Download Monitor - Version 4.5.93

Version Description

Download this release

Release Info

Developer raldea89
Plugin Icon 128x128 Download Monitor
Version 4.5.93
Comparing to
See all releases

Code changes from version 4.5.92 to 4.5.93

Files changed (123) hide show
  1. assets/blocks/src/blocks.js +165 -165
  2. assets/blocks/src/components/DownloadButton/index.js +67 -67
  3. assets/blocks/src/components/DownloadInput/index.js +33 -33
  4. assets/blocks/src/components/TemplateInput/index.js +22 -22
  5. assets/css/admin.css +1 -1
  6. assets/css/admin.less +7 -1
  7. assets/css/cart.less +87 -87
  8. assets/css/checkout.less +205 -205
  9. assets/css/gb-editor.less +10 -10
  10. assets/css/menu.css +1 -1
  11. assets/css/menu.less +18 -6
  12. assets/css/preview.less +18 -18
  13. assets/js/blockui.js +615 -615
  14. assets/js/chosen/chosen.css +413 -413
  15. assets/js/chosen/chosen.jquery.js +1090 -1090
  16. assets/js/chosen/chosen.jquery.min.js +9 -9
  17. assets/js/dlm-uninstall.js +69 -69
  18. assets/js/extensions.js +41 -41
  19. assets/js/insert-download.js +8 -8
  20. assets/js/legacy-upgrader/build/style.css +1 -1
  21. assets/js/legacy-upgrader/package.json +101 -101
  22. assets/js/legacy-upgrader/src/components/app.js +69 -69
  23. assets/js/legacy-upgrader/src/components/content/QueueItem.js +13 -13
  24. assets/js/legacy-upgrader/src/components/content/index.js +149 -149
  25. assets/js/legacy-upgrader/src/components/content/style.less +49 -49
  26. assets/js/legacy-upgrader/src/components/done/index.js +36 -36
  27. assets/js/legacy-upgrader/src/components/done/style.less +5 -5
  28. assets/js/legacy-upgrader/src/components/downloads/QueueItem.js +12 -12
  29. assets/js/legacy-upgrader/src/components/downloads/index.js +145 -145
  30. assets/js/legacy-upgrader/src/components/downloads/style.less +49 -49
  31. assets/js/legacy-upgrader/src/components/welcome/index.js +16 -16
  32. assets/js/legacy-upgrader/src/components/welcome/style.less +5 -5
  33. assets/js/legacy-upgrader/src/config.json +3 -3
  34. assets/js/legacy-upgrader/src/index.ejs +408 -408
  35. assets/js/legacy-upgrader/src/index.js +20 -20
  36. assets/js/legacy-upgrader/src/style/helpers.less +19 -19
  37. assets/js/legacy-upgrader/src/style/index.less +6 -6
  38. assets/js/legacy-upgrader/src/style/mixins.less +18 -18
  39. assets/js/legacy-upgrader/src/style/variables.less +5 -5
  40. assets/js/legacy-upgrader/webpack.config.babel.js +184 -184
  41. assets/js/notices.js +20 -20
  42. assets/js/onboarding.js +69 -69
  43. assets/js/select2/select2.min.css +1 -1
  44. assets/js/shop/admin-order-details.js +45 -45
  45. assets/js/shop/checkout.js +127 -127
  46. assets/views/notice-lu-upgrade.php +12 -12
  47. changelog.txt +12 -0
  48. download-monitor.php +6 -2
  49. includes/admin/class-dlm-beta-testers.php +157 -0
  50. includes/admin/class-dlm-review.php +1 -1
  51. includes/admin/class-dlm-welcome.php +0 -5
  52. includes/deprecated.php +37 -37
  53. includes/download-functions.php +15 -15
  54. includes/php-too-low.php +43 -43
  55. includes/submodules/banner/assets/css/wpchill-welcome.css +364 -364
  56. includes/submodules/banner/assets/img/star.svg +12 -12
  57. includes/submodules/banner/class-wpchill-welcome.php +260 -260
  58. includes/submodules/banner/readme.txt +1 -1
  59. readme.txt +1 -1
  60. src/Admin/CategoryWalker.php +52 -52
  61. src/Admin/CustomColumns.php +16 -7
  62. src/Admin/CustomLabels.php +59 -59
  63. src/Admin/OptionsUpsells.php +95 -95
  64. src/Admin/Settings/Fields/ActionButton.php +55 -55
  65. src/Admin/Settings/Fields/Desc.php +13 -13
  66. src/Admin/Settings/Fields/Title.php +29 -29
  67. src/Admin/Settings/Page.php +88 -21
  68. src/Admin/ViewManager.php +32 -32
  69. src/Ajax/Ajax.php +32 -32
  70. src/Ajax/GetDownloads.php +40 -40
  71. src/Ajax/Manager.php +84 -84
  72. src/AjaxHandler.php +286 -286
  73. src/Constants.php +15 -15
  74. src/CookieManager.php +67 -67
  75. src/DebugLogger.php +49 -49
  76. src/DownloadHandler.php +5 -4
  77. src/DownloadNoAccessPageEndpoint.php +40 -40
  78. src/DownloadPreview/Config.php +48 -48
  79. src/DownloadPreview/Preview.php +111 -111
  80. src/Hasher.php +102 -102
  81. src/Integrations/PostTypesOrder.php +20 -20
  82. src/Integrations/YoastSEO.php +26 -26
  83. src/LegacyUpgrader/Ajax.php +157 -157
  84. src/LegacyUpgrader/Checker.php +107 -107
  85. src/LegacyUpgrader/ContentQueue.php +115 -115
  86. src/LegacyUpgrader/ContentUpgrader.php +68 -68
  87. src/LegacyUpgrader/DownloadQueue.php +135 -135
  88. src/LegacyUpgrader/DownloadUpgrader.php +346 -346
  89. src/LegacyUpgrader/Message.php +47 -47
  90. src/LegacyUpgrader/Page.php +59 -59
  91. src/Polyfill/DateTimeImmutable/DateTimeInterface.php +28 -28
  92. src/Product/ProductErrorHandler.php +89 -89
  93. src/Product/ProductLicense.php +109 -109
  94. src/Search.php +50 -50
  95. src/Shop/Admin/ProductTableColumns.php +101 -3
  96. src/TaxonomyManager.php +98 -98
  97. src/TransientManager.php +32 -32
  98. src/Util/Onboarding.php +16 -51
  99. src/Utils.php +14 -1
  100. src/Version/VersionRepository.php +39 -39
  101. src/Widgets/Manager.php +22 -22
  102. templates/content-download-box.php +35 -35
  103. templates/content-download-filename.php +16 -16
  104. templates/content-download-no-version.php +12 -12
  105. templates/content-download-title.php +14 -14
  106. templates/content-download-version-list.php +31 -31
  107. templates/no-access.php +20 -20
  108. templates/pagination.php +33 -33
  109. templates/shop/cart/empty.php +6 -6
  110. templates/shop/checkout/empty.php +6 -6
  111. templates/shop/checkout/error.php +13 -13
  112. templates/shop/checkout/no-access.php +6 -6
  113. templates/shop/checkout/order-review-item.php +10 -10
  114. templates/shop/checkout/submit-button.php +5 -5
  115. templates/shop/email/elements/order-table-plain.php +10 -10
  116. templates/shop/email/elements/order-table.php +16 -16
  117. templates/shop/email/new-order-admin-plain.php +14 -14
  118. templates/shop/email/new-order-admin.php +57 -57
  119. templates/shop/email/new-order-plain.php +17 -17
  120. templates/shop/email/new-order.php +82 -82
  121. vendor/autoload.php +7 -7
  122. vendor/composer/LICENSE +21 -21
  123. vendor/composer/autoload_namespaces.php +9 -9
assets/blocks/src/blocks.js CHANGED
@@ -1,165 +1,165 @@
1
- //import 'whatwg-fetch';
2
- import Select from 'react-select';
3
-
4
- import { __ } from '@wordpress/i18n';
5
- import { registerBlockType } from '@wordpress/blocks';
6
- import { InspectorControls } from '@wordpress/block-editor';
7
- import { PanelBody } from '@wordpress/components';
8
- import { Fragment } from '@wordpress/element';
9
-
10
- import DownloadButton from './components/DownloadButton';
11
- import DownloadInput from './components/DownloadInput';
12
- import VersionInput from './components/VersionInput';
13
- import TemplateInput from './components/TemplateInput';
14
-
15
- //setLocaleData( window.gutenberg_dlm_blocks.localeData, 'download-monitor' );
16
-
17
- registerBlockType( 'download-monitor/download-button', {
18
- title: __( 'Download Button', 'download-monitor' ),
19
- icon: 'download',
20
- keywords: [
21
- __( 'download', 'download-monitor' ),
22
- 'download monitor',
23
- __( 'file', 'download-monitor' ),
24
- ],
25
- category: 'common',
26
- attributes: {
27
- download_id: {
28
- type: 'number',
29
- default: 0,
30
- },
31
- version_id: {
32
- type: 'number',
33
- default: 0,
34
- },
35
- template: {
36
- type: 'string',
37
- default: 'settings',
38
- },
39
- custom_template: {
40
- type: 'string',
41
- default: '',
42
- },
43
- autop: {
44
- type: 'number',
45
- default: 0,
46
- },
47
- },
48
- edit: ( props ) => {
49
- const {
50
- attributes: {
51
- download_id,
52
- version_id,
53
- template,
54
- custom_template,
55
- autop,
56
- },
57
- setAttributes,
58
- } = props;
59
-
60
- const valueFromId = ( opts, id ) =>
61
- opts.find( ( o ) => o.value === id );
62
- const autoPOptions = [
63
- { value: 0, label: 'No' },
64
- { value: 1, label: 'Yes' },
65
- ];
66
-
67
- return (
68
- <Fragment>
69
- <InspectorControls>
70
- <PanelBody
71
- title={ __(
72
- 'Download Information',
73
- 'download-monitor'
74
- ) }
75
- >
76
- <div className="components-base-control">
77
- <span className="components-base-control__label">
78
- { __( 'Download', 'download-monitor' ) }
79
- </span>
80
- <DownloadInput
81
- onChange={ ( v ) =>
82
- setAttributes( { download_id: v } )
83
- }
84
- selectedDownloadId={ download_id }
85
- />
86
- </div>
87
-
88
- <div className="components-base-control">
89
- <span className="components-base-control__label">
90
- { __( 'Version', 'download-monitor' ) }
91
- </span>
92
- <VersionInput
93
- onChange={ ( v ) =>
94
- setAttributes( { version_id: v } )
95
- }
96
- selectedVersionId={ version_id }
97
- downloadId={ download_id }
98
- />
99
- </div>
100
- </PanelBody>
101
-
102
- <PanelBody title={ __( 'Template', 'download-monitor' ) }>
103
- <div className="components-base-control dlmGbEditorTemplateWrapper">
104
- <span className="components-base-control__label">
105
- { __( 'Template', 'download-monitor' ) }
106
- </span>
107
- <TemplateInput
108
- onChange={ ( v ) =>
109
- setAttributes( { template: v } )
110
- }
111
- selectedTemplate={ template }
112
- templatesStr={ window.dlmBlocks.templates }
113
- />
114
- </div>
115
- { template === 'custom' && (
116
- <div className="components-base-control">
117
- <span className="components-base-control__label">
118
- { __(
119
- 'Custom Template',
120
- 'download-monitor'
121
- ) }
122
- </span>
123
- <input
124
- className="components-text-control__input"
125
- onChange={ ( e ) =>
126
- setAttributes( {
127
- custom_template: e.target.value,
128
- } )
129
- }
130
- value={ custom_template }
131
- />
132
- </div>
133
- ) }
134
- <div className="components-base-control dlmGbEditorTemplateWrapper">
135
- <span className="components-base-control__label">
136
- { __(
137
- 'Wrap in paragraph tag (<p>)?',
138
- 'download-monitor'
139
- ) }
140
- </span>
141
- <Select
142
- value={ valueFromId( autoPOptions, autop ) }
143
- onChange={ ( selectedOption ) => {
144
- setAttributes( {
145
- autop: selectedOption.value,
146
- } );
147
- } }
148
- options={ autoPOptions }
149
- isSearchable="false"
150
- />
151
- </div>
152
- </PanelBody>
153
- </InspectorControls>
154
-
155
- <DownloadButton
156
- download_id={ download_id }
157
- version_id={ version_id }
158
- template={ template }
159
- custom_template={ custom_template }
160
- />
161
- </Fragment>
162
- );
163
- },
164
- save: () => null,
165
- } );
1
+ //import 'whatwg-fetch';
2
+ import Select from 'react-select';
3
+
4
+ import { __ } from '@wordpress/i18n';
5
+ import { registerBlockType } from '@wordpress/blocks';
6
+ import { InspectorControls } from '@wordpress/block-editor';
7
+ import { PanelBody } from '@wordpress/components';
8
+ import { Fragment } from '@wordpress/element';
9
+
10
+ import DownloadButton from './components/DownloadButton';
11
+ import DownloadInput from './components/DownloadInput';
12
+ import VersionInput from './components/VersionInput';
13
+ import TemplateInput from './components/TemplateInput';
14
+
15
+ //setLocaleData( window.gutenberg_dlm_blocks.localeData, 'download-monitor' );
16
+
17
+ registerBlockType( 'download-monitor/download-button', {
18
+ title: __( 'Download Button', 'download-monitor' ),
19
+ icon: 'download',
20
+ keywords: [
21
+ __( 'download', 'download-monitor' ),
22
+ 'download monitor',
23
+ __( 'file', 'download-monitor' ),
24
+ ],
25
+ category: 'common',
26
+ attributes: {
27
+ download_id: {
28
+ type: 'number',
29
+ default: 0,
30
+ },
31
+ version_id: {
32
+ type: 'number',
33
+ default: 0,
34
+ },
35
+ template: {
36
+ type: 'string',
37
+ default: 'settings',
38
+ },
39
+ custom_template: {
40
+ type: 'string',
41
+ default: '',
42
+ },
43
+ autop: {
44
+ type: 'number',
45
+ default: 0,
46
+ },
47
+ },
48
+ edit: ( props ) => {
49
+ const {
50
+ attributes: {
51
+ download_id,
52
+ version_id,
53
+ template,
54
+ custom_template,
55
+ autop,
56
+ },
57
+ setAttributes,
58
+ } = props;
59
+
60
+ const valueFromId = ( opts, id ) =>
61
+ opts.find( ( o ) => o.value === id );
62
+ const autoPOptions = [
63
+ { value: 0, label: 'No' },
64
+ { value: 1, label: 'Yes' },
65
+ ];
66
+
67
+ return (
68
+ <Fragment>
69
+ <InspectorControls>
70
+ <PanelBody
71
+ title={ __(
72
+ 'Download Information',
73
+ 'download-monitor'
74
+ ) }
75
+ >
76
+ <div className="components-base-control">
77
+ <span className="components-base-control__label">
78
+ { __( 'Download', 'download-monitor' ) }
79
+ </span>
80
+ <DownloadInput
81
+ onChange={ ( v ) =>
82
+ setAttributes( { download_id: v } )
83
+ }
84
+ selectedDownloadId={ download_id }
85
+ />
86
+ </div>
87
+
88
+ <div className="components-base-control">
89
+ <span className="components-base-control__label">
90
+ { __( 'Version', 'download-monitor' ) }
91
+ </span>
92
+ <VersionInput
93
+ onChange={ ( v ) =>
94
+ setAttributes( { version_id: v } )
95
+ }
96
+ selectedVersionId={ version_id }
97
+ downloadId={ download_id }
98
+ />
99
+ </div>
100
+ </PanelBody>
101
+
102
+ <PanelBody title={ __( 'Template', 'download-monitor' ) }>
103
+ <div className="components-base-control dlmGbEditorTemplateWrapper">
104
+ <span className="components-base-control__label">
105
+ { __( 'Template', 'download-monitor' ) }
106
+ </span>
107
+ <TemplateInput
108
+ onChange={ ( v ) =>
109
+ setAttributes( { template: v } )
110
+ }
111
+ selectedTemplate={ template }
112
+ templatesStr={ window.dlmBlocks.templates }
113
+ />
114
+ </div>
115
+ { template === 'custom' && (
116
+ <div className="components-base-control">
117
+ <span className="components-base-control__label">
118
+ { __(
119
+ 'Custom Template',
120
+ 'download-monitor'
121
+ ) }
122
+ </span>
123
+ <input
124
+ className="components-text-control__input"
125
+ onChange={ ( e ) =>
126
+ setAttributes( {
127
+ custom_template: e.target.value,
128
+ } )
129
+ }
130
+ value={ custom_template }
131
+ />
132
+ </div>
133
+ ) }
134
+ <div className="components-base-control dlmGbEditorTemplateWrapper">
135
+ <span className="components-base-control__label">
136
+ { __(
137
+ 'Wrap in paragraph tag (<p>)?',
138
+ 'download-monitor'
139
+ ) }
140
+ </span>
141
+ <Select
142
+ value={ valueFromId( autoPOptions, autop ) }
143
+ onChange={ ( selectedOption ) => {
144
+ setAttributes( {
145
+ autop: selectedOption.value,
146
+ } );
147
+ } }
148
+ options={ autoPOptions }
149
+ isSearchable="false"
150
+ />
151
+ </div>
152
+ </PanelBody>
153
+ </InspectorControls>
154
+
155
+ <DownloadButton
156
+ download_id={ download_id }
157
+ version_id={ version_id }
158
+ template={ template }
159
+ custom_template={ custom_template }
160
+ />
161
+ </Fragment>
162
+ );
163
+ },
164
+ save: () => null,
165
+ } );
assets/blocks/src/components/DownloadButton/index.js CHANGED
@@ -1,67 +1,67 @@
1
- import { useState } from '@wordpress/element';
2
-
3
- const DownloadButton = ( {
4
- download_id,
5
- version_id,
6
- template,
7
- custom_template,
8
- } ) => {
9
- const [ calculatedHeight, setCalculatedHeight ] = useState( {
10
- cacheKey: '',
11
- height: 100,
12
- } );
13
-
14
- const getIframeUrl = () => {
15
- let iframeURL = window.dlmBlocks.urlButtonPreview;
16
-
17
- if ( download_id !== 0 ) {
18
- iframeURL += '&download_id=' + download_id;
19
- }
20
-
21
- if ( version_id !== 0 ) {
22
- iframeURL += '&version_id=' + version_id;
23
- }
24
-
25
- if ( template !== '' ) {
26
- iframeURL += '&template=' + template;
27
- }
28
-
29
- if ( custom_template !== '' ) {
30
- iframeURL += '&custom_template=' + custom_template;
31
- }
32
-
33
- return iframeURL;
34
- };
35
-
36
- const updateHeight = ( target ) => {
37
- const cacheKey = encodeURI( getIframeUrl() );
38
-
39
- // check if we need to reset height to new URL
40
- if ( calculatedHeight.chacheKey !== cacheKey ) {
41
- setCalculatedHeight( {
42
- cacheKey,
43
- height: target.contentDocument.getElementById(
44
- 'dlmPreviewContainer'
45
- ).scrollHeight,
46
- } );
47
- }
48
- };
49
-
50
- const iframeURL = getIframeUrl();
51
- const frameHeight = calculatedHeight.height + 'px';
52
-
53
- return (
54
- <div className="dlmPreviewButton">
55
- <iframe
56
- src={ iframeURL }
57
- width="100%"
58
- height={ frameHeight }
59
- onLoad={ ( e ) => {
60
- updateHeight( e.target );
61
- } }
62
- ></iframe>
63
- </div>
64
- );
65
- };
66
-
67
- export default DownloadButton;
1
+ import { useState } from '@wordpress/element';
2
+
3
+ const DownloadButton = ( {
4
+ download_id,
5
+ version_id,
6
+ template,
7
+ custom_template,
8
+ } ) => {
9
+ const [ calculatedHeight, setCalculatedHeight ] = useState( {
10
+ cacheKey: '',
11
+ height: 100,
12
+ } );
13
+
14
+ const getIframeUrl = () => {
15
+ let iframeURL = window.dlmBlocks.urlButtonPreview;
16
+
17
+ if ( download_id !== 0 ) {
18
+ iframeURL += '&download_id=' + download_id;
19
+ }
20
+
21
+ if ( version_id !== 0 ) {
22
+ iframeURL += '&version_id=' + version_id;
23
+ }
24
+
25
+ if ( template !== '' ) {
26
+ iframeURL += '&template=' + template;
27
+ }
28
+
29
+ if ( custom_template !== '' ) {
30
+ iframeURL += '&custom_template=' + custom_template;
31
+ }
32
+
33
+ return iframeURL;
34
+ };
35
+
36
+ const updateHeight = ( target ) => {
37
+ const cacheKey = encodeURI( getIframeUrl() );
38
+
39
+ // check if we need to reset height to new URL
40
+ if ( calculatedHeight.chacheKey !== cacheKey ) {
41
+ setCalculatedHeight( {
42
+ cacheKey,
43
+ height: target.contentDocument.getElementById(
44
+ 'dlmPreviewContainer'
45
+ ).scrollHeight,
46
+ } );
47
+ }
48
+ };
49
+
50
+ const iframeURL = getIframeUrl();
51
+ const frameHeight = calculatedHeight.height + 'px';
52
+
53
+ return (
54
+ <div className="dlmPreviewButton">
55
+ <iframe
56
+ src={ iframeURL }
57
+ width="100%"
58
+ height={ frameHeight }
59
+ onLoad={ ( e ) => {
60
+ updateHeight( e.target );
61
+ } }
62
+ ></iframe>
63
+ </div>
64
+ );
65
+ };
66
+
67
+ export default DownloadButton;
assets/blocks/src/components/DownloadInput/index.js CHANGED
@@ -1,33 +1,33 @@
1
- import Select from 'react-select';
2
-
3
- import { useEffect, useState } from '@wordpress/element';
4
- import apiFetch from '@wordpress/api-fetch';
5
-
6
- const DownloadInput = ( { selectedDownloadId, onChange } ) => {
7
- const [ downloads, setDownloads ] = useState( [] );
8
-
9
- useEffect( () => {
10
- apiFetch( { url: window.dlmBlocks.ajax_getDownloads } ).then(
11
- ( results ) => {
12
- setDownloads( results );
13
- }
14
- );
15
- }, [] );
16
-
17
- const valueFromId = ( opts, id ) => opts.find( ( o ) => o.value === id );
18
-
19
- return (
20
- <div>
21
- <Select
22
- value={ valueFromId( downloads, selectedDownloadId ) }
23
- onChange={ ( selectedOption ) =>
24
- onChange( selectedOption.value )
25
- }
26
- options={ downloads }
27
- isSearchable="true"
28
- />
29
- </div>
30
- );
31
- };
32
-
33
- export default DownloadInput;
1
+ import Select from 'react-select';
2
+
3
+ import { useEffect, useState } from '@wordpress/element';
4
+ import apiFetch from '@wordpress/api-fetch';
5
+
6
+ const DownloadInput = ( { selectedDownloadId, onChange } ) => {
7
+ const [ downloads, setDownloads ] = useState( [] );
8
+
9
+ useEffect( () => {
10
+ apiFetch( { url: window.dlmBlocks.ajax_getDownloads } ).then(
11
+ ( results ) => {
12
+ setDownloads( results );
13
+ }
14
+ );
15
+ }, [] );
16
+
17
+ const valueFromId = ( opts, id ) => opts.find( ( o ) => o.value === id );
18
+
19
+ return (
20
+ <div>
21
+ <Select
22
+ value={ valueFromId( downloads, selectedDownloadId ) }
23
+ onChange={ ( selectedOption ) =>
24
+ onChange( selectedOption.value )
25
+ }
26
+ options={ downloads }
27
+ isSearchable="true"
28
+ />
29
+ </div>
30
+ );
31
+ };
32
+
33
+ export default DownloadInput;
assets/blocks/src/components/TemplateInput/index.js CHANGED
@@ -1,22 +1,22 @@
1
- import Select from 'react-select';
2
-
3
- const TemplateInput = ( { templatesStr, selectedTemplate, onChange } ) => {
4
- const templates = JSON.parse( templatesStr );
5
-
6
- const valueFromId = ( opts, id ) => opts.find( ( o ) => o.value === id );
7
-
8
- return (
9
- <div>
10
- <Select
11
- value={ valueFromId( templates, selectedTemplate ) }
12
- onChange={ ( selectedOption ) =>
13
- onChange( selectedOption.value )
14
- }
15
- options={ templates }
16
- isSearchable="true"
17
- />
18
- </div>
19
- );
20
- };
21
-
22
- export default TemplateInput;
1
+ import Select from 'react-select';
2
+
3
+ const TemplateInput = ( { templatesStr, selectedTemplate, onChange } ) => {
4
+ const templates = JSON.parse( templatesStr );
5
+
6
+ const valueFromId = ( opts, id ) => opts.find( ( o ) => o.value === id );
7
+
8
+ return (
9
+ <div>
10
+ <Select
11
+ value={ valueFromId( templates, selectedTemplate ) }
12
+ onChange={ ( selectedOption ) =>
13
+ onChange( selectedOption.value )
14
+ }
15
+ options={ templates }
16
+ isSearchable="true"
17
+ />
18
+ </div>
19
+ );
20
+ };
21
+
22
+ export default TemplateInput;
assets/css/admin.css CHANGED
@@ -1 +1 @@
1
- .post-type-dlm_download h1 a.dlm-delete-logs{color:#a00}.post-type-dlm_download h1 a.dlm-delete-logs:hover{color:#fff;background:#a00;border-color:#7c0900}.post-type-dlm_download .dlm-page-header{border-bottom:1px solid #ccc;padding:15px 20px;display:flex;justify-content:space-between;background:#fff;width:calc(100% + 20px);box-sizing:border-box;margin-left:-20px}.post-type-dlm_download .dlm-page-header .dlm-header-links{margin-left:-20px}.post-type-dlm_download .dlm-page-header .dlm-header-links a span{vertical-align:middle;position:relative;top:-2px;padding-right:10px}.post-type-dlm_download .dlm-page-header .dlm-header-logo img{max-height:35px}.post-type-dlm_download td.column-shortcode .hidden{display:none}#dlm_logs td{padding:7px 7px;vertical-align:middle}#dlm_logs .check-column{width:1%;padding:0;vertical-align:middle}#dlm_logs .column-status{width:2%}#dlm_logs td.column-status{font-size:10px;vertical-align:middle;text-align:center}#dlm_logs td.column-status span{color:#fff;font-weight:400;-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%;height:18px;line-height:18px;width:18px;display:inline-block;background:url(../images/log-status-icons.png) top left no-repeat}#dlm_logs td.column-status .completed{background-color:#6cc644}#dlm_logs td.column-status .failed{background-color:#bd2c00;background-position-y:-18px}#dlm_logs td.column-status .redirected{background-color:#1c769b;background-position-y:-36px}#dlm_logs td.column-user_agent,#dlm_logs td.column-user_ip{font-family:monospace;font-weight:400}#dlm_logs span.dlm-description{font-weight:400}#dlm_logs .column-download,#dlm_logs .column-file,#dlm_logs .column-user,#dlm_logs .column-user_ua{width:16%!important}#dlm_logs .column-date,#dlm_logs .column-user_ip{width:6%!important}.post-type-dlm_download .inline-edit-row .inline-edit-col-dlm .inline-edit-col-dlm-inner{margin-top:10px}.dlm-settings-sub-nav{margin:0 0 10px 0;width:100%;border-bottom:1px solid #ccc;box-shadow:0 1px 1px rgba(0,0,0,.04)}.dlm-settings-sub-nav li{margin-right:10px;margin-bottom:-2px}.dlm-settings-sub-nav a{padding:13px;display:block}.dlm-settings-sub-nav .active-section{margin-bottom:-2px}.dlm-settings-sub-nav .active-section a{border-bottom:4px solid #000;padding-bottom:9px;margin-bottom:-2px;font-weight:600}.admin-color-blue .dlm-settings-sub-nav .active-section a{border-bottom-color:#096484}.admin-color-coffee .dlm-settings-sub-nav .active-section a{border-bottom-color:#c7a589}.admin-color-ectoplasm .dlm-settings-sub-nav .active-section a{border-bottom-color:#a3b745}.admin-color-midnight .dlm-settings-sub-nav .active-section a{border-bottom-color:#e14d43}.admin-color-ocean .dlm-settings-sub-nav .active-section a{border-bottom-color:#627c83}.admin-color-sunrise .dlm-settings-sub-nav .active-section a{border-bottom-color:#be3631}.admin-color-light .dlm-settings-sub-nav .active-section a{border-bottom-color:#888}.admin-color-evergreen .dlm-settings-sub-nav .active-section a{border-bottom-color:#36533f}.admin-color-mint .dlm-settings-sub-nav .active-section a{border-bottom-color:#4f6d59}.admin-color-modern .dlm-settings-sub-nav .active-section a{border-bottom-color:#3858e9}.dlm-admin-settings #setting-dlm_decimal_separator,.dlm-admin-settings #setting-dlm_thousand_separator{width:50px}.dlm-admin-settings table td{padding:15px 0}.dlm-admin-settings h3{margin:2em 0 0}ul.download_monitor_file_browser{list-style:none outside;margin:0;border:1px solid #ddd;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#f9f9f9;padding:5px 5px;-moz-box-shadow:inset 0 0 0 1px #fff;-webkit-box-shadow:inset 0 0 0 1px #fff;box-shadow:inset 0 0 0 1px #fff}ul.download_monitor_file_browser li{padding:0;margin:0}ul.download_monitor_file_browser li a{color:#21759b;display:block;padding:4px 0 4px 4px;text-decoration:none}ul.download_monitor_file_browser li a:hover{background-color:#eaf2fa}ul.download_monitor_file_browser li a:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f123";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.folder:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f318";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.filetype-3g2:before,ul.download_monitor_file_browser li a.filetype-3gp:before,ul.download_monitor_file_browser li a.filetype-asf:before,ul.download_monitor_file_browser li a.filetype-asx:before,ul.download_monitor_file_browser li a.filetype-avi:before,ul.download_monitor_file_browser li a.filetype-mov:before,ul.download_monitor_file_browser li a.filetype-mp4:before,ul.download_monitor_file_browser li a.filetype-mpg:before,ul.download_monitor_file_browser li a.filetype-rm:before,ul.download_monitor_file_browser li a.filetype-srt:before,ul.download_monitor_file_browser li a.filetype-vob:before,ul.download_monitor_file_browser li a.filetype-wmv:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f126";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.filetype-aif:before,ul.download_monitor_file_browser li a.filetype-iff:before,ul.download_monitor_file_browser li a.filetype-m3u:before,ul.download_monitor_file_browser li a.filetype-m4a:before,ul.download_monitor_file_browser li a.filetype-mid:before,ul.download_monitor_file_browser li a.filetype-midi:before,ul.download_monitor_file_browser li a.filetype-mp3:before,ul.download_monitor_file_browser li a.filetype-mpa:before,ul.download_monitor_file_browser li a.filetype-ra:before,ul.download_monitor_file_browser li a.filetype-wav:before,ul.download_monitor_file_browser li a.filetype-wma:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f127";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.filetype-ai:before,ul.download_monitor_file_browser li a.filetype-bmp:before,ul.download_monitor_file_browser li a.filetype-dds:before,ul.download_monitor_file_browser li a.filetype-eps:before,ul.download_monitor_file_browser li a.filetype-gif:before,ul.download_monitor_file_browser li a.filetype-ico:before,ul.download_monitor_file_browser li a.filetype-jpeg:before,ul.download_monitor_file_browser li a.filetype-jpg:before,ul.download_monitor_file_browser li a.filetype-png:before,ul.download_monitor_file_browser li a.filetype-ps:before,ul.download_monitor_file_browser li a.filetype-psd:before,ul.download_monitor_file_browser li a.filetype-pspimage:before,ul.download_monitor_file_browser li a.filetype-svg:before,ul.download_monitor_file_browser li a.filetype-tga:before,ul.download_monitor_file_browser li a.filetype-thm:before,ul.download_monitor_file_browser li a.filetype-tif:before,ul.download_monitor_file_browser li a.filetype-yuv:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f128";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li.nofiles{color:#999;font-style:italic;padding:4px 0}ul.download_monitor_file_browser li ul{list-style:none outside;margin:0;padding:0 0 0 28px}ul.download_monitor_file_browser li ul.loading{background:url(../images/ajax-loader.gif) no-repeat 24px 0;height:32px}table.wp-list-table .column-thumb{width:44px;text-align:center;white-space:nowrap}table.wp-list-table .column-dlm_download_cat,table.wp-list-table .column-dlm_download_tag,table.wp-list-table .column-file{width:11%!important}table.wp-list-table .column-file,table.wp-list-table .column-title{width:17%!important}table.wp-list-table .column-download_id,table.wp-list-table .column-version{width:5em}table.wp-list-table th.column-download_count span:first-child,table.wp-list-table th.column-featured span:first-child,table.wp-list-table th.column-locked_download span:first-child,table.wp-list-table th.column-redirect_only span:first-child,table.wp-list-table th.column-thumb span:first-child{float:none;display:inline-block;width:1em;height:1em;line-height:1em;padding:2px 0 0 0;overflow:hidden}table.wp-list-table th.column-download_count .sorting-indicator,table.wp-list-table th.column-featured .sorting-indicator,table.wp-list-table th.column-locked_download .sorting-indicator,table.wp-list-table th.column-redirect_only .sorting-indicator,table.wp-list-table th.column-thumb .sorting-indicator{float:right}table.wp-list-table th.column-thumb{width:52px;text-align:center}table.wp-list-table th.column-thumb span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f128";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-download_count{width:5em}table.wp-list-table th.column-download_count span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f346";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-locked_download{width:3.5em}table.wp-list-table th.column-locked_download span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f160";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-redirect_only{width:3.5em}table.wp-list-table th.column-redirect_only span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f103";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-featured{width:3.5em}table.wp-list-table th.column-featured span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f155";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table td.column-download_count,table.wp-list-table td.column-featured,table.wp-list-table td.column-locked_download,table.wp-list-table td.column-redirect_only{text-align:left;padding-left:11px}table.wp-list-table td.column-download_count span.na,table.wp-list-table td.column-featured span.na,table.wp-list-table td.column-locked_download span.na,table.wp-list-table td.column-redirect_only span.na{color:#999;width:1em;height:1em;line-height:1em;display:inline-block;overflow:hidden;vertical-align:middle}table.wp-list-table td.column-download_count span.na:before,table.wp-list-table td.column-featured span.na:before,table.wp-list-table td.column-locked_download span.na:before,table.wp-list-table td.column-redirect_only span.na:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f460";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table td.column-download_count span.yes,table.wp-list-table td.column-featured span.yes,table.wp-list-table td.column-locked_download span.yes,table.wp-list-table td.column-redirect_only span.yes{width:1em;height:1em;line-height:1em;display:inline-block;overflow:hidden;vertical-align:middle}table.wp-list-table td.column-download_count span.yes:before,table.wp-list-table td.column-featured span.yes:before,table.wp-list-table td.column-locked_download span.yes:before,table.wp-list-table td.column-redirect_only span.yes:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f147";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table .column-thumb img{padding:2px;margin:0;border:1px solid #dfdfdf;vertical-align:middle;width:32px;height:32px}#download-monitor-file .inside{padding:0;margin:0}#download-monitor-file .dlm-metaboxes-wrapper .close_all,#download-monitor-file .dlm-metaboxes-wrapper .expand_all{float:right;margin-left:1em;line-height:22px;text-decoration:none}#download-monitor-file .dlm-metaboxes-wrapper .expand_all:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f168";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .close_all:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f460";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper p.toolbar{margin:0!important;border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-file .dlm-metaboxes-wrapper p.toolbar a.button{float:left;margin:0}#download-monitor-file .dlm-metaboxes-wrapper .fr,#download-monitor-file .dlm-metaboxes-wrapper button.add_attribute,#download-monitor-file .dlm-metaboxes-wrapper button.add_variable_attribute,#download-monitor-file .dlm-metaboxes-wrapper select.attribute_taxonomy{float:right;margin:0 0 0 6px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metaboxes{padding:0 12px 0}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox-sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;margin:9px 0;border-width:1px;border-style:dashed}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox{background:#ececec;border:1px solid #ececec;margin:9px 0!important}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox .dlm-blury:before{content:url(../images/ajax-loader.gif);display:block;position:absolute;top:50%;transform:translateY(-50%);width:100%;left:0;margin:0 auto;color:#cecece;text-align:center;z-index:11;font-size:16px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox .dlm-blury:after{content:"";display:block;background:rgba(0,0,0,.5);width:100%;top:0;left:0;margin:0 auto;height:100%;z-index:10;position:absolute}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3{margin:0!important;padding:6px!important;font-size:1em!important;overflow:hidden;zoom:1;cursor:move}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 button{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 strong{line-height:24px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 select{font-family:sans-serif}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 .handlediv{background-position:6px 5px!important;display:none!important;height:24px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox:hover h3 .handlediv{display:block}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table{width:100%;position:relative;background:#fff;padding:3px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td{text-align:left;padding:6px 6px;vertical-align:top;border:0;line-height:26px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td label{text-align:left;display:block;line-height:21px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input{float:left;min-width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td textarea{width:100%;margin:0;display:block;font-size:14px;padding:4px;color:#555}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td textarea{height:7.5em}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td select{width:100%}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.short{width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.checkbox{width:auto;min-width:inherit;vertical-align:middle;display:inline;float:none}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.date-picker-field{width:50%;min-width:inherit;float:none;display:inline}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.hour,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.minute{width:2em;min-width:inherit;float:none;display:inline}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td.attribute_name{width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .minus,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .plus{margin-top:6px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .fl{float:left}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .fr{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox:first-child h3{background-color:#fafafa;border-bottom:1px solid #dcdcde}#download-monitor-file .dlm-metaboxes-wrapper .plus:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f132";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .minus:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f460";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .dlm_upload_file:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f317";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .dlm_media_library:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f104";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .dlm_browse_for_file{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm_browse_for_file:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f322";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-information .dlm_information_panel div p{overflow:hidden;width:100%;font-weight:700;box-sizing:border-box;line-height:28px;margin-bottom:5px}#download-monitor-information .dlm_information_panel input{margin:0;border-top-right-radius:0;border-bottom-right-radius:0;flex-grow:1;width:calc(100% - 45px)}#download-monitor-product-information .dlm_information_panel div p{overflow:hidden;width:100%;font-weight:700;box-sizing:border-box;line-height:28px;margin-bottom:5px}#download-monitor-product-information .dlm_information_panel input{margin:0;border-top-right-radius:0;border-bottom-right-radius:0;flex-grow:1;width:calc(100% - 45px)}#download-monitor-options .inside{padding:0;margin:0}#download-monitor-options .form-field-checkbox label{display:inline;padding:0 0 4px}#download-monitor-options .form-field-checkbox input{display:inline-block;width:auto;vertical-align:middle}#download-monitor-options .form-field-checkbox .dlm-description{padding:4px 0 0 0;display:block}#download-monitor-options .access_permissions{margin:0!important;border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-options .access_permissions h4{margin-bottom:.5em;margin:0 0 .5em}#download-monitor-options .access_permissions ul{background:#fff;border:1px solid #dfdfdf;height:110px;overflow:auto;padding:.5em .9em;margin:0}#download-monitor-options p{margin:0!important;border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-options p.not-active{opacity:.7}#download-monitor-options .options_upsell_link{color:unset;text-decoration:none}#download-monitor-options .dlm-upsell-badge{font-size:10px;background:#f4daa4;padding:2px 5px;display:inline-block;margin-left:5px;border-radius:10px}#insert-download{padding:20px 20px}#insert-download #drag-drop-area,#insert-download #insert-shortcode{margin:1em 0}#insert-download .error,#insert-download .updated{margin-left:0;margin-right:0}#insert-download h2{margin-top:0}#insert-download label{margin:0 0 .25em 0;display:block;font-size:1.1em}#insert-download span.description{display:block}#insert-download input.input{margin:0 0 .25em 0;display:block;width:100%;font-size:1.1em}#insert-download .add_link{float:right}#insert-download ul.page-numbers{overflow:hidden;zoom:1;margin:0 auto;padding:0;text-align:center}#insert-download ul.page-numbers li{display:inline-block;margin:0;list-style:none outside;line-height:1em}#insert-download ul.page-numbers li a,#insert-download ul.page-numbers li span{text-decoration:none;border:1px solid #ddd;-webkit-border-radius:4px;border-radius:4px;padding:8px;display:block}#insert-download ul.page-numbers li span{border-color:#eee}#insert-download legend{font-weight:700;display:block;margin:0 0 1em}#insert-download fieldset label{display:block;margin:0 0 .5em}.dlm-code-nginx-rules{display:block}.settings_panel .form-table td{padding-left:0}.settings_panel .dlm-lazy-select-loader{display:inline-block;vertical-align:middle;padding:0 0 0 3px}.settings_panel .dlm-lazy-select-loader img{display:inline-block;height:25px;width:25px;margin-top:1px}.dlm-reports h1 .dlm-reports-actions{float:right}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector,.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period,.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher{margin:0 5px;float:left}.dlm-reports h1 .dlm-reports-actions>:last-child{margin-right:0}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector{position:relative;font-size:14px;padding:0 .5em 0 1em;background:#fff;border:1px solid #ccc;border-radius:3px;user-select:none;cursor:pointer}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm-arrow:before{font-family:dashicons!important;content:"\f140";font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;font-size:1.6em;vertical-align:middle;margin-top:-2px}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay{display:block;width:466px;padding:10px;background:#fff;border:1px solid #ccc;position:absolute;top:30px;right:0;z-index:10;overflow:hidden}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date{font-size:70%;margin-right:5px;float:left;z-index:11}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline{border:0}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline .ui-state-highlight{background:#e6e6e6 url(../images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;color:#555;border:1px solid #d3d3d3}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline .ui-state-active{border:1px solid #aaa;background:#fff url(../images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline td,.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline th{padding:0;margin:0;line-height:2em}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline td a,.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline th a{text-align:center!important}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_actions{width:70px;padding-left:10px;text-align:center;float:left}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher{display:block;margin-top:1px;padding-top:4px;color:#23282d;text-decoration:none}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher:before{font-family:dashicons!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;font-size:1.4em}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher.dlm-line:before{content:"\f238"}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher.dlm-bar:before{content:"\f185"}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period a{border-color:#ccc!important}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period a:first-child{border-bottom-right-radius:0;border-top-right-radius:0;border-right:0}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period a:last-child{border-bottom-left-radius:0;border-top-left-radius:0;border-left:0}.dlm-reports .dlm_reports_loader{position:absolute;width:32px;height:32px;top:50%;left:50%;margin:-16px 0 0 -16px}.dlm-reports .dlm-reports-block-chart{width:100%;height:300px;margin-top:20px;background:#fff;border:1px solid #e5e5e5;overflow:hidden}.dlm-reports .dlm-reports-block-chart .chart-container h6{display:none}.dlm-reports .dlm-reports-block-summary #popular span{line-height:1em}.dlm-reports .dlm-reports-block{position:relative;box-sizing:border-box;width:100%;padding:20px 10px;margin-top:20px;background:#fff;border:1px solid #e5e5e5;overflow:hidden;float:left}.dlm-reports .dlm-reports-block.dlm-reports-block-half{width:49%;margin-right:1%}.dlm-reports .dlm-reports-block.dlm-reports-block-half-right{width:49%;margin-left:1%}.dlm-reports .dlm-reports-block .dlm-reports-placeholder-no-data{display:inline-block;width:100%;font-size:1.5em;color:#b4b9be;font-style:italic;text-align:center}.dlm-reports .dlm-reports-block ul{box-sizing:border-box;width:100%;padding:0;margin:0}.dlm-reports .dlm-reports-block ul li{display:inline-block;width:33%;padding:5px 0}.dlm-reports .dlm-reports-block ul li label,.dlm-reports .dlm-reports-block ul li span{display:block;width:100%;text-align:center}.dlm-reports .dlm-reports-block ul li span{font-size:2.5em;font-weight:700;padding:.5em 0 0}.dlm-reports .dlm-reports-block table{width:100%}.dlm-reports .dlm-reports-block table td,.dlm-reports .dlm-reports-block table th{text-align:center;padding:10px 0;border-bottom:1px solid #e5e5e5}.dlm-reports .dlm-reports-block table td:first-child,.dlm-reports .dlm-reports-block table th:first-child{text-align:left}.dlm-reports .dlm-reports-block table th{padding-bottom:20px}.dlm-reports-block-summary{background:#333!important;color:#fff}.post-type-dlm_product table.wp-list-table .column-title{width:65%!important}.dlm_mb_shop_product_information .dlm_shop_field_row{width:100%;overflow:hidden}.dlm_mb_shop_product_information .dlm_shop_field_row label.dlm_shop_field_label{display:inline-block;width:20%;height:100%;line-height:2.2em;float:left}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input{display:inline-block;width:50%;float:left}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .dlm_shop_input{width:100%;padding:5px 7px}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-selection--multiple{border:1px solid #ddd}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-search,.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-selection__choice{margin-bottom:0}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-search__field{padding-top:3px}.dlm-order-overview #dlm_empty_trash{margin-left:3px}.dlm-order-overview .wp-list-table td .column-id{width:25%}.dlm-order-details{max-width:1250px;margin-left:auto;margin-right:auto;padding-right:20px}.dlm-order-details h1{padding-bottom:25px}.dlm-order-details .dlm-order-details-main,.dlm-order-details .dlm-order-details-side{width:100%;float:left}.dlm-order-details .dlm-order-details-block{padding:0;margin-bottom:20px;line-height:1;border:1px solid #e5e5e5;background:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.dlm-order-details .dlm-order-details-block h2.dlm-order-details-block-title{font-size:14px;padding:8px 12px;margin:0;line-height:1.4;border-bottom:1px solid #eee}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside{margin:6px 0 0 0;padding:6px 12px 12px;line-height:1.4em;font-size:13px}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside label{display:block;font-weight:700;padding-bottom:6px}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside p{padding:0;margin:0}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside ul,.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside ul li{list-style:none;padding:0;margin:0}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside ul li{padding:6px 0}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside .dlm-order-details-current-state{width:70%;height:30px}.dlm-order-details .dlm-order-details-block.dlm-order-details-customer .dlm-order-details-customer-image{float:right}.dlm-order-details .dlm-order-details-block.dlm-order-details-customer ul li{margin-bottom:4px;padding:0}.dlm-order-details .dlm-order-details-block.dlm-order-details-customer ul li:first-child{font-weight:700}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items{overflow:hidden}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview{width:25%;float:right}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview td,.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview th{padding-top:1.5em;padding-bottom:1.5em;text-align:right}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview th{width:50%;font-weight:400}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview td{padding-right:1em;font-weight:700}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table{width:100%}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th{text-align:center}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td:first-child,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th:first-child{text-align:left;padding-left:.5em}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th{padding-top:.5em;padding-bottom:.5em;border-bottom:2px solid #c3c1bc}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td{padding-top:1.5em;padding-bottom:1.5em;border-bottom:1px solid #c3c1bc}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td.dlm-order-details-order-items-item-total,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th.dlm-order-details-order-items-item-total{text-align:right;padding-right:1em}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td.dlm-order-transaction-processor-id,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th.dlm-order-transaction-processor-id{display:none}.dlm-order-details .dlm-order-details-block .dlm-order-details-update-successful{font-size:2em;padding:.2em .3em;color:#46b450}@media (min-width:768px){.dlm-order-details .dlm-order-details-main{width:62%;float:left}.dlm-order-details .dlm-order-details-side{width:35%;float:right}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td.dlm-order-transaction-processor-id,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th.dlm-order-transaction-processor-id{display:table-cell}}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-one-col{margin:0 auto;max-width:680px}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-cta{margin-top:40px;text-align:center}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col{max-width:680px;margin:40px auto 0;overflow:hidden;display:flex;justify-content:space-between;flex-wrap:wrap}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col .dlm-onboarding-col{padding-top:2.5em;flex:1;align-self:flex-start;min-width:100%;max-width:100%}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col .dlm-onboarding-col img{width:100%}.dlm-onboarding .dlm-onboarding-section h2{margin:60px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.dlm-onboarding .dlm-onboarding-section p{max-width:55em;margin:.6em auto 0 auto}.dlm-onboarding .dlm-onboarding-section a.button-hero{height:46px;font-size:14px;line-height:44px;padding:0 36px;font-weight:700;text-align:center}.dlm-onboarding .dlm-onboarding-pages{max-width:55em;margin:0 auto;padding:2em 0 0}.dlm-onboarding .dlm-onboarding-pages a.button-hero{width:170px}.dlm-onboarding .dlm-onboarding-pages a.button-hero.dlm-page-exists{background:#46b450;border-color:#46b450 #4a8442 #467a3f;box-shadow:0 2px 0 #467a3f;text-shadow:0 -1px 1px #4a8442,1px 0 1px #4a8442,0 1px 1px #4a8442,-1px 0 1px #4a8442}.dlm-onboarding .dlm-onboarding-pages a.button-hero.dlm-page-exists:active{box-shadow:0 2px 0 #467a3f}.dlm-onboarding .dlm-onboarding-pages td,.dlm-onboarding .dlm-onboarding-pages th{padding:1em 0;border-bottom:1px solid #ccc}.dlm-onboarding .dlm-onboarding-pages th{width:13%;min-width:6em;text-align:left}.dlm-onboarding .dlm-onboarding-pages td{padding-right:.5em;padding-left:.5em}.dlm-onboarding .dlm-onboarding-pages td.dlm-onboarding-pages-page-title{font-weight:700}@media (min-width:768px){.dlm-onboarding .dlm-onboarding-section .dlm-onboarding-pages{width:55em}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col .dlm-onboarding-col{padding-top:0;min-width:31%;max-width:31%}}.dlm_extensions_wrap a.dlm-reload-button{float:right;position:relative;top:-40px}.dlm_extensions_wrap #available-extensions{clear:both}.dlm_extensions_wrap .dlm_extensions{padding:15px 0;overflow:hidden}.dlm_extensions_wrap .dlm_extensions .dlm_extension{background-color:#fff;width:calc(20% - 15px);margin:0 15px 15px 0;display:inline-block;vertical-align:top}.dlm_extensions_wrap .dlm_extensions .dlm_extension p{margin:0}.dlm_extensions_wrap .dlm_extensions .dlm_extension a{color:#444;text-decoration:none}.dlm_extensions_wrap .dlm_extensions .dlm_extension .dlm_extension_img_wrapper{width:100%;background:#419ccb;text-align:center}.dlm_extensions_wrap .dlm_extensions .dlm_extension .dlm_extension_img_wrapper img{max-width:100%;margin:0 auto}.dlm_extensions_wrap .dlm_extensions .dlm_extension h3{padding:0 20px}.dlm_extensions_wrap .dlm_extensions .dlm_extension div.extension-desc{min-height:120px;padding:0 20px}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer{padding:15px 15px 15px 0;text-align:right;background-color:#fafafa;border-top:1px solid #dcdcde}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .loop_price{font-weight:700}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .loop_price.sale{color:green}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .loop_price.sale strike{color:#444}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .button .dashicons{vertical-align:middle;font-size:16px}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license{padding:0 20px 20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license div.dlm_license_error{padding:.5em;margin-bottom:15px;background:#ffffe0}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license div.dlm_license_error a{color:#00f;text-decoration:underline}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license p.license-status{padding:5px 0;margin:5px 0;background:red;font-weight:700;font-size:1.2em;color:#fff;text-align:center}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license p.license-status.active{background:green}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license input{width:100%;margin:7px 0;padding:7px}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license a.button-primary{width:100%;margin:5px auto 0;color:#fff;text-align:center}#ui-datepicker-div{display:none}.wpchill-upsell{background:#fff;border:0;padding:15px;margin-top:30px}.wpchill-upsell .wpchill-upsell-features{text-align:left;display:flex;flex-wrap:wrap;padding:20px 0}.wpchill-upsell .wpchill-upsell-features li{width:33%}.wpchill-upsell a:first-child{margin-right:10px}.wpchill-upsells-wrapper{width:100%}.wrap.dlm-admin-settings .form-table{width:65%;float:left}.wrap.dlm-admin-settings .form-table+.wpchill-upsells-wrapper{width:30%;float:right}.wrap.dlm-admin-settings .form-table .dlm_htaccess_notice{margin-bottom:5px}.wrap.dlm-admin-settings .dlm-upsell-badge{font-size:10px;background:#f4daa4;padding:2px 5px;display:inline-block;margin-left:10px;border-radius:10px}.wrap.dlm-admin-settings #setting-dlm_downloads_path+p strong{color:red}#total_downloads_browser_table a.nav-tab{text-transform:capitalize}#dlm-amazon-s3-upsell .inside,#dlm-buttons-upsell .inside,#dlm-download-page-upsell .inside,#dlm-google-drive-upsell .inside{display:flex;flex-wrap:wrap;background:#f1f1f1}#dlm-amazon-s3-upsell .inside .wpchill-upsell,#dlm-buttons-upsell .inside .wpchill-upsell,#dlm-download-page-upsell .inside .wpchill-upsell,#dlm-google-drive-upsell .inside .wpchill-upsell{background:0 0;text-align:center;width:100%;margin-top:0}#dlm-amazon-s3-upsell .inside,#dlm-buttons-upsell .inside,#dlm-download-page-upsell .inside,#dlm-google-drive-upsell .inside{margin:0;padding:0}.upsells-columns{display:flex;flex-wrap:wrap;align-items:center;align-content:center}.upsells-columns .upsells-columns-2{width:50%;text-align:center;display:flex;align-items:center;align-content:center}.upsells-columns .upsells-column{width:100%;text-align:center;display:flex;align-items:center;align-content:center}.upsells-columns .upsells-column>*{display:inline-block;align-content:center;vertical-align:middle;margin:0 15px;padding:10px 0}.upsells-columns .upsells-column>.wpchill-upsell{position:relative;float:none;flex-grow:1;display:flex;align-items:center}.upsells-columns .upsells-column>.wpchill-upsell .wpchill-upsell-description{margin:0 auto}.upsells-columns .upsells-column h3{line-height:1.3em}.upsells-columns .upsells-column:last-child{border-top:1px solid #c3c4c7;border-bottom:1px solid #c3c4c7}.upsells-columns .wpchill-upsell{margin-top:0}.dlm_download_page_dlm-extensions .theme.dlm_extension{background-color:#fff}body.rsvp_page_rsvp-upgrade-to-pro #wpcontent .wrap{margin-left:0;max-width:85%}.rsvp-lite-vs-premium,.rsvp-lite-vs-premium p{font-size:14px;margin:0}.rsvp-lite-vs-premium>.wpchill-plans-table.wpchill-highlight>.wpchill-pricing-package{background:#fefff0;box-shadow:0 0 15px rgb(208 219 219)}.rsvp-lite-vs-premium .wp-badge{display:inline-block;vertical-align:middle;position:relative;margin-right:2.5%}.rsvp-lite-vs-premium h3{display:block;position:relative;font-size:16px;margin:0}.rsvp-lite-vs-premium .wpchill-plans-table{display:flex}.rsvp-lite-vs-premium .wpchill-plans-table.table-header{margin-top:50px;border-top:0}.rsvp-lite-vs-premium .wpchill-plans-table.table-header .wpchill-pricing-package{border:0}.rsvp-lite-vs-premium .wpchill-plans-table.table-header .wpchill-pricing-package.wpchill-title.wpchill-highlight::before,.rsvp-lite-vs-premium .wpchill-plans-table.table-header .wpchill-pricing-package:not(.wpchill-modula-lite):last-child:before{content:'';width:auto;display:inline-block;opacity:1;position:absolute;top:-1px;background:#41495b;text-align:center;left:0;right:0;color:#fff;font-size:15px;text-transform:uppercase;padding:10px 5px;transform:translateY(-100%)}.rsvp-lite-vs-premium.table-footer .wpchill-pricing-package:last-child{border:0}.rsvp-lite-vs-premium .wpchill-pricing-package{text-align:center;line-height:1.5;padding:10px 15px;display:flex;align-content:center;align-items:center;justify-content:center;background:#fff;border-top:1px solid #ccc;width:32%}.rsvp-lite-vs-premium .wpchill-pricing-package:not(:first-child){max-width:300px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title{font-weight:400;color:#666;font-size:1.25rem;height:auto;-ms-flex-direction:column;flex-direction:column;padding-top:30px;padding-bottom:30px;justify-content:space-between;position:relative}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-name{margin:0;font-size:36px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title.wpchill-modula-lite{justify-content:center}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title p.description{font-style:italic;font-size:13px;margin-bottom:40px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price p:last-child{font-size:30px;margin:0 0 40px 0}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price p.old-price{margin:0;position:relative}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price p.old-price:after{content:"";height:2px;width:60px;background:red;display:block;position:absolute;left:50%;top:52%;transform:translate(-50%,-50%)}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price sup{top:2px;position:relative;font-size:15px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-empty{background:0 0;border-color:transparent}.rsvp-lite-vs-premium .wpchill-pricing-package.feature-name{justify-content:space-between;font-weight:400;text-align:left;font-size:13px;display:block;background:0 0}.rsvp-lite-vs-premium .wpchill-pricing-package .dashicons-saved{color:green}.rsvp-lite-vs-premium .wpchill-pricing-package .dashicons{width:30px;height:30px;font-size:30px}.rsvp-lite-vs-premium .wpchill-pricing-package .dashicons-no-alt{color:#ff3439}.rsvp-lite-vs-premium .wpchill-pricing-package:last-child{background:#fefff0}.rsvp-lite-vs-premium .button .dashicons{font-size:16px;vertical-align:middle;line-height:26px}.wpchill-tooltip{position:relative;display:inline-block;float:left;margin-right:10px}.wpchill-tooltip>span{cursor:pointer;color:#0073aa;text-decoration:underline;margin-left:5px}.wpchill-tooltip .wpchill-tooltip-content{display:none;position:absolute;top:50%;right:-10px;transform:translate(100%,-50%);width:300px;background:#000;color:#fff;padding:10px;box-sizing:border-box;z-index:99}.wpchill-tooltip:hover .wpchill-tooltip-content{display:block}.wpchill-tooltip .wpchill-tooltip-content:before{content:'';width:0;height:0;border-style:solid;border-width:8px 8px 8px 0;border-color:transparent #000 transparent transparent;display:block;position:absolute;top:50%;left:-8px;transform:translateY(-50%)}.wpchill-tooltip-button{position:relative}.wpchill-tooltip-button .wpchill-tooltip-content{display:none;position:absolute;top:50%;right:25px;transform:translate(50%,-135%);width:auto;background:rgba(0,0,0,.8);color:#fff;padding:10px 15px;box-sizing:border-box;font-size:14px;z-index:99}.wpchill-tooltip-button:hover .wpchill-tooltip-content{display:block}.wpchill-tooltip-button .wpchill-tooltip-content:before{content:'';width:0;height:0;border-style:solid;border-width:8px 8px 8px 0;border-color:transparent #000 transparent transparent;display:block;position:absolute;bottom:-12px;left:50%;transform:rotate(-90deg)}.dlm-file-link{display:block;margin-top:3px}
1
+ .post-type-dlm_download h1 a.dlm-delete-logs{color:#a00}.post-type-dlm_download h1 a.dlm-delete-logs:hover{color:#fff;background:#a00;border-color:#7c0900}.post-type-dlm_download .dlm-page-header{border-bottom:1px solid #ccc;padding:15px 20px;display:flex;justify-content:space-between;background:#fff;width:calc(100% + 20px);box-sizing:border-box;margin-left:-20px}.post-type-dlm_download .dlm-page-header .dlm-header-links{margin-left:-20px}.post-type-dlm_download .dlm-page-header .dlm-header-links a span{vertical-align:middle;position:relative;top:-2px;padding-right:10px}.post-type-dlm_download .dlm-page-header .dlm-header-logo img{max-height:35px}.post-type-dlm_download td.column-shortcode .hidden{display:none}#dlm_logs td{padding:7px 7px;vertical-align:middle}#dlm_logs .check-column{width:1%;padding:0;vertical-align:middle}#dlm_logs .column-status{width:2%}#dlm_logs td.column-status{font-size:10px;vertical-align:middle;text-align:center}#dlm_logs td.column-status span{color:#fff;font-weight:400;-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%;height:18px;line-height:18px;width:18px;display:inline-block;background:url(../images/log-status-icons.png) top left no-repeat}#dlm_logs td.column-status .completed{background-color:#6cc644}#dlm_logs td.column-status .failed{background-color:#bd2c00;background-position-y:-18px}#dlm_logs td.column-status .redirected{background-color:#1c769b;background-position-y:-36px}#dlm_logs td.column-user_agent,#dlm_logs td.column-user_ip{font-family:monospace;font-weight:400}#dlm_logs span.dlm-description{font-weight:400}#dlm_logs .column-download,#dlm_logs .column-file,#dlm_logs .column-user,#dlm_logs .column-user_ua{width:16%!important}#dlm_logs .column-date,#dlm_logs .column-user_ip{width:6%!important}.post-type-dlm_download .inline-edit-row .inline-edit-col-dlm .inline-edit-col-dlm-inner{margin-top:10px}.dlm-settings-sub-nav{margin:0 0 10px 0;width:100%;border-bottom:1px solid #ccc;box-shadow:0 1px 1px rgba(0,0,0,.04)}.dlm-settings-sub-nav li{margin-right:10px;margin-bottom:-2px}.dlm-settings-sub-nav a{padding:13px;display:block}.dlm-settings-sub-nav .active-section{margin-bottom:-2px}.dlm-settings-sub-nav .active-section a{border-bottom:4px solid #000;padding-bottom:9px;margin-bottom:-2px;font-weight:600}.admin-color-blue .dlm-settings-sub-nav .active-section a{border-bottom-color:#096484}.admin-color-coffee .dlm-settings-sub-nav .active-section a{border-bottom-color:#c7a589}.admin-color-ectoplasm .dlm-settings-sub-nav .active-section a{border-bottom-color:#a3b745}.admin-color-midnight .dlm-settings-sub-nav .active-section a{border-bottom-color:#e14d43}.admin-color-ocean .dlm-settings-sub-nav .active-section a{border-bottom-color:#627c83}.admin-color-sunrise .dlm-settings-sub-nav .active-section a{border-bottom-color:#be3631}.admin-color-light .dlm-settings-sub-nav .active-section a{border-bottom-color:#888}.admin-color-evergreen .dlm-settings-sub-nav .active-section a{border-bottom-color:#36533f}.admin-color-mint .dlm-settings-sub-nav .active-section a{border-bottom-color:#4f6d59}.admin-color-modern .dlm-settings-sub-nav .active-section a{border-bottom-color:#3858e9}.dlm-admin-settings #setting-dlm_decimal_separator,.dlm-admin-settings #setting-dlm_thousand_separator{width:50px}.dlm-admin-settings table td{padding:15px 0}.dlm-admin-settings h3{margin:2em 0 0}ul.download_monitor_file_browser{list-style:none outside;margin:0;border:1px solid #ddd;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#f9f9f9;padding:5px 5px;-moz-box-shadow:inset 0 0 0 1px #fff;-webkit-box-shadow:inset 0 0 0 1px #fff;box-shadow:inset 0 0 0 1px #fff}ul.download_monitor_file_browser li{padding:0;margin:0}ul.download_monitor_file_browser li a{color:#21759b;display:block;padding:4px 0 4px 4px;text-decoration:none}ul.download_monitor_file_browser li a:hover{background-color:#eaf2fa}ul.download_monitor_file_browser li a:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f123";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.folder:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f318";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.filetype-3g2:before,ul.download_monitor_file_browser li a.filetype-3gp:before,ul.download_monitor_file_browser li a.filetype-asf:before,ul.download_monitor_file_browser li a.filetype-asx:before,ul.download_monitor_file_browser li a.filetype-avi:before,ul.download_monitor_file_browser li a.filetype-mov:before,ul.download_monitor_file_browser li a.filetype-mp4:before,ul.download_monitor_file_browser li a.filetype-mpg:before,ul.download_monitor_file_browser li a.filetype-rm:before,ul.download_monitor_file_browser li a.filetype-srt:before,ul.download_monitor_file_browser li a.filetype-vob:before,ul.download_monitor_file_browser li a.filetype-wmv:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f126";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.filetype-aif:before,ul.download_monitor_file_browser li a.filetype-iff:before,ul.download_monitor_file_browser li a.filetype-m3u:before,ul.download_monitor_file_browser li a.filetype-m4a:before,ul.download_monitor_file_browser li a.filetype-mid:before,ul.download_monitor_file_browser li a.filetype-midi:before,ul.download_monitor_file_browser li a.filetype-mp3:before,ul.download_monitor_file_browser li a.filetype-mpa:before,ul.download_monitor_file_browser li a.filetype-ra:before,ul.download_monitor_file_browser li a.filetype-wav:before,ul.download_monitor_file_browser li a.filetype-wma:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f127";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.filetype-ai:before,ul.download_monitor_file_browser li a.filetype-bmp:before,ul.download_monitor_file_browser li a.filetype-dds:before,ul.download_monitor_file_browser li a.filetype-eps:before,ul.download_monitor_file_browser li a.filetype-gif:before,ul.download_monitor_file_browser li a.filetype-ico:before,ul.download_monitor_file_browser li a.filetype-jpeg:before,ul.download_monitor_file_browser li a.filetype-jpg:before,ul.download_monitor_file_browser li a.filetype-png:before,ul.download_monitor_file_browser li a.filetype-ps:before,ul.download_monitor_file_browser li a.filetype-psd:before,ul.download_monitor_file_browser li a.filetype-pspimage:before,ul.download_monitor_file_browser li a.filetype-svg:before,ul.download_monitor_file_browser li a.filetype-tga:before,ul.download_monitor_file_browser li a.filetype-thm:before,ul.download_monitor_file_browser li a.filetype-tif:before,ul.download_monitor_file_browser li a.filetype-yuv:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f128";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li.nofiles{color:#999;font-style:italic;padding:4px 0}ul.download_monitor_file_browser li ul{list-style:none outside;margin:0;padding:0 0 0 28px}ul.download_monitor_file_browser li ul.loading{background:url(../images/ajax-loader.gif) no-repeat 24px 0;height:32px}table.wp-list-table .column-thumb{width:44px;text-align:center;white-space:nowrap}table.wp-list-table .column-dlm_download_cat,table.wp-list-table .column-dlm_download_tag,table.wp-list-table .column-file{width:11%!important}table.wp-list-table .column-file,table.wp-list-table .column-title{width:17%!important}table.wp-list-table .column-download_id,table.wp-list-table .column-version{width:5em}table.wp-list-table th.column-download_count span:first-child,table.wp-list-table th.column-featured span:first-child,table.wp-list-table th.column-locked_download span:first-child,table.wp-list-table th.column-redirect_only span:first-child,table.wp-list-table th.column-thumb span:first-child{float:none;display:inline-block;width:1em;height:1em;line-height:1em;padding:2px 0 0 0;overflow:hidden}table.wp-list-table th.column-download_count .sorting-indicator,table.wp-list-table th.column-featured .sorting-indicator,table.wp-list-table th.column-locked_download .sorting-indicator,table.wp-list-table th.column-redirect_only .sorting-indicator,table.wp-list-table th.column-thumb .sorting-indicator{float:right}table.wp-list-table th.column-thumb{width:52px;text-align:center}table.wp-list-table th.column-thumb span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f128";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-download_count{width:5em}table.wp-list-table th.column-download_count span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f346";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-locked_download{width:3.5em}table.wp-list-table th.column-locked_download span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f160";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-redirect_only{width:3.5em}table.wp-list-table th.column-redirect_only span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f103";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-featured{width:3.5em}table.wp-list-table th.column-featured span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f155";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table td.column-download_count,table.wp-list-table td.column-featured,table.wp-list-table td.column-locked_download,table.wp-list-table td.column-redirect_only{text-align:left;padding-left:11px}table.wp-list-table td.column-download_count span.na,table.wp-list-table td.column-featured span.na,table.wp-list-table td.column-locked_download span.na,table.wp-list-table td.column-redirect_only span.na{color:#999;width:1em;height:1em;line-height:1em;display:inline-block;overflow:hidden;vertical-align:middle}table.wp-list-table td.column-download_count span.na:before,table.wp-list-table td.column-featured span.na:before,table.wp-list-table td.column-locked_download span.na:before,table.wp-list-table td.column-redirect_only span.na:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f460";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table td.column-download_count span.yes,table.wp-list-table td.column-featured span.yes,table.wp-list-table td.column-locked_download span.yes,table.wp-list-table td.column-redirect_only span.yes{width:1em;height:1em;line-height:1em;display:inline-block;overflow:hidden;vertical-align:middle}table.wp-list-table td.column-download_count span.yes:before,table.wp-list-table td.column-featured span.yes:before,table.wp-list-table td.column-locked_download span.yes:before,table.wp-list-table td.column-redirect_only span.yes:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f147";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table .column-thumb img{padding:2px;margin:0;border:1px solid #dfdfdf;vertical-align:middle;width:32px;height:32px}#download-monitor-file .inside{padding:0;margin:0}#download-monitor-file .dlm-metaboxes-wrapper .close_all,#download-monitor-file .dlm-metaboxes-wrapper .expand_all{float:right;margin-left:1em;line-height:22px;text-decoration:none}#download-monitor-file .dlm-metaboxes-wrapper .expand_all:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f168";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .close_all:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f460";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper p.toolbar{margin:0!important;border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-file .dlm-metaboxes-wrapper p.toolbar a.button{float:left;margin:0}#download-monitor-file .dlm-metaboxes-wrapper .fr,#download-monitor-file .dlm-metaboxes-wrapper button.add_attribute,#download-monitor-file .dlm-metaboxes-wrapper button.add_variable_attribute,#download-monitor-file .dlm-metaboxes-wrapper select.attribute_taxonomy{float:right;margin:0 0 0 6px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metaboxes{padding:0 12px 0}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox-sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;margin:9px 0;border-width:1px;border-style:dashed}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox{background:#ececec;border:1px solid #ececec;margin:9px 0!important}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox .dlm-blury:before{content:url(../images/ajax-loader.gif);display:block;position:absolute;top:50%;transform:translateY(-50%);width:100%;left:0;margin:0 auto;color:#cecece;text-align:center;z-index:11;font-size:16px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox .dlm-blury:after{content:"";display:block;background:rgba(0,0,0,.5);width:100%;top:0;left:0;margin:0 auto;height:100%;z-index:10;position:absolute}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3{margin:0!important;padding:6px!important;font-size:1em!important;overflow:hidden;zoom:1;cursor:move}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 button{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 strong{line-height:24px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 select{font-family:sans-serif}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 .handlediv{background-position:6px 5px!important;display:none!important;height:24px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox:hover h3 .handlediv{display:block}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table{width:100%;position:relative;background:#fff;padding:3px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td{text-align:left;padding:6px 6px;vertical-align:top;border:0;line-height:26px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td label{text-align:left;display:block;line-height:21px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input{float:left;min-width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td textarea{width:100%;margin:0;display:block;font-size:14px;padding:4px;color:#555}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td textarea{height:7.5em}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td select{width:100%}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.short{width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.checkbox{width:auto;min-width:inherit;vertical-align:middle;display:inline;float:none}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.date-picker-field{width:50%;min-width:inherit;float:none;display:inline}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.hour,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.minute{width:2em;min-width:inherit;float:none;display:inline}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td.attribute_name{width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .minus,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .plus{margin-top:6px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .fl{float:left}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .fr{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox:first-child h3{background-color:#fafafa;border-bottom:1px solid #dcdcde}#download-monitor-file .dlm-metaboxes-wrapper .plus:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f132";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .minus:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f460";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .dlm_upload_file:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f317";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .dlm_media_library:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f104";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .dlm_browse_for_file{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm_browse_for_file:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f322";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-information .dlm_information_panel div p{overflow:hidden;width:100%;font-weight:700;box-sizing:border-box;line-height:28px;margin-bottom:5px}#download-monitor-information .dlm_information_panel input{margin:0;border-top-right-radius:0;border-bottom-right-radius:0;flex-grow:1;width:calc(100% - 45px)}#download-monitor-product-information .dlm_information_panel div p{overflow:hidden;width:100%;font-weight:700;box-sizing:border-box;line-height:28px;margin-bottom:5px}#download-monitor-product-information .dlm_information_panel input{margin:0;border-top-right-radius:0;border-bottom-right-radius:0;flex-grow:1;width:calc(100% - 45px)}#download-monitor-options .inside{padding:0;margin:0}#download-monitor-options .form-field-checkbox label{display:inline;padding:0 0 4px}#download-monitor-options .form-field-checkbox input{display:inline-block;width:auto;vertical-align:middle}#download-monitor-options .form-field-checkbox .dlm-description{padding:4px 0 0 0;display:block}#download-monitor-options .access_permissions{margin:0!important;border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-options .access_permissions h4{margin-bottom:.5em;margin:0 0 .5em}#download-monitor-options .access_permissions ul{background:#fff;border:1px solid #dfdfdf;height:110px;overflow:auto;padding:.5em .9em;margin:0}#download-monitor-options p{margin:0!important;border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-options p.not-active{opacity:.7}#download-monitor-options .options_upsell_link{color:unset;text-decoration:none}#download-monitor-options .dlm-upsell-badge{font-size:10px;background:#f4daa4;padding:2px 5px;display:inline-block;margin-left:5px;border-radius:10px}#insert-download{padding:20px 20px}#insert-download #drag-drop-area,#insert-download #insert-shortcode{margin:1em 0}#insert-download .error,#insert-download .updated{margin-left:0;margin-right:0}#insert-download h2{margin-top:0}#insert-download label{margin:0 0 .25em 0;display:block;font-size:1.1em}#insert-download span.description{display:block}#insert-download input.input{margin:0 0 .25em 0;display:block;width:100%;font-size:1.1em}#insert-download .add_link{float:right}#insert-download ul.page-numbers{overflow:hidden;zoom:1;margin:0 auto;padding:0;text-align:center}#insert-download ul.page-numbers li{display:inline-block;margin:0;list-style:none outside;line-height:1em}#insert-download ul.page-numbers li a,#insert-download ul.page-numbers li span{text-decoration:none;border:1px solid #ddd;-webkit-border-radius:4px;border-radius:4px;padding:8px;display:block}#insert-download ul.page-numbers li span{border-color:#eee}#insert-download legend{font-weight:700;display:block;margin:0 0 1em}#insert-download fieldset label{display:block;margin:0 0 .5em}.dlm-code-nginx-rules{display:block}.settings_panel .form-table td{padding-left:0}.settings_panel .dlm-lazy-select-loader{display:inline-block;vertical-align:middle;padding:0 0 0 3px}.settings_panel .dlm-lazy-select-loader img{display:inline-block;height:25px;width:25px;margin-top:1px}.dlm-reports h1 .dlm-reports-actions{float:right}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector,.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period,.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher{margin:0 5px;float:left}.dlm-reports h1 .dlm-reports-actions>:last-child{margin-right:0}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector{position:relative;font-size:14px;padding:0 .5em 0 1em;background:#fff;border:1px solid #ccc;border-radius:3px;user-select:none;cursor:pointer}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm-arrow:before{font-family:dashicons!important;content:"\f140";font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;font-size:1.6em;vertical-align:middle;margin-top:-2px}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay{display:block;width:466px;padding:10px;background:#fff;border:1px solid #ccc;position:absolute;top:30px;right:0;z-index:10;overflow:hidden}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date{font-size:70%;margin-right:5px;float:left;z-index:11}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline{border:0}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline .ui-state-highlight{background:#e6e6e6 url(../images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;color:#555;border:1px solid #d3d3d3}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline .ui-state-active{border:1px solid #aaa;background:#fff url(../images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline td,.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline th{padding:0;margin:0;line-height:2em}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline td a,.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline th a{text-align:center!important}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_actions{width:70px;padding-left:10px;text-align:center;float:left}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher{display:block;margin-top:1px;padding-top:4px;color:#23282d;text-decoration:none}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher:before{font-family:dashicons!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;font-size:1.4em}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher.dlm-line:before{content:"\f238"}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher.dlm-bar:before{content:"\f185"}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period a{border-color:#ccc!important}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period a:first-child{border-bottom-right-radius:0;border-top-right-radius:0;border-right:0}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period a:last-child{border-bottom-left-radius:0;border-top-left-radius:0;border-left:0}.dlm-reports .dlm_reports_loader{position:absolute;width:32px;height:32px;top:50%;left:50%;margin:-16px 0 0 -16px}.dlm-reports .dlm-reports-block-chart{width:100%;height:300px;margin-top:20px;background:#fff;border:1px solid #e5e5e5;overflow:hidden}.dlm-reports .dlm-reports-block-chart .chart-container h6{display:none}.dlm-reports .dlm-reports-block-summary #popular span{line-height:1em}.dlm-reports .dlm-reports-block{position:relative;box-sizing:border-box;width:100%;padding:20px 10px;margin-top:20px;background:#fff;border:1px solid #e5e5e5;overflow:hidden;float:left}.dlm-reports .dlm-reports-block.dlm-reports-block-half{width:49%;margin-right:1%}.dlm-reports .dlm-reports-block.dlm-reports-block-half-right{width:49%;margin-left:1%}.dlm-reports .dlm-reports-block .dlm-reports-placeholder-no-data{display:inline-block;width:100%;font-size:1.5em;color:#b4b9be;font-style:italic;text-align:center}.dlm-reports .dlm-reports-block ul{box-sizing:border-box;width:100%;padding:0;margin:0}.dlm-reports .dlm-reports-block ul li{display:inline-block;width:33%;padding:5px 0}.dlm-reports .dlm-reports-block ul li label,.dlm-reports .dlm-reports-block ul li span{display:block;width:100%;text-align:center}.dlm-reports .dlm-reports-block ul li span{font-size:2.5em;font-weight:700;padding:.5em 0 0}.dlm-reports .dlm-reports-block table{width:100%}.dlm-reports .dlm-reports-block table td,.dlm-reports .dlm-reports-block table th{text-align:center;padding:10px 0;border-bottom:1px solid #e5e5e5}.dlm-reports .dlm-reports-block table td:first-child,.dlm-reports .dlm-reports-block table th:first-child{text-align:left}.dlm-reports .dlm-reports-block table th{padding-bottom:20px}.dlm-reports-block-summary{background:#333!important;color:#fff}.post-type-dlm_product table.wp-list-table .column-title{width:65%!important}.dlm_mb_shop_product_information .dlm_shop_field_row{width:100%;overflow:hidden}.dlm_mb_shop_product_information .dlm_shop_field_row label.dlm_shop_field_label{display:inline-block;width:20%;height:100%;line-height:2.2em;float:left}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input{display:inline-block;width:50%;float:left}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .dlm_shop_input{width:100%;padding:5px 7px}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-selection--multiple{border:1px solid #ddd}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-search,.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-selection__choice{margin-bottom:0}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-search__field{padding-top:3px}.dlm-order-overview #dlm_empty_trash{margin-left:3px}.dlm-order-overview .wp-list-table td .column-id{width:25%}.dlm-order-details{max-width:1250px;margin-left:auto;margin-right:auto;padding-right:20px}.dlm-order-details h1{padding-bottom:25px}.dlm-order-details .dlm-order-details-main,.dlm-order-details .dlm-order-details-side{width:100%;float:left}.dlm-order-details .dlm-order-details-block{padding:0;margin-bottom:20px;line-height:1;border:1px solid #e5e5e5;background:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.dlm-order-details .dlm-order-details-block h2.dlm-order-details-block-title{font-size:14px;padding:8px 12px;margin:0;line-height:1.4;border-bottom:1px solid #eee}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside{margin:6px 0 0 0;padding:6px 12px 12px;line-height:1.4em;font-size:13px}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside label{display:block;font-weight:700;padding-bottom:6px}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside p{padding:0;margin:0}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside ul,.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside ul li{list-style:none;padding:0;margin:0}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside ul li{padding:6px 0}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside .dlm-order-details-current-state{width:70%;height:30px}.dlm-order-details .dlm-order-details-block.dlm-order-details-customer .dlm-order-details-customer-image{float:right}.dlm-order-details .dlm-order-details-block.dlm-order-details-customer ul li{margin-bottom:4px;padding:0}.dlm-order-details .dlm-order-details-block.dlm-order-details-customer ul li:first-child{font-weight:700}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items{overflow:hidden}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview{width:25%;float:right}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview td,.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview th{padding-top:1.5em;padding-bottom:1.5em;text-align:right}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview th{width:50%;font-weight:400}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview td{padding-right:1em;font-weight:700}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table{width:100%}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th{text-align:center}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td:first-child,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th:first-child{text-align:left;padding-left:.5em}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th{padding-top:.5em;padding-bottom:.5em;border-bottom:2px solid #c3c1bc}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td{padding-top:1.5em;padding-bottom:1.5em;border-bottom:1px solid #c3c1bc}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td.dlm-order-details-order-items-item-total,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th.dlm-order-details-order-items-item-total{text-align:right;padding-right:1em}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td.dlm-order-transaction-processor-id,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th.dlm-order-transaction-processor-id{display:none}.dlm-order-details .dlm-order-details-block .dlm-order-details-update-successful{font-size:2em;padding:.2em .3em;color:#46b450}@media (min-width:768px){.dlm-order-details .dlm-order-details-main{width:62%;float:left}.dlm-order-details .dlm-order-details-side{width:35%;float:right}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td.dlm-order-transaction-processor-id,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th.dlm-order-transaction-processor-id{display:table-cell}}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-one-col{margin:0 auto;max-width:800px}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-cta{margin-top:40px;text-align:center}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col{max-width:680px;margin:40px auto 0;overflow:hidden;display:flex;justify-content:space-between;flex-wrap:wrap}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col .dlm-onboarding-col{padding-top:2.5em;flex:1;align-self:flex-start;min-width:100%;max-width:100%}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col .dlm-onboarding-col img{width:100%}.dlm-onboarding .dlm-onboarding-section h2{margin:60px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.dlm-onboarding .dlm-onboarding-section p{max-width:55em;margin:.6em auto 0 auto}.dlm-onboarding .dlm-onboarding-section a.button-hero{height:46px;font-size:14px;line-height:44px;padding:0 36px;font-weight:700;text-align:center}.dlm-onboarding .dlm-onboarding-pages{max-width:55em;margin:0 auto;padding:2em 0 0}.dlm-onboarding .dlm-onboarding-pages a.button-hero{width:170px}.dlm-onboarding .dlm-onboarding-pages a.button-hero.dlm-page-exists{background:#46b450;border-color:#46b450 #4a8442 #467a3f;box-shadow:0 2px 0 #467a3f;text-shadow:0 -1px 1px #4a8442,1px 0 1px #4a8442,0 1px 1px #4a8442,-1px 0 1px #4a8442}.dlm-onboarding .dlm-onboarding-pages a.button-hero.dlm-page-exists:active{box-shadow:0 2px 0 #467a3f}.dlm-onboarding .dlm-onboarding-pages td,.dlm-onboarding .dlm-onboarding-pages th{padding:1em 0;border-bottom:1px solid #ccc}.dlm-onboarding .dlm-onboarding-pages th{width:13%;min-width:6em;text-align:left}.dlm-onboarding .dlm-onboarding-pages td{padding-right:.5em;padding-left:.5em}.dlm-onboarding .dlm-onboarding-pages td.dlm-onboarding-pages-page-title{font-weight:700}@media (min-width:768px){.dlm-onboarding .dlm-onboarding-section .dlm-onboarding-pages{width:55em}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col .dlm-onboarding-col{padding-top:0;min-width:31%;max-width:31%}}.dlm_extensions_wrap a.dlm-reload-button{float:right;position:relative;top:-40px}.dlm_extensions_wrap #available-extensions{clear:both}.dlm_extensions_wrap .dlm_extensions{padding:15px 0;overflow:hidden}.dlm_extensions_wrap .dlm_extensions .dlm_extension{background-color:#fff;width:calc(20% - 15px);margin:0 15px 15px 0;display:inline-block;vertical-align:top}.dlm_extensions_wrap .dlm_extensions .dlm_extension p{margin:0}.dlm_extensions_wrap .dlm_extensions .dlm_extension a{color:#444;text-decoration:none}.dlm_extensions_wrap .dlm_extensions .dlm_extension .dlm_extension_img_wrapper{width:100%;background:#419ccb;text-align:center}.dlm_extensions_wrap .dlm_extensions .dlm_extension .dlm_extension_img_wrapper img{max-width:100%;margin:0 auto}.dlm_extensions_wrap .dlm_extensions .dlm_extension h3{padding:0 20px}.dlm_extensions_wrap .dlm_extensions .dlm_extension div.extension-desc{min-height:120px;padding:0 20px}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer{padding:15px 15px 15px 0;text-align:right;background-color:#fafafa;border-top:1px solid #dcdcde}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .loop_price{font-weight:700}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .loop_price.sale{color:green}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .loop_price.sale strike{color:#444}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .button .dashicons{vertical-align:middle;font-size:16px}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license{padding:0 20px 20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license div.dlm_license_error{padding:.5em;margin-bottom:15px;background:#ffffe0}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license div.dlm_license_error a{color:#00f;text-decoration:underline}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license p.license-status{padding:5px 0;margin:5px 0;background:red;font-weight:700;font-size:1.2em;color:#fff;text-align:center}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license p.license-status.active{background:green}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license input{width:100%;margin:7px 0;padding:7px}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license a.button-primary{width:100%;margin:5px auto 0;color:#fff;text-align:center}#ui-datepicker-div{display:none}.wpchill-upsell{background:#fff;border:0;padding:15px;margin-top:30px}.wpchill-upsell .wpchill-upsell-features{text-align:left;display:flex;flex-wrap:wrap;padding:20px 0}.wpchill-upsell .wpchill-upsell-features li{width:33%}.wpchill-upsell a:first-child{margin-right:10px}.wpchill-upsells-wrapper{width:100%}.wrap.dlm-admin-settings .form-table{width:65%;float:left}.wrap.dlm-admin-settings .form-table+.wpchill-upsells-wrapper{width:30%;float:right}.wrap.dlm-admin-settings .form-table .dlm_htaccess_notice{margin-bottom:5px}.wrap.dlm-admin-settings .dlm-upsell-badge{font-size:10px;background:#f4daa4;padding:2px 5px;display:inline-block;margin-left:10px;border-radius:10px}.wrap.dlm-admin-settings #setting-dlm_downloads_path+p strong{color:red}#total_downloads_browser_table a.nav-tab{text-transform:capitalize}#dlm-amazon-s3-upsell .inside,#dlm-buttons-upsell .inside,#dlm-download-page-upsell .inside,#dlm-google-drive-upsell .inside{display:flex;flex-wrap:wrap;background:#f1f1f1}#dlm-amazon-s3-upsell .inside .wpchill-upsell,#dlm-buttons-upsell .inside .wpchill-upsell,#dlm-download-page-upsell .inside .wpchill-upsell,#dlm-google-drive-upsell .inside .wpchill-upsell{background:0 0;text-align:center;width:100%;margin-top:0}#dlm-amazon-s3-upsell .inside,#dlm-buttons-upsell .inside,#dlm-download-page-upsell .inside,#dlm-google-drive-upsell .inside{margin:0;padding:0}.upsells-columns{display:flex;flex-wrap:wrap;align-items:center;align-content:center}.upsells-columns .upsells-columns-2{width:50%;text-align:center;display:flex;align-items:center;align-content:center}.upsells-columns .upsells-column{width:100%;text-align:center;display:flex;align-items:center;align-content:center}.upsells-columns .upsells-column>*{display:inline-block;align-content:center;vertical-align:middle;margin:0 15px;padding:10px 0}.upsells-columns .upsells-column>.wpchill-upsell{position:relative;float:none;flex-grow:1;display:flex;align-items:center}.upsells-columns .upsells-column>.wpchill-upsell .wpchill-upsell-description{margin:0 auto}.upsells-columns .upsells-column h3{line-height:1.3em}.upsells-columns .upsells-column:last-child{border-top:1px solid #c3c4c7;border-bottom:1px solid #c3c4c7}.upsells-columns .wpchill-upsell{margin-top:0}.dlm_download_page_dlm-extensions .theme.dlm_extension{background-color:#fff}body.rsvp_page_rsvp-upgrade-to-pro #wpcontent .wrap{margin-left:0;max-width:85%}.rsvp-lite-vs-premium,.rsvp-lite-vs-premium p{font-size:14px;margin:0}.rsvp-lite-vs-premium>.wpchill-plans-table.wpchill-highlight>.wpchill-pricing-package{background:#fefff0;box-shadow:0 0 15px rgb(208 219 219)}.rsvp-lite-vs-premium .wp-badge{display:inline-block;vertical-align:middle;position:relative;margin-right:2.5%}.rsvp-lite-vs-premium h3{display:block;position:relative;font-size:16px;margin:0}.rsvp-lite-vs-premium .wpchill-plans-table{display:flex}.rsvp-lite-vs-premium .wpchill-plans-table.table-header{margin-top:50px;border-top:0}.rsvp-lite-vs-premium .wpchill-plans-table.table-header .wpchill-pricing-package{border:0}.rsvp-lite-vs-premium .wpchill-plans-table.table-header .wpchill-pricing-package.wpchill-title.wpchill-highlight::before,.rsvp-lite-vs-premium .wpchill-plans-table.table-header .wpchill-pricing-package:not(.wpchill-modula-lite):last-child:before{content:'';width:auto;display:inline-block;opacity:1;position:absolute;top:-1px;background:#41495b;text-align:center;left:0;right:0;color:#fff;font-size:15px;text-transform:uppercase;padding:10px 5px;transform:translateY(-100%)}.rsvp-lite-vs-premium.table-footer .wpchill-pricing-package:last-child{border:0}.rsvp-lite-vs-premium .wpchill-pricing-package{text-align:center;line-height:1.5;padding:10px 15px;display:flex;align-content:center;align-items:center;justify-content:center;background:#fff;border-top:1px solid #ccc;width:32%}.rsvp-lite-vs-premium .wpchill-pricing-package:not(:first-child){max-width:300px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title{font-weight:400;color:#666;font-size:1.25rem;height:auto;-ms-flex-direction:column;flex-direction:column;padding-top:30px;padding-bottom:30px;justify-content:space-between;position:relative}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-name{margin:0;font-size:36px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title.wpchill-modula-lite{justify-content:center}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title p.description{font-style:italic;font-size:13px;margin-bottom:40px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price p:last-child{font-size:30px;margin:0 0 40px 0}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price p.old-price{margin:0;position:relative}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price p.old-price:after{content:"";height:2px;width:60px;background:red;display:block;position:absolute;left:50%;top:52%;transform:translate(-50%,-50%)}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price sup{top:2px;position:relative;font-size:15px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-empty{background:0 0;border-color:transparent}.rsvp-lite-vs-premium .wpchill-pricing-package.feature-name{justify-content:space-between;font-weight:400;text-align:left;font-size:13px;display:block;background:0 0}.rsvp-lite-vs-premium .wpchill-pricing-package .dashicons-saved{color:green}.rsvp-lite-vs-premium .wpchill-pricing-package .dashicons{width:30px;height:30px;font-size:30px}.rsvp-lite-vs-premium .wpchill-pricing-package .dashicons-no-alt{color:#ff3439}.rsvp-lite-vs-premium .wpchill-pricing-package:last-child{background:#fefff0}.rsvp-lite-vs-premium .button .dashicons{font-size:16px;vertical-align:middle;line-height:26px}.wpchill-tooltip{position:relative;display:inline-block;float:left;margin-right:10px}.wpchill-tooltip>span{cursor:pointer;color:#0073aa;text-decoration:underline;margin-left:5px}.wpchill-tooltip .wpchill-tooltip-content{display:none;position:absolute;top:50%;right:-10px;transform:translate(100%,-50%);width:300px;background:#000;color:#fff;padding:10px;box-sizing:border-box;z-index:99}.wpchill-tooltip:hover .wpchill-tooltip-content{display:block}.wpchill-tooltip .wpchill-tooltip-content:before{content:'';width:0;height:0;border-style:solid;border-width:8px 8px 8px 0;border-color:transparent #000 transparent transparent;display:block;position:absolute;top:50%;left:-8px;transform:translateY(-50%)}.wpchill-tooltip-button{position:relative}.wpchill-tooltip-button .wpchill-tooltip-content{display:none;position:absolute;top:50%;right:25px;transform:translate(50%,-135%);width:auto;background:rgba(0,0,0,.8);color:#fff;padding:10px 15px;box-sizing:border-box;font-size:14px;z-index:99}.wpchill-tooltip-button:hover .wpchill-tooltip-content{display:block}.wpchill-tooltip-button .wpchill-tooltip-content:before{content:'';width:0;height:0;border-style:solid;border-width:8px 8px 8px 0;border-color:transparent #000 transparent transparent;display:block;position:absolute;bottom:-12px;left:50%;transform:rotate(-90deg)}.dlm-file-link{display:block;margin-top:3px}.dlm-listing-no-file code{color:#b32d2e}
assets/css/admin.less CHANGED
@@ -1574,7 +1574,7 @@ table.wp-list-table {
1574
 
1575
  &.dlm-onboarding-section-one-col {
1576
  margin: 0 auto;
1577
- max-width: 680px;
1578
  }
1579
 
1580
  &.dlm-onboarding-section-cta {
@@ -2266,4 +2266,10 @@ body.rsvp_page_rsvp-upgrade-to-pro #wpcontent .wrap {
2266
  .dlm-file-link{
2267
  display:block;
2268
  margin-top:3px;
 
 
 
 
 
 
2269
  }
1574
 
1575
  &.dlm-onboarding-section-one-col {
1576
  margin: 0 auto;
1577
+ max-width: 800px;
1578
  }
1579
 
1580
  &.dlm-onboarding-section-cta {
2266
  .dlm-file-link{
2267
  display:block;
2268
  margin-top:3px;
2269
+ }
2270
+
2271
+ .dlm-listing-no-file{
2272
+ code {
2273
+ color: #b32d2e;
2274
+ }
2275
  }
assets/css/cart.less CHANGED
@@ -1,88 +1,88 @@
1
- @cart_bottom_bg: #f8f8f8;
2
-
3
- .dlm-cart {
4
-
5
- .dlm-cart-table-items {
6
- table {
7
- tr {
8
- th, td {
9
- background: none;
10
- padding: 1em;
11
- }
12
- th {
13
- font-size: 1.1em;
14
- padding-top: 0.5em;
15
- padding-bottom: 0.5em;
16
- border-bottom: 2px solid #c3c1bc;
17
- }
18
- td {
19
- padding-top: 1.5em;
20
- padding-bottom: 1.5em;
21
- border-bottom: 1px solid #c3c1bc;
22
-
23
- .dlm-cart-remove-item {
24
- display: inline-block;
25
- width: 18px;
26
- height: 18px;
27
- line-height: 14px;
28
- font-size: 15px;
29
- color: #000;
30
- text-align: center;
31
- border: 1px solid #000;
32
- -webkit-border-radius: 100%;
33
- -moz-border-radius: 100%;
34
- border-radius: 100%;
35
- }
36
- }
37
- }
38
- }
39
- }
40
-
41
- .dlm-cart-bottom {
42
- background: @cart_bottom_bg;
43
- padding: 1em;
44
- overflow: hidden;
45
-
46
- .dlm-cart-coupons {
47
- width: 40%;
48
- float: left;
49
- }
50
-
51
- .dlm-cart-bottom-right {
52
- width: 40%;
53
- float: right;
54
-
55
- .dlm-cart-totals {
56
- h2 {
57
- font-size: 1.6em;
58
- }
59
-
60
- table {
61
- tr {
62
- th, td {
63
- padding: .75em .5em;
64
- background: @cart_bottom_bg;
65
- }
66
- }
67
- tr.dlm-totals-last-row {
68
- th, td {
69
- border-top: 1px solid #c3c1bc;
70
- }
71
- }
72
- }
73
- }
74
-
75
- .dlm-proceed-to-checkout {
76
- a.dlm-button-checkout {
77
- display: block;
78
- color: #000;
79
- padding: 1em 2em;
80
- border: 2px solid #000;
81
- text-align: center;
82
- font-weight: 800;
83
- box-shadow: none !important;
84
- }
85
- }
86
- }
87
- }
88
  }
1
+ @cart_bottom_bg: #f8f8f8;
2
+
3
+ .dlm-cart {
4
+
5
+ .dlm-cart-table-items {
6
+ table {
7
+ tr {
8
+ th, td {
9
+ background: none;
10
+ padding: 1em;
11
+ }
12
+ th {
13
+ font-size: 1.1em;
14
+ padding-top: 0.5em;
15
+ padding-bottom: 0.5em;
16
+ border-bottom: 2px solid #c3c1bc;
17
+ }
18
+ td {
19
+ padding-top: 1.5em;
20
+ padding-bottom: 1.5em;
21
+ border-bottom: 1px solid #c3c1bc;
22
+
23
+ .dlm-cart-remove-item {
24
+ display: inline-block;
25
+ width: 18px;
26
+ height: 18px;
27
+ line-height: 14px;
28
+ font-size: 15px;
29
+ color: #000;
30
+ text-align: center;
31
+ border: 1px solid #000;
32
+ -webkit-border-radius: 100%;
33
+ -moz-border-radius: 100%;
34
+ border-radius: 100%;
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+
41
+ .dlm-cart-bottom {
42
+ background: @cart_bottom_bg;
43
+ padding: 1em;
44
+ overflow: hidden;
45
+
46
+ .dlm-cart-coupons {
47
+ width: 40%;
48
+ float: left;
49
+ }
50
+
51
+ .dlm-cart-bottom-right {
52
+ width: 40%;
53
+ float: right;
54
+
55
+ .dlm-cart-totals {
56
+ h2 {
57
+ font-size: 1.6em;
58
+ }
59
+
60
+ table {
61
+ tr {
62
+ th, td {
63
+ padding: .75em .5em;
64
+ background: @cart_bottom_bg;
65
+ }
66
+ }
67
+ tr.dlm-totals-last-row {
68
+ th, td {
69
+ border-top: 1px solid #c3c1bc;
70
+ }
71
+ }
72
+ }
73
+ }
74
+
75
+ .dlm-proceed-to-checkout {
76
+ a.dlm-button-checkout {
77
+ display: block;
78
+ color: #000;
79
+ padding: 1em 2em;
80
+ border: 2px solid #000;
81
+ text-align: center;
82
+ font-weight: 800;
83
+ box-shadow: none !important;
84
+ }
85
+ }
86
+ }
87
+ }
88
  }
assets/css/checkout.less CHANGED
@@ -1,206 +1,206 @@
1
- @cart_bottom_bg: #f8f8f8;
2
-
3
- .dlm-checkout {
4
-
5
- width: 100% !important;
6
- max-width: 100% !important;
7
- overflow: hidden;
8
-
9
- .dlm-checkout-error {
10
- padding: 1em;
11
- margin-bottom: 15px;
12
- background: #dc3232;
13
- box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
14
-
15
- .dlm-checkout-error-icon {
16
- display: inline-block;
17
- width: 25px;
18
- color: #fff;
19
- vertical-align: middle;
20
- margin-right: 10px;
21
- }
22
-
23
- p {
24
- display: inline-block;
25
- color: #fff;
26
- font-weight: bold;
27
- padding: 0;
28
- margin: 0;
29
- }
30
- }
31
-
32
- form {
33
- padding: 0;
34
- margin: 0;
35
- }
36
-
37
- .dlm-checkout-billing {
38
- width: 55%;
39
- float: left;
40
- }
41
-
42
- .dlm-checkout-order-review {
43
- width: 40%;
44
- float: right;
45
-
46
- table {
47
- th {
48
- text-align: left;
49
- }
50
- }
51
- }
52
-
53
- .dlm-checkout-row {
54
- width: 100%;
55
- padding: 5px 0;
56
-
57
- label {
58
- display: inline-block;
59
- width: 100%;
60
- .dlm-checkout-required {
61
- padding: 0 5px;
62
- color: #ff0000;
63
- }
64
- }
65
-
66
- .dlm-checkout-input-wrapper {
67
- display: inline-block;
68
- width: 100%;
69
- padding: 5px 0;
70
-
71
- input, select {
72
- width: 100%;
73
- }
74
- select {
75
- padding: 5px;
76
- }
77
-
78
- .dlm-checkout-field {
79
- &.dlm-checkout-field-error {
80
- border: 1px solid #dc3232;
81
- }
82
- }
83
-
84
- }
85
- }
86
-
87
- .dlm-checkout-row-half {
88
- width: 45%;
89
- float: left;
90
- }
91
-
92
- .dlm-checkout-row-last {
93
- float: right;
94
- }
95
-
96
- .dlm-checkout-payment {
97
- ul, li {
98
- padding: 0;
99
- margin: 0;
100
- list-style: none;
101
- }
102
- ul {
103
- li {
104
- background: #fbfbfb;
105
- margin-bottom: 20px;
106
- label {
107
- display: inline-block;
108
- width: 100%;
109
- padding: 15px 25px;
110
- background: #f8f8f8;
111
- cursor: pointer;
112
-
113
- input {
114
- margin-right: 10px;
115
- }
116
- }
117
- .dlm_gateway_details {
118
- padding: 15px 25px;
119
-
120
- p {
121
- padding: 0;
122
- margin: 0;
123
- }
124
- }
125
- }
126
- }
127
- }
128
-
129
- }
130
-
131
- .dlm-checkout-complete {
132
-
133
- table {
134
- th {
135
- text-align: left;
136
- }
137
- }
138
-
139
- .dlm-checkout-download-button {
140
- display: inline-block;
141
- padding: 1em 1.5em;
142
- background-color: #eeeeee;
143
- border-color: #eeeeee;
144
- color: #333333;
145
- }
146
- }
147
-
148
- .dlm-checkout-overlay-bg {
149
- position: fixed;
150
- top: 0;
151
- left: 0;
152
- width: 100%;
153
- height:100%;
154
- background: #000;
155
- opacity: 0.5;
156
- z-index: 9998;
157
-
158
- display: none;
159
- }
160
-
161
- .dlm-checkout-overlay {
162
- box-sizing: border-box;
163
- position: fixed;
164
- top: 50%;
165
- left: 50%;
166
- width: 350px;
167
- height:150px;
168
- margin-top: -75px;
169
- margin-left: -175px;
170
- padding: 25px;
171
- background: #fff;
172
- border-radius: 8px;
173
- box-shadow: 1px 2px;
174
- z-index: 9999;
175
- text-align: center;
176
- display: none;
177
-
178
- h2 {
179
- padding: 0;
180
- margin: 0;
181
- font-size: 26px;
182
- font-weight: 400;
183
- text-align: center;
184
-
185
- &:before {
186
- content:"";
187
- display: none;
188
- }
189
- }
190
-
191
- span {
192
- font-size: 16px;
193
- display: inline-block;
194
- width: 100%;
195
- padding: 10px 0 20px;
196
- text-align: center;
197
- }
198
-
199
- img {
200
- position: absolute;
201
- bottom: 25px;
202
- left: 50%;
203
- margin-left: -22px;
204
- }
205
-
206
  }
1
+ @cart_bottom_bg: #f8f8f8;
2
+
3
+ .dlm-checkout {
4
+
5
+ width: 100% !important;
6
+ max-width: 100% !important;
7
+ overflow: hidden;
8
+
9
+ .dlm-checkout-error {
10
+ padding: 1em;
11
+ margin-bottom: 15px;
12
+ background: #dc3232;
13
+ box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
14
+
15
+ .dlm-checkout-error-icon {
16
+ display: inline-block;
17
+ width: 25px;
18
+ color: #fff;
19
+ vertical-align: middle;
20
+ margin-right: 10px;
21
+ }
22
+
23
+ p {
24
+ display: inline-block;
25
+ color: #fff;
26
+ font-weight: bold;
27
+ padding: 0;
28
+ margin: 0;
29
+ }
30
+ }
31
+
32
+ form {
33
+ padding: 0;
34
+ margin: 0;
35
+ }
36
+
37
+ .dlm-checkout-billing {
38
+ width: 55%;
39
+ float: left;
40
+ }
41
+
42
+ .dlm-checkout-order-review {
43
+ width: 40%;
44
+ float: right;
45
+
46
+ table {
47
+ th {
48
+ text-align: left;
49
+ }
50
+ }
51
+ }
52
+
53
+ .dlm-checkout-row {
54
+ width: 100%;
55
+ padding: 5px 0;
56
+
57
+ label {
58
+ display: inline-block;
59
+ width: 100%;
60
+ .dlm-checkout-required {
61
+ padding: 0 5px;
62
+ color: #ff0000;
63
+ }
64
+ }
65
+
66
+ .dlm-checkout-input-wrapper {
67
+ display: inline-block;
68
+ width: 100%;
69
+ padding: 5px 0;
70
+
71
+ input, select {
72
+ width: 100%;
73
+ }
74
+ select {
75
+ padding: 5px;
76
+ }
77
+
78
+ .dlm-checkout-field {
79
+ &.dlm-checkout-field-error {
80
+ border: 1px solid #dc3232;
81
+ }
82
+ }
83
+
84
+ }
85
+ }
86
+
87
+ .dlm-checkout-row-half {
88
+ width: 45%;
89
+ float: left;
90
+ }
91
+
92
+ .dlm-checkout-row-last {
93
+ float: right;
94
+ }
95
+
96
+ .dlm-checkout-payment {
97
+ ul, li {
98
+ padding: 0;
99
+ margin: 0;
100
+ list-style: none;
101
+ }
102
+ ul {
103
+ li {
104
+ background: #fbfbfb;
105
+ margin-bottom: 20px;
106
+ label {
107
+ display: inline-block;
108
+ width: 100%;
109
+ padding: 15px 25px;
110
+ background: #f8f8f8;
111
+ cursor: pointer;
112
+
113
+ input {
114
+ margin-right: 10px;
115
+ }
116
+ }
117
+ .dlm_gateway_details {
118
+ padding: 15px 25px;
119
+
120
+ p {
121
+ padding: 0;
122
+ margin: 0;
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+
129
+ }
130
+
131
+ .dlm-checkout-complete {
132
+
133
+ table {
134
+ th {
135
+ text-align: left;
136
+ }
137
+ }
138
+
139
+ .dlm-checkout-download-button {
140
+ display: inline-block;
141
+ padding: 1em 1.5em;
142
+ background-color: #eeeeee;
143
+ border-color: #eeeeee;
144
+ color: #333333;
145
+ }
146
+ }
147
+
148
+ .dlm-checkout-overlay-bg {
149
+ position: fixed;
150
+ top: 0;
151
+ left: 0;
152
+ width: 100%;
153
+ height:100%;
154
+ background: #000;
155
+ opacity: 0.5;
156
+ z-index: 9998;
157
+
158
+ display: none;
159
+ }
160
+
161
+ .dlm-checkout-overlay {
162
+ box-sizing: border-box;
163
+ position: fixed;
164
+ top: 50%;
165
+ left: 50%;
166
+ width: 350px;
167
+ height:150px;
168
+ margin-top: -75px;
169
+ margin-left: -175px;
170
+ padding: 25px;
171
+ background: #fff;
172
+ border-radius: 8px;
173
+ box-shadow: 1px 2px;
174
+ z-index: 9999;
175
+ text-align: center;
176
+ display: none;
177
+
178
+ h2 {
179
+ padding: 0;
180
+ margin: 0;
181
+ font-size: 26px;
182
+ font-weight: 400;
183
+ text-align: center;
184
+
185
+ &:before {
186
+ content:"";
187
+ display: none;
188
+ }
189
+ }
190
+
191
+ span {
192
+ font-size: 16px;
193
+ display: inline-block;
194
+ width: 100%;
195
+ padding: 10px 0 20px;
196
+ text-align: center;
197
+ }
198
+
199
+ img {
200
+ position: absolute;
201
+ bottom: 25px;
202
+ left: 50%;
203
+ margin-left: -22px;
204
+ }
205
+
206
  }
assets/css/gb-editor.less CHANGED
@@ -1,11 +1,11 @@
1
- .dlmPreviewButton {
2
- border: 2px dashed #419ccb;
3
- color: #fff;
4
- padding: 1em;
5
- overflow: hidden;
6
-
7
- iframe {
8
- overflow: hidden;
9
- float: left;
10
- }
11
  }
1
+ .dlmPreviewButton {
2
+ border: 2px dashed #419ccb;
3
+ color: #fff;
4
+ padding: 1em;
5
+ overflow: hidden;
6
+
7
+ iframe {
8
+ overflow: hidden;
9
+ float: left;
10
+ }
11
  }
assets/css/menu.css CHANGED
@@ -1 +1 @@
1
- #adminmenu #menu-posts-dlm_download .wp-menu-image:before{content:"\f316";font-family:dashicons!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em}#adminmenu ul.wp-submenu a[href$=dlm-lite-vs-pro]{color:gold}.dlm-lu-upgrade-notice{position:relative;padding:1em;margin:3em 1em 1em 0;color:#fff;background:#419ccb;box-shadow:2px 2px 1px grey}.dlm-lu-upgrade-notice a,.dlm-lu-upgrade-notice h3{color:#fff}.dlm-lu-upgrade-notice h3{margin-top:0}.dlm-lu-upgrade-notice p{font-size:1.05em}.dlm-lu-upgrade-notice p a{font-weight:700}.dlm-lu-upgrade-notice a.dlm-lu-upgrade-notice-hide{position:absolute;top:10px;right:10px;text-decoration:none;font-size:.95em}.dlm-onboarding-notice{border-left-color:#419ccb}.dlm-onboarding-notice:before{display:inline-block;position:absolute;top:0;left:0;width:35px;height:100%;content:"";background-color:#419ccb;background-image:url(../images/logo.png);background-size:29px 28px;background-position:1px center;background-repeat:no-repeat}.dlm-onboarding-notice p{padding-left:33px}
1
+ #adminmenu #menu-posts-dlm_download .wp-menu-image:before{content:"\f316";font-family:dashicons!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em}#adminmenu #menu-posts-dlm_download ul.wp-submenu li>a{padding:7px 12px}#adminmenu #menu-posts-dlm_download ul.wp-submenu li a[href$=dlm-lite-vs-pro]{color:gold}#adminmenu #menu-posts-dlm_download ul.wp-submenu li a[href$="edit-tags.php?taxonomy=dlm_download_tag&post_type=dlm_download"],#adminmenu #menu-posts-dlm_download ul.wp-submenu li a[href$="edit.php?post_type=dlm_download&page=download-monitor-reports"],#adminmenu #menu-posts-dlm_download ul.wp-submenu li a[href$="edit.php?post_type=dlm_download&page=download-monitor-settings"]{border-bottom:1px solid hsla(0,0%,100%,.2)}.dlm-lu-upgrade-notice{position:relative;padding:1em;margin:3em 1em 1em 0;color:#fff;background:#419ccb;box-shadow:2px 2px 1px grey}.dlm-lu-upgrade-notice a,.dlm-lu-upgrade-notice h3{color:#fff}.dlm-lu-upgrade-notice h3{margin-top:0}.dlm-lu-upgrade-notice p{font-size:1.05em}.dlm-lu-upgrade-notice p a{font-weight:700}.dlm-lu-upgrade-notice a.dlm-lu-upgrade-notice-hide{position:absolute;top:10px;right:10px;text-decoration:none;font-size:.95em}.dlm-onboarding-notice{border-left-color:#419ccb}.dlm-onboarding-notice:before{display:inline-block;position:absolute;top:0;left:0;width:35px;height:100%;content:"";background-color:#419ccb;background-image:url(../images/logo.png);background-size:29px 28px;background-position:1px center;background-repeat:no-repeat}.dlm-onboarding-notice p{padding-left:33px}
assets/css/menu.less CHANGED
@@ -20,13 +20,25 @@
20
  /* fix buttons height, for twitter bootstrap */
21
  line-height: 1em;
22
  }
23
- }
 
 
 
24
 
25
- ul.wp-submenu {
 
 
 
 
 
 
26
 
27
- // Lite vs PRO menu link
28
- a[href$="dlm-lite-vs-pro"] {
29
- color: gold;
 
 
 
30
  }
31
  }
32
  }
@@ -82,4 +94,4 @@
82
  p {
83
  padding-left: 33px;
84
  }
85
- }
20
  /* fix buttons height, for twitter bootstrap */
21
  line-height: 1em;
22
  }
23
+
24
+ ul.wp-submenu {
25
+
26
+ li {
27
 
28
+ & > a {
29
+ padding:7px 12px;
30
+ }
31
+ // Lite vs PRO menu link
32
+ a[href$="dlm-lite-vs-pro"] {
33
+ color: gold;
34
+ }
35
 
36
+ a[href$="edit-tags.php?taxonomy=dlm_download_tag&post_type=dlm_download"],
37
+ a[href$="edit.php?post_type=dlm_download&page=download-monitor-settings"],
38
+ a[href$="edit.php?post_type=dlm_download&page=download-monitor-reports"]{
39
+ border-bottom: 1px solid hsla(0,0%,100%,.2);
40
+ }
41
+ }
42
  }
43
  }
44
  }
94
  p {
95
  padding-left: 33px;
96
  }
97
+ }
assets/css/preview.less CHANGED
@@ -1,19 +1,19 @@
1
- html,body {
2
- padding: 0;
3
- margin: 0;
4
- overflow: hidden !important;
5
- }
6
-
7
- table,tr,td {
8
- padding: 0 !important;
9
- margin: 0 !important;
10
- }
11
-
12
- p {
13
- padding: 0 !important;
14
- margin: 0 !important;
15
- }
16
-
17
- .dlmPreviewContainer {
18
- overflow: hidden;
19
  }
1
+ html,body {
2
+ padding: 0;
3
+ margin: 0;
4
+ overflow: hidden !important;
5
+ }
6
+
7
+ table,tr,td {
8
+ padding: 0 !important;
9
+ margin: 0 !important;
10
+ }
11
+
12
+ p {
13
+ padding: 0 !important;
14
+ margin: 0 !important;
15
+ }
16
+
17
+ .dlmPreviewContainer {
18
+ overflow: hidden;
19
  }
assets/js/blockui.js CHANGED
@@ -1,616 +1,616 @@
1
- /*!
2
- * jQuery blockUI plugin
3
- * Version 2.61.0-2013.06.06
4
- * @requires jQuery v1.7 or later
5
- *
6
- * Examples at: http://malsup.com/jquery/block/
7
- * Copyright (c) 2007-2013 M. Alsup
8
- * Dual licensed under the MIT and GPL licenses:
9
- * http://www.opensource.org/licenses/mit-license.php
10
- * http://www.gnu.org/licenses/gpl.html
11
- *
12
- * Thanks to Amir-Hossein Sobhi for some excellent contributions!
13
- */
14
-
15
- ;(function() {
16
- /*jshint eqeqeq:false curly:false latedef:false */
17
- "use strict";
18
-
19
- function setup($) {
20
- $.fn._fadeIn = $.fn.fadeIn;
21
-
22
- var noOp = $.noop || function() {};
23
-
24
- // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
25
- // retarded userAgent strings on Vista)
26
- var msie = /MSIE/.test(navigator.userAgent);
27
- var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
28
- var mode = document.documentMode || 0;
29
- var setExpr = $.isFunction( document.createElement('div').style.setExpression );
30
-
31
- // global $ methods for blocking/unblocking the entire page
32
- $.blockUI = function(opts) { install(window, opts); };
33
- $.unblockUI = function(opts) { remove(window, opts); };
34
-
35
- // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
36
- $.growlUI = function(title, message, timeout, onClose) {
37
- var $m = $('<div class="growlUI"></div>');
38
- if (title) $m.append('<h1>'+title+'</h1>');
39
- if (message) $m.append('<h2>'+message+'</h2>');
40
- if (timeout === undefined) timeout = 3000;
41
-
42
- // Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications
43
- var callBlock = function(opts) {
44
- opts = opts || {};
45
-
46
- $.blockUI({
47
- message: $m,
48
- fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,
49
- fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
50
- timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
51
- centerY: false,
52
- showOverlay: false,
53
- onUnblock: onClose,
54
- css: $.blockUI.defaults.growlCSS
55
- });
56
- };
57
-
58
- callBlock();
59
- var nonmousedOpacity = $m.css('opacity');
60
- $m.mouseover(function() {
61
- callBlock({
62
- fadeIn: 0,
63
- timeout: 30000
64
- });
65
-
66
- var displayBlock = $('.blockMsg');
67
- displayBlock.stop(); // cancel fadeout if it has started
68
- displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
69
- }).mouseout(function() {
70
- $('.blockMsg').fadeOut(1000);
71
- });
72
- // End konapun additions
73
- };
74
-
75
- // plugin method for blocking element content
76
- $.fn.block = function(opts) {
77
- if ( this[0] === window ) {
78
- $.blockUI( opts );
79
- return this;
80
- }
81
- var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
82
- this.each(function() {
83
- var $el = $(this);
84
- if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
85
- return;
86
- $el.unblock({ fadeOut: 0 });
87
- });
88
-
89
- return this.each(function() {
90
- if ($.css(this,'position') == 'static') {
91
- this.style.position = 'relative';
92
- $(this).data('blockUI.static', true);
93
- }
94
- this.style.zoom = 1; // force 'hasLayout' in ie
95
- install(this, opts);
96
- });
97
- };
98
-
99
- // plugin method for unblocking element content
100
- $.fn.unblock = function(opts) {
101
- if ( this[0] === window ) {
102
- $.unblockUI( opts );
103
- return this;
104
- }
105
- return this.each(function() {
106
- remove(this, opts);
107
- });
108
- };
109
-
110
- $.blockUI.version = 2.60; // 2nd generation blocking at no extra cost!
111
-
112
- // override these in your code to change the default behavior and style
113
- $.blockUI.defaults = {
114
- // message displayed when blocking (use null for no message)
115
- message: '<h1>Please wait...</h1>',
116
-
117
- title: null, // title string; only used when theme == true
118
- draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
119
-
120
- theme: false, // set to true to use with jQuery UI themes
121
-
122
- // styles for the message when blocking; if you wish to disable
123
- // these and use an external stylesheet then do this in your code:
124
- // $.blockUI.defaults.css = {};
125
- css: {
126
- padding: 0,
127
- margin: 0,
128
- width: '30%',
129
- top: '40%',
130
- left: '35%',
131
- textAlign: 'center',
132
- color: '#000',
133
- border: '3px solid #aaa',
134
- backgroundColor:'#fff',
135
- cursor: 'wait'
136
- },
137
-
138
- // minimal style set used when themes are used
139
- themedCSS: {
140
- width: '30%',
141
- top: '40%',
142
- left: '35%'
143
- },
144
-
145
- // styles for the overlay
146
- overlayCSS: {
147
- backgroundColor: '#000',
148
- opacity: 0.6,
149
- cursor: 'wait'
150
- },
151
-
152
- // style to replace wait cursor before unblocking to correct issue
153
- // of lingering wait cursor
154
- cursorReset: 'default',
155
-
156
- // styles applied when using $.growlUI
157
- growlCSS: {
158
- width: '350px',
159
- top: '10px',
160
- left: '',
161
- right: '10px',
162
- border: 'none',
163
- padding: '5px',
164
- opacity: 0.6,
165
- cursor: 'default',
166
- color: '#fff',
167
- backgroundColor: '#000',
168
- '-webkit-border-radius':'10px',
169
- '-moz-border-radius': '10px',
170
- 'border-radius': '10px'
171
- },
172
-
173
- // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
174
- // (hat tip to Jorge H. N. de Vasconcelos)
175
- /*jshint scripturl:true */
176
- iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
177
-
178
- // force usage of iframe in non-IE browsers (handy for blocking applets)
179
- forceIframe: false,
180
-
181
- // z-index for the blocking overlay
182
- baseZ: 1000,
183
-
184
- // set these to true to have the message automatically centered
185
- centerX: true, // <-- only effects element blocking (page block controlled via css above)
186
- centerY: true,
187
-
188
- // allow body element to be stetched in ie6; this makes blocking look better
189
- // on "short" pages. disable if you wish to prevent changes to the body height
190
- allowBodyStretch: true,
191
-
192
- // enable if you want key and mouse events to be disabled for content that is blocked
193
- bindEvents: true,
194
-
195
- // be default blockUI will supress tab navigation from leaving blocking content
196
- // (if bindEvents is true)
197
- constrainTabKey: true,
198
-
199
- // fadeIn time in millis; set to 0 to disable fadeIn on block
200
- fadeIn: 200,
201
-
202
- // fadeOut time in millis; set to 0 to disable fadeOut on unblock
203
- fadeOut: 400,
204
-
205
- // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
206
- timeout: 0,
207
-
208
- // disable if you don't want to show the overlay
209
- showOverlay: true,
210
-
211
- // if true, focus will be placed in the first available input field when
212
- // page blocking
213
- focusInput: true,
214
-
215
- // elements that can receive focus
216
- focusableElements: ':input:enabled:visible',
217
-
218
- // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
219
- // no longer needed in 2012
220
- // applyPlatformOpacityRules: true,
221
-
222
- // callback method invoked when fadeIn has completed and blocking message is visible
223
- onBlock: null,
224
-
225
- // callback method invoked when unblocking has completed; the callback is
226
- // passed the element that has been unblocked (which is the window object for page
227
- // blocks) and the options that were passed to the unblock call:
228
- // onUnblock(element, options)
229
- onUnblock: null,
230
-
231
- // callback method invoked when the overlay area is clicked.
232
- // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
233
- onOverlayClick: null,
234
-
235
- // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
236
- quirksmodeOffsetHack: 4,
237
-
238
- // class name of the message block
239
- blockMsgClass: 'blockMsg',
240
-
241
- // if it is already blocked, then ignore it (don't unblock and reblock)
242
- ignoreIfBlocked: false
243
- };
244
-
245
- // private data and functions follow...
246
-
247
- var pageBlock = null;
248
- var pageBlockEls = [];
249
-
250
- function install(el, opts) {
251
- var css, themedCSS;
252
- var full = (el == window);
253
- var msg = (opts && opts.message !== undefined ? opts.message : undefined);
254
- opts = $.extend({}, $.blockUI.defaults, opts || {});
255
-
256
- if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
257
- return;
258
-
259
- opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
260
- css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
261
- if (opts.onOverlayClick)
262
- opts.overlayCSS.cursor = 'pointer';
263
-
264
- themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
265
- msg = msg === undefined ? opts.message : msg;
266
-
267
- // remove the current block (if there is one)
268
- if (full && pageBlock)
269
- remove(window, {fadeOut:0});
270
-
271
- // if an existing element is being used as the blocking content then we capture
272
- // its current place in the DOM (and current display style) so we can restore
273
- // it when we unblock
274
- if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
275
- var node = msg.jquery ? msg[0] : msg;
276
- var data = {};
277
- $(el).data('blockUI.history', data);
278
- data.el = node;
279
- data.parent = node.parentNode;
280
- data.display = node.style.display;
281
- data.position = node.style.position;
282
- if (data.parent)
283
- data.parent.removeChild(node);
284
- }
285
-
286
- $(el).data('blockUI.onUnblock', opts.onUnblock);
287
- var z = opts.baseZ;
288
-
289
- // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
290
- // layer1 is the iframe layer which is used to supress bleed through of underlying content
291
- // layer2 is the overlay layer which has opacity and a wait cursor (by default)
292
- // layer3 is the message content that is displayed while blocking
293
- var lyr1, lyr2, lyr3, s;
294
- if (msie || opts.forceIframe)
295
- lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>');
296
- else
297
- lyr1 = $('<div class="blockUI" style="display:none"></div>');
298
-
299
- if (opts.theme)
300
- lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>');
301
- else
302
- lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
303
-
304
- if (opts.theme && full) {
305
- s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';
306
- if ( opts.title ) {
307
- s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
308
- }
309
- s += '<div class="ui-widget-content ui-dialog-content"></div>';
310
- s += '</div>';
311
- }
312
- else if (opts.theme) {
313
- s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';
314
- if ( opts.title ) {
315
- s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
316
- }
317
- s += '<div class="ui-widget-content ui-dialog-content"></div>';
318
- s += '</div>';
319
- }
320
- else if (full) {
321
- s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
322
- }
323
- else {
324
- s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
325
- }
326
- lyr3 = $(s);
327
-
328
- // if we have a message, style it
329
- if (msg) {
330
- if (opts.theme) {
331
- lyr3.css(themedCSS);
332
- lyr3.addClass('ui-widget-content');
333
- }
334
- else
335
- lyr3.css(css);
336
- }
337
-
338
- // style the overlay
339
- if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
340
- lyr2.css(opts.overlayCSS);
341
- lyr2.css('position', full ? 'fixed' : 'absolute');
342
-
343
- // make iframe layer transparent in IE
344
- if (msie || opts.forceIframe)
345
- lyr1.css('opacity',0.0);
346
-
347
- //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
348
- var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
349
- $.each(layers, function() {
350
- this.appendTo($par);
351
- });
352
-
353
- if (opts.theme && opts.draggable && $.fn.draggable) {
354
- lyr3.draggable({
355
- handle: '.ui-dialog-titlebar',
356
- cancel: 'li'
357
- });
358
- }
359
-
360
- // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
361
- var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
362
- if (ie6 || expr) {
363
- // give body 100% height
364
- if (full && opts.allowBodyStretch && $.support.boxModel)
365
- $('html,body').css('height','100%');
366
-
367
- // fix ie6 issue when blocked element has a border width
368
- if ((ie6 || !$.support.boxModel) && !full) {
369
- var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
370
- var fixT = t ? '(0 - '+t+')' : 0;
371
- var fixL = l ? '(0 - '+l+')' : 0;
372
- }
373
-
374
- // simulate fixed position
375
- $.each(layers, function(i,o) {
376
- var s = o[0].style;
377
- s.position = 'absolute';
378
- if (i < 2) {
379
- if (full)
380
- s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');
381
- else
382
- s.setExpression('height','this.parentNode.offsetHeight + "px"');
383
- if (full)
384
- s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
385
- else
386
- s.setExpression('width','this.parentNode.offsetWidth + "px"');
387
- if (fixL) s.setExpression('left', fixL);
388
- if (fixT) s.setExpression('top', fixT);
389
- }
390
- else if (opts.centerY) {
391
- if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
392
- s.marginTop = 0;
393
- }
394
- else if (!opts.centerY && full) {
395
- var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
396
- var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
397
- s.setExpression('top',expression);
398
- }
399
- });
400
- }
401
-
402
- // show the message
403
- if (msg) {
404
- if (opts.theme)
405
- lyr3.find('.ui-widget-content').append(msg);
406
- else
407
- lyr3.append(msg);
408
- if (msg.jquery || msg.nodeType)
409
- $(msg).show();
410
- }
411
-
412
- if ((msie || opts.forceIframe) && opts.showOverlay)
413
- lyr1.show(); // opacity is zero
414
- if (opts.fadeIn) {
415
- var cb = opts.onBlock ? opts.onBlock : noOp;
416
- var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
417
- var cb2 = msg ? cb : noOp;
418
- if (opts.showOverlay)
419
- lyr2._fadeIn(opts.fadeIn, cb1);
420
- if (msg)
421
- lyr3._fadeIn(opts.fadeIn, cb2);
422
- }
423
- else {
424
- if (opts.showOverlay)
425
- lyr2.show();
426
- if (msg)
427
- lyr3.show();
428
- if (opts.onBlock)
429
- opts.onBlock();
430
- }
431
-
432
- // bind key and mouse events
433
- bind(1, el, opts);
434
-
435
- if (full) {
436
- pageBlock = lyr3[0];
437
- pageBlockEls = $(opts.focusableElements,pageBlock);
438
- if (opts.focusInput)
439
- setTimeout(focus, 20);
440
- }
441
- else
442
- center(lyr3[0], opts.centerX, opts.centerY);
443
-
444
- if (opts.timeout) {
445
- // auto-unblock
446
- var to = setTimeout(function() {
447
- if (full)
448
- $.unblockUI(opts);
449
- else
450
- $(el).unblock(opts);
451
- }, opts.timeout);
452
- $(el).data('blockUI.timeout', to);
453
- }
454
- }
455
-
456
- // remove the block
457
- function remove(el, opts) {
458
- var count;
459
- var full = (el == window);
460
- var $el = $(el);
461
- var data = $el.data('blockUI.history');
462
- var to = $el.data('blockUI.timeout');
463
- if (to) {
464
- clearTimeout(to);
465
- $el.removeData('blockUI.timeout');
466
- }
467
- opts = $.extend({}, $.blockUI.defaults, opts || {});
468
- bind(0, el, opts); // unbind events
469
-
470
- if (opts.onUnblock === null) {
471
- opts.onUnblock = $el.data('blockUI.onUnblock');
472
- $el.removeData('blockUI.onUnblock');
473
- }
474
-
475
- var els;
476
- if (full) // crazy selector to handle odd field errors in ie6/7
477
- els = $('body').children().filter('.blockUI').add('body > .blockUI');
478
- else
479
- els = $el.find('>.blockUI');
480
-
481
- // fix cursor issue
482
- if ( opts.cursorReset ) {
483
- if ( els.length > 1 )
484
- els[1].style.cursor = opts.cursorReset;
485
- if ( els.length > 2 )
486
- els[2].style.cursor = opts.cursorReset;
487
- }
488
-
489
- if (full)
490
- pageBlock = pageBlockEls = null;
491
-
492
- if (opts.fadeOut) {
493
- count = els.length;
494
- els.fadeOut(opts.fadeOut, function() {
495
- if ( --count === 0)
496
- reset(els,data,opts,el);
497
- });
498
- }
499
- else
500
- reset(els, data, opts, el);
501
- }
502
-
503
- // move blocking element back into the DOM where it started
504
- function reset(els,data,opts,el) {
505
- var $el = $(el);
506
- els.each(function(i,o) {
507
- // remove via DOM calls so we don't lose event handlers
508
- if (this.parentNode)
509
- this.parentNode.removeChild(this);
510
- });
511
-
512
- if (data && data.el) {
513
- data.el.style.display = data.display;
514
- data.el.style.position = data.position;
515
- if (data.parent)
516
- data.parent.appendChild(data.el);
517
- $el.removeData('blockUI.history');
518
- }
519
-
520
- if ($el.data('blockUI.static')) {
521
- $el.css('position', 'static'); // #22
522
- }
523
-
524
- if (typeof opts.onUnblock == 'function')
525
- opts.onUnblock(el,opts);
526
-
527
- // fix issue in Safari 6 where block artifacts remain until reflow
528
- var body = $(document.body), w = body.width(), cssW = body[0].style.width;
529
- body.width(w-1).width(w);
530
- body[0].style.width = cssW;
531
- }
532
-
533
- // bind/unbind the handler
534
- function bind(b, el, opts) {
535
- var full = el == window, $el = $(el);
536
-
537
- // don't bother unbinding if there is nothing to unbind
538
- if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
539
- return;
540
-
541
- $el.data('blockUI.isBlocked', b);
542
-
543
- // don't bind events when overlay is not in use or if bindEvents is false
544
- if (!full || !opts.bindEvents || (b && !opts.showOverlay))
545
- return;
546
-
547
- // bind anchors and inputs for mouse and key events
548
- var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
549
- if (b)
550
- $(document).bind(events, opts, handler);
551
- else
552
- $(document).unbind(events, handler);
553
-
554
- // former impl...
555
- // var $e = $('a,:input');
556
- // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
557
- }
558
-
559
- // event handler to suppress keyboard/mouse events when blocking
560
- function handler(e) {
561
- // allow tab navigation (conditionally)
562
- if (e.keyCode && e.keyCode == 9) {
563
- if (pageBlock && e.data.constrainTabKey) {
564
- var els = pageBlockEls;
565
- var fwd = !e.shiftKey && e.target === els[els.length-1];
566
- var back = e.shiftKey && e.target === els[0];
567
- if (fwd || back) {
568
- setTimeout(function(){focus(back);},10);
569
- return false;
570
- }
571
- }
572
- }
573
- var opts = e.data;
574
- var target = $(e.target);
575
- if (target.hasClass('blockOverlay') && opts.onOverlayClick)
576
- opts.onOverlayClick();
577
-
578
- // allow events within the message content
579
- if (target.parents('div.' + opts.blockMsgClass).length > 0)
580
- return true;
581
-
582
- // allow events for content that is not being blocked
583
- return target.parents().children().filter('div.blockUI').length === 0;
584
- }
585
-
586
- function focus(back) {
587
- if (!pageBlockEls)
588
- return;
589
- var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
590
- if (e)
591
- e.focus();
592
- }
593
-
594
- function center(el, x, y) {
595
- var p = el.parentNode, s = el.style;
596
- var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
597
- var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
598
- if (x) s.left = l > 0 ? (l+'px') : '0';
599
- if (y) s.top = t > 0 ? (t+'px') : '0';
600
- }
601
-
602
- function sz(el, p) {
603
- return parseInt($.css(el,p),10)||0;
604
- }
605
-
606
- }
607
-
608
-
609
- /*global define:true */
610
- if (typeof define === 'function' && define.amd && define.amd.jQuery) {
611
- define(['jquery'], setup);
612
- } else {
613
- setup(jQuery);
614
- }
615
-
616
  })();
1
+ /*!
2
+ * jQuery blockUI plugin
3
+ * Version 2.61.0-2013.06.06
4
+ * @requires jQuery v1.7 or later
5
+ *
6
+ * Examples at: http://malsup.com/jquery/block/
7
+ * Copyright (c) 2007-2013 M. Alsup
8
+ * Dual licensed under the MIT and GPL licenses:
9
+ * http://www.opensource.org/licenses/mit-license.php
10
+ * http://www.gnu.org/licenses/gpl.html
11
+ *
12
+ * Thanks to Amir-Hossein Sobhi for some excellent contributions!
13
+ */
14
+
15
+ ;(function() {
16
+ /*jshint eqeqeq:false curly:false latedef:false */
17
+ "use strict";
18
+
19
+ function setup($) {
20
+ $.fn._fadeIn = $.fn.fadeIn;
21
+
22
+ var noOp = $.noop || function() {};
23
+
24
+ // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
25
+ // retarded userAgent strings on Vista)
26
+ var msie = /MSIE/.test(navigator.userAgent);
27
+ var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
28
+ var mode = document.documentMode || 0;
29
+ var setExpr = $.isFunction( document.createElement('div').style.setExpression );
30
+
31
+ // global $ methods for blocking/unblocking the entire page
32
+ $.blockUI = function(opts) { install(window, opts); };
33
+ $.unblockUI = function(opts) { remove(window, opts); };
34
+
35
+ // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
36
+ $.growlUI = function(title, message, timeout, onClose) {
37
+ var $m = $('<div class="growlUI"></div>');
38
+ if (title) $m.append('<h1>'+title+'</h1>');
39
+ if (message) $m.append('<h2>'+message+'</h2>');
40
+ if (timeout === undefined) timeout = 3000;
41
+
42
+ // Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications
43
+ var callBlock = function(opts) {
44
+ opts = opts || {};
45
+
46
+ $.blockUI({
47
+ message: $m,
48
+ fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,
49
+ fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
50
+ timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
51
+ centerY: false,
52
+ showOverlay: false,
53
+ onUnblock: onClose,
54
+ css: $.blockUI.defaults.growlCSS
55
+ });
56
+ };
57
+
58
+ callBlock();
59
+ var nonmousedOpacity = $m.css('opacity');
60
+ $m.mouseover(function() {
61
+ callBlock({
62
+ fadeIn: 0,
63
+ timeout: 30000
64
+ });
65
+
66
+ var displayBlock = $('.blockMsg');
67
+ displayBlock.stop(); // cancel fadeout if it has started
68
+ displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
69
+ }).mouseout(function() {
70
+ $('.blockMsg').fadeOut(1000);
71
+ });
72
+ // End konapun additions
73
+ };
74
+
75
+ // plugin method for blocking element content
76
+ $.fn.block = function(opts) {
77
+ if ( this[0] === window ) {
78
+ $.blockUI( opts );
79
+ return this;
80
+ }
81
+ var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
82
+ this.each(function() {
83
+ var $el = $(this);
84
+ if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
85
+ return;
86
+ $el.unblock({ fadeOut: 0 });
87
+ });
88
+
89
+ return this.each(function() {
90
+ if ($.css(this,'position') == 'static') {
91
+ this.style.position = 'relative';
92
+ $(this).data('blockUI.static', true);
93
+ }
94
+ this.style.zoom = 1; // force 'hasLayout' in ie
95
+ install(this, opts);
96
+ });
97
+ };
98
+
99
+ // plugin method for unblocking element content
100
+ $.fn.unblock = function(opts) {
101
+ if ( this[0] === window ) {
102
+ $.unblockUI( opts );
103
+ return this;
104
+ }
105
+ return this.each(function() {
106
+ remove(this, opts);
107
+ });
108
+ };
109
+
110
+ $.blockUI.version = 2.60; // 2nd generation blocking at no extra cost!
111
+
112
+ // override these in your code to change the default behavior and style
113
+ $.blockUI.defaults = {
114
+ // message displayed when blocking (use null for no message)
115
+ message: '<h1>Please wait...</h1>',
116
+
117
+ title: null, // title string; only used when theme == true
118
+ draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
119
+
120
+ theme: false, // set to true to use with jQuery UI themes
121
+
122
+ // styles for the message when blocking; if you wish to disable
123
+ // these and use an external stylesheet then do this in your code:
124
+ // $.blockUI.defaults.css = {};
125
+ css: {
126
+ padding: 0,
127
+ margin: 0,
128
+ width: '30%',
129
+ top: '40%',
130
+ left: '35%',
131
+ textAlign: 'center',
132
+ color: '#000',
133
+ border: '3px solid #aaa',
134
+ backgroundColor:'#fff',
135
+ cursor: 'wait'
136
+ },
137
+
138
+ // minimal style set used when themes are used
139
+ themedCSS: {
140
+ width: '30%',
141
+ top: '40%',
142
+ left: '35%'
143
+ },
144
+
145
+ // styles for the overlay
146
+ overlayCSS: {
147
+ backgroundColor: '#000',
148
+ opacity: 0.6,
149
+ cursor: 'wait'
150
+ },
151
+
152
+ // style to replace wait cursor before unblocking to correct issue
153
+ // of lingering wait cursor
154
+ cursorReset: 'default',
155
+
156
+ // styles applied when using $.growlUI
157
+ growlCSS: {
158
+ width: '350px',
159
+ top: '10px',
160
+ left: '',
161
+ right: '10px',
162
+ border: 'none',
163
+ padding: '5px',
164
+ opacity: 0.6,
165
+ cursor: 'default',
166
+ color: '#fff',
167
+ backgroundColor: '#000',
168
+ '-webkit-border-radius':'10px',
169
+ '-moz-border-radius': '10px',
170
+ 'border-radius': '10px'
171
+ },
172
+
173
+ // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
174
+ // (hat tip to Jorge H. N. de Vasconcelos)
175
+ /*jshint scripturl:true */
176
+ iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
177
+
178
+ // force usage of iframe in non-IE browsers (handy for blocking applets)
179
+ forceIframe: false,
180
+
181
+ // z-index for the blocking overlay
182
+ baseZ: 1000,
183
+
184
+ // set these to true to have the message automatically centered
185
+ centerX: true, // <-- only effects element blocking (page block controlled via css above)
186
+ centerY: true,
187
+
188
+ // allow body element to be stetched in ie6; this makes blocking look better
189
+ // on "short" pages. disable if you wish to prevent changes to the body height
190
+ allowBodyStretch: true,
191
+
192
+ // enable if you want key and mouse events to be disabled for content that is blocked
193
+ bindEvents: true,
194
+
195
+ // be default blockUI will supress tab navigation from leaving blocking content
196
+ // (if bindEvents is true)
197
+ constrainTabKey: true,
198
+
199
+ // fadeIn time in millis; set to 0 to disable fadeIn on block
200
+ fadeIn: 200,
201
+
202
+ // fadeOut time in millis; set to 0 to disable fadeOut on unblock
203
+ fadeOut: 400,
204
+
205
+ // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
206
+ timeout: 0,
207
+
208
+ // disable if you don't want to show the overlay
209
+ showOverlay: true,
210
+
211
+ // if true, focus will be placed in the first available input field when
212
+ // page blocking
213
+ focusInput: true,
214
+
215
+ // elements that can receive focus
216
+ focusableElements: ':input:enabled:visible',
217
+
218
+ // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
219
+ // no longer needed in 2012
220
+ // applyPlatformOpacityRules: true,
221
+
222
+ // callback method invoked when fadeIn has completed and blocking message is visible
223
+ onBlock: null,
224
+
225
+ // callback method invoked when unblocking has completed; the callback is
226
+ // passed the element that has been unblocked (which is the window object for page
227
+ // blocks) and the options that were passed to the unblock call:
228
+ // onUnblock(element, options)
229
+ onUnblock: null,
230
+
231
+ // callback method invoked when the overlay area is clicked.
232
+ // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
233
+ onOverlayClick: null,
234
+
235
+ // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
236
+ quirksmodeOffsetHack: 4,
237
+
238
+ // class name of the message block
239
+ blockMsgClass: 'blockMsg',
240
+
241
+ // if it is already blocked, then ignore it (don't unblock and reblock)
242
+ ignoreIfBlocked: false
243
+ };
244
+
245
+ // private data and functions follow...
246
+
247
+ var pageBlock = null;
248
+ var pageBlockEls = [];
249
+
250
+ function install(el, opts) {
251
+ var css, themedCSS;
252
+ var full = (el == window);
253
+ var msg = (opts && opts.message !== undefined ? opts.message : undefined);
254
+ opts = $.extend({}, $.blockUI.defaults, opts || {});
255
+
256
+ if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
257
+ return;
258
+
259
+ opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
260
+ css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
261
+ if (opts.onOverlayClick)
262
+ opts.overlayCSS.cursor = 'pointer';
263
+
264
+ themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
265
+ msg = msg === undefined ? opts.message : msg;
266
+
267
+ // remove the current block (if there is one)
268
+ if (full && pageBlock)
269
+ remove(window, {fadeOut:0});
270
+
271
+ // if an existing element is being used as the blocking content then we capture
272
+ // its current place in the DOM (and current display style) so we can restore
273
+ // it when we unblock
274
+ if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
275
+ var node = msg.jquery ? msg[0] : msg;
276
+ var data = {};
277
+ $(el).data('blockUI.history', data);
278
+ data.el = node;
279
+ data.parent = node.parentNode;
280
+ data.display = node.style.display;
281
+ data.position = node.style.position;
282
+ if (data.parent)
283
+ data.parent.removeChild(node);
284
+ }
285
+
286
+ $(el).data('blockUI.onUnblock', opts.onUnblock);
287
+ var z = opts.baseZ;
288
+
289
+ // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
290
+ // layer1 is the iframe layer which is used to supress bleed through of underlying content
291
+ // layer2 is the overlay layer which has opacity and a wait cursor (by default)
292
+ // layer3 is the message content that is displayed while blocking
293
+ var lyr1, lyr2, lyr3, s;
294
+ if (msie || opts.forceIframe)
295
+ lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>');
296
+ else
297
+ lyr1 = $('<div class="blockUI" style="display:none"></div>');
298
+
299
+ if (opts.theme)
300
+ lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>');
301
+ else
302
+ lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
303
+
304
+ if (opts.theme && full) {
305
+ s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';
306
+ if ( opts.title ) {
307
+ s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
308
+ }
309
+ s += '<div class="ui-widget-content ui-dialog-content"></div>';
310
+ s += '</div>';
311
+ }
312
+ else if (opts.theme) {
313
+ s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';
314
+ if ( opts.title ) {
315
+ s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
316
+ }
317
+ s += '<div class="ui-widget-content ui-dialog-content"></div>';
318
+ s += '</div>';
319
+ }
320
+ else if (full) {
321
+ s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
322
+ }
323
+ else {
324
+ s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
325
+ }
326
+ lyr3 = $(s);
327
+
328
+ // if we have a message, style it
329
+ if (msg) {
330
+ if (opts.theme) {
331
+ lyr3.css(themedCSS);
332
+ lyr3.addClass('ui-widget-content');
333
+ }
334
+ else
335
+ lyr3.css(css);
336
+ }
337
+
338
+ // style the overlay
339
+ if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
340
+ lyr2.css(opts.overlayCSS);
341
+ lyr2.css('position', full ? 'fixed' : 'absolute');
342
+
343
+ // make iframe layer transparent in IE
344
+ if (msie || opts.forceIframe)
345
+ lyr1.css('opacity',0.0);
346
+
347
+ //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
348
+ var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
349
+ $.each(layers, function() {
350
+ this.appendTo($par);
351
+ });
352
+
353
+ if (opts.theme && opts.draggable && $.fn.draggable) {
354
+ lyr3.draggable({
355
+ handle: '.ui-dialog-titlebar',
356
+ cancel: 'li'
357
+ });
358
+ }
359
+
360
+ // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
361
+ var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
362
+ if (ie6 || expr) {
363
+ // give body 100% height
364
+ if (full && opts.allowBodyStretch && $.support.boxModel)
365
+ $('html,body').css('height','100%');
366
+
367
+ // fix ie6 issue when blocked element has a border width
368
+ if ((ie6 || !$.support.boxModel) && !full) {
369
+ var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
370
+ var fixT = t ? '(0 - '+t+')' : 0;
371
+ var fixL = l ? '(0 - '+l+')' : 0;
372
+ }
373
+
374
+ // simulate fixed position
375
+ $.each(layers, function(i,o) {
376
+ var s = o[0].style;
377
+ s.position = 'absolute';
378
+ if (i < 2) {
379
+ if (full)
380
+ s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');
381
+ else
382
+ s.setExpression('height','this.parentNode.offsetHeight + "px"');
383
+ if (full)
384
+ s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
385
+ else
386
+ s.setExpression('width','this.parentNode.offsetWidth + "px"');
387
+ if (fixL) s.setExpression('left', fixL);
388
+ if (fixT) s.setExpression('top', fixT);
389
+ }
390
+ else if (opts.centerY) {
391
+ if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
392
+ s.marginTop = 0;
393
+ }
394
+ else if (!opts.centerY && full) {
395
+ var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
396
+ var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
397
+ s.setExpression('top',expression);
398
+ }
399
+ });
400
+ }
401
+
402
+ // show the message
403
+ if (msg) {
404
+ if (opts.theme)
405
+ lyr3.find('.ui-widget-content').append(msg);
406
+ else
407
+ lyr3.append(msg);
408
+ if (msg.jquery || msg.nodeType)
409
+ $(msg).show();
410
+ }
411
+
412
+ if ((msie || opts.forceIframe) && opts.showOverlay)
413
+ lyr1.show(); // opacity is zero
414
+ if (opts.fadeIn) {
415
+ var cb = opts.onBlock ? opts.onBlock : noOp;
416
+ var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
417
+ var cb2 = msg ? cb : noOp;
418
+ if (opts.showOverlay)
419
+ lyr2._fadeIn(opts.fadeIn, cb1);
420
+ if (msg)
421
+ lyr3._fadeIn(opts.fadeIn, cb2);
422
+ }
423
+ else {
424
+ if (opts.showOverlay)
425
+ lyr2.show();
426
+ if (msg)
427
+ lyr3.show();
428
+ if (opts.onBlock)
429
+ opts.onBlock();
430
+ }
431
+
432
+ // bind key and mouse events
433
+ bind(1, el, opts);
434
+
435
+ if (full) {
436
+ pageBlock = lyr3[0];
437
+ pageBlockEls = $(opts.focusableElements,pageBlock);
438
+ if (opts.focusInput)
439
+ setTimeout(focus, 20);
440
+ }
441
+ else
442
+ center(lyr3[0], opts.centerX, opts.centerY);
443
+
444
+ if (opts.timeout) {
445
+ // auto-unblock
446
+ var to = setTimeout(function() {
447
+ if (full)
448
+ $.unblockUI(opts);
449
+ else
450
+ $(el).unblock(opts);
451
+ }, opts.timeout);
452
+ $(el).data('blockUI.timeout', to);
453
+ }
454
+ }
455
+
456
+ // remove the block
457
+ function remove(el, opts) {
458
+ var count;
459
+ var full = (el == window);
460
+ var $el = $(el);
461
+ var data = $el.data('blockUI.history');
462
+ var to = $el.data('blockUI.timeout');
463
+ if (to) {
464
+ clearTimeout(to);
465
+ $el.removeData('blockUI.timeout');
466
+ }
467
+ opts = $.extend({}, $.blockUI.defaults, opts || {});
468
+ bind(0, el, opts); // unbind events
469
+
470
+ if (opts.onUnblock === null) {
471
+ opts.onUnblock = $el.data('blockUI.onUnblock');
472
+ $el.removeData('blockUI.onUnblock');
473
+ }
474
+
475
+ var els;
476
+ if (full) // crazy selector to handle odd field errors in ie6/7
477
+ els = $('body').children().filter('.blockUI').add('body > .blockUI');
478
+ else
479
+ els = $el.find('>.blockUI');
480
+
481
+ // fix cursor issue
482
+ if ( opts.cursorReset ) {
483
+ if ( els.length > 1 )
484
+ els[1].style.cursor = opts.cursorReset;
485
+ if ( els.length > 2 )
486
+ els[2].style.cursor = opts.cursorReset;
487
+ }
488
+
489
+ if (full)
490
+ pageBlock = pageBlockEls = null;
491
+
492
+ if (opts.fadeOut) {
493
+ count = els.length;
494
+ els.fadeOut(opts.fadeOut, function() {
495
+ if ( --count === 0)
496
+ reset(els,data,opts,el);
497
+ });
498
+ }
499
+ else
500
+ reset(els, data, opts, el);
501
+ }
502
+
503
+ // move blocking element back into the DOM where it started
504
+ function reset(els,data,opts,el) {
505
+ var $el = $(el);
506
+ els.each(function(i,o) {
507
+ // remove via DOM calls so we don't lose event handlers
508
+ if (this.parentNode)
509
+ this.parentNode.removeChild(this);
510
+ });
511
+
512
+ if (data && data.el) {
513
+ data.el.style.display = data.display;
514
+ data.el.style.position = data.position;
515
+ if (data.parent)
516
+ data.parent.appendChild(data.el);
517
+ $el.removeData('blockUI.history');
518
+ }
519
+
520
+ if ($el.data('blockUI.static')) {
521
+ $el.css('position', 'static'); // #22
522
+ }
523
+
524
+ if (typeof opts.onUnblock == 'function')
525
+ opts.onUnblock(el,opts);
526
+
527
+ // fix issue in Safari 6 where block artifacts remain until reflow
528
+ var body = $(document.body), w = body.width(), cssW = body[0].style.width;
529
+ body.width(w-1).width(w);
530
+ body[0].style.width = cssW;
531
+ }
532
+
533
+ // bind/unbind the handler
534
+ function bind(b, el, opts) {
535
+ var full = el == window, $el = $(el);
536
+
537
+ // don't bother unbinding if there is nothing to unbind
538
+ if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
539
+ return;
540
+
541
+ $el.data('blockUI.isBlocked', b);
542
+
543
+ // don't bind events when overlay is not in use or if bindEvents is false
544
+ if (!full || !opts.bindEvents || (b && !opts.showOverlay))
545
+ return;
546
+
547
+ // bind anchors and inputs for mouse and key events
548
+ var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
549
+ if (b)
550
+ $(document).bind(events, opts, handler);
551
+ else
552
+ $(document).unbind(events, handler);
553
+
554
+ // former impl...
555
+ // var $e = $('a,:input');
556
+ // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
557
+ }
558
+
559
+ // event handler to suppress keyboard/mouse events when blocking
560
+ function handler(e) {
561
+ // allow tab navigation (conditionally)
562
+ if (e.keyCode && e.keyCode == 9) {
563
+ if (pageBlock && e.data.constrainTabKey) {
564
+ var els = pageBlockEls;
565
+ var fwd = !e.shiftKey && e.target === els[els.length-1];
566
+ var back = e.shiftKey && e.target === els[0];
567
+ if (fwd || back) {
568
+ setTimeout(function(){focus(back);},10);
569
+ return false;
570
+ }
571
+ }
572
+ }
573
+ var opts = e.data;
574
+ var target = $(e.target);
575
+ if (target.hasClass('blockOverlay') && opts.onOverlayClick)
576
+ opts.onOverlayClick();
577
+
578
+ // allow events within the message content
579
+ if (target.parents('div.' + opts.blockMsgClass).length > 0)
580
+ return true;
581
+
582
+ // allow events for content that is not being blocked
583
+ return target.parents().children().filter('div.blockUI').length === 0;
584
+ }
585
+
586
+ function focus(back) {
587
+ if (!pageBlockEls)
588
+ return;
589
+ var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
590
+ if (e)
591
+ e.focus();
592
+ }
593
+
594
+ function center(el, x, y) {
595
+ var p = el.parentNode, s = el.style;
596
+ var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
597
+ var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
598
+ if (x) s.left = l > 0 ? (l+'px') : '0';
599
+ if (y) s.top = t > 0 ? (t+'px') : '0';
600
+ }
601
+
602
+ function sz(el, p) {
603
+ return parseInt($.css(el,p),10)||0;
604
+ }
605
+
606
+ }
607
+
608
+
609
+ /*global define:true */
610
+ if (typeof define === 'function' && define.amd && define.amd.jQuery) {
611
+ define(['jquery'], setup);
612
+ } else {
613
+ setup(jQuery);
614
+ }
615
+
616
  })();
assets/js/chosen/chosen.css CHANGED
@@ -1,413 +1,413 @@
1
- /* @group Base */
2
- .chzn-container {
3
- font-size: 13px;
4
- position: relative;
5
- display: inline-block;
6
- zoom: 1;
7
- *display: inline;
8
- }
9
- .chzn-container .chzn-drop {
10
- background: #fff;
11
- border: 1px solid #aaa;
12
- border-top: 0;
13
- position: absolute;
14
- top: 29px;
15
- left: 0;
16
- -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15);
17
- -moz-box-shadow : 0 4px 5px rgba(0,0,0,.15);
18
- box-shadow : 0 4px 5px rgba(0,0,0,.15);
19
- z-index: 1010;
20
- }
21
- /* @end */
22
-
23
- /* @group Single Chosen */
24
- .chzn-container-single .chzn-single {
25
- background-color: #ffffff;
26
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0 );
27
- background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
28
- background-image: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
29
- background-image: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
30
- background-image: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
31
- background-image: linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
32
- -webkit-border-radius: 5px;
33
- -moz-border-radius : 5px;
34
- border-radius : 5px;
35
- -moz-background-clip : padding;
36
- -webkit-background-clip: padding-box;
37
- background-clip : padding-box;
38
- border: 1px solid #aaaaaa;
39
- -webkit-box-shadow: 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
40
- -moz-box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
41
- box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
42
- display: block;
43
- overflow: hidden;
44
- white-space: nowrap;
45
- position: relative;
46
- height: 23px;
47
- line-height: 24px;
48
- padding: 0 0 0 8px;
49
- color: #444444;
50
- text-decoration: none;
51
- }
52
- .chzn-container-single .chzn-default {
53
- color: #999;
54
- }
55
- .chzn-container-single .chzn-single span {
56
- margin-right: 26px;
57
- display: block;
58
- overflow: hidden;
59
- white-space: nowrap;
60
- -o-text-overflow: ellipsis;
61
- -ms-text-overflow: ellipsis;
62
- text-overflow: ellipsis;
63
- }
64
- .chzn-container-single .chzn-single abbr {
65
- display: block;
66
- position: absolute;
67
- right: 26px;
68
- top: 6px;
69
- width: 12px;
70
- height: 12px;
71
- font-size: 1px;
72
- background: url('chosen-sprite.png') -42px 1px no-repeat;
73
- }
74
- .chzn-container-single .chzn-single abbr:hover {
75
- background-position: -42px -10px;
76
- }
77
- .chzn-container-single.chzn-disabled .chzn-single abbr:hover {
78
- background-position: -42px -10px;
79
- }
80
- .chzn-container-single .chzn-single div {
81
- position: absolute;
82
- right: 0;
83
- top: 0;
84
- display: block;
85
- height: 100%;
86
- width: 18px;
87
- }
88
- .chzn-container-single .chzn-single div b {
89
- background: url('chosen-sprite.png') no-repeat 0px 2px;
90
- display: block;
91
- width: 100%;
92
- height: 100%;
93
- }
94
- .chzn-container-single .chzn-search {
95
- padding: 3px 4px;
96
- position: relative;
97
- margin: 0;
98
- white-space: nowrap;
99
- z-index: 1010;
100
- }
101
- .chzn-container-single .chzn-search input {
102
- background: #fff url('chosen-sprite.png') no-repeat 100% -20px;
103
- background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
104
- background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
105
- background: url('chosen-sprite.png') no-repeat 100% -20px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
106
- background: url('chosen-sprite.png') no-repeat 100% -20px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
107
- background: url('chosen-sprite.png') no-repeat 100% -20px, linear-gradient(#eeeeee 1%, #ffffff 15%);
108
- margin: 1px 0;
109
- padding: 4px 20px 4px 5px;
110
- outline: 0;
111
- border: 1px solid #aaa;
112
- font-family: sans-serif;
113
- font-size: 1em;
114
- }
115
- .chzn-container-single .chzn-drop {
116
- -webkit-border-radius: 0 0 4px 4px;
117
- -moz-border-radius : 0 0 4px 4px;
118
- border-radius : 0 0 4px 4px;
119
- -moz-background-clip : padding;
120
- -webkit-background-clip: padding-box;
121
- background-clip : padding-box;
122
- }
123
- /* @end */
124
-
125
- .chzn-container-single-nosearch .chzn-search input {
126
- position: absolute;
127
- left: -9000px;
128
- }
129
-
130
- /* @group Multi Chosen */
131
- .chzn-container-multi .chzn-choices {
132
- background-color: #fff;
133
- background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
134
- background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
135
- background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
136
- background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
137
- background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
138
- border: 1px solid #aaa;
139
- margin: 0;
140
- padding: 0;
141
- cursor: text;
142
- overflow: hidden;
143
- height: auto !important;
144
- height: 1%;
145
- position: relative;
146
- }
147
- .chzn-container-multi .chzn-choices li {
148
- float: left;
149
- list-style: none;
150
- }
151
- .chzn-container-multi .chzn-choices .search-field {
152
- white-space: nowrap;
153
- margin: 0;
154
- padding: 0;
155
- }
156
- .chzn-container-multi .chzn-choices .search-field input {
157
- color: #666;
158
- background: transparent !important;
159
- border: 0 !important;
160
- font-family: sans-serif;
161
- font-size: 100%;
162
- height: 15px;
163
- padding: 5px;
164
- margin: 1px 0;
165
- outline: 0;
166
- -webkit-box-shadow: none;
167
- -moz-box-shadow : none;
168
- box-shadow : none;
169
- }
170
- .chzn-container-multi .chzn-choices .search-field .default {
171
- color: #999;
172
- }
173
- .chzn-container-multi .chzn-choices .search-choice {
174
- -webkit-border-radius: 3px;
175
- -moz-border-radius : 3px;
176
- border-radius : 3px;
177
- -moz-background-clip : padding;
178
- -webkit-background-clip: padding-box;
179
- background-clip : padding-box;
180
- background-color: #e4e4e4;
181
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
182
- background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
183
- background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
184
- background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
185
- background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
186
- background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
187
- -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
188
- -moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
189
- box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
190
- color: #333;
191
- border: 1px solid #aaaaaa;
192
- line-height: 13px;
193
- padding: 3px 20px 3px 5px;
194
- margin: 3px 0 3px 5px;
195
- position: relative;
196
- cursor: default;
197
- }
198
- .chzn-container-multi .chzn-choices .search-choice.search-choice-disabled {
199
- background-color: #e4e4e4;
200
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
201
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
202
- background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
203
- background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
204
- background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
205
- background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
206
- background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
207
- color: #666;
208
- border: 1px solid #cccccc;
209
- padding-right: 5px;
210
- }
211
- .chzn-container-multi .chzn-choices .search-choice-focus {
212
- background: #d4d4d4;
213
- }
214
- .chzn-container-multi .chzn-choices .search-choice .search-choice-close {
215
- display: block;
216
- position: absolute;
217
- right: 3px;
218
- top: 4px;
219
- width: 12px;
220
- height: 12px;
221
- font-size: 1px;
222
- background: url('chosen-sprite.png') -42px 1px no-repeat;
223
- }
224
- .chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover {
225
- background-position: -42px -10px;
226
- }
227
- .chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close {
228
- background-position: -42px -10px;
229
- }
230
- /* @end */
231
-
232
- /* @group Results */
233
- .chzn-container .chzn-results {
234
- margin: 0 4px 4px 0;
235
- max-height: 240px;
236
- padding: 0 0 0 4px;
237
- position: relative;
238
- overflow-x: hidden;
239
- overflow-y: auto;
240
- -webkit-overflow-scrolling: touch;
241
- }
242
- .chzn-container-multi .chzn-results {
243
- margin: -1px 0 0;
244
- padding: 0;
245
- }
246
- .chzn-container .chzn-results li {
247
- display: none;
248
- line-height: 15px;
249
- padding: 5px 6px;
250
- margin: 0;
251
- list-style: none;
252
- }
253
- .chzn-container .chzn-results .active-result {
254
- cursor: pointer;
255
- display: list-item;
256
- }
257
- .chzn-container .chzn-results .highlighted {
258
- background-color: #3875d7;
259
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3875d7', endColorstr='#2a62bc', GradientType=0 );
260
- background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
261
- background-image: -webkit-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
262
- background-image: -moz-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
263
- background-image: -o-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
264
- background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
265
- color: #fff;
266
- }
267
- .chzn-container .chzn-results li em {
268
- background: #feffde;
269
- font-style: normal;
270
- }
271
- .chzn-container .chzn-results .highlighted em {
272
- background: transparent;
273
- }
274
- .chzn-container .chzn-results .no-results {
275
- background: #f4f4f4;
276
- display: list-item;
277
- }
278
- .chzn-container .chzn-results .group-result {
279
- cursor: default;
280
- color: #999;
281
- font-weight: bold;
282
- }
283
- .chzn-container .chzn-results .group-option {
284
- padding-left: 15px;
285
- }
286
- .chzn-container-multi .chzn-drop .result-selected {
287
- display: none;
288
- }
289
- .chzn-container .chzn-results-scroll {
290
- background: white;
291
- margin: 0 4px;
292
- position: absolute;
293
- text-align: center;
294
- width: 321px; /* This should by dynamic with js */
295
- z-index: 1;
296
- }
297
- .chzn-container .chzn-results-scroll span {
298
- display: inline-block;
299
- height: 17px;
300
- text-indent: -5000px;
301
- width: 9px;
302
- }
303
- .chzn-container .chzn-results-scroll-down {
304
- bottom: 0;
305
- }
306
- .chzn-container .chzn-results-scroll-down span {
307
- background: url('chosen-sprite.png') no-repeat -4px -3px;
308
- }
309
- .chzn-container .chzn-results-scroll-up span {
310
- background: url('chosen-sprite.png') no-repeat -22px -3px;
311
- }
312
- /* @end */
313
-
314
- /* @group Active */
315
- .chzn-container-active .chzn-single {
316
- -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
317
- -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
318
- box-shadow : 0 0 5px rgba(0,0,0,.3);
319
- border: 1px solid #5897fb;
320
- }
321
- .chzn-container-active .chzn-single-with-drop {
322
- border: 1px solid #aaa;
323
- -webkit-box-shadow: 0 1px 0 #fff inset;
324
- -moz-box-shadow : 0 1px 0 #fff inset;
325
- box-shadow : 0 1px 0 #fff inset;
326
- background-color: #eee;
327
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0 );
328
- background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
329
- background-image: -webkit-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
330
- background-image: -moz-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
331
- background-image: -o-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
332
- background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
333
- -webkit-border-bottom-left-radius : 0;
334
- -webkit-border-bottom-right-radius: 0;
335
- -moz-border-radius-bottomleft : 0;
336
- -moz-border-radius-bottomright: 0;
337
- border-bottom-left-radius : 0;
338
- border-bottom-right-radius: 0;
339
- }
340
- .chzn-container-active .chzn-single-with-drop div {
341
- background: transparent;
342
- border-left: none;
343
- }
344
- .chzn-container-active .chzn-single-with-drop div b {
345
- background-position: -18px 2px;
346
- }
347
- .chzn-container-active .chzn-choices {
348
- -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
349
- -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
350
- box-shadow : 0 0 5px rgba(0,0,0,.3);
351
- border: 1px solid #5897fb;
352
- }
353
- .chzn-container-active .chzn-choices .search-field input {
354
- color: #111 !important;
355
- }
356
- /* @end */
357
-
358
- /* @group Disabled Support */
359
- .chzn-disabled {
360
- cursor: default;
361
- opacity:0.5 !important;
362
- }
363
- .chzn-disabled .chzn-single {
364
- cursor: default;
365
- }
366
- .chzn-disabled .chzn-choices .search-choice .search-choice-close {
367
- cursor: default;
368
- }
369
-
370
- /* @group Right to Left */
371
- .chzn-rtl { text-align: right; }
372
- .chzn-rtl .chzn-single { padding: 0 8px 0 0; overflow: visible; }
373
- .chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; direction: rtl; }
374
-
375
- .chzn-rtl .chzn-single div { left: 3px; right: auto; }
376
- .chzn-rtl .chzn-single abbr {
377
- left: 26px;
378
- right: auto;
379
- }
380
- .chzn-rtl .chzn-choices .search-field input { direction: rtl; }
381
- .chzn-rtl .chzn-choices li { float: right; }
382
- .chzn-rtl .chzn-choices .search-choice { padding: 3px 5px 3px 19px; margin: 3px 5px 3px 0; }
383
- .chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 4px; right: auto; }
384
- .chzn-rtl.chzn-container-single .chzn-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; }
385
- .chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 15px; }
386
- .chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; }
387
- .chzn-rtl .chzn-search input {
388
- background: #fff url('chosen-sprite.png') no-repeat -30px -20px;
389
- background: url('chosen-sprite.png') no-repeat -30px -20px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
390
- background: url('chosen-sprite.png') no-repeat -30px -20px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
391
- background: url('chosen-sprite.png') no-repeat -30px -20px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
392
- background: url('chosen-sprite.png') no-repeat -30px -20px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
393
- background: url('chosen-sprite.png') no-repeat -30px -20px, linear-gradient(#eeeeee 1%, #ffffff 15%);
394
- padding: 4px 5px 4px 20px;
395
- direction: rtl;
396
- }
397
- .chzn-container-single.chzn-rtl .chzn-single div b {
398
- background-position: 6px 2px;
399
- }
400
- .chzn-container-single.chzn-rtl .chzn-single-with-drop div b {
401
- background-position: -12px 2px;
402
- }
403
- /* @end */
404
-
405
- /* @group Retina compatibility */
406
- @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {
407
- .chzn-rtl .chzn-search input, .chzn-container-single .chzn-single abbr, .chzn-container-single .chzn-single div b, .chzn-container-single .chzn-search input, .chzn-container-multi .chzn-choices .search-choice .search-choice-close, .chzn-container .chzn-results-scroll-down span, .chzn-container .chzn-results-scroll-up span {
408
- background-image: url('chosen-sprite@2x.png') !important;
409
- background-repeat: no-repeat !important;
410
- background-size: 52px 37px !important;
411
- }
412
- }
413
- /* @end */
1
+ /* @group Base */
2
+ .chzn-container {
3
+ font-size: 13px;
4
+ position: relative;
5
+ display: inline-block;
6
+ zoom: 1;
7
+ *display: inline;
8
+ }
9
+ .chzn-container .chzn-drop {
10
+ background: #fff;
11
+ border: 1px solid #aaa;
12
+ border-top: 0;
13
+ position: absolute;
14
+ top: 29px;
15
+ left: 0;
16
+ -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15);
17
+ -moz-box-shadow : 0 4px 5px rgba(0,0,0,.15);
18
+ box-shadow : 0 4px 5px rgba(0,0,0,.15);
19
+ z-index: 1010;
20
+ }
21
+ /* @end */
22
+
23
+ /* @group Single Chosen */
24
+ .chzn-container-single .chzn-single {
25
+ background-color: #ffffff;
26
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0 );
27
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
28
+ background-image: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
29
+ background-image: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
30
+ background-image: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
31
+ background-image: linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
32
+ -webkit-border-radius: 5px;
33
+ -moz-border-radius : 5px;
34
+ border-radius : 5px;
35
+ -moz-background-clip : padding;
36
+ -webkit-background-clip: padding-box;
37
+ background-clip : padding-box;
38
+ border: 1px solid #aaaaaa;
39
+ -webkit-box-shadow: 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
40
+ -moz-box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
41
+ box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
42
+ display: block;
43
+ overflow: hidden;
44
+ white-space: nowrap;
45
+ position: relative;
46
+ height: 23px;
47
+ line-height: 24px;
48
+ padding: 0 0 0 8px;
49
+ color: #444444;
50
+ text-decoration: none;
51
+ }
52
+ .chzn-container-single .chzn-default {
53
+ color: #999;
54
+ }
55
+ .chzn-container-single .chzn-single span {
56
+ margin-right: 26px;
57
+ display: block;
58
+ overflow: hidden;
59
+ white-space: nowrap;
60
+ -o-text-overflow: ellipsis;
61
+ -ms-text-overflow: ellipsis;
62
+ text-overflow: ellipsis;
63
+ }
64
+ .chzn-container-single .chzn-single abbr {
65
+ display: block;
66
+ position: absolute;
67
+ right: 26px;
68
+ top: 6px;
69
+ width: 12px;
70
+ height: 12px;
71
+ font-size: 1px;
72
+ background: url('chosen-sprite.png') -42px 1px no-repeat;
73
+ }
74
+ .chzn-container-single .chzn-single abbr:hover {
75
+ background-position: -42px -10px;
76
+ }
77
+ .chzn-container-single.chzn-disabled .chzn-single abbr:hover {
78
+ background-position: -42px -10px;
79
+ }
80
+ .chzn-container-single .chzn-single div {
81
+ position: absolute;
82
+ right: 0;
83
+ top: 0;
84
+ display: block;
85
+ height: 100%;
86
+ width: 18px;
87
+ }
88
+ .chzn-container-single .chzn-single div b {
89
+ background: url('chosen-sprite.png') no-repeat 0px 2px;
90
+ display: block;
91
+ width: 100%;
92
+ height: 100%;
93
+ }
94
+ .chzn-container-single .chzn-search {
95
+ padding: 3px 4px;
96
+ position: relative;
97
+ margin: 0;
98
+ white-space: nowrap;
99
+ z-index: 1010;
100
+ }
101
+ .chzn-container-single .chzn-search input {
102
+ background: #fff url('chosen-sprite.png') no-repeat 100% -20px;
103
+ background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
104
+ background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
105
+ background: url('chosen-sprite.png') no-repeat 100% -20px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
106
+ background: url('chosen-sprite.png') no-repeat 100% -20px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
107
+ background: url('chosen-sprite.png') no-repeat 100% -20px, linear-gradient(#eeeeee 1%, #ffffff 15%);
108
+ margin: 1px 0;
109
+ padding: 4px 20px 4px 5px;
110
+ outline: 0;
111
+ border: 1px solid #aaa;
112
+ font-family: sans-serif;
113
+ font-size: 1em;
114
+ }
115
+ .chzn-container-single .chzn-drop {
116
+ -webkit-border-radius: 0 0 4px 4px;
117
+ -moz-border-radius : 0 0 4px 4px;
118
+ border-radius : 0 0 4px 4px;
119
+ -moz-background-clip : padding;
120
+ -webkit-background-clip: padding-box;
121
+ background-clip : padding-box;
122
+ }
123
+ /* @end */
124
+
125
+ .chzn-container-single-nosearch .chzn-search input {
126
+ position: absolute;
127
+ left: -9000px;
128
+ }
129
+
130
+ /* @group Multi Chosen */
131
+ .chzn-container-multi .chzn-choices {
132
+ background-color: #fff;
133
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
134
+ background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
135
+ background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
136
+ background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
137
+ background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
138
+ border: 1px solid #aaa;
139
+ margin: 0;
140
+ padding: 0;
141
+ cursor: text;
142
+ overflow: hidden;
143
+ height: auto !important;
144
+ height: 1%;
145
+ position: relative;
146
+ }
147
+ .chzn-container-multi .chzn-choices li {
148
+ float: left;
149
+ list-style: none;
150
+ }
151
+ .chzn-container-multi .chzn-choices .search-field {
152
+ white-space: nowrap;
153
+ margin: 0;
154
+ padding: 0;
155
+ }
156
+ .chzn-container-multi .chzn-choices .search-field input {
157
+ color: #666;
158
+ background: transparent !important;
159
+ border: 0 !important;
160
+ font-family: sans-serif;
161
+ font-size: 100%;
162
+ height: 15px;
163
+ padding: 5px;
164
+ margin: 1px 0;
165
+ outline: 0;
166
+ -webkit-box-shadow: none;
167
+ -moz-box-shadow : none;
168
+ box-shadow : none;
169
+ }
170
+ .chzn-container-multi .chzn-choices .search-field .default {
171
+ color: #999;
172
+ }
173
+ .chzn-container-multi .chzn-choices .search-choice {
174
+ -webkit-border-radius: 3px;
175
+ -moz-border-radius : 3px;
176
+ border-radius : 3px;
177
+ -moz-background-clip : padding;
178
+ -webkit-background-clip: padding-box;
179
+ background-clip : padding-box;
180
+ background-color: #e4e4e4;
181
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
182
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
183
+ background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
184
+ background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
185
+ background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
186
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
187
+ -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
188
+ -moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
189
+ box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
190
+ color: #333;
191
+ border: 1px solid #aaaaaa;
192
+ line-height: 13px;
193
+ padding: 3px 20px 3px 5px;
194
+ margin: 3px 0 3px 5px;
195
+ position: relative;
196
+ cursor: default;
197
+ }
198
+ .chzn-container-multi .chzn-choices .search-choice.search-choice-disabled {
199
+ background-color: #e4e4e4;
200
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
201
+ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
202
+ background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
203
+ background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
204
+ background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
205
+ background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
206
+ background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
207
+ color: #666;
208
+ border: 1px solid #cccccc;
209
+ padding-right: 5px;
210
+ }
211
+ .chzn-container-multi .chzn-choices .search-choice-focus {
212
+ background: #d4d4d4;
213
+ }
214
+ .chzn-container-multi .chzn-choices .search-choice .search-choice-close {
215
+ display: block;
216
+ position: absolute;
217
+ right: 3px;
218
+ top: 4px;
219
+ width: 12px;
220
+ height: 12px;
221
+ font-size: 1px;
222
+ background: url('chosen-sprite.png') -42px 1px no-repeat;
223
+ }
224
+ .chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover {
225
+ background-position: -42px -10px;
226
+ }
227
+ .chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close {
228
+ background-position: -42px -10px;
229
+ }
230
+ /* @end */
231
+
232
+ /* @group Results */
233
+ .chzn-container .chzn-results {
234
+ margin: 0 4px 4px 0;
235
+ max-height: 240px;
236
+ padding: 0 0 0 4px;
237
+ position: relative;
238
+ overflow-x: hidden;
239
+ overflow-y: auto;
240
+ -webkit-overflow-scrolling: touch;
241
+ }
242
+ .chzn-container-multi .chzn-results {
243
+ margin: -1px 0 0;
244
+ padding: 0;
245
+ }
246
+ .chzn-container .chzn-results li {
247
+ display: none;
248
+ line-height: 15px;
249
+ padding: 5px 6px;
250
+ margin: 0;
251
+ list-style: none;
252
+ }
253
+ .chzn-container .chzn-results .active-result {
254
+ cursor: pointer;
255
+ display: list-item;
256
+ }
257
+ .chzn-container .chzn-results .highlighted {
258
+ background-color: #3875d7;
259
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3875d7', endColorstr='#2a62bc', GradientType=0 );
260
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
261
+ background-image: -webkit-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
262
+ background-image: -moz-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
263
+ background-image: -o-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
264
+ background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
265
+ color: #fff;
266
+ }
267
+ .chzn-container .chzn-results li em {
268
+ background: #feffde;
269
+ font-style: normal;
270
+ }
271
+ .chzn-container .chzn-results .highlighted em {
272
+ background: transparent;
273
+ }
274
+ .chzn-container .chzn-results .no-results {
275
+ background: #f4f4f4;
276
+ display: list-item;
277
+ }
278
+ .chzn-container .chzn-results .group-result {
279
+ cursor: default;
280
+ color: #999;
281
+ font-weight: bold;
282
+ }
283
+ .chzn-container .chzn-results .group-option {
284
+ padding-left: 15px;
285
+ }
286
+ .chzn-container-multi .chzn-drop .result-selected {
287
+ display: none;
288
+ }
289
+ .chzn-container .chzn-results-scroll {
290
+ background: white;
291
+ margin: 0 4px;
292
+ position: absolute;
293
+ text-align: center;
294
+ width: 321px; /* This should by dynamic with js */
295
+ z-index: 1;
296
+ }
297
+ .chzn-container .chzn-results-scroll span {
298
+ display: inline-block;
299
+ height: 17px;
300
+ text-indent: -5000px;
301
+ width: 9px;
302
+ }
303
+ .chzn-container .chzn-results-scroll-down {
304
+ bottom: 0;
305
+ }
306
+ .chzn-container .chzn-results-scroll-down span {
307
+ background: url('chosen-sprite.png') no-repeat -4px -3px;
308
+ }
309
+ .chzn-container .chzn-results-scroll-up span {
310
+ background: url('chosen-sprite.png') no-repeat -22px -3px;
311
+ }
312
+ /* @end */
313
+
314
+ /* @group Active */
315
+ .chzn-container-active .chzn-single {
316
+ -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
317
+ -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
318
+ box-shadow : 0 0 5px rgba(0,0,0,.3);
319
+ border: 1px solid #5897fb;
320
+ }
321
+ .chzn-container-active .chzn-single-with-drop {
322
+ border: 1px solid #aaa;
323
+ -webkit-box-shadow: 0 1px 0 #fff inset;
324
+ -moz-box-shadow : 0 1px 0 #fff inset;
325
+ box-shadow : 0 1px 0 #fff inset;
326
+ background-color: #eee;
327
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0 );
328
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
329
+ background-image: -webkit-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
330
+ background-image: -moz-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
331
+ background-image: -o-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
332
+ background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
333
+ -webkit-border-bottom-left-radius : 0;
334
+ -webkit-border-bottom-right-radius: 0;
335
+ -moz-border-radius-bottomleft : 0;
336
+ -moz-border-radius-bottomright: 0;
337
+ border-bottom-left-radius : 0;
338
+ border-bottom-right-radius: 0;
339
+ }
340
+ .chzn-container-active .chzn-single-with-drop div {
341
+ background: transparent;
342
+ border-left: none;
343
+ }
344
+ .chzn-container-active .chzn-single-with-drop div b {
345
+ background-position: -18px 2px;
346
+ }
347
+ .chzn-container-active .chzn-choices {
348
+ -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
349
+ -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
350
+ box-shadow : 0 0 5px rgba(0,0,0,.3);
351
+ border: 1px solid #5897fb;
352
+ }
353
+ .chzn-container-active .chzn-choices .search-field input {
354
+ color: #111 !important;
355
+ }
356
+ /* @end */
357
+
358
+ /* @group Disabled Support */
359
+ .chzn-disabled {
360
+ cursor: default;
361
+ opacity:0.5 !important;
362
+ }
363
+ .chzn-disabled .chzn-single {
364
+ cursor: default;
365
+ }
366
+ .chzn-disabled .chzn-choices .search-choice .search-choice-close {
367
+ cursor: default;
368
+ }
369
+
370
+ /* @group Right to Left */
371
+ .chzn-rtl { text-align: right; }
372
+ .chzn-rtl .chzn-single { padding: 0 8px 0 0; overflow: visible; }
373
+ .chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; direction: rtl; }
374
+
375
+ .chzn-rtl .chzn-single div { left: 3px; right: auto; }
376
+ .chzn-rtl .chzn-single abbr {
377
+ left: 26px;
378
+ right: auto;
379
+ }
380
+ .chzn-rtl .chzn-choices .search-field input { direction: rtl; }
381
+ .chzn-rtl .chzn-choices li { float: right; }
382
+ .chzn-rtl .chzn-choices .search-choice { padding: 3px 5px 3px 19px; margin: 3px 5px 3px 0; }
383
+ .chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 4px; right: auto; }
384
+ .chzn-rtl.chzn-container-single .chzn-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; }
385
+ .chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 15px; }
386
+ .chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; }
387
+ .chzn-rtl .chzn-search input {
388
+ background: #fff url('chosen-sprite.png') no-repeat -30px -20px;
389
+ background: url('chosen-sprite.png') no-repeat -30px -20px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
390
+ background: url('chosen-sprite.png') no-repeat -30px -20px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
391
+ background: url('chosen-sprite.png') no-repeat -30px -20px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
392
+ background: url('chosen-sprite.png') no-repeat -30px -20px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
393
+ background: url('chosen-sprite.png') no-repeat -30px -20px, linear-gradient(#eeeeee 1%, #ffffff 15%);
394
+ padding: 4px 5px 4px 20px;
395
+ direction: rtl;
396
+ }
397
+ .chzn-container-single.chzn-rtl .chzn-single div b {
398
+ background-position: 6px 2px;
399
+ }
400
+ .chzn-container-single.chzn-rtl .chzn-single-with-drop div b {
401
+ background-position: -12px 2px;
402
+ }
403
+ /* @end */
404
+
405
+ /* @group Retina compatibility */
406
+ @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {
407
+ .chzn-rtl .chzn-search input, .chzn-container-single .chzn-single abbr, .chzn-container-single .chzn-single div b, .chzn-container-single .chzn-search input, .chzn-container-multi .chzn-choices .search-choice .search-choice-close, .chzn-container .chzn-results-scroll-down span, .chzn-container .chzn-results-scroll-up span {
408
+ background-image: url('chosen-sprite@2x.png') !important;
409
+ background-repeat: no-repeat !important;
410
+ background-size: 52px 37px !important;
411
+ }
412
+ }
413
+ /* @end */
assets/js/chosen/chosen.jquery.js CHANGED
@@ -1,1090 +1,1090 @@
1
- // Chosen, a Select Box Enhancer for jQuery and Protoype
2
- // by Patrick Filler for Harvest, http://getharvest.com
3
- //
4
- // Version 0.9.12
5
- // Full source at https://github.com/harvesthq/chosen
6
- // Copyright (c) 2011 Harvest http://getharvest.com
7
-
8
- // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
9
- // This file is generated by `cake build`, do not edit it by hand.
10
- (function() {
11
- var SelectParser;
12
-
13
- SelectParser = (function() {
14
-
15
- function SelectParser() {
16
- this.options_index = 0;
17
- this.parsed = [];
18
- }
19
-
20
- SelectParser.prototype.add_node = function(child) {
21
- if (child.nodeName.toUpperCase() === "OPTGROUP") {
22
- return this.add_group(child);
23
- } else {
24
- return this.add_option(child);
25
- }
26
- };
27
-
28
- SelectParser.prototype.add_group = function(group) {
29
- var group_position, option, _i, _len, _ref, _results;
30
- group_position = this.parsed.length;
31
- this.parsed.push({
32
- array_index: group_position,
33
- group: true,
34
- label: group.label,
35
- children: 0,
36
- disabled: group.disabled
37
- });
38
- _ref = group.childNodes;
39
- _results = [];
40
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
41
- option = _ref[_i];
42
- _results.push(this.add_option(option, group_position, group.disabled));
43
- }
44
- return _results;
45
- };
46
-
47
- SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
48
- if (option.nodeName.toUpperCase() === "OPTION") {
49
- if (option.text !== "") {
50
- if (group_position != null) {
51
- this.parsed[group_position].children += 1;
52
- }
53
- this.parsed.push({
54
- array_index: this.parsed.length,
55
- options_index: this.options_index,
56
- value: option.value,
57
- text: option.text,
58
- html: option.innerHTML,
59
- selected: option.selected,
60
- disabled: group_disabled === true ? group_disabled : option.disabled,
61
- group_array_index: group_position,
62
- classes: option.className,
63
- style: option.style.cssText
64
- });
65
- } else {
66
- this.parsed.push({
67
- array_index: this.parsed.length,
68
- options_index: this.options_index,
69
- empty: true
70
- });
71
- }
72
- return this.options_index += 1;
73
- }
74
- };
75
-
76
- return SelectParser;
77
-
78
- })();
79
-
80
- SelectParser.select_to_array = function(select) {
81
- var child, parser, _i, _len, _ref;
82
- parser = new SelectParser();
83
- _ref = select.childNodes;
84
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
85
- child = _ref[_i];
86
- parser.add_node(child);
87
- }
88
- return parser.parsed;
89
- };
90
-
91
- this.SelectParser = SelectParser;
92
-
93
- }).call(this);
94
-
95
- /*
96
- Chosen source: generate output using 'cake build'
97
- Copyright (c) 2011 by Harvest
98
- */
99
-
100
-
101
- (function() {
102
- var AbstractChosen, root;
103
-
104
- root = this;
105
-
106
- AbstractChosen = (function() {
107
-
108
- function AbstractChosen(form_field, options) {
109
- this.form_field = form_field;
110
- this.options = options != null ? options : {};
111
- this.is_multiple = this.form_field.multiple;
112
- this.set_default_text();
113
- this.set_default_values();
114
- this.setup();
115
- this.set_up_html();
116
- this.register_observers();
117
- this.finish_setup();
118
- }
119
-
120
- AbstractChosen.prototype.set_default_values = function() {
121
- var _this = this;
122
- this.click_test_action = function(evt) {
123
- return _this.test_active_click(evt);
124
- };
125
- this.activate_action = function(evt) {
126
- return _this.activate_field(evt);
127
- };
128
- this.active_field = false;
129
- this.mouse_on_container = false;
130
- this.results_showing = false;
131
- this.result_highlighted = null;
132
- this.result_single_selected = null;
133
- this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
134
- this.disable_search_threshold = this.options.disable_search_threshold || 0;
135
- this.disable_search = this.options.disable_search || false;
136
- this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
137
- this.search_contains = this.options.search_contains || false;
138
- this.choices = 0;
139
- this.single_backstroke_delete = this.options.single_backstroke_delete || false;
140
- this.max_selected_options = this.options.max_selected_options || Infinity;
141
- return this.inherit_select_classes = this.options.inherit_select_classes || false;
142
- };
143
-
144
- AbstractChosen.prototype.set_default_text = function() {
145
- if (this.form_field.getAttribute("data-placeholder")) {
146
- this.default_text = this.form_field.getAttribute("data-placeholder");
147
- } else if (this.is_multiple) {
148
- this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || "Select Some Options";
149
- } else {
150
- this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || "Select an Option";
151
- }
152
- return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || "No results match";
153
- };
154
-
155
- AbstractChosen.prototype.mouse_enter = function() {
156
- return this.mouse_on_container = true;
157
- };
158
-
159
- AbstractChosen.prototype.mouse_leave = function() {
160
- return this.mouse_on_container = false;
161
- };
162
-
163
- AbstractChosen.prototype.input_focus = function(evt) {
164
- var _this = this;
165
- if (this.is_multiple) {
166
- if (!this.active_field) {
167
- return setTimeout((function() {
168
- return _this.container_mousedown();
169
- }), 50);
170
- }
171
- } else {
172
- if (!this.active_field) {
173
- return this.activate_field();
174
- }
175
- }
176
- };
177
-
178
- AbstractChosen.prototype.input_blur = function(evt) {
179
- var _this = this;
180
- if (!this.mouse_on_container) {
181
- this.active_field = false;
182
- return setTimeout((function() {
183
- return _this.blur_test();
184
- }), 100);
185
- }
186
- };
187
-
188
- AbstractChosen.prototype.result_add_option = function(option) {
189
- var classes, style;
190
- if (!option.disabled) {
191
- option.dom_id = this.container_id + "_o_" + option.array_index;
192
- classes = option.selected && this.is_multiple ? [] : ["active-result"];
193
- if (option.selected) {
194
- classes.push("result-selected");
195
- }
196
- if (option.group_array_index != null) {
197
- classes.push("group-option");
198
- }
199
- if (option.classes !== "") {
200
- classes.push(option.classes);
201
- }
202
- style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
203
- return '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>';
204
- } else {
205
- return "";
206
- }
207
- };
208
-
209
- AbstractChosen.prototype.results_update_field = function() {
210
- this.set_default_text();
211
- if (!this.is_multiple) {
212
- this.results_reset_cleanup();
213
- }
214
- this.result_clear_highlight();
215
- this.result_single_selected = null;
216
- return this.results_build();
217
- };
218
-
219
- AbstractChosen.prototype.results_toggle = function() {
220
- if (this.results_showing) {
221
- return this.results_hide();
222
- } else {
223
- return this.results_show();
224
- }
225
- };
226
-
227
- AbstractChosen.prototype.results_search = function(evt) {
228
- if (this.results_showing) {
229
- return this.winnow_results();
230
- } else {
231
- return this.results_show();
232
- }
233
- };
234
-
235
- AbstractChosen.prototype.keyup_checker = function(evt) {
236
- var stroke, _ref;
237
- stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
238
- this.search_field_scale();
239
- switch (stroke) {
240
- case 8:
241
- if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
242
- return this.keydown_backstroke();
243
- } else if (!this.pending_backstroke) {
244
- this.result_clear_highlight();
245
- return this.results_search();
246
- }
247
- break;
248
- case 13:
249
- evt.preventDefault();
250
- if (this.results_showing) {
251
- return this.result_select(evt);
252
- }
253
- break;
254
- case 27:
255
- if (this.results_showing) {
256
- this.results_hide();
257
- }
258
- return true;
259
- case 9:
260
- case 38:
261
- case 40:
262
- case 16:
263
- case 91:
264
- case 17:
265
- break;
266
- default:
267
- return this.results_search();
268
- }
269
- };
270
-
271
- AbstractChosen.prototype.generate_field_id = function() {
272
- var new_id;
273
- new_id = this.generate_random_id();
274
- this.form_field.id = new_id;
275
- return new_id;
276
- };
277
-
278
- AbstractChosen.prototype.generate_random_char = function() {
279
- var chars, newchar, rand;
280
- chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
281
- rand = Math.floor(Math.random() * chars.length);
282
- return newchar = chars.substring(rand, rand + 1);
283
- };
284
-
285
- return AbstractChosen;
286
-
287
- })();
288
-
289
- root.AbstractChosen = AbstractChosen;
290
-
291
- }).call(this);
292
-
293
- /*
294
- Chosen source: generate output using 'cake build'
295
- Copyright (c) 2011 by Harvest
296
- */
297
-
298
-
299
- (function() {
300
- var $, Chosen, get_side_border_padding, root,
301
- __hasProp = {}.hasOwnProperty,
302
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
303
-
304
- root = this;
305
-
306
- $ = jQuery;
307
-
308
- $.fn.extend({
309
- chosen: function(options) {
310
- var browser, match, ua;
311
- ua = navigator.userAgent.toLowerCase();
312
- match = /(msie) ([\w.]+)/.exec(ua) || [];
313
- browser = {
314
- name: match[1] || "",
315
- version: match[2] || "0"
316
- };
317
- if (browser.name === "msie" && (browser.version === "6.0" || (browser.version === "7.0" && document.documentMode === 7))) {
318
- return this;
319
- }
320
- return this.each(function(input_field) {
321
- var $this;
322
- $this = $(this);
323
- if (!$this.hasClass("chzn-done")) {
324
- return $this.data('chosen', new Chosen(this, options));
325
- }
326
- });
327
- }
328
- });
329
-
330
- Chosen = (function(_super) {
331
-
332
- __extends(Chosen, _super);
333
-
334
- function Chosen() {
335
- return Chosen.__super__.constructor.apply(this, arguments);
336
- }
337
-
338
- Chosen.prototype.setup = function() {
339
- this.form_field_jq = $(this.form_field);
340
- this.current_value = this.form_field_jq.val();
341
- return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl");
342
- };
343
-
344
- Chosen.prototype.finish_setup = function() {
345
- return this.form_field_jq.addClass("chzn-done");
346
- };
347
-
348
- Chosen.prototype.set_up_html = function() {
349
- var container_classes, container_div, container_props, dd_top, dd_width, sf_width;
350
- this.container_id = this.form_field.id.length ? this.form_field.id.replace(/[^\w]/g, '_') : this.generate_field_id();
351
- this.container_id += "_chzn";
352
- container_classes = ["chzn-container"];
353
- container_classes.push("chzn-container-" + (this.is_multiple ? "multi" : "single"));
354
- if (this.inherit_select_classes && this.form_field.className) {
355
- container_classes.push(this.form_field.className);
356
- }
357
- if (this.is_rtl) {
358
- container_classes.push("chzn-rtl");
359
- }
360
- this.f_width = this.form_field_jq.outerWidth();
361
- container_props = {
362
- id: this.container_id,
363
- "class": container_classes.join(' '),
364
- style: 'width: ' + this.f_width + 'px;',
365
- title: this.form_field.title
366
- };
367
- container_div = $("<div />", container_props);
368
- if (this.is_multiple) {
369
- container_div.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>');
370
- } else {
371
- container_div.html('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');
372
- }
373
- this.form_field_jq.hide().after(container_div);
374
- this.container = $('#' + this.container_id);
375
- this.dropdown = this.container.find('div.chzn-drop').first();
376
- dd_top = this.container.height();
377
- dd_width = this.f_width - get_side_border_padding(this.dropdown);
378
- this.dropdown.css({
379
- "width": dd_width + "px",
380
- "top": dd_top + "px"
381
- });
382
- this.search_field = this.container.find('input').first();
383
- this.search_results = this.container.find('ul.chzn-results').first();
384
- this.search_field_scale();
385
- this.search_no_results = this.container.find('li.no-results').first();
386
- if (this.is_multiple) {
387
- this.search_choices = this.container.find('ul.chzn-choices').first();
388
- this.search_container = this.container.find('li.search-field').first();
389
- } else {
390
- this.search_container = this.container.find('div.chzn-search').first();
391
- this.selected_item = this.container.find('.chzn-single').first();
392
- sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field);
393
- this.search_field.css({
394
- "width": sf_width + "px"
395
- });
396
- }
397
- this.results_build();
398
- this.set_tab_index();
399
- return this.form_field_jq.trigger("liszt:ready", {
400
- chosen: this
401
- });
402
- };
403
-
404
- Chosen.prototype.register_observers = function() {
405
- var _this = this;
406
- this.container.mousedown(function(evt) {
407
- _this.container_mousedown(evt);
408
- });
409
- this.container.mouseup(function(evt) {
410
- _this.container_mouseup(evt);
411
- });
412
- this.container.mouseenter(function(evt) {
413
- _this.mouse_enter(evt);
414
- });
415
- this.container.mouseleave(function(evt) {
416
- _this.mouse_leave(evt);
417
- });
418
- this.search_results.mouseup(function(evt) {
419
- _this.search_results_mouseup(evt);
420
- });
421
- this.search_results.mouseover(function(evt) {
422
- _this.search_results_mouseover(evt);
423
- });
424
- this.search_results.mouseout(function(evt) {
425
- _this.search_results_mouseout(evt);
426
- });
427
- this.form_field_jq.bind("liszt:updated", function(evt) {
428
- _this.results_update_field(evt);
429
- });
430
- this.form_field_jq.bind("liszt:activate", function(evt) {
431
- _this.activate_field(evt);
432
- });
433
- this.form_field_jq.bind("liszt:open", function(evt) {
434
- _this.container_mousedown(evt);
435
- });
436
- this.search_field.blur(function(evt) {
437
- _this.input_blur(evt);
438
- });
439
- this.search_field.keyup(function(evt) {
440
- _this.keyup_checker(evt);
441
- });
442
- this.search_field.keydown(function(evt) {
443
- _this.keydown_checker(evt);
444
- });
445
- this.search_field.focus(function(evt) {
446
- _this.input_focus(evt);
447
- });
448
- if (this.is_multiple) {
449
- return this.search_choices.click(function(evt) {
450
- _this.choices_click(evt);
451
- });
452
- } else {
453
- return this.container.click(function(evt) {
454
- evt.preventDefault();
455
- });
456
- }
457
- };
458
-
459
- Chosen.prototype.search_field_disabled = function() {
460
- this.is_disabled = this.form_field_jq[0].disabled;
461
- if (this.is_disabled) {
462
- this.container.addClass('chzn-disabled');
463
- this.search_field[0].disabled = true;
464
- if (!this.is_multiple) {
465
- this.selected_item.unbind("focus", this.activate_action);
466
- }
467
- return this.close_field();
468
- } else {
469
- this.container.removeClass('chzn-disabled');
470
- this.search_field[0].disabled = false;
471
- if (!this.is_multiple) {
472
- return this.selected_item.bind("focus", this.activate_action);
473
- }
474
- }
475
- };
476
-
477
- Chosen.prototype.container_mousedown = function(evt) {
478
- var target_closelink;
479
- if (!this.is_disabled) {
480
- target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false;
481
- if (evt && evt.type === "mousedown" && !this.results_showing) {
482
- evt.preventDefault();
483
- }
484
- if (!this.pending_destroy_click && !target_closelink) {
485
- if (!this.active_field) {
486
- if (this.is_multiple) {
487
- this.search_field.val("");
488
- }
489
- $(document).click(this.click_test_action);
490
- this.results_show();
491
- } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chzn-single").length)) {
492
- evt.preventDefault();
493
- this.results_toggle();
494
- }
495
- return this.activate_field();
496
- } else {
497
- return this.pending_destroy_click = false;
498
- }
499
- }
500
- };
501
-
502
- Chosen.prototype.container_mouseup = function(evt) {
503
- if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
504
- return this.results_reset(evt);
505
- }
506
- };
507
-
508
- Chosen.prototype.blur_test = function(evt) {
509
- if (!this.active_field && this.container.hasClass("chzn-container-active")) {
510
- return this.close_field();
511
- }
512
- };
513
-
514
- Chosen.prototype.close_field = function() {
515
- $(document).unbind("click", this.click_test_action);
516
- this.active_field = false;
517
- this.results_hide();
518
- this.container.removeClass("chzn-container-active");
519
- this.winnow_results_clear();
520
- this.clear_backstroke();
521
- this.show_search_field_default();
522
- return this.search_field_scale();
523
- };
524
-
525
- Chosen.prototype.activate_field = function() {
526
- this.container.addClass("chzn-container-active");
527
- this.active_field = true;
528
- this.search_field.val(this.search_field.val());
529
- return this.search_field.focus();
530
- };
531
-
532
- Chosen.prototype.test_active_click = function(evt) {
533
- if ($(evt.target).parents('#' + this.container_id).length) {
534
- return this.active_field = true;
535
- } else {
536
- return this.close_field();
537
- }
538
- };
539
-
540
- Chosen.prototype.results_build = function() {
541
- var content, data, _i, _len, _ref;
542
- this.parsing = true;
543
- this.results_data = root.SelectParser.select_to_array(this.form_field);
544
- if (this.is_multiple && this.choices > 0) {
545
- this.search_choices.find("li.search-choice").remove();
546
- this.choices = 0;
547
- } else if (!this.is_multiple) {
548
- this.selected_item.addClass("chzn-default").find("span").text(this.default_text);
549
- if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
550
- this.container.addClass("chzn-container-single-nosearch");
551
- } else {
552
- this.container.removeClass("chzn-container-single-nosearch");
553
- }
554
- }
555
- content = '';
556
- _ref = this.results_data;
557
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
558
- data = _ref[_i];
559
- if (data.group) {
560
- content += this.result_add_group(data);
561
- } else if (!data.empty) {
562
- content += this.result_add_option(data);
563
- if (data.selected && this.is_multiple) {
564
- this.choice_build(data);
565
- } else if (data.selected && !this.is_multiple) {
566
- this.selected_item.removeClass("chzn-default").find("span").text(data.text);
567
- if (this.allow_single_deselect) {
568
- this.single_deselect_control_build();
569
- }
570
- }
571
- }
572
- }
573
- this.search_field_disabled();
574
- this.show_search_field_default();
575
- this.search_field_scale();
576
- this.search_results.html(content);
577
- return this.parsing = false;
578
- };
579
-
580
- Chosen.prototype.result_add_group = function(group) {
581
- if (!group.disabled) {
582
- group.dom_id = this.container_id + "_g_" + group.array_index;
583
- return '<li id="' + group.dom_id + '" class="group-result">' + $("<div />").text(group.label).html() + '</li>';
584
- } else {
585
- return "";
586
- }
587
- };
588
-
589
- Chosen.prototype.result_do_highlight = function(el) {
590
- var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
591
- if (el.length) {
592
- this.result_clear_highlight();
593
- this.result_highlight = el;
594
- this.result_highlight.addClass("highlighted");
595
- maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
596
- visible_top = this.search_results.scrollTop();
597
- visible_bottom = maxHeight + visible_top;
598
- high_top = this.result_highlight.position().top + this.search_results.scrollTop();
599
- high_bottom = high_top + this.result_highlight.outerHeight();
600
- if (high_bottom >= visible_bottom) {
601
- return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
602
- } else if (high_top < visible_top) {
603
- return this.search_results.scrollTop(high_top);
604
- }
605
- }
606
- };
607
-
608
- Chosen.prototype.result_clear_highlight = function() {
609
- if (this.result_highlight) {
610
- this.result_highlight.removeClass("highlighted");
611
- }
612
- return this.result_highlight = null;
613
- };
614
-
615
- Chosen.prototype.results_show = function() {
616
- var dd_top;
617
- if (!this.is_multiple) {
618
- this.selected_item.addClass("chzn-single-with-drop");
619
- if (this.result_single_selected) {
620
- this.result_do_highlight(this.result_single_selected);
621
- }
622
- } else if (this.max_selected_options <= this.choices) {
623
- this.form_field_jq.trigger("liszt:maxselected", {
624
- chosen: this
625
- });
626
- return false;
627
- }
628
- dd_top = this.is_multiple ? this.container.height() : this.container.height() - 1;
629
- this.form_field_jq.trigger("liszt:showing_dropdown", {
630
- chosen: this
631
- });
632
- this.dropdown.css({
633
- "top": dd_top + "px",
634
- "left": 0
635
- });
636
- this.results_showing = true;
637
- this.search_field.focus();
638
- this.search_field.val(this.search_field.val());
639
- return this.winnow_results();
640
- };
641
-
642
- Chosen.prototype.results_hide = function() {
643
- if (!this.is_multiple) {
644
- this.selected_item.removeClass("chzn-single-with-drop");
645
- }
646
- this.result_clear_highlight();
647
- this.form_field_jq.trigger("liszt:hiding_dropdown", {
648
- chosen: this
649
- });
650
- this.dropdown.css({
651
- "left": "-9000px"
652
- });
653
- return this.results_showing = false;
654
- };
655
-
656
- Chosen.prototype.set_tab_index = function(el) {
657
- var ti;
658
- if (this.form_field_jq.attr("tabindex")) {
659
- ti = this.form_field_jq.attr("tabindex");
660
- this.form_field_jq.attr("tabindex", -1);
661
- return this.search_field.attr("tabindex", ti);
662
- }
663
- };
664
-
665
- Chosen.prototype.show_search_field_default = function() {
666
- if (this.is_multiple && this.choices < 1 && !this.active_field) {
667
- this.search_field.val(this.default_text);
668
- return this.search_field.addClass("default");
669
- } else {
670
- this.search_field.val("");
671
- return this.search_field.removeClass("default");
672
- }
673
- };
674
-
675
- Chosen.prototype.search_results_mouseup = function(evt) {
676
- var target;
677
- target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
678
- if (target.length) {
679
- this.result_highlight = target;
680
- this.result_select(evt);
681
- return this.search_field.focus();
682
- }
683
- };
684
-
685
- Chosen.prototype.search_results_mouseover = function(evt) {
686
- var target;
687
- target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
688
- if (target) {
689
- return this.result_do_highlight(target);
690
- }
691
- };
692
-
693
- Chosen.prototype.search_results_mouseout = function(evt) {
694
- if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
695
- return this.result_clear_highlight();
696
- }
697
- };
698
-
699
- Chosen.prototype.choices_click = function(evt) {
700
- evt.preventDefault();
701
- if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) {
702
- return this.results_show();
703
- }
704
- };
705
-
706
- Chosen.prototype.choice_build = function(item) {
707
- var choice_id, html, link,
708
- _this = this;
709
- if (this.is_multiple && this.max_selected_options <= this.choices) {
710
- this.form_field_jq.trigger("liszt:maxselected", {
711
- chosen: this
712
- });
713
- return false;
714
- }
715
- choice_id = this.container_id + "_c_" + item.array_index;
716
- this.choices += 1;
717
- if (item.disabled) {
718
- html = '<li class="search-choice search-choice-disabled" id="' + choice_id + '"><span>' + item.html + '</span></li>';
719
- } else {
720
- html = '<li class="search-choice" id="' + choice_id + '"><span>' + item.html + '</span><a href="javascript:void(0)" class="search-choice-close" rel="' + item.array_index + '"></a></li>';
721
- }
722
- this.search_container.before(html);
723
- link = $('#' + choice_id).find("a").first();
724
- return link.click(function(evt) {
725
- return _this.choice_destroy_link_click(evt);
726
- });
727
- };
728
-
729
- Chosen.prototype.choice_destroy_link_click = function(evt) {
730
- evt.preventDefault();
731
- if (!this.is_disabled) {
732
- this.pending_destroy_click = true;
733
- return this.choice_destroy($(evt.target));
734
- } else {
735
- return evt.stopPropagation;
736
- }
737
- };
738
-
739
- Chosen.prototype.choice_destroy = function(link) {
740
- if (this.result_deselect(link.attr("rel"))) {
741
- this.choices -= 1;
742
- this.show_search_field_default();
743
- if (this.is_multiple && this.choices > 0 && this.search_field.val().length < 1) {
744
- this.results_hide();
745
- }
746
- link.parents('li').first().remove();
747
- return this.search_field_scale();
748
- }
749
- };
750
-
751
- Chosen.prototype.results_reset = function() {
752
- this.form_field.options[0].selected = true;
753
- this.selected_item.find("span").text(this.default_text);
754
- if (!this.is_multiple) {
755
- this.selected_item.addClass("chzn-default");
756
- }
757
- this.show_search_field_default();
758
- this.results_reset_cleanup();
759
- this.form_field_jq.trigger("change");
760
- if (this.active_field) {
761
- return this.results_hide();
762
- }
763
- };
764
-
765
- Chosen.prototype.results_reset_cleanup = function() {
766
- this.current_value = this.form_field_jq.val();
767
- return this.selected_item.find("abbr").remove();
768
- };
769
-
770
- Chosen.prototype.result_select = function(evt) {
771
- var high, high_id, item, position;
772
- if (this.result_highlight) {
773
- high = this.result_highlight;
774
- high_id = high.attr("id");
775
- this.result_clear_highlight();
776
- if (this.is_multiple) {
777
- this.result_deactivate(high);
778
- } else {
779
- this.search_results.find(".result-selected").removeClass("result-selected");
780
- this.result_single_selected = high;
781
- this.selected_item.removeClass("chzn-default");
782
- }
783
- high.addClass("result-selected");
784
- position = high_id.substr(high_id.lastIndexOf("_") + 1);
785
- item = this.results_data[position];
786
- item.selected = true;
787
- this.form_field.options[item.options_index].selected = true;
788
- if (this.is_multiple) {
789
- this.choice_build(item);
790
- } else {
791
- this.selected_item.find("span").first().text(item.text);
792
- if (this.allow_single_deselect) {
793
- this.single_deselect_control_build();
794
- }
795
- }
796
- if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
797
- this.results_hide();
798
- }
799
- this.search_field.val("");
800
- if (this.is_multiple || this.form_field_jq.val() !== this.current_value) {
801
- this.form_field_jq.trigger("change", {
802
- 'selected': this.form_field.options[item.options_index].value
803
- });
804
- }
805
- this.current_value = this.form_field_jq.val();
806
- return this.search_field_scale();
807
- }
808
- };
809
-
810
- Chosen.prototype.result_activate = function(el) {
811
- return el.addClass("active-result");
812
- };
813
-
814
- Chosen.prototype.result_deactivate = function(el) {
815
- return el.removeClass("active-result");
816
- };
817
-
818
- Chosen.prototype.result_deselect = function(pos) {
819
- var result, result_data;
820
- result_data = this.results_data[pos];
821
- if (!this.form_field.options[result_data.options_index].disabled) {
822
- result_data.selected = false;
823
- this.form_field.options[result_data.options_index].selected = false;
824
- result = $("#" + this.container_id + "_o_" + pos);
825
- result.removeClass("result-selected").addClass("active-result").show();
826
- this.result_clear_highlight();
827
- this.winnow_results();
828
- this.form_field_jq.trigger("change", {
829
- deselected: this.form_field.options[result_data.options_index].value
830
- });
831
- this.search_field_scale();
832
- return true;
833
- } else {
834
- return false;
835
- }
836
- };
837
-
838
- Chosen.prototype.single_deselect_control_build = function() {
839
- if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) {
840
- return this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
841
- }
842
- };
843
-
844
- Chosen.prototype.winnow_results = function() {
845
- var found, option, part, parts, regex, regexAnchor, result, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len1, _ref;
846
- this.no_results_clear();
847
- results = 0;
848
- searchText = this.search_field.val() === this.default_text ? "" : $('<div/>').text($.trim(this.search_field.val())).html();
849
- regexAnchor = this.search_contains ? "" : "^";
850
- regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
851
- zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
852
- _ref = this.results_data;
853
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
854
- option = _ref[_i];
855
- if (!option.disabled && !option.empty) {
856
- if (option.group) {
857
- $('#' + option.dom_id).css('display', 'none');
858
- } else if (!(this.is_multiple && option.selected)) {
859
- found = false;
860
- result_id = option.dom_id;
861
- result = $("#" + result_id);
862
- if (regex.test(option.html)) {
863
- found = true;
864
- results += 1;
865
- } else if (this.enable_split_word_search && (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0)) {
866
- parts = option.html.replace(/\[|\]/g, "").split(" ");
867
- if (parts.length) {
868
- for (_j = 0, _len1 = parts.length; _j < _len1; _j++) {
869
- part = parts[_j];
870
- if (regex.test(part)) {
871
- found = true;
872
- results += 1;
873
- }
874
- }
875
- }
876
- }
877
- if (found) {
878
- if (searchText.length) {
879
- startpos = option.html.search(zregex);
880
- text = option.html.substr(0, startpos + searchText.length) + '</em>' + option.html.substr(startpos + searchText.length);
881
- text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
882
- } else {
883
- text = option.html;
884
- }
885
- result.html(text);
886
- this.result_activate(result);
887
- if (option.group_array_index != null) {
888
- $("#" + this.results_data[option.group_array_index].dom_id).css('display', 'list-item');
889
- }
890
- } else {
891
- if (this.result_highlight && result_id === this.result_highlight.attr('id')) {
892
- this.result_clear_highlight();
893
- }
894
- this.result_deactivate(result);
895
- }
896
- }
897
- }
898
- }
899
- if (results < 1 && searchText.length) {
900
- return this.no_results(searchText);
901
- } else {
902
- return this.winnow_results_set_highlight();
903
- }
904
- };
905
-
906
- Chosen.prototype.winnow_results_clear = function() {
907
- var li, lis, _i, _len, _results;
908
- this.search_field.val("");
909
- lis = this.search_results.find("li");
910
- _results = [];
911
- for (_i = 0, _len = lis.length; _i < _len; _i++) {
912
- li = lis[_i];
913
- li = $(li);
914
- if (li.hasClass("group-result")) {
915
- _results.push(li.css('display', 'auto'));
916
- } else if (!this.is_multiple || !li.hasClass("result-selected")) {
917
- _results.push(this.result_activate(li));
918
- } else {
919
- _results.push(void 0);
920
- }
921
- }
922
- return _results;
923
- };
924
-
925
- Chosen.prototype.winnow_results_set_highlight = function() {
926
- var do_high, selected_results;
927
- if (!this.result_highlight) {
928
- selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
929
- do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
930
- if (do_high != null) {
931
- return this.result_do_highlight(do_high);
932
- }
933
- }
934
- };
935
-
936
- Chosen.prototype.no_results = function(terms) {
937
- var no_results_html;
938
- no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
939
- no_results_html.find("span").first().html(terms);
940
- return this.search_results.append(no_results_html);
941
- };
942
-
943
- Chosen.prototype.no_results_clear = function() {
944
- return this.search_results.find(".no-results").remove();
945
- };
946
-
947
- Chosen.prototype.keydown_arrow = function() {
948
- var first_active, next_sib;
949
- if (!this.result_highlight) {
950
- first_active = this.search_results.find("li.active-result").first();
951
- if (first_active) {
952
- this.result_do_highlight($(first_active));
953
- }
954
- } else if (this.results_showing) {
955
- next_sib = this.result_highlight.nextAll("li.active-result").first();
956
- if (next_sib) {
957
- this.result_do_highlight(next_sib);
958
- }
959
- }
960
- if (!this.results_showing) {
961
- return this.results_show();
962
- }
963
- };
964
-
965
- Chosen.prototype.keyup_arrow = function() {
966
- var prev_sibs;
967
- if (!this.results_showing && !this.is_multiple) {
968
- return this.results_show();
969
- } else if (this.result_highlight) {
970
- prev_sibs = this.result_highlight.prevAll("li.active-result");
971
- if (prev_sibs.length) {
972
- return this.result_do_highlight(prev_sibs.first());
973
- } else {
974
- if (this.choices > 0) {
975
- this.results_hide();
976
- }
977
- return this.result_clear_highlight();
978
- }
979
- }
980
- };
981
-
982
- Chosen.prototype.keydown_backstroke = function() {
983
- var next_available_destroy;
984
- if (this.pending_backstroke) {
985
- this.choice_destroy(this.pending_backstroke.find("a").first());
986
- return this.clear_backstroke();
987
- } else {
988
- next_available_destroy = this.search_container.siblings("li.search-choice").last();
989
- if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
990
- this.pending_backstroke = next_available_destroy;
991
- if (this.single_backstroke_delete) {
992
- return this.keydown_backstroke();
993
- } else {
994
- return this.pending_backstroke.addClass("search-choice-focus");
995
- }
996
- }
997
- }
998
- };
999
-
1000
- Chosen.prototype.clear_backstroke = function() {
1001
- if (this.pending_backstroke) {
1002
- this.pending_backstroke.removeClass("search-choice-focus");
1003
- }
1004
- return this.pending_backstroke = null;
1005
- };
1006
-
1007
- Chosen.prototype.keydown_checker = function(evt) {
1008
- var stroke, _ref;
1009
- stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
1010
- this.search_field_scale();
1011
- if (stroke !== 8 && this.pending_backstroke) {
1012
- this.clear_backstroke();
1013
- }
1014
- switch (stroke) {
1015
- case 8:
1016
- this.backstroke_length = this.search_field.val().length;
1017
- break;
1018
- case 9:
1019
- if (this.results_showing && !this.is_multiple) {
1020
- this.result_select(evt);
1021
- }
1022
- this.mouse_on_container = false;
1023
- break;
1024
- case 13:
1025
- evt.preventDefault();
1026
- break;
1027
- case 38:
1028
- evt.preventDefault();
1029
- this.keyup_arrow();
1030
- break;
1031
- case 40:
1032
- this.keydown_arrow();
1033
- break;
1034
- }
1035
- };
1036
-
1037
- Chosen.prototype.search_field_scale = function() {
1038
- var dd_top, div, h, style, style_block, styles, w, _i, _len;
1039
- if (this.is_multiple) {
1040
- h = 0;
1041
- w = 0;
1042
- style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
1043
- styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
1044
- for (_i = 0, _len = styles.length; _i < _len; _i++) {
1045
- style = styles[_i];
1046
- style_block += style + ":" + this.search_field.css(style) + ";";
1047
- }
1048
- div = $('<div />', {
1049
- 'style': style_block
1050
- });
1051
- div.text(this.search_field.val());
1052
- $('body').append(div);
1053
- w = div.width() + 25;
1054
- div.remove();
1055
- if (w > this.f_width - 10) {
1056
- w = this.f_width - 10;
1057
- }
1058
- this.search_field.css({
1059
- 'width': w + 'px'
1060
- });
1061
- dd_top = this.container.height();
1062
- return this.dropdown.css({
1063
- "top": dd_top + "px"
1064
- });
1065
- }
1066
- };
1067
-
1068
- Chosen.prototype.generate_random_id = function() {
1069
- var string;
1070
- string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char();
1071
- while ($("#" + string).length > 0) {
1072
- string += this.generate_random_char();
1073
- }
1074
- return string;
1075
- };
1076
-
1077
- return Chosen;
1078
-
1079
- })(AbstractChosen);
1080
-
1081
- root.Chosen = Chosen;
1082
-
1083
- get_side_border_padding = function(elmt) {
1084
- var side_border_padding;
1085
- return side_border_padding = elmt.outerWidth() - elmt.width();
1086
- };
1087
-
1088
- root.get_side_border_padding = get_side_border_padding;
1089
-
1090
- }).call(this);
1
+ // Chosen, a Select Box Enhancer for jQuery and Protoype
2
+ // by Patrick Filler for Harvest, http://getharvest.com
3
+ //
4
+ // Version 0.9.12
5
+ // Full source at https://github.com/harvesthq/chosen
6
+ // Copyright (c) 2011 Harvest http://getharvest.com
7
+
8
+ // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
9
+ // This file is generated by `cake build`, do not edit it by hand.
10
+ (function() {
11
+ var SelectParser;
12
+
13
+ SelectParser = (function() {
14
+
15
+ function SelectParser() {
16
+ this.options_index = 0;
17
+ this.parsed = [];
18
+ }
19
+
20
+ SelectParser.prototype.add_node = function(child) {
21
+ if (child.nodeName.toUpperCase() === "OPTGROUP") {
22
+ return this.add_group(child);
23
+ } else {
24
+ return this.add_option(child);
25
+ }
26
+ };
27
+
28
+ SelectParser.prototype.add_group = function(group) {
29
+ var group_position, option, _i, _len, _ref, _results;
30
+ group_position = this.parsed.length;
31
+ this.parsed.push({
32
+ array_index: group_position,
33
+ group: true,
34
+ label: group.label,
35
+ children: 0,
36
+ disabled: group.disabled
37
+ });
38
+ _ref = group.childNodes;
39
+ _results = [];
40
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
41
+ option = _ref[_i];
42
+ _results.push(this.add_option(option, group_position, group.disabled));
43
+ }
44
+ return _results;
45
+ };
46
+
47
+ SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
48
+ if (option.nodeName.toUpperCase() === "OPTION") {
49
+ if (option.text !== "") {
50
+ if (group_position != null) {
51
+ this.parsed[group_position].children += 1;
52
+ }
53
+ this.parsed.push({
54
+ array_index: this.parsed.length,
55
+ options_index: this.options_index,
56
+ value: option.value,
57
+ text: option.text,
58
+ html: option.innerHTML,
59
+ selected: option.selected,
60
+ disabled: group_disabled === true ? group_disabled : option.disabled,
61
+ group_array_index: group_position,
62
+ classes: option.className,
63
+ style: option.style.cssText
64
+ });
65
+ } else {
66
+ this.parsed.push({
67
+ array_index: this.parsed.length,
68
+ options_index: this.options_index,
69
+ empty: true
70
+ });
71
+ }
72
+ return this.options_index += 1;
73
+ }
74
+ };
75
+
76
+ return SelectParser;
77
+
78
+ })();
79
+
80
+ SelectParser.select_to_array = function(select) {
81
+ var child, parser, _i, _len, _ref;
82
+ parser = new SelectParser();
83
+ _ref = select.childNodes;
84
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
85
+ child = _ref[_i];
86
+ parser.add_node(child);
87
+ }
88
+ return parser.parsed;
89
+ };
90
+
91
+ this.SelectParser = SelectParser;
92
+
93
+ }).call(this);
94
+
95
+ /*
96
+ Chosen source: generate output using 'cake build'
97
+ Copyright (c) 2011 by Harvest
98
+ */
99
+
100
+
101
+ (function() {
102
+ var AbstractChosen, root;
103
+
104
+ root = this;
105
+
106
+ AbstractChosen = (function() {
107
+
108
+ function AbstractChosen(form_field, options) {
109
+ this.form_field = form_field;
110
+ this.options = options != null ? options : {};
111
+ this.is_multiple = this.form_field.multiple;
112
+ this.set_default_text();
113
+ this.set_default_values();
114
+ this.setup();
115
+ this.set_up_html();
116
+ this.register_observers();
117
+ this.finish_setup();
118
+ }
119
+
120
+ AbstractChosen.prototype.set_default_values = function() {
121
+ var _this = this;
122
+ this.click_test_action = function(evt) {
123
+ return _this.test_active_click(evt);
124
+ };
125
+ this.activate_action = function(evt) {
126
+ return _this.activate_field(evt);
127
+ };
128
+ this.active_field = false;
129
+ this.mouse_on_container = false;
130
+ this.results_showing = false;
131
+ this.result_highlighted = null;
132
+ this.result_single_selected = null;
133
+ this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
134
+ this.disable_search_threshold = this.options.disable_search_threshold || 0;
135
+ this.disable_search = this.options.disable_search || false;
136
+ this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
137
+ this.search_contains = this.options.search_contains || false;
138
+ this.choices = 0;
139
+ this.single_backstroke_delete = this.options.single_backstroke_delete || false;
140
+ this.max_selected_options = this.options.max_selected_options || Infinity;
141
+ return this.inherit_select_classes = this.options.inherit_select_classes || false;
142
+ };
143
+
144
+ AbstractChosen.prototype.set_default_text = function() {
145
+ if (this.form_field.getAttribute("data-placeholder")) {
146
+ this.default_text = this.form_field.getAttribute("data-placeholder");
147
+ } else if (this.is_multiple) {
148
+ this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || "Select Some Options";
149
+ } else {
150
+ this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || "Select an Option";
151
+ }
152
+ return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || "No results match";
153
+ };
154
+
155
+ AbstractChosen.prototype.mouse_enter = function() {
156
+ return this.mouse_on_container = true;
157
+ };
158
+
159
+ AbstractChosen.prototype.mouse_leave = function() {
160
+ return this.mouse_on_container = false;
161
+ };
162
+
163
+ AbstractChosen.prototype.input_focus = function(evt) {
164
+ var _this = this;
165
+ if (this.is_multiple) {
166
+ if (!this.active_field) {
167
+ return setTimeout((function() {
168
+ return _this.container_mousedown();
169
+ }), 50);
170
+ }
171
+ } else {
172
+ if (!this.active_field) {
173
+ return this.activate_field();
174
+ }
175
+ }
176
+ };
177
+
178
+ AbstractChosen.prototype.input_blur = function(evt) {
179
+ var _this = this;
180
+ if (!this.mouse_on_container) {
181
+ this.active_field = false;
182
+ return setTimeout((function() {
183
+ return _this.blur_test();
184
+ }), 100);
185
+ }
186
+ };
187
+
188
+ AbstractChosen.prototype.result_add_option = function(option) {
189
+ var classes, style;
190
+ if (!option.disabled) {
191
+ option.dom_id = this.container_id + "_o_" + option.array_index;
192
+ classes = option.selected && this.is_multiple ? [] : ["active-result"];
193
+ if (option.selected) {
194
+ classes.push("result-selected");
195
+ }
196
+ if (option.group_array_index != null) {
197
+ classes.push("group-option");
198
+ }
199
+ if (option.classes !== "") {
200
+ classes.push(option.classes);
201
+ }
202
+ style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
203
+ return '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>';
204
+ } else {
205
+ return "";
206
+ }
207
+ };
208
+
209
+ AbstractChosen.prototype.results_update_field = function() {
210
+ this.set_default_text();
211
+ if (!this.is_multiple) {
212
+ this.results_reset_cleanup();
213
+ }
214
+ this.result_clear_highlight();
215
+ this.result_single_selected = null;
216
+ return this.results_build();
217
+ };
218
+
219
+ AbstractChosen.prototype.results_toggle = function() {
220
+ if (this.results_showing) {
221
+ return this.results_hide();
222
+ } else {
223
+ return this.results_show();
224
+ }
225
+ };
226
+
227
+ AbstractChosen.prototype.results_search = function(evt) {
228
+ if (this.results_showing) {
229
+ return this.winnow_results();
230
+ } else {
231
+ return this.results_show();
232
+ }
233
+ };
234
+
235
+ AbstractChosen.prototype.keyup_checker = function(evt) {
236
+ var stroke, _ref;
237
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
238
+ this.search_field_scale();
239
+ switch (stroke) {
240
+ case 8:
241
+ if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
242
+ return this.keydown_backstroke();
243
+ } else if (!this.pending_backstroke) {
244
+ this.result_clear_highlight();
245
+ return this.results_search();
246
+ }
247
+ break;
248
+ case 13:
249
+ evt.preventDefault();
250
+ if (this.results_showing) {
251
+ return this.result_select(evt);
252
+ }
253
+ break;
254
+ case 27:
255
+ if (this.results_showing) {
256
+ this.results_hide();
257
+ }
258
+ return true;
259
+ case 9:
260
+ case 38:
261
+ case 40:
262
+ case 16:
263
+ case 91:
264
+ case 17:
265
+ break;
266
+ default:
267
+ return this.results_search();
268
+ }
269
+ };
270
+
271
+ AbstractChosen.prototype.generate_field_id = function() {
272
+ var new_id;
273
+ new_id = this.generate_random_id();
274
+ this.form_field.id = new_id;
275
+ return new_id;
276
+ };
277
+
278
+ AbstractChosen.prototype.generate_random_char = function() {
279
+ var chars, newchar, rand;
280
+ chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
281
+ rand = Math.floor(Math.random() * chars.length);
282
+ return newchar = chars.substring(rand, rand + 1);
283
+ };
284
+
285
+ return AbstractChosen;
286
+
287
+ })();
288
+
289
+ root.AbstractChosen = AbstractChosen;
290
+
291
+ }).call(this);
292
+
293
+ /*
294
+ Chosen source: generate output using 'cake build'
295
+ Copyright (c) 2011 by Harvest
296
+ */
297
+
298
+
299
+ (function() {
300
+ var $, Chosen, get_side_border_padding, root,
301
+ __hasProp = {}.hasOwnProperty,
302
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
303
+
304
+ root = this;
305
+
306
+ $ = jQuery;
307
+
308
+ $.fn.extend({
309
+ chosen: function(options) {
310
+ var browser, match, ua;
311
+ ua = navigator.userAgent.toLowerCase();
312
+ match = /(msie) ([\w.]+)/.exec(ua) || [];
313
+ browser = {
314
+ name: match[1] || "",
315
+ version: match[2] || "0"
316
+ };
317
+ if (browser.name === "msie" && (browser.version === "6.0" || (browser.version === "7.0" && document.documentMode === 7))) {
318
+ return this;
319
+ }
320
+ return this.each(function(input_field) {
321
+ var $this;
322
+ $this = $(this);
323
+ if (!$this.hasClass("chzn-done")) {
324
+ return $this.data('chosen', new Chosen(this, options));
325
+ }
326
+ });
327
+ }
328
+ });
329
+
330
+ Chosen = (function(_super) {
331
+
332
+ __extends(Chosen, _super);
333
+
334
+ function Chosen() {
335
+ return Chosen.__super__.constructor.apply(this, arguments);
336
+ }
337
+
338
+ Chosen.prototype.setup = function() {
339
+ this.form_field_jq = $(this.form_field);
340
+ this.current_value = this.form_field_jq.val();
341
+ return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl");
342
+ };
343
+
344
+ Chosen.prototype.finish_setup = function() {
345
+ return this.form_field_jq.addClass("chzn-done");
346
+ };
347
+
348
+ Chosen.prototype.set_up_html = function() {
349
+ var container_classes, container_div, container_props, dd_top, dd_width, sf_width;
350
+ this.container_id = this.form_field.id.length ? this.form_field.id.replace(/[^\w]/g, '_') : this.generate_field_id();
351
+ this.container_id += "_chzn";
352
+ container_classes = ["chzn-container"];
353
+ container_classes.push("chzn-container-" + (this.is_multiple ? "multi" : "single"));
354
+ if (this.inherit_select_classes && this.form_field.className) {
355
+ container_classes.push(this.form_field.className);
356
+ }
357
+ if (this.is_rtl) {
358
+ container_classes.push("chzn-rtl");
359
+ }
360
+ this.f_width = this.form_field_jq.outerWidth();
361
+ container_props = {
362
+ id: this.container_id,
363
+ "class": container_classes.join(' '),
364
+ style: 'width: ' + this.f_width + 'px;',
365
+ title: this.form_field.title
366
+ };
367
+ container_div = $("<div />", container_props);
368
+ if (this.is_multiple) {
369
+ container_div.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>');
370
+ } else {
371
+ container_div.html('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');
372
+ }
373
+ this.form_field_jq.hide().after(container_div);
374
+ this.container = $('#' + this.container_id);
375
+ this.dropdown = this.container.find('div.chzn-drop').first();
376
+ dd_top = this.container.height();
377
+ dd_width = this.f_width - get_side_border_padding(this.dropdown);
378
+ this.dropdown.css({
379
+ "width": dd_width + "px",
380
+ "top": dd_top + "px"
381
+ });
382
+ this.search_field = this.container.find('input').first();
383
+ this.search_results = this.container.find('ul.chzn-results').first();
384
+ this.search_field_scale();
385
+ this.search_no_results = this.container.find('li.no-results').first();
386
+ if (this.is_multiple) {
387
+ this.search_choices = this.container.find('ul.chzn-choices').first();
388
+ this.search_container = this.container.find('li.search-field').first();
389
+ } else {
390
+ this.search_container = this.container.find('div.chzn-search').first();
391
+ this.selected_item = this.container.find('.chzn-single').first();
392
+ sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field);
393
+ this.search_field.css({
394
+ "width": sf_width + "px"
395
+ });
396
+ }
397
+ this.results_build();
398
+ this.set_tab_index();
399
+ return this.form_field_jq.trigger("liszt:ready", {
400
+ chosen: this
401
+ });
402
+ };
403
+
404
+ Chosen.prototype.register_observers = function() {
405
+ var _this = this;
406
+ this.container.mousedown(function(evt) {
407
+ _this.container_mousedown(evt);
408
+ });
409
+ this.container.mouseup(function(evt) {
410
+ _this.container_mouseup(evt);
411
+ });
412
+ this.container.mouseenter(function(evt) {
413
+ _this.mouse_enter(evt);
414
+ });
415
+ this.container.mouseleave(function(evt) {
416
+ _this.mouse_leave(evt);
417
+ });
418
+ this.search_results.mouseup(function(evt) {
419
+ _this.search_results_mouseup(evt);
420
+ });
421
+ this.search_results.mouseover(function(evt) {
422
+ _this.search_results_mouseover(evt);
423
+ });
424
+ this.search_results.mouseout(function(evt) {
425
+ _this.search_results_mouseout(evt);
426
+ });
427
+ this.form_field_jq.bind("liszt:updated", function(evt) {
428
+ _this.results_update_field(evt);
429
+ });
430
+ this.form_field_jq.bind("liszt:activate", function(evt) {
431
+ _this.activate_field(evt);
432
+ });
433
+ this.form_field_jq.bind("liszt:open", function(evt) {
434
+ _this.container_mousedown(evt);
435
+ });
436
+ this.search_field.blur(function(evt) {
437
+ _this.input_blur(evt);
438
+ });
439
+ this.search_field.keyup(function(evt) {
440
+ _this.keyup_checker(evt);
441
+ });
442
+ this.search_field.keydown(function(evt) {
443
+ _this.keydown_checker(evt);
444
+ });
445
+ this.search_field.focus(function(evt) {
446
+ _this.input_focus(evt);
447
+ });
448
+ if (this.is_multiple) {
449
+ return this.search_choices.click(function(evt) {
450
+ _this.choices_click(evt);
451
+ });
452
+ } else {
453
+ return this.container.click(function(evt) {
454
+ evt.preventDefault();
455
+ });
456
+ }
457
+ };
458
+
459
+ Chosen.prototype.search_field_disabled = function() {
460
+ this.is_disabled = this.form_field_jq[0].disabled;
461
+ if (this.is_disabled) {
462
+ this.container.addClass('chzn-disabled');
463
+ this.search_field[0].disabled = true;
464
+ if (!this.is_multiple) {
465
+ this.selected_item.unbind("focus", this.activate_action);
466
+ }
467
+ return this.close_field();
468
+ } else {
469
+ this.container.removeClass('chzn-disabled');
470
+ this.search_field[0].disabled = false;
471
+ if (!this.is_multiple) {
472
+ return this.selected_item.bind("focus", this.activate_action);
473
+ }
474
+ }
475
+ };
476
+
477
+ Chosen.prototype.container_mousedown = function(evt) {
478
+ var target_closelink;
479
+ if (!this.is_disabled) {
480
+ target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false;
481
+ if (evt && evt.type === "mousedown" && !this.results_showing) {
482
+ evt.preventDefault();
483
+ }
484
+ if (!this.pending_destroy_click && !target_closelink) {
485
+ if (!this.active_field) {
486
+ if (this.is_multiple) {
487
+ this.search_field.val("");
488
+ }
489
+ $(document).click(this.click_test_action);
490
+ this.results_show();
491
+ } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chzn-single").length)) {
492
+ evt.preventDefault();
493
+ this.results_toggle();
494
+ }
495
+ return this.activate_field();
496
+ } else {
497
+ return this.pending_destroy_click = false;
498
+ }
499
+ }
500
+ };
501
+
502
+ Chosen.prototype.container_mouseup = function(evt) {
503
+ if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
504
+ return this.results_reset(evt);
505
+ }
506
+ };
507
+
508
+ Chosen.prototype.blur_test = function(evt) {
509
+ if (!this.active_field && this.container.hasClass("chzn-container-active")) {
510
+ return this.close_field();
511
+ }
512
+ };
513
+
514
+ Chosen.prototype.close_field = function() {
515
+ $(document).unbind("click", this.click_test_action);
516
+ this.active_field = false;
517
+ this.results_hide();
518
+ this.container.removeClass("chzn-container-active");
519
+ this.winnow_results_clear();
520
+ this.clear_backstroke();
521
+ this.show_search_field_default();
522
+ return this.search_field_scale();
523
+ };
524
+
525
+ Chosen.prototype.activate_field = function() {
526
+ this.container.addClass("chzn-container-active");
527
+ this.active_field = true;
528
+ this.search_field.val(this.search_field.val());
529
+ return this.search_field.focus();
530
+ };
531
+
532
+ Chosen.prototype.test_active_click = function(evt) {
533
+ if ($(evt.target).parents('#' + this.container_id).length) {
534
+ return this.active_field = true;
535
+ } else {
536
+ return this.close_field();
537
+ }
538
+ };
539
+
540
+ Chosen.prototype.results_build = function() {
541
+ var content, data, _i, _len, _ref;
542
+ this.parsing = true;
543
+ this.results_data = root.SelectParser.select_to_array(this.form_field);
544
+ if (this.is_multiple && this.choices > 0) {
545
+ this.search_choices.find("li.search-choice").remove();
546
+ this.choices = 0;
547
+ } else if (!this.is_multiple) {
548
+ this.selected_item.addClass("chzn-default").find("span").text(this.default_text);
549
+ if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
550
+ this.container.addClass("chzn-container-single-nosearch");
551
+ } else {
552
+ this.container.removeClass("chzn-container-single-nosearch");
553
+ }
554
+ }
555
+ content = '';
556
+ _ref = this.results_data;
557
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
558
+ data = _ref[_i];
559
+ if (data.group) {
560
+ content += this.result_add_group(data);
561
+ } else if (!data.empty) {
562
+ content += this.result_add_option(data);
563
+ if (data.selected && this.is_multiple) {
564
+ this.choice_build(data);
565
+ } else if (data.selected && !this.is_multiple) {
566
+ this.selected_item.removeClass("chzn-default").find("span").text(data.text);
567
+ if (this.allow_single_deselect) {
568
+ this.single_deselect_control_build();
569
+ }
570
+ }
571
+ }
572
+ }
573
+ this.search_field_disabled();
574
+ this.show_search_field_default();
575
+ this.search_field_scale();
576
+ this.search_results.html(content);
577
+ return this.parsing = false;
578
+ };
579
+
580
+ Chosen.prototype.result_add_group = function(group) {
581
+ if (!group.disabled) {
582
+ group.dom_id = this.container_id + "_g_" + group.array_index;
583
+ return '<li id="' + group.dom_id + '" class="group-result">' + $("<div />").text(group.label).html() + '</li>';
584
+ } else {
585
+ return "";
586
+ }
587
+ };
588
+
589
+ Chosen.prototype.result_do_highlight = function(el) {
590
+ var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
591
+ if (el.length) {
592
+ this.result_clear_highlight();
593
+ this.result_highlight = el;
594
+ this.result_highlight.addClass("highlighted");
595
+ maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
596
+ visible_top = this.search_results.scrollTop();
597
+ visible_bottom = maxHeight + visible_top;
598
+ high_top = this.result_highlight.position().top + this.search_results.scrollTop();
599
+ high_bottom = high_top + this.result_highlight.outerHeight();
600
+ if (high_bottom >= visible_bottom) {
601
+ return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
602
+ } else if (high_top < visible_top) {
603
+ return this.search_results.scrollTop(high_top);
604
+ }
605
+ }
606
+ };
607
+
608
+ Chosen.prototype.result_clear_highlight = function() {
609
+ if (this.result_highlight) {
610
+ this.result_highlight.removeClass("highlighted");
611
+ }
612
+ return this.result_highlight = null;
613
+ };
614
+
615
+ Chosen.prototype.results_show = function() {
616
+ var dd_top;
617
+ if (!this.is_multiple) {
618
+ this.selected_item.addClass("chzn-single-with-drop");
619
+ if (this.result_single_selected) {
620
+ this.result_do_highlight(this.result_single_selected);
621
+ }
622
+ } else if (this.max_selected_options <= this.choices) {
623
+ this.form_field_jq.trigger("liszt:maxselected", {
624
+ chosen: this
625
+ });
626
+ return false;
627
+ }
628
+ dd_top = this.is_multiple ? this.container.height() : this.container.height() - 1;
629
+ this.form_field_jq.trigger("liszt:showing_dropdown", {
630
+ chosen: this
631
+ });
632
+ this.dropdown.css({
633
+ "top": dd_top + "px",
634
+ "left": 0
635
+ });
636
+ this.results_showing = true;
637
+ this.search_field.focus();
638
+ this.search_field.val(this.search_field.val());
639
+ return this.winnow_results();
640
+ };
641
+
642
+ Chosen.prototype.results_hide = function() {
643
+ if (!this.is_multiple) {
644
+ this.selected_item.removeClass("chzn-single-with-drop");
645
+ }
646
+ this.result_clear_highlight();
647
+ this.form_field_jq.trigger("liszt:hiding_dropdown", {
648
+ chosen: this
649
+ });
650
+ this.dropdown.css({
651
+ "left": "-9000px"
652
+ });
653
+ return this.results_showing = false;
654
+ };
655
+
656
+ Chosen.prototype.set_tab_index = function(el) {
657
+ var ti;
658
+ if (this.form_field_jq.attr("tabindex")) {
659
+ ti = this.form_field_jq.attr("tabindex");
660
+ this.form_field_jq.attr("tabindex", -1);
661
+ return this.search_field.attr("tabindex", ti);
662
+ }
663
+ };
664
+
665
+ Chosen.prototype.show_search_field_default = function() {
666
+ if (this.is_multiple && this.choices < 1 && !this.active_field) {
667
+ this.search_field.val(this.default_text);
668
+ return this.search_field.addClass("default");
669
+ } else {
670
+ this.search_field.val("");
671
+ return this.search_field.removeClass("default");
672
+ }
673
+ };
674
+
675
+ Chosen.prototype.search_results_mouseup = function(evt) {
676
+ var target;
677
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
678
+ if (target.length) {
679
+ this.result_highlight = target;
680
+ this.result_select(evt);
681
+ return this.search_field.focus();
682
+ }
683
+ };
684
+
685
+ Chosen.prototype.search_results_mouseover = function(evt) {
686
+ var target;
687
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
688
+ if (target) {
689
+ return this.result_do_highlight(target);
690
+ }
691
+ };
692
+
693
+ Chosen.prototype.search_results_mouseout = function(evt) {
694
+ if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
695
+ return this.result_clear_highlight();
696
+ }
697
+ };
698
+
699
+ Chosen.prototype.choices_click = function(evt) {
700
+ evt.preventDefault();
701
+ if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) {
702
+ return this.results_show();
703
+ }
704
+ };
705
+
706
+ Chosen.prototype.choice_build = function(item) {
707
+ var choice_id, html, link,
708
+ _this = this;
709
+ if (this.is_multiple && this.max_selected_options <= this.choices) {
710
+ this.form_field_jq.trigger("liszt:maxselected", {
711
+ chosen: this
712
+ });
713
+ return false;
714
+ }
715
+ choice_id = this.container_id + "_c_" + item.array_index;
716
+ this.choices += 1;
717
+ if (item.disabled) {
718
+ html = '<li class="search-choice search-choice-disabled" id="' + choice_id + '"><span>' + item.html + '</span></li>';
719
+ } else {
720
+ html = '<li class="search-choice" id="' + choice_id + '"><span>' + item.html + '</span><a href="javascript:void(0)" class="search-choice-close" rel="' + item.array_index + '"></a></li>';
721
+ }
722
+ this.search_container.before(html);
723
+ link = $('#' + choice_id).find("a").first();
724
+ return link.click(function(evt) {
725
+ return _this.choice_destroy_link_click(evt);
726
+ });
727
+ };
728
+
729
+ Chosen.prototype.choice_destroy_link_click = function(evt) {
730
+ evt.preventDefault();
731
+ if (!this.is_disabled) {
732
+ this.pending_destroy_click = true;
733
+ return this.choice_destroy($(evt.target));
734
+ } else {
735
+ return evt.stopPropagation;
736
+ }
737
+ };
738
+
739
+ Chosen.prototype.choice_destroy = function(link) {
740
+ if (this.result_deselect(link.attr("rel"))) {
741
+ this.choices -= 1;
742
+ this.show_search_field_default();
743
+ if (this.is_multiple && this.choices > 0 && this.search_field.val().length < 1) {
744
+ this.results_hide();
745
+ }
746
+ link.parents('li').first().remove();
747
+ return this.search_field_scale();
748
+ }
749
+ };
750
+
751
+ Chosen.prototype.results_reset = function() {
752
+ this.form_field.options[0].selected = true;
753
+ this.selected_item.find("span").text(this.default_text);
754
+ if (!this.is_multiple) {
755
+ this.selected_item.addClass("chzn-default");
756
+ }
757
+ this.show_search_field_default();
758
+ this.results_reset_cleanup();
759
+ this.form_field_jq.trigger("change");
760
+ if (this.active_field) {
761
+ return this.results_hide();
762
+ }
763
+ };
764
+
765
+ Chosen.prototype.results_reset_cleanup = function() {
766
+ this.current_value = this.form_field_jq.val();
767
+ return this.selected_item.find("abbr").remove();
768
+ };
769
+
770
+ Chosen.prototype.result_select = function(evt) {
771
+ var high, high_id, item, position;
772
+ if (this.result_highlight) {
773
+ high = this.result_highlight;
774
+ high_id = high.attr("id");
775
+ this.result_clear_highlight();
776
+ if (this.is_multiple) {
777
+ this.result_deactivate(high);
778
+ } else {
779
+ this.search_results.find(".result-selected").removeClass("result-selected");
780
+ this.result_single_selected = high;
781
+ this.selected_item.removeClass("chzn-default");
782
+ }
783
+ high.addClass("result-selected");
784
+ position = high_id.substr(high_id.lastIndexOf("_") + 1);
785
+ item = this.results_data[position];
786
+ item.selected = true;
787
+ this.form_field.options[item.options_index].selected = true;
788
+ if (this.is_multiple) {
789
+ this.choice_build(item);
790
+ } else {
791
+ this.selected_item.find("span").first().text(item.text);
792
+ if (this.allow_single_deselect) {
793
+ this.single_deselect_control_build();
794
+ }
795
+ }
796
+ if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
797
+ this.results_hide();
798
+ }
799
+ this.search_field.val("");
800
+ if (this.is_multiple || this.form_field_jq.val() !== this.current_value) {
801
+ this.form_field_jq.trigger("change", {
802
+ 'selected': this.form_field.options[item.options_index].value
803
+ });
804
+ }
805
+ this.current_value = this.form_field_jq.val();
806
+ return this.search_field_scale();
807
+ }
808
+ };
809
+
810
+ Chosen.prototype.result_activate = function(el) {
811
+ return el.addClass("active-result");
812
+ };
813
+
814
+ Chosen.prototype.result_deactivate = function(el) {
815
+ return el.removeClass("active-result");
816
+ };
817
+
818
+ Chosen.prototype.result_deselect = function(pos) {
819
+ var result, result_data;
820
+ result_data = this.results_data[pos];
821
+ if (!this.form_field.options[result_data.options_index].disabled) {
822
+ result_data.selected = false;
823
+ this.form_field.options[result_data.options_index].selected = false;
824
+ result = $("#" + this.container_id + "_o_" + pos);
825
+ result.removeClass("result-selected").addClass("active-result").show();
826
+ this.result_clear_highlight();
827
+ this.winnow_results();
828
+ this.form_field_jq.trigger("change", {
829
+ deselected: this.form_field.options[result_data.options_index].value
830
+ });
831
+ this.search_field_scale();
832
+ return true;
833
+ } else {
834
+ return false;
835
+ }
836
+ };
837
+
838
+ Chosen.prototype.single_deselect_control_build = function() {
839
+ if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) {
840
+ return this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
841
+ }
842
+ };
843
+
844
+ Chosen.prototype.winnow_results = function() {
845
+ var found, option, part, parts, regex, regexAnchor, result, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len1, _ref;
846
+ this.no_results_clear();
847
+ results = 0;
848
+ searchText = this.search_field.val() === this.default_text ? "" : $('<div/>').text($.trim(this.search_field.val())).html();
849
+ regexAnchor = this.search_contains ? "" : "^";
850
+ regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
851
+ zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
852
+ _ref = this.results_data;
853
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
854
+ option = _ref[_i];
855
+ if (!option.disabled && !option.empty) {
856
+ if (option.group) {
857
+ $('#' + option.dom_id).css('display', 'none');
858
+ } else if (!(this.is_multiple && option.selected)) {
859
+ found = false;
860
+ result_id = option.dom_id;
861
+ result = $("#" + result_id);
862
+ if (regex.test(option.html)) {
863
+ found = true;
864
+ results += 1;
865
+ } else if (this.enable_split_word_search && (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0)) {
866
+ parts = option.html.replace(/\[|\]/g, "").split(" ");
867
+ if (parts.length) {
868
+ for (_j = 0, _len1 = parts.length; _j < _len1; _j++) {
869
+ part = parts[_j];
870
+ if (regex.test(part)) {
871
+ found = true;
872
+ results += 1;
873
+ }
874
+ }
875
+ }
876
+ }
877
+ if (found) {
878
+ if (searchText.length) {
879
+ startpos = option.html.search(zregex);
880
+ text = option.html.substr(0, startpos + searchText.length) + '</em>' + option.html.substr(startpos + searchText.length);
881
+ text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
882
+ } else {
883
+ text = option.html;
884
+ }
885
+ result.html(text);
886
+ this.result_activate(result);
887
+ if (option.group_array_index != null) {
888
+ $("#" + this.results_data[option.group_array_index].dom_id).css('display', 'list-item');
889
+ }
890
+ } else {
891
+ if (this.result_highlight && result_id === this.result_highlight.attr('id')) {
892
+ this.result_clear_highlight();
893
+ }
894
+ this.result_deactivate(result);
895
+ }
896
+ }
897
+ }
898
+ }
899
+ if (results < 1 && searchText.length) {
900
+ return this.no_results(searchText);
901
+ } else {
902
+ return this.winnow_results_set_highlight();
903
+ }
904
+ };
905
+
906
+ Chosen.prototype.winnow_results_clear = function() {
907
+ var li, lis, _i, _len, _results;
908
+ this.search_field.val("");
909
+ lis = this.search_results.find("li");
910
+ _results = [];
911
+ for (_i = 0, _len = lis.length; _i < _len; _i++) {
912
+ li = lis[_i];
913
+ li = $(li);
914
+ if (li.hasClass("group-result")) {
915
+ _results.push(li.css('display', 'auto'));
916
+ } else if (!this.is_multiple || !li.hasClass("result-selected")) {
917
+ _results.push(this.result_activate(li));
918
+ } else {
919
+ _results.push(void 0);
920
+ }
921
+ }
922
+ return _results;
923
+ };
924
+
925
+ Chosen.prototype.winnow_results_set_highlight = function() {
926
+ var do_high, selected_results;
927
+ if (!this.result_highlight) {
928
+ selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
929
+ do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
930
+ if (do_high != null) {
931
+ return this.result_do_highlight(do_high);
932
+ }
933
+ }
934
+ };
935
+
936
+ Chosen.prototype.no_results = function(terms) {
937
+ var no_results_html;
938
+ no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
939
+ no_results_html.find("span").first().html(terms);
940
+ return this.search_results.append(no_results_html);
941
+ };
942
+
943
+ Chosen.prototype.no_results_clear = function() {
944
+ return this.search_results.find(".no-results").remove();
945
+ };
946
+
947
+ Chosen.prototype.keydown_arrow = function() {
948
+ var first_active, next_sib;
949
+ if (!this.result_highlight) {
950
+ first_active = this.search_results.find("li.active-result").first();
951
+ if (first_active) {
952
+ this.result_do_highlight($(first_active));
953
+ }
954
+ } else if (this.results_showing) {
955
+ next_sib = this.result_highlight.nextAll("li.active-result").first();
956
+ if (next_sib) {
957
+ this.result_do_highlight(next_sib);
958
+ }
959
+ }
960
+ if (!this.results_showing) {
961
+ return this.results_show();
962
+ }
963
+ };
964
+
965
+ Chosen.prototype.keyup_arrow = function() {
966
+ var prev_sibs;
967
+ if (!this.results_showing && !this.is_multiple) {
968
+ return this.results_show();
969
+ } else if (this.result_highlight) {
970
+ prev_sibs = this.result_highlight.prevAll("li.active-result");
971
+ if (prev_sibs.length) {
972
+ return this.result_do_highlight(prev_sibs.first());
973
+ } else {
974
+ if (this.choices > 0) {
975
+ this.results_hide();
976
+ }
977
+ return this.result_clear_highlight();
978
+ }
979
+ }
980
+ };
981
+
982
+ Chosen.prototype.keydown_backstroke = function() {
983
+ var next_available_destroy;
984
+ if (this.pending_backstroke) {
985
+ this.choice_destroy(this.pending_backstroke.find("a").first());
986
+ return this.clear_backstroke();
987
+ } else {
988
+ next_available_destroy = this.search_container.siblings("li.search-choice").last();
989
+ if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
990
+ this.pending_backstroke = next_available_destroy;
991
+ if (this.single_backstroke_delete) {
992
+ return this.keydown_backstroke();
993
+ } else {
994
+ return this.pending_backstroke.addClass("search-choice-focus");
995
+ }
996
+ }
997
+ }
998
+ };
999
+
1000
+ Chosen.prototype.clear_backstroke = function() {
1001
+ if (this.pending_backstroke) {
1002
+ this.pending_backstroke.removeClass("search-choice-focus");
1003
+ }
1004
+ return this.pending_backstroke = null;
1005
+ };
1006
+
1007
+ Chosen.prototype.keydown_checker = function(evt) {
1008
+ var stroke, _ref;
1009
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
1010
+ this.search_field_scale();
1011
+ if (stroke !== 8 && this.pending_backstroke) {
1012
+ this.clear_backstroke();
1013
+ }
1014
+ switch (stroke) {
1015
+ case 8:
1016
+ this.backstroke_length = this.search_field.val().length;
1017
+ break;
1018
+ case 9:
1019
+ if (this.results_showing && !this.is_multiple) {
1020
+ this.result_select(evt);
1021
+ }
1022
+ this.mouse_on_container = false;
1023
+ break;
1024
+ case 13:
1025
+ evt.preventDefault();
1026
+ break;
1027
+ case 38:
1028
+ evt.preventDefault();
1029
+ this.keyup_arrow();
1030
+ break;
1031
+ case 40:
1032
+ this.keydown_arrow();
1033
+ break;
1034
+ }
1035
+ };
1036
+
1037
+ Chosen.prototype.search_field_scale = function() {
1038
+ var dd_top, div, h, style, style_block, styles, w, _i, _len;
1039
+ if (this.is_multiple) {
1040
+ h = 0;
1041
+ w = 0;
1042
+ style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
1043
+ styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
1044
+ for (_i = 0, _len = styles.length; _i < _len; _i++) {
1045
+ style = styles[_i];
1046
+ style_block += style + ":" + this.search_field.css(style) + ";";
1047
+ }
1048
+ div = $('<div />', {
1049
+ 'style': style_block
1050
+ });
1051
+ div.text(this.search_field.val());
1052
+ $('body').append(div);
1053
+ w = div.width() + 25;
1054
+ div.remove();
1055
+ if (w > this.f_width - 10) {
1056
+ w = this.f_width - 10;
1057
+ }
1058
+ this.search_field.css({
1059
+ 'width': w + 'px'
1060
+ });
1061
+ dd_top = this.container.height();
1062
+ return this.dropdown.css({
1063
+ "top": dd_top + "px"
1064
+ });
1065
+ }
1066
+ };
1067
+
1068
+ Chosen.prototype.generate_random_id = function() {
1069
+ var string;
1070
+ string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char();
1071
+ while ($("#" + string).length > 0) {
1072
+ string += this.generate_random_char();
1073
+ }
1074
+ return string;
1075
+ };
1076
+
1077
+ return Chosen;
1078
+
1079
+ })(AbstractChosen);
1080
+
1081
+ root.Chosen = Chosen;
1082
+
1083
+ get_side_border_padding = function(elmt) {
1084
+ var side_border_padding;
1085
+ return side_border_padding = elmt.outerWidth() - elmt.width();
1086
+ };
1087
+
1088
+ root.get_side_border_padding = get_side_border_padding;
1089
+
1090
+ }).call(this);
assets/js/chosen/chosen.jquery.min.js CHANGED
@@ -1,10 +1,10 @@
1
- // Chosen, a Select Box Enhancer for jQuery and Protoype
2
- // by Patrick Filler for Harvest, http://getharvest.com
3
- //
4
- // Version 0.9.12
5
- // Full source at https://github.com/harvesthq/chosen
6
- // Copyright (c) 2011 Harvest http://getharvest.com
7
-
8
- // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
9
- // This file is generated by `cake build`, do not edit it by hand.
10
  (function(){var e;e=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(e){return e.nodeName.toUpperCase()==="OPTGROUP"?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,n,r,i,s,o;t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:e.label,children:0,disabled:e.disabled}),s=e.childNodes,o=[];for(r=0,i=s.length;r<i;r++)n=s[r],o.push(this.add_option(n,t,e.disabled));return o},e.prototype.add_option=function(e,t,n){if(e.nodeName.toUpperCase()==="OPTION")return e.text!==""?(t!=null&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,html:e.innerHTML,selected:e.selected,disabled:n===!0?n:e.disabled,group_array_index:t,classes:e.className,style:e.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},e}(),e.select_to_array=function(t){var n,r,i,s,o;r=new e,o=t.childNodes;for(i=0,s=o.length;i<s;i++)n=o[i],r.add_node(n);return r.parsed},this.SelectParser=e}).call(this),function(){var e,t;t=this,e=function(){function e(e,t){this.form_field=e,this.options=t!=null?t:{},this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.finish_setup()}return e.prototype.set_default_values=function(){var e=this;return this.click_test_action=function(t){return e.test_active_click(t)},this.activate_action=function(t){return e.activate_field(t)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.result_single_selected=null,this.allow_single_deselect=this.options.allow_single_deselect!=null&&this.form_field.options[0]!=null&&this.form_field.options[0].text===""?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:!0,this.search_contains=this.options.search_contains||!1,this.choices=0,this.single_backstroke_delete=this.options.single_backstroke_delete||!1,this.max_selected_options=this.options.max_selected_options||Infinity,this.inherit_select_classes=this.options.inherit_select_classes||!1},e.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||"Select Some Options":this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||"Select an Option",this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||"No results match"},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(e){var t=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return t.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(e){var t=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return t.blur_test()},100)},e.prototype.result_add_option=function(e){var t,n;return e.disabled?"":(e.dom_id=this.container_id+"_o_"+e.array_index,t=e.selected&&this.is_multiple?[]:["active-result"],e.selected&&t.push("result-selected"),e.group_array_index!=null&&t.push("group-option"),e.classes!==""&&t.push(e.classes),n=e.style.cssText!==""?' style="'+e.style+'"':"",'<li id="'+e.dom_id+'" class="'+t.join(" ")+'"'+n+">"+e.html+"</li>")},e.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.keyup_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale();switch(t){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:e.preventDefault();if(this.results_showing)return this.result_select(e);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.generate_field_id=function(){var e;return e=this.generate_random_id(),this.form_field.id=e,e},e.prototype.generate_random_char=function(){var e,t,n;return e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",n=Math.floor(Math.random()*e.length),t=e.substring(n,n+1)},e}(),t.AbstractChosen=e}.call(this),function(){var e,t,n,r,i={}.hasOwnProperty,s=function(e,t){function r(){this.constructor=e}for(var n in t)i.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};r=this,e=jQuery,e.fn.extend({chosen:function(n){var r,i,s;return s=navigator.userAgent.toLowerCase(),i=/(msie) ([\w.]+)/.exec(s)||[],r={name:i[1]||"",version:i[2]||"0"},r.name==="msie"&&(r.version==="6.0"||r.version==="7.0"&&document.documentMode===7)?this:this.each(function(r){var i;i=e(this);if(!i.hasClass("chzn-done"))return i.data("chosen",new t(this,n))})}}),t=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return s(i,t),i.prototype.setup=function(){return this.form_field_jq=e(this.form_field),this.current_value=this.form_field_jq.val(),this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},i.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},i.prototype.set_up_html=function(){var t,r,i,s,o,u;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/[^\w]/g,"_"):this.generate_field_id(),this.container_id+="_chzn",t=["chzn-container"],t.push("chzn-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chzn-rtl"),this.f_width=this.form_field_jq.outerWidth(),i={id:this.container_id,"class":t.join(" "),style:"width: "+this.f_width+"px;",title:this.form_field.title},r=e("<div />",i),this.is_multiple?r.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>'):r.html('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>'),this.form_field_jq.hide().after(r),this.container=e("#"+this.container_id),this.dropdown=this.container.find("div.chzn-drop").first(),s=this.container.height(),o=this.f_width-n(this.dropdown),this.dropdown.css({width:o+"px",top:s+"px"}),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first(),u=o-n(this.search_container)-n(this.search_field),this.search_field.css({width:u+"px"})),this.results_build(),this.set_tab_index(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},i.prototype.register_observers=function(){var e=this;return this.container.mousedown(function(t){e.container_mousedown(t)}),this.container.mouseup(function(t){e.container_mouseup(t)}),this.container.mouseenter(function(t){e.mouse_enter(t)}),this.container.mouseleave(function(t){e.mouse_leave(t)}),this.search_results.mouseup(function(t){e.search_results_mouseup(t)}),this.search_results.mouseover(function(t){e.search_results_mouseover(t)}),this.search_results.mouseout(function(t){e.search_results_mouseout(t)}),this.form_field_jq.bind("liszt:updated",function(t){e.results_update_field(t)}),this.form_field_jq.bind("liszt:activate",function(t){e.activate_field(t)}),this.form_field_jq.bind("liszt:open",function(t){e.container_mousedown(t)}),this.search_field.blur(function(t){e.input_blur(t)}),this.search_field.keyup(function(t){e.keyup_checker(t)}),this.search_field.keydown(function(t){e.keydown_checker(t)}),this.search_field.focus(function(t){e.input_focus(t)}),this.is_multiple?this.search_choices.click(function(t){e.choices_click(t)}):this.container.click(function(e){e.preventDefault()})},i.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled)return this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field();this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1;if(!this.is_multiple)return this.selected_item.bind("focus",this.activate_action)},i.prototype.container_mousedown=function(t){var n;if(!this.is_disabled)return n=t!=null?e(t.target).hasClass("search-choice-close"):!1,t&&t.type==="mousedown"&&!this.results_showing&&t.preventDefault(),!this.pending_destroy_click&&!n?(this.active_field?!this.is_multiple&&t&&(e(t.target)[0]===this.selected_item[0]||e(t.target).parents("a.chzn-single").length)&&(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),e(document).click(this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},i.prototype.container_mouseup=function(e){if(e.target.nodeName==="ABBR"&&!this.is_disabled)return this.results_reset(e)},i.prototype.blur_test=function(e){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},i.prototype.close_field=function(){return e(document).unbind("click",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(t){return e(t.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){var e,t,n,i,s;this.parsing=!0,this.results_data=r.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):this.is_multiple||(this.selected_item.addClass("chzn-default").find("span").text(this.default_text),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")),e="",s=this.results_data;for(n=0,i=s.length;n<i;n++)t=s[n],t.group?e+=this.result_add_group(t):t.empty||(e+=this.result_add_option(t),t.selected&&this.is_multiple?this.choice_build(t):t.selected&&!this.is_multiple&&(this.selected_item.removeClass("chzn-default").find("span").text(t.text),this.allow_single_deselect&&this.single_deselect_control_build()));return this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.search_results.html(e),this.parsing=!1},i.prototype.result_add_group=function(t){return t.disabled?"":(t.dom_id=this.container_id+"_g_"+t.array_index,'<li id="'+t.dom_id+'" class="group-result">'+e("<div />").text(t.label).html()+"</li>")},i.prototype.result_do_highlight=function(e){var t,n,r,i,s;if(e.length){this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),r=parseInt(this.search_results.css("maxHeight"),10),s=this.search_results.scrollTop(),i=r+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),t=n+this.result_highlight.outerHeight();if(t>=i)return this.search_results.scrollTop(t-r>0?t-r:0);if(n<s)return this.search_results.scrollTop(n)}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e;if(!this.is_multiple)this.selected_item.addClass("chzn-single-with-drop"),this.result_single_selected&&this.result_do_highlight(this.result_single_selected);else if(this.max_selected_options<=this.choices)return this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1;return e=this.is_multiple?this.container.height():this.container.height()-1,this.form_field_jq.trigger("liszt:showing_dropdown",{chosen:this}),this.dropdown.css({top:e+"px",left:0}),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results()},i.prototype.results_hide=function(){return this.is_multiple||this.selected_item.removeClass("chzn-single-with-drop"),this.result_clear_highlight(),this.form_field_jq.trigger("liszt:hiding_dropdown",{chosen:this}),this.dropdown.css({left:"-9000px"}),this.results_showing=!1},i.prototype.set_tab_index=function(e){var t;if(this.form_field_jq.attr("tabindex"))return t=this.form_field_jq.attr("tabindex"),this.form_field_jq.attr("tabindex",-1),this.search_field.attr("tabindex",t)},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(t){var n;n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first();if(n.length)return this.result_highlight=n,this.result_select(t),this.search_field.focus()},i.prototype.search_results_mouseover=function(t){var n;n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first();if(n)return this.result_do_highlight(n)},i.prototype.search_results_mouseout=function(t){if(e(t.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choices_click=function(t){t.preventDefault();if(this.active_field&&!e(t.target).hasClass("search-choice")&&!this.results_showing)return this.results_show()},i.prototype.choice_build=function(t){var n,r,i,s=this;return this.is_multiple&&this.max_selected_options<=this.choices?(this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1):(n=this.container_id+"_c_"+t.array_index,this.choices+=1,t.disabled?r='<li class="search-choice search-choice-disabled" id="'+n+'"><span>'+t.html+"</span></li>":r='<li class="search-choice" id="'+n+'"><span>'+t.html+'</span><a href="javascript:void(0)" class="search-choice-close" rel="'+t.array_index+'"></a></li>',this.search_container.before(r),i=e("#"+n).find("a").first(),i.click(function(e){return s.choice_destroy_link_click(e)}))},i.prototype.choice_destroy_link_click=function(t){return t.preventDefault(),this.is_disabled?t.stopPropagation:(this.pending_destroy_click=!0,this.choice_destroy(e(t.target)))},i.prototype.choice_destroy=function(e){if(this.result_deselect(e.attr("rel")))return this.choices-=1,this.show_search_field_default(),this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),e.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){this.form_field.options[0].selected=!0,this.selected_item.find("span").text(this.default_text),this.is_multiple||this.selected_item.addClass("chzn-default"),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_value=this.form_field_jq.val(),this.selected_item.find("abbr").remove()},i.prototype.result_select=function(e){var t,n,r,i;if(this.result_highlight)return t=this.result_highlight,n=t.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(t):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=t,this.selected_item.removeClass("chzn-default")),t.addClass("result-selected"),i=n.substr(n.lastIndexOf("_")+1),r=this.results_data[i],r.selected=!0,this.form_field.options[r.options_index].selected=!0,this.is_multiple?this.choice_build(r):(this.selected_item.find("span").first().text(r.text),this.allow_single_deselect&&this.single_deselect_control_build()),(!e.metaKey&&!e.ctrlKey||!this.is_multiple)&&this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field_jq.val()!==this.current_value)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[r.options_index].value}),this.current_value=this.form_field_jq.val(),this.search_field_scale()},i.prototype.result_activate=function(e){return e.addClass("active-result")},i.prototype.result_deactivate=function(e){return e.removeClass("active-result")},i.prototype.result_deselect=function(t){var n,r;return r=this.results_data[t],this.form_field.options[r.options_index].disabled?!1:(r.selected=!1,this.form_field.options[r.options_index].selected=!1,n=e("#"+this.container_id+"_o_"+t),n.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[r.options_index].value}),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>')},i.prototype.winnow_results=function(){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y;this.no_results_clear(),f=0,l=this.search_field.val()===this.default_text?"":e("<div/>").text(e.trim(this.search_field.val())).html(),o=this.search_contains?"":"^",s=new RegExp(o+l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),p=new RegExp(l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),y=this.results_data;for(d=0,m=y.length;d<m;d++){n=y[d];if(!n.disabled&&!n.empty)if(n.group)e("#"+n.dom_id).css("display","none");else if(!this.is_multiple||!n.selected){t=!1,a=n.dom_id,u=e("#"+a);if(s.test(n.html))t=!0,f+=1;else if(this.enable_split_word_search&&(n.html.indexOf(" ")>=0||n.html.indexOf("[")===0)){i=n.html.replace(/\[|\]/g,"").split(" ");if(i.length)for(v=0,g=i.length;v<g;v++)r=i[v],s.test(r)&&(t=!0,f+=1)}t?(l.length?(c=n.html.search(p),h=n.html.substr(0,c+l.length)+"</em>"+n.html.substr(c+l.length),h=h.substr(0,c)+"<em>"+h.substr(c)):h=n.html,u.html(h),this.result_activate(u),n.group_array_index!=null&&e("#"+this.results_data[n.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&a===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(u))}}return f<1&&l.length?this.no_results(l):this.winnow_results_set_highlight()},i.prototype.winnow_results_clear=function(){var t,n,r,i,s;this.search_field.val(""),n=this.search_results.find("li"),s=[];for(r=0,i=n.length;r<i;r++)t=n[r],t=e(t),t.hasClass("group-result")?s.push(t.css("display","auto")):!this.is_multiple||!t.hasClass("result-selected")?s.push(this.result_activate(t)):s.push(void 0);return s},i.prototype.winnow_results_set_highlight=function(){var e,t;if(!this.result_highlight){t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=t.length?t.first():this.search_results.find(".active-result").first();if(e!=null)return this.result_do_highlight(e)}},i.prototype.no_results=function(t){var n;return n=e('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),n.find("span").first().html(t),this.search_results.append(n)},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t,n;this.result_highlight?this.results_showing&&(n=this.result_highlight.nextAll("li.active-result").first(),n&&this.result_do_highlight(n)):(t=this.search_results.find("li.active-result").first(),t&&this.result_do_highlight(e(t)));if(!this.results_showing)return this.results_show()},i.prototype.keyup_arrow=function(){var e;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight)return e=this.result_highlight.prevAll("li.active-result"),e.length?this.result_do_highlight(e.first()):(this.choices>0&&this.results_hide(),this.result_clear_highlight())},i.prototype.keydown_backstroke=function(){var e;if(this.pending_backstroke)return this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke();e=this.search_container.siblings("li.search-choice").last();if(e.length&&!e.hasClass("search-choice-disabled"))return this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale(),t!==8&&this.pending_backstroke&&this.clear_backstroke();switch(t){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},i.prototype.search_field_scale=function(){var t,n,r,i,s,o,u,a,f;if(this.is_multiple){r=0,u=0,s="position:absolute; left: -1000px; top: -1000px; display:none;",o=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(a=0,f=o.length;a<f;a++)i=o[a],s+=i+":"+this.search_field.css(i)+";";return n=e("<div />",{style:s}),n.text(this.search_field.val()),e("body").append(n),u=n.width()+25,n.remove(),u>this.f_width-10&&(u=this.f_width-10),this.search_field.css({width:u+"px"}),t=this.container.height(),this.dropdown.css({top:t+"px"})}},i.prototype.generate_random_id=function(){var t;t="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();while(e("#"+t).length>0)t+=this.generate_random_char();return t},i}(AbstractChosen),r.Chosen=t,n=function(e){var t;return t=e.outerWidth()-e.width()},r.get_side_border_padding=n}.call(this);
1
+ // Chosen, a Select Box Enhancer for jQuery and Protoype
2
+ // by Patrick Filler for Harvest, http://getharvest.com
3
+ //
4
+ // Version 0.9.12
5
+ // Full source at https://github.com/harvesthq/chosen
6
+ // Copyright (c) 2011 Harvest http://getharvest.com
7
+
8
+ // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
9
+ // This file is generated by `cake build`, do not edit it by hand.
10
  (function(){var e;e=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(e){return e.nodeName.toUpperCase()==="OPTGROUP"?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,n,r,i,s,o;t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:e.label,children:0,disabled:e.disabled}),s=e.childNodes,o=[];for(r=0,i=s.length;r<i;r++)n=s[r],o.push(this.add_option(n,t,e.disabled));return o},e.prototype.add_option=function(e,t,n){if(e.nodeName.toUpperCase()==="OPTION")return e.text!==""?(t!=null&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,html:e.innerHTML,selected:e.selected,disabled:n===!0?n:e.disabled,group_array_index:t,classes:e.className,style:e.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},e}(),e.select_to_array=function(t){var n,r,i,s,o;r=new e,o=t.childNodes;for(i=0,s=o.length;i<s;i++)n=o[i],r.add_node(n);return r.parsed},this.SelectParser=e}).call(this),function(){var e,t;t=this,e=function(){function e(e,t){this.form_field=e,this.options=t!=null?t:{},this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.finish_setup()}return e.prototype.set_default_values=function(){var e=this;return this.click_test_action=function(t){return e.test_active_click(t)},this.activate_action=function(t){return e.activate_field(t)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.result_single_selected=null,this.allow_single_deselect=this.options.allow_single_deselect!=null&&this.form_field.options[0]!=null&&this.form_field.options[0].text===""?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:!0,this.search_contains=this.options.search_contains||!1,this.choices=0,this.single_backstroke_delete=this.options.single_backstroke_delete||!1,this.max_selected_options=this.options.max_selected_options||Infinity,this.inherit_select_classes=this.options.inherit_select_classes||!1},e.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||"Select Some Options":this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||"Select an Option",this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||"No results match"},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(e){var t=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return t.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(e){var t=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return t.blur_test()},100)},e.prototype.result_add_option=function(e){var t,n;return e.disabled?"":(e.dom_id=this.container_id+"_o_"+e.array_index,t=e.selected&&this.is_multiple?[]:["active-result"],e.selected&&t.push("result-selected"),e.group_array_index!=null&&t.push("group-option"),e.classes!==""&&t.push(e.classes),n=e.style.cssText!==""?' style="'+e.style+'"':"",'<li id="'+e.dom_id+'" class="'+t.join(" ")+'"'+n+">"+e.html+"</li>")},e.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.keyup_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale();switch(t){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:e.preventDefault();if(this.results_showing)return this.result_select(e);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.generate_field_id=function(){var e;return e=this.generate_random_id(),this.form_field.id=e,e},e.prototype.generate_random_char=function(){var e,t,n;return e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",n=Math.floor(Math.random()*e.length),t=e.substring(n,n+1)},e}(),t.AbstractChosen=e}.call(this),function(){var e,t,n,r,i={}.hasOwnProperty,s=function(e,t){function r(){this.constructor=e}for(var n in t)i.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};r=this,e=jQuery,e.fn.extend({chosen:function(n){var r,i,s;return s=navigator.userAgent.toLowerCase(),i=/(msie) ([\w.]+)/.exec(s)||[],r={name:i[1]||"",version:i[2]||"0"},r.name==="msie"&&(r.version==="6.0"||r.version==="7.0"&&document.documentMode===7)?this:this.each(function(r){var i;i=e(this);if(!i.hasClass("chzn-done"))return i.data("chosen",new t(this,n))})}}),t=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return s(i,t),i.prototype.setup=function(){return this.form_field_jq=e(this.form_field),this.current_value=this.form_field_jq.val(),this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},i.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},i.prototype.set_up_html=function(){var t,r,i,s,o,u;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/[^\w]/g,"_"):this.generate_field_id(),this.container_id+="_chzn",t=["chzn-container"],t.push("chzn-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chzn-rtl"),this.f_width=this.form_field_jq.outerWidth(),i={id:this.container_id,"class":t.join(" "),style:"width: "+this.f_width+"px;",title:this.form_field.title},r=e("<div />",i),this.is_multiple?r.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>'):r.html('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>'),this.form_field_jq.hide().after(r),this.container=e("#"+this.container_id),this.dropdown=this.container.find("div.chzn-drop").first(),s=this.container.height(),o=this.f_width-n(this.dropdown),this.dropdown.css({width:o+"px",top:s+"px"}),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first(),u=o-n(this.search_container)-n(this.search_field),this.search_field.css({width:u+"px"})),this.results_build(),this.set_tab_index(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},i.prototype.register_observers=function(){var e=this;return this.container.mousedown(function(t){e.container_mousedown(t)}),this.container.mouseup(function(t){e.container_mouseup(t)}),this.container.mouseenter(function(t){e.mouse_enter(t)}),this.container.mouseleave(function(t){e.mouse_leave(t)}),this.search_results.mouseup(function(t){e.search_results_mouseup(t)}),this.search_results.mouseover(function(t){e.search_results_mouseover(t)}),this.search_results.mouseout(function(t){e.search_results_mouseout(t)}),this.form_field_jq.bind("liszt:updated",function(t){e.results_update_field(t)}),this.form_field_jq.bind("liszt:activate",function(t){e.activate_field(t)}),this.form_field_jq.bind("liszt:open",function(t){e.container_mousedown(t)}),this.search_field.blur(function(t){e.input_blur(t)}),this.search_field.keyup(function(t){e.keyup_checker(t)}),this.search_field.keydown(function(t){e.keydown_checker(t)}),this.search_field.focus(function(t){e.input_focus(t)}),this.is_multiple?this.search_choices.click(function(t){e.choices_click(t)}):this.container.click(function(e){e.preventDefault()})},i.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled)return this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field();this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1;if(!this.is_multiple)return this.selected_item.bind("focus",this.activate_action)},i.prototype.container_mousedown=function(t){var n;if(!this.is_disabled)return n=t!=null?e(t.target).hasClass("search-choice-close"):!1,t&&t.type==="mousedown"&&!this.results_showing&&t.preventDefault(),!this.pending_destroy_click&&!n?(this.active_field?!this.is_multiple&&t&&(e(t.target)[0]===this.selected_item[0]||e(t.target).parents("a.chzn-single").length)&&(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),e(document).click(this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},i.prototype.container_mouseup=function(e){if(e.target.nodeName==="ABBR"&&!this.is_disabled)return this.results_reset(e)},i.prototype.blur_test=function(e){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},i.prototype.close_field=function(){return e(document).unbind("click",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(t){return e(t.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){var e,t,n,i,s;this.parsing=!0,this.results_data=r.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):this.is_multiple||(this.selected_item.addClass("chzn-default").find("span").text(this.default_text),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")),e="",s=this.results_data;for(n=0,i=s.length;n<i;n++)t=s[n],t.group?e+=this.result_add_group(t):t.empty||(e+=this.result_add_option(t),t.selected&&this.is_multiple?this.choice_build(t):t.selected&&!this.is_multiple&&(this.selected_item.removeClass("chzn-default").find("span").text(t.text),this.allow_single_deselect&&this.single_deselect_control_build()));return this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.search_results.html(e),this.parsing=!1},i.prototype.result_add_group=function(t){return t.disabled?"":(t.dom_id=this.container_id+"_g_"+t.array_index,'<li id="'+t.dom_id+'" class="group-result">'+e("<div />").text(t.label).html()+"</li>")},i.prototype.result_do_highlight=function(e){var t,n,r,i,s;if(e.length){this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),r=parseInt(this.search_results.css("maxHeight"),10),s=this.search_results.scrollTop(),i=r+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),t=n+this.result_highlight.outerHeight();if(t>=i)return this.search_results.scrollTop(t-r>0?t-r:0);if(n<s)return this.search_results.scrollTop(n)}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e;if(!this.is_multiple)this.selected_item.addClass("chzn-single-with-drop"),this.result_single_selected&&this.result_do_highlight(this.result_single_selected);else if(this.max_selected_options<=this.choices)return this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1;return e=this.is_multiple?this.container.height():this.container.height()-1,this.form_field_jq.trigger("liszt:showing_dropdown",{chosen:this}),this.dropdown.css({top:e+"px",left:0}),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results()},i.prototype.results_hide=function(){return this.is_multiple||this.selected_item.removeClass("chzn-single-with-drop"),this.result_clear_highlight(),this.form_field_jq.trigger("liszt:hiding_dropdown",{chosen:this}),this.dropdown.css({left:"-9000px"}),this.results_showing=!1},i.prototype.set_tab_index=function(e){var t;if(this.form_field_jq.attr("tabindex"))return t=this.form_field_jq.attr("tabindex"),this.form_field_jq.attr("tabindex",-1),this.search_field.attr("tabindex",t)},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(t){var n;n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first();if(n.length)return this.result_highlight=n,this.result_select(t),this.search_field.focus()},i.prototype.search_results_mouseover=function(t){var n;n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first();if(n)return this.result_do_highlight(n)},i.prototype.search_results_mouseout=function(t){if(e(t.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choices_click=function(t){t.preventDefault();if(this.active_field&&!e(t.target).hasClass("search-choice")&&!this.results_showing)return this.results_show()},i.prototype.choice_build=function(t){var n,r,i,s=this;return this.is_multiple&&this.max_selected_options<=this.choices?(this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1):(n=this.container_id+"_c_"+t.array_index,this.choices+=1,t.disabled?r='<li class="search-choice search-choice-disabled" id="'+n+'"><span>'+t.html+"</span></li>":r='<li class="search-choice" id="'+n+'"><span>'+t.html+'</span><a href="javascript:void(0)" class="search-choice-close" rel="'+t.array_index+'"></a></li>',this.search_container.before(r),i=e("#"+n).find("a").first(),i.click(function(e){return s.choice_destroy_link_click(e)}))},i.prototype.choice_destroy_link_click=function(t){return t.preventDefault(),this.is_disabled?t.stopPropagation:(this.pending_destroy_click=!0,this.choice_destroy(e(t.target)))},i.prototype.choice_destroy=function(e){if(this.result_deselect(e.attr("rel")))return this.choices-=1,this.show_search_field_default(),this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),e.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){this.form_field.options[0].selected=!0,this.selected_item.find("span").text(this.default_text),this.is_multiple||this.selected_item.addClass("chzn-default"),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_value=this.form_field_jq.val(),this.selected_item.find("abbr").remove()},i.prototype.result_select=function(e){var t,n,r,i;if(this.result_highlight)return t=this.result_highlight,n=t.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(t):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=t,this.selected_item.removeClass("chzn-default")),t.addClass("result-selected"),i=n.substr(n.lastIndexOf("_")+1),r=this.results_data[i],r.selected=!0,this.form_field.options[r.options_index].selected=!0,this.is_multiple?this.choice_build(r):(this.selected_item.find("span").first().text(r.text),this.allow_single_deselect&&this.single_deselect_control_build()),(!e.metaKey&&!e.ctrlKey||!this.is_multiple)&&this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field_jq.val()!==this.current_value)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[r.options_index].value}),this.current_value=this.form_field_jq.val(),this.search_field_scale()},i.prototype.result_activate=function(e){return e.addClass("active-result")},i.prototype.result_deactivate=function(e){return e.removeClass("active-result")},i.prototype.result_deselect=function(t){var n,r;return r=this.results_data[t],this.form_field.options[r.options_index].disabled?!1:(r.selected=!1,this.form_field.options[r.options_index].selected=!1,n=e("#"+this.container_id+"_o_"+t),n.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[r.options_index].value}),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>')},i.prototype.winnow_results=function(){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y;this.no_results_clear(),f=0,l=this.search_field.val()===this.default_text?"":e("<div/>").text(e.trim(this.search_field.val())).html(),o=this.search_contains?"":"^",s=new RegExp(o+l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),p=new RegExp(l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),y=this.results_data;for(d=0,m=y.length;d<m;d++){n=y[d];if(!n.disabled&&!n.empty)if(n.group)e("#"+n.dom_id).css("display","none");else if(!this.is_multiple||!n.selected){t=!1,a=n.dom_id,u=e("#"+a);if(s.test(n.html))t=!0,f+=1;else if(this.enable_split_word_search&&(n.html.indexOf(" ")>=0||n.html.indexOf("[")===0)){i=n.html.replace(/\[|\]/g,"").split(" ");if(i.length)for(v=0,g=i.length;v<g;v++)r=i[v],s.test(r)&&(t=!0,f+=1)}t?(l.length?(c=n.html.search(p),h=n.html.substr(0,c+l.length)+"</em>"+n.html.substr(c+l.length),h=h.substr(0,c)+"<em>"+h.substr(c)):h=n.html,u.html(h),this.result_activate(u),n.group_array_index!=null&&e("#"+this.results_data[n.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&a===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(u))}}return f<1&&l.length?this.no_results(l):this.winnow_results_set_highlight()},i.prototype.winnow_results_clear=function(){var t,n,r,i,s;this.search_field.val(""),n=this.search_results.find("li"),s=[];for(r=0,i=n.length;r<i;r++)t=n[r],t=e(t),t.hasClass("group-result")?s.push(t.css("display","auto")):!this.is_multiple||!t.hasClass("result-selected")?s.push(this.result_activate(t)):s.push(void 0);return s},i.prototype.winnow_results_set_highlight=function(){var e,t;if(!this.result_highlight){t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=t.length?t.first():this.search_results.find(".active-result").first();if(e!=null)return this.result_do_highlight(e)}},i.prototype.no_results=function(t){var n;return n=e('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),n.find("span").first().html(t),this.search_results.append(n)},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t,n;this.result_highlight?this.results_showing&&(n=this.result_highlight.nextAll("li.active-result").first(),n&&this.result_do_highlight(n)):(t=this.search_results.find("li.active-result").first(),t&&this.result_do_highlight(e(t)));if(!this.results_showing)return this.results_show()},i.prototype.keyup_arrow=function(){var e;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight)return e=this.result_highlight.prevAll("li.active-result"),e.length?this.result_do_highlight(e.first()):(this.choices>0&&this.results_hide(),this.result_clear_highlight())},i.prototype.keydown_backstroke=function(){var e;if(this.pending_backstroke)return this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke();e=this.search_container.siblings("li.search-choice").last();if(e.length&&!e.hasClass("search-choice-disabled"))return this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale(),t!==8&&this.pending_backstroke&&this.clear_backstroke();switch(t){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},i.prototype.search_field_scale=function(){var t,n,r,i,s,o,u,a,f;if(this.is_multiple){r=0,u=0,s="position:absolute; left: -1000px; top: -1000px; display:none;",o=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(a=0,f=o.length;a<f;a++)i=o[a],s+=i+":"+this.search_field.css(i)+";";return n=e("<div />",{style:s}),n.text(this.search_field.val()),e("body").append(n),u=n.width()+25,n.remove(),u>this.f_width-10&&(u=this.f_width-10),this.search_field.css({width:u+"px"}),t=this.container.height(),this.dropdown.css({top:t+"px"})}},i.prototype.generate_random_id=function(){var t;t="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();while(e("#"+t).length>0)t+=this.generate_random_char();return t},i}(AbstractChosen),r.Chosen=t,n=function(e){var t;return t=e.outerWidth()-e.width()},r.get_side_border_padding=n}.call(this);
assets/js/dlm-uninstall.js CHANGED
@@ -1,70 +1,70 @@
1
- jQuery(document).ready(function ($) {
2
-
3
- var uninstall = $("a.uninstall-dlm"),
4
- formContainer = $('#dlm-uninstall-form');
5
-
6
- formContainer.on('click', '#delete_all', function () {
7
- if ( $('#delete_all').is(':checked') ) {
8
- $('#delete_options').prop('checked', true);
9
- $('#delete_transients').prop('checked', true);
10
- $('#delete_cpt').prop('checked', true);
11
- $('#delete_set_tables').prop('checked', true);
12
- } else {
13
- $('#delete_options').prop('checked', false);
14
- $('#delete_transients').prop('checked', false);
15
- $('#delete_cpt').prop('checked', false);
16
- $('#delete_set_tables').prop('checked', false);
17
- }
18
- });
19
-
20
- $(uninstall).on("click", function () {
21
-
22
- $('body').toggleClass('dlm-uninstall-form-active');
23
- formContainer.fadeIn();
24
-
25
- formContainer.on('click', '#dlm-uninstall-submit-form', function (e) {
26
- formContainer.addClass('toggle-spinner');
27
- var selectedOptions = {
28
- delete_options: ($('#delete_options').is(':checked')) ? 1 : 0,
29
- delete_transients: ($('#delete_transients').is(':checked')) ? 1 : 0,
30
- delete_cpt: ($('#delete_cpt').is(':checked')) ? 1 : 0,
31
- delete_set_tables: ($('#delete_set_tables').is(':checked')) ? 1 : 0,
32
- };
33
-
34
- var data = {
35
- 'action': 'dlm_uninstall_plugin',
36
- 'security': wpDLMUninstall.nonce,
37
- 'dataType': "json",
38
- 'options': selectedOptions
39
- };
40
-
41
- $.post(
42
- ajaxurl,
43
- data,
44
- function (response) {
45
- // Redirect to plugins page
46
- window.location.href = wpDLMUninstall.redirect_url;
47
- }
48
- );
49
- });
50
-
51
- // If we click outside the form, the form will close
52
- // Stop propagation from form
53
- formContainer.on('click', function (e) {
54
- e.stopPropagation();
55
- });
56
-
57
- $('.dlm-uninstall-form-wrapper, .close-uninstall-form').on('click', function (e) {
58
- e.stopPropagation();
59
- formContainer.fadeOut();
60
- $('body').removeClass('dlm-uninstall-form-active');
61
- });
62
-
63
- $(document).on("keyup", function (e) {
64
- if ( e.key === "Escape" ) {
65
- formContainer.fadeOut();
66
- $('body').removeClass('dlm-uninstall-form-active');
67
- }
68
- });
69
- });
70
  });
1
+ jQuery(document).ready(function ($) {
2
+
3
+ var uninstall = $("a.uninstall-dlm"),
4
+ formContainer = $('#dlm-uninstall-form');
5
+
6
+ formContainer.on('click', '#delete_all', function () {
7
+ if ( $('#delete_all').is(':checked') ) {
8
+ $('#delete_options').prop('checked', true);
9
+ $('#delete_transients').prop('checked', true);
10
+ $('#delete_cpt').prop('checked', true);
11
+ $('#delete_set_tables').prop('checked', true);
12
+ } else {
13
+ $('#delete_options').prop('checked', false);
14
+ $('#delete_transients').prop('checked', false);
15
+ $('#delete_cpt').prop('checked', false);
16
+ $('#delete_set_tables').prop('checked', false);
17
+ }
18
+ });
19
+
20
+ $(uninstall).on("click", function () {
21
+
22
+ $('body').toggleClass('dlm-uninstall-form-active');
23
+ formContainer.fadeIn();
24
+
25
+ formContainer.on('click', '#dlm-uninstall-submit-form', function (e) {
26
+ formContainer.addClass('toggle-spinner');
27
+ var selectedOptions = {
28
+ delete_options: ($('#delete_options').is(':checked')) ? 1 : 0,
29
+ delete_transients: ($('#delete_transients').is(':checked')) ? 1 : 0,
30
+ delete_cpt: ($('#delete_cpt').is(':checked')) ? 1 : 0,
31
+ delete_set_tables: ($('#delete_set_tables').is(':checked')) ? 1 : 0,
32
+ };
33
+
34
+ var data = {
35
+ 'action': 'dlm_uninstall_plugin',
36
+ 'security': wpDLMUninstall.nonce,
37
+ 'dataType': "json",
38
+ 'options': selectedOptions
39
+ };
40
+
41
+ $.post(
42
+ ajaxurl,
43
+ data,
44
+ function (response) {
45
+ // Redirect to plugins page
46
+ window.location.href = wpDLMUninstall.redirect_url;
47
+ }
48
+ );
49
+ });
50
+
51
+ // If we click outside the form, the form will close
52
+ // Stop propagation from form
53
+ formContainer.on('click', function (e) {
54
+ e.stopPropagation();
55
+ });
56
+
57
+ $('.dlm-uninstall-form-wrapper, .close-uninstall-form').on('click', function (e) {
58
+ e.stopPropagation();
59
+ formContainer.fadeOut();
60
+ $('body').removeClass('dlm-uninstall-form-active');
61
+ });
62
+
63
+ $(document).on("keyup", function (e) {
64
+ if ( e.key === "Escape" ) {
65
+ formContainer.fadeOut();
66
+ $('body').removeClass('dlm-uninstall-form-active');
67
+ }
68
+ });
69
+ });
70
  });
assets/js/extensions.js CHANGED
@@ -1,42 +1,42 @@
1
- jQuery( function ( $ ) {
2
-
3
- $.each( $( '.extension_license a' ), function ( k, v ) {
4
- $( v ).click( function () {
5
- var wrap = $( v ).closest( '.extension_license' );
6
-
7
- var ex_ac = (
8
- 'inactive' == $( wrap ).find( '#status' ).val()
9
- ) ? 'activate' : 'deactivate';
10
-
11
- $(wrap).find('.dlm_license_error').remove();
12
-
13
- $.post( ajaxurl, {
14
- action: 'dlm_extension',
15
- nonce: $( '#dlm-ajax-nonce' ).val(),
16
- product_id: $( wrap ).find( '#product_id' ).val(),
17
- key: $( wrap ).find( '#key' ).val(),
18
- email: $( wrap ).find( '#email' ).val(),
19
- extension_action: ex_ac
20
- }, function ( response ) {
21
- if ( response.result == 'failed' ) {
22
- $( wrap ).prepend( $( "<div>" ).addClass( "dlm_license_error" ).html( response.message ) );
23
- } else {
24
- if ( 'activate' == ex_ac ) {
25
- $( wrap ).find( '.license-status' ).addClass( 'active' ).html( 'ACTIVE' );
26
- $( wrap ).find( '.button' ).html( 'Deactivate' );
27
- $( wrap ).find( '#status' ).val( 'active' );
28
- $( wrap ).find( '#key' ).attr( 'disabled', true );
29
- $( wrap ).find( '#email' ).attr( 'disabled', true );
30
- } else {
31
- $( wrap ).find( '.license-status' ).removeClass( 'active' ).html( 'INACTIVE' );
32
- $( wrap ).find( '.button' ).html( 'Activate' );
33
- $( wrap ).find( '#status' ).val( 'inactive' );
34
- $( wrap ).find( '#key' ).attr( 'disabled', false );
35
- $( wrap ).find( '#email' ).attr( 'disabled', false );
36
- }
37
- }
38
- } );
39
-
40
- } );
41
- } );
42
  } );
1
+ jQuery( function ( $ ) {
2
+
3
+ $.each( $( '.extension_license a' ), function ( k, v ) {
4
+ $( v ).click( function () {
5
+ var wrap = $( v ).closest( '.extension_license' );
6
+
7
+ var ex_ac = (
8
+ 'inactive' == $( wrap ).find( '#status' ).val()
9
+ ) ? 'activate' : 'deactivate';
10
+
11
+ $(wrap).find('.dlm_license_error').remove();
12
+
13
+ $.post( ajaxurl, {
14
+ action: 'dlm_extension',
15
+ nonce: $( '#dlm-ajax-nonce' ).val(),
16
+ product_id: $( wrap ).find( '#product_id' ).val(),
17
+ key: $( wrap ).find( '#key' ).val(),
18
+ email: $( wrap ).find( '#email' ).val(),
19
+ extension_action: ex_ac
20
+ }, function ( response ) {
21
+ if ( response.result == 'failed' ) {
22
+ $( wrap ).prepend( $( "<div>" ).addClass( "dlm_license_error" ).html( response.message ) );
23
+ } else {
24
+ if ( 'activate' == ex_ac ) {
25
+ $( wrap ).find( '.license-status' ).addClass( 'active' ).html( 'ACTIVE' );
26
+ $( wrap ).find( '.button' ).html( 'Deactivate' );
27
+ $( wrap ).find( '#status' ).val( 'active' );
28
+ $( wrap ).find( '#key' ).attr( 'disabled', true );
29
+ $( wrap ).find( '#email' ).attr( 'disabled', true );
30
+ } else {
31
+ $( wrap ).find( '.license-status' ).removeClass( 'active' ).html( 'INACTIVE' );
32
+ $( wrap ).find( '.button' ).html( 'Activate' );
33
+ $( wrap ).find( '#status' ).val( 'inactive' );
34
+ $( wrap ).find( '#key' ).attr( 'disabled', false );
35
+ $( wrap ).find( '#email' ).attr( 'disabled', false );
36
+ }
37
+ }
38
+ } );
39
+
40
+ } );
41
+ } );
42
  } );
assets/js/insert-download.js CHANGED
@@ -1,9 +1,9 @@
1
- jQuery( function ($) {
2
- // Browse for file
3
- jQuery( 'body' ).on( 'click', 'a.dlm_insert_download', function () {
4
-
5
- tb_show( dlm_id_strings.insert_download, 'media-upload.php?type=add_download&amp;from=wpdlm01&amp;TB_iframe=true&amp;height=200' );
6
-
7
- return false;
8
- } );
9
  } );
1
+ jQuery( function ($) {
2
+ // Browse for file
3
+ jQuery( 'body' ).on( 'click', 'a.dlm_insert_download', function () {
4
+
5
+ tb_show( dlm_id_strings.insert_download, 'media-upload.php?type=add_download&amp;from=wpdlm01&amp;TB_iframe=true&amp;height=200' );
6
+
7
+ return false;
8
+ } );
9
  } );
assets/js/legacy-upgrader/build/style.css CHANGED
@@ -1,2 +1,2 @@
1
- #dlm_legacy_upgrader_app{height:100%;box-sizing:border-box}._1kijZ35OiZkKapzULElh6m ._2CxVTmzHXSW60xGZZcsG4W{position:relative;background:#419ccb;color:#fff;font-weight:700;padding:10px 10px 10px 35px}._1kijZ35OiZkKapzULElh6m ._2CxVTmzHXSW60xGZZcsG4W img{display:block;position:absolute;left:12px;top:12px;width:15px;height:15px;z-index:10}._1kijZ35OiZkKapzULElh6m ul{width:100%;padding:10px 0}._1kijZ35OiZkKapzULElh6m ul li{display:inline-block;width:50%}._1kijZ35OiZkKapzULElh6m ul li:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\F147";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top;font-size:1.5em}._1kijZ35OiZkKapzULElh6m ul li.zV9Nyt3hQBQicmm04gduY:before{color:#000}._1kijZ35OiZkKapzULElh6m ul li._1AzdgG9aB69nDxpkTig5B9:before{color:green}._5MraKW-sdXoMAncl8aoJ0 ._34ZBh3TYpaRFeMMsfEgz75{position:relative;background:#419ccb;color:#fff;font-weight:700;padding:10px 10px 10px 35px}._5MraKW-sdXoMAncl8aoJ0 ._34ZBh3TYpaRFeMMsfEgz75 img{display:block;position:absolute;left:12px;top:12px;width:15px;height:15px;z-index:10}._5MraKW-sdXoMAncl8aoJ0 ul{width:100%;padding:10px 0}._5MraKW-sdXoMAncl8aoJ0 ul li{display:inline-block;width:50%}._5MraKW-sdXoMAncl8aoJ0 ul li:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\F147";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top;font-size:1.5em}._5MraKW-sdXoMAncl8aoJ0 ul li._34VuGJn3eCzOVIhWxpf3EI:before{color:#000}._5MraKW-sdXoMAncl8aoJ0 ul li._3o3myVBr0p_jZTcVVSWdNC:before{color:green}
2
  /*# sourceMappingURL=style.css.map*/
1
+ #dlm_legacy_upgrader_app{height:100%;box-sizing:border-box}._1kijZ35OiZkKapzULElh6m ._2CxVTmzHXSW60xGZZcsG4W{position:relative;background:#419ccb;color:#fff;font-weight:700;padding:10px 10px 10px 35px}._1kijZ35OiZkKapzULElh6m ._2CxVTmzHXSW60xGZZcsG4W img{display:block;position:absolute;left:12px;top:12px;width:15px;height:15px;z-index:10}._1kijZ35OiZkKapzULElh6m ul{width:100%;padding:10px 0}._1kijZ35OiZkKapzULElh6m ul li{display:inline-block;width:50%}._1kijZ35OiZkKapzULElh6m ul li:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\F147";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top;font-size:1.5em}._1kijZ35OiZkKapzULElh6m ul li.zV9Nyt3hQBQicmm04gduY:before{color:#000}._1kijZ35OiZkKapzULElh6m ul li._1AzdgG9aB69nDxpkTig5B9:before{color:green}._5MraKW-sdXoMAncl8aoJ0 ._34ZBh3TYpaRFeMMsfEgz75{position:relative;background:#419ccb;color:#fff;font-weight:700;padding:10px 10px 10px 35px}._5MraKW-sdXoMAncl8aoJ0 ._34ZBh3TYpaRFeMMsfEgz75 img{display:block;position:absolute;left:12px;top:12px;width:15px;height:15px;z-index:10}._5MraKW-sdXoMAncl8aoJ0 ul{width:100%;padding:10px 0}._5MraKW-sdXoMAncl8aoJ0 ul li{display:inline-block;width:50%}._5MraKW-sdXoMAncl8aoJ0 ul li:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\F147";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top;font-size:1.5em}._5MraKW-sdXoMAncl8aoJ0 ul li._34VuGJn3eCzOVIhWxpf3EI:before{color:#000}._5MraKW-sdXoMAncl8aoJ0 ul li._3o3myVBr0p_jZTcVVSWdNC:before{color:green}
2
  /*# sourceMappingURL=style.css.map*/
assets/js/legacy-upgrader/package.json CHANGED
@@ -1,101 +1,101 @@
1
- {
2
- "name": "preact-boilerplate",
3
- "version": "6.0.0",
4
- "description": "Ready-to-go Preact starter project powered by webpack.",
5
- "scripts": {
6
- "dev": "cross-env NODE_ENV=development webpack-dev-server --inline --hot --progress",
7
- "start": "serve build -s -c 1",
8
- "prestart": "npm run build",
9
- "build": "cross-env NODE_ENV=production webpack --progress",
10
- "prebuild": "mkdirp build && ncp src/assets build/assets",
11
- "test": "npm run -s lint && jest --coverage",
12
- "test:watch": "npm run -s test -- --watch",
13
- "lint": "eslint src test"
14
- },
15
- "keywords": [
16
- "preact",
17
- "boilerplate",
18
- "webpack"
19
- ],
20
- "license": "MIT",
21
- "author": "Jason Miller <jason@developit.ca>",
22
- "jest": {
23
- "setupFiles": [
24
- "./test/setup.js"
25
- ],
26
- "testURL": "http://localhost:8080",
27
- "moduleFileExtensions": [
28
- "js",
29
- "jsx"
30
- ],
31
- "moduleDirectories": [
32
- "node_modules"
33
- ],
34
- "moduleNameMapper": {
35
- "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
36
- "\\.(css|less)$": "identity-obj-proxy",
37
- "^react$": "preact-compat",
38
- "^react-dom$": "preact-compat"
39
- },
40
- "collectCoverageFrom": [
41
- "src/**/*.{js,jsx}"
42
- ]
43
- },
44
- "devDependencies": {
45
- "autoprefixer": "^7.0.1",
46
- "babel": "^6.5.2",
47
- "babel-core": "^6.24.0",
48
- "babel-eslint": "^7.2.2",
49
- "babel-jest": "^20.0.0",
50
- "babel-loader": "^7.0.0",
51
- "babel-plugin-transform-decorators-legacy": "^1.3.4",
52
- "babel-plugin-transform-react-jsx": "^6.8.0",
53
- "babel-preset-es2015": "^6.24.0",
54
- "babel-preset-stage-0": "^6.5.0",
55
- "babel-register": "^6.24.0",
56
- "babel-runtime": "^6.11.6",
57
- "chai": "^4.0.2",
58
- "copy-webpack-plugin": "^4.0.1",
59
- "core-js": "^2.4.1",
60
- "cross-env": "^5.0.1",
61
- "css-loader": "^0.28.0",
62
- "eslint": "^4.1.0",
63
- "eslint-plugin-jest": "^20.0.0",
64
- "eslint-plugin-react": "^7.0.0",
65
- "extract-text-webpack-plugin": "^2.1.0",
66
- "file-loader": "^0.11.1",
67
- "html-webpack-plugin": "^2.28.0",
68
- "identity-obj-proxy": "^3.0.0",
69
- "jest": "^20.0.0",
70
- "json-loader": "^0.5.4",
71
- "less": "^2.7.1",
72
- "less-loader": "^4.0.3",
73
- "mkdirp": "^0.5.1",
74
- "ncp": "^2.0.0",
75
- "offline-plugin": "^4.7.0",
76
- "postcss-loader": "^2.0.3",
77
- "preact-jsx-chai": "^2.2.1",
78
- "raw-loader": "^0.5.1",
79
- "regenerator-runtime": "^0.10.3",
80
- "replace-bundle-webpack-plugin": "^1.0.0",
81
- "script-ext-html-webpack-plugin": "^1.3.4",
82
- "sinon": "^2.1.0",
83
- "sinon-chai": "^2.9.0",
84
- "source-map-loader": "^0.2.1",
85
- "style-loader": "^0.18.1",
86
- "url-loader": "^0.6.1",
87
- "webpack": "^3.0.0",
88
- "webpack-dev-server": "^2.4.4"
89
- },
90
- "dependencies": {
91
- "preact": "^8.1.0",
92
- "preact-compat": "^3.15.0",
93
- "preact-render-to-string": "^3.6.0",
94
- "preact-router": "^2.5.1",
95
- "promise-polyfill": "^6.0.2",
96
- "proptypes": "^1.0.0",
97
- "serve": "^6.0.0",
98
- "react-router-dom": "^4.1.1",
99
- "whatwg-fetch": "^2.0.3"
100
- }
101
- }
1
+ {
2
+ "name": "preact-boilerplate",
3
+ "version": "6.0.0",
4
+ "description": "Ready-to-go Preact starter project powered by webpack.",
5
+ "scripts": {
6
+ "dev": "cross-env NODE_ENV=development webpack-dev-server --inline --hot --progress",
7
+ "start": "serve build -s -c 1",
8
+ "prestart": "npm run build",
9
+ "build": "cross-env NODE_ENV=production webpack --progress",
10
+ "prebuild": "mkdirp build && ncp src/assets build/assets",
11
+ "test": "npm run -s lint && jest --coverage",
12
+ "test:watch": "npm run -s test -- --watch",
13
+ "lint": "eslint src test"
14
+ },
15
+ "keywords": [
16
+ "preact",
17
+ "boilerplate",
18
+ "webpack"
19
+ ],
20
+ "license": "MIT",
21
+ "author": "Jason Miller <jason@developit.ca>",
22
+ "jest": {
23
+ "setupFiles": [
24
+ "./test/setup.js"
25
+ ],
26
+ "testURL": "http://localhost:8080",
27
+ "moduleFileExtensions": [
28
+ "js",
29
+ "jsx"
30
+ ],
31
+ "moduleDirectories": [
32
+ "node_modules"
33
+ ],
34
+ "moduleNameMapper": {
35
+ "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
36
+ "\\.(css|less)$": "identity-obj-proxy",
37
+ "^react$": "preact-compat",
38
+ "^react-dom$": "preact-compat"
39
+ },
40
+ "collectCoverageFrom": [
41
+ "src/**/*.{js,jsx}"
42
+ ]
43
+ },
44
+ "devDependencies": {
45
+ "autoprefixer": "^7.0.1",
46
+ "babel": "^6.5.2",
47
+ "babel-core": "^6.24.0",
48
+ "babel-eslint": "^7.2.2",
49
+ "babel-jest": "^20.0.0",
50
+ "babel-loader": "^7.0.0",
51
+ "babel-plugin-transform-decorators-legacy": "^1.3.4",
52
+ "babel-plugin-transform-react-jsx": "^6.8.0",
53
+ "babel-preset-es2015": "^6.24.0",
54
+ "babel-preset-stage-0": "^6.5.0",
55
+ "babel-register": "^6.24.0",
56
+ "babel-runtime": "^6.11.6",
57
+ "chai": "^4.0.2",
58
+ "copy-webpack-plugin": "^4.0.1",
59
+ "core-js": "^2.4.1",
60
+ "cross-env": "^5.0.1",
61
+ "css-loader": "^0.28.0",
62
+ "eslint": "^4.1.0",
63
+ "eslint-plugin-jest": "^20.0.0",
64
+ "eslint-plugin-react": "^7.0.0",
65
+ "extract-text-webpack-plugin": "^2.1.0",
66
+ "file-loader": "^0.11.1",
67
+ "html-webpack-plugin": "^2.28.0",
68
+ "identity-obj-proxy": "^3.0.0",
69
+ "jest": "^20.0.0",
70
+ "json-loader": "^0.5.4",
71
+ "less": "^2.7.1",
72
+ "less-loader": "^4.0.3",
73
+ "mkdirp": "^0.5.1",
74
+ "ncp": "^2.0.0",
75
+ "offline-plugin": "^4.7.0",
76
+ "postcss-loader": "^2.0.3",
77
+ "preact-jsx-chai": "^2.2.1",
78
+ "raw-loader": "^0.5.1",
79
+ "regenerator-runtime": "^0.10.3",
80
+ "replace-bundle-webpack-plugin": "^1.0.0",
81
+ "script-ext-html-webpack-plugin": "^1.3.4",
82
+ "sinon": "^2.1.0",
83
+ "sinon-chai": "^2.9.0",
84
+ "source-map-loader": "^0.2.1",
85
+ "style-loader": "^0.18.1",
86
+ "url-loader": "^0.6.1",
87
+ "webpack": "^3.0.0",
88
+ "webpack-dev-server": "^2.4.4"
89
+ },
90
+ "dependencies": {
91
+ "preact": "^8.1.0",
92
+ "preact-compat": "^3.15.0",
93
+ "preact-render-to-string": "^3.6.0",
94
+ "preact-router": "^2.5.1",
95
+ "promise-polyfill": "^6.0.2",
96
+ "proptypes": "^1.0.0",
97
+ "serve": "^6.0.0",
98
+ "react-router-dom": "^4.1.1",
99
+ "whatwg-fetch": "^2.0.3"
100
+ }
101
+ }
assets/js/legacy-upgrader/src/components/app.js CHANGED
@@ -1,69 +1,69 @@
1
- import { h, Component } from 'preact';
2
- import { HashRouter, Route, Redirect } from 'react-router-dom';
3
-
4
- // polyfill fetch and promise
5
- import 'whatwg-fetch';
6
- import Promise from 'promise-polyfill';
7
- if (!window.Promise) {
8
- window.Promise = Promise;
9
- }
10
-
11
- import Welcome from './welcome';
12
- import Downloads from './downloads';
13
- import Content from './content';
14
- import Done from './done';
15
-
16
- // mock dlm_vars for dev
17
- if(window.dlm_lu_vars == undefined) {
18
- window.dlm_lu_vars = {
19
- nonce: 'noncemock',
20
- assets_path: 'http://lnmp.dev:1337/assets/'
21
- };
22
- }
23
-
24
- export default class App extends Component {
25
-
26
- ROUTES = {
27
- welcome: () => <Welcome />,
28
- downloads: () => <Downloads />,
29
- content: ({match}) => <Content download_amount={match.params.download_amount} />,
30
- done: ({match}) => <Done download_amount={match.params.download_amount} content_amount={match.params.content_amount} />
31
- };
32
-
33
- constructor(props) {
34
- super(props);
35
-
36
- this.state = {
37
- queue: []
38
- };
39
- }
40
-
41
- /**
42
- <Router onChange={this.handleRoute}>
43
-
44
- <Welcome path="" />
45
- <Downloads path="/downloads" />
46
- <Content path="/content/:download_amount" />
47
- <Done path="/done/:download_amount/:content_amount" />
48
- </Router>*/
49
-
50
- render() {
51
-
52
- const ROUTES = this.ROUTES;
53
-
54
- return (
55
- <div id="dlm_legacy_upgrader_app">
56
- <HashRouter>
57
- <div>
58
- <Route path="/welcome" component={ROUTES.welcome} />
59
- <Route path="/downloads" component={ROUTES.downloads} />
60
- <Route path="/content/:download_amount" component={ROUTES.content} />
61
- <Route path="/done/:download_amount/:content_amount" component={ROUTES.done} />
62
- <Redirect from="/" to="/welcome" />
63
- </div>
64
- </HashRouter>
65
-
66
- </div>
67
- );
68
- }
69
- }
1
+ import { h, Component } from 'preact';
2
+ import { HashRouter, Route, Redirect } from 'react-router-dom';
3
+
4
+ // polyfill fetch and promise
5
+ import 'whatwg-fetch';
6
+ import Promise from 'promise-polyfill';
7
+ if (!window.Promise) {
8
+ window.Promise = Promise;
9
+ }
10
+
11
+ import Welcome from './welcome';
12
+ import Downloads from './downloads';
13
+ import Content from './content';
14
+ import Done from './done';
15
+
16
+ // mock dlm_vars for dev
17
+ if(window.dlm_lu_vars == undefined) {
18
+ window.dlm_lu_vars = {
19
+ nonce: 'noncemock',
20
+ assets_path: 'http://lnmp.dev:1337/assets/'
21
+ };
22
+ }
23
+
24
+ export default class App extends Component {
25
+
26
+ ROUTES = {
27
+ welcome: () => <Welcome />,
28
+ downloads: () => <Downloads />,
29
+ content: ({match}) => <Content download_amount={match.params.download_amount} />,
30
+ done: ({match}) => <Done download_amount={match.params.download_amount} content_amount={match.params.content_amount} />
31
+ };
32
+
33
+ constructor(props) {
34
+ super(props);
35
+
36
+ this.state = {
37
+ queue: []
38
+ };
39
+ }
40
+
41
+ /**
42
+ <Router onChange={this.handleRoute}>
43
+
44
+ <Welcome path="" />
45
+ <Downloads path="/downloads" />
46
+ <Content path="/content/:download_amount" />
47
+ <Done path="/done/:download_amount/:content_amount" />
48
+ </Router>*/
49
+
50
+ render() {
51
+
52
+ const ROUTES = this.ROUTES;
53
+
54
+ return (
55
+ <div id="dlm_legacy_upgrader_app">
56
+ <HashRouter>
57
+ <div>
58
+ <Route path="/welcome" component={ROUTES.welcome} />
59
+ <Route path="/downloads" component={ROUTES.downloads} />
60
+ <Route path="/content/:download_amount" component={ROUTES.content} />
61
+ <Route path="/done/:download_amount/:content_amount" component={ROUTES.done} />
62
+ <Redirect from="/" to="/welcome" />
63
+ </div>
64
+ </HashRouter>
65
+
66
+ </div>
67
+ );
68
+ }
69
+ }
assets/js/legacy-upgrader/src/components/content/QueueItem.js CHANGED
@@ -1,13 +1,13 @@
1
- import { h, Component } from 'preact';
2
- import style from './style';
3
-
4
- export default class QueueItem extends Component {
5
-
6
- render() {
7
- var listClass = (this.props.item.done?style.done:style.todo);
8
-
9
- return (
10
- <li class={listClass}>Content ID: {this.props.item.id}</li>
11
- );
12
- }
13
- }
1
+ import { h, Component } from 'preact';
2
+ import style from './style';
3
+
4
+ export default class QueueItem extends Component {
5
+
6
+ render() {
7
+ var listClass = (this.props.item.done?style.done:style.todo);
8
+
9
+ return (
10
+ <li class={listClass}>Content ID: {this.props.item.id}</li>
11
+ );
12
+ }
13
+ }
assets/js/legacy-upgrader/src/components/content/index.js CHANGED
@@ -1,149 +1,149 @@
1
- import {h, Component} from 'preact';
2
- import style from './style.less';
3
- import QueueItem from './QueueItem';
4
- import { Link } from 'react-router-dom';
5
-
6
- export default class Content extends Component {
7
-
8
- state = {
9
- checked: false,
10
- items: [],
11
- upgrading: false
12
- };
13
-
14
- constructor(props) {
15
- super(props);
16
-
17
- this.startUpgrade = this.startUpgrade.bind(this);
18
- this.upgradeNext = this.upgradeNext.bind(this);
19
- this.upgradeItem = this.upgradeItem.bind(this);
20
- }
21
-
22
- // gets called when this route is navigated to
23
- componentDidMount() {
24
- fetch( ajaxurl + "?action=dlm_lu_get_content_queue&nonce="+window.dlm_lu_vars.nonce, {
25
- method: 'GET',
26
- credentials: 'include'
27
- } ).then( ( r ) => {
28
- if ( r.status == 200 ) {
29
- return r.json();
30
- }
31
-
32
- throw "AJAX API OFFLINE";
33
- } ).then( ( j ) => {
34
- var items = [];
35
- for ( var i = 0; i < j.length; i ++ ) {
36
- items.push( {id: j[i], done: false} );
37
- }
38
- this.setState( {checked: true, items: items} );
39
- return;
40
- } ).catch( ( e ) => {
41
- console.log( e );
42
- return;
43
- } );
44
- }
45
-
46
- // gets called just before navigating away from the route
47
- componentWillUnmount() {
48
- // todo clear queue
49
- }
50
-
51
- upgradeNext() {
52
- var upgradeDone = true;
53
- for( var i = 0; i < this.state.items.length; i++ ) {
54
- if( this.state.items[i].done === false ) {
55
- upgradeDone = false;
56
- this.upgradeItem( this.state.items[i] );
57
- break;
58
- }
59
- }
60
-
61
- if( upgradeDone ) {
62
- window.location.hash = "/done/"+this.props.download_amount+"/"+this.state.items.length;
63
- }
64
- }
65
-
66
- upgradeItem( item ) {
67
- fetch( ajaxurl + "?action=dlm_lu_upgrade_content&content_id="+item.id+"&nonce="+window.dlm_lu_vars.nonce, {
68
- method: 'GET',
69
- credentials: 'include'
70
- } ).then( ( r ) => {
71
- if ( r.status == 200 ) {
72
- return r.json();
73
- }
74
-
75
- throw "AJAX API OFFLINE";
76
- } ).then( ( j ) => {
77
- console.log( j );
78
- item.done = true;
79
- this.forceUpdate();
80
- this.upgradeNext();
81
- return;
82
- } ).catch( ( e ) => {
83
- console.log( e );
84
- return;
85
- } );
86
- }
87
-
88
- startUpgrade() {
89
- // check if we're upgrading
90
- if( this.state.upgrading ) {
91
- return;
92
- }
93
-
94
- // set we're upgrading
95
- this.setState( {upgrading: true} );
96
-
97
- // upgrade next download
98
- this.upgradeNext();
99
- }
100
-
101
- render() {
102
-
103
- var loadingImg = window.dlm_lu_vars.assets_path + "loading.gif";
104
-
105
- if ( this.state.checked == false ) {
106
- return (
107
- <div class={style.queue}>
108
- <h2>Posts/Pages Queue</h2>
109
- <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
110
- <p>We're currently building the posts/pages queue, please wait.</p>
111
- </div>
112
- );
113
- }
114
-
115
- if ( this.state.items.length == 0 ) {
116
- var linkURL = "/done/"+this.props.download_amount+"/0";
117
- return (
118
- <div class={style.queue}>
119
- <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
120
- <p>No posts/pages found that require upgrading.</p>
121
- <Link to={linkURL} class="button button-primary button-large">Continue to Post/Page upgrade</Link>
122
- </div>
123
- );
124
- }
125
-
126
- return (
127
- <div class={style.queue}>
128
- <h2>Posts/Pages Queue</h2>
129
-
130
- {this.state.upgrading &&
131
- <p class={style.upgrading_notice}><img src={loadingImg} />Currently upgrading your downloads, please wait...</p>
132
- }
133
-
134
- <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
135
-
136
- <p>The following posts/pages items have been found that need upgrading:</p>
137
-
138
- {this.state.items.length > 0 &&
139
- <ul>
140
- {this.state.items.map( ( o, i ) => <QueueItem item={o}/> )}
141
- </ul>
142
- }
143
-
144
- <a href="javascript:;" class="button button-primary button-large" onClick={() => this.startUpgrade()}>Upgrade Content Items</a>
145
-
146
- </div>
147
- );
148
- }
149
- }
1
+ import {h, Component} from 'preact';
2
+ import style from './style.less';
3
+ import QueueItem from './QueueItem';
4
+ import { Link } from 'react-router-dom';
5
+
6
+ export default class Content extends Component {
7
+
8
+ state = {
9
+ checked: false,
10
+ items: [],
11
+ upgrading: false
12
+ };
13
+
14
+ constructor(props) {
15
+ super(props);
16
+
17
+ this.startUpgrade = this.startUpgrade.bind(this);
18
+ this.upgradeNext = this.upgradeNext.bind(this);
19
+ this.upgradeItem = this.upgradeItem.bind(this);
20
+ }
21
+
22
+ // gets called when this route is navigated to
23
+ componentDidMount() {
24
+ fetch( ajaxurl + "?action=dlm_lu_get_content_queue&nonce="+window.dlm_lu_vars.nonce, {
25
+ method: 'GET',
26
+ credentials: 'include'
27
+ } ).then( ( r ) => {
28
+ if ( r.status == 200 ) {
29
+ return r.json();
30
+ }
31
+
32
+ throw "AJAX API OFFLINE";
33
+ } ).then( ( j ) => {
34
+ var items = [];
35
+ for ( var i = 0; i < j.length; i ++ ) {
36
+ items.push( {id: j[i], done: false} );
37
+ }
38
+ this.setState( {checked: true, items: items} );
39
+ return;
40
+ } ).catch( ( e ) => {
41
+ console.log( e );
42
+ return;
43
+ } );
44
+ }
45
+
46
+ // gets called just before navigating away from the route
47
+ componentWillUnmount() {
48
+ // todo clear queue
49
+ }
50
+
51
+ upgradeNext() {
52
+ var upgradeDone = true;
53
+ for( var i = 0; i < this.state.items.length; i++ ) {
54
+ if( this.state.items[i].done === false ) {
55
+ upgradeDone = false;
56
+ this.upgradeItem( this.state.items[i] );
57
+ break;
58
+ }
59
+ }
60
+
61
+ if( upgradeDone ) {
62
+ window.location.hash = "/done/"+this.props.download_amount+"/"+this.state.items.length;
63
+ }
64
+ }
65
+
66
+ upgradeItem( item ) {
67
+ fetch( ajaxurl + "?action=dlm_lu_upgrade_content&content_id="+item.id+"&nonce="+window.dlm_lu_vars.nonce, {
68
+ method: 'GET',
69
+ credentials: 'include'
70
+ } ).then( ( r ) => {
71
+ if ( r.status == 200 ) {
72
+ return r.json();
73
+ }
74
+
75
+ throw "AJAX API OFFLINE";
76
+ } ).then( ( j ) => {
77
+ console.log( j );
78
+ item.done = true;
79
+ this.forceUpdate();
80
+ this.upgradeNext();
81
+ return;
82
+ } ).catch( ( e ) => {
83
+ console.log( e );
84
+ return;
85
+ } );
86
+ }
87
+
88
+ startUpgrade() {
89
+ // check if we're upgrading
90
+ if( this.state.upgrading ) {
91
+ return;
92
+ }
93
+
94
+ // set we're upgrading
95
+ this.setState( {upgrading: true} );
96
+
97
+ // upgrade next download
98
+ this.upgradeNext();
99
+ }
100
+
101
+ render() {
102
+
103
+ var loadingImg = window.dlm_lu_vars.assets_path + "loading.gif";
104
+
105
+ if ( this.state.checked == false ) {
106
+ return (
107
+ <div class={style.queue}>
108
+ <h2>Posts/Pages Queue</h2>
109
+ <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
110
+ <p>We're currently building the posts/pages queue, please wait.</p>
111
+ </div>
112
+ );
113
+ }
114
+
115
+ if ( this.state.items.length == 0 ) {
116
+ var linkURL = "/done/"+this.props.download_amount+"/0";
117
+ return (
118
+ <div class={style.queue}>
119
+ <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
120
+ <p>No posts/pages found that require upgrading.</p>
121
+ <Link to={linkURL} class="button button-primary button-large">Continue to Post/Page upgrade</Link>
122
+ </div>
123
+ );
124
+ }
125
+
126
+ return (
127
+ <div class={style.queue}>
128
+ <h2>Posts/Pages Queue</h2>
129
+
130
+ {this.state.upgrading &&
131
+ <p class={style.upgrading_notice}><img src={loadingImg} />Currently upgrading your downloads, please wait...</p>
132
+ }
133
+
134
+ <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
135
+
136
+ <p>The following posts/pages items have been found that need upgrading:</p>
137
+
138
+ {this.state.items.length > 0 &&
139
+ <ul>
140
+ {this.state.items.map( ( o, i ) => <QueueItem item={o}/> )}
141
+ </ul>
142
+ }
143
+
144
+ <a href="javascript:;" class="button button-primary button-large" onClick={() => this.startUpgrade()}>Upgrade Content Items</a>
145
+
146
+ </div>
147
+ );
148
+ }
149
+ }
assets/js/legacy-upgrader/src/components/content/style.less CHANGED
@@ -1,49 +1,49 @@
1
- @import '~style/helpers';
2
-
3
- .queue {
4
-
5
- .upgrading_notice {
6
- position: relative;
7
- background: #419ccb;
8
- color: #fff;
9
- font-weight: bold;
10
- padding: 10px 10px 10px 35px;
11
-
12
- img {
13
- display: block;
14
- position: absolute;
15
- left: 12px;
16
- top: 12px;
17
- width: 15px;
18
- height: 15px;
19
- z-index: 10;
20
- }
21
- }
22
-
23
- ul {
24
- width: 100%;
25
- padding: 10px 0;
26
-
27
- li {
28
- display: inline-block;
29
- width: 50%;
30
- &:before {
31
- .iconbefore("\f147");
32
- font-size: 1.5em;
33
- }
34
-
35
- &.todo {
36
- &:before {
37
- color: black;
38
- }
39
- }
40
-
41
- &.done {
42
- &:before {
43
- color: green;
44
- }
45
- }
46
- }
47
-
48
- }
49
- }
1
+ @import '~style/helpers';
2
+
3
+ .queue {
4
+
5
+ .upgrading_notice {
6
+ position: relative;
7
+ background: #419ccb;
8
+ color: #fff;
9
+ font-weight: bold;
10
+ padding: 10px 10px 10px 35px;
11
+
12
+ img {
13
+ display: block;
14
+ position: absolute;
15
+ left: 12px;
16
+ top: 12px;
17
+ width: 15px;
18
+ height: 15px;
19
+ z-index: 10;
20
+ }
21
+ }
22
+
23
+ ul {
24
+ width: 100%;
25
+ padding: 10px 0;
26
+
27
+ li {
28
+ display: inline-block;
29
+ width: 50%;
30
+ &:before {
31
+ .iconbefore("\f147");
32
+ font-size: 1.5em;
33
+ }
34
+
35
+ &.todo {
36
+ &:before {
37
+ color: black;
38
+ }
39
+ }
40
+
41
+ &.done {
42
+ &:before {
43
+ color: green;
44
+ }
45
+ }
46
+ }
47
+
48
+ }
49
+ }
assets/js/legacy-upgrader/src/components/done/index.js CHANGED
@@ -1,36 +1,36 @@
1
- import { h, Component } from 'preact';
2
- import { Link } from 'preact-router';
3
- import style from './style.less';
4
-
5
- export default class Done extends Component {
6
-
7
- // gets called when this route is navigated to
8
- componentDidMount() {
9
- // mark upgrade as completed
10
- fetch( ajaxurl + "?action=dlm_lu_mark_upgrade_done&nonce="+window.dlm_lu_vars.nonce, {
11
- method: 'GET',
12
- credentials: 'include'
13
- } ).then( ( r ) => {
14
- if ( r.status == 200 ) {
15
- return r.json();
16
- }
17
-
18
- throw "AJAX API OFFLINE";
19
- } ).then( ( j ) => {
20
- return;
21
- } ).catch( ( e ) => {
22
- console.log( e );
23
- return;
24
- } );
25
- }
26
-
27
- render() {
28
- return (
29
- <div class={style.welcome}>
30
- <h2>Upgrade Done</h2>
31
- <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
32
- <p><strong>{this.props.content_amount}</strong> posts/pages have been upgraded.</p>
33
- </div>
34
- );
35
- }
36
- }
1
+ import { h, Component } from 'preact';
2
+ import { Link } from 'preact-router';
3
+ import style from './style.less';
4
+
5
+ export default class Done extends Component {
6
+
7
+ // gets called when this route is navigated to
8
+ componentDidMount() {
9
+ // mark upgrade as completed
10
+ fetch( ajaxurl + "?action=dlm_lu_mark_upgrade_done&nonce="+window.dlm_lu_vars.nonce, {
11
+ method: 'GET',
12
+ credentials: 'include'
13
+ } ).then( ( r ) => {
14
+ if ( r.status == 200 ) {
15
+ return r.json();
16
+ }
17
+
18
+ throw "AJAX API OFFLINE";
19
+ } ).then( ( j ) => {
20
+ return;
21
+ } ).catch( ( e ) => {
22
+ console.log( e );
23
+ return;
24
+ } );
25
+ }
26
+
27
+ render() {
28
+ return (
29
+ <div class={style.welcome}>
30
+ <h2>Upgrade Done</h2>
31
+ <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
32
+ <p><strong>{this.props.content_amount}</strong> posts/pages have been upgraded.</p>
33
+ </div>
34
+ );
35
+ }
36
+ }
assets/js/legacy-upgrader/src/components/done/style.less CHANGED
@@ -1,5 +1,5 @@
1
- @import '~style/helpers';
2
-
3
- .done {
4
-
5
- }
1
+ @import '~style/helpers';
2
+
3
+ .done {
4
+
5
+ }
assets/js/legacy-upgrader/src/components/downloads/QueueItem.js CHANGED
@@ -1,13 +1,13 @@
1
- import { h, Component } from 'preact';
2
- import style from './style';
3
-
4
- export default class QueueItem extends Component {
5
-
6
- render() {
7
- var listClass = (this.props.item.done?style.done:style.todo);
8
-
9
- return (
10
- <li class={listClass}>Legacy Download ID: {this.props.item.id}</li>
11
- );
12
- }
13
  }
1
+ import { h, Component } from 'preact';
2
+ import style from './style';
3
+
4
+ export default class QueueItem extends Component {
5
+
6
+ render() {
7
+ var listClass = (this.props.item.done?style.done:style.todo);
8
+
9
+ return (
10
+ <li class={listClass}>Legacy Download ID: {this.props.item.id}</li>
11
+ );
12
+ }
13
  }
assets/js/legacy-upgrader/src/components/downloads/index.js CHANGED
@@ -1,145 +1,145 @@
1
- import {h, Component} from 'preact';
2
- import style from './style.less';
3
- import QueueItem from './QueueItem';
4
- import { Link } from 'react-router-dom';
5
-
6
- export default class Downloads extends Component {
7
-
8
- state = {
9
- checked: false,
10
- items: [],
11
- upgrading: false
12
- };
13
-
14
- constructor(props) {
15
- super(props);
16
-
17
- this.startUpgrade = this.startUpgrade.bind(this);
18
- this.upgradeNext = this.upgradeNext.bind(this);
19
- this.upgradeItem = this.upgradeItem.bind(this);
20
- }
21
-
22
- // gets called when this route is navigated to
23
- componentDidMount() {
24
- fetch( ajaxurl + "?action=dlm_lu_get_download_queue&nonce="+window.dlm_lu_vars.nonce, {
25
- method: 'GET',
26
- credentials: 'include'
27
- } ).then( ( r ) => {
28
- if ( r.status == 200 ) {
29
- return r.json();
30
- }
31
-
32
- throw "AJAX API OFFLINE";
33
- } ).then( ( j ) => {
34
- var items = [];
35
- for ( var i = 0; i < j.length; i ++ ) {
36
- items.push( {id: j[i], done: false} );
37
- }
38
- this.setState( {checked: true, items: items} );
39
- return;
40
- } ).catch( ( e ) => {
41
- console.log( e );
42
- return;
43
- } );
44
- }
45
-
46
- // gets called just before navigating away from the route
47
- componentWillUnmount() {
48
- // todo clear queue
49
- }
50
-
51
- upgradeNext() {
52
- var upgradeDone = true;
53
- for( var i = 0; i < this.state.items.length; i++ ) {
54
- if( this.state.items[i].done === false ) {
55
- upgradeDone = false;
56
- this.upgradeItem( this.state.items[i] );
57
- break;
58
- }
59
- }
60
-
61
- if( upgradeDone ) {
62
- window.location.hash = "/content/"+this.state.items.length;
63
- }
64
- }
65
-
66
- upgradeItem( item ) {
67
- fetch( ajaxurl + "?action=dlm_lu_upgrade_download&download_id="+item.id+"&nonce="+window.dlm_lu_vars.nonce, {
68
- method: 'GET',
69
- credentials: 'include'
70
- } ).then( ( r ) => {
71
- if ( r.status == 200 ) {
72
- return r.json();
73
- }
74
-
75
- throw "AJAX API OFFLINE";
76
- } ).then( ( j ) => {
77
- console.log( j );
78
- item.done = true;
79
- this.forceUpdate();
80
- this.upgradeNext();
81
- return;
82
- } ).catch( ( e ) => {
83
- console.log( e );
84
- return;
85
- } );
86
- }
87
-
88
- startUpgrade() {
89
- // check if we're upgrading
90
- if( this.state.upgrading ) {
91
- return;
92
- }
93
-
94
- // set we're upgrading
95
- this.setState( {upgrading: true} );
96
-
97
- // upgrade next download
98
- this.upgradeNext();
99
- }
100
-
101
- render() {
102
-
103
- var loadingImg = window.dlm_lu_vars.assets_path + "loading.gif";
104
-
105
- if ( this.state.checked == false ) {
106
- return (
107
- <div class={style.queue}>
108
- <h2>Downloads Queue</h2>
109
- <p>We're currently building the queue, please wait.</p>
110
- </div>
111
- );
112
- }
113
-
114
- if ( this.state.items.length == 0 ) {
115
- return (
116
- <div class={style.queue}>
117
- <h2>Downloads Queue</h2>
118
- <p>No Downloads found that require upgrading</p>
119
- <Link to="/content/0" class="button button-primary button-large">Continue to Post/Page upgrade</Link>
120
- </div>
121
- );
122
- }
123
-
124
- return (
125
- <div class={style.queue}>
126
- <h2>Downloads Queue</h2>
127
-
128
- {this.state.upgrading &&
129
- <p class={style.upgrading_notice}><img src={loadingImg} />Currently upgrading your downloads, please wait...</p>
130
- }
131
-
132
- <p>The following legacy download ID's have been found that need upgrading:</p>
133
-
134
- {this.state.items.length > 0 &&
135
- <ul>
136
- {this.state.items.map( ( o, i ) => <QueueItem item={o}/> )}
137
- </ul>
138
- }
139
-
140
- <a href="javascript:;" class="button button-primary button-large" onClick={() => this.startUpgrade()}>Upgrade Downloads</a>
141
-
142
- </div>
143
- );
144
- }
145
- }
1
+ import {h, Component} from 'preact';
2
+ import style from './style.less';
3
+ import QueueItem from './QueueItem';
4
+ import { Link } from 'react-router-dom';
5
+
6
+ export default class Downloads extends Component {
7
+
8
+ state = {
9
+ checked: false,
10
+ items: [],
11
+ upgrading: false
12
+ };
13
+
14
+ constructor(props) {
15
+ super(props);
16
+
17
+ this.startUpgrade = this.startUpgrade.bind(this);
18
+ this.upgradeNext = this.upgradeNext.bind(this);
19
+ this.upgradeItem = this.upgradeItem.bind(this);
20
+ }
21
+
22
+ // gets called when this route is navigated to
23
+ componentDidMount() {
24
+ fetch( ajaxurl + "?action=dlm_lu_get_download_queue&nonce="+window.dlm_lu_vars.nonce, {
25
+ method: 'GET',
26
+ credentials: 'include'
27
+ } ).then( ( r ) => {
28
+ if ( r.status == 200 ) {
29
+ return r.json();
30
+ }
31
+
32
+ throw "AJAX API OFFLINE";
33
+ } ).then( ( j ) => {
34
+ var items = [];
35
+ for ( var i = 0; i < j.length; i ++ ) {
36
+ items.push( {id: j[i], done: false} );
37
+ }
38
+ this.setState( {checked: true, items: items} );
39
+ return;
40
+ } ).catch( ( e ) => {
41
+ console.log( e );
42
+ return;
43
+ } );
44
+ }
45
+
46
+ // gets called just before navigating away from the route
47
+ componentWillUnmount() {
48
+ // todo clear queue
49
+ }
50
+
51
+ upgradeNext() {
52
+ var upgradeDone = true;
53
+ for( var i = 0; i < this.state.items.length; i++ ) {
54
+ if( this.state.items[i].done === false ) {
55
+ upgradeDone = false;
56
+ this.upgradeItem( this.state.items[i] );
57
+ break;
58
+ }
59
+ }
60
+
61
+ if( upgradeDone ) {
62
+ window.location.hash = "/content/"+this.state.items.length;
63
+ }
64
+ }
65
+
66
+ upgradeItem( item ) {
67
+ fetch( ajaxurl + "?action=dlm_lu_upgrade_download&download_id="+item.id+"&nonce="+window.dlm_lu_vars.nonce, {
68
+ method: 'GET',
69
+ credentials: 'include'
70
+ } ).then( ( r ) => {
71
+ if ( r.status == 200 ) {
72
+ return r.json();
73
+ }
74
+
75
+ throw "AJAX API OFFLINE";
76
+ } ).then( ( j ) => {
77
+ console.log( j );
78
+ item.done = true;
79
+ this.forceUpdate();
80
+ this.upgradeNext();
81
+ return;
82
+ } ).catch( ( e ) => {
83
+ console.log( e );
84
+ return;
85
+ } );
86
+ }
87
+
88
+ startUpgrade() {
89
+ // check if we're upgrading
90
+ if( this.state.upgrading ) {
91
+ return;
92
+ }
93
+
94
+ // set we're upgrading
95
+ this.setState( {upgrading: true} );
96
+
97
+ // upgrade next download
98
+ this.upgradeNext();
99
+ }
100
+
101
+ render() {
102
+
103
+ var loadingImg = window.dlm_lu_vars.assets_path + "loading.gif";
104
+
105
+ if ( this.state.checked == false ) {
106
+ return (
107
+ <div class={style.queue}>
108
+ <h2>Downloads Queue</h2>
109
+ <p>We're currently building the queue, please wait.</p>
110
+ </div>
111
+ );
112
+ }
113
+
114
+ if ( this.state.items.length == 0 ) {
115
+ return (
116
+ <div class={style.queue}>
117
+ <h2>Downloads Queue</h2>
118
+ <p>No Downloads found that require upgrading</p>
119
+ <Link to="/content/0" class="button button-primary button-large">Continue to Post/Page upgrade</Link>
120
+ </div>
121
+ );
122
+ }
123
+
124
+ return (
125
+ <div class={style.queue}>
126
+ <h2>Downloads Queue</h2>
127
+
128
+ {this.state.upgrading &&
129
+ <p class={style.upgrading_notice}><img src={loadingImg} />Currently upgrading your downloads, please wait...</p>
130
+ }
131
+
132
+ <p>The following legacy download ID's have been found that need upgrading:</p>
133
+
134
+ {this.state.items.length > 0 &&
135
+ <ul>
136
+ {this.state.items.map( ( o, i ) => <QueueItem item={o}/> )}
137
+ </ul>
138
+ }
139
+
140
+ <a href="javascript:;" class="button button-primary button-large" onClick={() => this.startUpgrade()}>Upgrade Downloads</a>
141
+
142
+ </div>
143
+ );
144
+ }
145
+ }
assets/js/legacy-upgrader/src/components/downloads/style.less CHANGED
@@ -1,49 +1,49 @@
1
- @import '~style/helpers';
2
-
3
- .queue {
4
-
5
- .upgrading_notice {
6
- position: relative;
7
- background: #419ccb;
8
- color: #fff;
9
- font-weight: bold;
10
- padding: 10px 10px 10px 35px;
11
-
12
- img {
13
- display: block;
14
- position: absolute;
15
- left: 12px;
16
- top: 12px;
17
- width: 15px;
18
- height: 15px;
19
- z-index: 10;
20
- }
21
- }
22
-
23
- ul {
24
- width: 100%;
25
- padding: 10px 0;
26
-
27
- li {
28
- display: inline-block;
29
- width: 50%;
30
- &:before {
31
- .iconbefore("\f147");
32
- font-size: 1.5em;
33
- }
34
-
35
- &.todo {
36
- &:before {
37
- color: black;
38
- }
39
- }
40
-
41
- &.done {
42
- &:before {
43
- color: green;
44
- }
45
- }
46
- }
47
-
48
- }
49
- }
1
+ @import '~style/helpers';
2
+
3
+ .queue {
4
+
5
+ .upgrading_notice {
6
+ position: relative;
7
+ background: #419ccb;
8
+ color: #fff;
9
+ font-weight: bold;
10
+ padding: 10px 10px 10px 35px;
11
+
12
+ img {
13
+ display: block;
14
+ position: absolute;
15
+ left: 12px;
16
+ top: 12px;
17
+ width: 15px;
18
+ height: 15px;
19
+ z-index: 10;
20
+ }
21
+ }
22
+
23
+ ul {
24
+ width: 100%;
25
+ padding: 10px 0;
26
+
27
+ li {
28
+ display: inline-block;
29
+ width: 50%;
30
+ &:before {
31
+ .iconbefore("\f147");
32
+ font-size: 1.5em;
33
+ }
34
+
35
+ &.todo {
36
+ &:before {
37
+ color: black;
38
+ }
39
+ }
40
+
41
+ &.done {
42
+ &:before {
43
+ color: green;
44
+ }
45
+ }
46
+ }
47
+
48
+ }
49
+ }
assets/js/legacy-upgrader/src/components/welcome/index.js CHANGED
@@ -1,16 +1,16 @@
1
- import { h, Component } from 'preact';
2
- import { Link } from 'react-router-dom';
3
- import style from './style.less';
4
-
5
- export default class Welcome extends Component {
6
- render() {
7
- return (
8
- <div class={style.welcome}>
9
- <h2>Welcome</h2>
10
- <p>Before upgrading your downloads, we'll first scan your database to find your legacy downloads. We will put all found legacy downloads in a queue which you can review before the actual upgrading begins.</p>
11
- <p><strong>PLEASE NOTE: Although thoroughly tested, this process will modify and move your download data. Backup your database before you continue.</strong></p>
12
- <p><Link to="/downloads" class="button button-primary button-large">I have backed up my database, let's go</Link></p>
13
- </div>
14
- );
15
- }
16
- }
1
+ import { h, Component } from 'preact';
2
+ import { Link } from 'react-router-dom';
3
+ import style from './style.less';
4
+
5
+ export default class Welcome extends Component {
6
+ render() {
7
+ return (
8
+ <div class={style.welcome}>
9
+ <h2>Welcome</h2>
10
+ <p>Before upgrading your downloads, we'll first scan your database to find your legacy downloads. We will put all found legacy downloads in a queue which you can review before the actual upgrading begins.</p>
11
+ <p><strong>PLEASE NOTE: Although thoroughly tested, this process will modify and move your download data. Backup your database before you continue.</strong></p>
12
+ <p><Link to="/downloads" class="button button-primary button-large">I have backed up my database, let's go</Link></p>
13
+ </div>
14
+ );
15
+ }
16
+ }
assets/js/legacy-upgrader/src/components/welcome/style.less CHANGED
@@ -1,5 +1,5 @@
1
- @import '~style/helpers';
2
-
3
- .welcome {
4
-
5
- }
1
+ @import '~style/helpers';
2
+
3
+ .welcome {
4
+
5
+ }
assets/js/legacy-upgrader/src/config.json CHANGED
@@ -1,3 +1,3 @@
1
- {
2
- "key": "value"
3
- }
1
+ {
2
+ "key": "value"
3
+ }
assets/js/legacy-upgrader/src/index.ejs CHANGED
@@ -1,408 +1,408 @@
1
- <!DOCTYPE html>
2
- <!--[if IE 8]>
3
- <html xmlns="http://www.w3.org/1999/xhtml" class="ie8 wp-toolbar" lang="en-US">
4
- <![endif]-->
5
- <!--[if !(IE 8) ]><!-->
6
- <html xmlns="http://www.w3.org/1999/xhtml" class="wp-toolbar" lang="en-US">
7
- <!--<![endif]-->
8
- <head>
9
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
- <title> &lsaquo; Download Monitor &#8212; WordPress</title>
11
-
12
- <script type="text/javascript">
13
- addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
14
- var ajaxurl = 'http://lnmp.dev/download-monitor/wp-admin/admin-ajax.php',
15
- pagenow = 'admin_page_dlm_legacy_upgrade',
16
- typenow = '',
17
- adminpage = 'admin_page_dlm_legacy_upgrade',
18
- thousandsSeparator = ',',
19
- decimalPoint = '.',
20
- isRtl = 0;
21
- </script>
22
-
23
- <meta name="viewport" content="width=device-width,initial-scale=1.0">
24
- <link rel='dns-prefetch' href='//s.w.org' />
25
- <style type="text/css">
26
- img.wp-smiley,
27
- img.emoji {
28
- display: inline !important;
29
- border: none !important;
30
- box-shadow: none !important;
31
- height: 1em !important;
32
- width: 1em !important;
33
- margin: 0 .07em !important;
34
- vertical-align: -0.1em !important;
35
- background: none !important;
36
- padding: 0 !important;
37
- }
38
- </style>
39
- <link rel='stylesheet' id='dashicons-css' href='http://lnmp.dev/download-monitor/wp-includes/css/dashicons.css?ver=4.9' type='text/css' media='all' />
40
- <link rel='stylesheet' id='admin-bar-css' href='http://lnmp.dev/download-monitor/wp-includes/css/admin-bar.css?ver=4.9' type='text/css' media='all' />
41
- <link rel='stylesheet' id='common-css' href='http://lnmp.dev/download-monitor/wp-admin/css/common.css?ver=4.9' type='text/css' media='all' />
42
- <link rel='stylesheet' id='forms-css' href='http://lnmp.dev/download-monitor/wp-admin/css/forms.css?ver=4.9' type='text/css' media='all' />
43
- <link rel='stylesheet' id='admin-menu-css' href='http://lnmp.dev/download-monitor/wp-admin/css/admin-menu.css?ver=4.9' type='text/css' media='all' />
44
- <link rel='stylesheet' id='dashboard-css' href='http://lnmp.dev/download-monitor/wp-admin/css/dashboard.css?ver=4.9' type='text/css' media='all' />
45
- <link rel='stylesheet' id='list-tables-css' href='http://lnmp.dev/download-monitor/wp-admin/css/list-tables.css?ver=4.9' type='text/css' media='all' />
46
- <link rel='stylesheet' id='edit-css' href='http://lnmp.dev/download-monitor/wp-admin/css/edit.css?ver=4.9' type='text/css' media='all' />
47
- <link rel='stylesheet' id='revisions-css' href='http://lnmp.dev/download-monitor/wp-admin/css/revisions.css?ver=4.9' type='text/css' media='all' />
48
- <link rel='stylesheet' id='media-css' href='http://lnmp.dev/download-monitor/wp-admin/css/media.css?ver=4.9' type='text/css' media='all' />
49
- <link rel='stylesheet' id='themes-css' href='http://lnmp.dev/download-monitor/wp-admin/css/themes.css?ver=4.9' type='text/css' media='all' />
50
- <link rel='stylesheet' id='about-css' href='http://lnmp.dev/download-monitor/wp-admin/css/about.css?ver=4.9' type='text/css' media='all' />
51
- <link rel='stylesheet' id='nav-menus-css' href='http://lnmp.dev/download-monitor/wp-admin/css/nav-menus.css?ver=4.9' type='text/css' media='all' />
52
- <link rel='stylesheet' id='wp-pointer-css' href='http://lnmp.dev/download-monitor/wp-includes/css/wp-pointer.css?ver=4.9' type='text/css' media='all' />
53
- <link rel='stylesheet' id='widgets-css' href='http://lnmp.dev/download-monitor/wp-admin/css/widgets.css?ver=4.9' type='text/css' media='all' />
54
- <link rel='stylesheet' id='site-icon-css' href='http://lnmp.dev/download-monitor/wp-admin/css/site-icon.css?ver=4.9' type='text/css' media='all' />
55
- <link rel='stylesheet' id='l10n-css' href='http://lnmp.dev/download-monitor/wp-admin/css/l10n.css?ver=4.9' type='text/css' media='all' />
56
- <link rel='stylesheet' id='buttons-css' href='http://lnmp.dev/download-monitor/wp-includes/css/buttons.css?ver=4.9' type='text/css' media='all' />
57
- <!--[if lte IE 7]>
58
- <link rel='stylesheet' id='ie-css' href='http://lnmp.dev/download-monitor/wp-admin/css/ie.css?ver=4.9' type='text/css' media='all' />
59
- <![endif]-->
60
- <link rel='stylesheet' id='wp-auth-check-css' href='http://lnmp.dev/download-monitor/wp-includes/css/wp-auth-check.css?ver=4.9' type='text/css' media='all' />
61
- <link rel='stylesheet' id='download_monitor_menu_css-css' href='http://lnmp.dev/download-monitor/wp-content/plugins/_download-monitor-new/assets/css/menu.css?ver=4.9' type='text/css' media='all' />
62
- <script type="text/javascript">
63
- window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.3\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.3\/svg\/","svgExt":".svg","source":{"wpemoji":"http:\/\/lnmp.dev\/download-monitor\/wp-includes\/js\/wp-emoji.js?ver=4.9","twemoji":"http:\/\/lnmp.dev\/download-monitor\/wp-includes\/js\/twemoji.js?ver=4.9"}};
64
- ( function( window, document, settings ) {
65
- var src, ready, ii, tests;
66
-
67
- /*
68
- * Create a canvas element for testing native browser support
69
- * of emoji.
70
- */
71
- var canvas = document.createElement( 'canvas' );
72
- var context = canvas.getContext && canvas.getContext( '2d' );
73
-
74
- /**
75
- * Check if two sets of Emoji characters render the same.
76
- *
77
- * @param set1 array Set of Emoji characters.
78
- * @param set2 array Set of Emoji characters.
79
- * @returns {boolean} True if the two sets render the same.
80
- */
81
- function emojiSetsRenderIdentically( set1, set2 ) {
82
- var stringFromCharCode = String.fromCharCode;
83
-
84
- // Cleanup from previous test.
85
- context.clearRect( 0, 0, canvas.width, canvas.height );
86
- context.fillText( stringFromCharCode.apply( this, set1 ), 0, 0 );
87
- var rendered1 = canvas.toDataURL();
88
-
89
- // Cleanup from previous test.
90
- context.clearRect( 0, 0, canvas.width, canvas.height );
91
- context.fillText( stringFromCharCode.apply( this, set2 ), 0, 0 );
92
- var rendered2 = canvas.toDataURL();
93
-
94
- return rendered1 === rendered2;
95
- }
96
-
97
- /**
98
- * Detect if the browser supports rendering emoji or flag emoji. Flag emoji are a single glyph
99
- * made of two characters, so some browsers (notably, Firefox OS X) don't support them.
100
- *
101
- * @since 4.2.0
102
- *
103
- * @param type {String} Whether to test for support of "flag" or "emoji".
104
- * @return {Boolean} True if the browser can render emoji, false if it cannot.
105
- */
106
- function browserSupportsEmoji( type ) {
107
- var isIdentical;
108
-
109
- if ( ! context || ! context.fillText ) {
110
- return false;
111
- }
112
-
113
- /*
114
- * Chrome on OS X added native emoji rendering in M41. Unfortunately,
115
- * it doesn't work when the font is bolder than 500 weight. So, we
116
- * check for bold rendering support to avoid invisible emoji in Chrome.
117
- */
118
- context.textBaseline = 'top';
119
- context.font = '600 32px Arial';
120
-
121
- switch ( type ) {
122
- case 'flag':
123
- /*
124
- * Test for UN flag compatibility. This is the least supported of the letter locale flags,
125
- * so gives us an easy test for full support.
126
- *
127
- * To test for support, we try to render it, and compare the rendering to how it would look if
128
- * the browser doesn't render it correctly ([U] + [N]).
129
- */
130
- isIdentical = emojiSetsRenderIdentically(
131
- [ 55356, 56826, 55356, 56819 ],
132
- [ 55356, 56826, 8203, 55356, 56819 ]
133
- );
134
-
135
- if ( isIdentical ) {
136
- return false;
137
- }
138
-
139
- /*
140
- * Test for English flag compatibility. England is a country in the United Kingdom, it
141
- * does not have a two letter locale code but rather an five letter sub-division code.
142
- *
143
- * To test for support, we try to render it, and compare the rendering to how it would look if
144
- * the browser doesn't render it correctly (black flag emoji + [G] + [B] + [E] + [N] + [G]).
145
- */
146
- isIdentical = emojiSetsRenderIdentically(
147
- [ 55356, 57332, 56128, 56423, 56128, 56418, 56128, 56421, 56128, 56430, 56128, 56423, 56128, 56447 ],
148
- [ 55356, 57332, 8203, 56128, 56423, 8203, 56128, 56418, 8203, 56128, 56421, 8203, 56128, 56430, 8203, 56128, 56423, 8203, 56128, 56447 ]
149
- );
150
-
151
- return ! isIdentical;
152
- case 'emoji':
153
- /*
154
- * Emoji 5 has fairies of all genders.
155
- *
156
- * To test for support, try to render a new emoji (fairy, male), then compares
157
- * it to how it would look if the browser doesn't render it correctly
158
- * (fairy + male sign).
159
- */
160
- isIdentical = emojiSetsRenderIdentically(
161
- [ 55358, 56794, 8205, 9794, 65039 ],
162
- [ 55358, 56794, 8203, 9794, 65039 ]
163
- );
164
- return ! isIdentical;
165
- }
166
-
167
- return false;
168
- }
169
-
170
- function addScript( src ) {
171
- var script = document.createElement( 'script' );
172
-
173
- script.src = src;
174
- script.defer = script.type = 'text/javascript';
175
- document.getElementsByTagName( 'head' )[0].appendChild( script );
176
- }
177
-
178
- tests = Array( 'flag', 'emoji' );
179
-
180
- settings.supports = {
181
- everything: true,
182
- everythingExceptFlag: true
183
- };
184
-
185
- for( ii = 0; ii < tests.length; ii++ ) {
186
- settings.supports[ tests[ ii ] ] = browserSupportsEmoji( tests[ ii ] );
187
-
188
- settings.supports.everything = settings.supports.everything && settings.supports[ tests[ ii ] ];
189
-
190
- if ( 'flag' !== tests[ ii ] ) {
191
- settings.supports.everythingExceptFlag = settings.supports.everythingExceptFlag && settings.supports[ tests[ ii ] ];
192
- }
193
- }
194
-
195
- settings.supports.everythingExceptFlag = settings.supports.everythingExceptFlag && ! settings.supports.flag;
196
-
197
- settings.DOMReady = false;
198
- settings.readyCallback = function() {
199
- settings.DOMReady = true;
200
- };
201
-
202
- if ( ! settings.supports.everything ) {
203
- ready = function() {
204
- settings.readyCallback();
205
- };
206
-
207
- if ( document.addEventListener ) {
208
- document.addEventListener( 'DOMContentLoaded', ready, false );
209
- window.addEventListener( 'load', ready, false );
210
- } else {
211
- window.attachEvent( 'onload', ready );
212
- document.attachEvent( 'onreadystatechange', function() {
213
- if ( 'complete' === document.readyState ) {
214
- settings.readyCallback();
215
- }
216
- } );
217
- }
218
-
219
- src = settings.source || {};
220
-
221
- if ( src.concatemoji ) {
222
- addScript( src.concatemoji );
223
- } else if ( src.wpemoji && src.twemoji ) {
224
- addScript( src.twemoji );
225
- addScript( src.wpemoji );
226
- }
227
- }
228
-
229
- } )( window, document, window._wpemojiSettings );
230
- </script>
231
- <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>
232
- <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-includes/js/jquery/jquery-migrate.js?ver=1.4.1'></script>
233
- <script type='text/javascript'>
234
- /* <![CDATA[ */
235
- var userSettings = {"url":"\/download-monitor\/","uid":"1","time":"1511968878","secure":""};
236
- /* ]]> */
237
- </script>
238
- <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-includes/js/utils.js?ver=4.9'></script>
239
- <script type='text/javascript'>
240
- /* <![CDATA[ */
241
- var dlm_id_strings = {"insert_download":"Insert Download"};
242
- /* ]]> */
243
- </script>
244
- <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-content/plugins/_download-monitor-new/assets/js/insert-download.js?ver=4.0.0'></script>
245
- <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-content/plugins/_download-monitor-new/assets/js/notices.js?ver=4.0.0'></script>
246
- <link id="wp-admin-canonical" rel="canonical" href="http://lnmp.dev/download-monitor/wp-admin/options.php?page=dlm_legacy_upgrade" />
247
- <script>
248
- if ( window.history.replaceState ) {
249
- window.history.replaceState( null, null, document.getElementById( 'wp-admin-canonical' ).href + window.location.hash );
250
- }
251
- </script>
252
- <script type="text/javascript">var _wpColorScheme = {"icons":{"base":"#82878c","focus":"#00a0d2","current":"#fff"}};</script>
253
- <style type="text/css" media="print">#wpadminbar { display:none; }</style>
254
- </head>
255
- <body class="wp-admin wp-core-ui no-js admin_page_dlm_legacy_upgrade auto-fold admin-bar branch-4-9 version-4-9 admin-color-fresh locale-en-us no-customize-support no-svg">
256
- <script type="text/javascript">
257
- document.body.className = document.body.className.replace('no-js','js');
258
- </script>
259
-
260
- <!--[if lte IE 8]>
261
- <script type="text/javascript">
262
- document.body.className = document.body.className.replace( /(^|\s)(no-)?customize-support(?=\s|$)/, '' ) + ' no-customize-support';
263
- </script>
264
- <![endif]-->
265
- <!--[if gte IE 9]><!-->
266
- <script type="text/javascript">
267
- (function() {
268
- var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)');
269
-
270
- request = true;
271
-
272
- b[c] = b[c].replace( rcs, ' ' );
273
- // The customizer requires postMessage and CORS (if the site is cross domain)
274
- b[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs;
275
- }());
276
- </script>
277
- <!--<![endif]-->
278
-
279
- <div id="wpwrap">
280
-
281
- <div id="adminmenumain" role="navigation" aria-label="Main menu">
282
- <a href="#wpbody-content" class="screen-reader-shortcut">Skip to main content</a>
283
- <a href="#wp-toolbar" class="screen-reader-shortcut">Skip to toolbar</a>
284
- <div id="adminmenuback"></div>
285
- <div id="adminmenuwrap">
286
- <ul id="adminmenu">
287
-
288
-
289
- <li class="wp-first-item wp-has-submenu wp-not-current-submenu menu-top menu-top-first menu-icon-dashboard menu-top-last" id="menu-dashboard">
290
- <a href='index.php' class="wp-first-item wp-has-submenu wp-not-current-submenu menu-top menu-top-first menu-icon-dashboard menu-top-last" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-dashboard'><br /></div><div class='wp-menu-name'>Dashboard</div></a>
291
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Dashboard</li><li class="wp-first-item"><a href='index.php' class="wp-first-item">Home</a></li><li><a href='update-core.php'>Updates <span class='update-plugins count-5'><span class='update-count'>5</span></span></a></li></ul></li>
292
- <li class="wp-not-current-submenu wp-menu-separator" aria-hidden="true"><div class="separator"></div></li>
293
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-post open-if-no-js menu-top-first" id="menu-posts">
294
- <a href='edit.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-post open-if-no-js menu-top-first" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-post'><br /></div><div class='wp-menu-name'>Posts</div></a>
295
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Posts</li><li class="wp-first-item"><a href='edit.php' class="wp-first-item">All Posts</a></li><li><a href='post-new.php'>Add New</a></li><li><a href='edit-tags.php?taxonomy=category'>Categories</a></li><li><a href='edit-tags.php?taxonomy=post_tag'>Tags</a></li></ul></li>
296
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-media" id="menu-media">
297
- <a href='upload.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-media" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-media'><br /></div><div class='wp-menu-name'>Media</div></a>
298
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Media</li><li class="wp-first-item"><a href='upload.php' class="wp-first-item">Library</a></li><li><a href='media-new.php'>Add New</a></li></ul></li>
299
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-page" id="menu-pages">
300
- <a href='edit.php?post_type=page' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-page" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-page'><br /></div><div class='wp-menu-name'>Pages</div></a>
301
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Pages</li><li class="wp-first-item"><a href='edit.php?post_type=page' class="wp-first-item">All Pages</a></li><li><a href='post-new.php?post_type=page'>Add New</a></li></ul></li>
302
- <li class="wp-not-current-submenu menu-top menu-icon-comments" id="menu-comments">
303
- <a href='edit-comments.php' class="wp-not-current-submenu menu-top menu-icon-comments" ><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-comments'><br /></div><div class='wp-menu-name'>Comments <span class="awaiting-mod count-0"><span class="pending-count">0</span></span></div></a></li>
304
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-dlm_download menu-top-last" id="menu-posts-dlm_download">
305
- <a href='edit.php?post_type=dlm_download' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-dlm_download menu-top-last" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-post'><br /></div><div class='wp-menu-name'>Downloads</div></a>
306
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Downloads</li><li class="wp-first-item"><a href='edit.php?post_type=dlm_download' class="wp-first-item">All Downloads</a></li><li><a href='post-new.php?post_type=dlm_download'>Add New</a></li><li><a href='edit-tags.php?taxonomy=dlm_download_category&amp;post_type=dlm_download'>Categories</a></li><li><a href='edit-tags.php?taxonomy=dlm_download_tag&amp;post_type=dlm_download'>Tags</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=download-monitor-settings'>Settings</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=download-monitor-logs'>Logs</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=download-monitor-reports'>Reports</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=dlm-extensions'><span style="color:#419CCB;font-weight:bold;">Extensions</span></a></li></ul></li>
307
- <li class="wp-not-current-submenu wp-menu-separator" aria-hidden="true"><div class="separator"></div></li>
308
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-appearance menu-top-first" id="menu-appearance">
309
- <a href='themes.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-appearance menu-top-first" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-appearance'><br /></div><div class='wp-menu-name'>Appearance</div></a>
310
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Appearance</li><li class="wp-first-item"><a href='themes.php' class="wp-first-item">Themes</a></li><li class="hide-if-no-customize"><a href='customize.php?return=%2Fdownload-monitor%2Fwp-admin%2Foptions.php%3Fpage%3Ddlm_legacy_upgrade' class="hide-if-no-customize">Customize</a></li><li><a href='widgets.php'>Widgets</a></li><li><a href='nav-menus.php'>Menus</a></li><li class="hide-if-no-customize"><a href='customize.php?return=%2Fdownload-monitor%2Fwp-admin%2Foptions.php%3Fpage%3Ddlm_legacy_upgrade&#038;autofocus%5Bcontrol%5D=header_image' class="hide-if-no-customize">Header</a></li><li class="hide-if-no-customize"><a href='customize.php?return=%2Fdownload-monitor%2Fwp-admin%2Foptions.php%3Fpage%3Ddlm_legacy_upgrade&#038;autofocus%5Bcontrol%5D=background_image' class="hide-if-no-customize">Background</a></li><li><a href='themes.php?page=custom-header'>Header</a></li><li><a href='themes.php?page=custom-background'>Background</a></li><li><a href='theme-editor.php'>Editor</a></li></ul></li>
311
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-plugins" id="menu-plugins">
312
- <a href='plugins.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-plugins" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-plugins'><br /></div><div class='wp-menu-name'>Plugins <span class='update-plugins count-0'><span class='plugin-count'>0</span></span></div></a>
313
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Plugins <span class='update-plugins count-0'><span class='plugin-count'>0</span></span></li><li class="wp-first-item"><a href='plugins.php' class="wp-first-item">Installed Plugins</a></li><li><a href='plugin-install.php'>Add New</a></li><li><a href='plugin-editor.php'>Editor</a></li></ul></li>
314
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-users" id="menu-users">
315
- <a href='users.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-users" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-users'><br /></div><div class='wp-menu-name'>Users</div></a>
316
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Users</li><li class="wp-first-item"><a href='users.php' class="wp-first-item">All Users</a></li><li><a href='user-new.php'>Add New</a></li><li><a href='profile.php'>Your Profile</a></li></ul></li>
317
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-tools" id="menu-tools">
318
- <a href='tools.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-tools" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-tools'><br /></div><div class='wp-menu-name'>Tools</div></a>
319
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Tools</li><li class="wp-first-item"><a href='tools.php' class="wp-first-item">Available Tools</a></li><li><a href='import.php'>Import</a></li><li><a href='export.php'>Export</a></li></ul></li>
320
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-settings menu-top-last" id="menu-settings">
321
- <a href='options-general.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-settings menu-top-last" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-settings'><br /></div><div class='wp-menu-name'>Settings</div></a>
322
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Settings</li><li class="wp-first-item"><a href='options-general.php' class="wp-first-item">General</a></li><li><a href='options-writing.php'>Writing</a></li><li><a href='options-reading.php'>Reading</a></li><li><a href='options-discussion.php'>Discussion</a></li><li><a href='options-media.php'>Media</a></li><li><a href='options-permalink.php'>Permalinks</a></li></ul></li><li id="collapse-menu" class="hide-if-no-js"><button type="button" id="collapse-button" aria-label="Collapse Main menu" aria-expanded="true"><span class="collapse-button-icon" aria-hidden="true"></span><span class="collapse-button-label">Collapse menu</span></button></li></ul>
323
- </div>
324
- </div>
325
- <div id="wpcontent">
326
-
327
- <div id="wpadminbar" class="nojq nojs">
328
- <div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="Toolbar" tabindex="0">
329
- <ul id="wp-admin-bar-root-default" class="ab-top-menu">
330
- <li id="wp-admin-bar-menu-toggle"><a class="ab-item" href="#"><span class="ab-icon"></span><span class="screen-reader-text">Menu</span></a> </li>
331
- <li id="wp-admin-bar-wp-logo" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/wp-admin/about.php"><span class="ab-icon"></span><span class="screen-reader-text">About WordPress</span></a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-wp-logo-default" class="ab-submenu">
332
- <li id="wp-admin-bar-about"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/about.php">About WordPress</a> </li></ul><ul id="wp-admin-bar-wp-logo-external" class="ab-sub-secondary ab-submenu">
333
- <li id="wp-admin-bar-wporg"><a class="ab-item" href="https://wordpress.org/">WordPress.org</a> </li>
334
- <li id="wp-admin-bar-documentation"><a class="ab-item" href="https://codex.wordpress.org/">Documentation</a> </li>
335
- <li id="wp-admin-bar-support-forums"><a class="ab-item" href="https://wordpress.org/support/">Support Forums</a> </li>
336
- <li id="wp-admin-bar-feedback"><a class="ab-item" href="https://wordpress.org/support/forum/requests-and-feedback">Feedback</a> </li></ul></div> </li>
337
- <li id="wp-admin-bar-site-name" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/">Download Monitor</a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-site-name-default" class="ab-submenu">
338
- <li id="wp-admin-bar-view-site"><a class="ab-item" href="http://lnmp.dev/download-monitor/">Visit Site</a> </li></ul></div> </li>
339
- <li id="wp-admin-bar-updates"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/update-core.php" title="4 Theme Updates, Translation Updates"><span class="ab-icon"></span><span class="ab-label">5</span><span class="screen-reader-text">4 Theme Updates, Translation Updates</span></a> </li>
340
- <li id="wp-admin-bar-comments"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/edit-comments.php"><span class="ab-icon"></span><span class="ab-label awaiting-mod pending-count count-0" aria-hidden="true">0</span><span class="screen-reader-text">0 comments awaiting moderation</span></a> </li>
341
- <li id="wp-admin-bar-new-content" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php"><span class="ab-icon"></span><span class="ab-label">New</span></a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-new-content-default" class="ab-submenu">
342
- <li id="wp-admin-bar-new-post"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php">Post</a> </li>
343
- <li id="wp-admin-bar-new-media"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/media-new.php">Media</a> </li>
344
- <li id="wp-admin-bar-new-page"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php?post_type=page">Page</a> </li>
345
- <li id="wp-admin-bar-new-dlm_download"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php?post_type=dlm_download">Download</a> </li>
346
- <li id="wp-admin-bar-new-user"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/user-new.php">User</a> </li></ul></div> </li></ul><ul id="wp-admin-bar-top-secondary" class="ab-top-secondary ab-top-menu">
347
- <li id="wp-admin-bar-my-account" class="menupop with-avatar"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/wp-admin/profile.php">Howdy, <span class="display-name">admin</span><img alt='' src='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=26&#038;d=mm&#038;r=g' srcset='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=52&#038;d=mm&#038;r=g 2x' class='avatar avatar-26 photo' height='26' width='26' /></a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-user-actions" class="ab-submenu">
348
- <li id="wp-admin-bar-user-info"><a class="ab-item" tabindex="-1" href="http://lnmp.dev/download-monitor/wp-admin/profile.php"><img alt='' src='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=64&#038;d=mm&#038;r=g' srcset='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=128&#038;d=mm&#038;r=g 2x' class='avatar avatar-64 photo' height='64' width='64' /><span class='display-name'>admin</span></a> </li>
349
- <li id="wp-admin-bar-edit-profile"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/profile.php">Edit My Profile</a> </li>
350
- <li id="wp-admin-bar-logout"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-login.php?action=logout&#038;_wpnonce=73db673a22">Log Out</a> </li></ul></div> </li></ul> </div>
351
- <a class="screen-reader-shortcut" href="http://lnmp.dev/download-monitor/wp-login.php?action=logout&#038;_wpnonce=73db673a22">Log Out</a>
352
- </div>
353
-
354
-
355
- <div id="wpbody" role="main">
356
-
357
- <div id="wpbody-content" aria-label="Main content" tabindex="0">
358
- <div id="screen-meta" class="metabox-prefs">
359
-
360
- <div id="contextual-help-wrap" class="hidden no-sidebar" tabindex="-1" aria-label="Contextual Help Tab">
361
- <div id="contextual-help-back"></div>
362
- <div id="contextual-help-columns">
363
- <div class="contextual-help-tabs">
364
- <ul>
365
- </ul>
366
- </div>
367
-
368
-
369
- <div class="contextual-help-tabs-wrap">
370
- </div>
371
- </div>
372
- </div>
373
- </div>
374
- <div class="wrap">
375
- <h1>Download Monitor - Legacy Upgrade</h1><br/>
376
- <p>Welcome to the Download Monitor Legacy Upgrader. On this page we will upgrade your old Download Monitor (legacy) data so it will work with the latest version. If you're on this page, it should mean that you updated to this version from Download Monitor <strong>3.x</strong>. If you're unsure if this is correct, or you want to read more about the legacy upgrade, we've setup a page that will explain this process in a lot more detail. <a href='https://www.download-monitor.com/kb/legacy-upgrade' target='_blank'>Click here</a> if to view that page.</p>
377
-
378
- <div id="dlm-legacy-upgrade-container" style="position:relative;"></div>
379
- </div>
380
-
381
- <div class="clear"></div></div><!-- wpbody-content -->
382
- <div class="clear"></div></div><!-- wpbody -->
383
- <div class="clear"></div></div><!-- wpcontent -->
384
-
385
- <div id="wpfooter" role="contentinfo">
386
- <p id="footer-left" class="alignleft">
387
- <span id="footer-thankyou">Thank you for creating with <a href="https://wordpress.org/">WordPress</a>.</span> </p>
388
- <p id="footer-upgrade" class="alignright">
389
- Version 4.9 </p>
390
- <div class="clear"></div>
391
- </div>
392
- <div id="wp-auth-check-wrap" class="hidden">
393
- <div id="wp-auth-check-bg"></div>
394
- <div id="wp-auth-check">
395
- <button type="button" class="wp-auth-check-close button-link"><span class="screen-reader-text">Close dialog</span></button>
396
- <div id="wp-auth-check-form" class="loading" data-src="http://lnmp.dev/download-monitor/wp-login.php?interim-login=1&#038;wp_lang=en_US"></div>
397
- <div class="wp-auth-fallback">
398
- <p><b class="wp-auth-fallback-expired" tabindex="0">Session expired</b></p>
399
- <p><a href="http://lnmp.dev/download-monitor/wp-login.php" target="_blank">Please log in again.</a>
400
- The login page will open in a new window. After logging in you can close it and return to this page.</p>
401
- </div>
402
- </div>
403
- </div>
404
-
405
-
406
- <div class="clear"></div></div><!-- wpwrap -->
407
- </body>
408
- </html>
1
+ <!DOCTYPE html>
2
+ <!--[if IE 8]>
3
+ <html xmlns="http://www.w3.org/1999/xhtml" class="ie8 wp-toolbar" lang="en-US">
4
+ <![endif]-->
5
+ <!--[if !(IE 8) ]><!-->
6
+ <html xmlns="http://www.w3.org/1999/xhtml" class="wp-toolbar" lang="en-US">
7
+ <!--<![endif]-->
8
+ <head>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
+ <title> &lsaquo; Download Monitor &#8212; WordPress</title>
11
+
12
+ <script type="text/javascript">
13
+ addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
14
+ var ajaxurl = 'http://lnmp.dev/download-monitor/wp-admin/admin-ajax.php',
15
+ pagenow = 'admin_page_dlm_legacy_upgrade',
16
+ typenow = '',
17
+ adminpage = 'admin_page_dlm_legacy_upgrade',
18
+ thousandsSeparator = ',',
19
+ decimalPoint = '.',
20
+ isRtl = 0;
21
+ </script>
22
+
23
+ <meta name="viewport" content="width=device-width,initial-scale=1.0">
24
+ <link rel='dns-prefetch' href='//s.w.org' />
25
+ <style type="text/css">
26
+ img.wp-smiley,
27
+ img.emoji {
28
+ display: inline !important;
29
+ border: none !important;
30
+ box-shadow: none !important;
31
+ height: 1em !important;
32
+ width: 1em !important;
33
+ margin: 0 .07em !important;
34
+ vertical-align: -0.1em !important;
35
+ background: none !important;
36
+ padding: 0 !important;
37
+ }
38
+ </style>
39
+ <link rel='stylesheet' id='dashicons-css' href='http://lnmp.dev/download-monitor/wp-includes/css/dashicons.css?ver=4.9' type='text/css' media='all' />
40
+ <link rel='stylesheet' id='admin-bar-css' href='http://lnmp.dev/download-monitor/wp-includes/css/admin-bar.css?ver=4.9' type='text/css' media='all' />
41
+ <link rel='stylesheet' id='common-css' href='http://lnmp.dev/download-monitor/wp-admin/css/common.css?ver=4.9' type='text/css' media='all' />
42
+ <link rel='stylesheet' id='forms-css' href='http://lnmp.dev/download-monitor/wp-admin/css/forms.css?ver=4.9' type='text/css' media='all' />
43
+ <link rel='stylesheet' id='admin-menu-css' href='http://lnmp.dev/download-monitor/wp-admin/css/admin-menu.css?ver=4.9' type='text/css' media='all' />
44
+ <link rel='stylesheet' id='dashboard-css' href='http://lnmp.dev/download-monitor/wp-admin/css/dashboard.css?ver=4.9' type='text/css' media='all' />
45
+ <link rel='stylesheet' id='list-tables-css' href='http://lnmp.dev/download-monitor/wp-admin/css/list-tables.css?ver=4.9' type='text/css' media='all' />
46
+ <link rel='stylesheet' id='edit-css' href='http://lnmp.dev/download-monitor/wp-admin/css/edit.css?ver=4.9' type='text/css' media='all' />
47
+ <link rel='stylesheet' id='revisions-css' href='http://lnmp.dev/download-monitor/wp-admin/css/revisions.css?ver=4.9' type='text/css' media='all' />
48
+ <link rel='stylesheet' id='media-css' href='http://lnmp.dev/download-monitor/wp-admin/css/media.css?ver=4.9' type='text/css' media='all' />
49
+ <link rel='stylesheet' id='themes-css' href='http://lnmp.dev/download-monitor/wp-admin/css/themes.css?ver=4.9' type='text/css' media='all' />
50
+ <link rel='stylesheet' id='about-css' href='http://lnmp.dev/download-monitor/wp-admin/css/about.css?ver=4.9' type='text/css' media='all' />
51
+ <link rel='stylesheet' id='nav-menus-css' href='http://lnmp.dev/download-monitor/wp-admin/css/nav-menus.css?ver=4.9' type='text/css' media='all' />
52
+ <link rel='stylesheet' id='wp-pointer-css' href='http://lnmp.dev/download-monitor/wp-includes/css/wp-pointer.css?ver=4.9' type='text/css' media='all' />
53
+ <link rel='stylesheet' id='widgets-css' href='http://lnmp.dev/download-monitor/wp-admin/css/widgets.css?ver=4.9' type='text/css' media='all' />
54
+ <link rel='stylesheet' id='site-icon-css' href='http://lnmp.dev/download-monitor/wp-admin/css/site-icon.css?ver=4.9' type='text/css' media='all' />
55
+ <link rel='stylesheet' id='l10n-css' href='http://lnmp.dev/download-monitor/wp-admin/css/l10n.css?ver=4.9' type='text/css' media='all' />
56
+ <link rel='stylesheet' id='buttons-css' href='http://lnmp.dev/download-monitor/wp-includes/css/buttons.css?ver=4.9' type='text/css' media='all' />
57
+ <!--[if lte IE 7]>
58
+ <link rel='stylesheet' id='ie-css' href='http://lnmp.dev/download-monitor/wp-admin/css/ie.css?ver=4.9' type='text/css' media='all' />
59
+ <![endif]-->
60
+ <link rel='stylesheet' id='wp-auth-check-css' href='http://lnmp.dev/download-monitor/wp-includes/css/wp-auth-check.css?ver=4.9' type='text/css' media='all' />
61
+ <link rel='stylesheet' id='download_monitor_menu_css-css' href='http://lnmp.dev/download-monitor/wp-content/plugins/_download-monitor-new/assets/css/menu.css?ver=4.9' type='text/css' media='all' />
62
+ <script type="text/javascript">
63
+ window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.3\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.3\/svg\/","svgExt":".svg","source":{"wpemoji":"http:\/\/lnmp.dev\/download-monitor\/wp-includes\/js\/wp-emoji.js?ver=4.9","twemoji":"http:\/\/lnmp.dev\/download-monitor\/wp-includes\/js\/twemoji.js?ver=4.9"}};
64
+ ( function( window, document, settings ) {
65
+ var src, ready, ii, tests;
66
+
67
+ /*
68
+ * Create a canvas element for testing native browser support
69
+ * of emoji.
70
+ */
71
+ var canvas = document.createElement( 'canvas' );
72
+ var context = canvas.getContext && canvas.getContext( '2d' );
73
+
74
+ /**
75
+ * Check if two sets of Emoji characters render the same.
76
+ *
77
+ * @param set1 array Set of Emoji characters.
78
+ * @param set2 array Set of Emoji characters.
79
+ * @returns {boolean} True if the two sets render the same.
80
+ */
81
+ function emojiSetsRenderIdentically( set1, set2 ) {
82
+ var stringFromCharCode = String.fromCharCode;
83
+
84
+ // Cleanup from previous test.
85
+ context.clearRect( 0, 0, canvas.width, canvas.height );
86
+ context.fillText( stringFromCharCode.apply( this, set1 ), 0, 0 );
87
+ var rendered1 = canvas.toDataURL();
88
+
89
+ // Cleanup from previous test.
90
+ context.clearRect( 0, 0, canvas.width, canvas.height );
91
+ context.fillText( stringFromCharCode.apply( this, set2 ), 0, 0 );
92
+ var rendered2 = canvas.toDataURL();
93
+
94
+ return rendered1 === rendered2;
95
+ }
96
+
97
+ /**
98
+ * Detect if the browser supports rendering emoji or flag emoji. Flag emoji are a single glyph
99
+ * made of two characters, so some browsers (notably, Firefox OS X) don't support them.
100
+ *
101
+ * @since 4.2.0
102
+ *
103
+ * @param type {String} Whether to test for support of "flag" or "emoji".
104
+ * @return {Boolean} True if the browser can render emoji, false if it cannot.
105
+ */
106
+ function browserSupportsEmoji( type ) {
107
+ var isIdentical;
108
+
109
+ if ( ! context || ! context.fillText ) {
110
+ return false;
111
+ }
112
+
113
+ /*
114
+ * Chrome on OS X added native emoji rendering in M41. Unfortunately,
115
+ * it doesn't work when the font is bolder than 500 weight. So, we
116
+ * check for bold rendering support to avoid invisible emoji in Chrome.
117
+ */
118
+ context.textBaseline = 'top';
119
+ context.font = '600 32px Arial';
120
+
121
+ switch ( type ) {
122
+ case 'flag':
123
+ /*
124
+ * Test for UN flag compatibility. This is the least supported of the letter locale flags,
125
+ * so gives us an easy test for full support.
126
+ *
127
+ * To test for support, we try to render it, and compare the rendering to how it would look if
128
+ * the browser doesn't render it correctly ([U] + [N]).
129
+ */
130
+ isIdentical = emojiSetsRenderIdentically(
131
+ [ 55356, 56826, 55356, 56819 ],
132
+ [ 55356, 56826, 8203, 55356, 56819 ]
133
+ );
134
+
135
+ if ( isIdentical ) {
136
+ return false;
137
+ }
138
+
139
+ /*
140
+ * Test for English flag compatibility. England is a country in the United Kingdom, it
141
+ * does not have a two letter locale code but rather an five letter sub-division code.
142
+ *
143
+ * To test for support, we try to render it, and compare the rendering to how it would look if
144
+ * the browser doesn't render it correctly (black flag emoji + [G] + [B] + [E] + [N] + [G]).
145
+ */
146
+ isIdentical = emojiSetsRenderIdentically(
147
+ [ 55356, 57332, 56128, 56423, 56128, 56418, 56128, 56421, 56128, 56430, 56128, 56423, 56128, 56447 ],
148
+ [ 55356, 57332, 8203, 56128, 56423, 8203, 56128, 56418, 8203, 56128, 56421, 8203, 56128, 56430, 8203, 56128, 56423, 8203, 56128, 56447 ]
149
+ );
150
+
151
+ return ! isIdentical;
152
+ case 'emoji':
153
+ /*
154
+ * Emoji 5 has fairies of all genders.
155
+ *
156
+ * To test for support, try to render a new emoji (fairy, male), then compares
157
+ * it to how it would look if the browser doesn't render it correctly
158
+ * (fairy + male sign).
159
+ */
160
+ isIdentical = emojiSetsRenderIdentically(
161
+ [ 55358, 56794, 8205, 9794, 65039 ],
162
+ [ 55358, 56794, 8203, 9794, 65039 ]
163
+ );
164
+ return ! isIdentical;
165
+ }
166
+
167
+ return false;
168
+ }
169
+
170
+ function addScript( src ) {
171
+ var script = document.createElement( 'script' );
172
+
173
+ script.src = src;
174
+ script.defer = script.type = 'text/javascript';
175
+ document.getElementsByTagName( 'head' )[0].appendChild( script );
176
+ }
177
+
178
+ tests = Array( 'flag', 'emoji' );
179
+
180
+ settings.supports = {
181
+ everything: true,
182
+ everythingExceptFlag: true
183
+ };
184
+
185
+ for( ii = 0; ii < tests.length; ii++ ) {
186
+ settings.supports[ tests[ ii ] ] = browserSupportsEmoji( tests[ ii ] );
187
+
188
+ settings.supports.everything = settings.supports.everything && settings.supports[ tests[ ii ] ];
189
+
190
+ if ( 'flag' !== tests[ ii ] ) {
191
+ settings.supports.everythingExceptFlag = settings.supports.everythingExceptFlag && settings.supports[ tests[ ii ] ];
192
+ }
193
+ }
194
+
195
+ settings.supports.everythingExceptFlag = settings.supports.everythingExceptFlag && ! settings.supports.flag;
196
+
197
+ settings.DOMReady = false;
198
+ settings.readyCallback = function() {
199
+ settings.DOMReady = true;
200
+ };
201
+
202
+ if ( ! settings.supports.everything ) {
203
+ ready = function() {
204
+ settings.readyCallback();
205
+ };
206
+
207
+ if ( document.addEventListener ) {
208
+ document.addEventListener( 'DOMContentLoaded', ready, false );
209
+ window.addEventListener( 'load', ready, false );
210
+ } else {
211
+ window.attachEvent( 'onload', ready );
212
+ document.attachEvent( 'onreadystatechange', function() {
213
+ if ( 'complete' === document.readyState ) {
214
+ settings.readyCallback();
215
+ }
216
+ } );
217
+ }
218
+
219
+ src = settings.source || {};
220
+
221
+ if ( src.concatemoji ) {
222
+ addScript( src.concatemoji );
223
+ } else if ( src.wpemoji && src.twemoji ) {
224
+ addScript( src.twemoji );
225
+ addScript( src.wpemoji );
226
+ }
227
+ }
228
+
229
+ } )( window, document, window._wpemojiSettings );
230
+ </script>
231
+ <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>
232
+ <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-includes/js/jquery/jquery-migrate.js?ver=1.4.1'></script>
233
+ <script type='text/javascript'>
234
+ /* <![CDATA[ */
235
+ var userSettings = {"url":"\/download-monitor\/","uid":"1","time":"1511968878","secure":""};
236
+ /* ]]> */
237
+ </script>
238
+ <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-includes/js/utils.js?ver=4.9'></script>
239
+ <script type='text/javascript'>
240
+ /* <![CDATA[ */
241
+ var dlm_id_strings = {"insert_download":"Insert Download"};
242
+ /* ]]> */
243
+ </script>
244
+ <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-content/plugins/_download-monitor-new/assets/js/insert-download.js?ver=4.0.0'></script>
245
+ <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-content/plugins/_download-monitor-new/assets/js/notices.js?ver=4.0.0'></script>
246
+ <link id="wp-admin-canonical" rel="canonical" href="http://lnmp.dev/download-monitor/wp-admin/options.php?page=dlm_legacy_upgrade" />
247
+ <script>
248
+ if ( window.history.replaceState ) {
249
+ window.history.replaceState( null, null, document.getElementById( 'wp-admin-canonical' ).href + window.location.hash );
250
+ }
251
+ </script>
252
+ <script type="text/javascript">var _wpColorScheme = {"icons":{"base":"#82878c","focus":"#00a0d2","current":"#fff"}};</script>
253
+ <style type="text/css" media="print">#wpadminbar { display:none; }</style>
254
+ </head>
255
+ <body class="wp-admin wp-core-ui no-js admin_page_dlm_legacy_upgrade auto-fold admin-bar branch-4-9 version-4-9 admin-color-fresh locale-en-us no-customize-support no-svg">
256
+ <script type="text/javascript">
257
+ document.body.className = document.body.className.replace('no-js','js');
258
+ </script>
259
+
260
+ <!--[if lte IE 8]>
261
+ <script type="text/javascript">
262
+ document.body.className = document.body.className.replace( /(^|\s)(no-)?customize-support(?=\s|$)/, '' ) + ' no-customize-support';
263
+ </script>
264
+ <![endif]-->
265
+ <!--[if gte IE 9]><!-->
266
+ <script type="text/javascript">
267
+ (function() {
268
+ var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)');
269
+
270
+ request = true;
271
+
272
+ b[c] = b[c].replace( rcs, ' ' );
273
+ // The customizer requires postMessage and CORS (if the site is cross domain)
274
+ b[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs;
275
+ }());
276
+ </script>
277
+ <!--<![endif]-->
278
+
279
+ <div id="wpwrap">
280
+
281
+ <div id="adminmenumain" role="navigation" aria-label="Main menu">
282
+ <a href="#wpbody-content" class="screen-reader-shortcut">Skip to main content</a>
283
+ <a href="#wp-toolbar" class="screen-reader-shortcut">Skip to toolbar</a>
284
+ <div id="adminmenuback"></div>
285
+ <div id="adminmenuwrap">
286
+ <ul id="adminmenu">
287
+
288
+
289
+ <li class="wp-first-item wp-has-submenu wp-not-current-submenu menu-top menu-top-first menu-icon-dashboard menu-top-last" id="menu-dashboard">
290
+ <a href='index.php' class="wp-first-item wp-has-submenu wp-not-current-submenu menu-top menu-top-first menu-icon-dashboard menu-top-last" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-dashboard'><br /></div><div class='wp-menu-name'>Dashboard</div></a>
291
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Dashboard</li><li class="wp-first-item"><a href='index.php' class="wp-first-item">Home</a></li><li><a href='update-core.php'>Updates <span class='update-plugins count-5'><span class='update-count'>5</span></span></a></li></ul></li>
292
+ <li class="wp-not-current-submenu wp-menu-separator" aria-hidden="true"><div class="separator"></div></li>
293
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-post open-if-no-js menu-top-first" id="menu-posts">
294
+ <a href='edit.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-post open-if-no-js menu-top-first" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-post'><br /></div><div class='wp-menu-name'>Posts</div></a>
295
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Posts</li><li class="wp-first-item"><a href='edit.php' class="wp-first-item">All Posts</a></li><li><a href='post-new.php'>Add New</a></li><li><a href='edit-tags.php?taxonomy=category'>Categories</a></li><li><a href='edit-tags.php?taxonomy=post_tag'>Tags</a></li></ul></li>
296
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-media" id="menu-media">
297
+ <a href='upload.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-media" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-media'><br /></div><div class='wp-menu-name'>Media</div></a>
298
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Media</li><li class="wp-first-item"><a href='upload.php' class="wp-first-item">Library</a></li><li><a href='media-new.php'>Add New</a></li></ul></li>
299
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-page" id="menu-pages">
300
+ <a href='edit.php?post_type=page' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-page" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-page'><br /></div><div class='wp-menu-name'>Pages</div></a>
301
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Pages</li><li class="wp-first-item"><a href='edit.php?post_type=page' class="wp-first-item">All Pages</a></li><li><a href='post-new.php?post_type=page'>Add New</a></li></ul></li>
302
+ <li class="wp-not-current-submenu menu-top menu-icon-comments" id="menu-comments">
303
+ <a href='edit-comments.php' class="wp-not-current-submenu menu-top menu-icon-comments" ><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-comments'><br /></div><div class='wp-menu-name'>Comments <span class="awaiting-mod count-0"><span class="pending-count">0</span></span></div></a></li>
304
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-dlm_download menu-top-last" id="menu-posts-dlm_download">
305
+ <a href='edit.php?post_type=dlm_download' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-dlm_download menu-top-last" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-post'><br /></div><div class='wp-menu-name'>Downloads</div></a>
306
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Downloads</li><li class="wp-first-item"><a href='edit.php?post_type=dlm_download' class="wp-first-item">All Downloads</a></li><li><a href='post-new.php?post_type=dlm_download'>Add New</a></li><li><a href='edit-tags.php?taxonomy=dlm_download_category&amp;post_type=dlm_download'>Categories</a></li><li><a href='edit-tags.php?taxonomy=dlm_download_tag&amp;post_type=dlm_download'>Tags</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=download-monitor-settings'>Settings</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=download-monitor-logs'>Logs</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=download-monitor-reports'>Reports</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=dlm-extensions'><span style="color:#419CCB;font-weight:bold;">Extensions</span></a></li></ul></li>
307
+ <li class="wp-not-current-submenu wp-menu-separator" aria-hidden="true"><div class="separator"></div></li>
308
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-appearance menu-top-first" id="menu-appearance">
309
+ <a href='themes.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-appearance menu-top-first" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-appearance'><br /></div><div class='wp-menu-name'>Appearance</div></a>
310
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Appearance</li><li class="wp-first-item"><a href='themes.php' class="wp-first-item">Themes</a></li><li class="hide-if-no-customize"><a href='customize.php?return=%2Fdownload-monitor%2Fwp-admin%2Foptions.php%3Fpage%3Ddlm_legacy_upgrade' class="hide-if-no-customize">Customize</a></li><li><a href='widgets.php'>Widgets</a></li><li><a href='nav-menus.php'>Menus</a></li><li class="hide-if-no-customize"><a href='customize.php?return=%2Fdownload-monitor%2Fwp-admin%2Foptions.php%3Fpage%3Ddlm_legacy_upgrade&#038;autofocus%5Bcontrol%5D=header_image' class="hide-if-no-customize">Header</a></li><li class="hide-if-no-customize"><a href='customize.php?return=%2Fdownload-monitor%2Fwp-admin%2Foptions.php%3Fpage%3Ddlm_legacy_upgrade&#038;autofocus%5Bcontrol%5D=background_image' class="hide-if-no-customize">Background</a></li><li><a href='themes.php?page=custom-header'>Header</a></li><li><a href='themes.php?page=custom-background'>Background</a></li><li><a href='theme-editor.php'>Editor</a></li></ul></li>
311
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-plugins" id="menu-plugins">
312
+ <a href='plugins.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-plugins" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-plugins'><br /></div><div class='wp-menu-name'>Plugins <span class='update-plugins count-0'><span class='plugin-count'>0</span></span></div></a>
313
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Plugins <span class='update-plugins count-0'><span class='plugin-count'>0</span></span></li><li class="wp-first-item"><a href='plugins.php' class="wp-first-item">Installed Plugins</a></li><li><a href='plugin-install.php'>Add New</a></li><li><a href='plugin-editor.php'>Editor</a></li></ul></li>
314
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-users" id="menu-users">
315
+ <a href='users.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-users" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-users'><br /></div><div class='wp-menu-name'>Users</div></a>
316
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Users</li><li class="wp-first-item"><a href='users.php' class="wp-first-item">All Users</a></li><li><a href='user-new.php'>Add New</a></li><li><a href='profile.php'>Your Profile</a></li></ul></li>
317
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-tools" id="menu-tools">
318
+ <a href='tools.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-tools" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-tools'><br /></div><div class='wp-menu-name'>Tools</div></a>
319
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Tools</li><li class="wp-first-item"><a href='tools.php' class="wp-first-item">Available Tools</a></li><li><a href='import.php'>Import</a></li><li><a href='export.php'>Export</a></li></ul></li>
320
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-settings menu-top-last" id="menu-settings">
321
+ <a href='options-general.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-settings menu-top-last" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-settings'><br /></div><div class='wp-menu-name'>Settings</div></a>
322
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Settings</li><li class="wp-first-item"><a href='options-general.php' class="wp-first-item">General</a></li><li><a href='options-writing.php'>Writing</a></li><li><a href='options-reading.php'>Reading</a></li><li><a href='options-discussion.php'>Discussion</a></li><li><a href='options-media.php'>Media</a></li><li><a href='options-permalink.php'>Permalinks</a></li></ul></li><li id="collapse-menu" class="hide-if-no-js"><button type="button" id="collapse-button" aria-label="Collapse Main menu" aria-expanded="true"><span class="collapse-button-icon" aria-hidden="true"></span><span class="collapse-button-label">Collapse menu</span></button></li></ul>
323
+ </div>
324
+ </div>
325
+ <div id="wpcontent">
326
+
327
+ <div id="wpadminbar" class="nojq nojs">
328
+ <div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="Toolbar" tabindex="0">
329
+ <ul id="wp-admin-bar-root-default" class="ab-top-menu">
330
+ <li id="wp-admin-bar-menu-toggle"><a class="ab-item" href="#"><span class="ab-icon"></span><span class="screen-reader-text">Menu</span></a> </li>
331
+ <li id="wp-admin-bar-wp-logo" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/wp-admin/about.php"><span class="ab-icon"></span><span class="screen-reader-text">About WordPress</span></a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-wp-logo-default" class="ab-submenu">
332
+ <li id="wp-admin-bar-about"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/about.php">About WordPress</a> </li></ul><ul id="wp-admin-bar-wp-logo-external" class="ab-sub-secondary ab-submenu">
333
+ <li id="wp-admin-bar-wporg"><a class="ab-item" href="https://wordpress.org/">WordPress.org</a> </li>
334
+ <li id="wp-admin-bar-documentation"><a class="ab-item" href="https://codex.wordpress.org/">Documentation</a> </li>
335
+ <li id="wp-admin-bar-support-forums"><a class="ab-item" href="https://wordpress.org/support/">Support Forums</a> </li>
336
+ <li id="wp-admin-bar-feedback"><a class="ab-item" href="https://wordpress.org/support/forum/requests-and-feedback">Feedback</a> </li></ul></div> </li>
337
+ <li id="wp-admin-bar-site-name" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/">Download Monitor</a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-site-name-default" class="ab-submenu">
338
+ <li id="wp-admin-bar-view-site"><a class="ab-item" href="http://lnmp.dev/download-monitor/">Visit Site</a> </li></ul></div> </li>
339
+ <li id="wp-admin-bar-updates"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/update-core.php" title="4 Theme Updates, Translation Updates"><span class="ab-icon"></span><span class="ab-label">5</span><span class="screen-reader-text">4 Theme Updates, Translation Updates</span></a> </li>
340
+ <li id="wp-admin-bar-comments"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/edit-comments.php"><span class="ab-icon"></span><span class="ab-label awaiting-mod pending-count count-0" aria-hidden="true">0</span><span class="screen-reader-text">0 comments awaiting moderation</span></a> </li>
341
+ <li id="wp-admin-bar-new-content" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php"><span class="ab-icon"></span><span class="ab-label">New</span></a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-new-content-default" class="ab-submenu">
342
+ <li id="wp-admin-bar-new-post"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php">Post</a> </li>
343
+ <li id="wp-admin-bar-new-media"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/media-new.php">Media</a> </li>
344
+ <li id="wp-admin-bar-new-page"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php?post_type=page">Page</a> </li>
345
+ <li id="wp-admin-bar-new-dlm_download"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php?post_type=dlm_download">Download</a> </li>
346
+ <li id="wp-admin-bar-new-user"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/user-new.php">User</a> </li></ul></div> </li></ul><ul id="wp-admin-bar-top-secondary" class="ab-top-secondary ab-top-menu">
347
+ <li id="wp-admin-bar-my-account" class="menupop with-avatar"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/wp-admin/profile.php">Howdy, <span class="display-name">admin</span><img alt='' src='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=26&#038;d=mm&#038;r=g' srcset='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=52&#038;d=mm&#038;r=g 2x' class='avatar avatar-26 photo' height='26' width='26' /></a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-user-actions" class="ab-submenu">
348
+ <li id="wp-admin-bar-user-info"><a class="ab-item" tabindex="-1" href="http://lnmp.dev/download-monitor/wp-admin/profile.php"><img alt='' src='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=64&#038;d=mm&#038;r=g' srcset='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=128&#038;d=mm&#038;r=g 2x' class='avatar avatar-64 photo' height='64' width='64' /><span class='display-name'>admin</span></a> </li>
349
+ <li id="wp-admin-bar-edit-profile"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/profile.php">Edit My Profile</a> </li>
350
+ <li id="wp-admin-bar-logout"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-login.php?action=logout&#038;_wpnonce=73db673a22">Log Out</a> </li></ul></div> </li></ul> </div>
351
+ <a class="screen-reader-shortcut" href="http://lnmp.dev/download-monitor/wp-login.php?action=logout&#038;_wpnonce=73db673a22">Log Out</a>
352
+ </div>
353
+
354
+
355
+ <div id="wpbody" role="main">
356
+
357
+ <div id="wpbody-content" aria-label="Main content" tabindex="0">
358
+ <div id="screen-meta" class="metabox-prefs">
359
+
360
+ <div id="contextual-help-wrap" class="hidden no-sidebar" tabindex="-1" aria-label="Contextual Help Tab">
361
+ <div id="contextual-help-back"></div>
362
+ <div id="contextual-help-columns">
363
+ <div class="contextual-help-tabs">
364
+ <ul>
365
+ </ul>
366
+ </div>
367
+
368
+
369
+ <div class="contextual-help-tabs-wrap">
370
+ </div>
371
+ </div>
372
+ </div>
373
+ </div>
374
+ <div class="wrap">
375
+ <h1>Download Monitor - Legacy Upgrade</h1><br/>
376
+ <p>Welcome to the Download Monitor Legacy Upgrader. On this page we will upgrade your old Download Monitor (legacy) data so it will work with the latest version. If you're on this page, it should mean that you updated to this version from Download Monitor <strong>3.x</strong>. If you're unsure if this is correct, or you want to read more about the legacy upgrade, we've setup a page that will explain this process in a lot more detail. <a href='https://www.download-monitor.com/kb/legacy-upgrade' target='_blank'>Click here</a> if to view that page.</p>
377
+
378
+ <div id="dlm-legacy-upgrade-container" style="position:relative;"></div>
379
+ </div>
380
+
381
+ <div class="clear"></div></div><!-- wpbody-content -->
382
+ <div class="clear"></div></div><!-- wpbody -->
383
+ <div class="clear"></div></div><!-- wpcontent -->
384
+
385
+ <div id="wpfooter" role="contentinfo">
386
+ <p id="footer-left" class="alignleft">
387
+ <span id="footer-thankyou">Thank you for creating with <a href="https://wordpress.org/">WordPress</a>.</span> </p>
388
+ <p id="footer-upgrade" class="alignright">
389
+ Version 4.9 </p>
390
+ <div class="clear"></div>
391
+ </div>
392
+ <div id="wp-auth-check-wrap" class="hidden">
393
+ <div id="wp-auth-check-bg"></div>
394
+ <div id="wp-auth-check">
395
+ <button type="button" class="wp-auth-check-close button-link"><span class="screen-reader-text">Close dialog</span></button>
396
+ <div id="wp-auth-check-form" class="loading" data-src="http://lnmp.dev/download-monitor/wp-login.php?interim-login=1&#038;wp_lang=en_US"></div>
397
+ <div class="wp-auth-fallback">
398
+ <p><b class="wp-auth-fallback-expired" tabindex="0">Session expired</b></p>
399
+ <p><a href="http://lnmp.dev/download-monitor/wp-login.php" target="_blank">Please log in again.</a>
400
+ The login page will open in a new window. After logging in you can close it and return to this page.</p>
401
+ </div>
402
+ </div>
403
+ </div>
404
+
405
+
406
+ <div class="clear"></div></div><!-- wpwrap -->
407
+ </body>
408
+ </html>
assets/js/legacy-upgrader/src/index.js CHANGED
@@ -1,20 +1,20 @@
1
- // import 'promise-polyfill';
2
- // import 'isomorphic-fetch';
3
- import { h, render } from 'preact';
4
- import './style';
5
-
6
- let root;
7
- function DLM_LU_init() {
8
- let App = require('./components/app').default;
9
- root = render(<App />, document.getElementById("dlm-legacy-upgrade-container"), root);
10
- }
11
-
12
- // in development, set up HMR:
13
- if (module.hot) {
14
- //require('preact/devtools'); // turn this on if you want to enable React DevTools!
15
- module.hot.accept('./components/app', () => requestAnimationFrame(init) );
16
- }
17
-
18
- document.addEventListener("DOMContentLoaded", function(event) {
19
- DLM_LU_init();
20
- });
1
+ // import 'promise-polyfill';
2
+ // import 'isomorphic-fetch';
3
+ import { h, render } from 'preact';
4
+ import './style';
5
+
6
+ let root;
7
+ function DLM_LU_init() {
8
+ let App = require('./components/app').default;
9
+ root = render(<App />, document.getElementById("dlm-legacy-upgrade-container"), root);
10
+ }
11
+
12
+ // in development, set up HMR:
13
+ if (module.hot) {
14
+ //require('preact/devtools'); // turn this on if you want to enable React DevTools!
15
+ module.hot.accept('./components/app', () => requestAnimationFrame(init) );
16
+ }
17
+
18
+ document.addEventListener("DOMContentLoaded", function(event) {
19
+ DLM_LU_init();
20
+ });
assets/js/legacy-upgrader/src/style/helpers.less CHANGED
@@ -1,20 +1,20 @@
1
- @import 'variables';
2
- @import 'mixins';
3
-
4
- .iconbefore( @glyph: "\f333" ) {
5
- font-family: dashicons !important;
6
- speak: none;
7
- font-weight: normal;
8
- font-variant: normal;
9
- text-transform: none;
10
- -webkit-font-smoothing: antialiased;
11
- -moz-osx-font-smoothing: grayscale;
12
- margin: 0 4px 0 0;
13
- content: @glyph;
14
- top: 1px;
15
- left: -1px;
16
- font-size: 1em;
17
- line-height: inherit;
18
- position: relative;
19
- vertical-align: top;
20
  }
1
+ @import 'variables';
2
+ @import 'mixins';
3
+
4
+ .iconbefore( @glyph: "\f333" ) {
5
+ font-family: dashicons !important;
6
+ speak: none;
7
+ font-weight: normal;
8
+ font-variant: normal;
9
+ text-transform: none;
10
+ -webkit-font-smoothing: antialiased;
11
+ -moz-osx-font-smoothing: grayscale;
12
+ margin: 0 4px 0 0;
13
+ content: @glyph;
14
+ top: 1px;
15
+ left: -1px;
16
+ font-size: 1em;
17
+ line-height: inherit;
18
+ position: relative;
19
+ vertical-align: top;
20
  }
assets/js/legacy-upgrader/src/style/index.less CHANGED
@@ -1,6 +1,6 @@
1
- @import 'helpers';
2
-
3
- #dlm_legacy_upgrader_app {
4
- height: 100%;
5
- box-sizing: border-box;
6
- }
1
+ @import 'helpers';
2
+
3
+ #dlm_legacy_upgrader_app {
4
+ height: 100%;
5
+ box-sizing: border-box;
6
+ }
assets/js/legacy-upgrader/src/style/mixins.less CHANGED
@@ -1,18 +1,18 @@
1
- .fill() {
2
- position: absolute;
3
- left: 0;
4
- top: 0;
5
- width: 100%;
6
- height: 100%;
7
- }
8
-
9
- .scroll() {
10
- overflow: auto;
11
- overflow-scrolling: touch;
12
-
13
- & > .inner {
14
- position: relative;
15
- transform: translateZ(0);
16
- overflow: hidden;
17
- }
18
- }
1
+ .fill() {
2
+ position: absolute;
3
+ left: 0;
4
+ top: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ }
8
+
9
+ .scroll() {
10
+ overflow: auto;
11
+ overflow-scrolling: touch;
12
+
13
+ & > .inner {
14
+ position: relative;
15
+ transform: translateZ(0);
16
+ overflow: hidden;
17
+ }
18
+ }
assets/js/legacy-upgrader/src/style/variables.less CHANGED
@@ -1,5 +1,5 @@
1
- @red: #F00;
2
- @blue: #00F;
3
- @white: #FFF;
4
- @gray: #999;
5
- @black: #000;
1
+ @red: #F00;
2
+ @blue: #00F;
3
+ @white: #FFF;
4
+ @gray: #999;
5
+ @black: #000;
assets/js/legacy-upgrader/webpack.config.babel.js CHANGED
@@ -1,184 +1,184 @@
1
- import webpack from 'webpack';
2
- import ExtractTextPlugin from 'extract-text-webpack-plugin';
3
- import HtmlWebpackPlugin from 'html-webpack-plugin';
4
- import autoprefixer from 'autoprefixer';
5
- import path from 'path';
6
- const ENV = process.env.NODE_ENV || 'development';
7
-
8
- const CSS_MAPS = ENV!=='production';
9
-
10
- module.exports = {
11
- context: path.resolve(__dirname, "src"),
12
- entry: './index.js',
13
-
14
- output: {
15
- path: path.resolve(__dirname, "build"),
16
- publicPath: '/',
17
- filename: 'bundle.js'
18
- },
19
-
20
- resolve: {
21
- extensions: ['.jsx', '.js', '.json', '.less'],
22
- modules: [
23
- path.resolve(__dirname, "src/lib"),
24
- path.resolve(__dirname, "node_modules"),
25
- 'node_modules'
26
- ],
27
- alias: {
28
- components: path.resolve(__dirname, "src/components"), // used for tests
29
- style: path.resolve(__dirname, "src/style"),
30
- 'react': 'preact-compat',
31
- 'react-dom': 'preact-compat'
32
- }
33
- },
34
-
35
- module: {
36
- rules: [
37
- {
38
- test: /\.jsx?$/,
39
- exclude: path.resolve(__dirname, 'src'),
40
- enforce: 'pre',
41
- use: 'source-map-loader'
42
- },
43
- {
44
- test: /\.jsx?$/,
45
- exclude: /node_modules/,
46
- use: 'babel-loader'
47
- },
48
- {
49
- // Transform our own .(less|css) files with PostCSS and CSS-modules
50
- test: /\.(less|css)$/,
51
- include: [path.resolve(__dirname, 'src/components')],
52
- use: ExtractTextPlugin.extract({
53
- fallback: 'style-loader',
54
- use: [
55
- {
56
- loader: 'css-loader',
57
- options: { modules: true, sourceMap: CSS_MAPS, importLoaders: 1, minimize: true }
58
- },
59
- {
60
- loader: `postcss-loader`,
61
- options: {
62
- sourceMap: CSS_MAPS,
63
- plugins: () => {
64
- autoprefixer({ browsers: [ 'last 2 versions' ] });
65
- }
66
- }
67
- },
68
- {
69
- loader: 'less-loader',
70
- options: { sourceMap: CSS_MAPS }
71
- }
72
- ]
73
- })
74
- },
75
- {
76
- test: /\.(less|css)$/,
77
- exclude: [path.resolve(__dirname, 'src/components')],
78
- use: ExtractTextPlugin.extract({
79
- fallback: 'style-loader',
80
- use: [
81
- {
82
- loader: 'css-loader',
83
- options: { sourceMap: CSS_MAPS, importLoaders: 1, minimize: true }
84
- },
85
- {
86
- loader: `postcss-loader`,
87
- options: {
88
- sourceMap: CSS_MAPS,
89
- plugins: () => {
90
- autoprefixer({ browsers: [ 'last 2 versions' ] });
91
- }
92
- }
93
- },
94
- {
95
- loader: 'less-loader',
96
- options: { sourceMap: CSS_MAPS }
97
- }
98
- ]
99
- })
100
- },
101
- {
102
- test: /\.json$/,
103
- use: 'json-loader'
104
- },
105
- {
106
- test: /\.(xml|html|txt|md)$/,
107
- use: 'raw-loader'
108
- },
109
- {
110
- test: /\.(svg|woff2?|ttf|eot|jpe?g|png|gif)(\?.*)?$/i,
111
- use: ENV==='production' ? 'file-loader' : 'url-loader'
112
- }
113
- ]
114
- },
115
- plugins: ([
116
- new webpack.NoEmitOnErrorsPlugin(),
117
- new ExtractTextPlugin({
118
- filename: 'style.css',
119
- allChunks: true,
120
- disable: ENV !== 'production'
121
- }),
122
- new webpack.DefinePlugin({
123
- 'process.env.NODE_ENV': JSON.stringify(ENV)
124
- }),
125
- new HtmlWebpackPlugin({
126
- template: './index.ejs',
127
- minify: { collapseWhitespace: true }
128
- })
129
- ]).concat(ENV==='production' ? [
130
- new webpack.optimize.UglifyJsPlugin({
131
- output: {
132
- comments: false
133
- },
134
- compress: {
135
- unsafe_comps: true,
136
- properties: true,
137
- keep_fargs: false,
138
- pure_getters: true,
139
- collapse_vars: true,
140
- unsafe: true,
141
- warnings: false,
142
- screw_ie8: true,
143
- sequences: true,
144
- dead_code: true,
145
- drop_debugger: true,
146
- comparisons: true,
147
- conditionals: true,
148
- evaluate: true,
149
- booleans: true,
150
- loops: true,
151
- unused: true,
152
- hoist_funs: true,
153
- if_return: true,
154
- join_vars: true,
155
- cascade: true,
156
- drop_console: true
157
- }
158
- })
159
- ] : []),
160
-
161
- stats: { colors: true },
162
-
163
- node: {
164
- global: true,
165
- process: false,
166
- Buffer: false,
167
- __filename: false,
168
- __dirname: false,
169
- setImmediate: false
170
- },
171
-
172
- devtool: ENV==='production' ? 'source-map' : 'cheap-module-eval-source-map',
173
-
174
- devServer: {
175
- inline: true,
176
- port: 1337,
177
- host: 'lnmp.dev',
178
- publicPath: '/',
179
- contentBase: './src',
180
- historyApiFallback: true,
181
- open: true,
182
- openPage: ''
183
- }
184
- };
1
+ import webpack from 'webpack';
2
+ import ExtractTextPlugin from 'extract-text-webpack-plugin';
3
+ import HtmlWebpackPlugin from 'html-webpack-plugin';
4
+ import autoprefixer from 'autoprefixer';
5
+ import path from 'path';
6
+ const ENV = process.env.NODE_ENV || 'development';
7
+
8
+ const CSS_MAPS = ENV!=='production';
9
+
10
+ module.exports = {
11
+ context: path.resolve(__dirname, "src"),
12
+ entry: './index.js',
13
+
14
+ output: {
15
+ path: path.resolve(__dirname, "build"),
16
+ publicPath: '/',
17
+ filename: 'bundle.js'
18
+ },
19
+
20
+ resolve: {
21
+ extensions: ['.jsx', '.js', '.json', '.less'],
22
+ modules: [
23
+ path.resolve(__dirname, "src/lib"),
24
+ path.resolve(__dirname, "node_modules"),
25
+ 'node_modules'
26
+ ],
27
+ alias: {
28
+ components: path.resolve(__dirname, "src/components"), // used for tests
29
+ style: path.resolve(__dirname, "src/style"),
30
+ 'react': 'preact-compat',
31
+ 'react-dom': 'preact-compat'
32
+ }
33
+ },
34
+
35
+ module: {
36
+ rules: [
37
+ {
38
+ test: /\.jsx?$/,
39
+ exclude: path.resolve(__dirname, 'src'),
40
+ enforce: 'pre',
41
+ use: 'source-map-loader'
42
+ },
43
+ {
44
+ test: /\.jsx?$/,
45
+ exclude: /node_modules/,
46
+ use: 'babel-loader'
47
+ },
48
+ {
49
+ // Transform our own .(less|css) files with PostCSS and CSS-modules
50
+ test: /\.(less|css)$/,
51
+ include: [path.resolve(__dirname, 'src/components')],
52
+ use: ExtractTextPlugin.extract({
53
+ fallback: 'style-loader',
54
+ use: [
55
+ {
56
+ loader: 'css-loader',
57
+ options: { modules: true, sourceMap: CSS_MAPS, importLoaders: 1, minimize: true }
58
+ },
59
+ {
60
+ loader: `postcss-loader`,
61
+ options: {
62
+ sourceMap: CSS_MAPS,
63
+ plugins: () => {
64
+ autoprefixer({ browsers: [ 'last 2 versions' ] });
65
+ }
66
+ }
67
+ },
68
+ {
69
+ loader: 'less-loader',
70
+ options: { sourceMap: CSS_MAPS }
71
+ }
72
+ ]
73
+ })
74
+ },
75
+ {
76
+ test: /\.(less|css)$/,
77
+ exclude: [path.resolve(__dirname, 'src/components')],
78
+ use: ExtractTextPlugin.extract({
79
+ fallback: 'style-loader',
80
+ use: [
81
+ {
82
+ loader: 'css-loader',
83
+ options: { sourceMap: CSS_MAPS, importLoaders: 1, minimize: true }
84
+ },
85
+ {
86
+ loader: `postcss-loader`,
87
+ options: {
88
+ sourceMap: CSS_MAPS,
89
+ plugins: () => {
90
+ autoprefixer({ browsers: [ 'last 2 versions' ] });
91
+ }
92
+ }
93
+ },
94
+ {
95
+ loader: 'less-loader',
96
+ options: { sourceMap: CSS_MAPS }
97
+ }
98
+ ]
99
+ })
100
+ },
101
+ {
102
+ test: /\.json$/,
103
+ use: 'json-loader'
104
+ },
105
+ {
106
+ test: /\.(xml|html|txt|md)$/,
107
+ use: 'raw-loader'
108
+ },
109
+ {
110
+ test: /\.(svg|woff2?|ttf|eot|jpe?g|png|gif)(\?.*)?$/i,
111
+ use: ENV==='production' ? 'file-loader' : 'url-loader'
112
+ }
113
+ ]
114
+ },
115
+ plugins: ([
116
+ new webpack.NoEmitOnErrorsPlugin(),
117
+ new ExtractTextPlugin({
118
+ filename: 'style.css',
119
+ allChunks: true,
120
+ disable: ENV !== 'production'
121
+ }),
122
+ new webpack.DefinePlugin({
123
+ 'process.env.NODE_ENV': JSON.stringify(ENV)
124
+ }),
125
+ new HtmlWebpackPlugin({
126
+ template: './index.ejs',
127
+ minify: { collapseWhitespace: true }
128
+ })
129
+ ]).concat(ENV==='production' ? [
130
+ new webpack.optimize.UglifyJsPlugin({
131
+ output: {
132
+ comments: false
133
+ },
134
+ compress: {
135
+ unsafe_comps: true,
136
+ properties: true,
137
+ keep_fargs: false,
138
+ pure_getters: true,
139
+ collapse_vars: true,
140
+ unsafe: true,
141
+ warnings: false,
142
+ screw_ie8: true,
143
+ sequences: true,
144
+ dead_code: true,
145
+ drop_debugger: true,
146
+ comparisons: true,
147
+ conditionals: true,
148
+ evaluate: true,
149
+ booleans: true,
150
+ loops: true,
151
+ unused: true,
152
+ hoist_funs: true,
153
+ if_return: true,
154
+ join_vars: true,
155
+ cascade: true,
156
+ drop_console: true
157
+ }
158
+ })
159
+ ] : []),
160
+
161
+ stats: { colors: true },
162
+
163
+ node: {
164
+ global: true,
165
+ process: false,
166
+ Buffer: false,
167
+ __filename: false,
168
+ __dirname: false,
169
+ setImmediate: false
170
+ },
171
+
172
+ devtool: ENV==='production' ? 'source-map' : 'cheap-module-eval-source-map',
173
+
174
+ devServer: {
175
+ inline: true,
176
+ port: 1337,
177
+ host: 'lnmp.dev',
178
+ publicPath: '/',
179
+ contentBase: './src',
180
+ historyApiFallback: true,
181
+ open: true,
182
+ openPage: ''
183
+ }
184
+ };
assets/js/notices.js CHANGED
@@ -1,21 +1,21 @@
1
- jQuery( function ( $ ) {
2
-
3
- $( '.dlm-notice.is-dismissible' ).on( 'click', '.notice-dismiss', function ( event ) {
4
- //$( '#dlm-ajax-nonce' ).val()
5
- var notice_el = $( this ).closest( '.dlm-notice' );
6
-
7
- var notice = notice_el.attr( 'id' );
8
- var notice_nonce = notice_el.attr( 'data-nonce' );
9
- $.post(
10
- ajaxurl,
11
- {
12
- action: 'dlm_dismiss_notice',
13
- nonce: notice_nonce,
14
- notice: notice
15
- },
16
- function ( response ) {
17
- }
18
- )
19
- } );
20
-
21
  } );
1
+ jQuery( function ( $ ) {
2
+
3
+ $( '.dlm-notice.is-dismissible' ).on( 'click', '.notice-dismiss', function ( event ) {
4
+ //$( '#dlm-ajax-nonce' ).val()
5
+ var notice_el = $( this ).closest( '.dlm-notice' );
6
+
7
+ var notice = notice_el.attr( 'id' );
8
+ var notice_nonce = notice_el.attr( 'data-nonce' );
9
+ $.post(
10
+ ajaxurl,
11
+ {
12
+ action: 'dlm_dismiss_notice',
13
+ nonce: notice_nonce,
14
+ notice: notice
15
+ },
16
+ function ( response ) {
17
+ }
18
+ )
19
+ } );
20
+
21
  } );
assets/js/onboarding.js CHANGED
@@ -1,70 +1,70 @@
1
- jQuery( function ( $ ) {
2
-
3
- $.each( $( '.dlm-create-page' ), function ( k, v ) {
4
- new DLM_Onboarding_CP( v );
5
- } );
6
-
7
- /*
8
- $('.dlm-create-page').click(function() {
9
-
10
- var page = $(this).data('page');
11
-
12
- $(this).html(dlm_onboarding.lbl_creating);
13
-
14
- // set loading
15
-
16
- // do ajax request
17
-
18
- // check response
19
-
20
- // if success, change button to green with checkmark
21
-
22
- });
23
- */
24
- } );
25
-
26
- var DLM_Onboarding_CP = function ( el ) {
27
- this.el = el;
28
- this.page = jQuery( el ).data( 'page' );
29
- this.allowAction = true;
30
- this.setup();
31
- };
32
-
33
- DLM_Onboarding_CP.prototype.setup = function () {
34
- var instance = this;
35
- jQuery( this.el ).click( function () {
36
- instance.process();
37
- } );
38
- };
39
-
40
- DLM_Onboarding_CP.prototype.process = function () {
41
- if ( !this.allowAction ) {
42
- return false;
43
- }
44
-
45
- this.allowAction = false;
46
-
47
- var instance = this;
48
-
49
- jQuery( instance.el ).html( dlm_onboarding.lbl_creating );
50
-
51
- jQuery.get( dlm_onboarding.ajax_url_create_page, {
52
- page: this.page
53
- }, function ( response ) {
54
- if ( response.result === 'success' ) {
55
- jQuery( instance.el ).html( dlm_onboarding.lbl_created );
56
- jQuery( instance.el ).removeClass( 'dlm-create-page' ).addClass( 'dlm-page-exists' );
57
- } else {
58
- jQuery( instance.el ).html( dlm_onboarding.lbl_create_page );
59
-
60
- if ( typeof response.error !== 'undefined' ) {
61
- alert( response.error );
62
- }
63
-
64
- instance.allowAction = true;
65
- }
66
-
67
- console.log( response );
68
- } );
69
-
70
  };
1
+ jQuery( function ( $ ) {
2
+
3
+ $.each( $( '.dlm-create-page' ), function ( k, v ) {
4
+ new DLM_Onboarding_CP( v );
5
+ } );
6
+
7
+ /*
8
+ $('.dlm-create-page').click(function() {
9
+
10
+ var page = $(this).data('page');
11
+
12
+ $(this).html(dlm_onboarding.lbl_creating);
13
+
14
+ // set loading
15
+
16
+ // do ajax request
17
+
18
+ // check response
19
+
20
+ // if success, change button to green with checkmark
21
+
22
+ });
23
+ */
24
+ } );
25
+
26
+ var DLM_Onboarding_CP = function ( el ) {
27
+ this.el = el;
28
+ this.page = jQuery( el ).data( 'page' );
29
+ this.allowAction = true;
30
+ this.setup();
31
+ };
32
+
33
+ DLM_Onboarding_CP.prototype.setup = function () {
34
+ var instance = this;
35
+ jQuery( this.el ).click( function () {
36
+ instance.process();
37
+ } );
38
+ };
39
+
40
+ DLM_Onboarding_CP.prototype.process = function () {
41
+ if ( !this.allowAction ) {
42
+ return false;
43
+ }
44
+
45
+ this.allowAction = false;
46
+
47
+ var instance = this;
48
+
49
+ jQuery( instance.el ).html( dlm_onboarding.lbl_creating );
50
+
51
+ jQuery.get( dlm_onboarding.ajax_url_create_page, {
52
+ page: this.page
53
+ }, function ( response ) {
54
+ if ( response.result === 'success' ) {
55
+ jQuery( instance.el ).html( dlm_onboarding.lbl_created );
56
+ jQuery( instance.el ).removeClass( 'dlm-create-page' ).addClass( 'dlm-page-exists' );
57
+ } else {
58
+ jQuery( instance.el ).html( dlm_onboarding.lbl_create_page );
59
+
60
+ if ( typeof response.error !== 'undefined' ) {
61
+ alert( response.error );
62
+ }
63
+
64
+ instance.allowAction = true;
65
+ }
66
+
67
+ console.log( response );
68
+ } );
69
+
70
  };
assets/js/select2/select2.min.css CHANGED
@@ -1 +1 @@
1
- .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
1
+ .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
assets/js/shop/admin-order-details.js CHANGED
@@ -1,46 +1,46 @@
1
- jQuery( function ( $ ) {
2
-
3
- function handleChangeOrderAction() {
4
- var button = $("#dlm-order-details-button-change-state");
5
- var ogLbl = button.html();
6
- var isWorking = false;
7
- var successBlock = null;
8
-
9
- button.click(function(){
10
- if(isWorking) {
11
- return;
12
- }
13
- isWorking = true;
14
- button.html('...');
15
-
16
- var new_status = $("#dlm-order-details-current-state").val();
17
-
18
- $.post( dlm_strings.ajax_url_change_order_status, {
19
- status: new_status,
20
- order_id: dlm_strings.order_id
21
- }, function ( response ) {
22
- if ( response.success === true ) {
23
- button.html(ogLbl);
24
- isWorking = false;
25
- if(successBlock === null) {
26
- successBlock = $("<span>").addClass("dlm-order-details-update-successful").html("✓");
27
- button.parent().append(successBlock);
28
- setTimeout(
29
- function() {
30
- successBlock.fadeOut(300, function(){
31
- successBlock.remove();
32
- successBlock = null;
33
- });
34
- }, 300
35
- );
36
- }
37
-
38
- }
39
- } );
40
-
41
- });
42
- }
43
-
44
- handleChangeOrderAction();
45
-
46
  } );
1
+ jQuery( function ( $ ) {
2
+
3
+ function handleChangeOrderAction() {
4
+ var button = $("#dlm-order-details-button-change-state");
5
+ var ogLbl = button.html();
6
+ var isWorking = false;
7
+ var successBlock = null;
8
+
9
+ button.click(function(){
10
+ if(isWorking) {
11
+ return;
12
+ }
13
+ isWorking = true;
14
+ button.html('...');
15
+
16
+ var new_status = $("#dlm-order-details-current-state").val();
17
+
18
+ $.post( dlm_strings.ajax_url_change_order_status, {
19
+ status: new_status,
20
+ order_id: dlm_strings.order_id
21
+ }, function ( response ) {
22
+ if ( response.success === true ) {
23
+ button.html(ogLbl);
24
+ isWorking = false;
25
+ if(successBlock === null) {
26
+ successBlock = $("<span>").addClass("dlm-order-details-update-successful").html("✓");
27
+ button.parent().append(successBlock);
28
+ setTimeout(
29
+ function() {
30
+ successBlock.fadeOut(300, function(){
31
+ successBlock.remove();
32
+ successBlock = null;
33
+ });
34
+ }, 300
35
+ );
36
+ }
37
+
38
+ }
39
+ } );
40
+
41
+ });
42
+ }
43
+
44
+ handleChangeOrderAction();
45
+
46
  } );
assets/js/shop/checkout.js CHANGED
@@ -1,127 +1,127 @@
1
- jQuery( function ( $ ) {
2
-
3
- $( '#dlm-form-checkout' ).submit( function ( e ) {
4
-
5
- var form = $( this );
6
-
7
- dlmShopResetErrorFields( form );
8
- dlmShopRemoveErrors( form );
9
-
10
- dlmShopShowLoading( form );
11
-
12
- var customer = {
13
- first_name: form.find( '#dlm_first_name' ).val(),
14
- last_name: form.find( '#dlm_last_name' ).val(),
15
- company: form.find( '#dlm_company' ).val(),
16
- email: form.find( '#dlm_email' ).val(),
17
- address_1: form.find( '#dlm_address_1' ).val(),
18
- postcode: form.find( '#dlm_postcode' ).val(),
19
- city: form.find( '#dlm_city' ).val(),
20
- country: form.find( '#dlm_country' ).val(),
21
- };
22
-
23
- var data = {
24
- payment_gateway: $( 'input[name=dlm_gateway]:checked', $( this ) ).val(),
25
- customer: customer
26
- };
27
-
28
- if ( typeof form.data( 'order_id' ) !== "undefined" ) {
29
- data.order_id = form.data( 'order_id' );
30
- }
31
-
32
- if ( typeof form.data( 'order_hash' ) !== "undefined" ) {
33
- data.order_hash = form.data( 'order_hash' );
34
- }
35
-
36
- // check if required data is set
37
- var errorFields = [];
38
- var success = true;
39
- for ( var i = 0; i < dlm_strings.required_fields.length; i ++ ) {
40
-
41
- if ( customer[dlm_strings.required_fields[i]] === "" ) {
42
- success = false;
43
- errorFields.push( dlm_strings.required_fields[i] );
44
- }
45
- }
46
-
47
- if ( success === false ) {
48
- dlmShopMarkErrorFields( form, errorFields );
49
-
50
- dlmShopDisplayError( form, dlm_strings.error_message_required_fields );
51
-
52
- dlmShopHideLoading( form );
53
- return false;
54
- }
55
-
56
- $.post( dlm_strings.ajax_url_place_order, data, function ( response ) {
57
- if ( response.success === true && typeof response.redirect !== 'undefined' ) {
58
- window.location.replace( response.redirect );
59
- return false;
60
- } else if ( response.success === false && response.error !== '' ) {
61
- dlmShopDisplayError( form, response.error );
62
- }
63
- dlmShopHideLoading( form );
64
- } );
65
-
66
- return false;
67
- } );
68
-
69
- function dlmShopMarkErrorFields( form, fields ) {
70
- for ( var i = 0; i < fields.length; i ++ ) {
71
- $( form ).find( '#dlm_' + fields[i] ).addClass( 'dlm-checkout-field-error' );
72
- }
73
- }
74
-
75
- function dlmShopResetErrorFields( form ) {
76
- $( form ).find( '.dlm-checkout-field-error' ).removeClass( 'dlm-checkout-field-error' );
77
- }
78
-
79
- function dlmShopDisplayError( form, errorMessage ) {
80
- var errorContainer = $( '<div>' ).addClass( "dlm-checkout-error" );
81
- errorContainer.append( $( '<img>' ).attr( 'src', dlm_strings.icon_error ).attr( 'alt', 'Checkout error' ).addClass( 'dlm-checkout-error-icon' ) );
82
- errorContainer.append( $( '<p>' ).html( errorMessage ) );
83
- form.prepend( errorContainer );
84
- }
85
-
86
- function dlmShopRemoveErrors( form ) {
87
- form.find( '.dlm-checkout-error' ).remove();
88
- }
89
-
90
- function dlmShopShowLoading( form ) {
91
- $( form ).find( '#dlm_checkout_submit' ).attr( 'disabled', true );
92
-
93
- var overlayBg = $( '<div>' ).addClass( 'dlm-checkout-overlay-bg' );
94
-
95
- var overlay = $( '<div>' ).addClass( 'dlm-checkout-overlay' );
96
- overlay.append( $( '<h2>' ).html( dlm_strings.overlay_title ) );
97
- overlay.append( $( '<span>' ).html( dlm_strings.overlay_body ) );
98
- overlay.append( $( '<img>' ).attr( 'src', dlm_strings.overlay_img_src ) );
99
-
100
- $( 'body' ).append( overlayBg );
101
- $( 'body' ).append( overlay );
102
-
103
- overlayBg.fadeIn( 300, function () {
104
- overlay.css( 'display', 'block' ).css( 'top', '47%' );
105
- overlay.animate( {
106
- "top": "+=3%"
107
- }, 300 );
108
- } );
109
- }
110
-
111
- function dlmShopHideLoading( form ) {
112
-
113
- var overlay = $( '.dlm-checkout-overlay:first' );
114
- var overlayBg = $( '.dlm-checkout-overlay-bg:first' );
115
-
116
- overlay.fadeOut( 300, function () {
117
- overlay.remove();
118
- } );
119
-
120
- overlayBg.fadeOut( 300, function () {
121
- overlayBg.remove();
122
- $( form ).find( '#dlm_checkout_submit' ).attr( 'disabled', false );
123
- } );
124
- }
125
- } );
126
-
127
-
1
+ jQuery( function ( $ ) {
2
+
3
+ $( '#dlm-form-checkout' ).submit( function ( e ) {
4
+
5
+ var form = $( this );
6
+
7
+ dlmShopResetErrorFields( form );
8
+ dlmShopRemoveErrors( form );
9
+
10
+ dlmShopShowLoading( form );
11
+
12
+ var customer = {
13
+ first_name: form.find( '#dlm_first_name' ).val(),
14
+ last_name: form.find( '#dlm_last_name' ).val(),
15
+ company: form.find( '#dlm_company' ).val(),
16
+ email: form.find( '#dlm_email' ).val(),
17
+ address_1: form.find( '#dlm_address_1' ).val(),
18
+ postcode: form.find( '#dlm_postcode' ).val(),
19
+ city: form.find( '#dlm_city' ).val(),
20
+ country: form.find( '#dlm_country' ).val(),
21
+ };
22
+
23
+ var data = {
24
+ payment_gateway: $( 'input[name=dlm_gateway]:checked', $( this ) ).val(),
25
+ customer: customer
26
+ };
27
+
28
+ if ( typeof form.data( 'order_id' ) !== "undefined" ) {
29
+ data.order_id = form.data( 'order_id' );
30
+ }
31
+
32
+ if ( typeof form.data( 'order_hash' ) !== "undefined" ) {
33
+ data.order_hash = form.data( 'order_hash' );
34
+ }
35
+
36
+ // check if required data is set
37
+ var errorFields = [];
38
+ var success = true;
39
+ for ( var i = 0; i < dlm_strings.required_fields.length; i ++ ) {
40
+
41
+ if ( customer[dlm_strings.required_fields[i]] === "" ) {
42
+ success = false;
43
+ errorFields.push( dlm_strings.required_fields[i] );
44
+ }
45
+ }
46
+
47
+ if ( success === false ) {
48
+ dlmShopMarkErrorFields( form, errorFields );
49
+
50
+ dlmShopDisplayError( form, dlm_strings.error_message_required_fields );
51
+
52
+ dlmShopHideLoading( form );
53
+ return false;
54
+ }
55
+
56
+ $.post( dlm_strings.ajax_url_place_order, data, function ( response ) {
57
+ if ( response.success === true && typeof response.redirect !== 'undefined' ) {
58
+ window.location.replace( response.redirect );
59
+ return false;
60
+ } else if ( response.success === false && response.error !== '' ) {
61
+ dlmShopDisplayError( form, response.error );
62
+ }
63
+ dlmShopHideLoading( form );
64
+ } );
65
+
66
+ return false;
67
+ } );
68
+
69
+ function dlmShopMarkErrorFields( form, fields ) {
70
+ for ( var i = 0; i < fields.length; i ++ ) {
71
+ $( form ).find( '#dlm_' + fields[i] ).addClass( 'dlm-checkout-field-error' );
72
+ }
73
+ }
74
+
75
+ function dlmShopResetErrorFields( form ) {
76
+ $( form ).find( '.dlm-checkout-field-error' ).removeClass( 'dlm-checkout-field-error' );
77
+ }
78
+
79
+ function dlmShopDisplayError( form, errorMessage ) {
80
+ var errorContainer = $( '<div>' ).addClass( "dlm-checkout-error" );
81
+ errorContainer.append( $( '<img>' ).attr( 'src', dlm_strings.icon_error ).attr( 'alt', 'Checkout error' ).addClass( 'dlm-checkout-error-icon' ) );
82
+ errorContainer.append( $( '<p>' ).html( errorMessage ) );
83
+ form.prepend( errorContainer );
84
+ }
85
+
86
+ function dlmShopRemoveErrors( form ) {
87
+ form.find( '.dlm-checkout-error' ).remove();
88
+ }
89
+
90
+ function dlmShopShowLoading( form ) {
91
+ $( form ).find( '#dlm_checkout_submit' ).attr( 'disabled', true );
92
+
93
+ var overlayBg = $( '<div>' ).addClass( 'dlm-checkout-overlay-bg' );
94
+
95
+ var overlay = $( '<div>' ).addClass( 'dlm-checkout-overlay' );
96
+ overlay.append( $( '<h2>' ).html( dlm_strings.overlay_title ) );
97
+ overlay.append( $( '<span>' ).html( dlm_strings.overlay_body ) );
98
+ overlay.append( $( '<img>' ).attr( 'src', dlm_strings.overlay_img_src ) );
99
+
100
+ $( 'body' ).append( overlayBg );
101
+ $( 'body' ).append( overlay );
102
+
103
+ overlayBg.fadeIn( 300, function () {
104
+ overlay.css( 'display', 'block' ).css( 'top', '47%' );
105
+ overlay.animate( {
106
+ "top": "+=3%"
107
+ }, 300 );
108
+ } );
109
+ }
110
+
111
+ function dlmShopHideLoading( form ) {
112
+
113
+ var overlay = $( '.dlm-checkout-overlay:first' );
114
+ var overlayBg = $( '.dlm-checkout-overlay-bg:first' );
115
+
116
+ overlay.fadeOut( 300, function () {
117
+ overlay.remove();
118
+ } );
119
+
120
+ overlayBg.fadeOut( 300, function () {
121
+ overlayBg.remove();
122
+ $( form ).find( '#dlm_checkout_submit' ).attr( 'disabled', false );
123
+ } );
124
+ }
125
+ } );
126
+
127
+
assets/views/notice-lu-upgrade.php CHANGED
@@ -1,12 +1,12 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
- ?>
6
- <div class="dlm-lu-upgrade-notice">
7
- <h3><?php echo esc_html__('It looks like you upgraded to the latest version of Download Monitor from a legacy version (3.x)', 'download-monitor' ); ?></h3>
8
- <p><?php printf( esc_html__( "Currently your downloads don't work like they should, we need to %s before they'll work again.", 'download-monitor' ), sprintf( '<strong>%s</strong>', esc_html__( 'upgrade your downloads', 'download-monitor' ) ) ); ?></p>
9
- <p><?php printf( esc_html__( "We've created an upgrading tool that will do all the work for you. You can read more about this tool on %sour website (click here)%s or start the upgrade now.", 'download-monitor'), '<a href="https://www.download-monitor.com/kb/legacy-upgrade?utm_source=plugin&utm_medium=dlm-lu-upgrade-notice&utm_campaign=dlm-lu-more-information" target="_blank">', '</a>' ); ?></p>
10
- <a href="<?php echo esc_url( admin_url( 'options.php?page=dlm_legacy_upgrade' ) ); ?>" class="button"><?php echo esc_html__( 'Take me to the Upgrade Tool', 'download-monitor' ); ?></a>
11
- <a href="<?php echo esc_url( admin_url( 'edit.php?post_type=dlm_download&dlm_lu_hide_notice=1' ) ); ?>" class="dlm-lu-upgrade-notice-hide"><?php echo esc_html__( 'hide notice', 'download-monitor' ); ?></a>
12
- </div>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+ ?>
6
+ <div class="dlm-lu-upgrade-notice">
7
+ <h3><?php echo esc_html__('It looks like you upgraded to the latest version of Download Monitor from a legacy version (3.x)', 'download-monitor' ); ?></h3>
8
+ <p><?php printf( esc_html__( "Currently your downloads don't work like they should, we need to %s before they'll work again.", 'download-monitor' ), sprintf( '<strong>%s</strong>', esc_html__( 'upgrade your downloads', 'download-monitor' ) ) ); ?></p>
9
+ <p><?php printf( esc_html__( "We've created an upgrading tool that will do all the work for you. You can read more about this tool on %sour website (click here)%s or start the upgrade now.", 'download-monitor'), '<a href="https://www.download-monitor.com/kb/legacy-upgrade?utm_source=plugin&utm_medium=dlm-lu-upgrade-notice&utm_campaign=dlm-lu-more-information" target="_blank">', '</a>' ); ?></p>
10
+ <a href="<?php echo esc_url( admin_url( 'options.php?page=dlm_legacy_upgrade' ) ); ?>" class="button"><?php echo esc_html__( 'Take me to the Upgrade Tool', 'download-monitor' ); ?></a>
11
+ <a href="<?php echo esc_url( admin_url( 'edit.php?post_type=dlm_download&dlm_lu_hide_notice=1' ) ); ?>" class="dlm-lu-upgrade-notice-hide"><?php echo esc_html__( 'hide notice', 'download-monitor' ); ?></a>
12
+ </div>
changelog.txt CHANGED
@@ -1,5 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
1
  = 4.5.92 - 11.04.2022 =
2
  Fixed: Missing Files/Access denied for users with out of root wp-content ( https://github.com/WPChill/download-monitor/issues/888 )
 
3
 
4
  = 4.5.91 - 05.04.2022 =
5
  Fixed: Error when checking for robots.txt file ( https://github.com/WPChill/download-monitor/issues/883 )
1
+ = 4.5.93 - 25.05.2022 =
2
+ Fixed: Robots.txt check on all pages ( https://github.com/WPChill/download-monitor/issues/937 )
3
+ Added: "No file provided" notification in download admin listing for "empty" downloads ( https://github.com/WPChill/download-monitor/issues/887 )
4
+ Added: Product ID in admin DLM products listing ( https://github.com/WPChill/download-monitor/issues/885 )
5
+ Fixed: Downloads hanging at 99% in multi-threaded mode ( https://github.com/WPChill/download-monitor/issues/816 )
6
+ Fixed: Critical error on quick-editing a Download/Product ( https://github.com/WPChill/download-monitor/issues/906 )
7
+ Changed: Onboarding page ( https://github.com/WPChill/download-monitor/issues/820 )
8
+ Changed: Partition the Download Monitor's menu into groups ( https://github.com/WPChill/download-monitor/issues/776 )
9
+ Fixed: the_title filter too few arguments ( https://github.com/WPChill/download-monitor/issues/908 )
10
+ Added: Notice for BETA testers ( https://github.com/WPChill/download-monitor/issues/951 )
11
+
12
  = 4.5.92 - 11.04.2022 =
13
  Fixed: Missing Files/Access denied for users with out of root wp-content ( https://github.com/WPChill/download-monitor/issues/888 )
14
+ Added: New setting for out of root/uploads directory for files to be downloaded
15
 
16
  = 4.5.91 - 05.04.2022 =
17
  Fixed: Error when checking for robots.txt file ( https://github.com/WPChill/download-monitor/issues/883 )
download-monitor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Download Monitor
4
  Plugin URI: https://www.download-monitor.com
5
  Description: A full solution for managing and selling downloadable files, monitoring downloads and outputting download links and file information on your WordPress powered site.
6
- Version: 4.5.92
7
  Author: WPChill
8
  Author URI: https://wpchill.com
9
  Requires at least: 5.4
@@ -33,7 +33,7 @@ if ( ! defined( 'ABSPATH' ) ) {
33
  } // Exit if accessed directly
34
 
35
  // Define DLM Version
36
- define( 'DLM_VERSION', '4.5.92' );
37
 
38
  // Define DLM FILE
39
  define( 'DLM_PLUGIN_FILE', __FILE__ );
@@ -58,6 +58,10 @@ if( ! class_exists( 'DLM_Review') && is_admin() ) {
58
  require_once dirname( __FILE__ ) . '/includes/admin/class-dlm-review.php';
59
  }
60
 
 
 
 
 
61
  if( ! function_exists( 'download_monitor_start_plugin_tracking' ) ) {
62
  function download_monitor_start_plugin_tracking() {
63
  $wisdom = new Download_Monitor_Usage_Tracker(
3
  Plugin Name: Download Monitor
4
  Plugin URI: https://www.download-monitor.com
5
  Description: A full solution for managing and selling downloadable files, monitoring downloads and outputting download links and file information on your WordPress powered site.
6
+ Version: 4.5.93
7
  Author: WPChill
8
  Author URI: https://wpchill.com
9
  Requires at least: 5.4
33
  } // Exit if accessed directly
34
 
35
  // Define DLM Version
36
+ define( 'DLM_VERSION', '4.5.93' );
37
 
38
  // Define DLM FILE
39
  define( 'DLM_PLUGIN_FILE', __FILE__ );
58
  require_once dirname( __FILE__ ) . '/includes/admin/class-dlm-review.php';
59
  }
60
 
61
+ if( ! class_exists( 'DLM_Beta_Testers') && is_admin() ) {
62
+ require_once dirname( __FILE__ ) . '/includes/admin/class-dlm-beta-testers.php';
63
+ }
64
+
65
  if( ! function_exists( 'download_monitor_start_plugin_tracking' ) ) {
66
  function download_monitor_start_plugin_tracking() {
67
  $wisdom = new Download_Monitor_Usage_Tracker(
includes/admin/class-dlm-beta-testers.php ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * DLM_Beta_Testers - Used to display a notice for BETA testers need
4
+ *
5
+ * @since 4.5.93
6
+ */
7
+ class DLM_Beta_Testers {
8
+
9
+ private $messages;
10
+ private $link;
11
+ private $contact;
12
+
13
+ /**
14
+ * Class constructor
15
+ */
16
+ public function __construct() {
17
+
18
+ $this->messages = array(
19
+ 'headling' => esc_html__( 'Download Monitor - BETA testers - needed!', 'download-monitor' ),
20
+ 'notice' => __( "<p> We've been working (hard!) on Download Monitor 4.6.0 which comes with a ton of improvements. We need hlep testing it out to make sure we don't break anything.</p><p> Just click on this link %1\$s, download and install Download Monitor 4.6.0 and test for issues. Please report any issue found back to us via: %2\$s.</p>", 'download-monitor' ),
21
+ 'changelog_title' => esc_html__( 'New features in this version:', 'download-monitor' ),
22
+ 'changelog' => array(
23
+ 'custom tables for Reports (should be blazing fast now)',
24
+ 'new way to handle downloads (we\'re using a browser-native way of handling downloads vs doing it via htaccess / nginx rules)',
25
+ 'a LOT of smaller bug fixes under the hood',
26
+ ),
27
+ );
28
+
29
+ $this->link = '<a target="_BLANK" href="https://downloads.wordpress.org/plugin/download-monitor.zip">' . esc_html( 'here', 'download-monitor' ) . '</a>';
30
+ $this->contact = '<a target="_BLANK" href="https://www.download-monitor.com/contact/">' . esc_html( 'contact us form', 'download-monitor' ) . '</a>';
31
+
32
+ add_action( 'init', array( $this, 'init' ) );
33
+
34
+ }
35
+
36
+ /**
37
+ * Init
38
+ *
39
+ * @since 4.5.93
40
+ */
41
+ public function init() {
42
+
43
+ if ( ! is_admin() ) {
44
+ return;
45
+ }
46
+
47
+ add_action( 'wp_ajax_download-monitor_beta_test_notice_dismiss', array( $this, 'ajax' ) );
48
+ add_action( 'admin_notices', array( $this, 'beta_testers_needed_notice' ) );
49
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
50
+ add_action( 'admin_print_footer_scripts', array( $this, 'ajax_script' ) );
51
+ add_filter( 'dlm_uninstall_db_options', array( $this, 'uninstall_options' ) );
52
+
53
+ }
54
+
55
+ /**
56
+ * BETA testers notice
57
+ *
58
+ * @since 4.5.93
59
+ */
60
+ public function beta_testers_needed_notice() {
61
+ if ( get_option( 'download-monitor-hide-beta-notice', false ) ) {
62
+ return;
63
+ }
64
+ ?>
65
+ <div data-dismissible="download-monitor-beta-notice" id="download-monitor-beta-notice" class="notice notice-success is-dismissible" style="margin-top:30px;">
66
+ <h1><?php echo $this->messages['headling']; ?></h1>
67
+ <p><?php echo sprintf( wp_kses_post( $this->messages['notice'] ), wp_kses_post( $this->link ), wp_kses_post( $this->contact ) ); ?></p>
68
+ <?php
69
+ if ( ! empty( $this->messages['changelog'] ) ) {
70
+ echo '<h3>' . $this->messages['changelog_title'] . '</h3>';
71
+ echo '<ul>';
72
+ foreach ( $this->messages['changelog'] as $item ) {
73
+ echo '<li><span class="dashicons dashicons-yes"></span> ' . $item . '</li>';
74
+ }
75
+ echo '</ul>';
76
+
77
+ }
78
+ ?>
79
+ </div>
80
+ <?php
81
+ }
82
+
83
+ /**
84
+ * Add our options to the uninstall list
85
+ *
86
+ * @param $options
87
+ *
88
+ * @return mixed
89
+ *
90
+ * @since 4.5.93
91
+ */
92
+ public function uninstall_options( $options ) {
93
+
94
+ $options[] = 'download-monitor-hide-beta-notice';
95
+
96
+ return $options;
97
+ }
98
+
99
+
100
+ /**
101
+ * AJAX functions
102
+ *
103
+ * @since 4.5.93
104
+ */
105
+ public function ajax() {
106
+
107
+ check_ajax_referer( 'download-monitor-beta-notice', 'security' );
108
+ update_option( 'download-monitor-hide-beta-notice', true );
109
+ wp_die( 'ok' );
110
+
111
+ }
112
+
113
+ /**
114
+ * Enqueue scripts
115
+ *
116
+ * @since 4.5.93
117
+ */
118
+ public function enqueue() {
119
+ wp_enqueue_script( 'jquery' );
120
+ }
121
+
122
+ /**
123
+ * AJAX script
124
+ *
125
+ * @since 4.5.93
126
+ */
127
+ public function ajax_script() {
128
+
129
+ $ajax_nonce = wp_create_nonce( 'download-monitor-beta-notice' );
130
+
131
+ ?>
132
+
133
+ <script type="text/javascript">
134
+ jQuery( document ).ready( function( $ ){
135
+
136
+ $(document).on('click','#download-monitor-beta-notice .notice-dismiss', function( ){
137
+ var data = {
138
+ action: 'download-monitor_beta_test_notice_dismiss',
139
+ security: '<?php echo $ajax_nonce; ?>',
140
+ };
141
+
142
+ $.post( '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>', data, function( response ) {
143
+ $( '#download-monitor-beta-notice' ).slideUp( 'fast', function() {
144
+ $( this ).remove();
145
+ } );
146
+ });
147
+
148
+ } );
149
+
150
+ });
151
+ </script>
152
+
153
+ <?php
154
+ }
155
+ }
156
+
157
+ new DLM_Beta_Testers();
includes/admin/class-dlm-review.php CHANGED
@@ -38,7 +38,7 @@ class DLM_Review {
38
  add_action( 'admin_print_footer_scripts', array( $this, 'ajax_script' ) );
39
  }
40
 
41
- add_filter('st_uninstall_db_options',array($this,'uninstall_options'));
42
 
43
  }
44
 
38
  add_action( 'admin_print_footer_scripts', array( $this, 'ajax_script' ) );
39
  }
40
 
41
+ add_filter( 'dlm_uninstall_db_options', array( $this, 'uninstall_options' ) );
42
 
43
  }
44
 
includes/admin/class-dlm-welcome.php CHANGED
@@ -138,11 +138,6 @@ class DLM_Welcome_Page {
138
  <?php $welcome->display_heading( esc_html__( 'Thank you for installing Download Monitor', 'download-monitor' ) ); ?>
139
  <?php $welcome->display_subheading( esc_html__( 'You\'re just a few steps away from adding, displaying and tracking your first download on your website with the easiest to use WordPress download plugin.', 'download-monitor' ) ); ?>
140
  </div>
141
- <div class="button-wrap-single">
142
- <?php $welcome->display_button( esc_html__( 'Read our step-by-step guide to get started', 'download-monitor' ), 'https://www.download-monitor.com/kb/add-your-first-download/', true, '#7364ff' ); ?>
143
- </div>
144
- <?php $welcome->display_empty_space(); ?>
145
- <img src="<?php echo esc_url( DLM_URL ); ?>assets/images/banner-dlm.png" alt="<?php esc_attr_e( 'Watch how to', 'strong-testimonials' ); ?>" class="video-thumbnail">
146
  <?php $welcome->horizontal_delimiter(); ?>
147
  <div class="block">
148
  <?php $welcome->display_heading( esc_html__( 'Features&Add-ons', 'download-monitor' ) ); ?>
138
  <?php $welcome->display_heading( esc_html__( 'Thank you for installing Download Monitor', 'download-monitor' ) ); ?>
139
  <?php $welcome->display_subheading( esc_html__( 'You\'re just a few steps away from adding, displaying and tracking your first download on your website with the easiest to use WordPress download plugin.', 'download-monitor' ) ); ?>
140
  </div>
 
 
 
 
 
141
  <?php $welcome->horizontal_delimiter(); ?>
142
  <div class="block">
143
  <?php $welcome->display_heading( esc_html__( 'Features&Add-ons', 'download-monitor' ) ); ?>
includes/deprecated.php CHANGED
@@ -1,37 +1,37 @@
1
- <?php
2
- /**
3
- * Deprecated code, avoid using anything that's in this file
4
- */
5
-
6
- /**
7
- * dlm_create_log function.
8
- *
9
- * @access public
10
- *
11
- * @deprecated 1.6.0
12
- *
13
- * @param string $type
14
- * @param string $status
15
- * @param string $message
16
- * @param mixed $download
17
- * @param mixed $version
18
- *
19
- * @return void
20
- */
21
- function dlm_create_log( $type, $status, $message, $download, $version ) {
22
-
23
- // Deprecated notice
24
- _deprecated_function( __FUNCTION__, '1.6.0', 'DLM_Logging->create_log()' );
25
-
26
- // Logging object
27
- $logging = new DLM_Logging();
28
-
29
- // Check if logging is enabled
30
- if( $logging->is_logging_enabled() ) {
31
-
32
- // Create log
33
- $logging->create_log( $type, $status, $message, $download, $version );
34
-
35
- }
36
-
37
- }
1
+ <?php
2
+ /**
3
+ * Deprecated code, avoid using anything that's in this file
4
+ */
5
+
6
+ /**
7
+ * dlm_create_log function.
8
+ *
9
+ * @access public
10
+ *
11
+ * @deprecated 1.6.0
12
+ *
13
+ * @param string $type
14
+ * @param string $status
15
+ * @param string $message
16
+ * @param mixed $download
17
+ * @param mixed $version
18
+ *
19
+ * @return void
20
+ */
21
+ function dlm_create_log( $type, $status, $message, $download, $version ) {
22
+
23
+ // Deprecated notice
24
+ _deprecated_function( __FUNCTION__, '1.6.0', 'DLM_Logging->create_log()' );
25
+
26
+ // Logging object
27
+ $logging = new DLM_Logging();
28
+
29
+ // Check if logging is enabled
30
+ if( $logging->is_logging_enabled() ) {
31
+
32
+ // Create log
33
+ $logging->create_log( $type, $status, $message, $download, $version );
34
+
35
+ }
36
+
37
+ }
includes/download-functions.php CHANGED
@@ -1,15 +1,15 @@
1
- <?php
2
-
3
- /**
4
- * Gets the name of the default template
5
- * @return string
6
- */
7
- function dlm_get_default_download_template() {
8
- $default = get_option( 'dlm_default_template' );
9
-
10
- if ( $default == 'custom' ) {
11
- $default = get_option( 'dlm_custom_template' );
12
- }
13
-
14
- return $default;
15
- }
1
+ <?php
2
+
3
+ /**
4
+ * Gets the name of the default template
5
+ * @return string
6
+ */
7
+ function dlm_get_default_download_template() {
8
+ $default = get_option( 'dlm_default_template' );
9
+
10
+ if ( $default == 'custom' ) {
11
+ $default = get_option( 'dlm_custom_template' );
12
+ }
13
+
14
+ return $default;
15
+ }
includes/php-too-low.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
-
6
- function dlm_admin_notice_php_version() {
7
-
8
- $version_parts = explode( '.', phpversion() );
9
- $user_version_nice = '';
10
- if ( ! empty( $version_parts[0] ) ) {
11
- $user_version_nice .= $version_parts[0];
12
- }
13
- if ( ! empty( $version_parts[1] ) ) {
14
- $user_version_nice .= '.' . $version_parts[1];
15
- }
16
-
17
- ?>
18
- <div class="notice notice-error is-dismissible">
19
- <h3><?php echo esc_html__( 'PHP Version too low!', 'download-monitor' ); ?></h3>
20
- <p>
21
- <?php
22
- printf(
23
- esc_html_e( "Download Monitor can't be loaded because it needs at least %1\$s but the server that is hosting your WordPress website is running %2\$s", 'download-monitor' ),
24
- '<strong>' . sprintf( esc_html_e( 'PHP Version %s', 'download-monitor' ), '5.3' ) . '</strong>',
25
- '<strong>' . sprintf( esc_html_e( 'PHP Version %s', 'download-monitor' ), esc_html( $user_version_nice ) ) . '</strong>'
26
- );
27
- ?>
28
- </p>
29
- <p>
30
- <?php
31
- printf(
32
- esc_html_e( "You can learn more about why it's important that you update and get tips on how to update by %s", 'download-monitor' ),
33
- '<a href="https://www.download-monitor.com/kb/minimum-required-php-version/" target="_blank">' . esc_html_e( 'clicking this link', 'download-monitor' ) . '</a>'
34
- );
35
- ?>
36
- </p>
37
- <p><?php echo esc_html__( "After you've upgraded your PHP version, Download Monitor will automatically load and work.", 'download-monitor' ); ?></p>
38
- <p></p>
39
- </div>
40
- <?php
41
- }
42
-
43
- add_action( 'admin_notices', 'dlm_admin_notice_php_version' );
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+
6
+ function dlm_admin_notice_php_version() {
7
+
8
+ $version_parts = explode( '.', phpversion() );
9
+ $user_version_nice = '';
10
+ if ( ! empty( $version_parts[0] ) ) {
11
+ $user_version_nice .= $version_parts[0];
12
+ }
13
+ if ( ! empty( $version_parts[1] ) ) {
14
+ $user_version_nice .= '.' . $version_parts[1];
15
+ }
16
+
17
+ ?>
18
+ <div class="notice notice-error is-dismissible">
19
+ <h3><?php echo esc_html__( 'PHP Version too low!', 'download-monitor' ); ?></h3>
20
+ <p>
21
+ <?php
22
+ printf(
23
+ esc_html_e( "Download Monitor can't be loaded because it needs at least %1\$s but the server that is hosting your WordPress website is running %2\$s", 'download-monitor' ),
24
+ '<strong>' . sprintf( esc_html_e( 'PHP Version %s', 'download-monitor' ), '5.3' ) . '</strong>',
25
+ '<strong>' . sprintf( esc_html_e( 'PHP Version %s', 'download-monitor' ), esc_html( $user_version_nice ) ) . '</strong>'
26
+ );
27
+ ?>
28
+ </p>
29
+ <p>
30
+ <?php
31
+ printf(
32
+ esc_html_e( "You can learn more about why it's important that you update and get tips on how to update by %s", 'download-monitor' ),
33
+ '<a href="https://www.download-monitor.com/kb/minimum-required-php-version/" target="_blank">' . esc_html_e( 'clicking this link', 'download-monitor' ) . '</a>'
34
+ );
35
+ ?>
36
+ </p>
37
+ <p><?php echo esc_html__( "After you've upgraded your PHP version, Download Monitor will automatically load and work.", 'download-monitor' ); ?></p>
38
+ <p></p>
39
+ </div>
40
+ <?php
41
+ }
42
+
43
+ add_action( 'admin_notices', 'dlm_admin_notice_php_version' );
includes/submodules/banner/assets/css/wpchill-welcome.css CHANGED
@@ -1,365 +1,365 @@
1
- #wpchill-welcome {
2
- padding-top: 80px;
3
- }
4
-
5
- #wpchill-welcome *, #wpchill-welcome *::before, #wpchill-welcome *::after {
6
- -webkit-box-sizing: border-box;
7
- -moz-box-sizing: border-box;
8
- box-sizing: border-box;
9
- }
10
-
11
- #wpchill-welcome .clear:before {
12
- content: " ";
13
- display: table;
14
- }
15
-
16
- #wpchill-welcome .clear:after {
17
- clear: both;
18
- content: " ";
19
- display: table;
20
- }
21
-
22
- #wpchill-welcome .container {
23
- margin: 0 auto;
24
- max-width: 800px;
25
- padding: 0;
26
- }
27
-
28
- #wpchill-welcome .block {
29
- padding: 40px;
30
- }
31
-
32
- #wpchill-welcome img {
33
- max-width: 100%;
34
- height: auto;
35
- }
36
-
37
- #wpchill-welcome h1 {
38
- color: #222;
39
- font-size: 24px;
40
- margin: 0 0 16px 0;
41
- }
42
-
43
- #wpchill-welcome h5 {
44
- color: #222;
45
- font-size: 16px;
46
- margin: 0 0 8px 0;
47
- }
48
-
49
- #wpchill-welcome h6 {
50
- font-size: 16px;
51
- font-weight: 400;
52
- line-height: 1.6;
53
- margin: 0;
54
- }
55
-
56
- #wpchill-welcome .wpmtst-btn-lg {
57
- font-size: 16px;
58
- font-weight: 600;
59
- padding: 16px 28px;
60
- }
61
-
62
- #wpchill-welcome .wpmtst-btn-block {
63
- display: block;
64
- width: 100%;
65
- }
66
-
67
- #wpchill-welcome .wpmtst-btn {
68
- border: 0;
69
- border-radius: 40px;
70
- cursor: pointer;
71
- display: inline-block;
72
- margin: 0;
73
- text-decoration: none;
74
- text-align: center;
75
- vertical-align: middle;
76
- white-space: nowrap;
77
- box-shadow: none;
78
- }
79
-
80
-
81
- #wpchill-welcome .button-wrap {
82
- max-width: 590px;
83
- margin: 0 auto 0 auto;
84
- }
85
-
86
- #wpchill-welcome .button-wrap .left {
87
- margin-bottom: 10px;
88
- }
89
-
90
- #wpchill-welcome .button-wrap-single a {
91
- font-size: 14px;
92
- }
93
-
94
- #wpchill-welcome .button-wrap-single {
95
- padding: 0 20px;
96
- }
97
-
98
- @media screen and (min-width: 720px) {
99
-
100
- #wpchill-welcome .button-wrap .left {
101
- margin-bottom: 0px;
102
- float: left;
103
- width: 50%;
104
- padding-right: 20px;
105
- }
106
-
107
- #wpchill-welcome .button-wrap .right {
108
- float: right;
109
- width: 50%;
110
- padding-left: 20px;
111
- }
112
-
113
- #wpchill-welcome .button-wrap-single a {
114
- font-size: 16px;
115
- }
116
- }
117
-
118
- /* hero section */
119
- #wpchill-welcome .hero {
120
- background-color: #fff;
121
- border-radius: 10px;
122
- margin-bottom: 30px;
123
- position: relative;
124
- box-shadow: -3px 2px 70px 0px rgba(128, 144, 174, 0.1);
125
- padding-top: 40px;
126
- }
127
-
128
- #wpchill-welcome .hero .mascot {
129
- background-color: #fff;
130
- border-radius: 50%;
131
- height: 90px;
132
- width: 90px;
133
- padding: 28px 28px;
134
- position: absolute;
135
- top: -45px;
136
- left: 50%;
137
- margin-left: -45px;
138
- }
139
-
140
- #wpchill-welcome .hero .video-thumbnail {
141
- display: block;
142
- margin: 0;
143
- width: 100%;
144
- }
145
-
146
- #wpchill-welcome .hero .button-wrap {
147
- margin-top: 20px;
148
- }
149
-
150
-
151
- /* features section */
152
- #wpchill-welcome .features {
153
- background-color: #fff;
154
- border-top-left-radius: 10px;
155
- border-top-right-radius: 10px;
156
- position: relative;
157
- padding-top: 20px;
158
- }
159
-
160
- #wpchill-welcome .features .feature-list {
161
- margin-top: 40px;
162
- }
163
-
164
- #wpchill-welcome .features .feature-block {
165
- margin-bottom: 30px;
166
- }
167
-
168
- @media screen and (min-width: 720px) {
169
-
170
- #wpchill-welcome .block-row-2 .feature-block {
171
- margin: 0 auto;
172
- float: left;
173
- width: 50%;
174
- padding-bottom: 32px;
175
- overflow: auto;
176
- }
177
-
178
- #wpchill-welcome .block-row-3 .feature-block {
179
- margin: 0 auto;
180
- float: left;
181
- width: 33%;
182
- padding-bottom: 32px;
183
- overflow: auto;
184
- }
185
-
186
- #wpchill-welcome .block-row-2 .feature-block:nth-child(odd) {
187
- padding-right: 22px;
188
- clear: both;
189
- }
190
-
191
- #wpchill-welcome .block-row-3 .feature-block:not(:nth-child(3n+3)) {
192
- padding-right: 22px;
193
- }
194
-
195
- #wpchill-welcome .block-row-3 .feature-block:nth-child(3n+1) {
196
- clear: both;
197
- }
198
-
199
- #wpchill-welcome .features .feature-block.last {
200
- padding-left: 22px;
201
- }
202
- .block-row-1 > * {
203
- width: 100%;
204
- }
205
- .block-row{
206
- display:flex;
207
- flex-wrap:wrap;
208
- align-items:flex-start;
209
- flex-direction: row;
210
- justify-content: flex-start;
211
- }
212
-
213
- .block-row-2 > * {
214
- width: 50%;
215
- }
216
-
217
- .block-row-3 > * {
218
- width: 33%;
219
- }
220
-
221
- .block-row-4 > * {
222
- width: 25%;
223
- }
224
- }
225
-
226
- #wpchill-welcome .features .feature-block img {
227
- float: left;
228
- max-width: 44px;
229
- max-height: 44px;
230
- }
231
-
232
- #wpchill-welcome .features .feature-block h5 {
233
- margin-left: 70px;
234
- }
235
-
236
- #wpchill-welcome .features .feature-block p {
237
- margin-left: 70px;
238
- }
239
-
240
- #wpchill-welcome .features .pro-label {
241
- display: inline-block;
242
- line-height: 1;
243
- color: #fff;
244
- padding: 3px 6px;
245
- font-size: 0.75rem;
246
- border-radius: 20px;
247
- vertical-align: text-top;
248
- margin-left: 20px;
249
- }
250
-
251
- #wpchill-welcome .features .feature-list a {
252
- color: #5333ED;
253
- }
254
-
255
- /* upgrade section */
256
- #wpchill-welcome .upgrade {
257
- background-color: white;
258
- text-align: center;
259
- }
260
-
261
- #wpchill-welcome .upgrade h1{
262
- color: #fff;
263
- }
264
-
265
- @media screen and (min-width: 720px) {
266
-
267
- #wpchill-welcome .upgrade .left{
268
- float: left;
269
- width: 50%;
270
- padding-left: 20%;
271
- margin-bottom: 30px;
272
- text-align: left;
273
- }
274
-
275
- #wpchill-welcome .upgrade .right{
276
- float: left;
277
- width: 50%;
278
- padding-right: 20%;
279
- margin-bottom: 30px;
280
- text-align: left;
281
- }
282
- #wpchill-welcome .button-wrap-single{
283
- width: 50%;
284
- margin: 0 auto;
285
- }
286
- }
287
-
288
- /* testimonials section */
289
- #wpchill-welcome .testimonials {
290
- background-color: #fafafa;
291
-
292
- position: relative;
293
- box-shadow: -3px 2px 70px 0px rgba(128, 144, 174, 0.1);
294
- }
295
-
296
- #wpchill-welcome .testimonials .testimonial-block {
297
- padding: 0 16px 32px;
298
- overflow: auto;
299
- margin-top: 40px;
300
- text-align: center;
301
- }
302
-
303
- @media screen and (min-width: 720px) {
304
-
305
- #wpchill-welcome .testimonials .testimonial-block {
306
- float: left;
307
- width: 50%;
308
- }
309
-
310
- }
311
-
312
- #wpchill-welcome .testimonials .testimonial-block p {
313
- font-size: 14px;
314
- font-weight: 400;
315
- line-height: 1.6;
316
- }
317
-
318
- #wpchill-welcome .testimonials .testimonial-block img {
319
- max-width: 60px;
320
- max-height: 60px;
321
- border-radius: 50%;
322
- filter: grayscale(100%);
323
- box-shadow: 0 0 12px rgba(0,0,0,0.15);
324
- }
325
-
326
- /* testimonials footer */
327
- #wpchill-welcome .footer {
328
- background-color: #fff;
329
- border-bottom-left-radius: 10px;
330
- border-bottom-right-radius: 10px;
331
- margin-bottom: 30px;
332
- position: relative;
333
- box-shadow: -3px 2px 70px 0px rgba(128, 144, 174, 0.1);
334
- }
335
-
336
- #wpchill-welcome .container {
337
- position: relative;
338
- width: 100%;
339
- height: 0;
340
- padding-bottom: 56.25%;
341
- }
342
-
343
- #wpchill-welcome .video {
344
- position: absolute;
345
- top: 0;
346
- left: 0;
347
- width: 100%;
348
- height: 100%;
349
- }
350
-
351
- #wpchill-welcome .stars_wrapper svg {
352
- height: 20px;
353
- }
354
-
355
- #wpchill-welcome .wpchill_empty_space{
356
- display:block;
357
- clear:both;
358
- }
359
-
360
- .wpchill_horizontal_delimiter {
361
- background-color: #f0f0f1;
362
- height:20px;
363
- width:100%;
364
- margin:0 auto;
365
  }
1
+ #wpchill-welcome {
2
+ padding-top: 80px;
3
+ }
4
+
5
+ #wpchill-welcome *, #wpchill-welcome *::before, #wpchill-welcome *::after {
6
+ -webkit-box-sizing: border-box;
7
+ -moz-box-sizing: border-box;
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ #wpchill-welcome .clear:before {
12
+ content: " ";
13
+ display: table;
14
+ }
15
+
16
+ #wpchill-welcome .clear:after {
17
+ clear: both;
18
+ content: " ";
19
+ display: table;
20
+ }
21
+
22
+ #wpchill-welcome .container {
23
+ margin: 0 auto;
24
+ max-width: 800px;
25
+ padding: 0;
26
+ }
27
+
28
+ #wpchill-welcome .block {
29
+ padding: 40px;
30
+ }
31
+
32
+ #wpchill-welcome img {
33
+ max-width: 100%;
34
+ height: auto;
35
+ }
36
+
37
+ #wpchill-welcome h1 {
38
+ color: #222;
39
+ font-size: 24px;
40
+ margin: 0 0 16px 0;
41
+ }
42
+
43
+ #wpchill-welcome h5 {
44
+ color: #222;
45
+ font-size: 16px;
46
+ margin: 0 0 8px 0;
47
+ }
48
+
49
+ #wpchill-welcome h6 {
50
+ font-size: 16px;
51
+ font-weight: 400;
52
+ line-height: 1.6;
53
+ margin: 0;
54
+ }
55
+
56
+ #wpchill-welcome .wpmtst-btn-lg {
57
+ font-size: 16px;
58
+ font-weight: 600;
59
+ padding: 16px 28px;
60
+ }
61
+
62
+ #wpchill-welcome .wpmtst-btn-block {
63
+ display: block;
64
+ width: 100%;
65
+ }
66
+
67
+ #wpchill-welcome .wpmtst-btn {
68
+ border: 0;
69
+ border-radius: 40px;
70
+ cursor: pointer;
71
+ display: inline-block;
72
+ margin: 0;
73
+ text-decoration: none;
74
+ text-align: center;
75
+ vertical-align: middle;
76
+ white-space: nowrap;
77
+ box-shadow: none;
78
+ }
79
+
80
+
81
+ #wpchill-welcome .button-wrap {
82
+ max-width: 590px;
83
+ margin: 0 auto 0 auto;
84
+ }
85
+
86
+ #wpchill-welcome .button-wrap .left {
87
+ margin-bottom: 10px;
88
+ }
89
+
90
+ #wpchill-welcome .button-wrap-single a {
91
+ font-size: 14px;
92
+ }
93
+
94
+ #wpchill-welcome .button-wrap-single {
95
+ padding: 0 20px;
96
+ }
97
+
98
+ @media screen and (min-width: 720px) {
99
+
100
+ #wpchill-welcome .button-wrap .left {
101
+ margin-bottom: 0px;
102
+ float: left;
103
+ width: 50%;
104
+ padding-right: 20px;
105
+ }
106
+
107
+ #wpchill-welcome .button-wrap .right {
108
+ float: right;
109
+ width: 50%;
110
+ padding-left: 20px;
111
+ }
112
+
113
+ #wpchill-welcome .button-wrap-single a {
114
+ font-size: 16px;
115
+ }
116
+ }
117
+
118
+ /* hero section */
119
+ #wpchill-welcome .hero {
120
+ background-color: #fff;
121
+ border-radius: 10px;
122
+ margin-bottom: 30px;
123
+ position: relative;
124
+ box-shadow: -3px 2px 70px 0px rgba(128, 144, 174, 0.1);
125
+ padding-top: 40px;
126
+ }
127
+
128
+ #wpchill-welcome .hero .mascot {
129
+ background-color: #fff;
130
+ border-radius: 50%;
131
+ height: 90px;
132
+ width: 90px;
133
+ padding: 28px 28px;
134
+ position: absolute;
135
+ top: -45px;
136
+ left: 50%;
137
+ margin-left: -45px;
138
+ }
139
+
140
+ #wpchill-welcome .hero .video-thumbnail {
141
+ display: block;
142
+ margin: 0;
143
+ width: 100%;
144
+ }
145
+
146
+ #wpchill-welcome .hero .button-wrap {
147
+ margin-top: 20px;
148
+ }
149
+
150
+
151
+ /* features section */
152
+ #wpchill-welcome .features {
153
+ background-color: #fff;
154
+ border-top-left-radius: 10px;
155
+ border-top-right-radius: 10px;
156
+ position: relative;
157
+ padding-top: 20px;
158
+ }
159
+
160
+ #wpchill-welcome .features .feature-list {
161
+ margin-top: 40px;
162
+ }
163
+
164
+ #wpchill-welcome .features .feature-block {
165
+ margin-bottom: 30px;
166
+ }
167
+
168
+ @media screen and (min-width: 720px) {
169
+
170
+ #wpchill-welcome .block-row-2 .feature-block {
171
+ margin: 0 auto;
172
+ float: left;
173
+ width: 50%;
174
+ padding-bottom: 32px;
175
+ overflow: auto;
176
+ }
177
+
178
+ #wpchill-welcome .block-row-3 .feature-block {
179
+ margin: 0 auto;
180
+ float: left;
181
+ width: 33%;
182
+ padding-bottom: 32px;
183
+ overflow: auto;
184
+ }
185
+
186
+ #wpchill-welcome .block-row-2 .feature-block:nth-child(odd) {
187
+ padding-right: 22px;
188
+ clear: both;
189
+ }
190
+
191
+ #wpchill-welcome .block-row-3 .feature-block:not(:nth-child(3n+3)) {
192
+ padding-right: 22px;
193
+ }
194
+
195
+ #wpchill-welcome .block-row-3 .feature-block:nth-child(3n+1) {
196
+ clear: both;
197
+ }
198
+
199
+ #wpchill-welcome .features .feature-block.last {
200
+ padding-left: 22px;
201
+ }
202
+ .block-row-1 > * {
203
+ width: 100%;
204
+ }
205
+ .block-row{
206
+ display:flex;
207
+ flex-wrap:wrap;
208
+ align-items:flex-start;
209
+ flex-direction: row;
210
+ justify-content: flex-start;
211
+ }
212
+
213
+ .block-row-2 > * {
214
+ width: 50%;
215
+ }
216
+
217
+ .block-row-3 > * {
218
+ width: 33%;
219
+ }
220
+
221
+ .block-row-4 > * {
222
+ width: 25%;
223
+ }
224
+ }
225
+
226
+ #wpchill-welcome .features .feature-block img {
227
+ float: left;
228
+ max-width: 44px;
229
+ max-height: 44px;
230
+ }
231
+
232
+ #wpchill-welcome .features .feature-block h5 {
233
+ margin-left: 70px;
234
+ }
235
+
236
+ #wpchill-welcome .features .feature-block p {
237
+ margin-left: 70px;
238
+ }
239
+
240
+ #wpchill-welcome .features .pro-label {
241
+ display: inline-block;
242
+ line-height: 1;
243
+ color: #fff;
244
+ padding: 3px 6px;
245
+ font-size: 0.75rem;
246
+ border-radius: 20px;
247
+ vertical-align: text-top;
248
+ margin-left: 20px;
249
+ }
250
+
251
+ #wpchill-welcome .features .feature-list a {
252
+ color: #5333ED;
253
+ }
254
+
255
+ /* upgrade section */
256
+ #wpchill-welcome .upgrade {
257
+ background-color: white;
258
+ text-align: center;
259
+ }
260
+
261
+ #wpchill-welcome .upgrade h1{
262
+ color: #fff;
263
+ }
264
+
265
+ @media screen and (min-width: 720px) {
266
+
267
+ #wpchill-welcome .upgrade .left{
268
+ float: left;
269
+ width: 50%;
270
+ padding-left: 20%;
271
+ margin-bottom: 30px;
272
+ text-align: left;
273
+ }
274
+
275
+ #wpchill-welcome .upgrade .right{
276
+ float: left;
277
+ width: 50%;
278
+ padding-right: 20%;
279
+ margin-bottom: 30px;
280
+ text-align: left;
281
+ }
282
+ #wpchill-welcome .button-wrap-single{
283
+ width: 50%;
284
+ margin: 0 auto;
285
+ }
286
+ }
287
+
288
+ /* testimonials section */
289
+ #wpchill-welcome .testimonials {
290
+ background-color: #fafafa;
291
+
292
+ position: relative;
293
+ box-shadow: -3px 2px 70px 0px rgba(128, 144, 174, 0.1);
294
+ }
295
+
296
+ #wpchill-welcome .testimonials .testimonial-block {
297
+ padding: 0 16px 32px;
298
+ overflow: auto;
299
+ margin-top: 40px;
300
+ text-align: center;
301
+ }
302
+
303
+ @media screen and (min-width: 720px) {
304
+
305
+ #wpchill-welcome .testimonials .testimonial-block {
306
+ float: left;
307
+ width: 50%;
308
+ }
309
+
310
+ }
311
+
312
+ #wpchill-welcome .testimonials .testimonial-block p {
313
+ font-size: 14px;
314
+ font-weight: 400;
315
+ line-height: 1.6;
316
+ }
317
+
318
+ #wpchill-welcome .testimonials .testimonial-block img {
319
+ max-width: 60px;
320
+ max-height: 60px;
321
+ border-radius: 50%;
322
+ filter: grayscale(100%);
323
+ box-shadow: 0 0 12px rgba(0,0,0,0.15);
324
+ }
325
+
326
+ /* testimonials footer */
327
+ #wpchill-welcome .footer {
328
+ background-color: #fff;
329
+ border-bottom-left-radius: 10px;
330
+ border-bottom-right-radius: 10px;
331
+ margin-bottom: 30px;
332
+ position: relative;
333
+ box-shadow: -3px 2px 70px 0px rgba(128, 144, 174, 0.1);
334
+ }
335
+
336
+ #wpchill-welcome .container {
337
+ position: relative;
338
+ width: 100%;
339
+ height: 0;
340
+ padding-bottom: 56.25%;
341
+ }
342
+
343
+ #wpchill-welcome .video {
344
+ position: absolute;
345
+ top: 0;
346
+ left: 0;
347
+ width: 100%;
348
+ height: 100%;
349
+ }
350
+
351
+ #wpchill-welcome .stars_wrapper svg {
352
+ height: 20px;
353
+ }
354
+
355
+ #wpchill-welcome .wpchill_empty_space{
356
+ display:block;
357
+ clear:both;
358
+ }
359
+
360
+ .wpchill_horizontal_delimiter {
361
+ background-color: #f0f0f1;
362
+ height:20px;
363
+ width:100%;
364
+ margin:0 auto;
365
  }
includes/submodules/banner/assets/img/star.svg CHANGED
@@ -1,12 +1,12 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
- viewBox="-274 399.8 53 43.1" style="enable-background:new -274 399.8 53 43.1;" xml:space="preserve">
5
- <style type="text/css">
6
- .st0{fill:#5333ED;}
7
- </style>
8
- <g>
9
- <path class="st0" d="M-234.8,415h-11.5l-3.6-11c-1.4-4.3-3.7-4.3-5.1,0l-3.6,11h-11.5c-4.5,0-5.3,2.2-1.6,4.8l9.3,6.8l-3.6,11
10
- c-1.4,4.3,0.4,5.7,4.1,3l9.3-6.8l9.3,6.8c3.7,2.7,5.5,1.3,4.1-3l-3.6-11l9.3-6.8C-229.6,417.1-230.3,415-234.8,415z"/>
11
- </g>
12
- </svg>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="-274 399.8 53 43.1" style="enable-background:new -274 399.8 53 43.1;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#5333ED;}
7
+ </style>
8
+ <g>
9
+ <path class="st0" d="M-234.8,415h-11.5l-3.6-11c-1.4-4.3-3.7-4.3-5.1,0l-3.6,11h-11.5c-4.5,0-5.3,2.2-1.6,4.8l9.3,6.8l-3.6,11
10
+ c-1.4,4.3,0.4,5.7,4.1,3l9.3-6.8l9.3,6.8c3.7,2.7,5.5,1.3,4.1-3l-3.6-11l9.3-6.8C-229.6,417.1-230.3,415-234.8,415z"/>
11
+ </g>
12
+ </svg>
includes/submodules/banner/class-wpchill-welcome.php CHANGED
@@ -1,260 +1,260 @@
1
- <?php
2
-
3
- if ( ! class_exists( 'WPChill_Welcome' ) ) {
4
-
5
- class WPChill_Welcome {
6
-
7
- /**
8
- * Contains the instance of the Class
9
- *
10
- * @since 1.0.0
11
- * @param WPChill_Welcome $instance
12
- */
13
- private static $instance = null;
14
-
15
- /**
16
- * @since 1.0.0
17
- * @param string $textdomain - wpchill textdomain
18
- */
19
- public $textdomain = 'wpchill';
20
-
21
- private function __construct() {
22
- add_action( 'admin_footer', array( $this, 'welcome_style' ) );
23
- }
24
-
25
- /**
26
- * @since 1.0.0
27
- * Singleton
28
- */
29
- public static function get_instance() {
30
-
31
- if ( ! isset( self::$instance ) && ! ( self::$instance instanceof WPChill_Welcome ) ) {
32
- self::$instance = new WPChill_Welcome();
33
- }
34
-
35
- return self::$instance;
36
- }
37
-
38
- /**
39
- * @since 1.0.0
40
- * Enqueue admin Wellcome style
41
- */
42
- public function welcome_style() {
43
- wp_register_style( 'wpchill-welcome-style', plugins_url( '/assets/css/wpchill-welcome.css', __FILE__ ), null, '1.0.0' );
44
- wp_print_styles( array( 'wpchill-welcome-style' ) );
45
- }
46
-
47
- /**
48
- * @since 1.0.0
49
- * Renders buttons
50
- *
51
- * @param string $text
52
- *
53
- * @param string $url
54
- *
55
- * @param bool $fill
56
- *
57
- * @param string $color
58
- */
59
- public function display_button( $text, $link, $fill = true, $color = '#5D3CE4' ) {
60
- $style = 'style="background-color:' . sanitize_hex_color( $color ) . ';border-color:' . sanitize_hex_color( $color ) . ';color:#fff;"';
61
- echo '<a href="' . esc_attr( $link ) . '" ' . ( $fill ? $style : '' ) . ' class="wpmtst-btn wpmtst-btn-block wpmtst-btn-lg">' . esc_html( $text ) . '</a>';
62
- }
63
-
64
- /**
65
- * @since 1.0.0
66
- * Renders extension html
67
- *
68
- * @param string $title
69
- *
70
- * @param string $description
71
- *
72
- * @param string $icon (icon URL)
73
- *
74
- * @param bool $pro
75
- */
76
- public function display_extension( $title, $description = '', $icon = '', $pro = false, $pro_color = '#5333ED' ) {
77
-
78
- echo '<div class="feature-block">';
79
- if ( '' != $icon ) {
80
- echo '<img src="' . esc_attr( $icon ) . '">';
81
- }
82
- echo '<h5>' . esc_html( $title ) . ( ( $pro ) ? '<div style="background-color:' . esc_attr( $pro_color ) . '" class="pro-label">PRO</div>' : '' ) . '</h5>';
83
- echo '<p>' . esc_html( $description ) . '</p>';
84
- echo '</div>';
85
- }
86
-
87
- /**
88
- * @since 1.0.0
89
- * Displays h1 heading
90
- *
91
- * @param string $text
92
- *
93
- * @param string $position
94
- */
95
- public function display_heading( $text, $position = 'center' ) {
96
- echo '<h1 style="text-align: ' . esc_attr( $position ) . ';" >' . esc_html( $text ) . '</h1>';
97
- }
98
-
99
- /**
100
- * @since 1.0.0
101
- * Displays h6 subheading
102
- *
103
- * @param string $text
104
- *
105
- * @param string $position
106
- */
107
- public function display_subheading( $text, $position = 'center' ) {
108
- echo '<h6 style="text-align: ' . esc_attr( $position ) . '" >' . esc_html( $text ) . '</h6>';
109
- }
110
-
111
-
112
- /**
113
- * @since 1.0.0
114
- * Renders testimonial block
115
- *
116
- * @param string $text
117
- *
118
- * @param string $icon
119
- *
120
- * @param string $name
121
- *
122
- * @param string $job (reviewer's job or company)
123
- */
124
- public function display_testimonial( $text, $icon = '', $name = '', $job = '', $star_color = '' ) {
125
-
126
- echo '<div class="testimonial-block">';
127
- if ( '' != $icon ) {
128
- echo '<img src=" ' . esc_url( $icon ) . ' "/>';
129
- }
130
- echo '<p>' . esc_html( $text ) . '</p>';
131
-
132
- $this->display_stars( $star_color );
133
-
134
- if ( '' !== $name || '' !== $job ) {
135
- echo '<p>';
136
-
137
- if ( '' !== $name ) {
138
- echo '<strong>' . esc_html( $name ) . '</strong><br/>';
139
- }
140
- if ( '' !== $job ) {
141
- echo esc_html( $job );
142
- }
143
- echo '</p>';
144
- }
145
-
146
- echo '</div>';
147
- }
148
-
149
- /**
150
- * @since 1.0.0
151
- * Renders a UL list
152
- *
153
- * @param array $items - array of list items
154
- */
155
- public function display_listing( $items ) {
156
- echo '<ul>';
157
-
158
- foreach ( $items as $item ) {
159
- echo '<li>' . esc_html( $item ) . '</li>';
160
- }
161
-
162
- echo '</ul>';
163
- }
164
-
165
-
166
- /**
167
- * @since 1.0.0
168
- * Renders a UL list
169
- *
170
- * @param string $url - youtube.com url
171
- */
172
- public function display_video( $url ) {
173
- parse_str( wp_parse_url( esc_url( $url ), PHP_URL_QUERY ), $video_vars );
174
- echo '<div class="container"><iframe src="https://www.youtube.com/embed/' . esc_attr( $video_vars['v'] ) . '" frameborder="0" allowfullscreen class="video"></iframe></div>';
175
- }
176
-
177
- /**
178
- * @since 1.0.0
179
- * Renders rating stars block
180
- *
181
- * @param string $color - code of the star color fill
182
- */
183
- public function display_stars( $color ) {
184
- $color = ( '' === $color ) ? '#FFD700' : sanitize_hex_color( $color );
185
- $id = wp_rand( 0, 9999999 );
186
- $star = '<svg version="1.1" class="svg-' . absint( $id ) . '" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-274 399.8 53 43.1" style="enable-background:new -274 399.8 53 43.1;" xml:space="preserve">
187
- <g>
188
- <path class="st0" d="M-234.8,415h-11.5l-3.6-11c-1.4-4.3-3.7-4.3-5.1,0l-3.6,11h-11.5c-4.5,0-5.3,2.2-1.6,4.8l9.3,6.8l-3.6,11
189
- c-1.4,4.3,0.4,5.7,4.1,3l9.3-6.8l9.3,6.8c3.7,2.7,5.5,1.3,4.1-3l-3.6-11l9.3-6.8C-229.6,417.1-230.3,415-234.8,415z"/>
190
- </g>
191
- </svg>';
192
-
193
- $svg_args = array(
194
- 'svg' => array(
195
- 'class' => true,
196
- 'aria-hidden' => true,
197
- 'aria-labelledby' => true,
198
- 'role' => true,
199
- 'xmlns' => true,
200
- 'width' => true,
201
- 'height' => true,
202
- 'viewbox' => true, // <= Must be lower case!
203
- 'id' => true,
204
- ),
205
- 'g' => array( 'fill' => true ),
206
- 'title' => array( 'title' => true ),
207
- 'path' => array(
208
- 'd' => true,
209
- 'fill' => true,
210
- ),
211
- 'style' => array( 'type' => true ),
212
- );
213
-
214
- echo '<style>';
215
- echo '.svg-' . absint( $id ) . '{ fill:' . sanitize_hex_color( $color ) . ';}';
216
- echo '</style>';
217
- echo '<div class="stars_wrapper">' . wp_kses( $star . $star . $star . $star . $star, $svg_args ) . '</div>';
218
- }
219
-
220
- /**
221
- * @since 1.0.0
222
- * Columns wrapper start
223
- *
224
- * @param int $cols - # of columns the contained objects should be displayed as. (1/2/3)
225
- */
226
- public function layout_start( $cols = 2, $class = '' ) {
227
- echo '<div class="' . esc_attr( $class ) . ' block-row block-row-' . absint( $cols ) . '">';
228
- }
229
-
230
- /**
231
- * @since 1.0.0
232
- * Columns wrapper end
233
- */
234
- public function layout_end() {
235
- echo '</div>';
236
- }
237
-
238
- /**
239
- * @since 1.0.0
240
- * Renders empty space block
241
- *
242
- * @param int $height - height(px) of space
243
- */
244
- public function display_empty_space( $height = 25 ) {
245
-
246
- echo '<div class="wpchill_empty_space" style="height:' . esc_attr( $height ) . 'px;"></div>';
247
- }
248
-
249
- /**
250
- * Horizontal delimiter
251
- *
252
- * @return void
253
- * @since 1.0.0
254
- */
255
- public function horizontal_delimiter() {
256
- echo '<hr class="wpchill_horizontal_delimiter">';
257
- }
258
-
259
- }
260
- }
1
+ <?php
2
+
3
+ if ( ! class_exists( 'WPChill_Welcome' ) ) {
4
+
5
+ class WPChill_Welcome {
6
+
7
+ /**
8
+ * Contains the instance of the Class
9
+ *
10
+ * @since 1.0.0
11
+ * @param WPChill_Welcome $instance
12
+ */
13
+ private static $instance = null;
14
+
15
+ /**
16
+ * @since 1.0.0
17
+ * @param string $textdomain - wpchill textdomain
18
+ */
19
+ public $textdomain = 'wpchill';
20
+
21
+ private function __construct() {
22
+ add_action( 'admin_footer', array( $this, 'welcome_style' ) );
23
+ }
24
+
25
+ /**
26
+ * @since 1.0.0
27
+ * Singleton
28
+ */
29
+ public static function get_instance() {
30
+
31
+ if ( ! isset( self::$instance ) && ! ( self::$instance instanceof WPChill_Welcome ) ) {
32
+ self::$instance = new WPChill_Welcome();
33
+ }
34
+
35
+ return self::$instance;
36
+ }
37
+
38
+ /**
39
+ * @since 1.0.0
40
+ * Enqueue admin Wellcome style
41
+ */
42
+ public function welcome_style() {
43
+ wp_register_style( 'wpchill-welcome-style', plugins_url( '/assets/css/wpchill-welcome.css', __FILE__ ), null, '1.0.0' );
44
+ wp_print_styles( array( 'wpchill-welcome-style' ) );
45
+ }
46
+
47
+ /**
48
+ * @since 1.0.0
49
+ * Renders buttons
50
+ *
51
+ * @param string $text
52
+ *
53
+ * @param string $url
54
+ *
55
+ * @param bool $fill
56
+ *
57
+ * @param string $color
58
+ */
59
+ public function display_button( $text, $link, $fill = true, $color = '#5D3CE4' ) {
60
+ $style = 'style="background-color:' . sanitize_hex_color( $color ) . ';border-color:' . sanitize_hex_color( $color ) . ';color:#fff;"';
61
+ echo '<a href="' . esc_attr( $link ) . '" ' . ( $fill ? $style : '' ) . ' class="wpmtst-btn wpmtst-btn-block wpmtst-btn-lg">' . esc_html( $text ) . '</a>';
62
+ }
63
+
64
+ /**
65
+ * @since 1.0.0
66
+ * Renders extension html
67
+ *
68
+ * @param string $title
69
+ *
70
+ * @param string $description
71
+ *
72
+ * @param string $icon (icon URL)
73
+ *
74
+ * @param bool $pro
75
+ */
76
+ public function display_extension( $title, $description = '', $icon = '', $pro = false, $pro_color = '#5333ED' ) {
77
+
78
+ echo '<div class="feature-block">';
79
+ if ( '' != $icon ) {
80
+ echo '<img src="' . esc_attr( $icon ) . '">';
81
+ }
82
+ echo '<h5>' . esc_html( $title ) . ( ( $pro ) ? '<div style="background-color:' . esc_attr( $pro_color ) . '" class="pro-label">PRO</div>' : '' ) . '</h5>';
83
+ echo '<p>' . esc_html( $description ) . '</p>';
84
+ echo '</div>';
85
+ }
86
+
87
+ /**
88
+ * @since 1.0.0
89
+ * Displays h1 heading
90
+ *
91
+ * @param string $text
92
+ *
93
+ * @param string $position
94
+ */
95
+ public function display_heading( $text, $position = 'center' ) {
96
+ echo '<h1 style="text-align: ' . esc_attr( $position ) . ';" >' . esc_html( $text ) . '</h1>';
97
+ }
98
+
99
+ /**
100
+ * @since 1.0.0
101
+ * Displays h6 subheading
102
+ *
103
+ * @param string $text
104
+ *
105
+ * @param string $position
106
+ */
107
+ public function display_subheading( $text, $position = 'center' ) {
108
+ echo '<h6 style="text-align: ' . esc_attr( $position ) . '" >' . esc_html( $text ) . '</h6>';
109
+ }
110
+
111
+
112
+ /**
113
+ * @since 1.0.0
114
+ * Renders testimonial block
115
+ *
116
+ * @param string $text
117
+ *
118
+ * @param string $icon
119
+ *
120
+ * @param string $name
121
+ *
122
+ * @param string $job (reviewer's job or company)
123
+ */
124
+ public function display_testimonial( $text, $icon = '', $name = '', $job = '', $star_color = '' ) {
125
+
126
+ echo '<div class="testimonial-block">';
127
+ if ( '' != $icon ) {
128
+ echo '<img src=" ' . esc_url( $icon ) . ' "/>';
129
+ }
130
+ echo '<p>' . esc_html( $text ) . '</p>';
131
+
132
+ $this->display_stars( $star_color );
133
+
134
+ if ( '' !== $name || '' !== $job ) {
135
+ echo '<p>';
136
+
137
+ if ( '' !== $name ) {
138
+ echo '<strong>' . esc_html( $name ) . '</strong><br/>';
139
+ }
140
+ if ( '' !== $job ) {
141
+ echo esc_html( $job );
142
+ }
143
+ echo '</p>';
144
+ }
145
+
146
+ echo '</div>';
147
+ }
148
+
149
+ /**
150
+ * @since 1.0.0
151
+ * Renders a UL list
152
+ *
153
+ * @param array $items - array of list items
154
+ */
155
+ public function display_listing( $items ) {
156
+ echo '<ul>';
157
+
158
+ foreach ( $items as $item ) {
159
+ echo '<li>' . esc_html( $item ) . '</li>';
160
+ }
161
+
162
+ echo '</ul>';
163
+ }
164
+
165
+
166
+ /**
167
+ * @since 1.0.0
168
+ * Renders a UL list
169
+ *
170
+ * @param string $url - youtube.com url
171
+ */
172
+ public function display_video( $url ) {
173
+ parse_str( wp_parse_url( esc_url( $url ), PHP_URL_QUERY ), $video_vars );
174
+ echo '<div class="container"><iframe src="https://www.youtube.com/embed/' . esc_attr( $video_vars['v'] ) . '" frameborder="0" allowfullscreen class="video"></iframe></div>';
175
+ }
176
+
177
+ /**
178
+ * @since 1.0.0
179
+ * Renders rating stars block
180
+ *
181
+ * @param string $color - code of the star color fill
182
+ */
183
+ public function display_stars( $color ) {
184
+ $color = ( '' === $color ) ? '#FFD700' : sanitize_hex_color( $color );
185
+ $id = wp_rand( 0, 9999999 );
186
+ $star = '<svg version="1.1" class="svg-' . absint( $id ) . '" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-274 399.8 53 43.1" style="enable-background:new -274 399.8 53 43.1;" xml:space="preserve">
187
+ <g>
188
+ <path class="st0" d="M-234.8,415h-11.5l-3.6-11c-1.4-4.3-3.7-4.3-5.1,0l-3.6,11h-11.5c-4.5,0-5.3,2.2-1.6,4.8l9.3,6.8l-3.6,11
189
+ c-1.4,4.3,0.4,5.7,4.1,3l9.3-6.8l9.3,6.8c3.7,2.7,5.5,1.3,4.1-3l-3.6-11l9.3-6.8C-229.6,417.1-230.3,415-234.8,415z"/>
190
+ </g>
191
+ </svg>';
192
+
193
+ $svg_args = array(
194
+ 'svg' => array(
195
+ 'class' => true,
196
+ 'aria-hidden' => true,
197
+ 'aria-labelledby' => true,
198
+ 'role' => true,
199
+ 'xmlns' => true,
200
+ 'width' => true,
201
+ 'height' => true,
202
+ 'viewbox' => true, // <= Must be lower case!
203
+ 'id' => true,
204
+ ),
205
+ 'g' => array( 'fill' => true ),
206
+ 'title' => array( 'title' => true ),
207
+ 'path' => array(
208
+ 'd' => true,
209
+ 'fill' => true,
210
+ ),
211
+ 'style' => array( 'type' => true ),
212
+ );
213
+
214
+ echo '<style>';
215
+ echo '.svg-' . absint( $id ) . '{ fill:' . sanitize_hex_color( $color ) . ';}';
216
+ echo '</style>';
217
+ echo '<div class="stars_wrapper">' . wp_kses( $star . $star . $star . $star . $star, $svg_args ) . '</div>';
218
+ }
219
+
220
+ /**
221
+ * @since 1.0.0
222
+ * Columns wrapper start
223
+ *
224
+ * @param int $cols - # of columns the contained objects should be displayed as. (1/2/3)
225
+ */
226
+ public function layout_start( $cols = 2, $class = '' ) {
227
+ echo '<div class="' . esc_attr( $class ) . ' block-row block-row-' . absint( $cols ) . '">';
228
+ }
229
+
230
+ /**
231
+ * @since 1.0.0
232
+ * Columns wrapper end
233
+ */
234
+ public function layout_end() {
235
+ echo '</div>';
236
+ }
237
+
238
+ /**
239
+ * @since 1.0.0
240
+ * Renders empty space block
241
+ *
242
+ * @param int $height - height(px) of space
243
+ */
244
+ public function display_empty_space( $height = 25 ) {
245
+
246
+ echo '<div class="wpchill_empty_space" style="height:' . esc_attr( $height ) . 'px;"></div>';
247
+ }
248
+
249
+ /**
250
+ * Horizontal delimiter
251
+ *
252
+ * @return void
253
+ * @since 1.0.0
254
+ */
255
+ public function horizontal_delimiter() {
256
+ echo '<hr class="wpchill_horizontal_delimiter">';
257
+ }
258
+
259
+ }
260
+ }
includes/submodules/banner/readme.txt CHANGED
@@ -1 +1 @@
1
- Readme
1
+ Readme
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: wpchill, silkalns, barrykooij, mikejolley
3
  Tags: download manager, document management, file manager, digital store, ecommerce, document management plugin, download monitor, download counter, password protection, download protection, password, protect downloads, tracker, sell, shop, ecommerce, paypal
4
  Requires at least: 5.4
5
  Tested up to: 6.0
6
- Stable tag: 4.5.92
7
  License: GPLv3
8
  Text Domain: -
9
  Requires PHP: 5.6
3
  Tags: download manager, document management, file manager, digital store, ecommerce, document management plugin, download monitor, download counter, password protection, download protection, password, protect downloads, tracker, sell, shop, ecommerce, paypal
4
  Requires at least: 5.4
5
  Tested up to: 6.0
6
+ Stable tag: 4.5.93
7
  License: GPLv3
8
  Text Domain: -
9
  Requires PHP: 5.6
src/Admin/CategoryWalker.php CHANGED
@@ -1,53 +1,53 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
-
6
- /**
7
- * DLM_Category_Walker class.
8
- *
9
- * @extends Walker
10
- */
11
- class DLM_Category_Walker extends Walker {
12
-
13
- var $tree_type = 'category';
14
- var $db_fields = array( 'parent' => 'parent', 'id' => 'term_id', 'slug' => 'slug' );
15
-
16
- /**
17
- * @see Walker::start_el()
18
- * @since 2.1.0
19
- *
20
- * @param string $output Passed by reference. Used to append additional content.
21
- * @param object $category Category data object.
22
- * @param int $depth Depth of category in reference to parents.
23
- * @param array $args
24
- */
25
- function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
26
-
27
- if ( ! empty( $args['hierarchical'] ) ) {
28
- $pad = str_repeat( '&nbsp;', $depth * 3 );
29
- } else {
30
- $pad = '';
31
- }
32
-
33
- $cat_name = apply_filters( 'list_product_cats', $object->name, $object );
34
-
35
- $value = isset( $args['value'] ) && $args['value'] == 'id' ? $object->term_id : $object->slug;
36
-
37
- $output .= "\t<option class=\"level-$depth\" value=\"" . $value . "\"";
38
-
39
- if ( $value == $args['selected'] || ( is_array( $args['selected'] ) && in_array( $value, $args['selected'] ) ) ) {
40
- $output .= ' selected="selected"';
41
- }
42
-
43
- $output .= '>';
44
-
45
- $output .= $pad . __( $cat_name, 'download-monitor' );
46
-
47
- if ( ! empty( $args['show_count'] ) ) {
48
- $output .= '&nbsp;(' . $object->count . ')';
49
- }
50
-
51
- $output .= "</option>\n";
52
- }
53
  }
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+
6
+ /**
7
+ * DLM_Category_Walker class.
8
+ *
9
+ * @extends Walker
10
+ */
11
+ class DLM_Category_Walker extends Walker {
12
+
13
+ var $tree_type = 'category';
14
+ var $db_fields = array( 'parent' => 'parent', 'id' => 'term_id', 'slug' => 'slug' );
15
+
16
+ /**
17
+ * @see Walker::start_el()
18
+ * @since 2.1.0
19
+ *
20
+ * @param string $output Passed by reference. Used to append additional content.
21
+ * @param object $category Category data object.
22
+ * @param int $depth Depth of category in reference to parents.
23
+ * @param array $args
24
+ */
25
+ function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
26
+
27
+ if ( ! empty( $args['hierarchical'] ) ) {
28
+ $pad = str_repeat( '&nbsp;', $depth * 3 );
29
+ } else {
30
+ $pad = '';
31
+ }
32
+
33
+ $cat_name = apply_filters( 'list_product_cats', $object->name, $object );
34
+
35
+ $value = isset( $args['value'] ) && $args['value'] == 'id' ? $object->term_id : $object->slug;
36
+
37
+ $output .= "\t<option class=\"level-$depth\" value=\"" . $value . "\"";
38
+
39
+ if ( $value == $args['selected'] || ( is_array( $args['selected'] ) && in_array( $value, $args['selected'] ) ) ) {
40
+ $output .= ' selected="selected"';
41
+ }
42
+
43
+ $output .= '>';
44
+
45
+ $output .= $pad . __( $cat_name, 'download-monitor' );
46
+
47
+ if ( ! empty( $args['show_count'] ) ) {
48
+ $output .= '&nbsp;(' . $object->count . ')';
49
+ }
50
+
51
+ $output .= "</option>\n";
52
+ }
53
  }
src/Admin/CustomColumns.php CHANGED
@@ -6,7 +6,7 @@ class DLM_Custom_Columns {
6
  add_filter( 'manage_edit-dlm_download_columns', array( $this, 'add_columns' ) );
7
  add_action( 'manage_dlm_download_posts_custom_column', array( $this, 'column_data' ), 2 );
8
  add_filter( 'manage_edit-dlm_download_sortable_columns', array( $this, 'sortable_columns' ) );
9
- add_filter( 'the_title', array( $this, 'prepend_id_to_title' ), 10, 2 );
10
  add_filter( 'list_table_primary_column', array( $this, 'set_primary_column_name' ), 10, 2 );
11
  }
12
 
@@ -67,16 +67,20 @@ class DLM_Custom_Columns {
67
  /** @var DLM_Download_Version $file */
68
  $file = $download->get_version();
69
 
 
 
 
 
70
  $wp_list_table->column_title( $post );
71
 
72
- if ( $file ) {
73
  echo '<a class="dlm-file-link" href="' . esc_url( $download->get_the_download_link() ) . '"><code>' . esc_html( $file->get_filename() );
74
  if ( $size = $download->get_version()->get_filesize_formatted() ) {
75
  echo ' &ndash; ' . esc_html( $size );
76
  }
77
  echo '</code></a>';
78
  } else {
79
- echo '<span class="na">&ndash;</span>';
80
  }
81
 
82
  break;
@@ -176,13 +180,18 @@ class DLM_Custom_Columns {
176
  *
177
  * @return string
178
  */
179
- public function prepend_id_to_title( $title, $id){
180
- if( 'dlm_download' === get_post_type( $id ) ) {
 
 
 
 
 
181
  return '#' . $id . ' - ' . $title;
182
  }
183
 
184
- return $title;
185
- }
186
 
187
  /**
188
  * Defaults the primary column name to 'download_title'
6
  add_filter( 'manage_edit-dlm_download_columns', array( $this, 'add_columns' ) );
7
  add_action( 'manage_dlm_download_posts_custom_column', array( $this, 'column_data' ), 2 );
8
  add_filter( 'manage_edit-dlm_download_sortable_columns', array( $this, 'sortable_columns' ) );
9
+ add_filter( 'the_title', array( $this, 'prepend_id_to_title' ), 15, 2 );
10
  add_filter( 'list_table_primary_column', array( $this, 'set_primary_column_name' ), 10, 2 );
11
  }
12
 
67
  /** @var DLM_Download_Version $file */
68
  $file = $download->get_version();
69
 
70
+ if ( ! $wp_list_table ) {
71
+ $wp_list_table = _get_list_table( 'WP_Posts_List_Table' );
72
+ }
73
+
74
  $wp_list_table->column_title( $post );
75
 
76
+ if ( $file->get_filename() ) {
77
  echo '<a class="dlm-file-link" href="' . esc_url( $download->get_the_download_link() ) . '"><code>' . esc_html( $file->get_filename() );
78
  if ( $size = $download->get_version()->get_filesize_formatted() ) {
79
  echo ' &ndash; ' . esc_html( $size );
80
  }
81
  echo '</code></a>';
82
  } else {
83
+ echo '<div class="dlm-listing-no-file"><code>No file provided</code></div>';
84
  }
85
 
86
  break;
180
  *
181
  * @return string
182
  */
183
+ public function prepend_id_to_title( $title, $id = null ) {
184
+
185
+ if ( ! isset( $id ) ) {
186
+ $id = get_the_ID();
187
+ }
188
+
189
+ if ( 'dlm_download' === get_post_type( $id ) ) {
190
  return '#' . $id . ' - ' . $title;
191
  }
192
 
193
+ return $title;
194
+ }
195
 
196
  /**
197
  * Defaults the primary column name to 'download_title'
src/Admin/CustomLabels.php CHANGED
@@ -1,60 +1,60 @@
1
- <?php
2
-
3
- class DLM_Custom_Labels {
4
-
5
- /**
6
- * Setup custom labels
7
- */
8
- public function setup() {
9
- add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 );
10
- add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
11
- }
12
-
13
- /**
14
- * enter_title_here function.
15
- *
16
- * @param string $text
17
- * @param WP_Post $post
18
- *
19
- * @access public
20
- * @return string
21
- */
22
- public function enter_title_here( $text, $post ) {
23
- if ( 'dlm_download' == $post->post_type ) {
24
- return __( 'Download title', 'download-monitor' );
25
- }
26
-
27
- return $text;
28
- }
29
-
30
- /**
31
- * post_updated_messages function.
32
- *
33
- * @access public
34
- *
35
- * @param array $messages
36
- *
37
- * @return array
38
- */
39
- public function post_updated_messages( $messages ) {
40
- global $post;
41
-
42
- $messages['dlm_download'] = array(
43
- 0 => '', // Unused. Messages start at index 1.
44
- 1 => __( 'Download updated.', 'download-monitor' ),
45
- 2 => __( 'Custom field updated.', 'download-monitor' ),
46
- 3 => __( 'Custom field deleted.', 'download-monitor' ),
47
- 4 => __( 'Download updated.', 'download-monitor' ),
48
- 5 => isset( $_GET['revision'] ) ? sprintf( esc_html__( 'Download restored to revision from %s', 'download-monitor' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
49
- 6 => __( 'Download published.', 'download-monitor' ),
50
- 7 => __( 'Download saved.', 'download-monitor' ),
51
- 8 => __( 'Download submitted.', 'download-monitor' ),
52
- 9 => sprintf( __( 'Download scheduled for: <strong>%1$s</strong>.', 'download-monitor' ),
53
- date_i18n( __( 'M j, Y @ G:i', 'download-monitor' ), strtotime( $post->post_date ) ) ),
54
- 10 => __( 'Download draft updated.', 'download-monitor' ),
55
- );
56
-
57
- return $messages;
58
- }
59
-
60
  }
1
+ <?php
2
+
3
+ class DLM_Custom_Labels {
4
+
5
+ /**
6
+ * Setup custom labels
7
+ */
8
+ public function setup() {
9
+ add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 );
10
+ add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
11
+ }
12
+
13
+ /**
14
+ * enter_title_here function.
15
+ *
16
+ * @param string $text
17
+ * @param WP_Post $post
18
+ *
19
+ * @access public
20
+ * @return string
21
+ */
22
+ public function enter_title_here( $text, $post ) {
23
+ if ( 'dlm_download' == $post->post_type ) {
24
+ return __( 'Download title', 'download-monitor' );
25
+ }
26
+
27
+ return $text;
28
+ }
29
+
30
+ /**
31
+ * post_updated_messages function.
32
+ *
33
+ * @access public
34
+ *
35
+ * @param array $messages
36
+ *
37
+ * @return array
38
+ */
39
+ public function post_updated_messages( $messages ) {
40
+ global $post;
41
+
42
+ $messages['dlm_download'] = array(
43
+ 0 => '', // Unused. Messages start at index 1.
44
+ 1 => __( 'Download updated.', 'download-monitor' ),
45
+ 2 => __( 'Custom field updated.', 'download-monitor' ),
46
+ 3 => __( 'Custom field deleted.', 'download-monitor' ),
47
+ 4 => __( 'Download updated.', 'download-monitor' ),
48
+ 5 => isset( $_GET['revision'] ) ? sprintf( esc_html__( 'Download restored to revision from %s', 'download-monitor' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
49
+ 6 => __( 'Download published.', 'download-monitor' ),
50
+ 7 => __( 'Download saved.', 'download-monitor' ),
51
+ 8 => __( 'Download submitted.', 'download-monitor' ),
52
+ 9 => sprintf( __( 'Download scheduled for: <strong>%1$s</strong>.', 'download-monitor' ),
53
+ date_i18n( __( 'M j, Y @ G:i', 'download-monitor' ), strtotime( $post->post_date ) ) ),
54
+ 10 => __( 'Download draft updated.', 'download-monitor' ),
55
+ );
56
+
57
+ return $messages;
58
+ }
59
+
60
  }
src/Admin/OptionsUpsells.php CHANGED
@@ -1,96 +1,96 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- } // Exit if accessed directly
6
-
7
- /**
8
- * DLM_Admin class.
9
- */
10
- class DLM_Admin_OptionsUpsells {
11
-
12
- /**
13
- * __construct function.
14
- *
15
- * @access public
16
- */
17
- public function __construct() {
18
- add_action( 'dlm_options_end', array( $this, 'add_upsells_products' ), 99 );
19
- }
20
-
21
- public function get_active_addons(){
22
-
23
- return DLM_Product_Manager::get()->get_products();
24
- }
25
-
26
- public function add_upsells_products(){
27
-
28
- $active_addons = $this->get_active_addons();
29
-
30
- if( !array_key_exists( 'dlm-terms-and-conditions', $active_addons ) ){
31
- $this->render_terms_and_conditions_upsell();
32
- }
33
-
34
- if( !array_key_exists( 'dlm-twitter-lock', $active_addons ) ){
35
- $this->render_twitter_lock_upsell();
36
- }
37
-
38
- if( !array_key_exists( 'dlm-email-lock', $active_addons ) ){
39
- $this->render_email_lock_upsell();
40
- }
41
-
42
- if( !array_key_exists( 'dlm-captcha', $active_addons ) ){
43
- $this->render_captcha_upsell();
44
- }
45
-
46
-
47
- }
48
-
49
- public function render_terms_and_conditions_upsell(){
50
- ?>
51
- <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Terms%20and%20Conditions' ); ?>" class="options_upsell_link" target="_blank">
52
- <p class="form-field form-field-checkbox not-active">
53
- <span class="dashicons dashicons-lock"></span>
54
- <span><?php esc_html_e( 'Terms &amp; Conditions Required', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span> </span>
55
- <span class="dlm-description"> <?php esc_html_e( 'This download will only be downloadable after accepting the terms and conditions.', 'download-monitor' ); ?></span>
56
- </p>
57
- </a>
58
- <?php
59
- }
60
-
61
- public function render_twitter_lock_upsell(){
62
- ?>
63
- <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Twitter%20Lock' ); ?>" class="options_upsell_link" target="_blank">
64
- <p class="form-field form-field-checkbox not-active">
65
- <span class="dashicons dashicons-lock"></span>
66
- <span><?php esc_html_e( 'Twitter Lock', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span></span>
67
- <span class="dlm-description"> <?php esc_html_e( 'Twitter locked downloads will only be available after user tweets a predefined text.', 'download-monitor' ); ?></span>
68
- </p>
69
- </a>
70
- <?php
71
- }
72
-
73
- public function render_email_lock_upsell(){
74
- ?>
75
- <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Email%20Lock' ); ?>" class="options_upsell_link" target="_blank">
76
- <p class="form-field form-field-checkbox not-active">
77
- <span class="dashicons dashicons-lock"></span>
78
- <span><?php esc_html_e( 'Email Lock', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span></span>
79
- <span class="dlm-description"> <?php esc_html_e( 'Email locked downloads will only be available after user entered their email address.', 'download-monitor' ); ?></span>
80
- </p>
81
- </a>
82
- <?php
83
- }
84
-
85
- public function render_captcha_upsell(){
86
- ?>
87
- <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Captcha' ); ?>" class="options_upsell_link" target="_blank">
88
- <p class="form-field form-field-checkbox not-active">
89
- <span class="dashicons dashicons-lock"></span>
90
- <span><?php esc_html_e( 'Require Captcha', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span></span>
91
- <span class="dlm-description"> <?php esc_html_e( 'User is required to complete a reCAPTCHA before access is granted to the dowload.', 'download-monitor' ); ?></span>
92
- </p>
93
- </a>
94
- <?php
95
- }
96
  }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ /**
8
+ * DLM_Admin class.
9
+ */
10
+ class DLM_Admin_OptionsUpsells {
11
+
12
+ /**
13
+ * __construct function.
14
+ *
15
+ * @access public
16
+ */
17
+ public function __construct() {
18
+ add_action( 'dlm_options_end', array( $this, 'add_upsells_products' ), 99 );
19
+ }
20
+
21
+ public function get_active_addons(){
22
+
23
+ return DLM_Product_Manager::get()->get_products();
24
+ }
25
+
26
+ public function add_upsells_products(){
27
+
28
+ $active_addons = $this->get_active_addons();
29
+
30
+ if( !array_key_exists( 'dlm-terms-and-conditions', $active_addons ) ){
31
+ $this->render_terms_and_conditions_upsell();
32
+ }
33
+
34
+ if( !array_key_exists( 'dlm-twitter-lock', $active_addons ) ){
35
+ $this->render_twitter_lock_upsell();
36
+ }
37
+
38
+ if( !array_key_exists( 'dlm-email-lock', $active_addons ) ){
39
+ $this->render_email_lock_upsell();
40
+ }
41
+
42
+ if( !array_key_exists( 'dlm-captcha', $active_addons ) ){
43
+ $this->render_captcha_upsell();
44
+ }
45
+
46
+
47
+ }
48
+
49
+ public function render_terms_and_conditions_upsell(){
50
+ ?>
51
+ <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Terms%20and%20Conditions' ); ?>" class="options_upsell_link" target="_blank">
52
+ <p class="form-field form-field-checkbox not-active">
53
+ <span class="dashicons dashicons-lock"></span>
54
+ <span><?php esc_html_e( 'Terms &amp; Conditions Required', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span> </span>
55
+ <span class="dlm-description"> <?php esc_html_e( 'This download will only be downloadable after accepting the terms and conditions.', 'download-monitor' ); ?></span>
56
+ </p>
57
+ </a>
58
+ <?php
59
+ }
60
+
61
+ public function render_twitter_lock_upsell(){
62
+ ?>
63
+ <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Twitter%20Lock' ); ?>" class="options_upsell_link" target="_blank">
64
+ <p class="form-field form-field-checkbox not-active">
65
+ <span class="dashicons dashicons-lock"></span>
66
+ <span><?php esc_html_e( 'Twitter Lock', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span></span>
67
+ <span class="dlm-description"> <?php esc_html_e( 'Twitter locked downloads will only be available after user tweets a predefined text.', 'download-monitor' ); ?></span>
68
+ </p>
69
+ </a>
70
+ <?php
71
+ }
72
+
73
+ public function render_email_lock_upsell(){
74
+ ?>
75
+ <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Email%20Lock' ); ?>" class="options_upsell_link" target="_blank">
76
+ <p class="form-field form-field-checkbox not-active">
77
+ <span class="dashicons dashicons-lock"></span>
78
+ <span><?php esc_html_e( 'Email Lock', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span></span>
79
+ <span class="dlm-description"> <?php esc_html_e( 'Email locked downloads will only be available after user entered their email address.', 'download-monitor' ); ?></span>
80
+ </p>
81
+ </a>
82
+ <?php
83
+ }
84
+
85
+ public function render_captcha_upsell(){
86
+ ?>
87
+ <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Captcha' ); ?>" class="options_upsell_link" target="_blank">
88
+ <p class="form-field form-field-checkbox not-active">
89
+ <span class="dashicons dashicons-lock"></span>
90
+ <span><?php esc_html_e( 'Require Captcha', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span></span>
91
+ <span class="dlm-description"> <?php esc_html_e( 'User is required to complete a reCAPTCHA before access is granted to the dowload.', 'download-monitor' ); ?></span>
92
+ </p>
93
+ </a>
94
+ <?php
95
+ }
96
  }
src/Admin/Settings/Fields/ActionButton.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php
2
-
3
- class DLM_Admin_Fields_Field_ActionButton extends DLM_Admin_Fields_Field {
4
-
5
- /** @var string */
6
- private $link;
7
-
8
- /** @var string */
9
- private $label;
10
-
11
- /**
12
- * DLM_Admin_Fields_Field constructor.
13
- *
14
- * @param String $name
15
- * @param String $link
16
- * @param String $label
17
- */
18
- public function __construct( $name, $link, $label ) {
19
- $this->link = $link;
20
- $this->label = $label;
21
- parent::__construct( $name, '', '' );
22
- }
23
-
24
- /**
25
- * Generate nonce
26
- *
27
- * @return string
28
- */
29
- private function generate_nonce() {
30
- return wp_create_nonce( $this->get_name() );
31
- }
32
-
33
- /**
34
- * Get prepped URL
35
- *
36
- * @return string
37
- */
38
- private function get_url() {
39
- return add_query_arg( array(
40
- 'dlm_action' => $this->get_name(),
41
- 'dlm_nonce' => $this->generate_nonce()
42
- ), $this->link );
43
- }
44
-
45
- /**
46
- * Renders field
47
- *
48
- * The Button is quite an odd 'field'. It's basically just an a tag.
49
- */
50
- public function render() {
51
- ?>
52
- <a class="button" href="<?php echo esc_url( $this->get_url() ); ?>"><?php echo esc_html( $this->label ); ?></a>
53
- <?php
54
- }
55
-
56
  }
1
+ <?php
2
+
3
+ class DLM_Admin_Fields_Field_ActionButton extends DLM_Admin_Fields_Field {
4
+
5
+ /** @var string */
6
+ private $link;
7
+
8
+ /** @var string */
9
+ private $label;
10
+
11
+ /**
12
+ * DLM_Admin_Fields_Field constructor.
13
+ *
14
+ * @param String $name
15
+ * @param String $link
16
+ * @param String $label
17
+ */
18
+ public function __construct( $name, $link, $label ) {
19
+ $this->link = $link;
20
+ $this->label = $label;
21
+ parent::__construct( $name, '', '' );
22
+ }
23
+
24
+ /**
25
+ * Generate nonce
26
+ *
27
+ * @return string
28
+ */
29
+ private function generate_nonce() {
30
+ return wp_create_nonce( $this->get_name() );
31
+ }
32
+
33
+ /**
34
+ * Get prepped URL
35
+ *
36
+ * @return string
37
+ */
38
+ private function get_url() {
39
+ return add_query_arg( array(
40
+ 'dlm_action' => $this->get_name(),
41
+ 'dlm_nonce' => $this->generate_nonce()
42
+ ), $this->link );
43
+ }
44
+
45
+ /**
46
+ * Renders field
47
+ *
48
+ * The Button is quite an odd 'field'. It's basically just an a tag.
49
+ */
50
+ public function render() {
51
+ ?>
52
+ <a class="button" href="<?php echo esc_url( $this->get_url() ); ?>"><?php echo esc_html( $this->label ); ?></a>
53
+ <?php
54
+ }
55
+
56
  }
src/Admin/Settings/Fields/Desc.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- class DLM_Admin_Fields_Field_Desc extends DLM_Admin_Fields_Field {
4
-
5
- /**
6
- * Renders field
7
- */
8
- public function render() {
9
- ?>
10
- <p class="dlm-setting-field-description"><?php echo wp_kses_post( $this->get_value() ); ?></p>
11
- <?php
12
- }
13
-
14
  }
1
+ <?php
2
+
3
+ class DLM_Admin_Fields_Field_Desc extends DLM_Admin_Fields_Field {
4
+
5
+ /**
6
+ * Renders field
7
+ */
8
+ public function render() {
9
+ ?>
10
+ <p class="dlm-setting-field-description"><?php echo wp_kses_post( $this->get_value() ); ?></p>
11
+ <?php
12
+ }
13
+
14
  }
src/Admin/Settings/Fields/Title.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
-
3
- class DLM_Admin_Fields_Field_Title extends DLM_Admin_Fields_Field {
4
-
5
- /** @var string */
6
- private $link;
7
-
8
- /** @var string */
9
- private $title;
10
-
11
- /**
12
- * DLM_Admin_Fields_Field_Title constructor.
13
- *
14
- * @param String $title
15
- */
16
- public function __construct( $title ) {
17
- $this->title = $title;
18
- parent::__construct( '', '', '' );
19
- }
20
-
21
- /**
22
- * Renders field
23
- */
24
- public function render() {
25
- ?>
26
- <h3><?php echo esc_html( $this->title ); ?></h3>
27
- <?php
28
- }
29
-
30
  }
1
+ <?php
2
+
3
+ class DLM_Admin_Fields_Field_Title extends DLM_Admin_Fields_Field {
4
+
5
+ /** @var string */
6
+ private $link;
7
+
8
+ /** @var string */
9
+ private $title;
10
+
11
+ /**
12
+ * DLM_Admin_Fields_Field_Title constructor.
13
+ *
14
+ * @param String $title
15
+ */
16
+ public function __construct( $title ) {
17
+ $this->title = $title;
18
+ parent::__construct( '', '', '' );
19
+ }
20
+
21
+ /**
22
+ * Renders field
23
+ */
24
+ public function render() {
25
+ ?>
26
+ <h3><?php echo esc_html( $this->title ); ?></h3>
27
+ <?php
28
+ }
29
+
30
  }
src/Admin/Settings/Page.php CHANGED
@@ -453,6 +453,10 @@ class DLM_Settings_Page {
453
  */
454
  public function access_files_checker_field( $settings ){
455
 
 
 
 
 
456
  $upload_dir = wp_upload_dir();
457
  $htaccess_path = $upload_dir['basedir'] . '/dlm_uploads/.htaccess';
458
  $icon = 'dashicons-dismiss';
@@ -551,38 +555,62 @@ Deny from all
551
  */
552
  public function robots_files_checker_field( $settings ) {
553
 
554
- $robots_file = "{$_SERVER['DOCUMENT_ROOT']}/robots.txt";
555
- $page = wp_remote_get( get_home_url() . '/robots.txt');
556
- $has_virtual_robots = 'undetermined';
 
 
557
 
558
- if ( ! is_wp_error( $page ) && is_array( $page ) ) {
559
- $has_virtual_robots = false !== strpos( $page['headers']['content-type'], 'text/plain' );
 
 
 
 
 
 
560
  }
561
 
562
- if ( ! file_exists( $robots_file ) ) {
 
563
  $icon = 'dashicons-dismiss';
564
  $icon_color = '#f00';
565
  $icon_text = __( 'Robots.txt is missing.', 'download-monitor' );
 
566
 
567
  if ( $has_virtual_robots && 'undetermined' !== $has_virtual_robots ) {
 
568
  $icon_text = __( 'Robots.txt file is missing but site has virtual Robots.txt file. If you regenerate this you will loose the restrictions set in the virtual one. Please either update the virtual with the corresponding rules for dlm_uploads or regenerate and update the newly created one with the contents from the virtual file.', 'download-monitor' );
 
569
  }
570
 
571
  if ( $has_virtual_robots && 'undetermined' === $has_virtual_robots ) {
 
572
  $icon_text = __( 'Robots.txt file is missing but site may have virtual Robots.txt file. If you regenerate this you will loose the restrictions set in the virtual one. Please either update the virtual with the corresponding rules for dlm_uploads or regenerate and update the newly created one with the contents from the virtual file.', 'download-monitor' );
 
573
  }
574
  } else {
575
-
576
- $content = file_get_contents( $robots_file );
577
- if ( stristr( $content, 'dlm_uploads' ) ) {
578
- $icon = 'dashicons-yes-alt';
579
- $icon_color = '#00A32A';
580
- $icon_text = __( 'You are protected by robots.txt.', 'download-monitor' );
581
- } else {
582
- $icon = 'dashicons-dismiss';
583
- $icon_color = '#f00';
584
- $icon_text = __( 'Robots.txt file exists but dlm_uploads folder is not protected.', 'download-monitor' );
 
 
 
 
 
 
 
 
 
585
  }
 
586
  }
587
 
588
  $settings['advanced']['sections']['misc']['fields'][] = array(
@@ -590,14 +618,15 @@ Deny from all
590
  'label' => __( 'Regenerate crawler protection for uploads folder', 'download-monitor' ),
591
  'desc' => __( 'Regenerates the robots.txt file.', 'download-monitor' ),
592
  'link' => admin_url( 'edit.php?post_type=dlm_download&page=download-monitor-settings' ) . '&tab=advanced&section=misc',
593
- 'icon' => $icon,
594
- 'icon-color' => $icon_color,
595
- 'icon-text' => $icon_text,
596
  'disabled' => isset( $disabled ) ? 'true' : 'false',
597
  'type' => 'htaccess_status',
598
  'priority' => 40
599
  );
600
 
 
601
  return $settings;
602
  }
603
 
@@ -610,6 +639,8 @@ Deny from all
610
  */
611
  private function regenerate_robots(){
612
 
 
 
613
  $robots_file = "{$_SERVER['DOCUMENT_ROOT']}/robots.txt";
614
  if( ! file_exists( $robots_file ) ) {
615
  $txt = 'User-agent: *' . "\n" . 'Disallow: /dlm_uploads/';
@@ -627,13 +658,49 @@ Deny from all
627
  $txt = 'User-agent: *' . "\n" . 'Disallow: /dlm_uploads/' . "\n\n" . $content;
628
 
629
  fwrite( $dlm_robots, $txt );
630
-
631
  return true;
632
  }
633
  }
634
-
635
  return false;
636
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
637
  }
638
 
639
 
453
  */
454
  public function access_files_checker_field( $settings ){
455
 
456
+ if ( ! self::check_if_dlm_settings() ) {
457
+ return $settings;
458
+ }
459
+
460
  $upload_dir = wp_upload_dir();
461
  $htaccess_path = $upload_dir['basedir'] . '/dlm_uploads/.htaccess';
462
  $icon = 'dashicons-dismiss';
555
  */
556
  public function robots_files_checker_field( $settings ) {
557
 
558
+ if ( ! self::check_if_dlm_settings() ) {
559
+ return $settings;
560
+ }
561
+
562
+ $transient = get_transient( 'dlm_robots_txt' );
563
 
564
+ if( !$transient ){
565
+ $robots_file = "{$_SERVER['DOCUMENT_ROOT']}/robots.txt";
566
+ $page = wp_remote_get( get_home_url() . '/robots.txt');
567
+ $has_virtual_robots = 'undetermined';
568
+
569
+ if ( ! is_wp_error( $page ) && is_array( $page ) ) {
570
+ $has_virtual_robots = false !== strpos( $page['headers']['content-type'], 'text/plain' );
571
+ }
572
  }
573
 
574
+
575
+ if ( ( !$transient ) && ! file_exists( $robots_file ) ) {
576
  $icon = 'dashicons-dismiss';
577
  $icon_color = '#f00';
578
  $icon_text = __( 'Robots.txt is missing.', 'download-monitor' );
579
+ $transient['virtual'] = false;
580
 
581
  if ( $has_virtual_robots && 'undetermined' !== $has_virtual_robots ) {
582
+ $transient['virtual'] = true;
583
  $icon_text = __( 'Robots.txt file is missing but site has virtual Robots.txt file. If you regenerate this you will loose the restrictions set in the virtual one. Please either update the virtual with the corresponding rules for dlm_uploads or regenerate and update the newly created one with the contents from the virtual file.', 'download-monitor' );
584
+ $transient['text'] = $icon_text;
585
  }
586
 
587
  if ( $has_virtual_robots && 'undetermined' === $has_virtual_robots ) {
588
+ $transient['virtual'] = 'maybe';
589
  $icon_text = __( 'Robots.txt file is missing but site may have virtual Robots.txt file. If you regenerate this you will loose the restrictions set in the virtual one. Please either update the virtual with the corresponding rules for dlm_uploads or regenerate and update the newly created one with the contents from the virtual file.', 'download-monitor' );
590
+ $transient['text'] = $icon_text;
591
  }
592
  } else {
593
+ if( !$transient ){
594
+ $content = file_get_contents( $robots_file );
595
+ if ( stristr( $content, 'dlm_uploads' ) ) {
596
+ $icon = 'dashicons-yes-alt';
597
+ $icon_color = '#00A32A';
598
+ $icon_text = __( 'You are protected by robots.txt.', 'download-monitor' );
599
+ $transient['protected'] = true;
600
+ $transient['icon'] = $icon;
601
+ $transient['icon_color'] = $icon_color;
602
+ $transient['text'] = $icon_text;
603
+ } else {
604
+ $icon = 'dashicons-dismiss';
605
+ $icon_color = '#f00';
606
+ $icon_text = __( 'Robots.txt file exists but dlm_uploads folder is not protected.', 'download-monitor' );
607
+ $transient['protected'] = false;
608
+ $transient['icon'] = $icon;
609
+ $transient['icon_color'] = $icon_color;
610
+ $transient['text'] = $icon_text;
611
+ }
612
  }
613
+
614
  }
615
 
616
  $settings['advanced']['sections']['misc']['fields'][] = array(
618
  'label' => __( 'Regenerate crawler protection for uploads folder', 'download-monitor' ),
619
  'desc' => __( 'Regenerates the robots.txt file.', 'download-monitor' ),
620
  'link' => admin_url( 'edit.php?post_type=dlm_download&page=download-monitor-settings' ) . '&tab=advanced&section=misc',
621
+ 'icon' => $transient['icon'],
622
+ 'icon-color' => $transient['icon_color'],
623
+ 'icon-text' => $transient['text'],
624
  'disabled' => isset( $disabled ) ? 'true' : 'false',
625
  'type' => 'htaccess_status',
626
  'priority' => 40
627
  );
628
 
629
+ set_transient( 'dlm_robots_txt', $transient, DAY_IN_SECONDS );
630
  return $settings;
631
  }
632
 
639
  */
640
  private function regenerate_robots(){
641
 
642
+ delete_transient( 'dlm_robots_txt' );
643
+
644
  $robots_file = "{$_SERVER['DOCUMENT_ROOT']}/robots.txt";
645
  if( ! file_exists( $robots_file ) ) {
646
  $txt = 'User-agent: *' . "\n" . 'Disallow: /dlm_uploads/';
658
  $txt = 'User-agent: *' . "\n" . 'Disallow: /dlm_uploads/' . "\n\n" . $content;
659
 
660
  fwrite( $dlm_robots, $txt );
 
661
  return true;
662
  }
663
  }
 
664
  return false;
665
  }
666
+
667
+ /**
668
+ * Undocumented function
669
+ *
670
+ * @return void
671
+ */
672
+ public function redo_upgrade() {
673
+
674
+ global $wp, $wpdb, $pagenow;
675
+
676
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
677
+ return false;
678
+ }
679
+
680
+ // Drop the dlm_reports_log
681
+ $drop_statement = "DROP TABLE IF EXISTS {$wpdb->prefix}dlm_reports_log";
682
+ $wpdb->query( $drop_statement );
683
+
684
+ // Delete upgrade history and set the need DB pgrade
685
+ delete_option( 'dlm_db_upgraded' );
686
+ set_transient( 'dlm_needs_upgrade', '1', 30 * DAY_IN_SECONDS );
687
+
688
+ return true;
689
+ }
690
+
691
+ /**
692
+ * Check if this is Download Monitor's settings page
693
+ *
694
+ * @return bool
695
+ */
696
+ public static function check_if_dlm_settings() {
697
+
698
+ if ( ! isset( $_GET['post_type'] ) || 'dlm_download' !== $_GET['post_type'] || ! isset( $_GET['page'] ) || 'download-monitor-settings' !== $_GET['page'] ) {
699
+ return false;
700
+ }
701
+
702
+ return true;
703
+ }
704
  }
705
 
706
 
src/Admin/ViewManager.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
-
3
- class DLM_View_Manager {
4
-
5
- /**
6
- * Display a view
7
- *
8
- * @param String $view
9
- * @param array $vars
10
- * @param String $path
11
- */
12
- public function display( $view, $vars=array(), $path = '' ) {
13
-
14
- // setup variables
15
- extract( $vars );
16
-
17
- // set default path if $path is empty
18
- if ( empty( $path ) ) {
19
- $path = download_monitor()->get_plugin_path() . 'assets/views/';
20
- }
21
-
22
- // setup full view path
23
- $view = $path . $view . '.php';
24
-
25
- // check if view exists
26
- if ( file_exists( $view ) ) {
27
-
28
- // load view
29
- include( $view );
30
- }
31
- }
32
-
33
  }
1
+ <?php
2
+
3
+ class DLM_View_Manager {
4
+
5
+ /**
6
+ * Display a view
7
+ *
8
+ * @param String $view
9
+ * @param array $vars
10
+ * @param String $path
11
+ */
12
+ public function display( $view, $vars=array(), $path = '' ) {
13
+
14
+ // setup variables
15
+ extract( $vars );
16
+
17
+ // set default path if $path is empty
18
+ if ( empty( $path ) ) {
19
+ $path = download_monitor()->get_plugin_path() . 'assets/views/';
20
+ }
21
+
22
+ // setup full view path
23
+ $view = $path . $view . '.php';
24
+
25
+ // check if view exists
26
+ if ( file_exists( $view ) ) {
27
+
28
+ // load view
29
+ include( $view );
30
+ }
31
+ }
32
+
33
  }
src/Ajax/Ajax.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
-
3
- abstract class DLM_Ajax {
4
- private $tag = '';
5
-
6
- /**
7
- * @param string $tag
8
- */
9
- public function __construct( $tag ) {
10
- $this->tag = $tag;
11
- }
12
-
13
- /**
14
- * Register AJAX action
15
- */
16
- public function register() {
17
- add_action( DLM_Ajax_Manager::ENDPOINT . $this->tag, array( $this, 'run' ) );
18
- }
19
-
20
- /**
21
- * Checks AJAX nonce
22
- */
23
- protected function check_nonce() {
24
- check_ajax_referer( 'dlm_ajax_nonce_' . $this->tag, 'nonce' );
25
- }
26
-
27
- /**
28
- * AJAX callback method, must be overridden
29
- *
30
- * @return void
31
- */
32
- public abstract function run();
33
  }
1
+ <?php
2
+
3
+ abstract class DLM_Ajax {
4
+ private $tag = '';
5
+
6
+ /**
7
+ * @param string $tag
8
+ */
9
+ public function __construct( $tag ) {
10
+ $this->tag = $tag;
11
+ }
12
+
13
+ /**
14
+ * Register AJAX action
15
+ */
16
+ public function register() {
17
+ add_action( DLM_Ajax_Manager::ENDPOINT . $this->tag, array( $this, 'run' ) );
18
+ }
19
+
20
+ /**
21
+ * Checks AJAX nonce
22
+ */
23
+ protected function check_nonce() {
24
+ check_ajax_referer( 'dlm_ajax_nonce_' . $this->tag, 'nonce' );
25
+ }
26
+
27
+ /**
28
+ * AJAX callback method, must be overridden
29
+ *
30
+ * @return void
31
+ */
32
+ public abstract function run();
33
  }
src/Ajax/GetDownloads.php CHANGED
@@ -1,41 +1,41 @@
1
- <?php
2
-
3
- class DLM_Ajax_GetDownloads extends DLM_Ajax {
4
-
5
- /**
6
- * Constructor
7
- */
8
- public function __construct() {
9
- parent::__construct( 'get_downloads' );
10
- }
11
-
12
- /**
13
- * AJAX callback method
14
- *
15
- * @return void
16
- */
17
- public function run() {
18
- // check nonce
19
- $this->check_nonce();
20
-
21
- $downloads = download_monitor()->service( 'download_repository' )->retrieve( array(
22
- 'orderby' => 'title',
23
- 'order' => 'ASC'
24
- ) );
25
- $downloads_array = array();
26
- if ( ! empty( $downloads ) ) {
27
- /** @var DLM_Download $download */
28
- foreach ( $downloads as $download ) {
29
- $downloads_array[] = array(
30
- 'value' => $download->get_id(),
31
- 'label' => $download->get_title()
32
- );
33
- }
34
- }
35
-
36
- wp_send_json( $downloads_array );
37
-
38
- exit;
39
- }
40
-
41
  }
1
+ <?php
2
+
3
+ class DLM_Ajax_GetDownloads extends DLM_Ajax {
4
+
5
+ /**
6
+ * Constructor
7
+ */
8
+ public function __construct() {
9
+ parent::__construct( 'get_downloads' );
10
+ }
11
+
12
+ /**
13
+ * AJAX callback method
14
+ *
15
+ * @return void
16
+ */
17
+ public function run() {
18
+ // check nonce
19
+ $this->check_nonce();
20
+
21
+ $downloads = download_monitor()->service( 'download_repository' )->retrieve( array(
22
+ 'orderby' => 'title',
23
+ 'order' => 'ASC'
24
+ ) );
25
+ $downloads_array = array();
26
+ if ( ! empty( $downloads ) ) {
27
+ /** @var DLM_Download $download */
28
+ foreach ( $downloads as $download ) {
29
+ $downloads_array[] = array(
30
+ 'value' => $download->get_id(),
31
+ 'label' => $download->get_title()
32
+ );
33
+ }
34
+ }
35
+
36
+ wp_send_json( $downloads_array );
37
+
38
+ exit;
39
+ }
40
+
41
  }
src/Ajax/Manager.php CHANGED
@@ -1,85 +1,85 @@
1
- <?php
2
-
3
- class DLM_Ajax_Manager {
4
- const ENDPOINT = 'dlm-ajax';
5
-
6
- /**a
7
- * Setup custom AJAX calls & custom AJAX handler
8
- */
9
- public function setup() {
10
- add_action( 'init', array( $this, 'add_endpoints' ) );
11
- add_action( 'template_redirect', array( $this, 'handle_ajax' ), 0 );
12
- $this->add_ajax_actions();
13
- }
14
-
15
- /**
16
- * Add endpoints
17
- */
18
- public function add_endpoints() {
19
- add_rewrite_tag( '%' . self::ENDPOINT . '%', '([^/]*)' );
20
- add_rewrite_rule( self::ENDPOINT . '/([^/]*)/?', 'index.php?' . self::ENDPOINT . '=$matches[1]', 'top' );
21
- add_rewrite_rule( 'index.php/' . self::ENDPOINT . '/([^/]*)/?', 'index.php?' . self::ENDPOINT . '=$matches[1]', 'top' );
22
- }
23
-
24
- /**
25
- * Get AJAX for given ajax
26
- *
27
- * @param string $action
28
- * @param bool $include_nonce
29
- *
30
- * @return string
31
- */
32
- public static function get_ajax_url( $action, $include_nonce = true ) {
33
- return untrailingslashit( home_url( sprintf( '?%s=%s&nonce=%s', self::ENDPOINT, $action, wp_create_nonce( 'dlm_ajax_nonce_' . $action ) ) ) );
34
- }
35
-
36
- /**
37
- * Add AJAX actions
38
- */
39
- private function add_ajax_actions() {
40
-
41
- $get_downloads = new DLM_Ajax_GetDownloads();
42
- $get_downloads->register();
43
-
44
- $get_versions = new DLM_Ajax_GetVersions();
45
- $get_versions->register();
46
-
47
- $create_page = new DLM_Ajax_CreatePage();
48
- $create_page->register();
49
-
50
- }
51
-
52
- /**
53
- * Handle AJAX requests
54
- */
55
- public function handle_ajax() {
56
- global $wp_query;
57
-
58
- // set AJAX action if it's set in $_GET
59
- if ( ! empty( $_GET[ self::ENDPOINT ] ) ) {
60
- $wp_query->set( self::ENDPOINT, sanitize_text_field( wp_unslash($_GET[ self::ENDPOINT ]) ) );
61
- }
62
-
63
- // check if endpoint is not false or an empty string
64
- if ( false != $wp_query->get( self::ENDPOINT ) && '' != trim( $wp_query->get( self::ENDPOINT ) ) ) {
65
-
66
- // set AJAX action into var
67
- $action = sanitize_text_field( $wp_query->get( self::ENDPOINT ) );
68
-
69
- // set DOING AJAX to true
70
- if ( ! defined( 'DOING_AJAX' ) ) {
71
- define( 'DOING_AJAX', true );
72
- }
73
-
74
- // set is_home to false
75
- $wp_query->is_home = false;
76
-
77
- // run custom AJAX action
78
- do_action( self::ENDPOINT . $action );
79
-
80
- // bye
81
- die();
82
-
83
- }
84
- }
85
  }
1
+ <?php
2
+
3
+ class DLM_Ajax_Manager {
4
+ const ENDPOINT = 'dlm-ajax';
5
+
6
+ /**a
7
+ * Setup custom AJAX calls & custom AJAX handler
8
+ */
9
+ public function setup() {
10
+ add_action( 'init', array( $this, 'add_endpoints' ) );
11
+ add_action( 'template_redirect', array( $this, 'handle_ajax' ), 0 );
12
+ $this->add_ajax_actions();
13
+ }
14
+
15
+ /**
16
+ * Add endpoints
17
+ */
18
+ public function add_endpoints() {
19
+ add_rewrite_tag( '%' . self::ENDPOINT . '%', '([^/]*)' );
20
+ add_rewrite_rule( self::ENDPOINT . '/([^/]*)/?', 'index.php?' . self::ENDPOINT . '=$matches[1]', 'top' );
21
+ add_rewrite_rule( 'index.php/' . self::ENDPOINT . '/([^/]*)/?', 'index.php?' . self::ENDPOINT . '=$matches[1]', 'top' );
22
+ }
23
+
24
+ /**
25
+ * Get AJAX for given ajax
26
+ *
27
+ * @param string $action
28
+ * @param bool $include_nonce
29
+ *
30
+ * @return string
31
+ */
32
+ public static function get_ajax_url( $action, $include_nonce = true ) {
33
+ return untrailingslashit( home_url( sprintf( '?%s=%s&nonce=%s', self::ENDPOINT, $action, wp_create_nonce( 'dlm_ajax_nonce_' . $action ) ) ) );
34
+ }
35
+
36
+ /**
37
+ * Add AJAX actions
38
+ */
39
+ private function add_ajax_actions() {
40
+
41
+ $get_downloads = new DLM_Ajax_GetDownloads();
42
+ $get_downloads->register();
43
+
44
+ $get_versions = new DLM_Ajax_GetVersions();
45
+ $get_versions->register();
46
+
47
+ $create_page = new DLM_Ajax_CreatePage();
48
+ $create_page->register();
49
+
50
+ }
51
+
52
+ /**
53
+ * Handle AJAX requests
54
+ */
55
+ public function handle_ajax() {
56
+ global $wp_query;
57
+
58
+ // set AJAX action if it's set in $_GET
59
+ if ( ! empty( $_GET[ self::ENDPOINT ] ) ) {
60
+ $wp_query->set( self::ENDPOINT, sanitize_text_field( wp_unslash($_GET[ self::ENDPOINT ]) ) );
61
+ }
62
+
63
+ // check if endpoint is not false or an empty string
64
+ if ( false != $wp_query->get( self::ENDPOINT ) && '' != trim( $wp_query->get( self::ENDPOINT ) ) ) {
65
+
66
+ // set AJAX action into var
67
+ $action = sanitize_text_field( $wp_query->get( self::ENDPOINT ) );
68
+
69
+ // set DOING AJAX to true
70
+ if ( ! defined( 'DOING_AJAX' ) ) {
71
+ define( 'DOING_AJAX', true );
72
+ }
73
+
74
+ // set is_home to false
75
+ $wp_query->is_home = false;
76
+
77
+ // run custom AJAX action
78
+ do_action( self::ENDPOINT . $action );
79
+
80
+ // bye
81
+ die();
82
+
83
+ }
84
+ }
85
  }
src/AjaxHandler.php CHANGED
@@ -1,287 +1,287 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- } // Exit if accessed directly
6
-
7
- /**
8
- * DLM_Ajax_Handler class.
9
- */
10
- class DLM_Ajax_Handler {
11
-
12
- /**
13
- * __construct function.
14
- *
15
- * @access public
16
- */
17
- public function __construct() {
18
- add_action( 'wp_ajax_download_monitor_remove_file', array( $this, 'remove_file' ) );
19
- add_action( 'wp_ajax_download_monitor_add_file', array( $this, 'add_file' ) );
20
- add_action( 'wp_ajax_download_monitor_list_files', array( $this, 'list_files' ) );
21
- add_action( 'wp_ajax_download_monitor_insert_panel_upload', array( $this, 'insert_panel_upload' ) );
22
- add_action( 'wp_ajax_dlm_settings_lazy_select', array( $this, 'handle_settings_lazy_select' ) );
23
- add_action( 'wp_ajax_dlm_extension', array( $this, 'handle_extensions' ) );
24
- add_action( 'wp_ajax_dlm_dismiss_notice', array( $this, 'dismiss_notice' ) );
25
- }
26
-
27
- /**
28
- * insert_panel_upload function.
29
- *
30
- * @access public
31
- * @return void
32
- */
33
- public function insert_panel_upload() {
34
-
35
- check_ajax_referer( 'file-upload' );
36
-
37
- // Check user rights
38
- if ( ! current_user_can( 'manage_downloads' ) ) {
39
- die();
40
- }
41
-
42
- require_once( ABSPATH . 'wp-admin/includes/image.php' );
43
- require_once( ABSPATH . 'wp-admin/includes/file.php' );
44
- require_once( ABSPATH . 'wp-admin/includes/media.php' );
45
-
46
- $attachment_id = media_handle_upload( 'async-upload', 0 );
47
-
48
- if ( ! is_wp_error( $attachment_id ) ) {
49
- $attachment_url = wp_get_attachment_url( $attachment_id );
50
-
51
- if ( false !== $attachment_url ) {
52
- echo esc_url( $attachment_url );
53
- }
54
- }
55
-
56
- die();
57
- }
58
-
59
- /**
60
- * remove_file function.
61
- *
62
- * @access public
63
- * @return void
64
- */
65
- public function remove_file() {
66
-
67
- check_ajax_referer( 'remove-file', 'security' );
68
-
69
- // Check user rights
70
- if ( ! current_user_can( 'manage_downloads' ) ) {
71
- die();
72
- }
73
-
74
- if ( ! isset( $_POST['file_id'] ) ) {
75
- die();
76
- }
77
-
78
- $file = get_post( intval( $_POST['file_id'] ) );
79
-
80
- if ( $file && $file->post_type == "dlm_download_version" ) {
81
- // clear transient
82
- download_monitor()->service( 'transient_manager' )->clear_versions_transient( $file->post_parent );
83
-
84
- wp_delete_post( $file->ID );
85
- }
86
-
87
- die();
88
- }
89
-
90
- /**
91
- * add_file function.
92
- *
93
- * @access public
94
- * @return void
95
- */
96
- public function add_file() {
97
-
98
- // check nonce
99
- check_ajax_referer( 'add-file', 'security' );
100
-
101
- // Check user rights
102
- if ( ! current_user_can( 'manage_downloads' ) ) {
103
- die();
104
- }
105
-
106
- // get POST data
107
- $download_id = isset( $_POST['post_id'] ) ? absint( $_POST['post_id'] ) : 0;
108
- $size = isset( $_POST['size'] ) ? absint( $_POST['size'] ) : 0;
109
-
110
- /** @var DLM_Download_Version $new_version */
111
- $new_version = new DLM_Download_Version();
112
-
113
- // set download id
114
- $new_version->set_download_id( $download_id );
115
-
116
- // set other version data
117
- $new_version->set_author( get_current_user_id() );
118
- $new_version->set_date( new DateTime( current_time( 'mysql' ) ) );
119
-
120
- // persist new version
121
- download_monitor()->service( 'version_repository' )->persist( $new_version );
122
-
123
- // clear download transient
124
- download_monitor()->service( 'transient_manager' )->clear_versions_transient( $download_id );
125
-
126
- // output new version admin html
127
- download_monitor()->service( 'view_manager' )->display( 'meta-box/version', array(
128
- 'version_increment' => $size,
129
- 'file_id' => $new_version->get_id(),
130
- 'file_version' => $new_version->get_version(),
131
- 'file_post_date' => $new_version->get_date(),
132
- 'file_download_count' => $new_version->get_download_count(),
133
- 'file_urls' => $new_version->get_mirrors(),
134
- 'version' => $new_version
135
- ) );
136
-
137
- die();
138
- }
139
-
140
- /**
141
- * list_files function.
142
- *
143
- * @access public
144
- * @return void
145
- */
146
- public function list_files() {
147
-
148
- // Check Nonce
149
- check_ajax_referer( 'list-files', 'security' );
150
-
151
- // Check user rights
152
- if ( ! current_user_can( 'manage_downloads' ) ) {
153
- die();
154
- }
155
-
156
- if ( ! isset( $_POST['path'] ) ) {
157
- die();
158
- }
159
-
160
- $path = sanitize_text_field( wp_unslash( $_POST['path'] ) );
161
-
162
- // List all files
163
- $files = download_monitor()->service( 'file_manager' )->list_files( $path );
164
-
165
- foreach ( $files as $found_file ) {
166
-
167
- // Multi-byte-safe pathinfo
168
- $file = download_monitor()->service( 'file_manager' )->mb_pathinfo( $found_file['path'] );
169
-
170
- if ( $found_file['type'] == 'folder' ) {
171
-
172
- echo '<li><a href="#" class="folder" data-path="' . esc_attr( trailingslashit( $file['dirname'] ) ) . esc_attr( $file['basename'] ) . '">' . esc_attr( $file['basename'] ) . '</a></li>';
173
-
174
- } else {
175
-
176
- $filename = $file['basename'];
177
- $extension = ( empty( $file['extension'] ) ) ? '' : $file['extension'];
178
-
179
- if ( substr( $filename, 0, 1 ) == '.' ) {
180
- continue;
181
- } // Ignore files starting with . like htaccess
182
- if ( in_array( $extension, array( '', 'php', 'html', 'htm', 'tmp' ) ) ) {
183
- continue;
184
- } // Ignored file types
185
-
186
- echo '<li><a href="#" class="file filetype-' . esc_attr( sanitize_title( $extension ) ) . '" data-path="' . esc_attr( trailingslashit( $file['dirname'] ) ) . esc_attr( $file['basename'] ) . '">' . esc_attr( $file['basename'] ) . '</a></li>';
187
-
188
- }
189
-
190
- }
191
-
192
- die();
193
- }
194
-
195
- /**
196
- * Handle notice dismissal
197
- */
198
- public function dismiss_notice() {
199
-
200
- // check notice
201
- if ( ! isset( $_POST['notice'] ) || empty( $_POST['notice'] ) ) {
202
- exit;
203
- }
204
-
205
- // the notice
206
- $notice = sanitize_text_field( wp_unslash($_POST['notice']) );
207
-
208
- // check nonce
209
- check_ajax_referer( 'dlm_hide_notice-' . $notice, 'nonce' );
210
-
211
- // update option
212
- update_option( 'dlm_hide_notice-' . $notice, 1 );
213
-
214
- // send JSON
215
- wp_send_json( array( 'response' => 'success' ) );
216
- }
217
-
218
- /**
219
- * Handle lazy select AJAX calls
220
- */
221
- public function handle_settings_lazy_select() {
222
-
223
- // check nonce
224
- check_ajax_referer( 'dlm-settings-lazy-select-nonce', 'nonce' );
225
-
226
- if ( ! isset( $_POST['option'] ) ) {
227
- wp_send_json_error();
228
- exit;
229
- }
230
-
231
- // settings key
232
- $option_key = sanitize_text_field( wp_unslash($_POST['option']) );
233
-
234
- // get options
235
- $options = apply_filters( 'dlm_settings_lazy_select_'.$option_key, array() );
236
-
237
- // send options
238
- wp_send_json( $options );
239
- exit;
240
-
241
- }
242
-
243
- /**
244
- * Handle extensions AJAX
245
- */
246
- public function handle_extensions() {
247
-
248
- // Check nonce
249
- check_ajax_referer( 'dlm-ajax-nonce', 'nonce' );
250
-
251
- // Post vars
252
- $product_id = isset( $_POST['product_id'] ) ? sanitize_text_field( wp_unslash($_POST['product_id']) ) : 0;
253
- $key = isset( $_POST['key'] ) ? sanitize_text_field( wp_unslash($_POST['key']) ) : '';
254
- $email = isset( $_POST['email'] ) ? sanitize_text_field( wp_unslash($_POST['email']) ) : '';
255
- $extension_action = isset( $_POST['extension_action'] ) ? sanitize_text_field( wp_unslash($_POST['extension_action']) ) : 'activate';
256
-
257
- // Get products
258
- $products = DLM_Product_Manager::get()->get_products();
259
-
260
- // Check if product exists
261
- $response = "";
262
- if ( isset( $products[ $product_id ] ) ) {
263
-
264
- // Get correct product
265
- /** @var DLM_Product $product */
266
- $product = $products[ $product_id ];
267
-
268
- // Set new key in license object
269
- $product->get_license()->set_key( $key );
270
-
271
- // Set new email in license object
272
- $product->get_license()->set_email( $email );
273
-
274
- if ( 'activate' === $extension_action ) {
275
- // Try to activate the license
276
- $response = $product->activate();
277
- } else {
278
- // Try to deactivate the license
279
- $response = $product->deactivate();
280
- }
281
-
282
- }
283
-
284
- // Send JSON
285
- wp_send_json( $response );
286
- }
287
  }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ /**
8
+ * DLM_Ajax_Handler class.
9
+ */
10
+ class DLM_Ajax_Handler {
11
+
12
+ /**
13
+ * __construct function.
14
+ *
15
+ * @access public
16
+ */
17
+ public function __construct() {
18
+ add_action( 'wp_ajax_download_monitor_remove_file', array( $this, 'remove_file' ) );
19
+ add_action( 'wp_ajax_download_monitor_add_file', array( $this, 'add_file' ) );
20
+ add_action( 'wp_ajax_download_monitor_list_files', array( $this, 'list_files' ) );
21
+ add_action( 'wp_ajax_download_monitor_insert_panel_upload', array( $this, 'insert_panel_upload' ) );
22
+ add_action( 'wp_ajax_dlm_settings_lazy_select', array( $this, 'handle_settings_lazy_select' ) );
23
+ add_action( 'wp_ajax_dlm_extension', array( $this, 'handle_extensions' ) );
24
+ add_action( 'wp_ajax_dlm_dismiss_notice', array( $this, 'dismiss_notice' ) );
25
+ }
26
+
27
+ /**
28
+ * insert_panel_upload function.
29
+ *
30
+ * @access public
31
+ * @return void
32
+ */
33
+ public function insert_panel_upload() {
34
+
35
+ check_ajax_referer( 'file-upload' );
36
+
37
+ // Check user rights
38
+ if ( ! current_user_can( 'manage_downloads' ) ) {
39
+ die();
40
+ }
41
+
42
+ require_once( ABSPATH . 'wp-admin/includes/image.php' );
43
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
44
+ require_once( ABSPATH . 'wp-admin/includes/media.php' );
45
+
46
+ $attachment_id = media_handle_upload( 'async-upload', 0 );
47
+
48
+ if ( ! is_wp_error( $attachment_id ) ) {
49
+ $attachment_url = wp_get_attachment_url( $attachment_id );
50
+
51
+ if ( false !== $attachment_url ) {
52
+ echo esc_url( $attachment_url );
53
+ }
54
+ }
55
+
56
+ die();
57
+ }
58
+
59
+ /**
60
+ * remove_file function.
61
+ *
62
+ * @access public
63
+ * @return void
64
+ */
65
+ public function remove_file() {
66
+
67
+ check_ajax_referer( 'remove-file', 'security' );
68
+
69
+ // Check user rights
70
+ if ( ! current_user_can( 'manage_downloads' ) ) {
71
+ die();
72
+ }
73
+
74
+ if ( ! isset( $_POST['file_id'] ) ) {
75
+ die();
76
+ }
77
+
78
+ $file = get_post( intval( $_POST['file_id'] ) );
79
+
80
+ if ( $file && $file->post_type == "dlm_download_version" ) {
81
+ // clear transient
82
+ download_monitor()->service( 'transient_manager' )->clear_versions_transient( $file->post_parent );
83
+
84
+ wp_delete_post( $file->ID );
85
+ }
86
+
87
+ die();
88
+ }
89
+
90
+ /**
91
+ * add_file function.
92
+ *
93
+ * @access public
94
+ * @return void
95
+ */
96
+ public function add_file() {
97
+
98
+ // check nonce
99
+ check_ajax_referer( 'add-file', 'security' );
100
+
101
+ // Check user rights
102
+ if ( ! current_user_can( 'manage_downloads' ) ) {
103
+ die();
104
+ }
105
+
106
+ // get POST data
107
+ $download_id = isset( $_POST['post_id'] ) ? absint( $_POST['post_id'] ) : 0;
108
+ $size = isset( $_POST['size'] ) ? absint( $_POST['size'] ) : 0;
109
+
110
+ /** @var DLM_Download_Version $new_version */
111
+ $new_version = new DLM_Download_Version();
112
+
113
+ // set download id
114
+ $new_version->set_download_id( $download_id );
115
+
116
+ // set other version data
117
+ $new_version->set_author( get_current_user_id() );
118
+ $new_version->set_date( new DateTime( current_time( 'mysql' ) ) );
119
+
120
+ // persist new version
121
+ download_monitor()->service( 'version_repository' )->persist( $new_version );
122
+
123
+ // clear download transient
124
+ download_monitor()->service( 'transient_manager' )->clear_versions_transient( $download_id );
125
+
126
+ // output new version admin html
127
+ download_monitor()->service( 'view_manager' )->display( 'meta-box/version', array(
128
+ 'version_increment' => $size,
129
+ 'file_id' => $new_version->get_id(),
130
+ 'file_version' => $new_version->get_version(),
131
+ 'file_post_date' => $new_version->get_date(),
132
+ 'file_download_count' => $new_version->get_download_count(),
133
+ 'file_urls' => $new_version->get_mirrors(),
134
+ 'version' => $new_version
135
+ ) );
136
+
137
+ die();
138
+ }
139
+
140
+ /**
141
+ * list_files function.
142
+ *
143
+ * @access public
144
+ * @return void
145
+ */
146
+ public function list_files() {
147
+
148
+ // Check Nonce
149
+ check_ajax_referer( 'list-files', 'security' );
150
+
151
+ // Check user rights
152
+ if ( ! current_user_can( 'manage_downloads' ) ) {
153
+ die();
154
+ }
155
+
156
+ if ( ! isset( $_POST['path'] ) ) {
157
+ die();
158
+ }
159
+
160
+ $path = sanitize_text_field( wp_unslash( $_POST['path'] ) );
161
+
162
+ // List all files
163
+ $files = download_monitor()->service( 'file_manager' )->list_files( $path );
164
+
165
+ foreach ( $files as $found_file ) {
166
+
167
+ // Multi-byte-safe pathinfo
168
+ $file = download_monitor()->service( 'file_manager' )->mb_pathinfo( $found_file['path'] );
169
+
170
+ if ( $found_file['type'] == 'folder' ) {
171
+
172
+ echo '<li><a href="#" class="folder" data-path="' . esc_attr( trailingslashit( $file['dirname'] ) ) . esc_attr( $file['basename'] ) . '">' . esc_attr( $file['basename'] ) . '</a></li>';
173
+
174
+ } else {
175
+
176
+ $filename = $file['basename'];
177
+ $extension = ( empty( $file['extension'] ) ) ? '' : $file['extension'];
178
+
179
+ if ( substr( $filename, 0, 1 ) == '.' ) {
180
+ continue;
181
+ } // Ignore files starting with . like htaccess
182
+ if ( in_array( $extension, array( '', 'php', 'html', 'htm', 'tmp' ) ) ) {
183
+ continue;
184
+ } // Ignored file types
185
+
186
+ echo '<li><a href="#" class="file filetype-' . esc_attr( sanitize_title( $extension ) ) . '" data-path="' . esc_attr( trailingslashit( $file['dirname'] ) ) . esc_attr( $file['basename'] ) . '">' . esc_attr( $file['basename'] ) . '</a></li>';
187
+
188
+ }
189
+
190
+ }
191
+
192
+ die();
193
+ }
194
+
195
+ /**
196
+ * Handle notice dismissal
197
+ */
198
+ public function dismiss_notice() {
199
+
200
+ // check notice
201
+ if ( ! isset( $_POST['notice'] ) || empty( $_POST['notice'] ) ) {
202
+ exit;
203
+ }
204
+
205
+ // the notice
206
+ $notice = sanitize_text_field( wp_unslash($_POST['notice']) );
207
+
208
+ // check nonce
209
+ check_ajax_referer( 'dlm_hide_notice-' . $notice, 'nonce' );
210
+
211
+ // update option
212
+ update_option( 'dlm_hide_notice-' . $notice, 1 );
213
+
214
+ // send JSON
215
+ wp_send_json( array( 'response' => 'success' ) );
216
+ }
217
+
218
+ /**
219
+ * Handle lazy select AJAX calls
220
+ */
221
+ public function handle_settings_lazy_select() {
222
+
223
+ // check nonce
224
+ check_ajax_referer( 'dlm-settings-lazy-select-nonce', 'nonce' );
225
+
226
+ if ( ! isset( $_POST['option'] ) ) {
227
+ wp_send_json_error();
228
+ exit;
229
+ }
230
+
231
+ // settings key
232
+ $option_key = sanitize_text_field( wp_unslash($_POST['option']) );
233
+
234
+ // get options
235
+ $options = apply_filters( 'dlm_settings_lazy_select_'.$option_key, array() );
236
+
237
+ // send options
238
+ wp_send_json( $options );
239
+ exit;
240
+
241
+ }
242
+
243
+ /**
244
+ * Handle extensions AJAX
245
+ */
246
+ public function handle_extensions() {
247
+
248
+ // Check nonce
249
+ check_ajax_referer( 'dlm-ajax-nonce', 'nonce' );
250
+
251
+ // Post vars
252
+ $product_id = isset( $_POST['product_id'] ) ? sanitize_text_field( wp_unslash($_POST['product_id']) ) : 0;
253
+ $key = isset( $_POST['key'] ) ? sanitize_text_field( wp_unslash($_POST['key']) ) : '';
254
+ $email = isset( $_POST['email'] ) ? sanitize_text_field( wp_unslash($_POST['email']) ) : '';
255
+ $extension_action = isset( $_POST['extension_action'] ) ? sanitize_text_field( wp_unslash($_POST['extension_action']) ) : 'activate';
256
+
257
+ // Get products
258
+ $products = DLM_Product_Manager::get()->get_products();
259
+
260
+ // Check if product exists
261
+ $response = "";
262
+ if ( isset( $products[ $product_id ] ) ) {
263
+
264
+ // Get correct product
265
+ /** @var DLM_Product $product */
266
+ $product = $products[ $product_id ];
267
+
268
+ // Set new key in license object
269
+ $product->get_license()->set_key( $key );
270
+
271
+ // Set new email in license object
272
+ $product->get_license()->set_email( $email );
273
+
274
+ if ( 'activate' === $extension_action ) {
275
+ // Try to activate the license
276
+ $response = $product->activate();
277
+ } else {
278
+ // Try to deactivate the license
279
+ $response = $product->deactivate();
280
+ }
281
+
282
+ }
283
+
284
+ // Send JSON
285
+ wp_send_json( $response );
286
+ }
287
  }
src/Constants.php CHANGED
@@ -1,16 +1,16 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- } // Exit if accessed directly
6
-
7
- class DLM_Constants {
8
-
9
- const OPTION_CURRENT_VERSION = 'dlm_current_version';
10
-
11
- const LU_OPTION_NEEDS_UPGRADING = "dlm_lu_needs_upgrading";
12
- const LU_OPTION_UPGRADED = "dlm_lu_upgraded";
13
- const LU_OPTION_DOWNLOAD_QUEUE_BUILD = "dlm_lu_download_queue_build";
14
- const LU_OPTION_CONTENT_QUEUE_BUILD = "dlm_lu_content_queue_build";
15
-
16
  }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ class DLM_Constants {
8
+
9
+ const OPTION_CURRENT_VERSION = 'dlm_current_version';
10
+
11
+ const LU_OPTION_NEEDS_UPGRADING = "dlm_lu_needs_upgrading";
12
+ const LU_OPTION_UPGRADED = "dlm_lu_upgraded";
13
+ const LU_OPTION_DOWNLOAD_QUEUE_BUILD = "dlm_lu_download_queue_build";
14
+ const LU_OPTION_CONTENT_QUEUE_BUILD = "dlm_lu_content_queue_build";
15
+
16
  }
src/CookieManager.php CHANGED
@@ -1,68 +1,68 @@
1
- <?php
2
-
3
- class DLM_Cookie_Manager {
4
-
5
- const KEY = 'wp_dlm_downloading';
6
-
7
- /**
8
- * Check if the cookie is exists for this download & version. If it does exists the requester has requested the exact same download & version in the past minute.
9
- *
10
- * @param DLM_Download $download
11
- *
12
- * @return bool
13
- */
14
- public static function exists( $download ) {
15
- $exists = false;
16
-
17
- // get JSON data
18
- $cdata = self::get_cookie_data();
19
-
20
- // check if no parse errors occurred
21
- if ( null != $cdata && is_array( $cdata ) && ! empty( $cdata ) ) {
22
-
23
- // check in cookie data for download AND version ID
24
- if ( $cdata['download'] == $download->get_id() && $cdata['version'] == $download->get_version()->get_version_number() ) {
25
- $exists = true;
26
- }
27
- }
28
-
29
-
30
- return $exists;
31
- }
32
-
33
- /**
34
- * Get cookie data
35
- *
36
- * @return array|null
37
- */
38
- public static function get_cookie_data() {
39
- $cdata = null;
40
- if ( ! empty( $_COOKIE[ self::KEY ] ) ) {
41
- $cdata = json_decode( base64_decode( sanitize_text_field( wp_unslash( $_COOKIE[ self::KEY ] ) ) ), true );
42
- }
43
-
44
- return $cdata;
45
- }
46
-
47
- /**
48
- * Set cookie
49
- *
50
- * @param DLM_Download $download
51
- */
52
- public static function set_cookie( $download ) {
53
-
54
- $cookie_data = apply_filters( 'wp_dlm_set_downloading_cookie', array( 'expires' => time() + 60, 'secure' => false, 'httponly' => true ) );
55
- setcookie(
56
- self::KEY,
57
- base64_encode( json_encode( array(
58
- 'download' => $download->get_id(),
59
- 'version' => $download->get_version()->get_version_number()
60
- ) ) ),
61
- $cookie_data['expires'],
62
- COOKIEPATH,
63
- COOKIE_DOMAIN,
64
- $cookie_data['secure'],
65
- $cookie_data['httponly'] );
66
- }
67
-
68
  }
1
+ <?php
2
+
3
+ class DLM_Cookie_Manager {
4
+
5
+ const KEY = 'wp_dlm_downloading';
6
+
7
+ /**
8
+ * Check if the cookie is exists for this download & version. If it does exists the requester has requested the exact same download & version in the past minute.
9
+ *
10
+ * @param DLM_Download $download
11
+ *
12
+ * @return bool
13
+ */
14
+ public static function exists( $download ) {
15
+ $exists = false;
16
+
17
+ // get JSON data
18
+ $cdata = self::get_cookie_data();
19
+
20
+ // check if no parse errors occurred
21
+ if ( null != $cdata && is_array( $cdata ) && ! empty( $cdata ) ) {
22
+
23
+ // check in cookie data for download AND version ID
24
+ if ( $cdata['download'] == $download->get_id() && $cdata['version'] == $download->get_version()->get_version_number() ) {
25
+ $exists = true;
26
+ }
27
+ }
28
+
29
+
30
+ return $exists;
31
+ }
32
+
33
+ /**
34
+ * Get cookie data
35
+ *
36
+ * @return array|null
37
+ */
38
+ public static function get_cookie_data() {
39
+ $cdata = null;
40
+ if ( ! empty( $_COOKIE[ self::KEY ] ) ) {
41
+ $cdata = json_decode( base64_decode( sanitize_text_field( wp_unslash( $_COOKIE[ self::KEY ] ) ) ), true );
42
+ }
43
+
44
+ return $cdata;
45
+ }
46
+
47
+ /**
48
+ * Set cookie
49
+ *
50
+ * @param DLM_Download $download
51
+ */
52
+ public static function set_cookie( $download ) {
53
+
54
+ $cookie_data = apply_filters( 'wp_dlm_set_downloading_cookie', array( 'expires' => time() + 60, 'secure' => false, 'httponly' => true ) );
55
+ setcookie(
56
+ self::KEY,
57
+ base64_encode( json_encode( array(
58
+ 'download' => $download->get_id(),
59
+ 'version' => $download->get_version()->get_version_number()
60
+ ) ) ),
61
+ $cookie_data['expires'],
62
+ COOKIEPATH,
63
+ COOKIE_DOMAIN,
64
+ $cookie_data['secure'],
65
+ $cookie_data['httponly'] );
66
+ }
67
+
68
  }
src/DebugLogger.php CHANGED
@@ -1,50 +1,50 @@
1
- <?php
2
-
3
- class DLM_Debug_Logger {
4
-
5
- const MSG_PREFIX = "DLM Notice: ";
6
-
7
- /**
8
- * Returns if debugging is enabled
9
- *
10
- * @return bool
11
- */
12
- private static function is_enabled() {
13
- return WP_DEBUG;
14
- }
15
-
16
- /**
17
- * Log debug message
18
- *
19
- * @param string $message
20
- */
21
- public static function log( $message ) {
22
-
23
- // Only continue if enabled
24
- if ( ! self::is_enabled() ) {
25
- return;
26
- }
27
-
28
- error_log( self::MSG_PREFIX . $message, 0 );
29
-
30
- }
31
-
32
- /**
33
- * Log deprecated warning
34
- *
35
- * @param string $method
36
- */
37
- public static function deprecated( $method ) {
38
-
39
- // Only continue if enabled
40
- if ( ! self::is_enabled() ) {
41
- return;
42
- }
43
-
44
- // Debug message
45
- $message = 'Deprecated method called: ' . $method;
46
-
47
- error_log( self::MSG_PREFIX . $message, 0 );
48
- }
49
-
50
  }
1
+ <?php
2
+
3
+ class DLM_Debug_Logger {
4
+
5
+ const MSG_PREFIX = "DLM Notice: ";
6
+
7
+ /**
8
+ * Returns if debugging is enabled
9
+ *
10
+ * @return bool
11
+ */
12
+ private static function is_enabled() {
13
+ return WP_DEBUG;
14
+ }
15
+
16
+ /**
17
+ * Log debug message
18
+ *
19
+ * @param string $message
20
+ */
21
+ public static function log( $message ) {
22
+
23
+ // Only continue if enabled
24
+ if ( ! self::is_enabled() ) {
25
+ return;
26
+ }
27
+
28
+ error_log( self::MSG_PREFIX . $message, 0 );
29
+
30
+ }
31
+
32
+ /**
33
+ * Log deprecated warning
34
+ *
35
+ * @param string $method
36
+ */
37
+ public static function deprecated( $method ) {
38
+
39
+ // Only continue if enabled
40
+ if ( ! self::is_enabled() ) {
41
+ return;
42
+ }
43
+
44
+ // Debug message
45
+ $message = 'Deprecated method called: ' . $method;
46
+
47
+ error_log( self::MSG_PREFIX . $message, 0 );
48
+ }
49
+
50
  }
src/DownloadHandler.php CHANGED
@@ -557,13 +557,13 @@ class DLM_Download_Handler {
557
  $range = intval( $range );
558
 
559
  if ( ! $range_end ) {
560
- $range_end = $version->get_filesize() - 1;
561
  } else {
562
  $range_end = intval( $range_end );
563
  }
564
 
565
- $new_length = $range_end - $range;
566
-
567
  header( "HTTP/1.1 206 Partial Content" );
568
  header( "Content-Length: $new_length" );
569
  header( "Content-Range: bytes {$range}-{$range_end}/{$version->get_filesize()}" );
@@ -572,7 +572,8 @@ class DLM_Download_Handler {
572
  $range = false;
573
  }
574
 
575
- if ( $this->readfile_chunked( $file_path, $range ) ) {
 
576
 
577
  // Complete!
578
  $this->log( 'download', 'completed', '', $download, $version );
557
  $range = intval( $range );
558
 
559
  if ( ! $range_end ) {
560
+ $range_end = $version->get_filesize() ;
561
  } else {
562
  $range_end = intval( $range_end );
563
  }
564
 
565
+ //$new_length = $range_end - $range;
566
+ $new_length = ($range_end - $range) + 1;
567
  header( "HTTP/1.1 206 Partial Content" );
568
  header( "Content-Length: $new_length" );
569
  header( "Content-Range: bytes {$range}-{$range_end}/{$version->get_filesize()}" );
572
  $range = false;
573
  }
574
 
575
+ if ( $this->readfile_chunked( $file_path, false, $range ) ) {
576
+ //if ( $this->readfile_chunked( $file_path, $range ) ) {
577
 
578
  // Complete!
579
  $this->log( 'download', 'completed', '', $download, $version );
src/DownloadNoAccessPageEndpoint.php CHANGED
@@ -1,41 +1,41 @@
1
- <?php
2
-
3
- class DLM_Download_No_Access_Page_Endpoint {
4
-
5
- private $endpoint = 'download-id';
6
-
7
- /**
8
- * Setup no access page
9
- */
10
- public function setup() {
11
- // add query var and enpoint
12
- add_filter( 'query_vars', array( $this, 'add_query_vars' ), 0 );
13
- add_action( 'init', array( $this, 'add_endpoint' ), 0 );
14
- }
15
-
16
- /**
17
- * add_query_vars function.
18
- *
19
- * @access public
20
- *
21
- * @param array $vars
22
- *
23
- * @return array
24
- */
25
- public function add_query_vars( $vars ) {
26
- $vars[] = $this->endpoint;
27
-
28
- return $vars;
29
- }
30
-
31
- /**
32
- * add_endpoint function.
33
- *
34
- * @access public
35
- * @return void
36
- */
37
- public function add_endpoint() {
38
- add_rewrite_endpoint( $this->endpoint, EP_ALL );
39
- }
40
-
41
  }
1
+ <?php
2
+
3
+ class DLM_Download_No_Access_Page_Endpoint {
4
+
5
+ private $endpoint = 'download-id';
6
+
7
+ /**
8
+ * Setup no access page
9
+ */
10
+ public function setup() {
11
+ // add query var and enpoint
12
+ add_filter( 'query_vars', array( $this, 'add_query_vars' ), 0 );
13
+ add_action( 'init', array( $this, 'add_endpoint' ), 0 );
14
+ }
15
+
16
+ /**
17
+ * add_query_vars function.
18
+ *
19
+ * @access public
20
+ *
21
+ * @param array $vars
22
+ *
23
+ * @return array
24
+ */
25
+ public function add_query_vars( $vars ) {
26
+ $vars[] = $this->endpoint;
27
+
28
+ return $vars;
29
+ }
30
+
31
+ /**
32
+ * add_endpoint function.
33
+ *
34
+ * @access public
35
+ * @return void
36
+ */
37
+ public function add_endpoint() {
38
+ add_rewrite_endpoint( $this->endpoint, EP_ALL );
39
+ }
40
+
41
  }
src/DownloadPreview/Config.php CHANGED
@@ -1,49 +1,49 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- } // Exit if accessed directly
6
-
7
- class DLM_DownloadPreview_Config {
8
-
9
- /** @var DLM_Download */
10
- private $download = null;
11
-
12
- /** @var string */
13
- private $template = "";
14
-
15
- /**
16
- * @return DLM_Download
17
- */
18
- public function get_download() {
19
- return $this->download;
20
- }
21
-
22
- /**
23
- * @param DLM_Download $download
24
- */
25
- public function set_download( $download ) {
26
- $this->download = $download;
27
- }
28
-
29
- /**
30
- * @return string
31
- */
32
- public function get_template() {
33
-
34
- if ( "settings" == $this->template ) {
35
- $this->template = dlm_get_default_download_template();
36
- }
37
-
38
- return $this->template;
39
- }
40
-
41
- /**
42
- * @param string $template
43
- */
44
- public function set_template( $template ) {
45
- $this->template = $template;
46
- }
47
-
48
-
49
  }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ class DLM_DownloadPreview_Config {
8
+
9
+ /** @var DLM_Download */
10
+ private $download = null;
11
+
12
+ /** @var string */
13
+ private $template = "";
14
+
15
+ /**
16
+ * @return DLM_Download
17
+ */
18
+ public function get_download() {
19
+ return $this->download;
20
+ }
21
+
22
+ /**
23
+ * @param DLM_Download $download
24
+ */
25
+ public function set_download( $download ) {
26
+ $this->download = $download;
27
+ }
28
+
29
+ /**
30
+ * @return string
31
+ */
32
+ public function get_template() {
33
+
34
+ if ( "settings" == $this->template ) {
35
+ $this->template = dlm_get_default_download_template();
36
+ }
37
+
38
+ return $this->template;
39
+ }
40
+
41
+ /**
42
+ * @param string $template
43
+ */
44
+ public function set_template( $template ) {
45
+ $this->template = $template;
46
+ }
47
+
48
+
49
  }
src/DownloadPreview/Preview.php CHANGED
@@ -1,112 +1,112 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- } // Exit if accessed directly
6
-
7
- class DLM_DownloadPreview_Preview {
8
-
9
- /**
10
- * Setup the preview hooks
11
- */
12
- public function setup() {
13
- add_action( 'template_redirect', array( $this, 'catch_preview_request' ), 999 );
14
- }
15
-
16
- /**
17
- * This method will setup a new DLM_DownloadPreview_Config object based on parameters in the URL ($_GET)
18
- *
19
- * @return DLM_DownloadPreview_Config
20
- */
21
- private function get_config_from_url() {
22
-
23
-
24
- $config = new DLM_DownloadPreview_Config();
25
-
26
- if ( isset( $_GET['download_id'] ) ) {
27
-
28
- try {
29
- /** @var DLM_Download $download */
30
- $download = download_monitor()->service( 'download_repository' )->retrieve_single( absint( $_GET['download_id'] ) );
31
-
32
-
33
- if ( isset( $_GET['version_id'] ) ) {
34
-
35
- try {
36
- /** @var DLM_Download_Version $version */
37
- $version = download_monitor()->service( 'version_repository' )->retrieve_single( absint( $_GET['version_id'] ) );
38
- $download->set_version( $version );
39
- } catch ( Exception $exception ) {
40
- // no version found, don't do anything.
41
- }
42
- }
43
-
44
- $config->set_download( $download );
45
-
46
-
47
- } catch ( Exception $exception ) {
48
- // no download found, don't do anything.
49
- }
50
- }
51
-
52
- if ( isset( $_GET['template'] ) ) {
53
- $config->set_template( sanitize_text_field( wp_unslash( $_GET['template'] ) ));
54
- }
55
-
56
- if ( isset( $_GET['custom_template'] ) ) {
57
- $config->set_template( sanitize_text_field( wp_unslash( $_GET['custom_template'] ) ) );
58
- }
59
-
60
- return $config;
61
- }
62
-
63
- /**
64
- * Output the button preview HTML
65
- */
66
- private function output_html() {
67
- echo '<!DOCTYPE html>
68
- <html lang="en-US" class="no-js">
69
- <head>';
70
- do_action( 'wp_head' );
71
- echo '</head>
72
- <body><table><tr><td valign="middle"><div id="dlmPreviewContainer">';
73
-
74
-
75
- $config = $this->get_config_from_url();
76
-
77
- if ( $config->get_download() != null ) {
78
-
79
- $template_handler = new DLM_Template_Handler();
80
-
81
- $template_handler->get_template_part( 'content-download', $config->get_template(), '', array( 'dlm_download' => $config->get_download() ) );
82
-
83
- } else {
84
- echo "<p>" . esc_html__( "Select a download first", 'download-monitor' ) . "</p>";
85
- }
86
-
87
- echo '</div></td></tr></table></body>
88
- </html>';
89
- }
90
-
91
-
92
- /**
93
- * Catch the preview request. Setup custom HTML but output WordPress head part.
94
- */
95
- public function catch_preview_request() {
96
- // check if this is a buttons preview request
97
- if ( isset( $_GET['dlm_gutenberg_download_preview'] ) ) {
98
-
99
- if ( ! current_user_can( 'edit_posts' ) ) {
100
- return;
101
- }
102
-
103
- // remove the admin bar styling
104
- remove_action( 'wp_head', '_admin_bar_bump_cb' );
105
-
106
- // it is, output HTML
107
- $this->output_html();
108
- exit;
109
- }
110
-
111
- }
112
  }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ class DLM_DownloadPreview_Preview {
8
+
9
+ /**
10
+ * Setup the preview hooks
11
+ */
12
+ public function setup() {
13
+ add_action( 'template_redirect', array( $this, 'catch_preview_request' ), 999 );
14
+ }
15
+
16
+ /**
17
+ * This method will setup a new DLM_DownloadPreview_Config object based on parameters in the URL ($_GET)
18
+ *
19
+ * @return DLM_DownloadPreview_Config
20
+ */
21
+ private function get_config_from_url() {
22
+
23
+
24
+ $config = new DLM_DownloadPreview_Config();
25
+
26
+ if ( isset( $_GET['download_id'] ) ) {
27
+
28
+ try {
29
+ /** @var DLM_Download $download */
30
+ $download = download_monitor()->service( 'download_repository' )->retrieve_single( absint( $_GET['download_id'] ) );
31
+
32
+
33
+ if ( isset( $_GET['version_id'] ) ) {
34
+
35
+ try {
36
+ /** @var DLM_Download_Version $version */
37
+ $version = download_monitor()->service( 'version_repository' )->retrieve_single( absint( $_GET['version_id'] ) );
38
+ $download->set_version( $version );
39
+ } catch ( Exception $exception ) {
40
+ // no version found, don't do anything.
41
+ }
42
+ }
43
+
44
+ $config->set_download( $download );
45
+
46
+
47
+ } catch ( Exception $exception ) {
48
+ // no download found, don't do anything.
49
+ }
50
+ }
51
+
52
+ if ( isset( $_GET['template'] ) ) {
53
+ $config->set_template( sanitize_text_field( wp_unslash( $_GET['template'] ) ));
54
+ }
55
+
56
+ if ( isset( $_GET['custom_template'] ) ) {
57
+ $config->set_template( sanitize_text_field( wp_unslash( $_GET['custom_template'] ) ) );
58
+ }
59
+
60
+ return $config;
61
+ }
62
+
63
+ /**
64
+ * Output the button preview HTML
65
+ */
66
+ private function output_html() {
67
+ echo '<!DOCTYPE html>
68
+ <html lang="en-US" class="no-js">
69
+ <head>';
70
+ do_action( 'wp_head' );
71
+ echo '</head>
72
+ <body><table><tr><td valign="middle"><div id="dlmPreviewContainer">';
73
+
74
+
75
+ $config = $this->get_config_from_url();
76
+
77
+ if ( $config->get_download() != null ) {
78
+
79
+ $template_handler = new DLM_Template_Handler();
80
+
81
+ $template_handler->get_template_part( 'content-download', $config->get_template(), '', array( 'dlm_download' => $config->get_download() ) );
82
+
83
+ } else {
84
+ echo "<p>" . esc_html__( "Select a download first", 'download-monitor' ) . "</p>";
85
+ }
86
+
87
+ echo '</div></td></tr></table></body>
88
+ </html>';
89
+ }
90
+
91
+
92
+ /**
93
+ * Catch the preview request. Setup custom HTML but output WordPress head part.
94
+ */
95
+ public function catch_preview_request() {
96
+ // check if this is a buttons preview request
97
+ if ( isset( $_GET['dlm_gutenberg_download_preview'] ) ) {
98
+
99
+ if ( ! current_user_can( 'edit_posts' ) ) {
100
+ return;
101
+ }
102
+
103
+ // remove the admin bar styling
104
+ remove_action( 'wp_head', '_admin_bar_bump_cb' );
105
+
106
+ // it is, output HTML
107
+ $this->output_html();
108
+ exit;
109
+ }
110
+
111
+ }
112
  }
src/Hasher.php CHANGED
@@ -1,103 +1,103 @@
1
- <?php
2
-
3
- class DLM_Hasher {
4
-
5
- /**
6
- * Get array with hashes for given file path.
7
- * Array will always contain all hash keys but hash values will only be set if user option for hash is turned on.
8
- *
9
- * @param string $file_path
10
- *
11
- * @return array
12
- */
13
- public function get_file_hashes( $file_path ) {
14
- $md5 = false;
15
- $sha1 = false;
16
- $sha256 = false;
17
- $crc32b = false;
18
-
19
- if ( $file_path ) {
20
- list( $file_path, $remote_file ) = download_monitor()->service( 'file_manager' )->parse_file_path( $file_path );
21
-
22
- if ( ! empty( $file_path ) ) {
23
- if ( ! $remote_file || apply_filters( 'dlm_allow_remote_hash_file', false ) ) {
24
-
25
- if ( $this->is_hash_enabled( 'md5' ) ) {
26
- $md5 = $this->generate_hash( 'md5', $file_path );
27
- }
28
-
29
- if ( $this->is_hash_enabled( 'sha1' ) ) {
30
- $sha1 = $this->generate_hash( 'sha1', $file_path );
31
- }
32
-
33
- if ( $this->is_hash_enabled( 'sha256' ) ) {
34
- $sha256 = $this->generate_hash( 'sha256', $file_path );
35
- }
36
-
37
- if ( $this->is_hash_enabled( 'crc32b' ) ) {
38
- $crc32b = $this->generate_hash( 'crc32b', $file_path );
39
- }
40
-
41
- }
42
- }
43
- }
44
-
45
- return apply_filters( "dlm_file_hashes", array( 'md5' => $md5, 'sha1' => $sha1, 'sha256' => $sha256, 'crc32b' => $crc32b ), $file_path );
46
- }
47
-
48
- /**
49
- * Generate hash of $type for $file_path
50
- *
51
- * @param string $type
52
- * @param string $file_path
53
- *
54
- * @return string
55
- */
56
- public function generate_hash( $type, $file_path ) {
57
- $hash = "";
58
- switch ( $type ) {
59
- case 'md5':
60
- $hash = hash_file( 'md5', $file_path );
61
- break;
62
- case 'sha1':
63
- $hash = hash_file( 'sha1', $file_path );
64
- break;
65
- case 'sha256':
66
- $hash = hash_file( 'sha256', $file_path );
67
- break;
68
- case 'crc32b':
69
- $hash = hash_file( 'crc32b', $file_path );
70
- break;
71
- }
72
-
73
- return $hash;
74
- }
75
-
76
- /**
77
- * Check if generation of given hash $type is enabled
78
- *
79
- * @param string $type
80
- *
81
- * @return bool
82
- */
83
- public function is_hash_enabled( $type ) {
84
- return ( "1" == get_option( 'dlm_generate_hash_' . $type, 0 ) );
85
- }
86
-
87
- /**
88
- * Get available and enabled hashes
89
- *
90
- * @return array
91
- */
92
- public function get_available_hashes() {
93
- $hashes = array( 'md5', 'sha1', 'crc32b', 'sha256' );
94
-
95
- foreach ( $hashes as $hash_key => $hash ) {
96
- if ( ! $this->is_hash_enabled( $hash ) ) {
97
- unset( $hashes[ $hash_key ] );
98
- }
99
- }
100
-
101
- return $hashes;
102
- }
103
  }
1
+ <?php
2
+
3
+ class DLM_Hasher {
4
+
5
+ /**
6
+ * Get array with hashes for given file path.
7
+ * Array will always contain all hash keys but hash values will only be set if user option for hash is turned on.
8
+ *
9
+ * @param string $file_path
10
+ *
11
+ * @return array
12
+ */
13
+ public function get_file_hashes( $file_path ) {
14
+ $md5 = false;
15
+ $sha1 = false;
16
+ $sha256 = false;
17
+ $crc32b = false;
18
+
19
+ if ( $file_path ) {
20
+ list( $file_path, $remote_file ) = download_monitor()->service( 'file_manager' )->parse_file_path( $file_path );
21
+
22
+ if ( ! empty( $file_path ) ) {
23
+ if ( ! $remote_file || apply_filters( 'dlm_allow_remote_hash_file', false ) ) {
24
+
25
+ if ( $this->is_hash_enabled( 'md5' ) ) {
26
+ $md5 = $this->generate_hash( 'md5', $file_path );
27
+ }
28
+
29
+ if ( $this->is_hash_enabled( 'sha1' ) ) {
30
+ $sha1 = $this->generate_hash( 'sha1', $file_path );
31
+ }
32
+
33
+ if ( $this->is_hash_enabled( 'sha256' ) ) {
34
+ $sha256 = $this->generate_hash( 'sha256', $file_path );
35
+ }
36
+
37
+ if ( $this->is_hash_enabled( 'crc32b' ) ) {
38
+ $crc32b = $this->generate_hash( 'crc32b', $file_path );
39
+ }
40
+
41
+ }
42
+ }
43
+ }
44
+
45
+ return apply_filters( "dlm_file_hashes", array( 'md5' => $md5, 'sha1' => $sha1, 'sha256' => $sha256, 'crc32b' => $crc32b ), $file_path );
46
+ }
47
+
48
+ /**
49
+ * Generate hash of $type for $file_path
50
+ *
51
+ * @param string $type
52
+ * @param string $file_path
53
+ *
54
+ * @return string
55
+ */
56
+ public function generate_hash( $type, $file_path ) {
57
+ $hash = "";
58
+ switch ( $type ) {
59
+ case 'md5':
60
+ $hash = hash_file( 'md5', $file_path );
61
+ break;
62
+ case 'sha1':
63
+ $hash = hash_file( 'sha1', $file_path );
64
+ break;
65
+ case 'sha256':
66
+ $hash = hash_file( 'sha256', $file_path );
67
+ break;
68
+ case 'crc32b':
69
+ $hash = hash_file( 'crc32b', $file_path );
70
+ break;
71
+ }
72
+
73
+ return $hash;
74
+ }
75
+
76
+ /**
77
+ * Check if generation of given hash $type is enabled
78
+ *
79
+ * @param string $type
80
+ *
81
+ * @return bool
82
+ */
83
+ public function is_hash_enabled( $type ) {
84
+ return ( "1" == get_option( 'dlm_generate_hash_' . $type, 0 ) );
85
+ }
86
+
87
+ /**
88
+ * Get available and enabled hashes
89
+ *
90
+ * @return array
91
+ */
92
+ public function get_available_hashes() {
93
+ $hashes = array( 'md5', 'sha1', 'crc32b', 'sha256' );
94
+
95
+ foreach ( $hashes as $hash_key => $hash ) {
96
+ if ( ! $this->is_hash_enabled( $hash ) ) {
97
+ unset( $hashes[ $hash_key ] );
98
+ }
99
+ }
100
+
101
+ return $hashes;
102
+ }
103
  }
src/Integrations/PostTypesOrder.php CHANGED
@@ -1,21 +1,21 @@
1
- <?php
2
-
3
- class DLM_Integrations_PostTypesOrder {
4
-
5
- /**
6
- * Setup integration
7
- */
8
- public function setup() {
9
- add_filter( 'dlm_admin_dashboard_popular_downloads_filters', array( $this, 'ignore_popular_downloads_order' ), 10, 2 );
10
- }
11
-
12
- /**
13
- * @param $filters
14
- *
15
- * @return array
16
- */
17
- public function ignore_popular_downloads_order($filters) {
18
- $filters['ignore_custom_sort'] = true;
19
- return $filters;
20
- }
21
  }
1
+ <?php
2
+
3
+ class DLM_Integrations_PostTypesOrder {
4
+
5
+ /**
6
+ * Setup integration
7
+ */
8
+ public function setup() {
9
+ add_filter( 'dlm_admin_dashboard_popular_downloads_filters', array( $this, 'ignore_popular_downloads_order' ), 10, 2 );
10
+ }
11
+
12
+ /**
13
+ * @param $filters
14
+ *
15
+ * @return array
16
+ */
17
+ public function ignore_popular_downloads_order($filters) {
18
+ $filters['ignore_custom_sort'] = true;
19
+ return $filters;
20
+ }
21
  }
src/Integrations/YoastSEO.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
-
3
- class DLM_Integrations_YoastSEO {
4
-
5
- /**
6
- * Setup integration
7
- */
8
- public function setup() {
9
- add_filter( 'wpseo_sitemap_exclude_taxonomy', array( $this, 'exclude_taxonomies' ), 10, 2 );
10
- }
11
-
12
- /**
13
- * Exclude our categories from YoastSEO sitemap
14
- *
15
- * @param $is_excluded
16
- * @param $taxonomy_name
17
- *
18
- * @return bool
19
- */
20
- public function exclude_taxonomies( $is_excluded, $taxonomy_name ) {
21
- if ( "dlm_download_category" == $taxonomy_name || "dlm_download_tag" == $taxonomy_name ) {
22
- $is_excluded = true;
23
- }
24
-
25
- return $is_excluded;
26
- }
27
  }
1
+ <?php
2
+
3
+ class DLM_Integrations_YoastSEO {
4
+
5
+ /**
6
+ * Setup integration
7
+ */
8
+ public function setup() {
9
+ add_filter( 'wpseo_sitemap_exclude_taxonomy', array( $this, 'exclude_taxonomies' ), 10, 2 );
10
+ }
11
+
12
+ /**
13
+ * Exclude our categories from YoastSEO sitemap
14
+ *
15
+ * @param $is_excluded
16
+ * @param $taxonomy_name
17
+ *
18
+ * @return bool
19
+ */
20
+ public function exclude_taxonomies( $is_excluded, $taxonomy_name ) {
21
+ if ( "dlm_download_category" == $taxonomy_name || "dlm_download_tag" == $taxonomy_name ) {
22
+ $is_excluded = true;
23
+ }
24
+
25
+ return $is_excluded;
26
+ }
27
  }
src/LegacyUpgrader/Ajax.php CHANGED
@@ -1,158 +1,158 @@
1
- <?php
2
-
3
- class DLM_LU_Ajax {
4
-
5
- /**
6
- * Setup AJAX report hooks
7
- */
8
- public function setup() {
9
- add_action( 'wp_ajax_dlm_lu_get_download_queue', array( $this, 'handle_get_download_queue' ) );
10
- add_action( 'wp_ajax_dlm_lu_get_content_queue', array( $this, 'handle_get_content_queue' ) );
11
- add_action( 'wp_ajax_dlm_lu_upgrade_download', array( $this, 'handle_upgrade_download' ) );
12
- add_action( 'wp_ajax_dlm_lu_upgrade_content', array( $this, 'handle_upgrade_content_item' ) );
13
- add_action( 'wp_ajax_dlm_lu_mark_upgrade_done', array( $this, 'handle_mark_upgrade_done' ) );
14
- }
15
-
16
- /**
17
- * Handle dlm_lu_get_queue AJAX request
18
- */
19
- public function handle_get_download_queue() {
20
-
21
- // nonce check
22
- check_ajax_referer( 'dlm_legacy_upgrade', 'nonce' );
23
-
24
- // check cap access
25
- if ( ! current_user_can( 'manage_downloads' ) ) {
26
- exit;
27
- }
28
-
29
- // queue object
30
- $queue = new DLM_LU_Download_Queue();
31
-
32
- // build queue
33
- $queue->build_queue();
34
-
35
- // send queue as response
36
- wp_send_json( $queue->get_queue() );
37
-
38
- // houdoe
39
- exit;
40
- }
41
-
42
- /**
43
- * Handle dlm_lu_upgrade_download AJAX request
44
- */
45
- public function handle_upgrade_download() {
46
-
47
- // nonce check
48
- check_ajax_referer( 'dlm_legacy_upgrade', 'nonce' );
49
-
50
- // check cap access
51
- if ( ! current_user_can( 'manage_downloads' ) ) {
52
- exit;
53
- }
54
-
55
- if ( ! isset( $_GET['download_id'] ) ) {
56
- exit;
57
- }
58
-
59
- // get download id
60
- $download_id = absint( $_GET['download_id'] );
61
-
62
- // upgrade download
63
- $upgrader = new DLM_LU_Download_Upgrader();
64
-
65
- if ( $upgrader->upgrade_download( $download_id ) ) {
66
- wp_send_json( array( 'success' => true ) );
67
- } else {
68
- wp_send_json( array( 'success' => false ) );
69
- }
70
-
71
- // ciao
72
- exit;
73
- }
74
-
75
- /**
76
- * Handle dlm_lu_get_queue AJAX request
77
- */
78
- public function handle_get_content_queue() {
79
-
80
- // nonce check
81
- check_ajax_referer( 'dlm_legacy_upgrade', 'nonce' );
82
-
83
- // check cap access
84
- if ( ! current_user_can( 'manage_downloads' ) ) {
85
- exit;
86
- }
87
-
88
- // queue object
89
- $queue = new DLM_LU_Content_Queue();
90
-
91
- // build queue
92
- $queue->build_queue();
93
-
94
- // send queue as response
95
- wp_send_json( $queue->get_queue() );
96
-
97
- // bye
98
- exit;
99
- }
100
-
101
- /**
102
- * Handle dlm_lu_upgrade_download AJAX request
103
- */
104
- public function handle_upgrade_content_item() {
105
-
106
- // nonce check
107
- check_ajax_referer( 'dlm_legacy_upgrade', 'nonce' );
108
-
109
- // check cap access
110
- if ( ! current_user_can( 'manage_downloads' ) ) {
111
- exit;
112
- }
113
-
114
- if ( ! isset( $_GET['content_id'] ) ) {
115
- exit;
116
- }
117
-
118
- // get download id
119
- $content_id = absint( $_GET['content_id'] );
120
-
121
- // upgrade download
122
- $upgrader = new DLM_LU_Content_Upgrader();
123
-
124
- if ( $upgrader->upgrade_item( $content_id ) ) {
125
- wp_send_json( array( 'success' => true ) );
126
- } else {
127
- wp_send_json( array( 'success' => false ) );
128
- }
129
-
130
- // alaaf
131
- exit;
132
- }
133
-
134
- /**
135
- * Handle dlm_lu_mark_upgrade_done AJAX request
136
- */
137
- public function handle_mark_upgrade_done() {
138
-
139
- // nonce check
140
- check_ajax_referer( 'dlm_legacy_upgrade', 'nonce' );
141
-
142
- // check cap access
143
- if ( ! current_user_can( 'manage_downloads' ) ) {
144
- exit;
145
- }
146
-
147
- // hide upgrade message
148
- $checker = new DLM_LU_Checker();
149
- $checker->mark_upgraded();
150
-
151
- // success
152
- wp_send_json( array( 'success' => true ) );
153
-
154
- // tschüss
155
- exit;
156
- }
157
-
158
  }
1
+ <?php
2
+
3
+ class DLM_LU_Ajax {
4
+
5
+ /**
6
+ * Setup AJAX report hooks
7
+ */
8
+ public function setup() {
9
+ add_action( 'wp_ajax_dlm_lu_get_download_queue', array( $this, 'handle_get_download_queue' ) );
10
+ add_action( 'wp_ajax_dlm_lu_get_content_queue', array( $this, 'handle_get_content_queue' ) );
11
+ add_action( 'wp_ajax_dlm_lu_upgrade_download', array( $this, 'handle_upgrade_download' ) );
12
+ add_action( 'wp_ajax_dlm_lu_upgrade_content', array( $this, 'handle_upgrade_content_item' ) );
13
+ add_action( 'wp_ajax_dlm_lu_mark_upgrade_done', array( $this, 'handle_mark_upgrade_done' ) );
14
+ }
15
+
16
+ /**
17
+ * Handle dlm_lu_get_queue AJAX request
18
+ */
19
+ public function handle_get_download_queue() {
20
+
21
+ // nonce check
22
+ check_ajax_referer( 'dlm_legacy_upgrade', 'nonce' );
23
+
24
+ // check cap access
25
+ if ( ! current_user_can( 'manage_downloads' ) ) {
26
+ exit;
27
+ }
28
+
29
+ // queue object
30
+ $queue = new DLM_LU_Download_Queue();
31
+
32
+ // build queue
33
+ $queue->build_queue();
34
+
35
+ // send queue as response
36
+ wp_send_json( $queue->get_queue() );
37
+
38
+ // houdoe
39
+ exit;
40
+ }
41
+
42
+ /**
43
+ * Handle dlm_lu_upgrade_download AJAX request
44
+ */
45
+ public function handle_upgrade_download() {
46
+
47
+ // nonce check
48
+ check_ajax_referer( 'dlm_legacy_upgrade', 'nonce' );
49
+
50
+ // check cap access
51
+ if ( ! current_user_can( 'manage_downloads' ) ) {
52
+ exit;
53
+ }
54
+
55
+ if ( ! isset( $_GET['download_id'] ) ) {
56
+ exit;
57
+ }
58
+
59
+ // get download id
60
+ $download_id = absint( $_GET['download_id'] );
61
+
62
+ // upgrade download
63
+ $upgrader = new DLM_LU_Download_Upgrader();
64
+
65
+ if ( $upgrader->upgrade_download( $download_id ) ) {
66
+ wp_send_json( array( 'success' => true ) );
67
+ } else {
68
+ wp_send_json( array( 'success' => false ) );
69
+ }
70
+
71
+ // ciao
72
+ exit;
73
+ }
74
+
75
+ /**
76
+ * Handle dlm_lu_get_queue AJAX request
77
+ */
78
+ public function handle_get_content_queue() {
79
+
80
+ // nonce check
81
+ check_ajax_referer( 'dlm_legacy_upgrade', 'nonce' );
82
+
83
+ // check cap access
84
+ if ( ! current_user_can( 'manage_downloads' ) ) {
85
+ exit;
86
+ }
87
+
88
+ // queue object
89
+ $queue = new DLM_LU_Content_Queue();
90
+
91
+ // build queue
92
+ $queue->build_queue();
93
+
94
+ // send queue as response
95
+ wp_send_json( $queue->get_queue() );
96
+
97
+ // bye
98
+ exit;
99
+ }
100
+
101
+ /**
102
+ * Handle dlm_lu_upgrade_download AJAX request
103
+ */
104
+ public function handle_upgrade_content_item() {
105
+
106
+ // nonce check
107
+ check_ajax_referer( 'dlm_legacy_upgrade', 'nonce' );
108
+
109
+ // check cap access
110
+ if ( ! current_user_can( 'manage_downloads' ) ) {
111
+ exit;
112
+ }
113
+
114
+ if ( ! isset( $_GET['content_id'] ) ) {
115
+ exit;
116
+ }
117
+
118
+ // get download id
119
+ $content_id = absint( $_GET['content_id'] );
120
+
121
+ // upgrade download
122
+ $upgrader = new DLM_LU_Content_Upgrader();
123
+
124
+ if ( $upgrader->upgrade_item( $content_id ) ) {
125
+ wp_send_json( array( 'success' => true ) );
126
+ } else {
127
+ wp_send_json( array( 'success' => false ) );
128
+ }
129
+
130
+ // alaaf
131
+ exit;
132
+ }
133
+
134
+ /**
135
+ * Handle dlm_lu_mark_upgrade_done AJAX request
136
+ */
137
+ public function handle_mark_upgrade_done() {
138
+
139
+ // nonce check
140
+ check_ajax_referer( 'dlm_legacy_upgrade', 'nonce' );
141
+
142
+ // check cap access
143
+ if ( ! current_user_can( 'manage_downloads' ) ) {
144
+ exit;
145
+ }
146
+
147
+ // hide upgrade message
148
+ $checker = new DLM_LU_Checker();
149
+ $checker->mark_upgraded();
150
+
151
+ // success
152
+ wp_send_json( array( 'success' => true ) );
153
+
154
+ // tschüss
155
+ exit;
156
+ }
157
+
158
  }
src/LegacyUpgrader/Checker.php CHANGED
@@ -1,108 +1,108 @@
1
- <?php
2
-
3
-
4
- class DLM_LU_Checker {
5
-
6
- /**
7
- * Check if DLM has already been upgraded
8
- *
9
- * @return bool
10
- */
11
- private function has_been_upgraded() {
12
- return ( 1 === absint( get_option( DLM_Constants::LU_OPTION_UPGRADED, 0 ) ) );
13
- }
14
-
15
- /**
16
- * Check if legacy table exists
17
- * @return bool
18
- */
19
- private function has_legacy_tables() {
20
- global $wpdb;
21
-
22
- $du = new DLM_LU_Download_Upgrader();
23
- $legacy_tables = $du->get_legacy_tables();
24
- $sql = "SELECT 1 FROM `" . $legacy_tables['files'] . "` LIMIT 1;";
25
- $o_suppress_errors = $wpdb->suppress_errors;
26
- $wpdb->suppress_errors = true;
27
- $r = $wpdb->query( $sql );
28
- $wpdb->suppress_errors = $o_suppress_errors;
29
-
30
- return ( $r !== false );
31
- }
32
-
33
- /**
34
- * Returns true if there is at least one 'new' downloads.
35
- * A new download is a custom post type with type 'dlm_download'
36
- * @return bool
37
- */
38
- private function has_modern_downloads() {
39
- $repo = new DLM_WordPress_Download_Repository();
40
- $amount = $repo->num_rows();
41
-
42
- return ( $amount > 0 );
43
- }
44
-
45
- /**
46
- * Mark website as upgraded
47
- *
48
- * @return void
49
- */
50
- public function mark_upgraded() {
51
- update_option( DLM_Constants::LU_OPTION_UPGRADED, 1 );
52
- update_option( DLM_Constants::LU_OPTION_NEEDS_UPGRADING, 0 );
53
- }
54
-
55
- /**
56
- * Check if DLM needs upgrading
57
- *
58
- * @return bool
59
- */
60
- public function needs_upgrading() {
61
-
62
- // no upgrade requests in AJAX
63
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
64
- return false;
65
- }
66
-
67
- /**
68
- * Check if we already checked if need to upgrade.
69
- * If we already checked we stored the result in this option.
70
- * This prevents us from checking on every admin load.
71
- */
72
- $needs_upgrading = get_option( DLM_Constants::LU_OPTION_NEEDS_UPGRADING, null );
73
-
74
- // if the option is null, it's not set yet and we need to check.
75
- if ( null === $needs_upgrading ) {
76
-
77
- // set default to 0 (no)
78
- $needs_upgrading = 0;
79
-
80
- // check if we already upgraded
81
- if ( ! $this->has_been_upgraded() ) {
82
-
83
- // check if we have legacy tables
84
- if ( $this->has_legacy_tables() ) {
85
-
86
- /**
87
- * Check if there are already 'new' download
88
- * We're doing this because there are users that manually upgraded in the past
89
- * So they will have the legacy tables but don't need converting
90
- */
91
- if ( ! $this->has_modern_downloads() ) {
92
-
93
- // this site needs upgrading, set to 1 (yes)
94
- $needs_upgrading = 1;
95
- }
96
-
97
- }
98
- }
99
-
100
- // store the option so we don't have to check this everytime.
101
- update_option( DLM_Constants::LU_OPTION_NEEDS_UPGRADING, $needs_upgrading );
102
- }
103
-
104
- // now convert to int and return if it's 1.
105
- return ( 1 === absint( $needs_upgrading ) );
106
- }
107
-
108
  }
1
+ <?php
2
+
3
+
4
+ class DLM_LU_Checker {
5
+
6
+ /**
7
+ * Check if DLM has already been upgraded
8
+ *
9
+ * @return bool
10
+ */
11
+ private function has_been_upgraded() {
12
+ return ( 1 === absint( get_option( DLM_Constants::LU_OPTION_UPGRADED, 0 ) ) );
13
+ }
14
+
15
+ /**
16
+ * Check if legacy table exists
17
+ * @return bool
18
+ */
19
+ private function has_legacy_tables() {
20
+ global $wpdb;
21
+
22
+ $du = new DLM_LU_Download_Upgrader();
23
+ $legacy_tables = $du->get_legacy_tables();
24
+ $sql = "SELECT 1 FROM `" . $legacy_tables['files'] . "` LIMIT 1;";
25
+ $o_suppress_errors = $wpdb->suppress_errors;
26
+ $wpdb->suppress_errors = true;
27
+ $r = $wpdb->query( $sql );
28
+ $wpdb->suppress_errors = $o_suppress_errors;
29
+
30
+ return ( $r !== false );
31
+ }
32
+
33
+ /**
34
+ * Returns true if there is at least one 'new' downloads.
35
+ * A new download is a custom post type with type 'dlm_download'
36
+ * @return bool
37
+ */
38
+ private function has_modern_downloads() {
39
+ $repo = new DLM_WordPress_Download_Repository();
40
+ $amount = $repo->num_rows();
41
+
42
+ return ( $amount > 0 );
43
+ }
44
+
45
+ /**
46
+ * Mark website as upgraded
47
+ *
48
+ * @return void
49
+ */
50
+ public function mark_upgraded() {
51
+ update_option( DLM_Constants::LU_OPTION_UPGRADED, 1 );
52
+ update_option( DLM_Constants::LU_OPTION_NEEDS_UPGRADING, 0 );
53
+ }
54
+
55
+ /**
56
+ * Check if DLM needs upgrading
57
+ *
58
+ * @return bool
59
+ */
60
+ public function needs_upgrading() {
61
+
62
+ // no upgrade requests in AJAX
63
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
64
+ return false;
65
+ }
66
+
67
+ /**
68
+ * Check if we already checked if need to upgrade.
69
+ * If we already checked we stored the result in this option.
70
+ * This prevents us from checking on every admin load.
71
+ */
72
+ $needs_upgrading = get_option( DLM_Constants::LU_OPTION_NEEDS_UPGRADING, null );
73
+
74
+ // if the option is null, it's not set yet and we need to check.
75
+ if ( null === $needs_upgrading ) {
76
+
77
+ // set default to 0 (no)
78
+ $needs_upgrading = 0;
79
+
80
+ // check if we already upgraded
81
+ if ( ! $this->has_been_upgraded() ) {
82
+
83
+ // check if we have legacy tables
84
+ if ( $this->has_legacy_tables() ) {
85
+
86
+ /**
87
+ * Check if there are already 'new' download
88
+ * We're doing this because there are users that manually upgraded in the past
89
+ * So they will have the legacy tables but don't need converting
90
+ */
91
+ if ( ! $this->has_modern_downloads() ) {
92
+
93
+ // this site needs upgrading, set to 1 (yes)
94
+ $needs_upgrading = 1;
95
+ }
96
+
97
+ }
98
+ }
99
+
100
+ // store the option so we don't have to check this everytime.
101
+ update_option( DLM_Constants::LU_OPTION_NEEDS_UPGRADING, $needs_upgrading );
102
+ }
103
+
104
+ // now convert to int and return if it's 1.
105
+ return ( 1 === absint( $needs_upgrading ) );
106
+ }
107
+
108
  }
src/LegacyUpgrader/ContentQueue.php CHANGED
@@ -1,116 +1,116 @@
1
- <?php
2
-
3
- class DLM_LU_Content_Queue {
4
-
5
- const TABLE = 'legacy_upgrade_queue_content';
6
-
7
- /**
8
- * check if queue has already been build once
9
- *
10
- * @return bool
11
- */
12
- private function is_queue_already_build() {
13
- return ( 1 === absint( get_option( DLM_Constants::LU_OPTION_CONTENT_QUEUE_BUILD, 0 ) ) );
14
- }
15
-
16
- /**
17
- * Get the queue table
18
- *
19
- * @return string
20
- */
21
- private function get_queue_table() {
22
- global $wpdb;
23
-
24
- return $wpdb->prefix . self::TABLE;
25
- }
26
-
27
- /**
28
- * Create database table if not exists
29
- *
30
- * @return bool
31
- */
32
- private function create_table_if_not_exists() {
33
- global $wpdb;
34
-
35
- // create table
36
- $sql = "CREATE TABLE IF NOT EXISTS `" . $this->get_queue_table() . "` ( `content_id` INT NOT NULL , `processing` DATETIME NULL DEFAULT NULL , `done` DATETIME NULL DEFAULT NULL , PRIMARY KEY (`content_id`)) ;";
37
- $r = $wpdb->query( $sql );
38
-
39
- return ( false === $r );
40
- }
41
-
42
- /**
43
- * Build queue of downloads that need upgrading
44
- *
45
- * @return bool
46
- */
47
- public function build_queue() {
48
- global $wpdb;
49
-
50
- // check if queue was already build because YOBO! (you only build once).
51
- if ( $this->is_queue_already_build() ) {
52
- return false;
53
- }
54
-
55
- // create database table if not exists
56
- $this->create_table_if_not_exists();
57
-
58
- // fetch content items that aren't in our queue
59
- $content_items = $wpdb->get_results( "SELECT P.`ID` FROM `{$wpdb->posts}` P LEFT JOIN `" . $this->get_queue_table() . "` Q ON P.ID=Q.content_id WHERE P.`post_type` IN ( 'post', 'page' ) AND Q.content_id IS NULL ;" );
60
-
61
- // loop and insert into queue
62
- if ( count( $content_items ) > 0 ) {
63
- foreach ( $content_items as $content_item ) {
64
- $wpdb->insert( $this->get_queue_table(), array( 'content_id' => $content_item->ID ) );
65
- }
66
- }
67
-
68
- // set queue build
69
- update_option( DLM_Constants::LU_OPTION_CONTENT_QUEUE_BUILD, 1 );
70
-
71
- return true;
72
- }
73
-
74
- /**
75
- * Get queue of content items that need upgrading.
76
- * This means we only return items that aren't currently upgrading or are already upgraded.
77
- *
78
- * @return array
79
- */
80
- public function get_queue() {
81
- global $wpdb;
82
-
83
- return $wpdb->get_col( "SELECT `content_id` AS `id` from `" . $this->get_queue_table() . "` WHERE `processing` IS NULL AND `done` IS NULL " );
84
- }
85
-
86
- /**
87
- * Mark content item as currently being upgraded
88
- *
89
- * @param int $content_id
90
- *
91
- * @return bool
92
- */
93
- public function mark_upgrading( $content_id ) {
94
- global $wpdb;
95
-
96
- $res = $wpdb->query( $wpdb->prepare( "UPDATE `" . $this->get_queue_table() . "` SET `processing` = NOW() WHERE `content_id` = %d ;", $content_id ) );
97
-
98
- return ( false === $res );
99
- }
100
-
101
- /**
102
- * Mark content item as successfully upgraded
103
- *
104
- * @param int $content_id
105
- *
106
- * @return bool
107
- */
108
- public function mark_upgraded( $content_id ) {
109
- global $wpdb;
110
-
111
- $res = $wpdb->query( $wpdb->prepare( "UPDATE `" . $this->get_queue_table() . "` SET `done` = NOW() WHERE `content_id` = %d ;", $content_id ) );
112
-
113
- return ( false === $res );
114
- }
115
-
116
  }
1
+ <?php
2
+
3
+ class DLM_LU_Content_Queue {
4
+
5
+ const TABLE = 'legacy_upgrade_queue_content';
6
+
7
+ /**
8
+ * check if queue has already been build once
9
+ *
10
+ * @return bool
11
+ */
12
+ private function is_queue_already_build() {
13
+ return ( 1 === absint( get_option( DLM_Constants::LU_OPTION_CONTENT_QUEUE_BUILD, 0 ) ) );
14
+ }
15
+
16
+ /**
17
+ * Get the queue table
18
+ *
19
+ * @return string
20
+ */
21
+ private function get_queue_table() {
22
+ global $wpdb;
23
+
24
+ return $wpdb->prefix . self::TABLE;
25
+ }
26
+
27
+ /**
28
+ * Create database table if not exists
29
+ *
30
+ * @return bool
31
+ */
32
+ private function create_table_if_not_exists() {
33
+ global $wpdb;
34
+
35
+ // create table
36
+ $sql = "CREATE TABLE IF NOT EXISTS `" . $this->get_queue_table() . "` ( `content_id` INT NOT NULL , `processing` DATETIME NULL DEFAULT NULL , `done` DATETIME NULL DEFAULT NULL , PRIMARY KEY (`content_id`)) ;";
37
+ $r = $wpdb->query( $sql );
38
+
39
+ return ( false === $r );
40
+ }
41
+
42
+ /**
43
+ * Build queue of downloads that need upgrading
44
+ *
45
+ * @return bool
46
+ */
47
+ public function build_queue() {
48
+ global $wpdb;
49
+
50
+ // check if queue was already build because YOBO! (you only build once).
51
+ if ( $this->is_queue_already_build() ) {
52
+ return false;
53
+ }
54
+
55
+ // create database table if not exists
56
+ $this->create_table_if_not_exists();
57
+
58
+ // fetch content items that aren't in our queue
59
+ $content_items = $wpdb->get_results( "SELECT P.`ID` FROM `{$wpdb->posts}` P LEFT JOIN `" . $this->get_queue_table() . "` Q ON P.ID=Q.content_id WHERE P.`post_type` IN ( 'post', 'page' ) AND Q.content_id IS NULL ;" );
60
+
61
+ // loop and insert into queue
62
+ if ( count( $content_items ) > 0 ) {
63
+ foreach ( $content_items as $content_item ) {
64
+ $wpdb->insert( $this->get_queue_table(), array( 'content_id' => $content_item->ID ) );
65
+ }
66
+ }
67
+
68
+ // set queue build
69
+ update_option( DLM_Constants::LU_OPTION_CONTENT_QUEUE_BUILD, 1 );
70
+
71
+ return true;
72
+ }
73
+
74
+ /**
75
+ * Get queue of content items that need upgrading.
76
+ * This means we only return items that aren't currently upgrading or are already upgraded.
77
+ *
78
+ * @return array
79
+ */
80
+ public function get_queue() {
81
+ global $wpdb;
82
+
83
+ return $wpdb->get_col( "SELECT `content_id` AS `id` from `" . $this->get_queue_table() . "` WHERE `processing` IS NULL AND `done` IS NULL " );
84
+ }
85
+
86
+ /**
87
+ * Mark content item as currently being upgraded
88
+ *
89
+ * @param int $content_id
90
+ *
91
+ * @return bool
92
+ */
93
+ public function mark_upgrading( $content_id ) {
94
+ global $wpdb;
95
+
96
+ $res = $wpdb->query( $wpdb->prepare( "UPDATE `" . $this->get_queue_table() . "` SET `processing` = NOW() WHERE `content_id` = %d ;", $content_id ) );
97
+
98
+ return ( false === $res );
99
+ }
100
+
101
+ /**
102
+ * Mark content item as successfully upgraded
103
+ *
104
+ * @param int $content_id
105
+ *
106
+ * @return bool
107
+ */
108
+ public function mark_upgraded( $content_id ) {
109
+ global $wpdb;
110
+
111
+ $res = $wpdb->query( $wpdb->prepare( "UPDATE `" . $this->get_queue_table() . "` SET `done` = NOW() WHERE `content_id` = %d ;", $content_id ) );
112
+
113
+ return ( false === $res );
114
+ }
115
+
116
  }
src/LegacyUpgrader/ContentUpgrader.php CHANGED
@@ -1,69 +1,69 @@
1
- <?php
2
-
3
- class DLM_LU_Content_Upgrader {
4
-
5
- /** @var array temporary id map so we don't query the same legacy id multiple times per post/page */
6
- private $id_map = array();
7
-
8
- private $download_queue;
9
-
10
- public function __construct() {
11
- $this->download_queue = new DLM_LU_Download_Queue();
12
- }
13
-
14
- /**
15
- * Regex callback. Use match parts to construct new download shortcode.
16
- *
17
- * @param $m array
18
- *
19
- * @return string
20
- */
21
- public function preg_replace_cb( $m ) {
22
-
23
- // check map, if not in map, fetch
24
- if ( ! isset( $this->id_map[ $m[3] ] ) ) {
25
- $this->id_map[ $m[3] ] = $this->download_queue->get_new_id( $m[3] );
26
- }
27
-
28
- return "[download ".$m[1]."id=".$m[2].$this->id_map[ $m[3] ].$m[2].$m[4]."]";
29
- }
30
-
31
- /**
32
- * Upgrade item
33
- *
34
- * @param $item_id int
35
- *
36
- * @return bool
37
- */
38
- public function upgrade_item( $item_id ) {
39
- global $wpdb;
40
-
41
- // make sure item id is int
42
- $item_id = absint( $item_id );
43
-
44
- // queue item
45
- $queue = new DLM_LU_Content_Queue();
46
-
47
- // mark content item as upgrading
48
- $queue->mark_upgrading( $item_id );
49
-
50
- // get 'post'
51
- $post = get_post( $item_id );
52
-
53
- // content
54
- $content = $post->post_content;
55
-
56
- // generate new content
57
- $regex = "`\[download ([^\]]*)(?:id=([\"|']{0,1})([0-9]+)(?:[\"|']{0,1}))([^\]]*)\]`";
58
- $new_content = preg_replace_callback( $regex, array( $this, 'preg_replace_cb' ), $content );
59
-
60
- // update content in database
61
- $wpdb->update( $wpdb->posts, array( 'post_content' => $new_content ), array('ID'=>$post->ID), array('%s'), array('%d') );
62
-
63
- // mark content item as upgraded
64
- $queue->mark_upgraded( $item_id );
65
-
66
- return true;
67
- }
68
-
69
  }
1
+ <?php
2
+
3
+ class DLM_LU_Content_Upgrader {
4
+
5
+ /** @var array temporary id map so we don't query the same legacy id multiple times per post/page */
6
+ private $id_map = array();
7
+
8
+ private $download_queue;
9
+
10
+ public function __construct() {
11
+ $this->download_queue = new DLM_LU_Download_Queue();
12
+ }
13
+
14
+ /**
15
+ * Regex callback. Use match parts to construct new download shortcode.
16
+ *
17
+ * @param $m array
18
+ *
19
+ * @return string
20
+ */
21
+ public function preg_replace_cb( $m ) {
22
+
23
+ // check map, if not in map, fetch
24
+ if ( ! isset( $this->id_map[ $m[3] ] ) ) {
25
+ $this->id_map[ $m[3] ] = $this->download_queue->get_new_id( $m[3] );
26
+ }
27
+
28
+ return "[download ".$m[1]."id=".$m[2].$this->id_map[ $m[3] ].$m[2].$m[4]."]";
29
+ }
30
+
31
+ /**
32
+ * Upgrade item
33
+ *
34
+ * @param $item_id int
35
+ *
36
+ * @return bool
37
+ */
38
+ public function upgrade_item( $item_id ) {
39
+ global $wpdb;
40
+
41
+ // make sure item id is int
42
+ $item_id = absint( $item_id );
43
+
44
+ // queue item
45
+ $queue = new DLM_LU_Content_Queue();
46
+
47
+ // mark content item as upgrading
48
+ $queue->mark_upgrading( $item_id );
49
+
50
+ // get 'post'
51
+ $post = get_post( $item_id );
52
+
53
+ // content
54
+ $content = $post->post_content;
55
+
56
+ // generate new content
57
+ $regex = "`\[download ([^\]]*)(?:id=([\"|']{0,1})([0-9]+)(?:[\"|']{0,1}))([^\]]*)\]`";
58
+ $new_content = preg_replace_callback( $regex, array( $this, 'preg_replace_cb' ), $content );
59
+
60
+ // update content in database
61
+ $wpdb->update( $wpdb->posts, array( 'post_content' => $new_content ), array('ID'=>$post->ID), array('%s'), array('%d') );
62
+
63
+ // mark content item as upgraded
64
+ $queue->mark_upgraded( $item_id );
65
+
66
+ return true;
67
+ }
68
+
69
  }
src/LegacyUpgrader/DownloadQueue.php CHANGED
@@ -1,136 +1,136 @@
1
- <?php
2
-
3
- class DLM_LU_Download_Queue {
4
-
5
- const TABLE = 'legacy_upgrade_queue_downloads';
6
-
7
- /**
8
- * check if queue has already been build once
9
- *
10
- * @return bool
11
- */
12
- private function is_queue_already_build() {
13
- return ( 1 === absint( get_option( DLM_Constants::LU_OPTION_DOWNLOAD_QUEUE_BUILD, 0 ) ) );
14
- }
15
-
16
- /**
17
- * Get the queue table
18
- *
19
- * @return string
20
- */
21
- private function get_queue_table() {
22
- global $wpdb;
23
-
24
- return $wpdb->prefix . self::TABLE;
25
- }
26
-
27
- /**
28
- * Create database table if not exists
29
- *
30
- * @return bool
31
- */
32
- private function create_table_if_not_exists() {
33
- global $wpdb;
34
-
35
- // create table
36
- $sql = "CREATE TABLE IF NOT EXISTS `" . $this->get_queue_table() . "` ( `legacy_id` INT NOT NULL , `new_id` INT NULL DEFAULT NULL , `processing` DATETIME NULL DEFAULT NULL , `done` DATETIME NULL DEFAULT NULL , PRIMARY KEY (`legacy_id`)) ;";
37
- $r = $wpdb->query( $sql );
38
-
39
- return ( false === $r );
40
- }
41
-
42
- /**
43
- * Get new ID of legacy ID
44
- *
45
- * @param $legacy_id
46
- *
47
- * @return int
48
- */
49
- public function get_new_id( $legacy_id ) {
50
- global $wpdb;
51
-
52
- $legacy_id = absint( $legacy_id );
53
-
54
- return absint( $wpdb->get_var( $wpdb->prepare( "SELECT `new_id` FROM `" . $this->get_queue_table() . "` WHERE `legacy_id` = %d ", $legacy_id ) ) );
55
- }
56
-
57
- /**
58
- * Build queue of downloads that need upgrading
59
- *
60
- * @return bool
61
- */
62
- public function build_queue() {
63
- global $wpdb;
64
-
65
- // check if queue was already build because YOBO! (you only build once).
66
- if ( $this->is_queue_already_build() ) {
67
- return false;
68
- }
69
-
70
- // create database table if not exists
71
- $this->create_table_if_not_exists();
72
-
73
- // legacy tables we're fetching from
74
- $upgrader = new DLM_LU_Download_Upgrader();
75
- $legacy_tables = $upgrader->get_legacy_tables();
76
-
77
- // fetch legacy downloads that aren't in our queue
78
- $legacy_downloads = $wpdb->get_results( "SELECT F.`ID` FROM `{$legacy_tables['files']}` F LEFT JOIN `" . $this->get_queue_table() . "` Q ON F.ID=Q.legacy_id WHERE Q.legacy_id IS NULL ;" );
79
-
80
- // loop and insert into queue
81
- if ( count( $legacy_downloads ) > 0 ) {
82
- foreach ( $legacy_downloads as $legacy_download ) {
83
- $wpdb->insert( $this->get_queue_table(), array( 'legacy_id' => $legacy_download->ID ) );
84
- }
85
- }
86
-
87
- // set queue build
88
- update_option( DLM_Constants::LU_OPTION_DOWNLOAD_QUEUE_BUILD, 1 );
89
-
90
- return true;
91
- }
92
-
93
- /**
94
- * Get queue of downloads that need upgrading.
95
- * This means we only return items that aren't currently upgrading or are already upgraded.
96
- *
97
- * @return array
98
- */
99
- public function get_queue() {
100
- global $wpdb;
101
-
102
- return $wpdb->get_col( "SELECT `legacy_id` AS `id` from `" . $this->get_queue_table() . "` WHERE `new_id` IS NULL AND `processing` IS NULL AND `done` IS NULL " );
103
- }
104
-
105
- /**
106
- * Mark download as currently being upgraded
107
- *
108
- * @param int $legacy_id
109
- *
110
- * @return bool
111
- */
112
- public function mark_download_upgrading( $legacy_id ) {
113
- global $wpdb;
114
-
115
- $res = $wpdb->query( $wpdb->prepare( "UPDATE `" . $this->get_queue_table() . "` SET `processing` = NOW() WHERE `legacy_id` = %d ;", $legacy_id ) );
116
-
117
- return ( false === $res );
118
- }
119
-
120
- /**
121
- * Mark download as successfully upgraded
122
- *
123
- * @param int $legacy_id
124
- * @param int $new_id
125
- *
126
- * @return bool
127
- */
128
- public function mark_download_upgraded( $legacy_id, $new_id ) {
129
- global $wpdb;
130
-
131
- $res = $wpdb->query( $wpdb->prepare( "UPDATE `" . $this->get_queue_table() . "` SET `done` = NOW(), `new_id` = %d WHERE `legacy_id` = %d ;", $new_id, $legacy_id ) );
132
-
133
- return ( false === $res );
134
- }
135
-
136
  }
1
+ <?php
2
+
3
+ class DLM_LU_Download_Queue {
4
+
5
+ const TABLE = 'legacy_upgrade_queue_downloads';
6
+
7
+ /**
8
+ * check if queue has already been build once
9
+ *
10
+ * @return bool
11
+ */
12
+ private function is_queue_already_build() {
13
+ return ( 1 === absint( get_option( DLM_Constants::LU_OPTION_DOWNLOAD_QUEUE_BUILD, 0 ) ) );
14
+ }
15
+
16
+ /**
17
+ * Get the queue table
18
+ *
19
+ * @return string
20
+ */
21
+ private function get_queue_table() {
22
+ global $wpdb;
23
+
24
+ return $wpdb->prefix . self::TABLE;
25
+ }
26
+
27
+ /**
28
+ * Create database table if not exists
29
+ *
30
+ * @return bool
31
+ */
32
+ private function create_table_if_not_exists() {
33
+ global $wpdb;
34
+
35
+ // create table
36
+ $sql = "CREATE TABLE IF NOT EXISTS `" . $this->get_queue_table() . "` ( `legacy_id` INT NOT NULL , `new_id` INT NULL DEFAULT NULL , `processing` DATETIME NULL DEFAULT NULL , `done` DATETIME NULL DEFAULT NULL , PRIMARY KEY (`legacy_id`)) ;";
37
+ $r = $wpdb->query( $sql );
38
+
39
+ return ( false === $r );
40
+ }
41
+
42
+ /**
43
+ * Get new ID of legacy ID
44
+ *
45
+ * @param $legacy_id
46
+ *
47
+ * @return int
48
+ */
49
+ public function get_new_id( $legacy_id ) {
50
+ global $wpdb;
51
+
52
+ $legacy_id = absint( $legacy_id );
53
+
54
+ return absint( $wpdb->get_var( $wpdb->prepare( "SELECT `new_id` FROM `" . $this->get_queue_table() . "` WHERE `legacy_id` = %d ", $legacy_id ) ) );
55
+ }
56
+
57
+ /**
58
+ * Build queue of downloads that need upgrading
59
+ *
60
+ * @return bool
61
+ */
62
+ public function build_queue() {
63
+ global $wpdb;
64
+
65
+ // check if queue was already build because YOBO! (you only build once).
66
+ if ( $this->is_queue_already_build() ) {
67
+ return false;
68
+ }
69
+
70
+ // create database table if not exists
71
+ $this->create_table_if_not_exists();
72
+
73
+ // legacy tables we're fetching from
74
+ $upgrader = new DLM_LU_Download_Upgrader();
75
+ $legacy_tables = $upgrader->get_legacy_tables();
76
+
77
+ // fetch legacy downloads that aren't in our queue
78
+ $legacy_downloads = $wpdb->get_results( "SELECT F.`ID` FROM `{$legacy_tables['files']}` F LEFT JOIN `" . $this->get_queue_table() . "` Q ON F.ID=Q.legacy_id WHERE Q.legacy_id IS NULL ;" );
79
+
80
+ // loop and insert into queue
81
+ if ( count( $legacy_downloads ) > 0 ) {
82
+ foreach ( $legacy_downloads as $legacy_download ) {
83
+ $wpdb->insert( $this->get_queue_table(), array( 'legacy_id' => $legacy_download->ID ) );
84
+ }
85
+ }
86
+
87
+ // set queue build
88
+ update_option( DLM_Constants::LU_OPTION_DOWNLOAD_QUEUE_BUILD, 1 );
89
+
90
+ return true;
91
+ }
92
+
93
+ /**
94
+ * Get queue of downloads that need upgrading.
95
+ * This means we only return items that aren't currently upgrading or are already upgraded.
96
+ *
97
+ * @return array
98
+ */
99
+ public function get_queue() {
100
+ global $wpdb;
101
+
102
+ return $wpdb->get_col( "SELECT `legacy_id` AS `id` from `" . $this->get_queue_table() . "` WHERE `new_id` IS NULL AND `processing` IS NULL AND `done` IS NULL " );
103
+ }
104
+
105
+ /**
106
+ * Mark download as currently being upgraded
107
+ *
108
+ * @param int $legacy_id
109
+ *
110
+ * @return bool
111
+ */
112
+ public function mark_download_upgrading( $legacy_id ) {
113
+ global $wpdb;
114
+
115
+ $res = $wpdb->query( $wpdb->prepare( "UPDATE `" . $this->get_queue_table() . "` SET `processing` = NOW() WHERE `legacy_id` = %d ;", $legacy_id ) );
116
+
117
+ return ( false === $res );
118
+ }
119
+
120
+ /**
121
+ * Mark download as successfully upgraded
122
+ *
123
+ * @param int $legacy_id
124
+ * @param int $new_id
125
+ *
126
+ * @return bool
127
+ */
128
+ public function mark_download_upgraded( $legacy_id, $new_id ) {
129
+ global $wpdb;
130
+
131
+ $res = $wpdb->query( $wpdb->prepare( "UPDATE `" . $this->get_queue_table() . "` SET `done` = NOW(), `new_id` = %d WHERE `legacy_id` = %d ;", $new_id, $legacy_id ) );
132
+
133
+ return ( false === $res );
134
+ }
135
+
136
  }
src/LegacyUpgrader/DownloadUpgrader.php CHANGED
@@ -1,347 +1,347 @@
1
- <?php
2
-
3
- class DLM_LU_Download_Upgrader {
4
-
5
- /**
6
- * Get legacy tables
7
- *
8
- * @return array
9
- */
10
- public function get_legacy_tables() {
11
- global $wpdb;
12
-
13
- return array(
14
- 'files' => $wpdb->prefix . "download_monitor_files",
15
- 'tax' => $wpdb->prefix . "download_monitor_taxonomies",
16
- 'rel' => $wpdb->prefix . "download_monitor_relationships",
17
- 'formats' => $wpdb->prefix . "download_monitor_formats",
18
- 'stats' => $wpdb->prefix . "download_monitor_stats",
19
- 'log' => $wpdb->prefix . "download_monitor_log",
20
- 'meta' => $wpdb->prefix . "download_monitor_file_meta"
21
- );
22
- }
23
-
24
- /**
25
- * Add terms to download
26
- *
27
- * @param array $terms
28
- * @param string $taxonomy
29
- * @param int $download_id
30
- */
31
- private function add_terms_to_download( $terms, $taxonomy, $download_id ) {
32
- $term_ids = array();
33
-
34
- foreach ( $terms as $term ) {
35
-
36
- try {
37
- $term_obj = term_exists( $term, $taxonomy );
38
-
39
- if ( $term_obj !== 0 && $term_obj !== null ) {
40
- $term_id = $term_obj['term_id'];
41
- } else {
42
- $term_obj = wp_insert_term( $term, $taxonomy );
43
-
44
- if ( is_wp_error( $term_obj ) ) {
45
- throw new Exception( 'Error on wp_insert_term()' );
46
- }
47
-
48
- $term_id = $term_obj['term_id'];
49
- }
50
-
51
- $term_ids[] = $term_id;
52
- } catch ( Exception $e ) {
53
- DLM_Debug_Logger::log( "add_terms_to_download Exception: " . $e->getMessage() );
54
- }
55
-
56
- }
57
-
58
- wp_set_post_terms( $download_id, $term_ids, $taxonomy );
59
- }
60
-
61
- /**
62
- * Upgrade legacy download thumnail
63
- *
64
- * @param string $url URL to fetch attachment from
65
- * @param int $download_id
66
- *
67
- * @return bool
68
- */
69
- private function upgrade_thumbnail( $url, $download_id ) {
70
-
71
- $attachment_id = '';
72
- $attachment_url = '';
73
- $attachment_file = '';
74
- $upload_dir = wp_upload_dir();
75
- $attachment_array = array(
76
- 'post_title' => '',
77
- 'post_content' => '',
78
- 'post_status' => 'inherit',
79
- 'post_parent' => $download_id
80
- );
81
-
82
- // check if thumbnail is in a local directory, if it is we copy it
83
- if ( strstr( $url, site_url() ) ) {
84
- $abs_url = str_replace( trailingslashit( site_url() ), trailingslashit( ABSPATH ), $url );
85
- $new_name = wp_unique_filename( $upload_dir['path'], basename( $url ) );
86
- $new_url = trailingslashit( $upload_dir['path'] ) . $new_name;
87
-
88
- if ( copy( $abs_url, $new_url ) ) {
89
- $url = basename( $new_url );
90
- }
91
- }
92
-
93
- try {
94
-
95
- if ( ! strstr( $url, 'http' ) ) {
96
-
97
- // Local file
98
- $attachment_file = trailingslashit( $upload_dir['path'] ) . $url;
99
-
100
- // We have the path, check it exists
101
- if ( file_exists( $attachment_file ) ) {
102
-
103
- $attachment_url = str_replace( trailingslashit( ABSPATH ), trailingslashit( site_url() ), $attachment_file );
104
-
105
- if ( $info = wp_check_filetype( $attachment_file ) ) {
106
- $attachment_array['post_mime_type'] = $info['type'];
107
- } else {
108
- throw new Exception( 'Invalid file type' );
109
- }
110
-
111
- $attachment_array['guid'] = $attachment_url;
112
-
113
- $attachment_id = wp_insert_attachment( $attachment_array, $attachment_file, $download_id );
114
-
115
- } else {
116
- throw new Exception( 'Local image did not exist!' );
117
- }
118
-
119
- } else {
120
-
121
- // if the URL is absolute, but does not contain address, then upload it assuming base_site_url
122
- if ( preg_match( '|^/[\w\W]+$|', $url ) ) {
123
- $url = rtrim( site_url(), '/' ) . $url;
124
- }
125
-
126
- // fetch remote file
127
- $upload = $this->fetch_remote_file( $url );
128
-
129
- if ( is_wp_error( $upload ) ) {
130
- throw new Exception( 'Error fetching remote file' );
131
- }
132
-
133
- if ( $info = wp_check_filetype( $upload['file'] ) ) {
134
- $attachment_array['post_mime_type'] = $info['type'];
135
- } else {
136
- throw new Exception( 'Invalid file type' );
137
- }
138
-
139
- $attachment_array['guid'] = $upload['url'];
140
-
141
- $attachment_file = $upload['file'];
142
-
143
- // as per wp-admin/includes/upload.php
144
- $attachment_id = wp_insert_attachment( $attachment_array, $attachment_file, $download_id );
145
-
146
- unset( $upload );
147
- }
148
-
149
-
150
- // set new meta data
151
- if ( ! is_wp_error( $attachment_id ) && $attachment_id > 0 ) {
152
- wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $attachment_file ) );
153
- update_post_meta( $download_id, '_thumbnail_id', $attachment_id );
154
- }
155
-
156
- } catch ( Exception $e ) {
157
- DLM_Debug_Logger::log( "Legacy Upgrade Thumbnail Exception: " . $e->getMessage() );
158
-
159
- return false;
160
- }
161
-
162
- return true;
163
- }
164
-
165
- /**
166
- * Fetch a remote file
167
- *
168
- * @param $url string
169
- *
170
- * @throws Exception
171
- *
172
- * @return array
173
- */
174
- private function fetch_remote_file( $url ) {
175
-
176
- // extract the file name and extension from the url
177
- $file_name = basename( $url );
178
-
179
- // Ensure url is valid
180
- $url = str_replace( " ", '%20', $url );
181
-
182
- // Get the file
183
- $response = wp_remote_get( $url, array(
184
- 'timeout' => 10
185
- ) );
186
-
187
- // check for error in response
188
- if ( is_wp_error( $response ) ) {
189
- throw new Exception( "wp_remote_get response is WP error " );
190
- }
191
-
192
- // Upload the file
193
- $upload = wp_upload_bits( $file_name, '', wp_remote_retrieve_body( $response ) );
194
-
195
- if ( $upload['error'] ) {
196
- throw new Exception( $upload['error'] );
197
- }
198
-
199
- // Get filesize
200
- $filesize = filesize( $upload['file'] );
201
-
202
- // check if filesize is greater than 0
203
- if ( 0 == $filesize ) {
204
- @unlink( $upload['file'] );
205
- unset( $upload );
206
-
207
- throw new Exception( 'Zero size file downloaded' );
208
- }
209
-
210
- unset( $response );
211
-
212
- return $upload;
213
- }
214
-
215
- /**
216
- * Upgrade a single download item. Do NOT call this without it being in queue.
217
- *
218
- * @param $download_id
219
- *
220
- * @return bool
221
- */
222
- public function upgrade_download( $download_id ) {
223
- global $wpdb;
224
-
225
- $queue = new DLM_LU_Download_Queue();
226
-
227
- $legacy_tables = $this->get_legacy_tables();
228
-
229
- // mark download upgrading
230
- $queue->mark_download_upgrading( $download_id );
231
-
232
- // get legacy download information
233
- $legacy_download = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM `" . $legacy_tables['files'] . "` WHERE `id` = %d ;", $download_id ) );
234
-
235
- // create new Download object
236
- $download = new DLM_Download();
237
- $download->set_status( 'publish' );
238
- $download->set_author( 1 );
239
-
240
- // get user ID of user that created legacy download
241
- if ( ! empty( $legacy_download->user ) ) {
242
- $user = get_user_by( 'login', $legacy_download->user );
243
- if ( $user ) {
244
- $download->set_author( $user->ID );
245
- }
246
- }
247
-
248
- // set title & description
249
- $download->set_title( $legacy_download->title );
250
- $download->set_description( $legacy_download->file_description );
251
- $download->set_excerpt( "" );
252
-
253
- // set download options
254
- $download->set_featured( false ); // there was no featured in legacy
255
- $download->set_redirect_only( false ); // there was no redirect only in legacy
256
- $download->set_members_only( ( 1 === absint( $legacy_download->members ) ) );
257
-
258
- // set download count
259
- $download->set_download_count( absint( $legacy_download->hits ) );
260
-
261
- // store new download
262
- download_monitor()->service( 'download_repository' )->persist( $download );
263
-
264
- // create new version
265
- /** @var DLM_Download_Version $new_version */
266
- $version = new DLM_Download_Version();
267
-
268
- // set download id on version
269
- $version->set_download_id( $download->get_id() );
270
-
271
- // set version name on version
272
- $version->set_version( $legacy_download->dlversion );
273
-
274
- // set download count in version
275
- $version->set_download_count( absint( $legacy_download->hits ) );
276
-
277
- // set mirrors
278
- $urls = array();
279
- if ( $legacy_download->mirrors ) {
280
- $urls = explode( "\n", $legacy_download->mirrors );
281
- }
282
- $urls = array_filter( array_merge( array( $legacy_download->filename ), (array) $urls ) );
283
- $version->set_mirrors( $urls );
284
-
285
- // set other version data
286
- $version->set_filesize( "" ); // empty filesize so it's calculated on persist
287
- $version->set_author( $download->get_author() );
288
-
289
- // version date
290
- $version_date = new DateTime( $legacy_download->postDate );
291
- if ( $version_date->format( 'U' ) < 0 ) {
292
- $version_date = new DateTime();
293
- }
294
- $version->set_date( $version_date );
295
-
296
- // persist new version
297
- download_monitor()->service( 'version_repository' )->persist( $version );
298
-
299
- // clear download transient
300
- download_monitor()->service( 'transient_manager' )->clear_versions_transient( $download->get_id() );
301
-
302
- // upgrade categories
303
- $terms = $wpdb->get_col( $wpdb->prepare( "SELECT T.name
304
- FROM `{$legacy_tables['tax']}` AS T
305
- LEFT JOIN `{$legacy_tables['rel']}` AS R ON T.id = R.taxonomy_id
306
- WHERE R.download_id = %d
307
- AND T.taxonomy = 'category'", $legacy_download->id ) );
308
- if ( $terms ) {
309
- $this->add_terms_to_download( $terms, 'dlm_download_category', $download->get_id() );
310
- }
311
-
312
- // upgrade tags
313
- $terms = $wpdb->get_col( $wpdb->prepare( "SELECT T.name
314
- FROM `{$legacy_tables['tax']}` AS T
315
- LEFT JOIN `{$legacy_tables['rel']}` AS R ON T.id = R.taxonomy_id
316
- WHERE R.download_id = %d
317
- AND T.taxonomy = 'tag'", $legacy_download->id ) );
318
- if ( $terms ) {
319
- $this->add_terms_to_download( $terms, 'dlm_download_tag', $download->get_id() );
320
- }
321
-
322
- // upgrade any custom meta data
323
- $meta_fields = $wpdb->get_results( $wpdb->prepare( "SELECT meta_name, meta_value FROM {$legacy_tables['meta']} WHERE download_id = %d;", $legacy_download->id ) );
324
-
325
- foreach ( $meta_fields as $meta ) {
326
-
327
- // thumbnails were also stored as file_meta, so we add an exception check here
328
- if ( 'thumbnail' === $meta->meta_name ) {
329
- $this->upgrade_thumbnail( $meta->meta_value, $download->get_id() );
330
- continue;
331
- }
332
-
333
- // force was an old option that is no longer supported
334
- if ( 'force' === $meta->meta_name ) {
335
- continue;
336
- }
337
-
338
- update_post_meta( $download->get_id(), $meta->meta_name, $meta->meta_value );
339
- }
340
-
341
- // mark download as upgraded
342
- $queue->mark_download_upgraded( $legacy_download->id, $download->get_id() );
343
-
344
- return true;
345
- }
346
-
347
  }
1
+ <?php
2
+
3
+ class DLM_LU_Download_Upgrader {
4
+
5
+ /**
6
+ * Get legacy tables
7
+ *
8
+ * @return array
9
+ */
10
+ public function get_legacy_tables() {
11
+ global $wpdb;
12
+
13
+ return array(
14
+ 'files' => $wpdb->prefix . "download_monitor_files",
15
+ 'tax' => $wpdb->prefix . "download_monitor_taxonomies",
16
+ 'rel' => $wpdb->prefix . "download_monitor_relationships",
17
+ 'formats' => $wpdb->prefix . "download_monitor_formats",
18
+ 'stats' => $wpdb->prefix . "download_monitor_stats",
19
+ 'log' => $wpdb->prefix . "download_monitor_log",
20
+ 'meta' => $wpdb->prefix . "download_monitor_file_meta"
21
+ );
22
+ }
23
+
24
+ /**
25
+ * Add terms to download
26
+ *
27
+ * @param array $terms
28
+ * @param string $taxonomy
29
+ * @param int $download_id
30
+ */
31
+ private function add_terms_to_download( $terms, $taxonomy, $download_id ) {
32
+ $term_ids = array();
33
+
34
+ foreach ( $terms as $term ) {
35
+
36
+ try {
37
+ $term_obj = term_exists( $term, $taxonomy );
38
+
39
+ if ( $term_obj !== 0 && $term_obj !== null ) {
40
+ $term_id = $term_obj['term_id'];
41
+ } else {
42
+ $term_obj = wp_insert_term( $term, $taxonomy );
43
+
44
+ if ( is_wp_error( $term_obj ) ) {
45
+ throw new Exception( 'Error on wp_insert_term()' );
46
+ }
47
+
48
+ $term_id = $term_obj['term_id'];
49
+ }
50
+
51
+ $term_ids[] = $term_id;
52
+ } catch ( Exception $e ) {
53
+ DLM_Debug_Logger::log( "add_terms_to_download Exception: " . $e->getMessage() );
54
+ }
55
+
56
+ }
57
+
58
+ wp_set_post_terms( $download_id, $term_ids, $taxonomy );
59
+ }
60
+
61
+ /**
62
+ * Upgrade legacy download thumnail
63
+ *
64
+ * @param string $url URL to fetch attachment from
65
+ * @param int $download_id
66
+ *
67
+ * @return bool
68
+ */
69
+ private function upgrade_thumbnail( $url, $download_id ) {
70
+
71
+ $attachment_id = '';
72
+ $attachment_url = '';
73
+ $attachment_file = '';
74
+ $upload_dir = wp_upload_dir();
75
+ $attachment_array = array(
76
+ 'post_title' => '',
77
+ 'post_content' => '',
78
+ 'post_status' => 'inherit',
79
+ 'post_parent' => $download_id
80
+ );
81
+
82
+ // check if thumbnail is in a local directory, if it is we copy it
83
+ if ( strstr( $url, site_url() ) ) {
84
+ $abs_url = str_replace( trailingslashit( site_url() ), trailingslashit( ABSPATH ), $url );
85
+ $new_name = wp_unique_filename( $upload_dir['path'], basename( $url ) );
86
+ $new_url = trailingslashit( $upload_dir['path'] ) . $new_name;
87
+
88
+ if ( copy( $abs_url, $new_url ) ) {
89
+ $url = basename( $new_url );
90
+ }
91
+ }
92
+
93
+ try {
94
+
95
+ if ( ! strstr( $url, 'http' ) ) {
96
+
97
+ // Local file
98
+ $attachment_file = trailingslashit( $upload_dir['path'] ) . $url;
99
+
100
+ // We have the path, check it exists
101
+ if ( file_exists( $attachment_file ) ) {
102
+
103
+ $attachment_url = str_replace( trailingslashit( ABSPATH ), trailingslashit( site_url() ), $attachment_file );
104
+
105
+ if ( $info = wp_check_filetype( $attachment_file ) ) {
106
+ $attachment_array['post_mime_type'] = $info['type'];
107
+ } else {
108
+ throw new Exception( 'Invalid file type' );
109
+ }
110
+
111
+ $attachment_array['guid'] = $attachment_url;
112
+
113
+ $attachment_id = wp_insert_attachment( $attachment_array, $attachment_file, $download_id );
114
+
115
+ } else {
116
+ throw new Exception( 'Local image did not exist!' );
117
+ }
118
+
119
+ } else {
120
+
121
+ // if the URL is absolute, but does not contain address, then upload it assuming base_site_url
122
+ if ( preg_match( '|^/[\w\W]+$|', $url ) ) {
123
+ $url = rtrim( site_url(), '/' ) . $url;
124
+ }
125
+
126
+ // fetch remote file
127
+ $upload = $this->fetch_remote_file( $url );
128
+
129
+ if ( is_wp_error( $upload ) ) {
130
+ throw new Exception( 'Error fetching remote file' );
131
+ }
132
+
133
+ if ( $info = wp_check_filetype( $upload['file'] ) ) {
134
+ $attachment_array['post_mime_type'] = $info['type'];
135
+ } else {
136
+ throw new Exception( 'Invalid file type' );
137
+ }
138
+
139
+ $attachment_array['guid'] = $upload['url'];
140
+
141
+ $attachment_file = $upload['file'];
142
+
143
+ // as per wp-admin/includes/upload.php
144
+ $attachment_id = wp_insert_attachment( $attachment_array, $attachment_file, $download_id );
145
+
146
+ unset( $upload );
147
+ }
148
+
149
+
150
+ // set new meta data
151
+ if ( ! is_wp_error( $attachment_id ) && $attachment_id > 0 ) {
152
+ wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $attachment_file ) );
153
+ update_post_meta( $download_id, '_thumbnail_id', $attachment_id );
154
+ }
155
+
156
+ } catch ( Exception $e ) {
157
+ DLM_Debug_Logger::log( "Legacy Upgrade Thumbnail Exception: " . $e->getMessage() );
158
+
159
+ return false;
160
+ }
161
+
162
+ return true;
163
+ }
164
+
165
+ /**
166
+ * Fetch a remote file
167
+ *
168
+ * @param $url string
169
+ *
170
+ * @throws Exception
171
+ *
172
+ * @return array
173
+ */
174
+ private function fetch_remote_file( $url ) {
175
+
176
+ // extract the file name and extension from the url
177
+ $file_name = basename( $url );
178
+
179
+ // Ensure url is valid
180
+ $url = str_replace( " ", '%20', $url );
181
+
182
+ // Get the file
183
+ $response = wp_remote_get( $url, array(
184
+ 'timeout' => 10
185
+ ) );
186
+
187
+ // check for error in response
188
+ if ( is_wp_error( $response ) ) {
189
+ throw new Exception( "wp_remote_get response is WP error " );
190
+ }
191
+
192
+ // Upload the file
193
+ $upload = wp_upload_bits( $file_name, '', wp_remote_retrieve_body( $response ) );
194
+
195
+ if ( $upload['error'] ) {
196
+ throw new Exception( $upload['error'] );
197
+ }
198
+
199
+ // Get filesize
200
+ $filesize = filesize( $upload['file'] );
201
+
202
+ // check if filesize is greater than 0
203
+ if ( 0 == $filesize ) {
204
+ @unlink( $upload['file'] );
205
+ unset( $upload );
206
+
207
+ throw new Exception( 'Zero size file downloaded' );
208
+ }
209
+
210
+ unset( $response );
211
+
212
+ return $upload;
213
+ }
214
+
215
+ /**
216
+ * Upgrade a single download item. Do NOT call this without it being in queue.
217
+ *
218
+ * @param $download_id
219
+ *
220
+ * @return bool
221
+ */
222
+ public function upgrade_download( $download_id ) {
223
+ global $wpdb;
224
+
225
+ $queue = new DLM_LU_Download_Queue();
226
+
227
+ $legacy_tables = $this->get_legacy_tables();
228
+
229
+ // mark download upgrading
230
+ $queue->mark_download_upgrading( $download_id );
231
+
232
+ // get legacy download information
233
+ $legacy_download = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM `" . $legacy_tables['files'] . "` WHERE `id` = %d ;", $download_id ) );
234
+
235
+ // create new Download object
236
+ $download = new DLM_Download();
237
+ $download->set_status( 'publish' );
238
+ $download->set_author( 1 );
239
+
240
+ // get user ID of user that created legacy download
241
+ if ( ! empty( $legacy_download->user ) ) {
242
+ $user = get_user_by( 'login', $legacy_download->user );
243
+ if ( $user ) {
244
+ $download->set_author( $user->ID );
245
+ }
246
+ }
247
+
248
+ // set title & description
249
+ $download->set_title( $legacy_download->title );
250
+ $download->set_description( $legacy_download->file_description );
251
+ $download->set_excerpt( "" );
252
+
253
+ // set download options
254
+ $download->set_featured( false ); // there was no featured in legacy
255
+ $download->set_redirect_only( false ); // there was no redirect only in legacy
256
+ $download->set_members_only( ( 1 === absint( $legacy_download->members ) ) );
257
+
258
+ // set download count
259
+ $download->set_download_count( absint( $legacy_download->hits ) );
260
+
261
+ // store new download
262
+ download_monitor()->service( 'download_repository' )->persist( $download );
263
+
264
+ // create new version
265
+ /** @var DLM_Download_Version $new_version */
266
+ $version = new DLM_Download_Version();
267
+
268
+ // set download id on version
269
+ $version->set_download_id( $download->get_id() );
270
+
271
+ // set version name on version
272
+ $version->set_version( $legacy_download->dlversion );
273
+
274
+ // set download count in version
275
+ $version->set_download_count( absint( $legacy_download->hits ) );
276
+
277
+ // set mirrors
278
+ $urls = array();
279
+ if ( $legacy_download->mirrors ) {
280
+ $urls = explode( "\n", $legacy_download->mirrors );
281
+ }
282
+ $urls = array_filter( array_merge( array( $legacy_download->filename ), (array) $urls ) );
283
+ $version->set_mirrors( $urls );
284
+
285
+ // set other version data
286
+ $version->set_filesize( "" ); // empty filesize so it's calculated on persist
287
+ $version->set_author( $download->get_author() );
288
+
289
+ // version date
290
+ $version_date = new DateTime( $legacy_download->postDate );
291
+ if ( $version_date->format( 'U' ) < 0 ) {
292
+ $version_date = new DateTime();
293
+ }
294
+ $version->set_date( $version_date );
295
+
296
+ // persist new version
297
+ download_monitor()->service( 'version_repository' )->persist( $version );
298
+
299
+ // clear download transient
300
+ download_monitor()->service( 'transient_manager' )->clear_versions_transient( $download->get_id() );
301
+
302
+ // upgrade categories
303
+ $terms = $wpdb->get_col( $wpdb->prepare( "SELECT T.name
304
+ FROM `{$legacy_tables['tax']}` AS T
305
+ LEFT JOIN `{$legacy_tables['rel']}` AS R ON T.id = R.taxonomy_id
306
+ WHERE R.download_id = %d
307
+ AND T.taxonomy = 'category'", $legacy_download->id ) );
308
+ if ( $terms ) {
309
+ $this->add_terms_to_download( $terms, 'dlm_download_category', $download->get_id() );
310
+ }
311
+
312
+ // upgrade tags
313
+ $terms = $wpdb->get_col( $wpdb->prepare( "SELECT T.name
314
+ FROM `{$legacy_tables['tax']}` AS T
315
+ LEFT JOIN `{$legacy_tables['rel']}` AS R ON T.id = R.taxonomy_id
316
+ WHERE R.download_id = %d
317
+ AND T.taxonomy = 'tag'", $legacy_download->id ) );
318
+ if ( $terms ) {
319
+ $this->add_terms_to_download( $terms, 'dlm_download_tag', $download->get_id() );
320
+ }
321
+
322
+ // upgrade any custom meta data
323
+ $meta_fields = $wpdb->get_results( $wpdb->prepare( "SELECT meta_name, meta_value FROM {$legacy_tables['meta']} WHERE download_id = %d;", $legacy_download->id ) );
324
+
325
+ foreach ( $meta_fields as $meta ) {
326
+
327
+ // thumbnails were also stored as file_meta, so we add an exception check here
328
+ if ( 'thumbnail' === $meta->meta_name ) {
329
+ $this->upgrade_thumbnail( $meta->meta_value, $download->get_id() );
330
+ continue;
331
+ }
332
+
333
+ // force was an old option that is no longer supported
334
+ if ( 'force' === $meta->meta_name ) {
335
+ continue;
336
+ }
337
+
338
+ update_post_meta( $download->get_id(), $meta->meta_name, $meta->meta_value );
339
+ }
340
+
341
+ // mark download as upgraded
342
+ $queue->mark_download_upgraded( $legacy_download->id, $download->get_id() );
343
+
344
+ return true;
345
+ }
346
+
347
  }
src/LegacyUpgrader/Message.php CHANGED
@@ -1,48 +1,48 @@
1
- <?php
2
-
3
- class DLM_LU_Message {
4
-
5
- const OPTION_HIDE = 'dlm_lu_notice_hide';
6
-
7
- /**
8
- * private void
9
- */
10
- private function catch_hide_message() {
11
- if ( isset( $_GET['dlm_lu_hide_notice'] ) ) {
12
- $this->hide_message();
13
- }
14
- }
15
-
16
- /**
17
- * @return void
18
- */
19
- public function hide_message() {
20
- update_option( self::OPTION_HIDE, 1 );
21
- }
22
-
23
- /**
24
- * @return bool
25
- */
26
- private function is_hidden() {
27
- return ( 1 === absint( get_option( self::OPTION_HIDE, 0 ) ) );
28
- }
29
-
30
- /**
31
- * @return void
32
- */
33
- public function display() {
34
- $this->catch_hide_message();
35
-
36
- if ( ( ! isset( $_GET['page'] ) || ( isset( $_GET['page'] ) && 'dlm_legacy_upgrade' != $_GET['page'] ) ) && ! $this->is_hidden() ) {
37
- add_action( 'admin_notices', array( $this, 'body' ) );
38
- }
39
- }
40
-
41
- /**
42
- * @return void
43
- */
44
- public function body() {
45
- $vm = new DLM_View_Manager();
46
- $vm->display( "notice-lu-upgrade" );
47
- }
48
  }
1
+ <?php
2
+
3
+ class DLM_LU_Message {
4
+
5
+ const OPTION_HIDE = 'dlm_lu_notice_hide';
6
+
7
+ /**
8
+ * private void
9
+ */
10
+ private function catch_hide_message() {
11
+ if ( isset( $_GET['dlm_lu_hide_notice'] ) ) {
12
+ $this->hide_message();
13
+ }
14
+ }
15
+
16
+ /**
17
+ * @return void
18
+ */
19
+ public function hide_message() {
20
+ update_option( self::OPTION_HIDE, 1 );
21
+ }
22
+
23
+ /**
24
+ * @return bool
25
+ */
26
+ private function is_hidden() {
27
+ return ( 1 === absint( get_option( self::OPTION_HIDE, 0 ) ) );
28
+ }
29
+
30
+ /**
31
+ * @return void
32
+ */
33
+ public function display() {
34
+ $this->catch_hide_message();
35
+
36
+ if ( ( ! isset( $_GET['page'] ) || ( isset( $_GET['page'] ) && 'dlm_legacy_upgrade' != $_GET['page'] ) ) && ! $this->is_hidden() ) {
37
+ add_action( 'admin_notices', array( $this, 'body' ) );
38
+ }
39
+ }
40
+
41
+ /**
42
+ * @return void
43
+ */
44
+ public function body() {
45
+ $vm = new DLM_View_Manager();
46
+ $vm->display( "notice-lu-upgrade" );
47
+ }
48
  }
src/LegacyUpgrader/Page.php CHANGED
@@ -1,60 +1,60 @@
1
- <?php
2
-
3
- class DLM_LU_Page {
4
-
5
- /**
6
- * Setup hooks
7
- */
8
- public function setup() {
9
- add_action( 'admin_menu', array( $this, 'add_admin_menu' ), 12 );
10
- }
11
-
12
- /**
13
- * Add settings menu item
14
- */
15
- public function add_admin_menu() {
16
- // Settings page
17
- add_submenu_page( '_dlm_not_existing_slug', __( 'Legacy Upgrader', 'download-monitor' ), __( 'Legacy Upgrader', 'download-monitor' ), 'manage_downloads', 'dlm_legacy_upgrade', array(
18
- $this,
19
- 'view'
20
- ) );
21
- }
22
-
23
- /**
24
- * Display page
25
- */
26
- public function view() {
27
-
28
- $show_upgrader = true;
29
- $checker = new DLM_LU_Checker();
30
- if ( ! $checker->needs_upgrading() ) {
31
- $show_upgrader = false;
32
- }
33
-
34
- if ( isset( $_GET['dlm_lu_force'] ) ) {
35
- $show_upgrader = true;
36
- }
37
-
38
-
39
- ?>
40
- <div class="wrap">
41
- <h1><?php echo esc_html__( 'Download Monitor - Legacy Upgrade', 'download-monitor' ); ?></h1><br/>
42
- <p><?php printf( wp_kses_post( __( "Welcome to the Download Monitor Legacy Upgrader. On this page we will upgrade your old Download Monitor (legacy) data so it will work with the latest version. If you're on this page, it should mean that you updated to this version from Download Monitor %s. If you're unsure if this is correct, or you want to read more about the legacy upgrade, we've setup a page that will explain this process in a lot more detail. %sClick here%s if to view that page.", 'download-monitor' ) ), "<strong>3.x</strong>", "<a href='https://www.download-monitor.com/kb/legacy-upgrade?utm_source=plugin&utm_medium=dlm-lu-upgrade-page&utm_campaign=dlm-lu-more-information' target='_blank'>", "</a>" ); ?></p>
43
- <?php
44
- if ( ! $show_upgrader ) {
45
- ?>
46
- <p style='font-weight:bold;color:#a00;font-size:1.4em;'><?php echo esc_html__( "WARNING: We don't think your database needs upgrading. Only continue if you're 100% sure what you're doing!", 'download-monitor' ); ?></p>
47
- <a class="button button-primary button-large"
48
- href="<?php echo esc_url( add_query_arg( array( 'page' => 'dlm_legacy_upgrade', 'dlm_lu_force' => 'true' ), admin_url( 'options.php' ) ) ); ?>"><?php echo esc_html__( "I'm sure I want to run the upgrader anyway", 'download-monitor' ); ?></a>
49
- <?php
50
- } else {
51
- ?>
52
- <div id="dlm-legacy-upgrade-container"></div>
53
- <?php
54
- }
55
- ?>
56
- </div>
57
- <?php
58
- }
59
-
60
  }
1
+ <?php
2
+
3
+ class DLM_LU_Page {
4
+
5
+ /**
6
+ * Setup hooks
7
+ */
8
+ public function setup() {
9
+ add_action( 'admin_menu', array( $this, 'add_admin_menu' ), 12 );
10
+ }
11
+
12
+ /**
13
+ * Add settings menu item
14
+ */
15
+ public function add_admin_menu() {
16
+ // Settings page
17
+ add_submenu_page( '_dlm_not_existing_slug', __( 'Legacy Upgrader', 'download-monitor' ), __( 'Legacy Upgrader', 'download-monitor' ), 'manage_downloads', 'dlm_legacy_upgrade', array(
18
+ $this,
19
+ 'view'
20
+ ) );
21
+ }
22
+
23
+ /**
24
+ * Display page
25
+ */
26
+ public function view() {
27
+
28
+ $show_upgrader = true;
29
+ $checker = new DLM_LU_Checker();
30
+ if ( ! $checker->needs_upgrading() ) {
31
+ $show_upgrader = false;
32
+ }
33
+
34
+ if ( isset( $_GET['dlm_lu_force'] ) ) {
35
+ $show_upgrader = true;
36
+ }
37
+
38
+
39
+ ?>
40
+ <div class="wrap">
41
+ <h1><?php echo esc_html__( 'Download Monitor - Legacy Upgrade', 'download-monitor' ); ?></h1><br/>
42
+ <p><?php printf( wp_kses_post( __( "Welcome to the Download Monitor Legacy Upgrader. On this page we will upgrade your old Download Monitor (legacy) data so it will work with the latest version. If you're on this page, it should mean that you updated to this version from Download Monitor %s. If you're unsure if this is correct, or you want to read more about the legacy upgrade, we've setup a page that will explain this process in a lot more detail. %sClick here%s if to view that page.", 'download-monitor' ) ), "<strong>3.x</strong>", "<a href='https://www.download-monitor.com/kb/legacy-upgrade?utm_source=plugin&utm_medium=dlm-lu-upgrade-page&utm_campaign=dlm-lu-more-information' target='_blank'>", "</a>" ); ?></p>
43
+ <?php
44
+ if ( ! $show_upgrader ) {
45
+ ?>
46
+ <p style='font-weight:bold;color:#a00;font-size:1.4em;'><?php echo esc_html__( "WARNING: We don't think your database needs upgrading. Only continue if you're 100% sure what you're doing!", 'download-monitor' ); ?></p>
47
+ <a class="button button-primary button-large"
48
+ href="<?php echo esc_url( add_query_arg( array( 'page' => 'dlm_legacy_upgrade', 'dlm_lu_force' => 'true' ), admin_url( 'options.php' ) ) ); ?>"><?php echo esc_html__( "I'm sure I want to run the upgrader anyway", 'download-monitor' ); ?></a>
49
+ <?php
50
+ } else {
51
+ ?>
52
+ <div id="dlm-legacy-upgrade-container"></div>
53
+ <?php
54
+ }
55
+ ?>
56
+ </div>
57
+ <?php
58
+ }
59
+
60
  }
src/Polyfill/DateTimeImmutable/DateTimeInterface.php CHANGED
@@ -1,28 +1,28 @@
1
- <?php
2
-
3
- /**
4
- * Interface DateTimeInterface
5
- *
6
- * Forked from https://github.com/jesseschalken/php-date-time-immutable-polyfill
7
- */
8
-
9
- // To keep the result of (new \ReflectionClass('DateTimeInterface'))->_toString()
10
- // as close as possible to PHP>=5.5, do not add, remove, reorder or change the
11
- // signature of any methods in this interface.
12
-
13
- if ( ! interface_exists( "DateTimeInterface" ) ) {
14
- interface DateTimeInterface {
15
- public function format( $format );
16
-
17
- public function getTimezone();
18
-
19
- public function getOffset();
20
-
21
- public function getTimestamp();
22
-
23
- public function diff( $object, $absolute = false );
24
-
25
- public function __wakeup();
26
- }
27
- }
28
-
1
+ <?php
2
+
3
+ /**
4
+ * Interface DateTimeInterface
5
+ *
6
+ * Forked from https://github.com/jesseschalken/php-date-time-immutable-polyfill
7
+ */
8
+
9
+ // To keep the result of (new \ReflectionClass('DateTimeInterface'))->_toString()
10
+ // as close as possible to PHP>=5.5, do not add, remove, reorder or change the
11
+ // signature of any methods in this interface.
12
+
13
+ if ( ! interface_exists( "DateTimeInterface" ) ) {
14
+ interface DateTimeInterface {
15
+ public function format( $format );
16
+
17
+ public function getTimezone();
18
+
19
+ public function getOffset();
20
+
21
+ public function getTimestamp();
22
+
23
+ public function diff( $object, $absolute = false );
24
+
25
+ public function __wakeup();
26
+ }
27
+ }
28
+
src/Product/ProductErrorHandler.php CHANGED
@@ -1,90 +1,90 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit;
6
- }
7
-
8
- class DLM_Product_Error_Handler {
9
-
10
- /**
11
- * @var DLM_Product_Error_Handler
12
- */
13
- private static $instance = null;
14
-
15
- /**
16
- * @var array<string>
17
- */
18
- private $errors = array();
19
-
20
- /**
21
- * Private constructor
22
- */
23
- private function __construct() {
24
- $this->setup();
25
- }
26
-
27
- /**
28
- * Singleton get method
29
- *
30
- * @since 1.0.0
31
- * @access public
32
- *
33
- * @return DLM_Product_Error_Handler
34
- */
35
- public static function get() {
36
- if ( null == self::$instance ) {
37
- self::$instance = new self();
38
- }
39
-
40
- return self::$instance;
41
- }
42
-
43
- private function setup() {
44
- $this->load();
45
- add_action( 'admin_notices', array( $this, 'display' ) );
46
- add_action( 'shutdown', array( $this, 'store' ) );
47
- }
48
-
49
- /**
50
- * Add message to error array
51
- *
52
- * @param string $message
53
- */
54
- public function add( $message ) {
55
- $this->errors[] = $message;
56
- }
57
-
58
- /**
59
- * Load error messages
60
- */
61
- public function load() {
62
- $this->errors = get_option( 'dlm_product_errors', array() );
63
- }
64
-
65
- /**
66
- * Store error messags
67
- */
68
- public function store() {
69
- update_option( 'dlm_product_errors', $this->errors );
70
- }
71
-
72
- /**
73
- * Display errors
74
- */
75
- public function display() {
76
- if ( ! empty( $this->errors ) ) {
77
- foreach ( $this->errors as $key => $error ) {
78
- ?>
79
- <div class="error">
80
- <p><?php echo wp_kses_post( $error ); ?></p>
81
- </div>
82
- <?php
83
- // unset error
84
- unset( $this->errors[ $key ] );
85
- }
86
- }
87
- }
88
-
89
-
90
  }
1
+ <?php
2
+
3
+ // Exit if accessed directly
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit;
6
+ }
7
+
8
+ class DLM_Product_Error_Handler {
9
+
10
+ /**
11
+ * @var DLM_Product_Error_Handler
12
+ */
13
+ private static $instance = null;
14
+
15
+ /**
16
+ * @var array<string>
17
+ */
18
+ private $errors = array();
19
+
20
+ /**
21
+ * Private constructor
22
+ */
23
+ private function __construct() {
24
+ $this->setup();
25
+ }
26
+
27
+ /**
28
+ * Singleton get method
29
+ *
30
+ * @since 1.0.0
31
+ * @access public
32
+ *
33
+ * @return DLM_Product_Error_Handler
34
+ */
35
+ public static function get() {
36
+ if ( null == self::$instance ) {
37
+ self::$instance = new self();
38
+ }
39
+
40
+ return self::$instance;
41
+ }
42
+
43
+ private function setup() {
44
+ $this->load();
45
+ add_action( 'admin_notices', array( $this, 'display' ) );
46
+ add_action( 'shutdown', array( $this, 'store' ) );
47
+ }
48
+
49
+ /**
50
+ * Add message to error array
51
+ *
52
+ * @param string $message
53
+ */
54
+ public function add( $message ) {
55
+ $this->errors[] = $message;
56
+ }
57
+
58
+ /**
59
+ * Load error messages
60
+ */
61
+ public function load() {
62
+ $this->errors = get_option( 'dlm_product_errors', array() );
63
+ }
64
+
65
+ /**
66
+ * Store error messags
67
+ */
68
+ public function store() {
69
+ update_option( 'dlm_product_errors', $this->errors );
70
+ }
71
+
72
+ /**
73
+ * Display errors
74
+ */
75
+ public function display() {
76
+ if ( ! empty( $this->errors ) ) {
77
+ foreach ( $this->errors as $key => $error ) {
78
+ ?>
79
+ <div class="error">
80
+ <p><?php echo wp_kses_post( $error ); ?></p>
81
+ </div>
82
+ <?php
83
+ // unset error
84
+ unset( $this->errors[ $key ] );
85
+ }
86
+ }
87
+ }
88
+
89
+
90
  }
src/Product/ProductLicense.php CHANGED
@@ -1,110 +1,110 @@
1
- <?php
2
-
3
- class DLM_Product_License {
4
-
5
- /**
6
- * @var String
7
- */
8
- private $product_id;
9
-
10
- /**
11
- * @var String
12
- */
13
- private $key;
14
-
15
- /**
16
- * @var String
17
- */
18
- private $email;
19
-
20
- /**
21
- * @var String (active or inactive)
22
- */
23
- private $status;
24
-
25
- /**
26
- * Constructor
27
- *
28
- * @param String $product_id
29
- */
30
- public function __construct( $product_id ) {
31
-
32
- // Set Product ID
33
- $this->product_id = $product_id;
34
-
35
- // Load license data from DB
36
- $db_license = wp_parse_args( get_option( $this->product_id . '-license', array() ), array(
37
- 'key' => '',
38
- 'email' => get_option( 'admin_email', '' ),
39
- 'status' => 'inactive'
40
- ) );
41
-
42
- // Set properties
43
- $this->key = $db_license['key'];
44
- $this->email = $db_license['email'];
45
- $this->status = $db_license['status'];
46
- }
47
-
48
- /**
49
- * @return String
50
- */
51
- public function get_key() {
52
- return $this->key;
53
- }
54
-
55
- /**
56
- * @param String $key
57
- */
58
- public function set_key( $key ) {
59
- $this->key = $key;
60
- }
61
-
62
- /**
63
- * @return String
64
- */
65
- public function get_email() {
66
- return $this->email;
67
- }
68
-
69
- /**
70
- * @param String $email
71
- */
72
- public function set_email( $email ) {
73
- $this->email = $email;
74
- }
75
-
76
- /**
77
- * @return String
78
- */
79
- public function get_status() {
80
- return $this->status;
81
- }
82
-
83
- /**
84
- * @param String $status
85
- */
86
- public function set_status( $status ) {
87
- $this->status = $status;
88
- }
89
-
90
- /**
91
- * Return if license is active
92
- *
93
- * @return bool
94
- */
95
- public function is_active() {
96
- return ( 'active' === $this->status );
97
- }
98
-
99
- /**
100
- * Store license data in DB
101
- */
102
- public function store() {
103
- update_option( $this->product_id . '-license', array(
104
- 'key' => $this->get_key(),
105
- 'email' => $this->get_email(),
106
- 'status' => $this->get_status()
107
- ) );
108
- }
109
-
110
  }
1
+ <?php
2
+
3
+ class DLM_Product_License {
4
+
5
+ /**
6
+ * @var String
7
+ */
8
+ private $product_id;
9
+
10
+ /**
11
+ * @var String
12
+ */
13
+ private $key;
14
+
15
+ /**
16
+ * @var String
17
+ */
18
+ private $email;
19
+
20
+ /**
21
+ * @var String (active or inactive)
22
+ */
23
+ private $status;
24
+
25
+ /**
26
+ * Constructor
27
+ *
28
+ * @param String $product_id
29
+ */
30
+ public function __construct( $product_id ) {
31
+
32
+ // Set Product ID
33
+ $this->product_id = $product_id;
34
+
35
+ // Load license data from DB
36
+ $db_license = wp_parse_args( get_option( $this->product_id . '-license', array() ), array(
37
+ 'key' => '',
38
+ 'email' => get_option( 'admin_email', '' ),
39
+ 'status' => 'inactive'
40
+ ) );
41
+
42
+ // Set properties
43
+ $this->key = $db_license['key'];
44
+ $this->email = $db_license['email'];
45
+ $this->status = $db_license['status'];
46
+ }
47
+
48
+ /**
49
+ * @return String
50
+ */
51
+ public function get_key() {
52
+ return $this->key;
53
+ }
54
+
55
+ /**
56
+ * @param String $key
57
+ */
58
+ public function set_key( $key ) {
59
+ $this->key = $key;
60
+ }
61
+
62
+ /**
63
+ * @return String
64
+ */
65
+ public function get_email() {
66
+ return $this->email;
67
+ }
68
+
69
+ /**
70
+ * @param String $email
71
+ */
72
+ public function set_email( $email ) {
73
+ $this->email = $email;
74
+ }
75
+
76
+ /**
77
+ * @return String
78
+ */
79
+ public function get_status() {
80
+ return $this->status;
81
+ }
82
+
83
+ /**
84
+ * @param String $status
85
+ */
86
+ public function set_status( $status ) {
87
+ $this->status = $status;
88
+ }
89
+
90
+ /**
91
+ * Return if license is active
92
+ *
93
+ * @return bool
94
+ */
95
+ public function is_active() {
96
+ return ( 'active' === $this->status );
97
+ }
98
+
99
+ /**
100
+ * Store license data in DB
101
+ */
102
+ public function store() {
103
+ update_option( $this->product_id . '-license', array(
104
+ 'key' => $this->get_key(),
105
+ 'email' => $this->get_email(),
106
+ 'status' => $this->get_status()
107
+ ) );
108
+ }
109
+
110
  }
src/Search.php CHANGED
@@ -1,51 +1,51 @@
1
- <?php
2
-
3
-
4
- /**
5
- * Class DLM_Search
6
- *
7
- * Add search support to Download Monitor downloads
8
- */
9
- class DLM_Search {
10
-
11
- /**
12
- * Setup the search
13
- */
14
- public function setup() {
15
-
16
- // frontend
17
- if ( ! is_admin() ) {
18
-
19
- if ( '1' == get_option( 'dlm_wp_search_enabled' ) ) {
20
- add_filter( 'post_type_link', array( $this, 'filter_download_permalink' ), 20, 2 );
21
- }
22
-
23
- }
24
-
25
- }
26
-
27
- /**
28
- * @param $post_link string
29
- * @param $post WP_Post
30
- *
31
- * @return string
32
- */
33
- public function filter_download_permalink( $post_link, $post ) {
34
- // check if we're filtering a dlm_download permalink in a search query
35
- if ( 'dlm_download' == $post->post_type && is_search() ) {
36
-
37
- // fetch download object
38
- try {
39
- /** @var DLM_Download $download */
40
- $download = download_monitor()->service( 'download_repository' )->retrieve_single( $post->ID );
41
-
42
- // allow this search download URL to be filtered
43
- return apply_filters( 'dlm_search_download_url', $download->get_the_download_link(), $download );
44
- } catch ( Exception $e ) {
45
- }
46
- }
47
-
48
- return $post_link;
49
- }
50
-
51
  }
1
+ <?php
2
+
3
+
4
+ /**
5
+ * Class DLM_Search
6
+ *
7
+ * Add search support to Download Monitor downloads
8
+ */
9
+ class DLM_Search {
10
+
11
+ /**
12
+ * Setup the search
13
+ */
14
+ public function setup() {
15
+
16
+ // frontend
17
+ if ( ! is_admin() ) {
18
+
19
+ if ( '1' == get_option( 'dlm_wp_search_enabled' ) ) {
20
+ add_filter( 'post_type_link', array( $this, 'filter_download_permalink' ), 20, 2 );
21
+ }
22
+
23
+ }
24
+
25
+ }
26
+
27
+ /**
28
+ * @param $post_link string
29
+ * @param $post WP_Post
30
+ *
31
+ * @return string
32
+ */
33
+ public function filter_download_permalink( $post_link, $post ) {
34
+ // check if we're filtering a dlm_download permalink in a search query
35
+ if ( 'dlm_download' == $post->post_type && is_search() ) {
36
+
37
+ // fetch download object
38
+ try {
39
+ /** @var DLM_Download $download */
40
+ $download = download_monitor()->service( 'download_repository' )->retrieve_single( $post->ID );
41
+
42
+ // allow this search download URL to be filtered
43
+ return apply_filters( 'dlm_search_download_url', $download->get_the_download_link(), $download );
44
+ } catch ( Exception $e ) {
45
+ }
46
+ }
47
+
48
+ return $post_link;
49
+ }
50
+
51
  }
src/Shop/Admin/ProductTableColumns.php CHANGED
@@ -14,6 +14,8 @@ class ProductTableColumns {
14
  add_filter( 'manage_edit-' . PostType::KEY . '_columns', array( $this, 'add_columns' ) );
15
  add_action( 'manage_' . PostType::KEY . '_posts_custom_column', array( $this, 'column_data' ), 10, 2 );
16
  add_filter( 'manage_edit-' . PostType::KEY . '_sortable_columns', array( $this, 'sortable_columns' ) );
 
 
17
  }
18
 
19
  /**
@@ -30,7 +32,7 @@ class ProductTableColumns {
30
 
31
  $columns["cb"] = "<input type=\"checkbox\" />";
32
  $columns["thumb"] = '<span>' . __( "Image", 'download-monitor' ) . '</span>';
33
- $columns["title"] = __( "Title", 'download-monitor' );
34
  $columns["shortcode"] = __( "Shortcode", 'download-monitor' );
35
  $columns["price"] = __( "Price", 'download-monitor' );
36
  $columns["date"] = __( "Date", 'download-monitor' );
@@ -48,8 +50,8 @@ class ProductTableColumns {
48
  *
49
  * @return void
50
  */
51
- public function column_data( $column, $post_id ) {
52
-
53
  /** @var \Never5\DownloadMonitor\Shop\Product\Product $product */
54
  try {
55
  $product = Services::get()->service( 'product_repository' )->retrieve_single( $post_id );
@@ -58,6 +60,31 @@ class ProductTableColumns {
58
  }
59
 
60
  switch ( $column ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  case "thumb" :
62
  echo wp_kses_post( $product->get_image() );
63
  break;
@@ -86,4 +113,75 @@ class ProductTableColumns {
86
 
87
  return wp_parse_args( $custom, $columns );
88
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
14
  add_filter( 'manage_edit-' . PostType::KEY . '_columns', array( $this, 'add_columns' ) );
15
  add_action( 'manage_' . PostType::KEY . '_posts_custom_column', array( $this, 'column_data' ), 10, 2 );
16
  add_filter( 'manage_edit-' . PostType::KEY . '_sortable_columns', array( $this, 'sortable_columns' ) );
17
+ add_filter( 'the_title', array( $this, 'prepend_id_to_title' ), 15, 2 );
18
+ add_filter( 'list_table_primary_column', array( $this, 'set_primary_column_name' ), 10, 2 );
19
  }
20
 
21
  /**
32
 
33
  $columns["cb"] = "<input type=\"checkbox\" />";
34
  $columns["thumb"] = '<span>' . __( "Image", 'download-monitor' ) . '</span>';
35
+ $columns["product_title"] = __( "Title", 'download-monitor' );
36
  $columns["shortcode"] = __( "Shortcode", 'download-monitor' );
37
  $columns["price"] = __( "Price", 'download-monitor' );
38
  $columns["date"] = __( "Date", 'download-monitor' );
50
  *
51
  * @return void
52
  */
53
+ public function column_data( $column, $post_id ) {
54
+
55
  /** @var \Never5\DownloadMonitor\Shop\Product\Product $product */
56
  try {
57
  $product = Services::get()->service( 'product_repository' )->retrieve_single( $post_id );
60
  }
61
 
62
  switch ( $column ) {
63
+ case "product_title" :
64
+ if ( ! class_exists( 'WP_List_Table' ) ) {
65
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
66
+ }
67
+ global $wp_list_table, $post;
68
+
69
+ if ( ! $wp_list_table ) {
70
+ $wp_list_table = _get_list_table( 'WP_Posts_List_Table' );
71
+ }
72
+
73
+ $wp_list_table->column_title( $post );
74
+ $downloads = $product->get_download_ids();
75
+
76
+ if ( $downloads && ! empty( $downloads ) ) {
77
+ echo '<div class="product-download__links">';
78
+ foreach ( $downloads as $download_id ) {
79
+ $download = $this->get_download( $download_id );
80
+ echo '<a class="product-download__download-link" target="_blank" href="' . esc_url( get_edit_post_link( $download->get_id() ) ) . '"><code>' . esc_html( $download->get_title() ) . '</code></a>';
81
+ }
82
+ echo '</div>';
83
+
84
+ } else {
85
+ echo '<div class="dlm-listing-no-file"><code>' . esc_html__( 'No Downloads provided', 'download-monitor' ) . '</code></div>';
86
+ }
87
+ break;
88
  case "thumb" :
89
  echo wp_kses_post( $product->get_image() );
90
  break;
113
 
114
  return wp_parse_args( $custom, $columns );
115
  }
116
+
117
+ /**
118
+ * Prepends the id to the title.
119
+ *
120
+ * @access public
121
+ *
122
+ * @param string $title
123
+ *
124
+ * @param int $id
125
+ *
126
+ * @return string
127
+ */
128
+ public function prepend_id_to_title( $title, $id = null ) {
129
+
130
+ if ( ! isset( $id ) ) {
131
+ $id = get_the_ID();
132
+ }
133
+
134
+ if ( 'dlm_product' === get_post_type( $id ) ) {
135
+ return '#' . $id . ' - ' . $title;
136
+ }
137
+
138
+ return $title;
139
+ }
140
+
141
+ /**
142
+ * Get the download based on post ID, used for setting columns info
143
+ *
144
+ * @param mixed $post_id
145
+ *
146
+ * @return void
147
+ * @since 4.6.0
148
+ */
149
+ private function get_download( $post_id ) {
150
+
151
+ /** @var DLM_Download $download */
152
+ $downloads = download_monitor()->service( 'download_repository' )->retrieve(
153
+ array(
154
+ 'p' => absint( $post_id ),
155
+ 'post_status' => array( 'any', 'trash' ),
156
+ ),
157
+ 1
158
+ );
159
+
160
+ if ( 0 === count( $downloads ) ) {
161
+ return;
162
+ }
163
+
164
+ return $downloads[0];
165
+ }
166
+
167
+
168
+ /**
169
+ * Defaults the primary column name to 'download_title'
170
+ *
171
+ * @access public
172
+ *
173
+ * @param string $column_name
174
+ *
175
+ * @return string
176
+ * @since 4.6.0
177
+ */
178
+ public function set_primary_column_name( $column_name, $context ){
179
+
180
+ if ( 'edit-dlm_product' === $context ) {
181
+
182
+ return 'product_title';
183
+ }
184
+
185
+ return $column_name;
186
+ }
187
  }
src/TaxonomyManager.php CHANGED
@@ -1,98 +1,98 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- } // Exit if accessed directly
6
-
7
- class DLM_Taxonomy_Manager {
8
-
9
- /**
10
- * Setup hooks
11
- */
12
- public function setup() {
13
- add_action( 'init', array( $this, 'register' ), 9 );
14
- }
15
-
16
- /**
17
- * Register Taxonomies
18
- */
19
- public function register() {
20
-
21
- // Register Download Category
22
- register_taxonomy(
23
- 'dlm_download_category',
24
- array( 'dlm_download' ),
25
- apply_filters(
26
- 'dlm_download_category_args',
27
- array(
28
- 'hierarchical' => true,
29
- 'update_count_callback' => '_update_post_term_count',
30
- 'label' => __( 'Categories', 'download-monitor' ),
31
- 'labels' => array(
32
- 'name' => __( 'Download Categories', 'download-monitor' ),
33
- 'menu_name' => __( 'Categories', 'download-monitor' ),
34
- 'singular_name' => __( 'Download Category', 'download-monitor' ),
35
- 'search_items' => __( 'Search Download Categories', 'download-monitor' ),
36
- 'all_items' => __( 'All Download Categories', 'download-monitor' ),
37
- 'parent_item' => __( 'Parent Download Category', 'download-monitor' ),
38
- 'parent_item_colon' => __( 'Parent Download Category', 'download-monitor' ),
39
- 'edit_item' => __( 'Edit Download Category', 'download-monitor' ),
40
- 'update_item' => __( 'Update Download Category', 'download-monitor' ),
41
- 'add_new_item' => __( 'Add New Download Category', 'download-monitor' ),
42
- 'new_item_name' => __( 'New Download Category Name', 'download-monitor' ),
43
- ),
44
- 'show_ui' => true,
45
- 'query_var' => true,
46
- 'public' => true,
47
- 'capabilities' => array(
48
- 'manage_terms' => 'manage_downloads',
49
- 'edit_terms' => 'manage_downloads',
50
- 'delete_terms' => 'manage_downloads',
51
- 'assign_terms' => 'manage_downloads',
52
- ),
53
- 'rewrite' => false,
54
- 'show_in_nav_menus' => false,
55
- 'show_in_rest' => true,
56
- )
57
- )
58
- );
59
-
60
- // Register Download Tag
61
- register_taxonomy(
62
- 'dlm_download_tag',
63
- array( 'dlm_download' ),
64
- apply_filters(
65
- 'dlm_download_tag_args',
66
- array(
67
- 'hierarchical' => false,
68
- 'label' => __( 'Tags', 'download-monitor' ),
69
- 'labels' => array(
70
- 'name' => __( 'Download Tags', 'download-monitor' ),
71
- 'menu_name' => __( 'Tags', 'download-monitor' ),
72
- 'singular_name' => __( 'Download Tag', 'download-monitor' ),
73
- 'search_items' => __( 'Search Download Tags', 'download-monitor' ),
74
- 'all_items' => __( 'All Download Tags', 'download-monitor' ),
75
- 'parent_item' => __( 'Parent Download Tag', 'download-monitor' ),
76
- 'parent_item_colon' => __( 'Parent Download Tag', 'download-monitor' ),
77
- 'edit_item' => __( 'Edit Download Tag', 'download-monitor' ),
78
- 'update_item' => __( 'Update Download Tag', 'download-monitor' ),
79
- 'add_new_item' => __( 'Add New Download Tag', 'download-monitor' ),
80
- 'new_item_name' => __( 'New Download Tag Name', 'download-monitor' ),
81
- ),
82
- 'show_ui' => true,
83
- 'query_var' => true,
84
- 'capabilities' => array(
85
- 'manage_terms' => 'manage_downloads',
86
- 'edit_terms' => 'manage_downloads',
87
- 'delete_terms' => 'manage_downloads',
88
- 'assign_terms' => 'manage_downloads',
89
- ),
90
- 'rewrite' => false,
91
- 'show_in_nav_menus' => false,
92
- 'show_in_rest' => true,
93
- )
94
- )
95
- );
96
- }
97
-
98
- }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ class DLM_Taxonomy_Manager {
8
+
9
+ /**
10
+ * Setup hooks
11
+ */
12
+ public function setup() {
13
+ add_action( 'init', array( $this, 'register' ), 9 );
14
+ }
15
+
16
+ /**
17
+ * Register Taxonomies
18
+ */
19
+ public function register() {
20
+
21
+ // Register Download Category
22
+ register_taxonomy(
23
+ 'dlm_download_category',
24
+ array( 'dlm_download' ),
25
+ apply_filters(
26
+ 'dlm_download_category_args',
27
+ array(
28
+ 'hierarchical' => true,
29
+ 'update_count_callback' => '_update_post_term_count',
30
+ 'label' => __( 'Categories', 'download-monitor' ),
31
+ 'labels' => array(
32
+ 'name' => __( 'Download Categories', 'download-monitor' ),
33
+ 'menu_name' => __( 'Categories', 'download-monitor' ),
34
+ 'singular_name' => __( 'Download Category', 'download-monitor' ),
35
+ 'search_items' => __( 'Search Download Categories', 'download-monitor' ),
36
+ 'all_items' => __( 'All Download Categories', 'download-monitor' ),
37
+ 'parent_item' => __( 'Parent Download Category', 'download-monitor' ),
38
+ 'parent_item_colon' => __( 'Parent Download Category', 'download-monitor' ),
39
+ 'edit_item' => __( 'Edit Download Category', 'download-monitor' ),
40
+ 'update_item' => __( 'Update Download Category', 'download-monitor' ),
41
+ 'add_new_item' => __( 'Add New Download Category', 'download-monitor' ),
42
+ 'new_item_name' => __( 'New Download Category Name', 'download-monitor' ),
43
+ ),
44
+ 'show_ui' => true,
45
+ 'query_var' => true,
46
+ 'public' => true,
47
+ 'capabilities' => array(
48
+ 'manage_terms' => 'manage_downloads',
49
+ 'edit_terms' => 'manage_downloads',
50
+ 'delete_terms' => 'manage_downloads',
51
+ 'assign_terms' => 'manage_downloads',
52
+ ),
53
+ 'rewrite' => false,
54
+ 'show_in_nav_menus' => false,
55
+ 'show_in_rest' => true,
56
+ )
57
+ )
58
+ );
59
+
60
+ // Register Download Tag
61
+ register_taxonomy(
62
+ 'dlm_download_tag',
63
+ array( 'dlm_download' ),
64
+ apply_filters(
65
+ 'dlm_download_tag_args',
66
+ array(
67
+ 'hierarchical' => false,
68
+ 'label' => __( 'Tags', 'download-monitor' ),
69
+ 'labels' => array(
70
+ 'name' => __( 'Download Tags', 'download-monitor' ),
71
+ 'menu_name' => __( 'Tags', 'download-monitor' ),
72
+ 'singular_name' => __( 'Download Tag', 'download-monitor' ),
73
+ 'search_items' => __( 'Search Download Tags', 'download-monitor' ),
74
+ 'all_items' => __( 'All Download Tags', 'download-monitor' ),
75
+ 'parent_item' => __( 'Parent Download Tag', 'download-monitor' ),
76
+ 'parent_item_colon' => __( 'Parent Download Tag', 'download-monitor' ),
77
+ 'edit_item' => __( 'Edit Download Tag', 'download-monitor' ),
78
+ 'update_item' => __( 'Update Download Tag', 'download-monitor' ),
79
+ 'add_new_item' => __( 'Add New Download Tag', 'download-monitor' ),
80
+ 'new_item_name' => __( 'New Download Tag Name', 'download-monitor' ),
81
+ ),
82
+ 'show_ui' => true,
83
+ 'query_var' => true,
84
+ 'capabilities' => array(
85
+ 'manage_terms' => 'manage_downloads',
86
+ 'edit_terms' => 'manage_downloads',
87
+ 'delete_terms' => 'manage_downloads',
88
+ 'assign_terms' => 'manage_downloads',
89
+ ),
90
+ 'rewrite' => false,
91
+ 'show_in_nav_menus' => false,
92
+ 'show_in_rest' => true,
93
+ )
94
+ )
95
+ );
96
+ }
97
+
98
+ }
src/TransientManager.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
-
3
- class DLM_Transient_Manager {
4
-
5
- /**
6
- * Clear download version transient
7
- *
8
- * @param int $download_id
9
- *
10
- * @return bool
11
- */
12
- public function clear_versions_transient( $download_id ) {
13
-
14
- delete_transient( 'dlm_file_version_ids_' . $download_id );
15
-
16
- return true;
17
- }
18
-
19
- /**
20
- * Clear all download version transients
21
- *
22
- * @return bool
23
- */
24
- public function clear_all_version_transients() {
25
- global $wpdb;
26
-
27
- $wpdb->query( "DELETE FROM {$wpdb->options} WHERE `option_name` LIKE '_transient_timeout_dlm_file_version_%';" );
28
- $wpdb->query( "DELETE FROM {$wpdb->options} WHERE `option_name` LIKE '_transient_dlm_file_version_%';" );
29
-
30
- return true;
31
- }
32
-
33
  }
1
+ <?php
2
+
3
+ class DLM_Transient_Manager {
4
+
5
+ /**
6
+ * Clear download version transient
7
+ *
8
+ * @param int $download_id
9
+ *
10
+ * @return bool
11
+ */
12
+ public function clear_versions_transient( $download_id ) {
13
+
14
+ delete_transient( 'dlm_file_version_ids_' . $download_id );
15
+
16
+ return true;
17
+ }
18
+
19
+ /**
20
+ * Clear all download version transients
21
+ *
22
+ * @return bool
23
+ */
24
+ public function clear_all_version_transients() {
25
+ global $wpdb;
26
+
27
+ $wpdb->query( "DELETE FROM {$wpdb->options} WHERE `option_name` LIKE '_transient_timeout_dlm_file_version_%';" );
28
+ $wpdb->query( "DELETE FROM {$wpdb->options} WHERE `option_name` LIKE '_transient_dlm_file_version_%';" );
29
+
30
+ return true;
31
+ }
32
+
33
  }
src/Util/Onboarding.php CHANGED
@@ -98,19 +98,6 @@ class Onboarding {
98
  // the actual page
99
  ?>
100
  <div class="wrap dlm-onboarding">
101
-
102
- <div class="dlm-onboarding-section dlm-onboarding-section-one-col">
103
- <h2><?php echo esc_html__( "Welcome to ", 'download-monitor' ); ?> Download Monitor</h2>
104
- <p>
105
- <?php echo esc_html__( "Thank you for installing Download Monitor! We'd like to help you setup the plugin correctly so you can start sharing your files as quickly as possible.", 'download-monitor' ); ?>
106
- <?php echo esc_html__( "With Download Monitor you can manage, track and offer downloads to your users using your WordPress website.", 'download-monitor' ); ?>
107
- <?php echo esc_html__( "On top of that, Download Monitor allows you to sell your downloads, turning your WordPress website into fully featured e-commerce website out of the box.", 'download-monitor' ); ?>
108
- </p>
109
- <p>
110
- <?php echo esc_html__( "You decide if you want to offer you downloads for free or want to start selling them (or both!). Whatever you decide, you chose the right plugin for the job!", 'download-monitor' ); ?>
111
- </p>
112
- </div>
113
-
114
  <div class="dlm-onboarding-section dlm-onboarding-section-one-col">
115
  <h2><?php echo esc_html__( "Let's Create Your Pages", 'download-monitor' ); ?></h2>
116
  <p>
@@ -201,45 +188,23 @@ class Onboarding {
201
  </table>
202
  </div>
203
 
204
- <div class="dlm-onboarding-section dlm-onboarding-section-one-col">
205
- <h2><?php echo esc_html__( 'Extensions', 'download-monitor' ); ?></h2>
206
- <p>
207
- <?php echo esc_html__( 'Power up your Download Monitor website with our official extensions. Our extensions allow you to add specific functionality to your Download Monitor powered website and come with our premium support and updates.', 'download-monitor' ); ?>
208
- <?php echo esc_html__( "Here's a quick sample of what we offer.", 'download-monitor' ); ?>
209
- </p>
210
- </div>
211
-
212
- <div class="dlm-onboarding-section dlm-onboarding-section-three-col">
213
- <?php
214
- $extension_loader = new ExtensionLoader();
215
- $response = json_decode( $extension_loader->fetch() );
216
- if ( ! empty( $response->extensions ) ) :
217
- $i = 0;
218
- foreach ( $response->extensions as $extension ) :
219
- ?>
220
- <div class="dlm-onboarding-col">
221
- <img src="<?php echo esc_attr( $extension->image ); ?>"
222
- alt="<?php echo esc_attr( $extension->name ); ?>"/>
223
- <h3><?php echo esc_html( $extension->name ); ?></h3>
224
- <p><?php echo esc_html( $extension->desc ); ?></p>
225
- </div>
226
- <?php
227
- $i ++;
228
- if ( $i > 2 ) {
229
- break;
230
- }
231
- endforeach;
232
- endif;
233
  ?>
234
- </div>
235
-
236
- <div class="dlm-onboarding-section dlm-onboarding-section-one-col dlm-onboarding-section-cta">
237
- <p>
238
- <a href="https://www.download-monitor.com/extensions/?utm_source=plugin&utm_medium=link&utm_campaign=onboarding"
239
- class="button button-primary button-hero"
240
- target="_blank"><?php echo esc_html__( 'View More Extensions', 'download-monitor' ); ?></a>
241
- </p>
242
- </div>
 
 
 
 
243
 
244
  <div class="dlm-onboarding-section dlm-onboarding-section-one-col">
245
  <h2><?php echo esc_html__( "What's Next?", 'download-monitor' ); ?></h2>
98
  // the actual page
99
  ?>
100
  <div class="wrap dlm-onboarding">
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  <div class="dlm-onboarding-section dlm-onboarding-section-one-col">
102
  <h2><?php echo esc_html__( "Let's Create Your Pages", 'download-monitor' ); ?></h2>
103
  <p>
188
  </table>
189
  </div>
190
 
191
+ <?php
192
+ if ( class_exists( 'WPChill_Welcome' ) ) {
193
+ $welcome = \WPChill_Welcome::get_instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  ?>
195
+ <div id="wpchill-welcome">
196
+ <div class="dlm-onboarding-section dlm-onboarding-section-one-col">
197
+ <img src="<?php echo esc_url( DLM_URL ); ?>assets/images/banner-dlm.png" alt="<?php esc_attr_e( 'Watch how to', 'strong-testimonials' ); ?>" class="video-thumbnail">
198
+ <?php $welcome->display_empty_space(); ?>
199
+ <div class="button-wrap-single">
200
+ <?php $welcome->display_button( esc_html__( 'Read our step-by-step guide to get started', 'download-monitor' ), 'https://www.download-monitor.com/kb/add-your-first-download/', true, '#2271b1' ); ?>
201
+ </div>
202
+ </div>
203
+ </div>
204
+ <?php
205
+ }
206
+
207
+ ?>
208
 
209
  <div class="dlm-onboarding-section dlm-onboarding-section-one-col">
210
  <h2><?php echo esc_html__( "What's Next?", 'download-monitor' ); ?></h2>
src/Utils.php CHANGED
@@ -9,8 +9,21 @@ abstract class DLM_Utils {
9
  */
10
  public static function get_visitor_ip() {
11
 
12
- $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field(wp_unslash($_SERVER['REMOTE_ADDR'])) : '';
 
13
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  if ( ( '1' == get_option( 'dlm_allow_x_forwarded_for', 0 ) ) && ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
15
  // phpcs:ignore
16
  $parts = explode( ",", $_SERVER['HTTP_X_FORWARDED_FOR'] );
9
  */
10
  public static function get_visitor_ip() {
11
 
12
+ // Fix for CloudFlare IPs
13
+ $ip = '';
14
 
15
+ if ( isset( $_SERVER['REMOTE_ADDR'] ) ){
16
+ $ip = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) );
17
+ }
18
+
19
+ if ( isset( $_SERVER["HTTP_X_REAL_IP"] ) ) {
20
+ $ip = sanitize_text_field( wp_unslash( $ $_SERVER["HTTP_X_REAL_IP"] ) );
21
+ }
22
+
23
+ if ( isset( $_SERVER["HTTP_CF_CONNECTING_IP"] ) ) {
24
+ $ip = sanitize_text_field( wp_unslash( $ $_SERVER["HTTP_CF_CONNECTING_IP"] ) );
25
+ }
26
+
27
  if ( ( '1' == get_option( 'dlm_allow_x_forwarded_for', 0 ) ) && ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
28
  // phpcs:ignore
29
  $parts = explode( ",", $_SERVER['HTTP_X_FORWARDED_FOR'] );
src/Version/VersionRepository.php CHANGED
@@ -1,40 +1,40 @@
1
- <?php
2
-
3
- interface DLM_Version_Repository {
4
-
5
- /**
6
- * Retrieve versions
7
- *
8
- * @param array $filters
9
- * @param int $limit
10
- * @param int $offset
11
- *
12
- * @return array<DLM_Download_Version>
13
- */
14
- public function retrieve( $filters=array(), $limit=0, $offset=0 );
15
-
16
- /**
17
- * Retrieve single version
18
- *
19
- * @param int $id
20
- *
21
- * @return DLM_Download_Version
22
- */
23
- public function retrieve_single( $id );
24
-
25
- /**
26
- * Returns number of rows for given filters
27
- *
28
- * @param array $filters
29
- *
30
- * @return int
31
- */
32
- public function num_rows( $filters=array() );
33
-
34
- /**
35
- * @param DLM_Download_Version $version
36
- *
37
- * @return bool
38
- */
39
- public function persist( $version );
40
  }
1
+ <?php
2
+
3
+ interface DLM_Version_Repository {
4
+
5
+ /**
6
+ * Retrieve versions
7
+ *
8
+ * @param array $filters
9
+ * @param int $limit
10
+ * @param int $offset
11
+ *
12
+ * @return array<DLM_Download_Version>
13
+ */
14
+ public function retrieve( $filters=array(), $limit=0, $offset=0 );
15
+
16
+ /**
17
+ * Retrieve single version
18
+ *
19
+ * @param int $id
20
+ *
21
+ * @return DLM_Download_Version
22
+ */
23
+ public function retrieve_single( $id );
24
+
25
+ /**
26
+ * Returns number of rows for given filters
27
+ *
28
+ * @param array $filters
29
+ *
30
+ * @return int
31
+ */
32
+ public function num_rows( $filters=array() );
33
+
34
+ /**
35
+ * @param DLM_Download_Version $version
36
+ *
37
+ * @return bool
38
+ */
39
+ public function persist( $version );
40
  }
src/Widgets/Manager.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- } // Exit if accessed directly
6
-
7
- class DLM_Widget_Manager {
8
-
9
- /**
10
- * Setup the actions
11
- */
12
- public function setup() {
13
- add_action( 'widgets_init', array( $this, 'register_widgets' ) );
14
- }
15
-
16
- /**
17
- * Register the widgets
18
- */
19
- public function register_widgets() {
20
- register_widget( 'DLM_Widget_Downloads' );
21
- }
22
-
23
  }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ class DLM_Widget_Manager {
8
+
9
+ /**
10
+ * Setup the actions
11
+ */
12
+ public function setup() {
13
+ add_action( 'widgets_init', array( $this, 'register_widgets' ) );
14
+ }
15
+
16
+ /**
17
+ * Register the widgets
18
+ */
19
+ public function register_widgets() {
20
+ register_widget( 'DLM_Widget_Downloads' );
21
+ }
22
+
23
  }
templates/content-download-box.php CHANGED
@@ -1,35 +1,35 @@
1
- <?php
2
- /**
3
- * Detailed download output
4
- */
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
- } // Exit if accessed directly
9
-
10
- ?>
11
-
12
- <aside class="download-box">
13
-
14
- <?php $dlm_download->the_image(); ?>
15
-
16
- <div
17
- class="download-count"><?php printf( esc_attr(_n( '1 download', '%d downloads', $dlm_download->get_download_count(), 'download-monitor' )), esc_html( $dlm_download->get_download_count() ) ) ?></div>
18
-
19
- <div class="download-box-content">
20
-
21
- <h1><?php $dlm_download->the_title(); ?></h1>
22
-
23
- <?php $dlm_download->the_excerpt(); ?>
24
-
25
- <a class="download-button" title="<?php if ( $dlm_download->get_version()->has_version_number() ) {
26
- printf( esc_html__( 'Version %s', 'download-monitor' ), esc_html( $dlm_download->get_version()->get_version_number() ) );
27
- } ?>" href="<?php $dlm_download->the_download_link(); ?>" rel="nofollow">
28
- <?php echo esc_html__( 'Download File', 'download-monitor' ); ?>
29
- <small><?php echo esc_html( $dlm_download->get_version()->get_filename() ); ?> &ndash; <?php echo esc_html( $dlm_download->get_version()->get_filesize_formatted() ); ?></small>
30
- </a>
31
-
32
- </div>
33
- </aside>
34
-
35
-
1
+ <?php
2
+ /**
3
+ * Detailed download output
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ } // Exit if accessed directly
9
+
10
+ ?>
11
+
12
+ <aside class="download-box">
13
+
14
+ <?php $dlm_download->the_image(); ?>
15
+
16
+ <div
17
+ class="download-count"><?php printf( esc_attr(_n( '1 download', '%d downloads', $dlm_download->get_download_count(), 'download-monitor' )), esc_html( $dlm_download->get_download_count() ) ) ?></div>
18
+
19
+ <div class="download-box-content">
20
+
21
+ <h1><?php $dlm_download->the_title(); ?></h1>
22
+
23
+ <?php $dlm_download->the_excerpt(); ?>
24
+
25
+ <a class="download-button" title="<?php if ( $dlm_download->get_version()->has_version_number() ) {
26
+ printf( esc_html__( 'Version %s', 'download-monitor' ), esc_html( $dlm_download->get_version()->get_version_number() ) );
27
+ } ?>" href="<?php $dlm_download->the_download_link(); ?>" rel="nofollow">
28
+ <?php echo esc_html__( 'Download File', 'download-monitor' ); ?>
29
+ <small><?php echo esc_html( $dlm_download->get_version()->get_filename() ); ?> &ndash; <?php echo esc_html( $dlm_download->get_version()->get_filesize_formatted() ); ?></small>
30
+ </a>
31
+
32
+ </div>
33
+ </aside>
34
+
35
+
templates/content-download-filename.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
- /**
3
- * Default output for a download via the [download] shortcode
4
- */
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
- } // Exit if accessed directly
9
-
10
- ?>
11
- <a class="download-link filetype-icon <?php echo 'filetype-' . esc_html( $dlm_download->get_version()->get_filetype() ); ?>"
12
- title="<?php if ( $dlm_download->get_version()->has_version_number() ) {
13
- printf( esc_html__( 'Version %s', 'download-monitor' ), esc_html( $dlm_download->get_version()->get_version_number() ) );
14
- } ?>" href="<?php $dlm_download->the_download_link(); ?>" rel="nofollow">
15
- <?php echo esc_html( $dlm_download->get_version()->get_filename() ); ?>
16
- (<?php printf( esc_html( _n( '1 download', '%d downloads', $dlm_download->get_download_count(), 'download-monitor' ) ), esc_html( $dlm_download->get_download_count() ) ) ?>)
17
  </a>
1
+ <?php
2
+ /**
3
+ * Default output for a download via the [download] shortcode
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ } // Exit if accessed directly
9
+
10
+ ?>
11
+ <a class="download-link filetype-icon <?php echo 'filetype-' . esc_html( $dlm_download->get_version()->get_filetype() ); ?>"
12
+ title="<?php if ( $dlm_download->get_version()->has_version_number() ) {
13
+ printf( esc_html__( 'Version %s', 'download-monitor' ), esc_html( $dlm_download->get_version()->get_version_number() ) );
14
+ } ?>" href="<?php $dlm_download->the_download_link(); ?>" rel="nofollow">
15
+ <?php echo esc_html( $dlm_download->get_version()->get_filename() ); ?>
16
+ (<?php printf( esc_html( _n( '1 download', '%d downloads', $dlm_download->get_download_count(), 'download-monitor' ) ), esc_html( $dlm_download->get_download_count() ) ) ?>)
17
  </a>
templates/content-download-no-version.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
- /**
3
- * Default output for a download via the [download] shortcode
4
- */
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
- } // Exit if accessed directly
9
-
10
- ?>
11
- <a class="download-link" title="<?php echo esc_attr__( 'Please set a version in your WordPress admin', 'download-monitor' ); ?>" href="#" rel="nofollow">
12
- "<?php $dlm_download->the_title(); ?>" <strong><?php echo esc_html__( 'has no version set!', 'download-monitor' ); ?></strong>
13
  </a>
1
+ <?php
2
+ /**
3
+ * Default output for a download via the [download] shortcode
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ } // Exit if accessed directly
9
+
10
+ ?>
11
+ <a class="download-link" title="<?php echo esc_attr__( 'Please set a version in your WordPress admin', 'download-monitor' ); ?>" href="#" rel="nofollow">
12
+ "<?php $dlm_download->the_title(); ?>" <strong><?php echo esc_html__( 'has no version set!', 'download-monitor' ); ?></strong>
13
  </a>
templates/content-download-title.php CHANGED
@@ -1,15 +1,15 @@
1
- <?php
2
- /**
3
- * Shows title only.
4
- */
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
- } // Exit if accessed directly
9
-
10
- ?>
11
- <a class="download-link" title="<?php if ( $dlm_download->get_version()->has_version_number() ) {
12
- printf( esc_html__( 'Version %s', 'download-monitor' ), esc_html( $dlm_download->get_version()->get_version_number() ) );
13
- } ?>" href="<?php esc_url( $dlm_download->the_download_link() ); ?>" rel="nofollow">
14
- <?php $dlm_download->the_title(); ?>
15
  </a>
1
+ <?php
2
+ /**
3
+ * Shows title only.
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ } // Exit if accessed directly
9
+
10
+ ?>
11
+ <a class="download-link" title="<?php if ( $dlm_download->get_version()->has_version_number() ) {
12
+ printf( esc_html__( 'Version %s', 'download-monitor' ), esc_html( $dlm_download->get_version()->get_version_number() ) );
13
+ } ?>" href="<?php esc_url( $dlm_download->the_download_link() ); ?>" rel="nofollow">
14
+ <?php $dlm_download->the_title(); ?>
15
  </a>
templates/content-download-version-list.php CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- /**
3
- * List of versions
4
- */
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
- } // Exit if accessed directly
9
-
10
- $versions = $dlm_download->get_versions();
11
-
12
- if ( $versions ) : ?>
13
- <ul class="download-versions">
14
- <?php
15
- /** @var DLM_Download_Version $version */
16
- foreach ( $versions as $version ) {
17
-
18
- // set loop version as current version
19
- $dlm_download->set_version( $version );
20
- ?>
21
- <li><a class="download-link"
22
- title="<?php printf( esc_attr(_n( 'Downloaded 1 time', 'Downloaded %d times', $dlm_download->get_download_count(), 'download-monitor' )), esc_html( $dlm_download->get_download_count() ) ) ?>"
23
- href="<?php $dlm_download->the_download_link(); ?>" rel="nofollow">
24
- <?php echo esc_html( $version->get_filename() ); ?> <?php if ( $version->has_version_number() ) {
25
- echo '- ' . esc_html( $version->get_version_number() );
26
- } ?>
27
- </a></li>
28
- <?php
29
- }
30
- ?>
31
- </ul>
32
  <?php endif; ?>
1
+ <?php
2
+ /**
3
+ * List of versions
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ } // Exit if accessed directly
9
+
10
+ $versions = $dlm_download->get_versions();
11
+
12
+ if ( $versions ) : ?>
13
+ <ul class="download-versions">
14
+ <?php
15
+ /** @var DLM_Download_Version $version */
16
+ foreach ( $versions as $version ) {
17
+
18
+ // set loop version as current version
19
+ $dlm_download->set_version( $version );
20
+ ?>
21
+ <li><a class="download-link"
22
+ title="<?php printf( esc_attr(_n( 'Downloaded 1 time', 'Downloaded %d times', $dlm_download->get_download_count(), 'download-monitor' )), esc_html( $dlm_download->get_download_count() ) ) ?>"
23
+ href="<?php $dlm_download->the_download_link(); ?>" rel="nofollow">
24
+ <?php echo esc_html( $version->get_filename() ); ?> <?php if ( $version->has_version_number() ) {
25
+ echo '- ' . esc_html( $version->get_version_number() );
26
+ } ?>
27
+ </a></li>
28
+ <?php
29
+ }
30
+ ?>
31
+ </ul>
32
  <?php endif; ?>
templates/no-access.php CHANGED
@@ -1,20 +1,20 @@
1
- <?php
2
- /**
3
- * Download No Access
4
- */
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
- } // Exit if accessed directly
9
-
10
- /** @var DLM_Download $download */
11
-
12
- ?>
13
-
14
- <?php do_action( 'dlm_no_access_before_message', $download ); ?>
15
- <?php if ( ! empty( $no_access_message ) ) : ?>
16
-
17
- <p><?php echo wp_kses_post( $no_access_message ); ?></p>
18
- <?php endif; ?>
19
-
20
- <?php do_action( 'dlm_no_access_after_message', $download ); ?>
1
+ <?php
2
+ /**
3
+ * Download No Access
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ } // Exit if accessed directly
9
+
10
+ /** @var DLM_Download $download */
11
+
12
+ ?>
13
+
14
+ <?php do_action( 'dlm_no_access_before_message', $download ); ?>
15
+ <?php if ( ! empty( $no_access_message ) ) : ?>
16
+
17
+ <p><?php echo wp_kses_post( $no_access_message ); ?></p>
18
+ <?php endif; ?>
19
+
20
+ <?php do_action( 'dlm_no_access_after_message', $download ); ?>
templates/pagination.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
- /**
3
- * Pagination - Show numbered pagination.
4
- */
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
- } // Exit if accessed directly
9
-
10
- if ( $pages <= 1 ) {
11
- return;
12
- }
13
- ?>
14
- <nav class="download-monitor-pagination">
15
- <?php
16
- echo wp_kses_post( paginate_links(
17
- apply_filters(
18
- 'download_monitor_pagination_args',
19
- array(
20
- 'base' => str_replace( 999999999, '%#%', get_pagenum_link( 999999999 ) ),
21
- 'format' => '',
22
- 'current' => max( 1, get_query_var( 'paged' ) ),
23
- 'total' => $pages,
24
- 'prev_text' => '&larr;',
25
- 'next_text' => '&rarr;',
26
- 'type' => 'list',
27
- 'end_size' => 3,
28
- 'mid_size' => 3,
29
- )
30
- )
31
- ) );
32
- ?>
33
- </nav>
1
+ <?php
2
+ /**
3
+ * Pagination - Show numbered pagination.
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ } // Exit if accessed directly
9
+
10
+ if ( $pages <= 1 ) {
11
+ return;
12
+ }
13
+ ?>
14
+ <nav class="download-monitor-pagination">
15
+ <?php
16
+ echo wp_kses_post( paginate_links(
17
+ apply_filters(
18
+ 'download_monitor_pagination_args',
19
+ array(
20
+ 'base' => str_replace( 999999999, '%#%', get_pagenum_link( 999999999 ) ),
21
+ 'format' => '',
22
+ 'current' => max( 1, get_query_var( 'paged' ) ),
23
+ 'total' => $pages,
24
+ 'prev_text' => '&larr;',
25
+ 'next_text' => '&rarr;',
26
+ 'type' => 'list',
27
+ 'end_size' => 3,
28
+ 'mid_size' => 3,
29
+ )
30
+ )
31
+ ) );
32
+ ?>
33
+ </nav>
templates/shop/cart/empty.php CHANGED
@@ -1,6 +1,6 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
- ?>
6
- <p><?php echo esc_html__( 'Your cart is empty.', 'download-monitor' ); ?></p>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+ ?>
6
+ <p><?php echo esc_html__( 'Your cart is empty.', 'download-monitor' ); ?></p>
templates/shop/checkout/empty.php CHANGED
@@ -1,6 +1,6 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
- ?>
6
- <p><?php echo esc_html__( 'Your cart is empty.', 'download-monitor' ); ?></p>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+ ?>
6
+ <p><?php echo esc_html__( 'Your cart is empty.', 'download-monitor' ); ?></p>
templates/shop/checkout/error.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
-
6
- /** @var string $error */
7
- ?>
8
-
9
- <div class="dlm-checkout-error">
10
- <img src="<?php echo esc_url( download_monitor()->get_plugin_url() ); ?>/assets/images/shop/icon-error.svg"
11
- alt="<?php echo esc_html__( 'Checkout error', 'download-monitor' ); ?>" class="dlm-checkout-error-icon">
12
- <p><?php echo esc_html( $error ); ?></p>
13
- </div>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+
6
+ /** @var string $error */
7
+ ?>
8
+
9
+ <div class="dlm-checkout-error">
10
+ <img src="<?php echo esc_url( download_monitor()->get_plugin_url() ); ?>/assets/images/shop/icon-error.svg"
11
+ alt="<?php echo esc_html__( 'Checkout error', 'download-monitor' ); ?>" class="dlm-checkout-error-icon">
12
+ <p><?php echo esc_html( $error ); ?></p>
13
+ </div>
templates/shop/checkout/no-access.php CHANGED
@@ -1,6 +1,6 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
- ?>
6
- <p><?php echo esc_html__( 'You have no access to this order.', 'download-monitor' ); ?></p>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+ ?>
6
+ <p><?php echo esc_html__( 'You have no access to this order.', 'download-monitor' ); ?></p>
templates/shop/checkout/order-review-item.php CHANGED
@@ -1,11 +1,11 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
-
6
- /** @var array $item */
7
- ?>
8
- <tr>
9
- <td><?php echo esc_html( $item['label'] ); ?></td>
10
- <td><?php echo esc_html( $item['subtotal'] ); ?></td>
11
  </tr>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+
6
+ /** @var array $item */
7
+ ?>
8
+ <tr>
9
+ <td><?php echo esc_html( $item['label'] ); ?></td>
10
+ <td><?php echo esc_html( $item['subtotal'] ); ?></td>
11
  </tr>
templates/shop/checkout/submit-button.php CHANGED
@@ -1,6 +1,6 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
- ?>
6
  <input type="submit" name="dlm_checkout_submit" id="dlm_checkout_submit" value="<?php echo esc_html__( 'Complete order', 'download-monitor' ); ?>" />
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+ ?>
6
  <input type="submit" name="dlm_checkout_submit" id="dlm_checkout_submit" value="<?php echo esc_html__( 'Complete order', 'download-monitor' ); ?>" />
templates/shop/email/elements/order-table-plain.php CHANGED
@@ -1,11 +1,11 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
- ?>
6
-
7
- <?php if ( count( $items ) > 0 ) : ?>
8
- <?php foreach ( $items as $item ) : ?>
9
- <?php echo esc_html( $item['key'] ); ?>: <?php echo esc_html( $item['value'] ) . PHP_EOL; ?>
10
- <?php endforeach; ?>
11
  <?php endif; ?>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+ ?>
6
+
7
+ <?php if ( count( $items ) > 0 ) : ?>
8
+ <?php foreach ( $items as $item ) : ?>
9
+ <?php echo esc_html( $item['key'] ); ?>: <?php echo esc_html( $item['value'] ) . PHP_EOL; ?>
10
+ <?php endforeach; ?>
11
  <?php endif; ?>
templates/shop/email/elements/order-table.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
- ?>
6
- <table cellpadding="0" cellspacing="0" border="0" class="dlm-order-table">
7
- <tbody>
8
- <?php if ( count( $items ) > 0 ) : ?>
9
- <?php foreach ( $items as $item ) : ?>
10
- <tr>
11
- <th><?php echo esc_html( $item['key'] ); ?></th>
12
- <td><?php echo esc_html( $item['value'] ); ?></td>
13
- </tr>
14
- <?php endforeach; ?>
15
- <?php endif; ?>
16
- </tbody>
17
  </table>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+ ?>
6
+ <table cellpadding="0" cellspacing="0" border="0" class="dlm-order-table">
7
+ <tbody>
8
+ <?php if ( count( $items ) > 0 ) : ?>
9
+ <?php foreach ( $items as $item ) : ?>
10
+ <tr>
11
+ <th><?php echo esc_html( $item['key'] ); ?></th>
12
+ <td><?php echo esc_html( $item['value'] ); ?></td>
13
+ </tr>
14
+ <?php endforeach; ?>
15
+ <?php endif; ?>
16
+ </tbody>
17
  </table>
templates/shop/email/new-order-admin-plain.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
- ?>
6
- Great news! Your %WEBSITE_NAME% shop just received a new order!
7
-
8
- Here's an overview of the order:
9
-
10
- %ORDER_TABLE_PLAIN%
11
-
12
- Cheers,
13
-
14
- Your Download Monitor powered website
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+ ?>
6
+ Great news! Your %WEBSITE_NAME% shop just received a new order!
7
+
8
+ Here's an overview of the order:
9
+
10
+ %ORDER_TABLE_PLAIN%
11
+
12
+ Cheers,
13
+
14
+ Your Download Monitor powered website
templates/shop/email/new-order-admin.php CHANGED
@@ -1,58 +1,58 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
- ?>
6
- <!DOCTYPE html>
7
- <html>
8
- <head lang="en">
9
- <meta charset="UTF-8">
10
- <style type="text/css">
11
- html, body {
12
- padding: 0;
13
- margin: 0;
14
- background: #F5F5F5;
15
- }
16
-
17
- body {
18
- padding: 25px;
19
- }
20
-
21
- .dlm-order-table {
22
- width: 100%;
23
- }
24
-
25
- .dlm-order-table th, .dlm-order-table td {
26
- padding: 1em 0;
27
- border-bottom: 1px solid #c3c1bc;
28
- text-align: left;
29
- }
30
- .dlm-order-table th {
31
- width: 40%;
32
- }
33
- </style>
34
- </head>
35
- <body>
36
- <table cellpadding="0" cellspacing="0" border="0" align="center" width="500"
37
- style="font-family: Arial; font-size: 14px;">
38
- <tr>
39
- <td style="font-size: 16px; font-weight: bold; background-color: #459ac9; color: #fff; height: 50px; padding: 0 15px;-webkit-border-top-left-radius: 5px;-webkit-border-top-right-radius: 5px;-moz-border-radius-topleft: 5px;-moz-border-radius-topright: 5px;border-top-left-radius: 5px;border-top-right-radius: 5px;">
40
- New %WEBSITE_NAME% order!
41
- </td>
42
- </tr>
43
- <tr>
44
- <td style="padding: 25px 15px;background: #fff;-webkit-border-bottom-right-radius: 5px;-webkit-border-bottom-left-radius: 5px;-moz-border-radius-bottomright: 5px;-moz-border-radius-bottomleft: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;">
45
- Great news! Your %WEBSITE_NAME% shop just received a new order!<br/>
46
- <br/>
47
- Here's an overview of the order:<br/>
48
- <br/>
49
- %ORDER_TABLE%
50
- <br/>
51
- Cheers,<br/>
52
- </br>
53
- <em>Your Download Monitor powered website</em>
54
- </td>
55
- </tr>
56
- </table>
57
- </body>
58
  </html>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+ ?>
6
+ <!DOCTYPE html>
7
+ <html>
8
+ <head lang="en">
9
+ <meta charset="UTF-8">
10
+ <style type="text/css">
11
+ html, body {
12
+ padding: 0;
13
+ margin: 0;
14
+ background: #F5F5F5;
15
+ }
16
+
17
+ body {
18
+ padding: 25px;
19
+ }
20
+
21
+ .dlm-order-table {
22
+ width: 100%;
23
+ }
24
+
25
+ .dlm-order-table th, .dlm-order-table td {
26
+ padding: 1em 0;
27
+ border-bottom: 1px solid #c3c1bc;
28
+ text-align: left;
29
+ }
30
+ .dlm-order-table th {
31
+ width: 40%;
32
+ }
33
+ </style>
34
+ </head>
35
+ <body>
36
+ <table cellpadding="0" cellspacing="0" border="0" align="center" width="500"
37
+ style="font-family: Arial; font-size: 14px;">
38
+ <tr>
39
+ <td style="font-size: 16px; font-weight: bold; background-color: #459ac9; color: #fff; height: 50px; padding: 0 15px;-webkit-border-top-left-radius: 5px;-webkit-border-top-right-radius: 5px;-moz-border-radius-topleft: 5px;-moz-border-radius-topright: 5px;border-top-left-radius: 5px;border-top-right-radius: 5px;">
40
+ New %WEBSITE_NAME% order!
41
+ </td>
42
+ </tr>
43
+ <tr>
44
+ <td style="padding: 25px 15px;background: #fff;-webkit-border-bottom-right-radius: 5px;-webkit-border-bottom-left-radius: 5px;-moz-border-radius-bottomright: 5px;-moz-border-radius-bottomleft: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;">
45
+ Great news! Your %WEBSITE_NAME% shop just received a new order!<br/>
46
+ <br/>
47
+ Here's an overview of the order:<br/>
48
+ <br/>
49
+ %ORDER_TABLE%
50
+ <br/>
51
+ Cheers,<br/>
52
+ </br>
53
+ <em>Your Download Monitor powered website</em>
54
+ </td>
55
+ </tr>
56
+ </table>
57
+ </body>
58
  </html>
templates/shop/email/new-order-plain.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
- ?>
6
-
7
- Hey %FIRST_NAME%,
8
-
9
- Thank you for your purchase, this email confirms your order.
10
-
11
- Here's an overview of your files:
12
-
13
- %DOWNLOADS_TABLE_PLAIN%
14
-
15
- Many thanks,
16
-
17
- Team %WEBSITE_NAME%
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+ ?>
6
+
7
+ Hey %FIRST_NAME%,
8
+
9
+ Thank you for your purchase, this email confirms your order.
10
+
11
+ Here's an overview of your files:
12
+
13
+ %DOWNLOADS_TABLE_PLAIN%
14
+
15
+ Many thanks,
16
+
17
+ Team %WEBSITE_NAME%
templates/shop/email/new-order.php CHANGED
@@ -1,83 +1,83 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
- ?>
6
- <!DOCTYPE html>
7
- <html>
8
- <head lang="en">
9
- <meta charset="UTF-8">
10
- <style type="text/css">
11
- html, body {
12
- padding: 0;
13
- margin: 0;
14
- background: #F5F5F5;
15
- }
16
-
17
- body {
18
- padding: 25px;
19
- }
20
-
21
- .dlm-downloads-table {
22
- width: 100%;
23
- }
24
-
25
- .dlm-downloads-table th, .dlm-downloads-table td {
26
- padding: 1.5em 0;
27
- text-align: left;
28
- }
29
-
30
- .dlm-downloads-table th {
31
- padding: .5em 0;
32
- border-bottom: 2px solid #c3c1bc;
33
- }
34
-
35
- .dlm-downloads-table td {
36
- border-bottom: 1px solid #c3c1bc;
37
- }
38
-
39
- .dlm-download-button {
40
- display: inline-block;
41
- padding: 1em 1.5em;
42
- background-color: #eee;
43
- border-color: #eee;
44
- color: #333;
45
- text-decoration: none;
46
- font-weight: bold;
47
- }
48
-
49
- .dlm-th-name {
50
- width: 45%;
51
- }
52
-
53
- .dlm-downloads-table td.dlm-td-download-button {
54
- text-align: center;
55
- }
56
- </style>
57
- </head>
58
- <body>
59
- <table cellpadding="0" cellspacing="0" border="0" align="center" width="500"
60
- style="font-family: Arial; font-size: 14px;">
61
- <tr>
62
- <td style="font-size: 16px; font-weight: bold; background-color: #459ac9; color: #fff; height: 50px; padding: 0 15px;-webkit-border-top-left-radius: 5px;-webkit-border-top-right-radius: 5px;-moz-border-radius-topleft: 5px;-moz-border-radius-topright: 5px;border-top-left-radius: 5px;border-top-right-radius: 5px;">
63
- Thanks for your order!
64
- </td>
65
- </tr>
66
- <tr>
67
- <td style="padding: 25px 15px;background: #fff;-webkit-border-bottom-right-radius: 5px;-webkit-border-bottom-left-radius: 5px;-moz-border-radius-bottomright: 5px;-moz-border-radius-bottomleft: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;">
68
- Hey %FIRST_NAME%,<br/>
69
- <br/>
70
- Thank you for your purchase, this email confirms your order.<br/>
71
- <br/>
72
- Here's an overview of your purchase:<br/>
73
- <br/>
74
- %DOWNLOADS_TABLE%
75
- <br/>
76
- Many thanks,<br/>
77
- </br>
78
- <em>Team %WEBSITE_NAME%</em>
79
- </td>
80
- </tr>
81
- </table>
82
- </body>
83
  </html>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+ ?>
6
+ <!DOCTYPE html>
7
+ <html>
8
+ <head lang="en">
9
+ <meta charset="UTF-8">
10
+ <style type="text/css">
11
+ html, body {
12
+ padding: 0;
13
+ margin: 0;
14
+ background: #F5F5F5;
15
+ }
16
+
17
+ body {
18
+ padding: 25px;
19
+ }
20
+
21
+ .dlm-downloads-table {
22
+ width: 100%;
23
+ }
24
+
25
+ .dlm-downloads-table th, .dlm-downloads-table td {
26
+ padding: 1.5em 0;
27
+ text-align: left;
28
+ }
29
+
30
+ .dlm-downloads-table th {
31
+ padding: .5em 0;
32
+ border-bottom: 2px solid #c3c1bc;
33
+ }
34
+
35
+ .dlm-downloads-table td {
36
+ border-bottom: 1px solid #c3c1bc;
37
+ }
38
+
39
+ .dlm-download-button {
40
+ display: inline-block;
41
+ padding: 1em 1.5em;
42
+ background-color: #eee;
43
+ border-color: #eee;
44
+ color: #333;
45
+ text-decoration: none;
46
+ font-weight: bold;
47
+ }
48
+
49
+ .dlm-th-name {
50
+ width: 45%;
51
+ }
52
+
53
+ .dlm-downloads-table td.dlm-td-download-button {
54
+ text-align: center;
55
+ }
56
+ </style>
57
+ </head>
58
+ <body>
59
+ <table cellpadding="0" cellspacing="0" border="0" align="center" width="500"
60
+ style="font-family: Arial; font-size: 14px;">
61
+ <tr>
62
+ <td style="font-size: 16px; font-weight: bold; background-color: #459ac9; color: #fff; height: 50px; padding: 0 15px;-webkit-border-top-left-radius: 5px;-webkit-border-top-right-radius: 5px;-moz-border-radius-topleft: 5px;-moz-border-radius-topright: 5px;border-top-left-radius: 5px;border-top-right-radius: 5px;">
63
+ Thanks for your order!
64
+ </td>
65
+ </tr>
66
+ <tr>
67
+ <td style="padding: 25px 15px;background: #fff;-webkit-border-bottom-right-radius: 5px;-webkit-border-bottom-left-radius: 5px;-moz-border-radius-bottomright: 5px;-moz-border-radius-bottomleft: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;">
68
+ Hey %FIRST_NAME%,<br/>
69
+ <br/>
70
+ Thank you for your purchase, this email confirms your order.<br/>
71
+ <br/>
72
+ Here's an overview of your purchase:<br/>
73
+ <br/>
74
+ %DOWNLOADS_TABLE%
75
+ <br/>
76
+ Many thanks,<br/>
77
+ </br>
78
+ <em>Team %WEBSITE_NAME%</em>
79
+ </td>
80
+ </tr>
81
+ </table>
82
+ </body>
83
  </html>
vendor/autoload.php CHANGED
@@ -1,7 +1,7 @@
1
- <?php
2
-
3
- // autoload.php @generated by Composer
4
-
5
- require_once __DIR__ . '/composer/autoload_real.php';
6
-
7
- return ComposerAutoloaderInit80ce4473100edd20fd6c17775a76ce9a::getLoader();
1
+ <?php
2
+
3
+ // autoload.php @generated by Composer
4
+
5
+ require_once __DIR__ . '/composer/autoload_real.php';
6
+
7
+ return ComposerAutoloaderInit80ce4473100edd20fd6c17775a76ce9a::getLoader();
vendor/composer/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
-
2
- Copyright (c) Nils Adermann, Jordi Boggiano
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is furnished
9
- to do so, subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be included in all
12
- copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- THE SOFTWARE.
21
-
1
+
2
+ Copyright (c) Nils Adermann, Jordi Boggiano
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished
9
+ to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
21
+
vendor/composer/autoload_namespaces.php CHANGED
@@ -1,9 +1,9 @@
1
- <?php
2
-
3
- // autoload_namespaces.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- );
1
+ <?php
2
+
3
+ // autoload_namespaces.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );