Skip to content

Commit

Permalink
- fix for js for template break missing
Browse files Browse the repository at this point in the history
- fix for boolean formatting in dumb adobe that doesn't adhere to casting rules
- improvement of remove all for custom fields with nice confirmations and only show when they exist.
  • Loading branch information
lmajano committed Oct 20, 2023
1 parent 5e747a3 commit 8480409
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 39 deletions.
8 changes: 4 additions & 4 deletions box.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
"testbox":"^5.0.0+1",
"commandbox-cfformat":"*",
"commandbox-docbox":"*",
"route-visualizer":"^1.4.0+24",
"cbdebugger":"be"
"cbdebugger":"be",
"route-visualizer":"^2.0.0+6"
},
"installPaths":{
"testbox":"testbox/",
"coldbox":"coldbox/",
"route-visualizer":"modules/route-visualizer/",
"cbdebugger":"modules/cbdebugger/"
"cbdebugger":"modules/cbdebugger/",
"route-visualizer":"modules/route-visualizer/"
},
"ignores":[],
"scripts":{
Expand Down
22 changes: 17 additions & 5 deletions config/modules/cbdebugger.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ component {
enabled : getSystemSetting( "CBDEBUGGER_ENABLED", false ),
// This setting controls if you will activate the debugger for visualizations ONLY
// The debugger will still track requests even in non debug mode.
debugMode : false,
debugMode : true,
// The URL password to use to activate it on demand
debugPassword : "cb",
// This flag enables/disables the end of request debugger panel docked to the bottem of the page.
// If you disable i, then the only way to visualize the debugger is via the `/cbdebugger` endpoint
requestPanelDock : false,
requestPanelDock : true,
// Request Tracker Options
requestTracker : {
storage : "cachebox",
storage : "memory",
cacheName : "template",
trackDebuggerEvents : false,
// Expand by default the tracker panel or not
Expand Down Expand Up @@ -46,7 +46,7 @@ component {
httpRequest : {
expanded : false,
// If enabled, we will profile HTTP Body content, disabled by default as it contains lots of data
profileHTTPBody : false
profileHTTPBody : true
}
},
// ColdBox Tracer Appender Messages
Expand Down Expand Up @@ -80,7 +80,19 @@ component {
// Log the binding parameters
logParams : false
},
async : { enabled : false, expanded : false }
// Adobe ColdFusion SQL Collector
acfSql : { enabled : false, expanded : false, logParams : true },
// Lucee SQL Collector
luceeSQL : { enabled : false, expanded : false, logParams : true },
// Async Manager Collector
async : { enabled : true, expanded : false },
// Hyper Collector
hyper : {
enabled : false,
expanded : false,
logResponseData : false,
logRequestBody : false
}
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ window.applyContentTemplateToField = function( fieldName, definition ){
}
}
);
break;
}
default:{
if ( $templateField[ 0 ].localName == "select" ){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
type="button"
id="removeCustomFieldsButton"
class="btn btn-sm btn-danger"
@click="cleanCustomFields"
x-show="customFields.length > 0"
@click="removeAllCustomFields"
>
<i class="fa fa-trash fa-lg"></i> Remove All
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ function customFieldsModel(){
this.customFields.push( newField );
},
cleanCustomFields(){
this.customFields.forEach( ( item, index ) => {
if( !item.key.trim() ){
this.customFields.splice( index, 1 );
}
} );
removeAllCustomFields(){
if( confirm( "Really delete all custom fields?" ) ){
this.customFields = [];
}
},
removeCustomField( field ){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<cfoutput>
<script>
window.authentication = #toJSON( prc.jwtTokens )#
window.assignedTemplate = #( !isNull( prc.oContent.getContentTemplate() ) ? toJSON( prc.oContent.getContentTemplate().getMemento() ) : javacast( "boolean", false ) )#
window.assignedTemplate = #( !isNull( prc.oContent.getContentTemplate() ) ? toJSON( prc.oContent.getContentTemplate().getMemento() ) : booleanFormat( false ) )#
// Editor alerts model
function alertsModel(){
return {
init(){
$nextTick( () => window.alerts = this.alerts ) },
alerts : [],
init(){
$nextTick( () => window.alerts = this.alerts )
},
removeAlert : index => this.alerts.splice( index, 1 ),
addAlert( alert ){
if( alert instanceof CustomEvent ){
alert = alert.detail
Expand All @@ -18,36 +22,41 @@ function alertsModel(){
}
}
}
/**
* Enclosure for custom editor startup
*/
$cbEditorStartup = function(){
#prc.oEditorDriver.startup()#
}
/**
* Enclosure for custom editor startup
*/
$cbEditorShutdown = function(){
#prc.oEditorDriver.shutdown()#
}
// Dynamic global variables coming from ColdFusion
$cbEditorConfig = {
adminEntryPoint : "#prc.cbAdminEntryPoint#",
adminEntryURL : "#event.buildLink( prc.cbAdminEntryPoint )#",
changelogMandatory : #prc.cbSettings.cb_versions_commit_mandatory#,
isBlogDisabled : #prc.oCurrentSite.getIsBlogEnabled() ? 'false' : 'true'#,
// Set by the content type handler
slugifyURL : "#event.buildLink( prc.xehSlugify )#",
slugCheckURL : "#event.buildLink( prc.xehSlugCheck )#"
};
// Load Editor Provider Assets now
#prc.oEditorDriver.loadAssets()#
// On Dom Ready
document.addEventListener( "DOMContentLoaded", () => {
// Dynamic global variables coming from ColdFusion
$cbEditorConfig = {
adminEntryPoint : "#prc.cbAdminEntryPoint#",
adminEntryURL : "#event.buildLink( prc.cbAdminEntryPoint )#",
changelogMandatory : #prc.cbSettings.cb_versions_commit_mandatory#,
isBlogDisabled : #prc.oCurrentSite.getIsBlogEnabled() ? 'false' : 'true'#,
// Set by the content type handler
slugifyURL : "#event.buildLink( prc.xehSlugify )#",
slugCheckURL : "#event.buildLink( prc.xehSlugCheck )#"
};
// Editor Form Pointer
$contentForm = $( "##contentForm" );
// Setup the Editors
setupEditors(
$contentForm,
Expand All @@ -58,6 +67,8 @@ document.addEventListener( "DOMContentLoaded", () => {
</cfif>
'#event.buildLink( prc.xehContentSave )#'
);
// Apply content templates
if( document.getElementById( 'contentTemplate' ) && document.getElementById( 'contentTemplate' ).value !== 'null' ){
applyContentTemplate( document.getElementById( 'contentTemplate' ).value );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
</button>
<ul class="dropdown-menu list-unstyled">
<cfif prc.availableTemplates.len()>
<li class="dropdown-header"><i class="fa fa-map-o"></i> From Template:</li>
<li class="dropdown-header"><i class="fa fa-object-group"></i> From Template:</li>
<cfloop array="#prc.availableTemplates#" item="template">
<li class="mb-5">
<a
Expand All @@ -130,7 +130,7 @@
</a>
</li>
<li class="mb-5">
<a href="#event.buildLink( prc.xehTemplates & "##create-ContentStore" )#"><i class="fa fa-map-o"></i> New Template</a>
<a href="#event.buildLink( prc.xehTemplates & "##create-ContentStore" )#"><i class="fa fa-object-group"></i> New Template</a>
</li>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="row">
<div class="col-md-12">
<h1 class="h1">
<i class="fa fa-tags"></i> Content Templates (<span x-text="templates.length"></span>)
<i class="fa fa-object-group"></i> Content Templates (<span x-text="templates.length"></span>)
</h1>
</div>
</div>
Expand Down Expand Up @@ -574,4 +574,4 @@
prePostExempt = true
)#
</cfif>
</cfoutput>
</cfoutput>
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
</button>
<ul class="dropdown-menu list-unstyled">
<cfif prc.availableTemplates.len()>
<li class="dropdown-header"><i class="fa fa-map-o"></i> From Template:</li>
<li class="dropdown-header"><i class="fa fa-object-group"></i> From Template:</li>
<cfloop array="#prc.availableTemplates#" item="template">
<li class="mb-5">
<a
Expand All @@ -135,7 +135,7 @@
</a>
</li>
<li class="mb-5">
<a href="#event.buildLink( prc.xehTemplates & "##create-Entry" )#"><i class="fa fa-map-o"></i> New Template</a>
<a href="#event.buildLink( prc.xehTemplates & "##create-Entry" )#"><i class="fa fa-object-group"></i> New Template</a>
</li>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,16 @@
</button>
<ul class="dropdown-menu list-unstyled">
<cfif prc.availableTemplates.len()>
<li class="dropdown-header"><i class="fa fa-map-o"></i> From Template:</li>
<li class="dropdown-header">
<i class="fa fa-object-group"></i> From Template:
</li>
<cfloop array="#prc.availableTemplates#" item="template">
<li class="mb-5">
<a
href="#event.buildLink( prc.xehPageEditor & "/parentId/" & encodeForHTMLAttribute( rc.parent ) & "?contentTemplate=" & encodeForHTMLAttribute( template[ "templateID" ] ) )#"
><small><i class="fa fa-plus"></i> #template[ "name" ]#</small></a>
>
<small><i class="fa fa-clone"></i> #template[ "name" ]#</small>
</a>
</li>
</cfloop>
<li role="separator" class="divider"></li>
Expand All @@ -131,7 +135,7 @@
</a>
</li>
<li class="mb-5">
<a href="#event.buildLink( prc.xehTemplates & "##create" )#"><i class="fa fa-map-o"></i> New Template</a>
<a href="#event.buildLink( prc.xehTemplates & "##create" )#"><i class="fa fa-object-group"></i> New Template</a>
</li>
</ul>
</div>
Expand Down

0 comments on commit 8480409

Please sign in to comment.