You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
improve: reorganize build system with better project structure
* Move build.js to scripts/build.js for better organization
* Create scripts/dev-build.js for development setup workflow
* Update package.json scripts to reference new file locations
* Move micromodal from js/ to vendor/micromodal/ directory
* Update assets.php to load micromodal from vendor location
* Switch from zip-a-folder to archiver for more stable ZIP creation
* Move micromodal from dependencies to devDependencies in package.json
* Update build process to include vendor directory in distribution
* Improve error handling and logging in build scripts
Follows WordPress best practices and improves developer experience
without changing end-user functionality.
Copy file name to clipboardExpand all lines: README.md
+62-22Lines changed: 62 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,25 +71,29 @@ Kntnt Popup offers multiple ways to control when and how popups appear and disap
71
71
### Time-based trigger
72
72
73
73
**Delayed display:** Show a popup after a specified number of seconds:
74
+
74
75
```
75
76
[popup show-after-time="10"]This popup appears after 10 seconds.[/popup]
76
77
```
77
78
78
79
**Immediate display:** Show a popup as soon as the page loads:
80
+
79
81
```
80
82
[popup show-after-time="0"]This popup appears immediately when the page loads.[/popup]
81
83
```
82
84
83
85
### Scroll-based trigger
84
86
85
87
Show a popup when the user has scrolled a certain percentage of the page:
88
+
86
89
```
87
90
[popup show-after-scroll="75"]This popup appears when you've scrolled 75% of the page.[/popup]
88
91
```
89
92
90
93
### Exit intent trigger
91
94
92
95
Trigger a popup when the user moves their mouse cursor toward the browser's address bar or tab area, indicating they might be about to leave:
96
+
93
97
```
94
98
[popup show-on-exit-intent]Wait! Don't leave yet. Check out this special offer![/popup]
95
99
```
@@ -140,25 +144,29 @@ Kntnt Popup provides several ways for users to close popups, giving you complete
140
144
### Built-in close button
141
145
142
146
Add a close button (×) in the top-right corner of the popup:
147
+
143
148
```
144
149
[popup close-button]This popup has a close button.[/popup]
145
150
```
146
151
147
152
You can customize the close button character:
153
+
148
154
```
149
155
[popup close-button="✕"]This popup uses a different close icon.[/popup]
150
156
```
151
157
152
158
### Click outside to close
153
159
154
160
Allow users to close the popup by clicking anywhere outside the popup area:
161
+
155
162
```
156
163
[popup close-outside-click]Click outside this popup to close it.[/popup]
157
164
```
158
165
159
166
### ESC key to close
160
167
161
168
Enable closing the popup by pressing the ESC key:
169
+
162
170
```
163
171
[popup close-esc-key]Press ESC to close this popup.[/popup]
164
172
```
@@ -168,6 +176,7 @@ Enable closing the popup by pressing the ESC key:
168
176
Make any element inside or outside the popup close it by adding the `data-popup-close` attribute:
169
177
170
178
**Close link inside popup content:**
179
+
171
180
```
172
181
[popup modal show-after-time="5"]
173
182
<h2>Welcome!</h2>
@@ -177,6 +186,7 @@ Make any element inside or outside the popup close it by adding the `data-popup-
177
186
```
178
187
179
188
**Close button inside popup:**
189
+
180
190
```
181
191
[popup show-after-scroll="50"]
182
192
<h2>Newsletter Signup</h2>
@@ -189,6 +199,7 @@ Make any element inside or outside the popup close it by adding the `data-popup-
189
199
```
190
200
191
201
**External close trigger (anywhere on the page):**
202
+
192
203
```html
193
204
<!-- This button can be anywhere on your page -->
194
205
<buttondata-popup-close>Close any open popup</button>
@@ -788,11 +799,11 @@ document.addEventListener('kntnt_popup:after_close', function (event) {
788
799
789
800
## Building from Source (for Developers)
790
801
791
-
If you have downloaded the plugin source code directly from GitHub, the necessary JavaScript file (`js/micromodal.min.js`) might not be included or might be outdated. This file is managed using Node.js and npm. Follow these steps to install dependencies and build the required JavaScript file:
802
+
If you have downloaded the plugin source code directly from GitHub, you'llneedtoinstalldependenciesandbuildthepluginfordistribution.
792
803
793
-
### 1. Install Node.js and npm
804
+
###DevelopmentSetup
794
805
795
-
You need Node.js installed on your system, which includes npm (Node Package Manager). If you don'thaveitinstalled,downloadandinstalltheLTS(LongTermSupport)versionfromtheofficialwebsite:
806
+
Fordevelopmentwork,youneedNode.jsinstalledonyoursystem,whichincludesnpm(NodePackageManager).Ifyoudon't have it installed, download and install the LTS (Long Term Support) version from the official website:
796
807
797
808
* [https://nodejs.org/](https://nodejs.org/)
798
809
@@ -803,53 +814,69 @@ node -v
803
814
npm -v
804
815
```
805
816
806
-
###2.InstallProjectDependencies
817
+
### Install Dependencies
807
818
808
-
Navigatetotheplugin's root directory (`kntnt-popup/`) in your terminal and run the following command:
819
+
Navigate to the plugin'srootdirectory(`kntnt-popup/`)inyourterminalandrun:
809
820
810
821
```bash
811
822
npminstall
812
823
```
813
824
814
-
This command reads the package.json file and downloads the required development dependencies (like Micromodal.js) into a node_modules folder within the plugin directory.
This command executes the build script, which typically copies the necessary JavaScript file (`micromodal.min.js`) from `node_modules` to the correct location within the plugin's`js/`directory.
0 commit comments