From 0b80a3a0251b9906b329c17fbe46dc425529cc2b Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 19 Aug 2005 19:26:30 +0000 Subject: [PATCH 1/1] adding git-svn-id: svn://svn.open-ils.org/ILS/trunk@1680 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/skin/default/css/layout.css | 72 ++++++ Open-ILS/web/opac/skin/default/js/config.js | 105 ++++++++ Open-ILS/web/opac/skin/default/js/mresult.js | 109 ++++++++ .../web/opac/skin/default/js/result_common.js | 241 ++++++++++++++++++ Open-ILS/web/opac/skin/default/js/rresult.js | 49 ++++ .../web/opac/skin/default/js/search_bar.js | 78 ++++++ Open-ILS/web/opac/skin/default/js/sidebar.js | 63 +++++ .../web/opac/skin/default/xml/advanced.xml | 23 ++ .../web/opac/skin/default/xml/altcanvas.xml | 14 + .../web/opac/skin/default/xml/css_common.xml | 27 ++ Open-ILS/web/opac/skin/default/xml/header.xml | 8 + Open-ILS/web/opac/skin/default/xml/index.xml | 22 ++ .../web/opac/skin/default/xml/js_common.xml | 26 ++ Open-ILS/web/opac/skin/default/xml/login.xml | 34 +++ Open-ILS/web/opac/skin/default/xml/logo.xml | 4 + .../web/opac/skin/default/xml/mresult.xml | 23 ++ Open-ILS/web/opac/skin/default/xml/myopac.xml | 21 ++ .../web/opac/skin/default/xml/orgtree.xml | 12 + .../web/opac/skin/default/xml/rdetail.xml | 21 ++ .../opac/skin/default/xml/result_common.xml | 46 ++++ .../opac/skin/default/xml/result_table.xml | 65 +++++ .../web/opac/skin/default/xml/rresult.xml | 23 ++ .../web/opac/skin/default/xml/searchbar.xml | 105 ++++++++ .../web/opac/skin/default/xml/sidebar.xml | 85 ++++++ .../web/opac/theme/default/css/colors.css | 22 ++ 25 files changed, 1298 insertions(+) create mode 100644 Open-ILS/web/opac/skin/default/css/layout.css create mode 100644 Open-ILS/web/opac/skin/default/js/config.js create mode 100644 Open-ILS/web/opac/skin/default/js/mresult.js create mode 100644 Open-ILS/web/opac/skin/default/js/result_common.js create mode 100644 Open-ILS/web/opac/skin/default/js/rresult.js create mode 100644 Open-ILS/web/opac/skin/default/js/search_bar.js create mode 100644 Open-ILS/web/opac/skin/default/js/sidebar.js create mode 100644 Open-ILS/web/opac/skin/default/xml/advanced.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/altcanvas.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/css_common.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/header.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/index.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/js_common.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/login.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/logo.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/mresult.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/myopac.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/orgtree.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/rdetail.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/result_common.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/result_table.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/rresult.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/searchbar.xml create mode 100644 Open-ILS/web/opac/skin/default/xml/sidebar.xml create mode 100644 Open-ILS/web/opac/theme/default/css/colors.css diff --git a/Open-ILS/web/opac/skin/default/css/layout.css b/Open-ILS/web/opac/skin/default/css/layout.css new file mode 100644 index 0000000000..fbece6ea2a --- /dev/null +++ b/Open-ILS/web/opac/skin/default/css/layout.css @@ -0,0 +1,72 @@ +.main_header { width: 100%; } +.space { padding-right:5px; } +.vert_space { padding-top: 82px; width: 100%;} +.right { position:absolute; right: 0px; } +.hide_me {display:none; visibility: hidden;} + +/* ---------------------------------------------------------------------- */ +.canvas { float:right; width: 80%; text-align: left;} +#loading_div { width: 100%;} + +.logo { height: 80px; width: 200px; position: absolute; top: 0px; left: 0px; } + +.org_tree { height: 500px; padding-left: 2px; padding-right: 2px; + overflow:-moz-scrollbars-vertical; overflow-y:scroll; overflow-x:hidden; } + +.org_link { padding-right: 15px; } +#org_link_container { margin-bottom: 5px; padding-left: 4px; padding-bottom: 3px; padding-top: 3px; width: 100%; } + +/* ---------------------------------------------------------------------- */ +.sidebar_div { float: left; width: 19%; } +.side_bar_item { padding-left: 15px; padding-right: 10px; padding-top: 5px; padding-bottom: 5px; } +.sidebar_chunk {margin-bottom: 2px;} +.sidebar_extra_item { padding: 2px; } +.sidebar_header { margin-top: 10px; padding-left: 3px; } + +/* ---------------------------------------------------------------------- */ +#searchbar { position: absolute; text-align: right; top: 2px; right: 3px; } + +.searchbar_item { text-align: center; padding: 3px; } + +.searchbar_tag { text-align: right; + padding-left: 5px; padding-right: 5px; padding-bottom: 3px; } + +#searchbar_main { text-align: right; + padding-top: 2px; padding-bottom: 3px; padding-right: 2px; padding-left: 3px; } + +.searchbar_extra_td { padding-top: 10px; } +#searchbar_table { border-collapse: collapse; } + +/* ---------------------------------------------------------------------- */ +#login_box { width: 60%; padding: 5px;} + +.login_text { margin-left: 8px; } + +/* ---------------------------------------------------------------------- */ +#result_table_div { text-align: left; width: 100%; } + +#search_nav_links { width: 100%; } +#result_info_box { text-align: left; } +#next_prev_links { text-align: right; padding-left: 2px; padding-right: 2px;} +#goto_page_links { text-align: left; padding-left: 2px; padding-right: 2px;} + +#next_prev_links_dead {padding-left: 5px; padding-right: 5px;} + +#res_table { width: 100%; } + +.result_table_pic_cell { width: 43px;} +.result_table_pic { height: 50px; width: 40px; } +.result_table_pic_header { width: 43px; } + +.result_table_row { text-align: left; } +.result_table_subtable { width: 100%; border-collapse: collapse;} +.result_table_subtbody { height: 100%; width: 100%; } +.result_table_title_cell { text-align: left; } + +.copy_count_cell { width: 8%; text-align: center; padding: 0px; margin: 0px;} + +.search_page_nav_link { margin-right: 5px; } + +/* ---------------------------------------------------------------------- */ + + diff --git a/Open-ILS/web/opac/skin/default/js/config.js b/Open-ILS/web/opac/skin/default/js/config.js new file mode 100644 index 0000000000..9f38deba3e --- /dev/null +++ b/Open-ILS/web/opac/skin/default/js/config.js @@ -0,0 +1,105 @@ +/* ---------------------------------------------------------------------------- */ +/* Set up ID's, CSS, etc. */ +/* ---------------------------------------------------------------------------- */ +config.ids.common.top_logo = "top_left_logo"; + +config.css.color_1 = "color_1"; +config.css.color_2 = "color_2"; +config.css.color_3 = "color_3"; + +/* result */ +config.ids.result = {}; +config.css.result = {}; +config.names.result = {}; +config.ids.result.offset_start = "offset_start"; +config.ids.result.offset_end = "offset_end"; +config.ids.result.result_count = "result_count"; +config.ids.result.next_link = 'next_link'; +config.ids.result.prev_link = 'prev_link'; +config.ids.result.home_link = 'search_home_link'; +config.ids.result.end_link = 'end_link'; +config.ids.result.main_table = 'result_table'; +config.ids.result.row_template = 'result_table_template'; +config.ids.result.num_pages = 'num_pages'; +config.ids.result.current_page = 'current_page'; +config.css.result.nav_active = "nav_link_active"; +config.ids.result.top_div = "result_table_div"; +config.ids.result.nav_links = "search_nav_links"; +config.ids.result.info = "result_info_div"; +config.css.result.cc_cell_even = "copy_count_cell_even"; + +config.names.result.item_jacket = "item_jacket"; +config.names.result.item_title = "item_title"; +config.names.result.item_author = "item_author"; +config.names.result.counts_row = "counts_row"; +config.names.result.count_cell = "copy_count_cell"; + +/* login page */ +config.ids.login = {}; +config.css.login = {}; +config.ids.login.box = "login_box"; +config.ids.login.username = "login_username"; +config.ids.login.password = "login_password"; +config.ids.login.button = "login_button"; +config.ids.login.cancel = "login_cancel_button"; + + +/* searchbar ids and css */ +config.ids.searchbar = {}; +config.css.searchbar = {}; +config.ids.searchbar.text = 'search_box'; +config.ids.searchbar.submit = 'search_submit'; +config.ids.searchbar.type_selector = 'search_type_selector'; +config.ids.searchbar.depth_selector = 'depth_selector'; +config.ids.searchbar.form_selector = 'form_selector'; +config.ids.searchbar.extra_row = 'searchbar_extra'; +config.ids.searchbar.main_row = 'searchbar_main_row'; +config.ids.searchbar.table = 'searchbar_table'; +config.ids.searchbar.tag = 'search_tag_link'; +config.ids.searchbar.tag_on = 'searchbar_tag_on'; +config.ids.searchbar.tag_off = 'searchbar_tag_off'; +config.ids.searchbar.location_tag = 'search_location_tag_link'; + + +/* sidebar */ +config.ids.sidebar = {}; +config.css.sidebar = {}; +config.names.sidebar = {}; +config.css.sidebar.item = {}; +config.ids.sidebar.home = 'home_link_div'; +config.ids.sidebar.advanced = 'advanced_link_div'; +config.ids.sidebar.myopac = 'myopac_link_div'; +config.ids.sidebar.prefs = 'prefs_link_div'; +config.ids.sidebar.mresult = 'mresult_link_div'; +config.ids.sidebar.rresult = 'result_link_div'; +config.ids.sidebar.login = 'login_link'; +config.ids.sidebar.logout = 'logout_link'; +config.ids.sidebar.logoutbox = 'logout_link_div'; +config.ids.sidebar.loginbox = 'login_link_div'; +config.ids.sidebar.logged_in_as = 'logged_in_as_div'; +config.ids.sidebar.username_dest = 'username_dest'; +config.ids.sidebar.subject = 'subject_sidebar'; +config.ids.sidebar.subject_item = 'subject_item'; +config.ids.sidebar.author = 'author_sidebar'; +config.ids.sidebar.author_item = 'author_item'; +config.ids.sidebar.series = 'series_sidebar'; +config.ids.sidebar.series_item = 'series_item'; + +config.ids.sidebar.home_link = 'home_link' +config.ids.sidebar.advanced_link = 'advanced_link' +config.ids.sidebar.myopac_link = 'myopac_link' + +config.names.sidebar.subject_item = 'subject_item'; +config.names.sidebar.author_item = 'author_item'; +config.names.sidebar.series_item = 'series_item'; + + +/* ---------------------------------------------------------------------------- */ +/* These are pages that may replace the canvas */ +/* ---------------------------------------------------------------------------- */ +config.ids.altcanvas.login = config.ids.login.box; +config.ids.altcanvas.org_tree = config.ids.common.org_container; + + + + diff --git a/Open-ILS/web/opac/skin/default/js/mresult.js b/Open-ILS/web/opac/skin/default/js/mresult.js new file mode 100644 index 0000000000..e8c28b2f84 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/js/mresult.js @@ -0,0 +1,109 @@ +var records = {}; +var ranks = {}; +var table; +var rowtemplate; +var idsCookie = new cookieObject("ids", 1, "/", COOKIE_IDS); + +G.evt.common.unload.push(mresultUnload); +G.evt.mresult.run.push(mresultDoSearch); +G.evt.mresult.idsReceived.push(mresultSetRecords, mresultCollectRecords); + +function mresultUnload() { removeChildren(table); table = null;} + +function mresultDoSearch() { + + table = G.ui.result.main_table; + + hideMe(G.ui.result.row_template); + while( table.parentNode.rows.length <= getDisplayCount() ) /* add an extra row so IE and safari won't complain */ + hideMe(table.appendChild(G.ui.result.row_template.cloneNode(true))); + + if(getOffset() == 0 || getHitCount() == null ) { + // mresultGetCount(); + mresultCollectIds(FETCH_MRIDS_FULL); + } else { + runEvt('result', 'hitCountReceived'); + mresultCollectIds(FETCH_MRIDS); + } +} + +function mresultGetCount() { + var form = (getForm() == "all") ? null : getForm(); + var req = new Request(FETCH_MRCOUNT, + getStype(), getTerm(), getLocation(), getDepth(), form ); + req.callback(mresultHandleCount); + req.send(); +} + +function mresultHandleCount(r) { + HITCOUNT = parseInt(r.getResultObject()); + runEvt('result', 'hitCountReceived'); +} + + +/* performs the actual search */ +function mresultCollectIds(method) { + + if(getOffset() == 0) { + idsCookie.put(COOKIE_IDS,""); + idsCookie.write(); + + } else { + var c = JSON2js(idsCookie.get(COOKIE_IDS)); + if(c && c.recs) { records = c.recs; ranks = c.ranks; } + } + + if( getOffset() != 0 && + records[getOffset()] != null && + records[resultFinalPageIndex()] != null) { + mresultCollectRecords(); + + } else { + + var req = new Request(method, getStype(), getTerm(), + getLocation(), getDepth(), getDisplayCount() * 10, getOffset(), getForm() ); + req.callback(mresultHandleMRIds); + req.send(); + } +} + +function mresultHandleMRIds(r) { + var res = r.getResultObject(); + + if(res.count != null) { + HITCOUNT = res.count; + runEvt('result', 'hitCountReceived'); + } + runEvt('mresult', 'idsReceived', res.ids); +} + +function mresultSetRecords(idstruct) { + var o = getOffset(); + for( var x = o; x < idstruct.length + o; x++ ) { + if(idstruct[x-o] == null) break; + records[x] = parseInt(idstruct[x - o][0]); + ranks[x] = parseFloat(idstruct[x - o][1]); + } + idsCookie.put(COOKIE_IDS, js2JSON({ recs: records, ranks : ranks }) ); + idsCookie.write(); +} + +function mresultCollectRecords() { + var i = 0; + for( var x = getOffset(); x!= getDisplayCount() + getOffset(); x++ ) { + if(isNull(records[x])) break; + var req = new Request(FETCH_MRMODS, records[x]); + req.request.userdata = i++; + req.callback(mresultHandleMods); + req.send(); + } +} + +function mresultHandleMods(r) { + var rec = r.getResultObject(); + var pagePosition = r.userdata; + runEvt('result', 'recordReceived', rec, pagePosition, true); + resultCollectCopyCounts(rec, pagePosition, FETCH_MR_COPY_COUNTS); +} + + diff --git a/Open-ILS/web/opac/skin/default/js/result_common.js b/Open-ILS/web/opac/skin/default/js/result_common.js new file mode 100644 index 0000000000..c14baf63a0 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/js/result_common.js @@ -0,0 +1,241 @@ +var subjectCache = {}; +var authorCache = {}; +var seriesCache = {}; + +var recordsHandled = 0; +var recordsCache = []; + +/* set up the event handlers */ +G.evt.result.hitCountReceived.push(resultSetHitInfo, resultPaginate); +G.evt.result.recordReceived.push(resultDisplayRecord, resultAddCopyCounts); +G.evt.result.copyCountsReceived.push(resultDisplayCopyCounts); +G.evt.result.allRecordsReceived.push(resultBuildCaches, resultDrawSubjects, resultDrawAuthors, resultDrawSeries); + + +/* returns the last 'index' postion ocurring in this page */ +function resultFinalPageIndex() { + if(getHitCount() < (getOffset() + getDisplayCount())) + return getHitCount() - 1; + return getOffset() + getDisplayCount() - 1; +} + +/* set the search result info, number of hits, which results we're + displaying, links to the next/prev pages, etc. */ +function resultSetHitInfo() { + var c; + if( getDisplayCount() > (getHitCount() - getOffset())) c = getHitCount(); + else c = getDisplayCount() + getOffset(); + + var pages = getHitCount() / getDisplayCount(); + if(pages % 1) pages = parseInt(pages) + 1; + + G.ui.result.current_page.appendChild(text( (getOffset()/getDisplayCount()) + 1)); + G.ui.result.num_pages.appendChild(text(pages + ")")); /* the ) is dumb */ + + G.ui.result.offset_start.appendChild(text(getOffset() + 1)); + G.ui.result.offset_end.appendChild(text(c)); + G.ui.result.result_count.appendChild(text(getHitCount())); + unHideMe(G.ui.result.info); +} + + +function resultPaginate() { + var o = getOffset(); + + if( !((o + getDisplayCount()) >= getHitCount()) ) { + + var args = {}; + args[PARAM_OFFSET] = o + getDisplayCount(); + G.ui.result.next_link.setAttribute("href", buildOPACLink(args)); + addCSSClass(G.ui.result.next_link, config.css.result.nav_active); + + args[PARAM_OFFSET] = getHitCount() - (getHitCount() % getDisplayCount()); + G.ui.result.end_link.setAttribute("href", buildOPACLink(args)); + addCSSClass(G.ui.result.end_link, config.css.result.nav_active); + } + + if( o > 0 ) { + + var args = {}; + args[PARAM_OFFSET] = o - getDisplayCount(); + G.ui.result.prev_link.setAttribute( "href", buildOPACLink(args)); + addCSSClass(G.ui.result.prev_link, config.css.result.nav_active); + + args[PARAM_OFFSET] = 0; + G.ui.result.home_link.setAttribute( "href", buildOPACLink(args)); + addCSSClass(G.ui.result.home_link, config.css.result.nav_active); + } +} + + +/* display the record info in the record display table 'pos' is the + zero based position the record should have in the display table */ +function resultDisplayRecord(rec, pos, is_mr) { + + if(rec == null) rec = new mvr(); /* so the page won't die if there was an error */ + recordsHandled++; + recordsCache.push(rec); + + /* hide the 'now loading...' message */ + hideMe(G.ui.common.loading); + + var r = table.rows[pos]; + + var pic = findNodeByName(r, config.names.result.item_jacket); + pic.setAttribute("src", buildISBNSrc(cleanISBN(rec.isbn()))); + + var title_link = findNodeByName(r, config.names.result.item_title); + var author_link = findNodeByName(r, config.names.result.item_author); + + if( is_mr ) buildTitleLink(rec, title_link); + else buildTitleDetailLink(rec, title_link); + buildSearchLink(STYPE_AUTHOR, rec.author(), author_link); + + findNodeByName(r, "result_table_title_cell").width = + 100 - (orgNodeTrail(findOrgUnit(getLocation())).length * 8) + "%"; + + unHideMe(r); + + if(resultPageIsDone()) + runEvt('result', 'allRecordsReceived', recordsCache); +} + +function resultPageIsDone(pos) { + return (recordsHandled == getDisplayCount() + || recordsHandled + getOffset() == getHitCount()); +} + +/* -------------------------------------------------------------------- */ +/* dynamically add the copy count rows based on the org type 'countsrow' + is the row into which we will add TD's to hold the copy counts + This code generates copy count cells with an id of + 'copy_count_cell__' */ +function resultAddCopyCounts(rec, pagePosition) { + + var r = table.rows[pagePosition]; + var countsrow = findNodeByName(r, config.names.result.counts_row ); + var ccell = findNodeByName(countsrow, config.names.result.count_cell); + + var nodes = orgNodeTrail(findOrgUnit(getLocation())); + var node = nodes[0]; + var type = findOrgType(node.ou_type()); + ccell.id = "copy_count_cell_" + type.depth() + "_" + pagePosition; + ccell.title = type.opac_label(); + addCSSClass(ccell, config.css.result.cc_cell_even); + + var lastcell = ccell; + + if(nodes[1]) { + + var x = 1; + var d = findOrgDepth(nodes[1]); + var d2 = findOrgDepth(nodes[nodes.length -1]); + + for( var i = d; i <= d2 ; i++ ) { + + ccell = ccell.cloneNode(true); + + if((i % 2)) + removeCSSClass(ccell, "copy_count_cell_even"); + else + addCSSClass(ccell, "copy_count_cell_even"); + + var node = nodes[x++]; + var type = findOrgType(node.ou_type()); + + ccell.id = "copy_count_cell_" + type.depth() + "_" + pagePosition; + ccell.title = type.opac_label(); + countsrow.insertBefore(ccell, lastcell); + lastcell = ccell; + } + } +} + +/* collect copy counts for a record using method 'methodName' */ +function resultCollectCopyCounts(rec, pagePosition, methodName) { + if(rec == null || rec.doc_id() == null) return; + var req = new Request(methodName, getLocation(), rec.doc_id() ); + req.request.userdata = [ rec, pagePosition ]; + req.callback(resultHandleCopyCounts); + req.send(); +} + +function resultHandleCopyCounts(r) { + runEvt('result', 'copyCountsReceived', r.userdata[0], r.userdata[1], r.getResultObject()); +} + + +/* display the collected copy counts */ +function resultDisplayCopyCounts(rec, pagePosition, copy_counts) { + if(copy_counts == null || rec == null) return; + var i = 0; + while(copy_counts[i] != null) { + var cell = getId("copy_count_cell_" + i +"_" + pagePosition); + cell.appendChild(text(copy_counts[i].available + " / " + copy_counts[i].count)); + i++; + } +} + + +/* captures extraneous info from each record */ +function resultBuildCaches(records) { + for( var r in records ) { + var rec = records[r]; + for( var s in rec.subject() ) + subjectCache[s] == null ? subjectCache[s] = 1 : subjectCache[s]++; + authorCache[rec.author()] = 1; + for( var s in rec.series() ) seriesCache[rec.series()[s]] = 1; + } +} + + +function resultSortSubjects(a, b) { return -(a.count - b.count); } /* sort in reverse */ +function resultDrawSubjects() { + + var subjs = []; + for( var s in subjectCache ) + subjs.push( { sub : s, count : subjectCache[s] } ); + subjs.sort(resultSortSubjects); + + var ss = []; + for( var s in subjs ) ss.push(subjs[s].sub); + resultDrawSidebarStuff(STYPE_SUBJECT, G.ui.sidebar.subject_item, + config.names.sidebar.subject_item, ss, G.ui.sidebar.subject); +} + +function resultDrawAuthors() { + var auths = new Array(); + for( var s in authorCache ) auths.push(s); + resultDrawSidebarStuff(STYPE_AUTHOR, G.ui.sidebar.author_item, + config.names.sidebar.author_item, auths.sort(), G.ui.sidebar.author); +} + +function resultDrawSeries() { + var sers = new Array(); + for( var s in seriesCache ) sers.push(s); + resultDrawSidebarStuff(STYPE_SERIES, G.ui.sidebar.series_item, + config.names.sidebar.series_item, sers.sort(), G.ui.sidebar.series); +} + +/* search type, template node, href link name, array of text, node to unhide */ +function resultDrawSidebarStuff(stype, node, linkname, items, wrapperNode) { + var parent = node.parentNode; + var template = parent.removeChild(node); + var x = 0; + var newnode = template.cloneNode(true); + var found = false; + for( var i in items ) { + if(isNull(items[i])) continue; + if(x++ > 7) break; + buildSearchLink(stype, items[i], findNodeByName(newnode, linkname), 100); + parent.appendChild(newnode); + newnode = template.cloneNode(true); + found = true; + } + if(found) unHideMe(wrapperNode); +} + + + + + diff --git a/Open-ILS/web/opac/skin/default/js/rresult.js b/Open-ILS/web/opac/skin/default/js/rresult.js new file mode 100644 index 0000000000..a50f3dc469 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/js/rresult.js @@ -0,0 +1,49 @@ +var records = new Array(); +var table; +var rowtemplate; + +function rresultUnload() { removeChildren(table); table = null;} + +G.evt.common.unload.push(rresultUnload); +G.evt.rresult.run.push(rresultDoSearch); +G.evt.rresult.idsReceived.push(rresultCollectRecords); + +function rresultDoSearch() { + table = G.ui.result.main_table; + hideMe(G.ui.result.row_template); + while( table.parentNode.rows.length < getDisplayCount() ) + hideMe(table.appendChild(G.ui.result.row_template.cloneNode(true))); + rresultCollectIds(); +} + +function rresultCollectIds() { + var form = (getForm() == "all") ? null : getForm(); + var req = new Request(FETCH_RIDS, getMrid(), form ); + req.callback( rresultHandleRIds ); + req.send(); +} + +function rresultHandleRIds(r) { + var res = r.getResultObject(); + HITCOUNT = parseInt(res.count); + runEvt('result', 'hitCountReceived'); + runEvt('rresult', 'idsReceived', res.ids); +} + +function rresultCollectRecords(ids) { + var x = 0; + for( var i = getOffset(); i!= getDisplayCount() + getOffset(); i++ ) { + if(ids[i] == null) break; + var req = new Request(FETCH_RMODS, parseInt(ids[i])); + req.callback(rresultHandleMods); + req.request.userdata = x++; + req.send(); + } +} + +function rresultHandleMods(r) { + var rec = r.getResultObject(); + runEvt('result', 'recordReceived', rec, r.userdata, false); + resultCollectCopyCounts(rec, r.userdata, FETCH_R_COPY_COUNTS); +} + diff --git a/Open-ILS/web/opac/skin/default/js/search_bar.js b/Open-ILS/web/opac/skin/default/js/search_bar.js new file mode 100644 index 0000000000..0702fbbec5 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/js/search_bar.js @@ -0,0 +1,78 @@ +var searchBarExpanded = false; +/* our search selector boxes */ +var _ts, _fs, _ds; + + +G.evt.common.init.push(searchBarInit); + + +/* if set by the org selector, this will be the location used the + next time the search is submitted */ +var newSearchLocation; + +function searchBarInit() { + + _ts = G.ui.searchbar.type_selector; + _ds = G.ui.searchbar.depth_selector; + _fs = G.ui.searchbar.form_selector; + + G.ui.searchbar.text.focus(); + G.ui.searchbar.text.onkeydown = + function(evt) {if(userPressedEnter(evt)) searchBarSubmit();}; + + G.ui.searchbar.submit.onclick = searchBarSubmit; + G.ui.searchbar.tag.onclick = searchBarToggle; + + /* set up the selector objects, etc */ + G.ui.searchbar.text.value = (getTerm() != null) ? getTerm() : ""; + setSelector(_ts, getStype()); + setSelector(_ds, getDepth()); + setSelector(_fs, getForm()); + G.ui.searchbar.location_tag.onclick = _opacHandleLocationTagClick; +} + +function _opacHandleLocationTagClick() { + orgTreeSelector.openTo( + (newSearchLocation != null) ? parseInt(newSearchLocation) : getLocation(), true ); + swapCanvas(G.ui.common.org_container); +} + +function updateLoc(location, depth) { + if( location != null ) + newSearchLocation = location; + if( depth != null ) + setSelector(G.ui.searchbar.depth_selector, depth); +} +function searchBarSubmit() { + + var text = G.ui.searchbar.text.value; + if(!text || text == "") return; + + + var args = {}; + args.page = MRESULT; + args[PARAM_OFFSET] = 0; + args[PARAM_TERM] = text; + args[PARAM_STYPE] = _ts.options[_ts.selectedIndex].value; + args[PARAM_LOCATION] = newSearchLocation; + args[PARAM_DEPTH] = parseInt(_ds.options[_ds.selectedIndex].value); + args[PARAM_FORM] = _fs.options[_fs.selectedIndex].value; + + goTo(buildOPACLink(args)); +} + + +function searchBarToggle() { + if(searchBarExpanded) { + hideMe(G.ui.searchbar.extra_row); + hideMe(G.ui.searchbar.tag_on); + unHideMe(G.ui.searchbar.tag_off); + } else { + unHideMe(G.ui.searchbar.extra_row); + hideMe(G.ui.searchbar.tag_off); + unHideMe(G.ui.searchbar.tag_on); + } + searchBarExpanded = !searchBarExpanded; +} + + diff --git a/Open-ILS/web/opac/skin/default/js/sidebar.js b/Open-ILS/web/opac/skin/default/js/sidebar.js new file mode 100644 index 0000000000..dae282ce27 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/js/sidebar.js @@ -0,0 +1,63 @@ +/* set up the colors in the sidebar + Disables/Enables certain components based on various state data */ + +attachEvt("common", "init", initSideBar); +attachEvt("common", "init", setSidebarLinks); + +function initSideBar() { + + for( var p in G.ui.sidebar ) + removeCSSClass(p, config.css.color_2); + + var page = findCurrentPage(); + unHideMe(G.ui.sidebar[page]); + addCSSClass(G.ui.sidebar[page], config.css.color_2); + + /* if we're logged in, show it and replace the Login link with the Logout link */ + if(grabUser()) { + G.ui.sidebar.username_dest.appendChild(text(G.user.usrname())); + unHideMe(G.ui.sidebar.logoutbox); + unHideMe(G.ui.sidebar.logged_in_as); + hideMe(G.ui.sidebar.loginbox); + } + + if(G.ui.sidebar.login) G.ui.sidebar.login.onclick = initLogin; + if(G.ui.sidebar.logout) G.ui.sidebar.logout.onclick = doLogout; + G.ui.common.top_logo.setAttribute("src", buildImageLink(config.images.logo)); +} + +/* sets up the login ui components */ +var loginBoxVisible = false; +function initLogin() { + + var loginDance = function() { + if(doLogin()) { + showCanvas(); + G.ui.sidebar.username_dest.appendChild(text(G.user.usrname())); + unHideMe(G.ui.sidebar.logoutbox); + unHideMe(G.ui.sidebar.logged_in_as); + hideMe(G.ui.sidebar.loginbox); + } + } + + G.ui.login.button.onclick = loginDance; + G.ui.login.username.onkeydown = + function(evt) {if(userPressedEnter(evt)) loginDance();}; + G.ui.login.password.onkeydown = + function(evt) {if(userPressedEnter(evt)) loginDance();}; + + if(loginBoxVisible) { + showCanvas(); + } else { + swapCanvas(G.ui.login.box); + G.ui.login.username.focus(); + } + loginBoxVisible = !loginBoxVisible; + G.ui.login.cancel.onclick = showCanvas; +} + +function setSidebarLinks() { + G.ui.sidebar.home_link.setAttribute("href", buildOPACLink({page:HOME})); + G.ui.sidebar.advanced_link.setAttribute("href", buildOPACLink({page:ADVANCED})); + G.ui.sidebar.myopac_link.setAttribute("href", buildOPACLink({page:MYOPAC}, false, true)); +} diff --git a/Open-ILS/web/opac/skin/default/xml/advanced.xml b/Open-ILS/web/opac/skin/default/xml/advanced.xml new file mode 100644 index 0000000000..9dee9ec926 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/advanced.xml @@ -0,0 +1,23 @@ + + %ent; ] > + + + + + + + Evergreen: Advanced Search + + + + + + +
+ +
Advanced Search Goes Here
+
+ + + diff --git a/Open-ILS/web/opac/skin/default/xml/altcanvas.xml b/Open-ILS/web/opac/skin/default/xml/altcanvas.xml new file mode 100644 index 0000000000..64709c9a9e --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/altcanvas.xml @@ -0,0 +1,14 @@ + + + + +
+ + + + + + + +
diff --git a/Open-ILS/web/opac/skin/default/xml/css_common.xml b/Open-ILS/web/opac/skin/default/xml/css_common.xml new file mode 100644 index 0000000000..6611e27167 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/css_common.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/web/opac/skin/default/xml/header.xml b/Open-ILS/web/opac/skin/default/xml/header.xml new file mode 100644 index 0000000000..2e48e0eb7a --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/header.xml @@ -0,0 +1,8 @@ + + +
+ + +
+ +
diff --git a/Open-ILS/web/opac/skin/default/xml/index.xml b/Open-ILS/web/opac/skin/default/xml/index.xml new file mode 100644 index 0000000000..5efbd2026f --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/index.xml @@ -0,0 +1,22 @@ + + %ent; ] > + + + + + Evergreen: Home + + + + + + + +
+ +
Home is here, show something interesting...
+
+ + + + diff --git a/Open-ILS/web/opac/skin/default/xml/js_common.xml b/Open-ILS/web/opac/skin/default/xml/js_common.xml new file mode 100644 index 0000000000..0d6c420b4c --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/js_common.xml @@ -0,0 +1,26 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ diff --git a/Open-ILS/web/opac/skin/default/xml/login.xml b/Open-ILS/web/opac/skin/default/xml/login.xml new file mode 100644 index 0000000000..6ced600799 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/login.xml @@ -0,0 +1,34 @@ + + %ent; ] > + + +
+ + + +
+ +
+ + +
+ +
+ +
+ + +
+ +
+ + + +
+ + diff --git a/Open-ILS/web/opac/skin/default/xml/logo.xml b/Open-ILS/web/opac/skin/default/xml/logo.xml new file mode 100644 index 0000000000..3ef934960d --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/logo.xml @@ -0,0 +1,4 @@ + +
+ +
diff --git a/Open-ILS/web/opac/skin/default/xml/mresult.xml b/Open-ILS/web/opac/skin/default/xml/mresult.xml new file mode 100644 index 0000000000..e86d496af6 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/mresult.xml @@ -0,0 +1,23 @@ + + %ent; ]> + + + + + Evergreen: Title Groups + + + + + + + + +
+ + +
+ + + diff --git a/Open-ILS/web/opac/skin/default/xml/myopac.xml b/Open-ILS/web/opac/skin/default/xml/myopac.xml new file mode 100644 index 0000000000..accbf01666 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/myopac.xml @@ -0,0 +1,21 @@ + + %ent; ] > + + + + + Evergreen: My OPAC + + + + + + +
+ +
My OPAC Goes Here
+
+ + + diff --git a/Open-ILS/web/opac/skin/default/xml/orgtree.xml b/Open-ILS/web/opac/skin/default/xml/orgtree.xml new file mode 100644 index 0000000000..d01fcdaade --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/orgtree.xml @@ -0,0 +1,12 @@ + + %ent; ]> + + + diff --git a/Open-ILS/web/opac/skin/default/xml/rdetail.xml b/Open-ILS/web/opac/skin/default/xml/rdetail.xml new file mode 100644 index 0000000000..67a3681662 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/rdetail.xml @@ -0,0 +1,21 @@ + + %ent; ] > + + + + + Evergreen: Titles + + + + + + +
+ + +
+ + + diff --git a/Open-ILS/web/opac/skin/default/xml/result_common.xml b/Open-ILS/web/opac/skin/default/xml/result_common.xml new file mode 100644 index 0000000000..755c7aaff7 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/result_common.xml @@ -0,0 +1,46 @@ + + %ent; ] > + +
+ + + + + + + + + + + + + + + + + + +
Loading Results...
+ +
+ + diff --git a/Open-ILS/web/opac/skin/default/xml/result_table.xml b/Open-ILS/web/opac/skin/default/xml/result_table.xml new file mode 100644 index 0000000000..619356c260 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/result_table.xml @@ -0,0 +1,65 @@ + + %ent; ] > + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+
+
+ + diff --git a/Open-ILS/web/opac/skin/default/xml/rresult.xml b/Open-ILS/web/opac/skin/default/xml/rresult.xml new file mode 100644 index 0000000000..fc83b7b50e --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/rresult.xml @@ -0,0 +1,23 @@ + + %ent; ] > + + + + + Evergreen: Titles + + + + + + + + +
+ + +
+ + + diff --git a/Open-ILS/web/opac/skin/default/xml/searchbar.xml b/Open-ILS/web/opac/skin/default/xml/searchbar.xml new file mode 100644 index 0000000000..52e5484546 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/searchbar.xml @@ -0,0 +1,105 @@ + + %ent; ] > + + + + + + + + + + diff --git a/Open-ILS/web/opac/skin/default/xml/sidebar.xml b/Open-ILS/web/opac/skin/default/xml/sidebar.xml new file mode 100644 index 0000000000..0d9edaf506 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/sidebar.xml @@ -0,0 +1,85 @@ + + %ent; ] > + + + + + diff --git a/Open-ILS/web/opac/theme/default/css/colors.css b/Open-ILS/web/opac/theme/default/css/colors.css new file mode 100644 index 0000000000..0bff262d2b --- /dev/null +++ b/Open-ILS/web/opac/theme/default/css/colors.css @@ -0,0 +1,22 @@ +body a { color: black; } +body a:visited { color: black; } +body a:hover { color: red; text-decoration: underline;} + +.color_1 { background: #A7EA9D; color: #000000; } +.color_2 { background: #64EA4F; color: #000000; } +.color_3 { background: #D8B4BE; color: #000000; } + +/* ---------------------------------------------------------------------- */ +.sidebar_chunk {border-right: 1px solid lightgrey;} +.sidebar_extra_link { text-decoration: none; } +#searchbar_tag_on { color: red; } +.searchbar_item { color: black; } +#login_box { border-top: 1px solid #808080; border-bottom: 1px solid #808080; } +#next_prev_links_dead { color: #808080; text-decoration: none; } +.nav_link_active { text-decoration: underline; } +.search_link { text-decoration: none; } +.result_table_subtable { border-top: 1px solid #E0E0E0; } +.copy_count_cell_even { border: 1px solid #E0E0E0; } +/* ---------------------------------------------------------------------- */ + + -- 2.43.2