Skip to content

Commit

Permalink
Fixed minor bug in domManip override.
Browse files Browse the repository at this point in the history
Changed Template Tags map to be named jQuery.tmpl.tag, rather than
jQuery.tmpl.tags, for consistency. (Just as jQuery.template, rather than
jQuery.templates, is the map for named templates).

Changed convention on all samples to use <script type="text/x-jquery-tmpl">
rather than type="text/html". (Needs a specific mime-type, so that future
tooling can provide an appropriate experience).
  • Loading branch information
BorisMoore committed Aug 23, 2010
1 parent 189c570 commit 466f1fc
Show file tree
Hide file tree
Showing 19 changed files with 51 additions and 51 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ ____________________________________________________________________
.appendTo( "ul" );
____________________________________________________________________

<!-- Declare a template as a script block of type "text/html" -->
<!-- Declare a template as a script block of type "text/x-jquery-tmpl" -->

<script id="sometmpl" type="text/html">
<script id="sometmpl" type="text/x-jquery-tmpl">
<li>${firstName}</li>
</script>
____________________________________________________________________
Expand Down
8 changes: 4 additions & 4 deletions demos/movies/PagesCore/movies.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h1>Netflix: Book a Movie...</h1>
<script src="../components/jquery.pager.js" type="text/javascript"></script>
<script src="../components/jquery-ui-1.8.1.custom.js" type="text/javascript"></script>

<script id="movieTmpl" type="text/html">
<script id="movieTmpl" type="text/x-jquery-tmpl">
<div>
<div><img src="${BoxArt.LargeUrl}" /> </div>
<strong>${Name}</strong>
Expand All @@ -57,7 +57,7 @@ <h1>Netflix: Book a Movie...</h1>
</div>
</script>

<script id="cartTmpl" type="text/html">
<script id="cartTmpl" type="text/x-jquery-tmpl">
<td class="cart-${!!count}" colspan="4">
<span class="text">${count} items in Cart...</span>
{{if count}}
Expand All @@ -77,7 +77,7 @@ <h1>Netflix: Book a Movie...</h1>
</td>
</script>

<script id="bookingTitleTmpl" type="text/html">
<script id="bookingTitleTmpl" type="text/x-jquery-tmpl">
<tr class="bookingTitle${$item.mode}">
<td>${movie.Name}</td><td>${movieTheater}</td>
<td>${formatDate(date)}</td>
Expand All @@ -88,7 +88,7 @@ <h1>Netflix: Book a Movie...</h1>
</tr>
</script>

<script id="bookingEditTmpl" type="text/html">
<script id="bookingEditTmpl" type="text/x-jquery-tmpl">
{{tmpl($data, {mode: "Edit"}) "#bookingTitleTmpl"}}
<tr class="bookingEdit">
<td colspan="4">
Expand Down
8 changes: 4 additions & 4 deletions demos/movies/PagesTmplPlus/movies1.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h1>Netflix: Book a Movie...</h1>
<script src="../components/jquery.pager.js" type="text/javascript"></script>
<script src="../components/jquery-ui-1.8.1.custom.js" type="text/javascript"></script>

<script id="movieTmpl" type="text/html">
<script id="movieTmpl" type="text/x-jquery-tmpl">
<div>
<div><img src="${BoxArt.LargeUrl}" /> </div>
<strong>${Name}</strong>
Expand All @@ -59,7 +59,7 @@ <h1>Netflix: Book a Movie...</h1>
</div>
</script>

<script id="cartTmpl" type="text/html">
<script id="cartTmpl" type="text/x-jquery-tmpl">
<td class="cart-${!!count}" colspan="4">
<span class="text">${count} items in Cart...</span>
{{if count}}
Expand All @@ -79,7 +79,7 @@ <h1>Netflix: Book a Movie...</h1>
</td>
</script>

<script id="bookingTitleTmpl" type="text/html">
<script id="bookingTitleTmpl" type="text/x-jquery-tmpl">
<tr class="bookingTitle${$item.mode}">
<td>${movie.Name}</td><td>${movieTheater}</td>
<td>${formatDate(date)}</td>
Expand All @@ -90,7 +90,7 @@ <h1>Netflix: Book a Movie...</h1>
</tr>
</script>

<script id="bookingEditTmpl" type="text/html">
<script id="bookingEditTmpl" type="text/x-jquery-tmpl">
{{tmpl($data, {mode: "Edit"}) "#bookingTitleTmpl"}}
<tr class="bookingEdit">
<td colspan="4">
Expand Down
8 changes: 4 additions & 4 deletions demos/movies/PagesTmplPlus/movies2.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h1>Netflix: Book a Movie...</h1>
<script src="../components/jquery.pager.js" type="text/javascript"></script>
<script src="../components/jquery-ui-1.8.1.custom.js" type="text/javascript"></script>

<script id="movieTmpl" type="text/html">
<script id="movieTmpl" type="text/x-jquery-tmpl">
<div>
<div><img src="${BoxArt.LargeUrl}" /> </div>
<strong>${Name}</strong>
Expand All @@ -58,7 +58,7 @@ <h1>Netflix: Book a Movie...</h1>
</div>
</script>

<script id="cartTmpl" type="text/html">
<script id="cartTmpl" type="text/x-jquery-tmpl">
<td class="cart-${!!count}" colspan="4">
<span class="text">${count} items in Cart...</span>
{{if count}}
Expand All @@ -78,7 +78,7 @@ <h1>Netflix: Book a Movie...</h1>
</td>
</script>

<script id="bookingTitleTmpl" type="text/html">
<script id="bookingTitleTmpl" type="text/x-jquery-tmpl">
<tr class="bookingTitle${$item.mode}">
<td>${movie.Name}</td><td>${movieTheater}</td>
<td>${formatDate(date)}</td>
Expand All @@ -89,7 +89,7 @@ <h1>Netflix: Book a Movie...</h1>
</tr>
</script>

<script id="bookingEditTmpl" type="text/html">
<script id="bookingEditTmpl" type="text/x-jquery-tmpl">
{{tmpl($data, {mode: "Edit"}) "#bookingTitleTmpl"}}
<tr class="bookingEdit">
<td colspan="4">
Expand Down
8 changes: 4 additions & 4 deletions demos/movies/PagesTmplPlus/movies3.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h1>Netflix: Book a Movie...</h1>
<script src="../components/jquery.pager.js" type="text/javascript"></script>
<script src="../components/jquery-ui-1.8.1.custom.js" type="text/javascript"></script>

<script id="movieTmpl" type="text/html">
<script id="movieTmpl" type="text/x-jquery-tmpl">
<div>
<div><img src="${BoxArt.LargeUrl}" /> </div>
<strong>${Name}</strong>
Expand All @@ -58,7 +58,7 @@ <h1>Netflix: Book a Movie...</h1>
</div>
</script>

<script id="cartTmpl" type="text/html">
<script id="cartTmpl" type="text/x-jquery-tmpl">
<td class="cart-${!!count}" colspan="4">
<span class="text">${count} items in Cart...</span>
{{if count}}
Expand All @@ -78,7 +78,7 @@ <h1>Netflix: Book a Movie...</h1>
</td>
</script>

<script id="bookingTitleTmpl" type="text/html">
<script id="bookingTitleTmpl" type="text/x-jquery-tmpl">
<tr class="bookingTitle${$item.mode}">
<td>${movie.Name}</td><td>${movieTheater}</td>
<td>${formatDate(date)}</td>
Expand All @@ -89,7 +89,7 @@ <h1>Netflix: Book a Movie...</h1>
</tr>
</script>

<script id="bookingEditTmpl" type="text/html">
<script id="bookingEditTmpl" type="text/x-jquery-tmpl">
{{tmpl($data, {mode: "Edit"}) "#bookingTitleTmpl"}}
<tr class="bookingEdit">
<td colspan="4">
Expand Down
6 changes: 3 additions & 3 deletions demos/samplesCore/Interactive/tabsTmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h1>Tabs</h1>
<script src="http://code.jquery.com/jquery.js" type="text/javascript"></script>
<script src="../../../jquery.tmpl.js" type="text/javascript"></script>

<script id="tabsTmpl" type="text/html">
<script id="tabsTmpl" type="text/x-jquery-tmpl">
<table class="tabsView"><tbody>
<tr>{{tmpl(items) "#headerItemTmpl"}}</tr>
<tr><td colspan="${items.length}">
Expand All @@ -24,11 +24,11 @@ <h1>Tabs</h1>
</tbody></table>
</script>

<script id="headerItemTmpl" type="text/html">
<script id="headerItemTmpl" type="text/x-jquery-tmpl">
<th class="header_${$data === activeDataItem}">${name}</th>
</script>

<script id="contentTmpl" type="text/html">
<script id="contentTmpl" type="text/x-jquery-tmpl">
<h3>${title}</h3>
<div>{{html description}}</div>
</script>
Expand Down
4 changes: 2 additions & 2 deletions demos/samplesCore/Interactive/tabsWrap.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1>Tabs</h1>
<script src="http://code.jquery.com/jquery.js" type="text/javascript"></script>
<script src="../../../jquery.tmpl.js" type="text/javascript"></script>

<script id="tabsTmpl" type="text/html">
<script id="tabsTmpl" type="text/x-jquery-tmpl">
{{wrap(null, {state: state}) "#tabsWrap"}}

<h3>Inline</h3>
Expand All @@ -37,7 +37,7 @@ <h3>Remote</h3>
{{/wrap}}
</script>

<script id="tabsWrap" type="text/html">
<script id="tabsWrap" type="text/x-jquery-tmpl">
<table class="tabsView"><tbody>
<tr>
{{each tabs}}
Expand Down
2 changes: 1 addition & 1 deletion demos/samplesCore/Interactive/tabsWrapImperative.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h3>Remote</h3>
</div>
</div>

<script id="tabsWrap" type="text/html">
<script id="tabsWrap" type="text/x-jquery-tmpl">
<table class="tabsView"><tbody>
<tr>
{{each $item.html("h3", true)}}
Expand Down
4 changes: 2 additions & 2 deletions demos/samplesCore/Interactive/tabsWrapNested.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1>Tabs</h1>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="../../../jquery.tmpl.js" type="text/javascript"></script>

<script id="tabsTmpl" type="text/html">
<script id="tabsTmpl" type="text/x-jquery-tmpl">
{{wrap(null, {state: outerState}) "#tabsWrap"}}

<h3>Inline</h3>
Expand Down Expand Up @@ -52,7 +52,7 @@ <h3>POST</h3>
{{/wrap}}
</script>

<script id="tabsWrap" type="text/html">
<script id="tabsWrap" type="text/x-jquery-tmpl">
<table class="tabsView"><tbody>
<tr>
{{each tabs}}
Expand Down
4 changes: 2 additions & 2 deletions demos/samplesCore/Interactive/treeView.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1>Tree View</h1>
<script src="http://code.jquery.com/jquery.js" type="text/javascript"></script>
<script src="../../../jquery.tmpl.js" type="text/javascript"></script>

<script id="folderTmpl" type="text/html">
<script id="folderTmpl" type="text/x-jquery-tmpl">
<li class="content_${hasContent($item)}">
<img class="expand" src="resources/${expanderImage}.png" />
<img class="folder" src="resources/folder.png" />
Expand All @@ -30,7 +30,7 @@ <h1>Tree View</h1>
{{/if}}
</script>

<script id="itemTmpl" type="text/html">
<script id="itemTmpl" type="text/x-jquery-tmpl">
<li class="folderItem">${name}</li>
</script>

Expand Down
4 changes: 2 additions & 2 deletions demos/samplesCore/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
});
</script>

<script id="sometmpl" type="text/html">
<script id="sometmpl" type="text/x-jquery-tmpl">
<li>
{{if $item.array}}
${index($item.array)} of ${$item.array.length})
Expand All @@ -124,7 +124,7 @@
</li>
</script>

<script id="leadingOrTrailingText" type="text/html">
<script id="leadingOrTrailingText" type="text/x-jquery-tmpl">
${firstName} <strong>${lastName}</strong> <br/>
</script>

Expand Down
6 changes: 3 additions & 3 deletions demos/samplesCore/composition.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@
});
</script>

<script id="tmplPeople" type="text/html">
<script id="tmplPeople" type="text/x-jquery-tmpl">
{{tmpl "#tmplSeparator"}}
<tr class="${alternate(this.data, people)}"><td colspan="2"><a href="${url}">${getName}</a></td></tr>
{{if cities}}
{{tmpl(cities) getTemplate("City")}}
{{/if}}
</script>

<script id="tmplSeparator" type="text/html">
<script id="tmplSeparator" type="text/x-jquery-tmpl">
<tr class="separator"><td colspan="2"></td></tr>
</script>

<script id="tmplCity" type="text/html">
<script id="tmplCity" type="text/x-jquery-tmpl">
{{tmpl "citySeparator"}}
<tr class="${alternate(this.parent.data, people)}"><td colspan="2"><b><i>City ${cityNumber}:</i></b></td></tr>
<tr class="${alternate(this.parent.data, people)}"><td><b>${name}</b></td><td>${state}</td></tr>
Expand Down
2 changes: 1 addition & 1 deletion demos/samplesCore/each.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
}
</script>

<script id="tmplPeople" type="text/html">
<script id="tmplPeople" type="text/x-jquery-tmpl">
<tr class="${alternate($data, people)}"><td colspan="2"><a href="${url}">${getName}</a></td></tr>
{{each cities}}
<tr class="cityseparator"><td colspan="2"></td></tr>
Expand Down
4 changes: 2 additions & 2 deletions demos/samplesCore/parameters.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
var startIndex = 1, endIndex = 3;
</script>

<script id="tmplPeople" type="text/html">
<script id="tmplPeople" type="text/x-jquery-tmpl">
<tr class="${alternate}"><td colspan="3"><a href="${url}">${getName}</a></td></tr>
{{tmpl "#tmplSeparator"}}
{{if getCityCount(startIndex, endIndex)}}
Expand All @@ -88,7 +88,7 @@
{{/if}}
</script>

<script id="tmplSeparator" type="text/html">
<script id="tmplSeparator" type="text/x-jquery-tmpl">
<tr class="${$item.type}separator"><td colspan="3"></td></tr>
</script>

Expand Down
4 changes: 2 additions & 2 deletions demos/samplesTmplPlus/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
});
</script>

<script id="sometmpl" type="text/html">
<script id="sometmpl" type="text/x-jquery-tmpl">
<li>${index($item.array)} of ${$item.array.length}) <a href="${url}">${getName()}</a>
{{if $item.showCities}}
Cities: {{each cities}} ${this} {{/each}}
Expand All @@ -85,7 +85,7 @@
</li>
</script>

<script id="leadingOrTrailingText" type="text/html">
<script id="leadingOrTrailingText" type="text/x-jquery-tmpl">
${firstName} <strong>${lastName}</strong> <br/>
</script>

Expand Down
8 changes: 4 additions & 4 deletions demos/samplesTmplPlus/composition.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,23 @@
});
</script>

<script id="tmplPeople" type="text/html">
<script id="tmplPeople" type="text/x-jquery-tmpl">
{{tmpl "#tmplSeparator"}}
<tr class="${alternate($data, people)}"><td colspan="2"><a href="${url}">${getName}</a></td></tr>
{{if cities}}
{{tmpl(cities) getTemplate("City")}}
{{/if}}
</script>

<script id="tmplSeparator" type="text/html">
<script id="tmplSeparator" type="text/x-jquery-tmpl">
<tr class="separator"><td colspan="2"></td></tr>
</script>

<script id="tmplCitySeparator" type="text/html">
<script id="tmplCitySeparator" type="text/x-jquery-tmpl">
<tr class="citySeparator"><td colspan="2"></td></tr>
</script>

<script id="tmplCity" type="text/html">
<script id="tmplCity" type="text/x-jquery-tmpl">
{{tmpl "#tmplCitySeparator"}}
<tr class="${alternate(this.parent.data, people)}"><td colspan="2"><b><i>City ${cityNumber}:</i></b></td></tr>
<tr class="${alternate(this.parent.data, people)}"><td><b>${name}</b></td><td>${state}</td></tr>
Expand Down
2 changes: 1 addition & 1 deletion demos/samplesTmplPlus/each.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
}
</script>

<script id="tmplPeople" type="text/html">
<script id="tmplPeople" type="text/x-jquery-tmpl">
<tr class="${alternate($data, people)}"><td colspan="2"><a href="${url}">${getName}</a></td></tr>
{{each cities}}
<tr class="cityseparator"><td colspan="2"></td></tr>
Expand Down
4 changes: 2 additions & 2 deletions demos/samplesTmplPlus/parameters.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
var startIndex = 1, endIndex = 3;
</script>

<script id="tmplPeople" type="text/html">
<script id="tmplPeople" type="text/x-jquery-tmpl">
<tr class="${alternate}"><td colspan="3"><a href="${url}">${getName}</a></td></tr>
{{tmpl "#tmplSeparator"}}
{{if getCityCount(startIndex, endIndex)}}
Expand All @@ -88,7 +88,7 @@
{{/if}}
</script>

<script id="tmplSeparator" type="text/html">
<script id="tmplSeparator" type="text/x-jquery-tmpl">
<tr class="${$item.type}separator"><td colspan="3"></td></tr>
</script>

Expand Down
Loading

0 comments on commit 466f1fc

Please sign in to comment.