nodebb-plugin-pdf-secure 1.2.27 → 1.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/library.js CHANGED
@@ -128,7 +128,8 @@ plugin.init = async (params) => {
128
128
  nonce: ${JSON.stringify(nonceData.nonce)},
129
129
  dk: ${JSON.stringify(nonceData.xorKey)},
130
130
  isPremium: ${JSON.stringify(isPremium)},
131
- isLite: ${JSON.stringify(isLite)}
131
+ isLite: ${JSON.stringify(isLite)},
132
+ uid: ${JSON.stringify(req.uid || 0)}
132
133
  };
133
134
  </script>
134
135
  </head>`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-pdf-secure",
3
- "version": "1.2.27",
3
+ "version": "1.2.28",
4
4
  "description": "Secure PDF viewer plugin for NodeBB - prevents downloading, enables canvas-only rendering with Premium group support",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -175,6 +175,9 @@
175
175
  const viewerEl = document.getElementById('viewer');
176
176
  if (!viewerEl) return;
177
177
 
178
+ const uid = (window.PDF_SECURE_CONFIG && window.PDF_SECURE_CONFIG.uid) || 0;
179
+ const checkoutUrl = 'https://forum.ieu.app/pay/checkout?uid=' + uid;
180
+
178
181
  const overlay = document.createElement('div');
179
182
  overlay.id = 'premiumLockOverlay';
180
183
  overlay.innerHTML = `
@@ -187,13 +190,18 @@
187
190
  ${totalPages - 1} sayfa daha kilitli
188
191
  </div>
189
192
  <div class="premium-lock-message">
190
- Bu icerigi goruntulemeye devam etmek icin Premium uyelik gereklidir.
193
+ Tum sayfalara erisim icin Premium satin alabilir veya materyal yukleyerek erisim kazanabilirsiniz.
191
194
  </div>
192
- <a href="https://forumtest.ieu.app/premium" target="_blank" class="premium-lock-button">
193
- Premium Satin Al
194
- </a>
195
- <div class="premium-lock-secondary">
196
- Materyal yukleyerek de Premium olabilirsiniz!
195
+ <div class="page-lock-actions">
196
+ <a href="${checkoutUrl}" target="_blank" class="page-lock-button">
197
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="#1a1a1a"><path d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V6h16v12zm-8-1h2v-4h4v-2h-4V7h-2v4H8v2h4v4z"/></svg>
198
+ Premium Satin Al
199
+ </a>
200
+ <div class="page-lock-divider">ya da</div>
201
+ <a href="https://forum.ieu.app/material-info" target="_blank" class="page-lock-button-secondary">
202
+ <svg viewBox="0 0 24 24" width="16" height="16" fill="#ccc"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11 8 15.01z"/></svg>
203
+ Materyal Yukle
204
+ </a>
197
205
  </div>
198
206
  `;
199
207
 
@@ -1614,17 +1614,31 @@
1614
1614
  line-height: 1.5;
1615
1615
  }
1616
1616
 
1617
+ .page-lock-actions {
1618
+ display: flex;
1619
+ flex-direction: column;
1620
+ align-items: center;
1621
+ gap: 0;
1622
+ width: 100%;
1623
+ max-width: 300px;
1624
+ }
1625
+
1617
1626
  .page-lock-button {
1618
- display: inline-block;
1619
- padding: 12px 36px;
1627
+ display: flex;
1628
+ align-items: center;
1629
+ justify-content: center;
1630
+ gap: 8px;
1631
+ width: 100%;
1632
+ padding: 13px 24px;
1620
1633
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
1621
1634
  color: #1a1a1a;
1622
1635
  font-size: 15px;
1623
1636
  font-weight: 700;
1624
- border-radius: 8px;
1637
+ border-radius: 10px;
1625
1638
  text-decoration: none;
1626
1639
  transition: transform 0.2s, box-shadow 0.2s;
1627
1640
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
1641
+ box-sizing: border-box;
1628
1642
  }
1629
1643
 
1630
1644
  .page-lock-button:hover {
@@ -1632,11 +1646,57 @@
1632
1646
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
1633
1647
  }
1634
1648
 
1635
- .page-lock-secondary {
1636
- margin-top: 16px;
1649
+ .page-lock-button svg {
1650
+ flex-shrink: 0;
1651
+ }
1652
+
1653
+ .page-lock-divider {
1654
+ display: flex;
1655
+ align-items: center;
1656
+ gap: 12px;
1657
+ width: 100%;
1658
+ margin: 14px 0;
1659
+ color: #666;
1660
+ font-size: 12px;
1661
+ font-weight: 500;
1662
+ letter-spacing: 0.5px;
1663
+ text-transform: lowercase;
1664
+ }
1665
+
1666
+ .page-lock-divider::before,
1667
+ .page-lock-divider::after {
1668
+ content: '';
1669
+ flex: 1;
1670
+ height: 1px;
1671
+ background: rgba(255, 255, 255, 0.1);
1672
+ }
1673
+
1674
+ .page-lock-button-secondary {
1675
+ display: flex;
1676
+ align-items: center;
1677
+ justify-content: center;
1678
+ gap: 8px;
1679
+ width: 100%;
1680
+ padding: 11px 24px;
1681
+ background: transparent;
1682
+ color: #ccc;
1637
1683
  font-size: 13px;
1638
- color: #888;
1639
- font-style: italic;
1684
+ font-weight: 600;
1685
+ border-radius: 10px;
1686
+ border: 1.5px solid rgba(255, 255, 255, 0.15);
1687
+ text-decoration: none;
1688
+ transition: transform 0.2s, border-color 0.2s, background 0.2s;
1689
+ box-sizing: border-box;
1690
+ }
1691
+
1692
+ .page-lock-button-secondary:hover {
1693
+ transform: translateY(-1px);
1694
+ border-color: rgba(255, 255, 255, 0.3);
1695
+ background: rgba(255, 255, 255, 0.05);
1696
+ }
1697
+
1698
+ .page-lock-button-secondary svg {
1699
+ flex-shrink: 0;
1640
1700
  }
1641
1701
 
1642
1702
  /* Blur locked page content - even if overlay removed, content unreadable */
@@ -1675,10 +1735,19 @@
1675
1735
  font-size: 13px;
1676
1736
  }
1677
1737
 
1738
+ .page-lock-actions {
1739
+ max-width: 260px;
1740
+ }
1741
+
1678
1742
  .page-lock-button {
1679
- padding: 10px 28px;
1743
+ padding: 11px 20px;
1680
1744
  font-size: 13px;
1681
1745
  }
1746
+
1747
+ .page-lock-button-secondary {
1748
+ padding: 9px 20px;
1749
+ font-size: 12px;
1750
+ }
1682
1751
  }
1683
1752
  </style>
1684
1753
  </head>
@@ -2238,6 +2307,8 @@
2238
2307
  }
2239
2308
  // Don't duplicate overlay
2240
2309
  if (pageEl.querySelector('.page-lock-overlay')) return;
2310
+ var uid = (window.PDF_SECURE_CONFIG && window.PDF_SECURE_CONFIG.uid) || 0;
2311
+ var checkoutUrl = 'https://forum.ieu.app/pay/checkout?uid=' + uid;
2241
2312
  var overlay = document.createElement('div');
2242
2313
  overlay.className = 'page-lock-overlay';
2243
2314
  overlay.innerHTML = '\
@@ -2246,10 +2317,19 @@
2246
2317
  <path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2z"/>\
2247
2318
  </svg>\
2248
2319
  </div>\
2249
- <div class="page-lock-title">Kilitli</div>\
2250
- <div class="page-lock-message">Bu sayfayi goruntulemeye devam etmek icin Premium uyelik gereklidir.</div>\
2251
- <a href="https://forumtest.ieu.app/premium" target="_blank" class="page-lock-button">Premium Satin Al</a>\
2252
- <div class="page-lock-secondary">Materyal yukleyerek de Premium olabilirsiniz!</div>';
2320
+ <div class="page-lock-title">Bu sayfa kilitli</div>\
2321
+ <div class="page-lock-message">Tum sayfalara erisim icin Premium satin alabilir veya materyal yukleyerek erisim kazanabilirsiniz.</div>\
2322
+ <div class="page-lock-actions">\
2323
+ <a href="' + checkoutUrl + '" target="_blank" class="page-lock-button">\
2324
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="#1a1a1a"><path d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V6h16v12zm-8-1h2v-4h4v-2h-4V7h-2v4H8v2h4v4z"/></svg>\
2325
+ Premium Satin Al\
2326
+ </a>\
2327
+ <div class="page-lock-divider">ya da</div>\
2328
+ <a href="https://forum.ieu.app/material-info" target="_blank" class="page-lock-button-secondary">\
2329
+ <svg viewBox="0 0 24 24" width="16" height="16" fill="#ccc"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11 8 15.01z"/></svg>\
2330
+ Materyal Yukle\
2331
+ </a>\
2332
+ </div>';
2253
2333
  pageEl.style.position = 'relative';
2254
2334
  pageEl.appendChild(overlay);
2255
2335
  }