|
|
Choosing A Webhost: |
[mb-commits] r7342 - in mb_server/trunk/htdocs: comp comp/layout comp/relea: msg#00231audio.musicbrainz.cvs
Author: keschte Date: 2006-04-27 13:07:10 +0000 (Thu, 27 Apr 2006) New Revision: 7342 Added: mb_server/trunk/htdocs/comp/layout/badarguments mb_server/trunk/htdocs/images/icon/wikidocs.gif mb_server/trunk/htdocs/images/icon/wikidocs.png Modified: mb_server/trunk/htdocs/comp/release/release_begin mb_server/trunk/htdocs/comp/wikitrans mb_server/trunk/htdocs/edit/albumbatch/cancel.html mb_server/trunk/htdocs/edit/albumbatch/done.html mb_server/trunk/htdocs/scripts/collapsereleases.js Log: * added "please help" text and "wiki link" for non-wikidocs pages * release collapse/expand script for releasebatchop * tinkered with more extensive help links from the interface using wikidocs. * re-added the checkbox for releasebatch selections Added: mb_server/trunk/htdocs/comp/layout/badarguments Modified: mb_server/trunk/htdocs/comp/release/release_begin =================================================================== --- mb_server/trunk/htdocs/comp/release/release_begin 2006-04-27 09:38:29 UTC (rev 7341) +++ mb_server/trunk/htdocs/comp/release/release_begin 2006-04-27 13:07:10 UTC (rev 7342) @@ -56,6 +56,8 @@ <td class="batchop" id="batchop::<% $releaseid %>"> <form method="post" action="/edit/albumbatch/done.html"> <div> + + <input type="hidden" id="tagchecked::<% $releaseid %>" value="<% $tagchecked %>" /> <input type="hidden" name="AlbumId<% $releaseid %>" value="<% $tagchecked ? "off" : "on" %>" /> <input type="submit" name="submit" value="<% $tagchecked ? "Remove" : "Select" %>" /> </div> Modified: mb_server/trunk/htdocs/comp/wikitrans =================================================================== --- mb_server/trunk/htdocs/comp/wikitrans 2006-04-27 09:38:29 UTC (rev 7341) +++ mb_server/trunk/htdocs/comp/wikitrans 2006-04-27 13:07:10 UTC (rev 7342) @@ -133,8 +133,12 @@ { $out = qq!<div class="header">\n!; $out .= qq! This page has been copied from our Wiki. \n!; - $out .= qq! The content is <i><b>not official</b></i> \n!; + $out .= qq! The content is <em><strong>not official</strong></em> \n!; $out .= qq! but probably correct and hopefully informative. \n!; + $out .= qq! If you have spotted a spelling error, or want to help \n!; + $out .= qq! writing the documentation, you'll find the editable version \n!; + $out .= qq! of this page on the wiki at <img src="/images/edit.gif" alt="" /><a\n!; + $out .= qq! href="http://wiki.musicbrainz.org/$id">$id</a> \n!; $out .= qq!</div> \n!; $out .= qq!<div class="unofficial"> \n!; $out .= $page; Modified: mb_server/trunk/htdocs/edit/albumbatch/cancel.html =================================================================== --- mb_server/trunk/htdocs/edit/albumbatch/cancel.html 2006-04-27 09:38:29 UTC (rev 7341) +++ mb_server/trunk/htdocs/edit/albumbatch/cancel.html 2006-04-27 13:07:10 UTC (rev 7342) @@ -1,31 +1,32 @@ %# vi: set ts=4 sw=4 ft=mason : <%args> -$url=>"" + $url => "" </%args> -% delete $session{tagged_albums}; +<%perl> -<& /comp/sidebar, title => 'Deselected Tagged Albums' &> + delete $session{tagged_albums}; -<center> - <p class="notice"> - All of your selected albums have been deselected. - </p> -%# TODO feeding any old URL back into the page is a security risk -% if ($url ne '') { - <p> - <a href="<% $url %>">Return to last page</a> - </p> -% } + $m->comp("/comp/sidebar-notitle", pagetitle => "Unselected Releases"); - <br> + $m->comp("/comp/tablebegin", title => "Unselected Releases"); + $m->out("All of your selected releases have been deselected."); - <& /comp/tablebegin, title=>'Search', attrs=>"align=left" &> - <br> - <& /comp/lucenesearch, type=>'artist' &> - <br> - <& /comp/tableend &> + # TODO feeding any old URL back into the page is a security risk + if ($url ne "") + { + $m->out(qq!<br /> !); + $m->out(qq!<form method="get" action="$url">!); + $m->out(qq!<div><input type="submit" value="Return to last page »" /></div>!); + $m->out(qq!</form>!); + } + $m->comp("/comp/tableend"); -</center> -<& /comp/movefocus, "TextSearchForm", "search" &> -<& /comp/footer &> + $m->comp("/comp/tablebegin", title => "Search for an Artist"); + $m->comp("/comp/lucenesearch", type=>'artist'); + $m->comp("/comp/movefocus", "TextSearchForm", "search"); + $m->comp("/comp/tableend"); + + $m->comp("/comp/footer"); + +</%perl> \ No newline at end of file Modified: mb_server/trunk/htdocs/edit/albumbatch/done.html =================================================================== --- mb_server/trunk/htdocs/edit/albumbatch/done.html 2006-04-27 09:38:29 UTC (rev 7341) +++ mb_server/trunk/htdocs/edit/albumbatch/done.html 2006-04-27 13:07:10 UTC (rev 7342) @@ -1,6 +1,6 @@ %# vi: set ts=4 sw=4 ft=mason : <%args> - $reset=>0 + $reset => 0 </%args> <%perl> @@ -81,158 +81,180 @@ %# [ <a href="<% $referer %>">Go back</a> | <a href="/search.html">Search</a> ] + <table class="formstyle" id="releasebatch"> + <tr> + <td colspan="2" class="instructions"> + <ul> + <li> + You have <strong>selected the releases shown below</strong>, + and can now apply one of the <& /comp/linkdoc, "EditType", "EditTypes" &> + listed in this box. + </li> + <li> + Alternatively, You can <strong>select more releases</strong> using + <strong><img src="/images/edit.gif" alt="" /><a href="<% $more_releases_url %>">this link</a></strong> + and return to this page to perform the action on all the other releases as well. + </li> + <li> + If you want to <strong>remove one or more releases</strong> from + this list, deactivate the checkbox in the release title + and click on the "Update" button at the bottom of this page. + </li> + </ul> + </td> + </tr> + <tr class="top"> + <td class="label">Merge:</td> + <td> + Merge all the selected releases into one release, preserving all + <& /comp/linkdoc, "PUID", "PUIDs" &>, <& /comp/linkdoc, "TRM", "TRM IDs" &> + and <& /comp/linkdoc, "DiscID", "Disc IDs" &>. If the target release + you want to merge into is a Various Artists release, use the + Various Artists Merge button, else the Single Artists button. - <table class="formstyle" id="albumbatch"> - <tr> - <td colspan="2" class="instructions"> - <ul> - <li> - You have <strong>selected the releases shown below</strong>, - and can now apply one of the <a href="/doc/EditType">EditTypes</a> - listed in this box. - </li> - <li> - Alternatively, You can <strong><a href="<% $more_releases_url %>"> - select more releases</a></strong> and then return on this - page to perform the action on all the other releases - as well. - </li> - <li> - If you want to <strong>remove one or more releases</strong> from - this list, deactivate the checkbox in the release title - and click on the "Update" button at the bottom of this page. - </li> - </ul> - </td> - </tr> - <tr class="top"> - <td class="label">Merge:</td> - <td> - Merge all the selected releases into one release, preserving all - <a href="/doc/PUID">PUIDs</a>, <a href="/doc/TRM">TRM IDs</a> - and <a href="/doc/DiscID">Disc IDs</a>. If the target release - you want to merge into is a Various Artists album, use the - Various Artists Merge button, else the Single Artists button. - - <table border="0" cellspacing="0" cellpadding="0"> - <tr> - <td> - <form method="post" action="/edit/albumbatch/merge.html"> - <div> + <table border="0" cellspacing="0" cellpadding="0"> + <tr> + <td> + <form method="post" action="/edit/albumbatch/merge.html"> + <div> % for (@releaseids) { - <input type="hidden" name="album" value="<% $_ %>" /> + <input type="hidden" name="album" value="<% $_ %>" /> % } - <input type="hidden" name="mac" value="0" /> - <input type="submit" value="Single Artist »" <% (@releaseObjs < 2) ? ' disabled="disabled"' : "" %> /> - </div> - </form> - </td> - <td> - <form method="post" action="/edit/albumbatch/merge.html"> - <div> + <input type="hidden" name="mac" value="0" /> + <input type="submit" value="Single Artist »" <% (@releaseObjs < 2) ? qq!disabled="disabled"! : "" |n %> /> + </div> + </form> + </td> + <td> + <form method="post" action="/edit/albumbatch/merge.html"> + <div> % for (@releaseids) { - <input type="hidden" name="album" value="<% $_ %>" /> + <input type="hidden" name="album" value="<% $_ %>" /> % } - <input type="hidden" name="mac" value="1" /> - <input type="submit" value="Various Artists »" <% (@releaseObjs < 2) ? ' disabled="disabled"' : "" %> /> - </div> - </form> - </td> - </tr> - </table> + <input type="hidden" name="mac" value="1" /> + <input type="submit" value="Various Artists »" <% (@releaseObjs < 2) ? qq!disabled="disabled"! : "" |n %> /> + </div> + </form> + </td> + </tr> + </table> % if (@releaseObjs < 2) { - <div style="margin: 5px 0px; border: 1px dotted red; padding: 5px"> + <div style="margin: 5px 0px; border: 1px dotted red; padding: 5px"> % $m->out(sprintf qq!<form method="get" action="%s">!, ($artistid ? "/showartist.html" : "/search.html")); + <div> +% $m->out(qq!<input type="hidden" name="artistid" value="$artistid" />!) if ($artistid); + <input type="submit" value="Select More »" /> + You have to select at least two releases for a merge edit. + </div> + </form> + </div> +% } + </td> + </tr> + + <tr class="top"> + <td class="label">Move:</td> + <td> + <form method="post" action="/edit/album/move.html"> <div> -% $m->out(qq!<input type="hidden" name="artistid" value="$artistid" />!) if ($artistid); - <input type="submit" value="Select More »" /> - You have to select at least two releases for a merge edit. +% for (@releaseids) { + <input type="hidden" name="album" value="<% $_ %>" /> +% } + <input type="submit" value="Move »" /> </div> </form> - </div> -% } - </td> - </tr> + </td> + </tr> - <tr class="top"> - <td class="label">Move:</td> - <td> - <form method="post" action="/edit/album/move.html"> - <div> -% for (@releaseids) { - <input type="hidden" name="album" value="<% $_ %>" /> -% } - <input type="submit" value="Move »" /> - </div> - </form> - </td> - </tr> + <tr class="top"> + <td class="label">Remove:</td> + <td> + <form method="post" action="/edit/album/move.html"> + <div> +% for (@releaseids) { + <input type="hidden" name="album" value="<% $_ %>" /> +% } + <input type="submit" value="Remove »" /> + </div> + </form> + </td> + </tr> - <tr class="top"> - <td class="label">Remove:</td> - <td> - <form method="post" action="/edit/album/move.html"> - <div> -% for (@releaseids) { - <input type="hidden" name="album" value="<% $_ %>" /> -% } - <input type="submit" value="Remove »" /> - </div> - </form> - </td> - </tr> + <tr class="top"> + <td class="label">Edit Attributes:</td> + <td> + <form method="post" action="/edit/album/editattributes.html"> + <div> +% for (@releaseids) { + <input type="hidden" name="id" value="<% $_ %>" /> +% } + <input type="hidden" name="untag" value="1" /> + <input type="submit" value="Edit Attributes »" /> + Apply release attributes to all selected releases. + </div> + </form> + </td> + </tr> - <tr class="top"> - <td class="label">Edit Attributes:</td> - <td> - <form method="post" action="/edit/album/editattributes.html"> - <div> -% for (@releaseids) { - <input type="hidden" name="id" value="<% $_ %>" /> -% } - <input type="hidden" name="untag" value="1" /> - <input type="submit" value="Edit Attributes »" /> - Apply release attributes to all selected releases. - </div> - </form> - </td> - </tr> + <tr class="top"> + <td class="label">Edit Language:</td> + <td> + <form method="post" action="/edit/albumlanguage/edit.html"> + <div> +% for (@releaseids) { + <input type="hidden" name="id" value="<% $_ %>" /> +% } + <input type="hidden" name="untag" value="1" /> + <input type="submit" value="Edit Language »" /> + Change the language and/or script of all selected releases. + </div> + </form> + </td> + </tr> - <tr class="top"> - <td class="label">Edit Language:</td> - <td> - <form method="post" action="/edit/albumlanguage/edit.html"> - <div> -% for (@releaseids) { - <input type="hidden" name="id" value="<% $_ %>" /> -% } - <input type="hidden" name="untag" value="1" /> - <input type="submit" value="Edit Language »" /> - Change the language and/or script of all selected releases. - </div> - </form> - </td> - </tr> + <tr class="top"> + <td class="label">Cancel:</td> + <td> + <form method="post" action="/edit/albumbatch/cancel.html"> + <div> + <input type="hidden" name="url" value="<% $referer %>" /> + <input type="submit" name="Submit" value="Cancel »" /> + If you have changed your mind, or want to start over, click + "Cancel" to stop this batch process. + </div> + </form> + </td> + </tr> + </table> + <& /comp/tableend &> - <tr class="top"> - <td class="label">Cancel:</td> - <td> - <form method=releaseObjs action="/edit/albumbatch/cancel.html"> - <div> - <input type="hidden" name="url" value="<% $referer %>" /> - <input type="submit" name="Submit" value="Cancel »" /> - If you have changed your mind, or want to start over, click - "Cancel" to stop this batch process. - </div> - </form> - </td> - </tr> - </table> + <& /comp/tablebegin, title => "With selected Releases, do..." &> + <table> + <tr> + <td style="padding-right: 40px; white-space: nowrap"> + <img src="/images/es/minimize.gif" alt="Maximize all releases" /> + <a href="javascript:; //" onclick="collapsereleases.toggleAll(true); return false;">Maximize all</a></td> + <td style="padding-right: 40px; white-space: nowrap"> + <img src="/images/es/maximize.gif" alt="Minimize all releases" /> + <a href="javascript:; //" onclick="collapsereleases.toggleAll(false); return false;">Minimize all</a></td> + <td style="text-align: right; width: 100%"> + <form method="post" action="/edit/albumbatch/done.html" id="BatchOp"> + <div> + <input type="hidden" name="url" value="<% $referer %>" /> + <input type="hidden" name="reset" value="1" /> +% for my $release (@releaseObjs) { + <input type="hidden" name="AlbumId<% $release->GetId() %>" value="on" /> +% } + </div> + </form> + </td> + </tr> + </table> + <script type="text/javascript" src="/scripts/collapsereleases.js"></script> <& /comp/tableend &> - <%perl> # Sort by artist so that all the artists are sequential @@ -260,19 +282,5 @@ } </%perl> - <form method="post" action="/edit/albumbatch/done.html" id="BatchOp"> - <div> - <script type="text/javascript"> - document.writeln('<input type="submit" name="Submit" value="Update" />'); - </script> - <input type="hidden" name="url" value="<% $referer %>" /> - <input type="hidden" name="reset" value="1" /> -% for my $release (@releaseObjs) { - <input type="hidden" name="AlbumId<% $release->GetId() %>" value="on" /> -% } - </div> - </form> - <script type="text/javascript" src="/scripts/collapsereleases.js"></script> - <& /comp/footer &> Added: mb_server/trunk/htdocs/images/icon/wikidocs.gif Property changes on: mb_server/trunk/htdocs/images/icon/wikidocs.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: mb_server/trunk/htdocs/images/icon/wikidocs.png Property changes on: mb_server/trunk/htdocs/images/icon/wikidocs.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: mb_server/trunk/htdocs/scripts/collapsereleases.js =================================================================== --- mb_server/trunk/htdocs/scripts/collapsereleases.js 2006-04-27 09:38:29 UTC (rev 7341) +++ mb_server/trunk/htdocs/scripts/collapsereleases.js 2006-04-27 13:07:10 UTC (rev 7342) @@ -1,12 +1,19 @@ -function CollapseRelease() { +function CollapseReleases() { // ---------------------------------------------------------------------------- // register class/global id // --------------------------------------------------------------------------- - this.CN = "CollapseRelease"; - this.GID = "collapserelease"; + this.CN = "CollapseReleases"; + this.GID = "collapsereleases"; mb.log.enter(this.CN, "__constructor"); + + this.imgplus = new Image(); + this.imgplus.src = "/images/es/maximize.gif"; + this.imgminus = new Image(); + this.imgminus.src = "/images/es/minimize.gif"; + + /** * */ @@ -17,6 +24,7 @@ var t = list[i]; var id = (t.id || ""); if (id.match(/tracks::\d+/i)) { + // go through all the TR's of the table var rows = mb.ui.getByTag("tr", t); for (var j=0;j<rows.length; j++) { @@ -40,8 +48,10 @@ a.id = id.replace("tracks", "expand"); a.className = "toggle"; a.onfocus = function onfocus(event) { this.blur(); }; - a.onclick = function onclick(event) { collapserelease.toggle(this); }; - + a.onclick = function onclick(event) { + var id = this.id.replace("expand", "tracks"); + collapsereleases.showRelease(id); + }; var img = document.createElement("img"); img.src = "/images/es/maximize.gif"; img.className = "toggle"; @@ -57,35 +67,48 @@ } mb.log.exit(); }; - + + + /** + * + */ + this.toggleAll = function(flag) { + mb.log.enter(this.CN, "setupReleases"); + var list = mb.ui.getByTag("table"); + for (var i=0;i<list.length; i++) { + var t = list[i]; + var id = (t.id || ""); + if (id.match(/tracks::\d+/i)) { + this.showRelease(id, flag); + } + } + }; + + /** * */ - this.toggle = function(el) { - mb.log.enter(this.CN, "toggle"); - if (el) { - var imgplus = new Image(); - imgplus.src = "/images/es/maximize.gif"; - var imgminus = new Image(); - imgminus.src = "/images/es/minimize.gif"; - - var obj, img = el.firstChild; - var display = ""; - if (img.src.match("maximize")) { - img.src = imgminus.src; - display = ""; - } else { - img.src = imgplus.src; - display = "none"; + this.showRelease = function(id, flag) { + mb.log.enter(this.CN, "showRelease"); + var obj, img, t; + + // get reference to image object. + if ((obj = mb.ui.get(id.replace("tracks", "expand"))) != null) { + img = obj.firstChild; + + if (flag == null) { + flag = img.src.match("maximize"); } - if ((obj = mb.ui.get(el.id.replace("expand", "releaselinks"))) != null) { + img.src = flag ? this.imgminus.src : this.imgplus.src; + var display = flag ? "" : "none"; + + if ((obj = mb.ui.get(id.replace("tracks", "releaselinks"))) != null) { obj.style.display = display; } - if ((obj = mb.ui.get(el.id.replace("expand", "releaseevents"))) != null) { + if ((obj = mb.ui.get(id.replace("tracks", "releaseevents"))) != null) { obj.style.display = display; } - var t,tid = el.id.replace("expand", "tracks"); - if ((t = mb.ui.get(tid)) != null) { + if ((t = mb.ui.get(id)) != null) { var rows = mb.ui.getByTag("tr", t); for (var j=0;j<rows.length; j++) { if (rows[j].className.match(/track|discid/i)) { @@ -100,18 +123,79 @@ } mb.log.exit(); }; + + + /** + * This function replaces the "remove" in the release title + * with a checkbox for the BatchOp form. + * + */ + this.setupReleaseBatch = function() { + mb.log.enter(this.CN, "showRelease"); + var obj,list = mb.ui.getByTag("table"); + for (var i=0;i<list.length; i++) { + var t = list[i]; + var id = (t.id || ""); + if (id.match(/tracks::\d+/i)) { + + var tagchecked = false; + if ((obj = mb.ui.get(id.replace("tracks", "tagchecked"))) != null) { + tagchecked = obj.value; + } + if ((obj = mb.ui.get(id.replace("tracks", "batchop"))) != null) { + var releaseid = id.replace("tracks::", ""); + + var input = document.createElement("input"); + input.id = id.replace("tracks", "batchcheckbox"); + input.type = "checkbox"; + input.onchange = function onclick(event) { + var batchOpForm = document.forms.BatchOp; + var releaseid = this.id.replace("batchcheckbox::", ""); + var fieldName = "AlbumId"+releaseid; + if (batchOpForm) { + var value = batchOpForm[fieldName].value; + batchOpForm[fieldName].value = (value == "off" ? "on" : "off"); + } + }; + obj.innerHTML = ""; + obj.appendChild(input); + input.checked = tagchecked; + input.title = tagchecked ? + "Deactivate this checkbox and click Update to unselect this release from the Batch Operations," : + "Activate this checkbox and click Update to select this release for Batch Operations."; + } + } + } + // get BatchOp form, then container element (div) + // inside it, to add the Update button + if ((obj = mb.ui.get("BatchOp")) != null) { + if ((obj = obj.firstChild) != null) { + var input = document.createElement("input"); + input.type = "submit"; + input.name = "submit"; + input.value = "Update"; + obj.appendChild(input); + } + } + }; + // exit constructor mb.log.exit(); } // register class... -var collapserelease = new CollapseRelease(); +var collapsereleases = new CollapseReleases(); mb.registerDOMReadyAction( - new MbEventAction(collapserelease.GID, "setupReleases", "Initialising CollapseRelease") + new MbEventAction(collapsereleases.GID, "setupReleases", "Initialising CollapseReleases") ); +mb.registerDOMReadyAction( + new MbEventAction(collapsereleases.GID, "setupReleaseBatch", "Initialising CollapseReleases") +); + + //toggleRelease(mb.ui.get("expand::82274"));
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [mb-commits] r7341 - mb_server/trunk/htdocs/edit/annotation, root |
|---|---|
| Next by Date: | [mb-commits] r7343 - mb_server/trunk/htdocs/comp, root |
| Previous by Thread: | [mb-commits] r7341 - mb_server/trunk/htdocs/edit/annotation, root |
| Next by Thread: | [mb-commits] r7343 - mb_server/trunk/htdocs/comp, root |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |