jsharmony-cms 1.13.2 → 1.13.4

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/lib/yauzl.js ADDED
@@ -0,0 +1,20 @@
1
+ /*
2
+ Copyright 2024 apHarmony
3
+
4
+ This file is part of jsHarmony.
5
+
6
+ jsHarmony is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU Lesser General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ jsHarmony is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU Lesser General Public License for more details.
15
+
16
+ You should have received a copy of the GNU Lesser General Public License
17
+ along with this package. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+
20
+ module.exports = require('yauzl');
package/lib/yazl.js ADDED
@@ -0,0 +1,20 @@
1
+ /*
2
+ Copyright 2024 apHarmony
3
+
4
+ This file is part of jsHarmony.
5
+
6
+ jsHarmony is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU Lesser General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ jsHarmony is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU Lesser General Public License for more details.
15
+
16
+ You should have received a copy of the GNU Lesser General Public License
17
+ along with this package. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+
20
+ module.exports = require('yazl');
@@ -100,6 +100,42 @@ app.get('/standalone_page', async function(req, res, next){
100
100
 
101
101
  </div>
102
102
 
103
+ <!-- React -->
104
+ <div class="<%=model.class%>_Integration_REACT">
105
+ <div style="margin-top:15px;">
106
+ Integration instructions are available at <a href="https://www.jsharmonycms.com/resources/integrations/react/" target="_blank">jsHarmonyCMS.com</a>.
107
+ </div>
108
+
109
+ <h3>React Sample Code</h3>
110
+ <textarea readonly='readonly' class='integration_code'>
111
+ import { JshCms } from &quot;jsharmony-cms-sdk-react&quot;;
112
+ import React from &quot;react&quot;;
113
+ import { createRoot } from &quot;react-dom/client&quot;;
114
+
115
+ // CMS Config
116
+ const jshCmsConfig = %%%INTEGRATION_PARAMS_ACCESS_KEYS%%%;
117
+
118
+ const root = createRoot(document.getElementById(&quot;root&quot;)!);
119
+
120
+ root.render(
121
+ &lt;JshCms {...jshCmsConfig} &gt;
122
+ &lt;App /&gt;
123
+ &lt;/JshCms&gt;
124
+ );</textarea>
125
+ <a href='#' class='integration_code_copy'>&#x1F4CB; Copy Code</a>
126
+
127
+
128
+ <h3>Editor Launcher for Remote Page Templates</h3>
129
+ <textarea readonly='readonly' class='integration_code'>
130
+ &lt;script type=&quot;text&#x2F;javascript&quot; class="removeOnPublish" src=&quot;/.jsHarmonyCms/jsHarmonyCmsEditor.js&quot;&gt;&lt;&#x2F;script&gt;
131
+ &lt;script type=&quot;text&#x2F;javascript&quot; class="removeOnPublish"&gt;
132
+ jsHarmonyCmsEditor({"access_keys":%%%ACCESS_KEYS%%%});
133
+ &lt;&#x2F;script&gt;</textarea>
134
+ <a href='#' class='integration_code_copy'>&#x1F4CB; Copy Code</a>
135
+ <div style="margin: 10px 0 15px 0;" >* Be sure to include the "removeOnPublish" class to the Launcher script tags, so that the Editor Launcher will not be added to published pages.</div>
136
+
137
+ </div>
138
+
103
139
  <!-- PHP - Router -->
104
140
  <div class="<%=model.class%>_Integration_PHP_ROUTER">
105
141
  <div style="margin-top:15px;">
@@ -93,8 +93,17 @@ jsh.App[modelid] = new (function(){
93
93
  OBJ_END: ']',
94
94
  }
95
95
  };
96
+ var KEYMAP = {
97
+ REACT: {
98
+ access_keys: 'accessKeys',
99
+ page_files_path: 'pageFilesPath',
100
+ redirect_listing_path: 'redirectListingPath',
101
+ },
102
+ };
96
103
  var _s = STRMAP['JS'];
97
104
  if(platform=='PHP') _s = STRMAP['PHP'];
105
+ var _k = {};
106
+ if(platform=='REACT') _k = KEYMAP['REACT'];
98
107
  options = _.extend({
99
108
  access_keys: false,
100
109
  cms_server_urls: false,
@@ -105,7 +114,7 @@ jsh.App[modelid] = new (function(){
105
114
  for(var key in options.params){
106
115
  if((key=='access_keys')&&!options.access_keys) continue;
107
116
  if((key=='cms_server_urls')&&!options.cms_server_urls) continue;
108
- integrationParamsString += (firstParam ? '' : ',')+'\n '+_s.OBJ_KEY_PRE+key+_s.OBJ_KEY_POST+_s.OBJ_EQ+JSON.stringify(options.params[key]);
117
+ integrationParamsString += (firstParam ? '' : ',')+'\n '+_s.OBJ_KEY_PRE+(_k[key]||key)+_s.OBJ_KEY_POST+_s.OBJ_EQ+JSON.stringify(options.params[key]);
109
118
  firstParam = false;
110
119
  }
111
120
  integrationParamsString += (firstParam ? '' : '\n') + _s.OBJ_END;
@@ -29,6 +29,7 @@
29
29
  "CLIENTJS_STANDALONE": "Client-side JavaScript - Standalone",
30
30
  "EXPRESSJS_ROUTER": "Node.js / Express.js - Router",
31
31
  "EXPRESSJS_STANDALONE": "Node.js / Express.js - Standalone",
32
+ "REACT": "React",
32
33
  "PHP_ROUTER": "PHP - Router",
33
34
  "PHP_STANDALONE": "PHP - Standalone",
34
35
  } }, "onchange":"_this.integration_target_onchange(obj, newval, undoChange);"},
@@ -887,7 +887,7 @@ module.exports = exports = function(module, funcs){
887
887
  op.params[1](null, null, content, op.done);
888
888
  }
889
889
  else {
890
- wc.req(op.params[0], 'GET', {}, {}, undefined, function(err, res, templateContent){
890
+ wc.req(op.params[0], 'GET', {}, { 'Accept': 'text/html' }, undefined, function(err, res, templateContent){
891
891
  if(err){
892
892
  if((err.code=='DEPTH_ZERO_SELF_SIGNED_CERT')||(err.code=='SELF_SIGNED_CERT_IN_CHAIN')||(err.message=='self signed certificate')){
893
893
  err.message = 'Self-signed certificate found for URL: '+op.params[0] + ' :: Select the "Ignore certificate errors when downloading remote templates" option in the Deployment Target configuration to allow self-signed certificates.';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsharmony-cms",
3
- "version": "1.13.2",
3
+ "version": "1.13.4",
4
4
  "description": "jsHarmony CMS",
5
5
  "main": "index.js",
6
6
  "scripts": {