json-object-editor 0.10.432 → 0.10.433
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/CHANGELOG.md +1 -0
- package/css/joe-styles.css +5 -0
- package/css/joe.css +5 -0
- package/js/JsonObjectEditor.jquery.craydent.js +3 -2
- package/js/joe-full.js +3 -2
- package/js/joe.js +3 -2
- package/js/page-editor-scripts.js +3 -1
- package/package.json +1 -1
- package/server/fields/core.js +4 -3
- package/server/modules/Sites.js +8 -4
- package/server/schemas/block.js +2 -1
- package/server/schemas/page.js +31 -5
- package/web-components/joe-button.js +10 -1
package/CHANGELOG.md
CHANGED
package/css/joe-styles.css
CHANGED
|
@@ -2965,6 +2965,11 @@ html.no-touch .joe-object-field .joe-button:hover{
|
|
|
2965
2965
|
float: none;
|
|
2966
2966
|
display:block;
|
|
2967
2967
|
}
|
|
2968
|
+
|
|
2969
|
+
.joe-content-sidebar joe-button.joe-button {
|
|
2970
|
+
float: none;
|
|
2971
|
+
}
|
|
2972
|
+
|
|
2968
2973
|
.joe-object-field .joe-iconed-button.full-width{
|
|
2969
2974
|
text-align:left;
|
|
2970
2975
|
}
|
package/css/joe.css
CHANGED
|
@@ -3451,6 +3451,11 @@ html.no-touch .joe-object-field .joe-button:hover{
|
|
|
3451
3451
|
float: none;
|
|
3452
3452
|
display:block;
|
|
3453
3453
|
}
|
|
3454
|
+
|
|
3455
|
+
.joe-content-sidebar joe-button.joe-button {
|
|
3456
|
+
float: none;
|
|
3457
|
+
}
|
|
3458
|
+
|
|
3454
3459
|
.joe-object-field .joe-iconed-button.full-width{
|
|
3455
3460
|
text-align:left;
|
|
3456
3461
|
}
|
|
@@ -4774,9 +4774,9 @@ this.renderHTMLContent = function(specs){
|
|
|
4774
4774
|
type: subprop.type||'text'
|
|
4775
4775
|
};
|
|
4776
4776
|
if(sortable){
|
|
4777
|
-
onclick='title="sort by '+property.name+'" onclick="_joe.Fields.objectlist.sortBy(\''+prop.name+'\',\''+subprop.name+'\');"';
|
|
4777
|
+
onclick='title="sort by '+property.name+' ('+subprop.name+')" onclick="_joe.Fields.objectlist.sortBy(\''+prop.name+'\',\''+subprop.name+'\');"';
|
|
4778
4778
|
}else{
|
|
4779
|
-
onclick = '';
|
|
4779
|
+
onclick = 'title="('+subprop.name+')"';
|
|
4780
4780
|
}
|
|
4781
4781
|
width=(subprop.width)?'width="'+subprop.width+'"':'';
|
|
4782
4782
|
html+="<th "+onclick+" data-subprop='"+subprop.name+"' "+width+">"
|
|
@@ -9408,6 +9408,7 @@ logit(intent)
|
|
|
9408
9408
|
var cTitle = self.propAsFuncOrValue(self.current.title,tempObj);
|
|
9409
9409
|
var titleStr = fillTemplate(cTitle,titleObj);
|
|
9410
9410
|
self.TITLE.dom().html(specs.before+titleStr+specs.after);
|
|
9411
|
+
document.title = titleStr;
|
|
9411
9412
|
return titleStr;
|
|
9412
9413
|
}
|
|
9413
9414
|
};
|
package/js/joe-full.js
CHANGED
|
@@ -16079,9 +16079,9 @@ this.renderHTMLContent = function(specs){
|
|
|
16079
16079
|
type: subprop.type||'text'
|
|
16080
16080
|
};
|
|
16081
16081
|
if(sortable){
|
|
16082
|
-
onclick='title="sort by '+property.name+'" onclick="_joe.Fields.objectlist.sortBy(\''+prop.name+'\',\''+subprop.name+'\');"';
|
|
16082
|
+
onclick='title="sort by '+property.name+' ('+subprop.name+')" onclick="_joe.Fields.objectlist.sortBy(\''+prop.name+'\',\''+subprop.name+'\');"';
|
|
16083
16083
|
}else{
|
|
16084
|
-
onclick = '';
|
|
16084
|
+
onclick = 'title="('+subprop.name+')"';
|
|
16085
16085
|
}
|
|
16086
16086
|
width=(subprop.width)?'width="'+subprop.width+'"':'';
|
|
16087
16087
|
html+="<th "+onclick+" data-subprop='"+subprop.name+"' "+width+">"
|
|
@@ -20713,6 +20713,7 @@ logit(intent)
|
|
|
20713
20713
|
var cTitle = self.propAsFuncOrValue(self.current.title,tempObj);
|
|
20714
20714
|
var titleStr = fillTemplate(cTitle,titleObj);
|
|
20715
20715
|
self.TITLE.dom().html(specs.before+titleStr+specs.after);
|
|
20716
|
+
document.title = titleStr;
|
|
20716
20717
|
return titleStr;
|
|
20717
20718
|
}
|
|
20718
20719
|
};
|
package/js/joe.js
CHANGED
|
@@ -4780,9 +4780,9 @@ this.renderHTMLContent = function(specs){
|
|
|
4780
4780
|
type: subprop.type||'text'
|
|
4781
4781
|
};
|
|
4782
4782
|
if(sortable){
|
|
4783
|
-
onclick='title="sort by '+property.name+'" onclick="_joe.Fields.objectlist.sortBy(\''+prop.name+'\',\''+subprop.name+'\');"';
|
|
4783
|
+
onclick='title="sort by '+property.name+' ('+subprop.name+')" onclick="_joe.Fields.objectlist.sortBy(\''+prop.name+'\',\''+subprop.name+'\');"';
|
|
4784
4784
|
}else{
|
|
4785
|
-
onclick = '';
|
|
4785
|
+
onclick = 'title="('+subprop.name+')"';
|
|
4786
4786
|
}
|
|
4787
4787
|
width=(subprop.width)?'width="'+subprop.width+'"':'';
|
|
4788
4788
|
html+="<th "+onclick+" data-subprop='"+subprop.name+"' "+width+">"
|
|
@@ -9414,6 +9414,7 @@ logit(intent)
|
|
|
9414
9414
|
var cTitle = self.propAsFuncOrValue(self.current.title,tempObj);
|
|
9415
9415
|
var titleStr = fillTemplate(cTitle,titleObj);
|
|
9416
9416
|
self.TITLE.dom().html(specs.before+titleStr+specs.after);
|
|
9417
|
+
document.title = titleStr;
|
|
9417
9418
|
return titleStr;
|
|
9418
9419
|
}
|
|
9419
9420
|
};
|
|
@@ -28,7 +28,9 @@ function JOEPageEditor(){
|
|
|
28
28
|
var html =
|
|
29
29
|
'<jpe-info-content title="'+data.id+'">'
|
|
30
30
|
+icon
|
|
31
|
-
|
|
31
|
+
+`<a href="${location.origin}/JOE/sitebuilder#/${data.schema}/${data.id}" class="jpe-edit-btn" target="_blank">edit</a>`
|
|
32
|
+
//+'<a href="//'+jsc_hostname+':'+jsc_port+'/JOE/sitebuilder#/'+data.schema+'/'+data.id+'" class="jpe-edit-btn" target="_blank">edit</a>'
|
|
33
|
+
|
|
32
34
|
+'<jpe-info-name>'+data.name+'</jpe-info-name>'
|
|
33
35
|
//+'<jpe-info-cuid>'+data.id+'</jpe-info-cuid>'
|
|
34
36
|
+'<jpe-info-schema>'
|
package/package.json
CHANGED
package/server/fields/core.js
CHANGED
|
@@ -305,10 +305,11 @@ var fields = {
|
|
|
305
305
|
if(typeof(__collectionNames) != undefined){
|
|
306
306
|
var opts = [],name;
|
|
307
307
|
__collectionNames.map(function(collName){
|
|
308
|
-
|
|
308
|
+
let schemaObj = _joe.schemas[collName] || {name:collName};
|
|
309
|
+
name = (schemaObj && schemaObj.menuicon)?
|
|
309
310
|
'<joe-icon class="fleft icon-30 icon-grey" style="padding-bottom:5px; padding-right:5px;">'
|
|
310
|
-
+
|
|
311
|
-
:'<joe-icon class="fleft icon-30 icon-grey" style="padding-bottom:5px; padding-right:5px;">'+'</joe-icon>'+
|
|
311
|
+
+schemaObj.menuicon+'</joe-icon>'+(schemaObj.display||schemaObj.name)
|
|
312
|
+
:'<joe-icon class="fleft icon-30 icon-grey" style="padding-bottom:5px; padding-right:5px;">'+'</joe-icon>'+(schemaObj.display||schemaObj.name);
|
|
312
313
|
|
|
313
314
|
opts.push({name:name,_id:collName});
|
|
314
315
|
})
|
package/server/modules/Sites.js
CHANGED
|
@@ -101,7 +101,7 @@ function findDynamicPage(originalURL,site,req){//returns a page or false
|
|
|
101
101
|
return ({page:testpage,mixins:mixins})
|
|
102
102
|
}*/
|
|
103
103
|
if(match){
|
|
104
|
-
logit('dynamic page: '+testpage.name);
|
|
104
|
+
logit('dynamic page found: '+testpage.name);
|
|
105
105
|
return ({page:testpage,mixins:mixins});
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -322,7 +322,7 @@ var Blocks = {
|
|
|
322
322
|
|
|
323
323
|
SitesServer.parseRoute = function(req,res,next){
|
|
324
324
|
var routeStartTimer = new Date().getTime();
|
|
325
|
-
var mixins;
|
|
325
|
+
var mixins = {};
|
|
326
326
|
var DYNAMIC={};
|
|
327
327
|
var section_content;
|
|
328
328
|
var editor = false;
|
|
@@ -407,10 +407,14 @@ logit('\n\r'+modulename+new Date()+' siteurl: '+siteurl+' site: '+(site && site.
|
|
|
407
407
|
var hash="";
|
|
408
408
|
if(page.dynamic && page.content_items && page.content_items.length){
|
|
409
409
|
//find mixins
|
|
410
|
-
logit(page.content_items);
|
|
410
|
+
logit('content items: '+page.content_items);
|
|
411
411
|
page.content_items.map(function(ci){
|
|
412
412
|
if(mixins[ci.reference]){
|
|
413
|
-
DYNAMIC[ci.reference] =
|
|
413
|
+
DYNAMIC[ci.reference] = $J.get(mixins[ci.reference]);
|
|
414
|
+
}
|
|
415
|
+
if(DYNAMIC[ci.reference] && DYNAMIC[ci.reference].itemtype != ci.itemtype){
|
|
416
|
+
delete DYNAMIC[ci.reference];
|
|
417
|
+
console.log(modulename+' dynamic itemtype mismatch',ci.itemtype,DYNAMIC[ci.reference].itemtype);
|
|
414
418
|
}
|
|
415
419
|
})
|
|
416
420
|
//use ":" for particular parameter
|
package/server/schemas/block.js
CHANGED
package/server/schemas/page.js
CHANGED
|
@@ -12,13 +12,38 @@ var page = {
|
|
|
12
12
|
'<joe-subtext><b><small>layout</b></small> ${RUN[_joe.getDataItemProp;\'${layout}\';\'layout\']}</joe-subtext>',
|
|
13
13
|
listWindowTitle: 'Pages'
|
|
14
14
|
},
|
|
15
|
+
methods:{
|
|
16
|
+
buildURL:function(item,fullURL,mixins){
|
|
17
|
+
var path = item.path || '/';
|
|
18
|
+
|
|
19
|
+
// Handle dynamic mixin substitution (e.g., :campaign → guid)
|
|
20
|
+
if (mixins && typeof mixins === 'object') {
|
|
21
|
+
Object.entries(mixins).forEach(([key, val]) => {
|
|
22
|
+
path = path.replace(`:${key}`, val);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Normalize site prefix
|
|
27
|
+
if(item.site){
|
|
28
|
+
var site = $J.get(item.site);
|
|
29
|
+
path = `/${site.url}/${path}`.replace(/\/+/g, '/');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Optional full URL
|
|
33
|
+
if(fullURL){
|
|
34
|
+
path = location.origin + path;
|
|
35
|
+
}
|
|
36
|
+
return path;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
15
39
|
itemMenu:function(item){
|
|
16
40
|
var menu = [];
|
|
17
41
|
if(item.site){
|
|
18
|
-
var site = _joe.Data.site.where({_id:item.site})[0]||{};
|
|
19
|
-
var path = (site.url+'/'+item.path).replace('//','/');
|
|
42
|
+
// var site = _joe.Data.site.where({_id:item.site})[0]||{};
|
|
43
|
+
// var path = (site.url+'/'+item.path).replace('//','/');
|
|
44
|
+
var fullURL = _joe.schemas.page.methods.buildURL(item,true)
|
|
20
45
|
menu.push({name:'<joe-icon class="joe-view-button" title="preview"> </joe-icon>',
|
|
21
|
-
action
|
|
46
|
+
action:`window.open('${fullURL}');`});
|
|
22
47
|
}
|
|
23
48
|
return menu;
|
|
24
49
|
},
|
|
@@ -124,9 +149,10 @@ var page = {
|
|
|
124
149
|
}},
|
|
125
150
|
{name:'dynamic',type:'boolean',display:'dynamic',label:'the following items from the url path will be available in the template as ${this.DYNAMIC.[reference]}'},
|
|
126
151
|
// {name:'dynamic_hash',display:'Hash Routing',comment:'ie #/content_reference/content_reference'},
|
|
127
|
-
{name:'content_items',comment:'itemtype is the dataset to look at, reference is path param to use for an ID in that dataset', type:'objectList',
|
|
152
|
+
{name:'content_items',display:'Content Items',comment:'itemtype is the dataset to look at, reference is path param to use for an ID in that dataset', type:'objectList',
|
|
128
153
|
properties:['itemtype','reference']
|
|
129
154
|
},
|
|
155
|
+
'datasets',
|
|
130
156
|
{section_end:'Dynamic'},
|
|
131
157
|
'meta',
|
|
132
158
|
{section_start:'system',collapsed:true},
|
|
@@ -140,7 +166,7 @@ var page = {
|
|
|
140
166
|
//_joe.Data.site.where({_id:item.site})[0]||{};
|
|
141
167
|
|
|
142
168
|
//var path = __jsc.PORT?('/'+site.url+'/'+item.path).replace('//','/'):'//'+location.hostname+':'+__jsc.sitesPort+'/'+(site.url+'/'+item.path).replace('//','/');
|
|
143
|
-
var path =
|
|
169
|
+
var path = _joe.schemas.page.methods.buildURL(item,true)
|
|
144
170
|
|
|
145
171
|
return `
|
|
146
172
|
<joe-subtext>${location.origin}</joe-subtext>
|
|
@@ -26,6 +26,11 @@ class JoeButton extends HTMLElement {
|
|
|
26
26
|
|
|
27
27
|
atts.color && classesToAdd.push(`joe-${atts.color}-button`);
|
|
28
28
|
atts.icon && classesToAdd.push('joe-iconed-button',`joe-${atts.icon}-button`);
|
|
29
|
+
|
|
30
|
+
this.overwrites = {};
|
|
31
|
+
if(atts.overwrites){
|
|
32
|
+
this.overwrites = eval('('+atts.overwrites+')');
|
|
33
|
+
}
|
|
29
34
|
var actionPreset = false;
|
|
30
35
|
if(atts.action){
|
|
31
36
|
var actString = '';
|
|
@@ -35,8 +40,12 @@ class JoeButton extends HTMLElement {
|
|
|
35
40
|
var actKey = "create"
|
|
36
41
|
//this.classList.add(`joe-${atts.action}-button`)
|
|
37
42
|
classesToAdd.push(`joe-${actKey}-button`);
|
|
43
|
+
var ovs = Object.keys(this.overwrites).length?
|
|
44
|
+
',overwrites:{'+Object.keys(this.overwrites).map(k=>{
|
|
45
|
+
return `'${k}':'${this.overwrites[k]}'`;
|
|
46
|
+
}).join(',')+'}':'';
|
|
38
47
|
if(atts.schema){
|
|
39
|
-
actString = `_joe.Object.${actKey}('${atts.schema}')`;
|
|
48
|
+
actString = `_joe.Object.${actKey}({schema:'${atts.schema}'${ovs}})`;
|
|
40
49
|
newHTML = `new <b>${atts.schema.toUpperCase()}</b>`;
|
|
41
50
|
classesToAdd.push('joe-iconed-button',`joe-plus-button`);
|
|
42
51
|
}
|