[open-ils-commits] r1334 - conifer/branches/rel_2_0/web/opac/skin/lul/xml/rdetail (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Apr 12 16:18:56 EDT 2011
Author: dbs
Date: 2011-04-12 16:18:51 -0400 (Tue, 12 Apr 2011)
New Revision: 1334
Modified:
conifer/branches/rel_2_0/web/opac/skin/lul/xml/rdetail/rdetail_summary.xml
Log:
A working rdetail_summary.xml for LUL skin
subjectMe() gets objects with .textContent properties that
BT.textContent() / dojox.data.dom.textContent() doesn't parse;
works fine in the inline implementation in the default skin
though.
Merge in the other 2.0-isms as we go.
Modified: conifer/branches/rel_2_0/web/opac/skin/lul/xml/rdetail/rdetail_summary.xml
===================================================================
--- conifer/branches/rel_2_0/web/opac/skin/lul/xml/rdetail/rdetail_summary.xml 2011-04-12 13:54:03 UTC (rev 1333)
+++ conifer/branches/rel_2_0/web/opac/skin/lul/xml/rdetail/rdetail_summary.xml 2011-04-12 20:18:51 UTC (rev 1334)
@@ -29,7 +29,7 @@
<td nowrap='nowrap' class='rdetail_desc'>&common.title;</td>
<td type='opac/slot-data' query='datafield[tag=245]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- var rdetail_bib_title = dojox.data.dom.textContent(item);
+ var rdetail_bib_title = BT.textContent(item);
var title_node = dojo.query('head title');
dojo.addOnLoad(function() {dojo.place('<title>' + rdetail_bib_title + '</title>', title_node[0], 'replace');});
return '<span>' + rdetail_bib_title + '</span><br/>';
@@ -42,7 +42,7 @@
<td type='opac/slot-data' query='datafield[tag=246] subfield[code=a]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag246').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -51,7 +51,7 @@
<td type='opac/slot-data' query='datafield[tag="247"]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag247').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -67,7 +67,7 @@
<td type='opac/slot-data' query='datafield[tag=100]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag100').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -76,7 +76,7 @@
<td type='opac/slot-data' query='datafield[tag=110]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag110').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -85,7 +85,7 @@
<td type='opac/slot-data' query='datafield[tag=111]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag111').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -94,7 +94,7 @@
<td type='opac/slot-data' query='datafield[tag=020]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag020').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
@@ -104,7 +104,7 @@
<td type='opac/slot-data' query='datafield[tag=022]' class='rdetail_item' id='rdetail_issn'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag022').removeClass('hide_me');
- var issn_raw = dojo.trim(dojox.data.dom.textContent(item));
+ var issn_raw = dojo.trim(BT.textContent(item));
// textContent returns multiple subfields concatenated with linefeeds,
// so our regex needs to match against linefeeds. "." does not match
@@ -142,7 +142,7 @@
<td type='opac/slot-data' query='datafield[tag=250]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag250').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -157,7 +157,7 @@
<td type='opac/slot-data' query='datafield[tag=260]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag260').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -181,7 +181,7 @@
<td type='opac/slot-data' query='datafield[tag=520]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag520').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
@@ -307,7 +307,7 @@
<td type='opac/slot-data' query='datafield[tag=500]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag500').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -316,7 +316,7 @@
<td type='opac/slot-data' query='datafield[tag=505]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag505').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -325,7 +325,7 @@
<td type='opac/slot-data' query='datafield[tag=506] subfield[code=a]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag506').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span> ';
+ return '<span>' + BT.textContent(item) + '</span> ';
]]></script>
</td>
</tr>
@@ -334,7 +334,7 @@
<td type='opac/slot-data' query='datafield[tag=511]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag511').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -346,7 +346,7 @@
var text = '';
var list = dojo.query( 'subfield:not([code=4])', item );
for (var i =0; i < list.length; i++) {
- text += dojox.data.dom.textContent(list[i]) + ' ';
+ text += BT.textContent(list[i]) + ' ';
}
return '<span>' + text + '</span><br/>';
]]></script>
@@ -357,7 +357,7 @@
<td type='opac/slot-data' query='datafield[tag=780]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag780').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -366,7 +366,7 @@
<td type='opac/slot-data' query='datafield[tag=785]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
dojo.query('#tag785').removeClass('hide_me');
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -395,7 +395,66 @@
]]></script>
</td>
</tr>
+ <tr name="serial_holdings_label"
+ class="result_table_title_cell hide_me">
+ <td class="rdetail_desc">&rdetail.summary.issues_held;</td>
+ <td templated="true" type="opac/slot-data"
+ query="datafield[tag='901'] subfield[code='c']"
+ class="rdetail_item">
+ ${holdingsStatement}
+ <span class="hide_me" name="holdingsStatement" type="opac/template-value"><![CDATA[
+ if (fetchOrgSettingDefault(
+ getLocation(),
+ "opac.fully_compressed_serial_holdings"
+ )) {
+ var bibid = BT.textContent(item_list[0]);
+ var blob = fieldmapper.standardRequest(
+ ["open-ils.serial",
+ "open-ils.serial.bib.summary_statements"],
+ [bibid, {
+ "orgid": getLocation(), "depth": getDepth()
+ }]
+ );
+ var fake = dojo.create("td");
+ var something = false;
+
+ for (var i in blob) {
+ if (!blob[i].length) continue;
+ if (something) dojo.create("br", null, fake);
+ something = true;
+
+ var a = dojo.create(
+ "a", {
+ "innerHTML": "[+]",
+ "href": "javascript:void(0);",
+ "onclick":
+ "rdetailDrawExpandedHoldings(this,"+
+ bibid + ",'" + i + "');",
+ "style": {"marginRight": "1.5em"}
+ }, fake
+ );
+ dojo.create(
+ "span", {
+ "innerHTML": blob[i].join(", ")
+ }, fake
+ );
+ dojo.create(
+ "span", {"id": "holding_type_" + i}, fake
+ );
+ }
+
+ if (something)
+ unHideMe(slot.parentNode);
+
+ return fake.innerHTML;
+ } else {
+ return "";
+ }
+ ]]></span>
+ </td>
+ </tr>
+
</tbody>
</table>
@@ -417,34 +476,41 @@
var first_issn = true;
function subjectMe(tag, item) {
- dojo.query(tag).removeClass('hide_me');
+ dojo.query(tag).removeClass('hide_me');
var cgi = new CGI();
var other_params = [ 'd', 'l', 'r', 'av', 's', 'sd' ];
var total = '';
var output = [];
- var list = dojo.query( 'subfield:not([code=2])', item );
- for (var i =0; i < list.length; i++) {
- total += dojox.data.dom.textContent(list[i]) + ' ';
+ dojo.query( 'subfield:not([code=2])', item ).forEach( function (onesub) {
+ var subtext;
+ try {
+ subtext = onesub.textContent;
+ total += subtext + ' ';
+ } catch (e) {
+ return;
+ }
var current = '<a class="search_link" href="rresult.xml?rt=subject&tp=subject&t=' + total;
for (var p in other_params) {
if (cgi.param(other_params[p]))
current += '&' + other_params[p] + '=' + cgi.param(other_params[p]);
}
- current += '">' + dojox.data.dom.textContent(list[i]) + '</a>'
+ current += '">' + subtext + '</a>'
output.push(current);
- }
+ });
return '<span>' + output.join(' -- ') + '</span><br/>';
}
dojo.addOnLoad( function () {
- var here = findOrgUnit(getLocation());
- if (getDepth() > 0 || getDepth === 0 ) {
- while (getDepth() < findOrgDepth(here))
- here = findOrgUnit( here.parent_ou() );
- }
+ setTimeout( function () {
+ var here = findOrgUnit(getLocation());
+ if (getDepth() > 0 || getDepth === 0 ) {
+ while (getDepth() < findOrgDepth(here))
+ here = findOrgUnit( here.parent_ou() );
+ }
- dojo.require('openils.BibTemplate');
- new openils.BibTemplate({ record : new CGI().param('r'), org_unit : here.shortname() }).render();
+ dojo.require('openils.BibTemplate');
+ new openils.BibTemplate({ record : new CGI().param('r'), org_unit : here.shortname() }).render();
+ }, 0);
});
]]></script>
More information about the open-ils-commits
mailing list