Skip to content

Commit

Permalink
Improved: Use media type "text/javascript" instead of "application/ja…
Browse files Browse the repository at this point in the history
…vascript to follow RFC-9239 (OFBIZ-13156)

See https://datatracker.ietf.org/doc/html/rfc9239#name-iana-considerations
  • Loading branch information
JacquesLeRoux committed Oct 21, 2024
1 parent a0fd3d0 commit f96232d
Show file tree
Hide file tree
Showing 70 changed files with 104 additions and 104 deletions.
8 changes: 4 additions & 4 deletions cmssite/data/CmsMultiSiteDemoData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ under the License.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>${(decoratedContent.subcontent.title.render)!"WebSite 1 Generic Title (Set subcontent 'title' on your content!)"}</title>
<link rel="shortcut icon" href="/images/ofbiz.ico" />
<script src="/common/js/util/fieldlookup.js" type="application/javascript"></script>
<script src="/common/js/util/OfbizUtil.js" type="application/javascript"></script>
<script src="/common/js/util/fieldlookup.js" type="text/javascript"></script>
<script src="/common/js/util/OfbizUtil.js" type="text/javascript"></script>
<link rel="stylesheet" href="/ecommerce/images/ecommain.css" type="text/css"/>
<link rel="stylesheet" href="/ecommerce/images/blog.css" type="text/css"/>
<link rel="stylesheet" href="/contentimages/css/contentForum.css" type="text/css"/>
Expand Down Expand Up @@ -125,8 +125,8 @@ under the License.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>${(decoratedContent.subcontent.title.render)!"WebSite 2 Generic Title (Set subcontent 'title' on your content!)"}</title>
<link rel="shortcut icon" href="/images/ofbiz.ico" />
<script src="/common/js/util/fieldlookup.js" type="application/javascript"></script>
<script src="/common/js/util/OfbizUtil.js" type="application/javascript"></script>
<script src="/common/js/util/fieldlookup.js" type="text/javascript"></script>
<script src="/common/js/util/OfbizUtil.js" type="text/javascript"></script>
<link rel="stylesheet" href="/ecommerce/images/ecommain.css" type="text/css"/>
<link rel="stylesheet" href="/ecommerce/images/blog.css" type="text/css"/>
<link rel="stylesheet" href="/contentimages/css/contentForum.css" type="text/css"/>
Expand Down
4 changes: 2 additions & 2 deletions cmssite/data/CmsSiteDemoData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ under the License.
<Content contentId="CMSS_HHEAD" contentTypeId="DOCUMENT" contentName="CMS Site HTML Head" dataResourceId="CMSS_HHEAD"/>
<ContentPurpose contentId="CMSS_HHEAD" contentPurposeTypeId="SECTION"/>

<DataResource dataResourceId="FIELD_LOOKUP_JS" dataResourceTypeId="LINK" mimeTypeId="application/javascript" objectInfo="/common/js/util/fieldlookup.js"/>
<DataResource dataResourceId="FIELD_LOOKUP_JS" dataResourceTypeId="LINK" mimeTypeId="text/javascript" objectInfo="/common/js/util/fieldlookup.js"/>
<Content contentId="FIELD_LOOKUP_JS" contentTypeId="DOCUMENT" contentName="Field Lookup JS" dataResourceId="FIELD_LOOKUP_JS"/>
<ContentAssoc contentId="CMSS_HHEAD" contentIdTo="FIELD_LOOKUP_JS" sequenceNum="1" contentAssocTypeId="SUB_CONTENT" mapKey="js" fromDate="2014-10-02 00:00:00"/>

<DataResource dataResourceId="OFBIZ_UTIL_JS" dataResourceTypeId="LINK" mimeTypeId="application/javascript" objectInfo="/common/js/util/OfbizUtil.js"/>
<DataResource dataResourceId="OFBIZ_UTIL_JS" dataResourceTypeId="LINK" mimeTypeId="text/javascript" objectInfo="/common/js/util/OfbizUtil.js"/>
<Content contentId="OFBIZ_UTIL_JS" contentTypeId="DOCUMENT" contentName="OFBiz Util JS" dataResourceId="OFBIZ_UTIL_JS"/>
<ContentAssoc contentId="CMSS_HHEAD" contentIdTo="OFBIZ_UTIL_JS" sequenceNum="2" contentAssocTypeId="SUB_CONTENT" mapKey="js" fromDate="2014-10-02 00:00:00"/>

Expand Down
2 changes: 1 addition & 1 deletion cmssite/template/cms/HtmlHead.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ under the License.
<#assign nothing = thisContent.setSortOrder("caSequenceNum")/>
<#assign nothing = thisContent.setMapKeyFilter("js")/>
<#list thisContent.subcontent_all as content>
<script src="${content.render!}" type="application/javascript"></script>
<script src="${content.render!}" type="text/javascript"></script>
</#list>
<#assign nothing = thisContent.setMapKeyFilter("css")/>
<#list thisContent.subcontent_all as content>
Expand Down
2 changes: 1 addition & 1 deletion ebay/template/find/EbayAdvancedSearch.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ specific language governing permissions and limitations
under the License.
-->

<script type="application/javascript">
<script type="text/javascript">
function selectChange(formId, elementId) {
if (elementId.id == 'searchProductStoreId') {
document.getElementById('searchCatalogId')[document.getElementById('searchCatalogId')
Expand Down
2 changes: 1 addition & 1 deletion ebay/template/find/EbayExportLink.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ specific language governing permissions and limitations
under the License.
-->

<script type="application/javascript">
<script type="text/javascript">
function exportToEbay() {
<#if toEbayStore??>
document.products.action="<@ofbizUrl>prepareProductListing</@ofbizUrl>";
Expand Down
4 changes: 2 additions & 2 deletions ebay/template/find/ProductsExportToEbay.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<script type="application/javascript">
<script type="text/javascript">
function changeEbayCategory(categ) {
document.forms["ProductsExportToEbay"].action =
"<@ofbizUrl>ProductsExportToEbay?categoryCode="+categ+"</@ofbizUrl>";
Expand Down Expand Up @@ -240,7 +240,7 @@ under the License.
</#if>
</table>
</form>
<script type="application/javascript">
<script type="text/javascript">
activateSubmitButton();
</script>
</div>
2 changes: 1 addition & 1 deletion ebaystore/template/feedback/LeaveFeedback.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ specific language governing permissions and limitations
under the License.
-->
<#if results.itemsAwaitingFeedback?has_content>
<script type="application/javascript">
<script type="text/javascript">
var active = "";
function overStar(obj){
if(obj.src.match("starActive")){
Expand Down
2 changes: 1 addition & 1 deletion ebaystore/template/store/EbayApiKeywordSearch.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ specific language governing permissions and limitations
under the License.
-->

<script type="application/javascript">
<script type="text/javascript">
//<![CDATA[
function selectChange(formId, elementId) {
if (elementId.id == 'searchCatalogId') {
Expand Down
2 changes: 1 addition & 1 deletion ebaystore/template/store/OrderImported.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<script type="application/javascript">
<script type="text/javascript">
<!-- //
function uploadTrackingCode(orderId, productStoreId) {
document.uploadTracking.orderId.value = orderId;
Expand Down
12 changes: 6 additions & 6 deletions ebaystore/template/store/ProductSearchExport.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ under the License.
background-color:#FFF;
}
</style>
<script type="application/javascript">
<script type="text/javascript">
function retrieveEbayCategoryByParent(url,cateId,productStoreId,id){
if (cateId.match('true')){
Expand Down Expand Up @@ -584,18 +584,18 @@ under the License.
<td>
<script
src="<@ofbizContentUrl>/common/js/jquery/plugins/elrte-1.3/js/elrte.min.js</@ofbizContentUrl>"
type="application/javascript">
type="text/javascript">
</script>
<#if language?has_content && language != "en">
<script
src="<@ofbizContentUrl>/common/js/jquery/plugins/elrte-1.3/js/i18n/elrte.${language!"en"}.js</@ofbizContentUrl>"
type="application/javascript">
type="text/javascript">
</script>
<#rt/>
</#if>
<link href="<@ofbizContentUrl>/common/js/jquery/plugins/elrte-1.3/css/elrte.min.css</@ofbizContentUrl>"
rel="stylesheet" type="text/css">
<script type="application/javascript">
<script type="text/javascript">
var opts = {
cssClass: 'el-rte',
lang: '${language}',
Expand All @@ -608,7 +608,7 @@ under the License.
<textarea id="description" name="description" style="width:800px; height:300px">
<#if item.getDescription()??>description<#else>${item.getDescription()!}</#if>
</textarea>
<script type="application/javascript">
<script type="text/javascript">
jQuery('#description').elrte(opts);
</script>
</td>
Expand Down Expand Up @@ -657,7 +657,7 @@ under the License.
<tr>
<td></td>
<td valign="top">
<script type="application/javascript">
<script type="text/javascript">
function popUpImg() {
//popUp(document.getElementById('themeImg').src, 'themeImgBig', '400', '550');
}
Expand Down
6 changes: 3 additions & 3 deletions ebaystore/template/store/StoreSetting.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<script type="application/javascript">
<script type="text/javascript">
function countAreaChars(areaName, limit, charleft)
{
if (areaName.value.length > limit) {
Expand Down Expand Up @@ -549,7 +549,7 @@ under the License.
</td>
</tr>
</table>
<script type="application/javascript">
<script type="text/javascript">
document.getElementById('charsleft1').innerHTML
= (35 - document.StoreSettingForm.storeName.value.length) + " charactors left.";
document.getElementById('charsleft2').innerHTML
Expand All @@ -558,7 +558,7 @@ under the License.
</fieldset>
</form>
</#if>
<script type="application/javascript">
<script type="text/javascript">
<#if "Basic" == themeType!>
document.StoreSettingForm.storeAdvancedTheme.disabled = true;
document.StoreSettingForm.storeAdvancedThemeColor.disabled = true;
Expand Down
6 changes: 3 additions & 3 deletions ecommerce/template/Login.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ under the License.
<#assign janrainEnabled = Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("ecommerce", "janrain.enabled", delegator)>
<#assign appName = Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("ecommerce", "janrain.appName", delegator)>
<#if "Y" == janrainEnabled>
<script type="application/javascript">
<script type="text/javascript">
(function() {
if (typeof window.janrain !== 'object') window.janrain = {};
window.janrain.settings = {};
Expand All @@ -34,7 +34,7 @@ under the License.
}
var e = document.createElement('script');
e.type = 'application/javascript';
e.type = 'text/javascript';
e.id = 'janrainAuthWidget';
if (document.location.protocol === 'https:') {
Expand Down Expand Up @@ -142,7 +142,7 @@ under the License.

<div class="endcolumns">&nbsp;</div>

<script type="application/javascript">
<script type="text/javascript">
<#if autoUserLogin?has_content>document.loginform.PASSWORD.focus();</#if>
<#if !autoUserLogin?has_content>document.loginform.USERNAME.focus();</#if>
</script>
2 changes: 1 addition & 1 deletion ecommerce/template/RequirePasswordChange.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ under the License.
</div>
</div>

<script type="application/javascript">
<script type="text/javascript">
<#if autoUserLogin?has_content>document.loginform.PASSWORD.focus();</#if>
<#if !autoUserLogin?has_content>document.loginform.USERNAME.focus();</#if>
</script>
6 changes: 3 additions & 3 deletions ecommerce/template/cart/ShowCart.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<script type="application/javascript">
<script type="text/javascript">
function removeSelected() {
var cform = document.cartform;
cform.removeSelected.value = true;
Expand Down Expand Up @@ -61,7 +61,7 @@ under the License.
}
</script>

<script type="application/javascript">
<script type="text/javascript">
function setAlternateGwp(field) {
window.location=field.value;
};
Expand Down Expand Up @@ -122,7 +122,7 @@ under the License.
</div>
</div>

<script type="application/javascript">
<script type="text/javascript">
document.quickaddform.add_product_id.focus();
</script>

Expand Down
2 changes: 1 addition & 1 deletion ecommerce/template/catalog/CategoryDetail.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
-->
<script type="application/javascript">
<script type="text/javascript">
function callDocumentByPaginate(info) {
var str = info.split('~');
var checkUrl = '<@ofbizUrl>categoryAjaxFired</@ofbizUrl>';
Expand Down
6 changes: 3 additions & 3 deletions ecommerce/template/catalog/ConfigProductDetail.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ under the License.

<#-- virtual product javascript -->
${virtualJavaScript!}
<script type="application/javascript">
<script type="text/javascript">
var detailImageUrl = null;
function setAddProductId(name) {
document.addform.add_product_id.value = name;
Expand Down Expand Up @@ -133,7 +133,7 @@ ${virtualJavaScript!}
}
</script>
<script type="application/javascript">
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery('#configFormId').change(getConfigDetails)
Expand Down Expand Up @@ -423,7 +423,7 @@ ${virtualJavaScript!}
<td>
<#-- Prefill first select box (virtual products only) -->
<#if variantTree?? && 0 < variantTree.size()>
<script type="application/javascript">eval("list" + "${featureOrderFirst}" + "()");</script>
<script type="text/javascript">eval("list" + "${featureOrderFirst}" + "()");</script>
</#if>
<#-- Swatches (virtual products only) -->
Expand Down
2 changes: 1 addition & 1 deletion ecommerce/template/catalog/DetailImage.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ under the License.
<#if requestParameters.detail?has_content>
<img src="${requestParameters.detail}" alt=""/>
<#else>
<script type="application/javascript">
<script type="text/javascript">
window.close();
</script>
</#if>
Expand Down
2 changes: 1 addition & 1 deletion ecommerce/template/catalog/ProductCategories.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
-->
<script type="application/javascript">
<script type="text/javascript">
<#-- some labels are not unescaped in the JSON object so we have to do this manuely -->
function unescapeHtmlText(text) {
return jQuery('<div />').html(text).text()
Expand Down
4 changes: 2 additions & 2 deletions ecommerce/template/catalog/ProductDetail.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ under the License.
<#-- virtual product javascript -->
${virtualJavaScript!}
${virtualVariantJavaScript!}
<script type="application/javascript">
<script type="text/javascript">
var detailImageUrl = null;
function setAddProductId2(sku, with_bak) {
document.addform.add_product_id.value = sku;
Expand Down Expand Up @@ -844,7 +844,7 @@ ${variantInfoJavaScript!}
</div>
<#-- Prefill first select box (virtual products only) -->
<#if variantTree?? && 0 &lt; variantTree.size()>
<script type="application/javascript">eval("list" + "${featureOrderFirst}" + "()");</script>
<script type="text/javascript">eval("list" + "${featureOrderFirst}" + "()");</script>
</#if>
<#-- Swatches (virtual products only) -->
Expand Down
2 changes: 1 addition & 1 deletion ecommerce/template/catalog/ProductSummary.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
under the License.
-->
${virtualJavaScript!}
<script type="application/javascript">
<script type="text/javascript">
function displayProductVirtualId(variantId, virtualProductId, pForm) {
if(variantId){
pForm.product_id.value = variantId;
Expand Down
2 changes: 1 addition & 1 deletion ecommerce/template/catalog/TellAFriend.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ under the License.
</tr>
</table>
<#else>
<script type="application/javascript">
<script type="text/javascript">
window.close();
</script>
<div>${uiLabelMap.EcommerceTellAFriendSorry}</div>
Expand Down
2 changes: 1 addition & 1 deletion ecommerce/template/customer/AnonContactus.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ under the License.
<div class="card-header">
<strong>${uiLabelMap.CommonContactUs}</strong>
</div>
<script type="application/javascript">
<script type="text/javascript">
function reloadCaptcha(fieldName) {
var captchaUri = "<@ofbizUrl>captcha.jpg?captchaCodeId=" + fieldName + "&amp;unique=_PLACEHOLDER_</@ofbizUrl>";
var unique = Date.now();
Expand Down
2 changes: 1 addition & 1 deletion ecommerce/template/customer/MiniSignUpForContactList.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ under the License.
</select>
</#macro>

<script type="application/javascript">
<script type="text/javascript">
function unsubscribe() {
var form = document.getElementById("signUpForContactListForm");
form.action = "<@ofbizUrl>unsubscribeContactListParty</@ofbizUrl>"
Expand Down
4 changes: 2 additions & 2 deletions ecommerce/template/customer/NewCustomer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ under the License.
-->

<#if getUsername>
<script type="application/javascript">
<script type="text/javascript">
//<![CDATA[
lastFocusedName = null;
function setLastFocused(formElement) {
Expand Down Expand Up @@ -478,7 +478,7 @@ button actions.
<a href="javascript:document.getElementById('newuserform').submit()" class="btn btn-outline-secondary btn-sm">${uiLabelMap.CommonSave}</a>
</div>

<script type="application/javascript">
<script type="text/javascript">
//<![CDATA[
hideShowUsaStates();
//]]>
Expand Down
Loading

0 comments on commit f96232d

Please sign in to comment.