From 02b78e06db9831cbf778b66016293057b08011c0 Mon Sep 17 00:00:00 2001 From: Tiago Mello Date: Mon, 28 Nov 2011 23:52:14 +0100 Subject: Bug 687725: Adding a local bug ID in the See Also field isn't logged in the bug history of that bug r/a=LpSolit --- Bugzilla/Bug.pm | 55 +++++++++++++++++++++++---------------- Bugzilla/BugUrl/Bugzilla/Local.pm | 45 ++------------------------------ 2 files changed, 34 insertions(+), 66 deletions(-) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 515fabb90..483a2a865 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -966,6 +966,9 @@ sub update { join(', ', map { $_->name } @$added_see)]; } + $_->update foreach @{ $self->{_update_ref_bugs} || [] }; + delete $self->{_update_ref_bugs}; + # Log bugs_activity items # XXX Eventually, when bugs_activity is able to track the dupe_id, # this code should go below the duplicates-table-updating code below. @@ -2835,7 +2838,7 @@ sub remove_group { } sub add_see_also { - my ($self, $input) = @_; + my ($self, $input, $skip_recursion) = @_; # This is needed by xt/search.t. $input = $input->name if blessed($input); @@ -2851,15 +2854,6 @@ sub add_see_also { $uri = $field_values->{value}; $field_values->{value} = $uri->as_string; - # If this is a link to a local bug then save the - # ref bug id for sending changes email. - if ($class->isa('Bugzilla::BugUrl::Bugzilla::Local')) { - my $ref_bug = $field_values->{ref_bug}; - my $self_url = $class->local_uri($self->id); - push @{ $self->{see_also_changes} }, $ref_bug->id - if !grep { $_->name eq $self_url } @{ $ref_bug->see_also }; - } - # We only add the new URI if it hasn't been added yet. URIs are # case-sensitive, but most of our DBs are case-insensitive, so we do # this check case-insensitively. @@ -2873,13 +2867,22 @@ sub add_see_also { newvalue => $value, privs => $privs }); } - + # If this is a link to a local bug then save the + # ref bug id for sending changes email. + my $ref_bug = delete $field_values->{ref_bug}; + if ($class->isa('Bugzilla::BugUrl::Bugzilla::Local') + and !$skip_recursion) + { + $ref_bug->add_see_also($self->id, 'skip_recursion'); + push @{ $self->{_update_ref_bugs} }, $ref_bug; + push @{ $self->{see_also_changes} }, $ref_bug->id; + } push @{ $self->{see_also} }, bless ($field_values, $class); } } sub remove_see_also { - my ($self, $url) = @_; + my ($self, $url, $skip_recursion) = @_; my $see_also = $self->see_also; # This is needed by xt/search.t. @@ -2887,17 +2890,6 @@ sub remove_see_also { my ($removed_bug_url, $new_see_also) = part { lc($_->name) ne lc($url) } @$see_also; - - # Since we remove also the url from the referenced bug, - # we need to notify changes for that bug too. - $removed_bug_url = $removed_bug_url->[0]; - if ($removed_bug_url - and $removed_bug_url->isa('Bugzilla::BugUrl::Bugzilla::Local') - and defined $removed_bug_url->ref_bug_url) - { - push @{ $self->{see_also_changes} }, - $removed_bug_url->ref_bug_url->bug_id; - } my $privs; my $can = $self->check_can_change_field('see_also', $see_also, $new_see_also, \$privs); @@ -2907,6 +2899,23 @@ sub remove_see_also { privs => $privs }); } + # Since we remove also the url from the referenced bug, + # we need to notify changes for that bug too. + $removed_bug_url = $removed_bug_url->[0]; + if (!$skip_recursion and $removed_bug_url + and $removed_bug_url->isa('Bugzilla::BugUrl::Bugzilla::Local')) + { + my $ref_bug + = Bugzilla::Bug->check($removed_bug_url->ref_bug_url->bug_id); + + if (Bugzilla->user->can_edit_product($ref_bug->product_id)) { + my $self_url = $removed_bug_url->local_uri($self->id); + $ref_bug->remove_see_also($self_url, 'skip_recursion'); + push @{ $self->{_update_ref_bugs} }, $ref_bug; + push @{ $self->{see_also_changes} }, $ref_bug->id; + } + } + $self->{see_also} = $new_see_also || []; } diff --git a/Bugzilla/BugUrl/Bugzilla/Local.pm b/Bugzilla/BugUrl/Bugzilla/Local.pm index bdfae2835..99f944fa6 100644 --- a/Bugzilla/BugUrl/Bugzilla/Local.pm +++ b/Bugzilla/BugUrl/Bugzilla/Local.pm @@ -42,56 +42,15 @@ sub ref_bug_url { if (!exists $self->{ref_bug_url}) { my $ref_bug_id = new URI($self->name)->query_param('id'); + my $ref_bug = Bugzilla::Bug->check($ref_bug_id); my $ref_value = $self->local_uri($self->bug_id); $self->{ref_bug_url} = - new Bugzilla::BugUrl::Bugzilla::Local({ bug_id => $ref_bug_id, + new Bugzilla::BugUrl::Bugzilla::Local({ bug_id => $ref_bug->id, value => $ref_value }); } return $self->{ref_bug_url}; } -sub insert_create_data { - my ($class, $field_values) = @_; - - my $ref_bug = delete $field_values->{ref_bug}; - my $bug_url = $class->SUPER::insert_create_data($field_values); - my $url = $class->local_uri($bug_url->bug_id); - - # Check if the ref bug has already the url and then, - # update the ref bug to point to the current bug. - if (!grep { $_->name eq $url } @{ $ref_bug->see_also }) { - $class->SUPER::insert_create_data({ value => $url, - bug_id => $ref_bug->id, - class => ref($class) || $class }); - } - - return $bug_url; -} - -sub remove_from_db { - my $self = shift; - - my $dbh = Bugzilla->dbh; - my $ref_bug_url = $self->ref_bug_url; - - $dbh->bz_start_transaction(); - - # We remove the current see also first so then we - # avoid infinite loop later. - $self->SUPER::remove_from_db(); - - # We also remove the referenced bug url. - if (defined $ref_bug_url) { - my $ref_bug = Bugzilla::Bug->check($ref_bug_url->bug_id); - my $product = $ref_bug->product_obj; - if (Bugzilla->user->can_edit_product($product->id)) { - $ref_bug_url->remove_from_db(); - } - } - - $dbh->bz_commit_transaction(); -} - sub should_handle { my ($class, $uri) = @_; -- cgit v1.2.3-24-g4f1b From 9a797e23c68dfe509236699264a4d15ea06022f9 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 30 Nov 2011 02:36:42 +0800 Subject: Bug 686422: Fix custom search's history interaction on HTML4 browsers r=mkanat, a=mkanat --- js/custom-search.js | 19 +++++++++++++++++-- js/history.js/license.txt | 10 ++++++++++ js/history.js/native.history.js | 1 + js/history.js/readme.txt | 2 ++ template/en/default/search/boolean-charts.html.tmpl | 6 +++++- 5 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 js/history.js/license.txt create mode 100644 js/history.js/native.history.js create mode 100644 js/history.js/readme.txt diff --git a/js/custom-search.js b/js/custom-search.js index 394e0eb32..0ee7d2488 100644 --- a/js/custom-search.js +++ b/js/custom-search.js @@ -140,14 +140,29 @@ function custom_search_close_paren() { // using the query string, which query.cgi can read to re-create the page // exactly as the user had it before. function fix_query_string(form_member) { - if (!(window.history && window.history.replaceState)) + // window.History comes from history.js. + // It falls back to the normal window.history object for HTML5 browsers. + if (!(window.History && window.History.replaceState)) return; var form = YAHOO.util.Dom.getAncestorByTagName(form_member, 'form'); var query = YAHOO.util.Connect.setForm(form); - window.history.replaceState(null, document.title, '?' + query); + window.History.replaceState(null, document.title, '?' + query); } +// Browsers that do not support HTML5's history.replaceState gain an emulated +// version via history.js, with the full query_string in the location's hash. +// We rewrite the URL to include the hash and redirect to the new location, +// which causes custom search fields to work. +function redirect_html4_browsers() { + var hash = document.location.hash; + if (hash == '') return; + hash = hash.substring(1); + if (hash.substring(0, 10) != 'query.cgi?') return; + var url = document.location + ""; + url = url.substring(0, url.indexOf('query.cgi#')) + hash; + document.location = url; +} function _cs_fix_ids(parent, preserve_values) { // Update the label of the checkbox. diff --git a/js/history.js/license.txt b/js/history.js/license.txt new file mode 100644 index 000000000..719aafc50 --- /dev/null +++ b/js/history.js/license.txt @@ -0,0 +1,10 @@ +Copyright (c) 2011, Benjamin Arthur Lupton +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + • Neither the name of Benjamin Arthur Lupton nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/js/history.js/native.history.js b/js/history.js/native.history.js new file mode 100644 index 000000000..3d341662e --- /dev/null +++ b/js/history.js/native.history.js @@ -0,0 +1 @@ +window.JSON||(window.JSON={}),function(){function f(a){return a<10?"0"+a:a}function quote(a){return escapable.lastIndex=0,escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return typeof b=="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function str(a,b){var c,d,e,f,g=gap,h,i=b[a];i&&typeof i=="object"&&typeof i.toJSON=="function"&&(i=i.toJSON(a)),typeof rep=="function"&&(i=rep.call(b,a,i));switch(typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";gap+=indent,h=[];if(Object.prototype.toString.apply(i)==="[object Array]"){f=i.length;for(c=0;c")&&c[0]);return a>4?a:!1}();return a},m.isInternetExplorer=function(){var a=m.isInternetExplorer.cached=typeof m.isInternetExplorer.cached!="undefined"?m.isInternetExplorer.cached:Boolean(m.getInternetExplorerMajorVersion());return a},m.emulated={pushState:!Boolean(a.history&&a.history.pushState&&a.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(e.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(e.userAgent)),hashChange:Boolean(!("onhashchange"in a||"onhashchange"in d)||m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<8)},m.enabled=!m.emulated.pushState,m.bugs={setHash:Boolean(!m.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),safariPoll:Boolean(!m.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),ieDoubleCheck:Boolean(m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<7)},m.isEmptyObject=function(a){for(var b in a)return!1;return!0},m.cloneObject=function(a){var b,c;return a?(b=k.stringify(a),c=k.parse(b)):c={},c},m.getRootUrl=function(){var a=d.location.protocol+"//"+(d.location.hostname||d.location.host);if(d.location.port||!1)a+=":"+d.location.port;return a+="/",a},m.getBaseHref=function(){var a=d.getElementsByTagName("base"),b=null,c="";return a.length===1&&(b=a[0],c=b.href.replace(/[^\/]+$/,"")),c=c.replace(/\/+$/,""),c&&(c+="/"),c},m.getBaseUrl=function(){var a=m.getBaseHref()||m.getBasePageUrl()||m.getRootUrl();return a},m.getPageUrl=function(){var a=m.getState(!1,!1),b=(a||{}).url||d.location.href,c;return c=b.replace(/\/+$/,"").replace(/[^\/]+$/,function(a,b,c){return/\./.test(a)?a:a+"/"}),c},m.getBasePageUrl=function(){var a=d.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(a,b,c){return/[^\/]$/.test(a)?"":a}).replace(/\/+$/,"")+"/";return a},m.getFullUrl=function(a,b){var c=a,d=a.substring(0,1);return b=typeof b=="undefined"?!0:b,/[a-z]+\:\/\//.test(a)||(d==="/"?c=m.getRootUrl()+a.replace(/^\/+/,""):d==="#"?c=m.getPageUrl().replace(/#.*/,"")+a:d==="?"?c=m.getPageUrl().replace(/[\?#].*/,"")+a:b?c=m.getBaseUrl()+a.replace(/^(\.\/)+/,""):c=m.getBasePageUrl()+a.replace(/^(\.\/)+/,"")),c.replace(/\#$/,"")},m.getShortUrl=function(a){var b=a,c=m.getBaseUrl(),d=m.getRootUrl();return m.emulated.pushState&&(b=b.replace(c,"")),b=b.replace(d,"/"),m.isTraditionalAnchor(b)&&(b="./"+b),b=b.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),b},m.store={},m.idToState=m.idToState||{},m.stateToId=m.stateToId||{},m.urlToId=m.urlToId||{},m.storedStates=m.storedStates||[],m.savedStates=m.savedStates||[],m.normalizeStore=function(){m.store.idToState=m.store.idToState||{},m.store.urlToId=m.store.urlToId||{},m.store.stateToId=m.store.stateToId||{}},m.getState=function(a,b){typeof a=="undefined"&&(a=!0),typeof b=="undefined"&&(b=!0);var c=m.getLastSavedState();return!c&&b&&(c=m.createStateObject()),a&&(c=m.cloneObject(c),c.url=c.cleanUrl||c.url),c},m.getIdByState=function(a){var b=m.extractId(a.url),c;if(!b){c=m.getStateString(a);if(typeof m.stateToId[c]!="undefined")b=m.stateToId[c];else if(typeof m.store.stateToId[c]!="undefined")b=m.store.stateToId[c];else{for(;;){b=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof m.idToState[b]=="undefined"&&typeof m.store.idToState[b]=="undefined")break}m.stateToId[c]=b,m.idToState[b]=a}}return b},m.normalizeState=function(a){var b,c;if(!a||typeof a!="object")a={};if(typeof a.normalized!="undefined")return a;if(!a.data||typeof a.data!="object")a.data={};b={},b.normalized=!0,b.title=a.title||"",b.url=m.getFullUrl(m.unescapeString(a.url||d.location.href)),b.hash=m.getShortUrl(b.url),b.data=m.cloneObject(a.data),b.id=m.getIdByState(b),b.cleanUrl=b.url.replace(/\??\&_suid.*/,""),b.url=b.cleanUrl,c=!m.isEmptyObject(b.data);if(b.title||c)b.hash=m.getShortUrl(b.url).replace(/\??\&_suid.*/,""),/\?/.test(b.hash)||(b.hash+="?"),b.hash+="&_suid="+b.id;return b.hashedUrl=m.getFullUrl(b.hash),(m.emulated.pushState||m.bugs.safariPoll)&&m.hasUrlDuplicate(b)&&(b.url=b.hashedUrl),b},m.createStateObject=function(a,b,c){var d={data:a,title:b,url:c};return d=m.normalizeState(d),d},m.getStateById=function(a){a=String(a);var c=m.idToState[a]||m.store.idToState[a]||b;return c},m.getStateString=function(a){var b,c,d;return b=m.normalizeState(a),c={data:b.data,title:a.title,url:a.url},d=k.stringify(c),d},m.getStateId=function(a){var b,c;return b=m.normalizeState(a),c=b.id,c},m.getHashByState=function(a){var b,c;return b=m.normalizeState(a),c=b.hash,c},m.extractId=function(a){var b,c,d;return c=/(.*)\&_suid=([0-9]+)$/.exec(a),d=c?c[1]||a:a,b=c?String(c[2]||""):"",b||!1},m.isTraditionalAnchor=function(a){var b=!/[\/\?\.]/.test(a);return b},m.extractState=function(a,b){var c=null,d,e;return b=b||!1,d=m.extractId(a),d&&(c=m.getStateById(d)),c||(e=m.getFullUrl(a),d=m.getIdByUrl(e)||!1,d&&(c=m.getStateById(d)),!c&&b&&!m.isTraditionalAnchor(a)&&(c=m.createStateObject(null,null,e))),c},m.getIdByUrl=function(a){var c=m.urlToId[a]||m.store.urlToId[a]||b;return c},m.getLastSavedState=function(){return m.savedStates[m.savedStates.length-1]||b},m.getLastStoredState=function(){return m.storedStates[m.storedStates.length-1]||b},m.hasUrlDuplicate=function(a){var b=!1,c;return c=m.extractState(a.url),b=c&&c.id!==a.id,b},m.storeState=function(a){return m.urlToId[a.url]=a.id,m.storedStates.push(m.cloneObject(a)),a},m.isLastSavedState=function(a){var b=!1,c,d,e;return m.savedStates.length&&(c=a.id,d=m.getLastSavedState(),e=d.id,b=c===e),b},m.saveState=function(a){return m.isLastSavedState(a)?!1:(m.savedStates.push(m.cloneObject(a)),!0)},m.getStateByIndex=function(a){var b=null;return typeof a=="undefined"?b=m.savedStates[m.savedStates.length-1]:a<0?b=m.savedStates[m.savedStates.length+a]:b=m.savedStates[a],b},m.getHash=function(){var a=m.unescapeHash(d.location.hash);return a},m.unescapeString=function(b){var c=b,d;for(;;){d=a.unescape(c);if(d===c)break;c=d}return c},m.unescapeHash=function(a){var b=m.normalizeHash(a);return b=m.unescapeString(b),b},m.normalizeHash=function(a){var b=a.replace(/[^#]*#/,"").replace(/#.*/,"");return b},m.setHash=function(a,b){var c,e,f;return b!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.setHash,args:arguments,queue:b}),!1):(c=m.escapeHash(a),m.busy(!0),e=m.extractState(a,!0),e&&!m.emulated.pushState?m.pushState(e.data,e.title,e.url,!1):d.location.hash!==c&&(m.bugs.setHash?(f=m.getPageUrl(),m.pushState(null,null,f+"#"+c,!1)):d.location.hash=c),m)},m.escapeHash=function(b){var c=m.normalizeHash(b);return c=a.escape(c),m.bugs.hashEscape||(c=c.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),c},m.getHashByUrl=function(a){var b=String(a).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return b=m.unescapeHash(b),b},m.setTitle=function(a){var b=a.title,c;b||(c=m.getStateByIndex(0),c&&c.url===a.url&&(b=c.title||m.options.initialTitle));try{d.getElementsByTagName("title")[0].innerHTML=b.replace("<","<").replace(">",">").replace(" & "," & ")}catch(e){}return d.title=b,m},m.queues=[],m.busy=function(a){typeof a!="undefined"?m.busy.flag=a:typeof m.busy.flag=="undefined"&&(m.busy.flag=!1);if(!m.busy.flag){h(m.busy.timeout);var b=function(){var a,c,d;if(m.busy.flag)return;for(a=m.queues.length-1;a>=0;--a){c=m.queues[a];if(c.length===0)continue;d=c.shift(),m.fireQueueItem(d),m.busy.timeout=g(b,m.options.busyDelay)}};m.busy.timeout=g(b,m.options.busyDelay)}return m.busy.flag},m.busy.flag=!1,m.fireQueueItem=function(a){return a.callback.apply(a.scope||m,a.args||[])},m.pushQueue=function(a){return m.queues[a.queue||0]=m.queues[a.queue||0]||[],m.queues[a.queue||0].push(a),m},m.queue=function(a,b){return typeof a=="function"&&(a={callback:a}),typeof b!="undefined"&&(a.queue=b),m.busy()?m.pushQueue(a):m.fireQueueItem(a),m},m.clearQueue=function(){return m.busy.flag=!1,m.queues=[],m},m.stateChanged=!1,m.doubleChecker=!1,m.doubleCheckComplete=function(){return m.stateChanged=!0,m.doubleCheckClear(),m},m.doubleCheckClear=function(){return m.doubleChecker&&(h(m.doubleChecker),m.doubleChecker=!1),m},m.doubleCheck=function(a){return m.stateChanged=!1,m.doubleCheckClear(),m.bugs.ieDoubleCheck&&(m.doubleChecker=g(function(){return m.doubleCheckClear(),m.stateChanged||a(),!0},m.options.doubleCheckInterval)),m},m.safariStatePoll=function(){var b=m.extractState(d.location.href),c;if(!m.isLastSavedState(b))c=b;else return;return c||(c=m.createStateObject()),m.Adapter.trigger(a,"popstate"),m},m.back=function(a){return a!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.back,args:arguments,queue:a}),!1):(m.busy(!0),m.doubleCheck(function(){m.back(!1)}),n.go(-1),!0)},m.forward=function(a){return a!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.forward,args:arguments,queue:a}),!1):(m.busy(!0),m.doubleCheck(function(){m.forward(!1)}),n.go(1),!0)},m.go=function(a,b){var c;if(a>0)for(c=1;c<=a;++c)m.forward(b);else{if(!(a<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(c=-1;c>=a;--c)m.back(b)}return m};if(m.emulated.pushState){var o=function(){};m.pushState=m.pushState||o,m.replaceState=m.replaceState||o}else m.onPopState=function(b,c){var e=!1,f=!1,g,h;return m.doubleCheckComplete(),g=m.getHash(),g?(h=m.extractState(g||d.location.href,!0),h?m.replaceState(h.data,h.title,h.url,!1):(m.Adapter.trigger(a,"anchorchange"),m.busy(!1)),m.expectedStateId=!1,!1):(e=m.Adapter.extractEventData("state",b,c)||!1,e?f=m.getStateById(e):m.expectedStateId?f=m.getStateById(m.expectedStateId):f=m.extractState(d.location.href),f||(f=m.createStateObject(null,null,d.location.href)),m.expectedStateId=!1,m.isLastSavedState(f)?(m.busy(!1),!1):(m.storeState(f),m.saveState(f),m.setTitle(f),m.Adapter.trigger(a,"statechange"),m.busy(!1),!0))},m.Adapter.bind(a,"popstate",m.onPopState),m.pushState=function(b,c,d,e){if(m.getHashByUrl(d)&&m.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&m.busy())return m.pushQueue({scope:m,callback:m.pushState,args:arguments,queue:e}),!1;m.busy(!0);var f=m.createStateObject(b,c,d);return m.isLastSavedState(f)?m.busy(!1):(m.storeState(f),m.expectedStateId=f.id,n.pushState(f.id,f.title,f.url),m.Adapter.trigger(a,"popstate")),!0},m.replaceState=function(b,c,d,e){if(m.getHashByUrl(d)&&m.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&m.busy())return m.pushQueue({scope:m,callback:m.replaceState,args:arguments,queue:e}),!1;m.busy(!0);var f=m.createStateObject(b,c,d);return m.isLastSavedState(f)?m.busy(!1):(m.storeState(f),m.expectedStateId=f.id,n.replaceState(f.id,f.title,f.url),m.Adapter.trigger(a,"popstate")),!0};if(f){try{m.store=k.parse(f.getItem("History.store"))||{}}catch(p){m.store={}}m.normalizeStore()}else m.store={},m.normalizeStore();m.Adapter.bind(a,"beforeunload",m.clearAllIntervals),m.Adapter.bind(a,"unload",m.clearAllIntervals),m.saveState(m.storeState(m.extractState(d.location.href,!0))),f&&(m.onUnload=function(){var a,b;try{a=k.parse(f.getItem("History.store"))||{}}catch(c){a={}}a.idToState=a.idToState||{},a.urlToId=a.urlToId||{},a.stateToId=a.stateToId||{};for(b in m.idToState){if(!m.idToState.hasOwnProperty(b))continue;a.idToState[b]=m.idToState[b]}for(b in m.urlToId){if(!m.urlToId.hasOwnProperty(b))continue;a.urlToId[b]=m.urlToId[b]}for(b in m.stateToId){if(!m.stateToId.hasOwnProperty(b))continue;a.stateToId[b]=m.stateToId[b]}m.store=a,m.normalizeStore(),f.setItem("History.store",k.stringify(a))},m.intervalList.push(i(m.onUnload,m.options.storeInterval)),m.Adapter.bind(a,"beforeunload",m.onUnload),m.Adapter.bind(a,"unload",m.onUnload));if(!m.emulated.pushState){m.bugs.safariPoll&&m.intervalList.push(i(m.safariStatePoll,m.options.safariPollInterval));if(e.vendor==="Apple Computer, Inc."||(e.appCodeName||"")==="Mozilla")m.Adapter.bind(a,"hashchange",function(){m.Adapter.trigger(a,"popstate")}),m.getHash()&&m.Adapter.onDomLoad(function(){m.Adapter.trigger(a,"hashchange")})}},m.init()}(window) \ No newline at end of file diff --git a/js/history.js/readme.txt b/js/history.js/readme.txt new file mode 100644 index 000000000..1288d07b1 --- /dev/null +++ b/js/history.js/readme.txt @@ -0,0 +1,2 @@ +History.js (v1.7.1 - October 4 2011) +http://github.com/balupton/history.js diff --git a/template/en/default/search/boolean-charts.html.tmpl b/template/en/default/search/boolean-charts.html.tmpl index b5ff90908..878589cea 100644 --- a/template/en/default/search/boolean-charts.html.tmpl +++ b/template/en/default/search/boolean-charts.html.tmpl @@ -74,7 +74,11 @@ TUI_alternates['custom_search_advanced'] = "Show Advanced Features"; TUI_hide_default('custom_search_advanced'); - + + + -- cgit v1.2.3-24-g4f1b From e4e7ef0a8252330798afacb2901388a055607880 Mon Sep 17 00:00:00 2001 From: Tiago Mello Date: Tue, 29 Nov 2011 18:02:39 -0200 Subject: Bug 686971: Fix add_see_also to ignore empty values r/a=LpSolit --- Bugzilla/Bug.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 483a2a865..c2899f669 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -2844,6 +2844,7 @@ sub add_see_also { $input = $input->name if blessed($input); $input = trim($input); + return if !$input; my ($class, $uri) = Bugzilla::BugUrl->class_for($input); -- cgit v1.2.3-24-g4f1b From f22bf7ffb8217525a17ec3e1414fa642047f8584 Mon Sep 17 00:00:00 2001 From: Marc Schumann Date: Tue, 29 Nov 2011 22:17:34 +0100 Subject: Bug 692737 - Main page icons are not centered. r/a=mkanat --- skins/standard/index.css | 29 +++++++++++++++++---------- template/en/default/index.html.tmpl | 40 ++++++++++++++++++++++--------------- 2 files changed, 42 insertions(+), 27 deletions(-) diff --git a/skins/standard/index.css b/skins/standard/index.css index 1b28dabd8..1e440cb99 100644 --- a/skins/standard/index.css +++ b/skins/standard/index.css @@ -26,7 +26,6 @@ easier on customizers. */ .intro, .outro { text-align: center; - width: 20em; } /* Hide from NN4 */ @@ -49,24 +48,32 @@ { font-weight: bold; } - + .bz_common_actions { - display: block; + text-align: center; + } + .bz_common_actions ul { + list-style-type: none; + padding: 0; + } + .bz_common_actions ul li { + display: inline; + vertical-align: top; + } + .bz_common_actions ul li a { + display: inline-block; height: 170px; width: 145px; - float: left; margin: 0 2ex 2em 0; - text-align: center; } - .bz_common_actions span { + .bz_common_actions ul li a span { position: relative; - top: 95%; + top: 90%; font-weight: bold; } - .bz_common_actions, - .bz_common_actions:visited, - .bz_common_actions:hover - { + .bz_common_actions a, + .bz_common_actions a:visited, + .bz_common_actions a:hover { text-decoration: none; } #enter_bug { background: url(index/file-a-bug.png) no-repeat; } diff --git a/template/en/default/index.html.tmpl b/template/en/default/index.html.tmpl index 98648e25e..5b9237aa1 100644 --- a/template/en/default/index.html.tmpl +++ b/template/en/default/index.html.tmpl @@ -125,22 +125,30 @@ YAHOO.util.Event.onDOMReady(onLoadActions);

Welcome to [% terms.Bugzilla %]

[% Hook.process('intro') %]
- File [% terms.aBug %] - - Search - - User Preferences - [% ELSIF Param('createemailregexp') - && user.authorizer.user_can_create_account - %] - href="createaccount.cgi">Open a New Account - [% ELSE %] - href="?GoAheadAndLogIn=1">Log In - [% END %] + +
+
    +
  • + File + [%= terms.aBug %] +
  • +
  • + Search +
  • +
  • + User Preferences + [% ELSIF Param('createemailregexp') + && user.authorizer.user_can_create_account + %] + href="createaccount.cgi">Open a New Account + [% ELSE %] + href="?GoAheadAndLogIn=1">Log In + [% END %] +
  • +
+
-- cgit v1.2.3-24-g4f1b