<!ENTITY staff.main.menu.file.label "File">
<!ENTITY staff.main.menu.file.new.accesskey "N">
<!ENTITY staff.main.menu.file.new.label "New Window">
+<!ENTITY staff.main.menu.file.open.record.windows.horizontal "Tile MARC Records (Horizontal)">
+<!ENTITY staff.main.menu.file.open.record.windows.vertical "Tile MARC Records (Vertical)">
<!ENTITY staff.main.menu.file.new_tab.accesskey "T">
<!ENTITY staff.main.menu.file.new_tab.label "New Tab">
<!ENTITY staff.main.menu.file.portal.label "Home">
return should_test_server;
}
+function tileWindows(urlList, isVertical, winCount, winIndex, aContinue) {
+ if(aContinue == true && tempWindow.closed == false) {
+ //check if window finished openning
+ if(tempWindow.g == undefined || tempWindow.g.menu == undefined) {
+ setTimeout(
+ function() {
+ tileWindows(urlList, isVertical, winCount, winIndex, true);
+ }, 500);
+ return null;
+ }
+ tempWindow = null;
+ }
+ var scrWidth = window.screen.width;
+ var scrHeight = window.screen.height;
+ var placement = '';
+ if (urlList.length > 0) {
+ var url = urlList.shift();
+ //stack windows vertically or horizontally
+ if (isVertical) {
+ var winWidth = scrWidth / winCount;
+ placement = 'screenX=' + winWidth * (winIndex) + ',width=' + winWidth+ ',height=' + scrHeight;
+ } else {
+ var winHeight = scrHeight / winCount;
+ placement = 'screenY=' + winHeight * (winIndex) + ',width=' + scrWidth+ ',height=' + winHeight
+ }
+ tempWindow = xulG.window.open(urls.XUL_MENU_FRAME
+ + '?server=' + window.escape(G.data.server) + '&firstURL=' + window.escape(url),
+ '_blank','chrome,resizable,sizemode="normal",' + placement);
+ tempWindow.xulG = xulG;
+ winIndex++;
+ setTimeout(
+ function() {
+ tileWindows(urlList, isVertical, winCount, winIndex, true);
+ }, 500);
+
+ }
+}
dump('exiting main/main.js\n');
['oncommand'],
function() { obj.close_all_tabs(); }
],
+ 'cmd_open_record_windows_horizontal' : [
+ ['oncommand'],
+ function(event) {
+ var bibURLs = obj.get_opac_record_urls();
+ if(bibURLs && bibURLs.length > 0)
+ {
+ var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
+ getService(Components.interfaces.nsIWindowMediator);
+ wm.getMostRecentWindow('eg_main').tileWindows(bibURLs, false, bibURLs.length, 0, false);
+ } else {
+ alert("No Records to Display");
+ }
+ }
+ ],
+ 'cmd_open_record_windows_vertical' : [
+ ['oncommand'],
+ function(event) {
+ var bibURLs = obj.get_opac_record_urls();
+ if(bibURLs && bibURLs.length > 0)
+ {
+ var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
+ getService(Components.interfaces.nsIWindowMediator);
+ wm.getMostRecentWindow('eg_main').tileWindows(bibURLs, true, bibURLs.length, 0, false);
+ } else {
+ alert("No Records to Display");
+ }
+ }
+ ],
/* Edit Menu */
'cmd_edit_copy_buckets' : [
} catch(E) {
alert('Error in menu.js, render_toolbar_layout('+layout+'): ' + E);
}
+ },
+
+ 'get_opac_record_urls' : function() {
+ var bibURLs = [];
+ var panelCount = this.controller.view.panels.childNodes.length;
+ for (var i = 1; i < panelCount; i++) {
+ var panel = this.controller.view.panels.childNodes[ i ];
+ if (panel
+ && panel.firstChild
+ && panel.firstChild.nodeName == 'iframe'
+ && panel.firstChild.contentWindow
+ )
+ {
+ var cw = panel.firstChild.contentWindow;
+ var iframes = cw.document.getElementsByTagName('iframe');
+
+ if(iframes.length > 0)
+ {
+ for (var y = 0; y < iframes.length; y++) {
+ if(iframes[y].getAttribute('src').match(/^[https|chrome|oils].*/)
+ && iframes[y].contentDocument
+ && iframes[y].contentDocument.getElementsByTagName('browser')[0]
+ && iframes[y].contentDocument.getElementsByTagName('browser')[0].contentWindow
+ && iframes[y].contentDocument.getElementsByTagName('browser')[0].contentWindow.location)
+ {
+ var opac_url = iframes[y].contentDocument.getElementsByTagName('browser')[0].contentWindow.location;
+ opac_url = opac_url.toString();
+ if (opac_url.match(/eg\/opac\/record\/\d+/) || opac_url.match(/\/skin\/default\/xml\/rdetail.xml\?r=\d+/)) {
+ bibURLs.push(urls.XUL_OPAC_WRAPPER + '?opac_url=' + window.escape( opac_url ) + '&show_nav_buttons=false,&default_view=marc_edit');
+ }
+ }
+ }
+ }
+ }
+ }
+ return bibURLs;
}
}
-
dump('exiting main/menu.js\n');
<command id="cmd_close_all_tabs" />
<command id="cmd_shutdown" />
<command id="cmd_portal" />
+ <command id="cmd_open_record_windows_horizontal" />
+ <command id="cmd_open_record_windows_vertical" />
<command id="cmd_edit_copy_buckets" />
<command id="cmd_edit_volume_buckets" />
<menuitem label="&staff.main.menu.file.close_tab.label;" accesskey="&staff.main.menu.file.close_tab.accesskey;" command="cmd_close_tab"/>
<menuitem label="&staff.main.menu.tabs.close;" accesskey="&staff.main.menu.tabs.close.accesskey;" command="cmd_close_all_tabs"/>
<menuitem label="&staff.main.menu.file.close.label;" accesskey="&staff.main.menu.file.close.accesskey;" command="cmd_close_window"/>
+ <menuitem label="&staff.main.menu.file.open.record.windows.vertical;" command="cmd_open_record_windows_vertical"/>
+ <menuitem label="&staff.main.menu.file.open.record.windows.horizontal;" command="cmd_open_record_windows_horizontal"/>
<menuseparator />
<menuitem label="&staff.main.menu.quit;" accesskey="&staff.main.menu.quit.accesskey;" command="cmd_shutdown"/>
</menupopup>
--- /dev/null
+New Feature - MARC Tile Edit Windows
+====================================
+
+.Overview
+New feature which allows MARC edit windows to be viewed side-by-side or above-below.
+
+Added functionality would allow library staff to view multiple MARC records for ease of editing.
+
+The new functionality is for staff client only.
+
+.Feature Access:
+
+The new functionality is accessed via the <File> menu, where two new menu options would be added.
+
+* <Tile MARC record horizontal> would tile all currently viewed MARC records side-by-side.
+* <Tile MARC record vertical> would tile all currently viewed MARC records above-below.
+
+.Code Changes:
+* The following files would be modified:
+* Open-ILS/xul/staff_client/chrome/content/main/main.js
+* Open-ILS/xul/staff_client/chrome/content/main/menu.js
+* Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.js
+* Open-ILS/web/opac/local/en-us/lang.dtd