Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

Commit

Permalink
Random Tag update
Browse files Browse the repository at this point in the history
Random Tag update. It seems like we are having some code Rot
  • Loading branch information
James Mohler committed Aug 31, 2016
1 parent 211d03e commit c3a53ca
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 22 deletions.
2 changes: 1 addition & 1 deletion application.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
component extends="framework.one" accessors="true" {


this.name="bs-4-cf-352";
this.name="bs-4-cf-355";
this.applicationManagement = true;
this.sessionManagement = true;

Expand Down
2 changes: 1 addition & 1 deletion layouts/default.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha/css/bootstrap.min.css" rel="stylesheet">
</cfcase>
<cfdefaultcase>
<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.6/<cfoutput>#lcase(session.bootswatch)#</cfoutput>/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/<cfoutput>#lcase(session.bootswatch)#</cfoutput>/bootstrap.min.css" rel="stylesheet">
</cfdefaultcase>
</cfswitch>

Expand Down
10 changes: 5 additions & 5 deletions vendor/tags/bootstrap/bootstrap.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void function setupApplication() {
isSafeHTML = [ "cf_buttongroup", "cf_buttontoolbar", "cf_column", "cf_container", "cf_dropmenu",
"cf_fieldset", "cf_formgroup", "cf_head", "cf_include",
"cf_jumbotron", "cf_modal", "cf_navbar", "cf_navbarlinks", "cf_navlink",
"cf_panel", "cf_row", "cf_table", "cf_tabview", "cf_tr","cf_well"], // these tags to not run through getSafeHTML
"cf_panel", "cf_row", "cf_table", "cf_tabview", "cf_tr", "cf_well"], // these tags to not run through getSafeHTML
profile = "", // blank means use system default
throwOnError = false, // Default behavior for getSafeHTML()

Expand Down Expand Up @@ -155,11 +155,11 @@ string function filterAttributes(required struct attr, string attributeFilter =
if(arguments.attr?.disabled == true) arguments.attr.disabled = "disabled";
if(arguments.attr?.readonly == true) arguments.attr.readonly = "readonly";
if(arguments.attr?.required == true) arguments.attr.required = "required";

var prev = "";

local.result = arguments.attr.filter(function(key, value) {
return (attributeFilter.ListFind(key) || key.reFindNoCase("data\-|ng\-|on") );
return (attributeFilter.ListFind(key) || key.reFindNoCase("data\-|ng\-|on" && key != "throwonError") );

})?.reduce(function(string prev, string key, string value) {
return prev & ' #key.lcase()# = "#value.encodeForHTMLAttribute()#"';
Expand All @@ -185,8 +185,8 @@ string function filterAttributes(required struct attr, string attributeFilter =

string function generateContent(required string Content, required array tagstack, required struct attr) output="false" {


if(arguments.attr?.key != "" ) {
if(arguments.attr?.key != "" ) {
arguments.Content = application.geti18n(arguments.attr.key, arguments.attr?.placeholder);
arguments.attr.isSafeHTML = true;
}
Expand Down
9 changes: 6 additions & 3 deletions vendor/tags/bootstrap/h1.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ case "start" :
case "end" :
if(attributes?.value != "") { thisTag.GeneratedContent = attributes.value; }
if(attributes?.key != "" ) {
thisTag.GeneratedContent = application.geti18n(attributes.key, attributes?.placeholder);
attributes.isSafeHTML = true;
}
thisTag.GeneratedContent = application.geti18n(attributes.key, attributes?.placeholder);
attributes.isSafeHTML = true;
}
if(attributes?.pageHeader == true) variables.result &= '<div class="page-header">';
Expand Down
3 changes: 3 additions & 0 deletions vendor/tags/bootstrap/h2.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ case "start" :
case "end" :
if(attributes?.value != "") { thisTag.GeneratedContent = attributes.value; }
if(attributes?.key != "" ) {
thisTag.GeneratedContent = application.geti18n(attributes.key, attributes?.placeholder);
attributes.isSafeHTML = true;
Expand Down
6 changes: 5 additions & 1 deletion vendor/tags/bootstrap/h3.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ case "start" :
break;
case "end" :
case "end" :
if(attributes?.value != "") { thisTag.GeneratedContent = attributes.value; }
if(attributes?.key != "" ) {
thisTag.GeneratedContent = application.geti18n(attributes.key, attributes?.placeholder);
attributes.isSafeHTML = true;
Expand Down
4 changes: 3 additions & 1 deletion vendor/tags/bootstrap/h4.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ case "start" :
break;
case "end" :
if(attributes?.value != "") { thisTag.GeneratedContent = attributes.value; }
if(variables.myClass == "") variables.result &= '<h4';
if(variables.myClass != "") variables.result &= '<h4 class="#variables.myClass.encodeForHTMLAttribute()#"';
Expand Down
2 changes: 2 additions & 0 deletions vendor/tags/bootstrap/h5.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ case "start" :
case "end" :
if(attributes?.value != "") { thisTag.GeneratedContent = attributes.value; }
if(variables.myClass == "") variables.result &= '<h5';
if(variables.myClass != "") variables.result &= '<h5 class="#variables.myClass.encodeForHTMLAttribute()#"';
Expand Down
6 changes: 3 additions & 3 deletions vendor/tags/bootstrap/h6.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ case "start" :
break;
case "end" :
case "end" :
if(attributes?.value != "") { thisTag.GeneratedContent = attributes.value; }
if(variables.myClass == "") variables.result &= '<h6';
if(variables.myClass != "") variables.result &= '<h6 class="#variables.myClass.encodeForHTMLAttribute()#"';
Expand Down
2 changes: 1 addition & 1 deletion vendor/tags/bootstrap/include.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@


<cfsavecontent variable="variables.result">
<cfinclude template="../#attributes.template#">
<cfinclude template="../../../views/#attributes.template#">
</cfsavecontent>

<cfscript>
Expand Down
2 changes: 1 addition & 1 deletion vendor/tags/bootstrap/outputText.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ case "start" :
break;
case "end" :
if(attributes?.value != "") thisTag.generatedContent = attributes.value;
if (attributes?.value != "") thisTag.generatedContent = attributes.value;
variables.result &= variables.crlf;
if (attributes.usespan) {
Expand Down
2 changes: 2 additions & 0 deletions vendor/tags/bootstrap/p.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ case "start" :
case "end" :
if(attributes?.value != "") { thisTag.GeneratedContent = attributes.value; }
variables.result &= variables.crlf;
if(variables.myClass == "") variables.result &= '<p';
Expand Down
2 changes: 1 addition & 1 deletion views/bootswatch/home.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<b:row>
<b:column span="12">

<b:h1 value="#rc.theme#" />
<b:h1 value="#session.bootswatch#" />
<p>All themes are from Bootswatch and are not a part of this distribution.</p>
</b:column>
</b:row>
Expand Down
7 changes: 3 additions & 4 deletions views/docs/setup.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
<h3>Minimal setup</h3>


<p>Inside of <code>views/_bootstrap/bootstrap.cfc</code></p>
<p>Inside of <code>vendor/tags/bootstrap/bootstrap.cfc</code></p>

<pre>
application.Bootstrap = {

actionRoot = cgi.script_name,
IconLibrary = {"default" = "glyphicon glyphicon-", "awesome" = "fa fa-"},
ImageLibrary = {"default" = replace(cgi.script_name, "/index.cfm", "") & "/assets/"},
StyleSheetLibrary = {"default" = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"},
Expand All @@ -48,7 +47,7 @@
<p>Inside of each view file</p>

<pre>
&lt;cfimport prefix="b" taglib="../bootstrap"&gt;
&lt;cfimport prefix="b" taglib="../../vendor/tags/bootstrap"&gt;
</pre>

<!--- And Bob's your uncle --->
Expand Down Expand Up @@ -78,7 +77,7 @@
<td>generatedContent</td>
<td>(none)</td>
<td>Pass through of content</td>
<td><b:label look="danger" key="No" />Default Antisamy wouldn't work anyway</td>
<td><b:label look="danger" key="No" /> Default Antisamy wouldn't work anyway</td>
</tr>
<tr>
<td><b:label look="info">Antisamy</b:label></td>
Expand Down

0 comments on commit c3a53ca

Please sign in to comment.