mirror of https://github.com/apache/archiva.git
implements a basic go to anchot mechanism
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1341117 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d58465581a
commit
eac9ee57f1
|
@ -295,11 +295,10 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock
|
|||
url: pomContentUrl,
|
||||
dataType: "text",
|
||||
success: function(data) {
|
||||
$.log("foo");
|
||||
$.log("data:"+data);
|
||||
var text = data.replace(/</g,'<');
|
||||
text=text.replace(/>/g,">");
|
||||
mainContent.find("#artifact-content-text" ).html(text);
|
||||
goToAnchor("artifact-content-text-header");
|
||||
}
|
||||
});
|
||||
return;
|
||||
|
@ -334,6 +333,7 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock
|
|||
var text = data.replace(/</g,'<');
|
||||
text=text.replace(/>/g,">");
|
||||
mainContent.find("#artifact-content-text" ).html(text);
|
||||
goToAnchor("artifact-content-text-header");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -373,6 +373,12 @@ define("utils",["jquery","i18n","jquery.tmpl"], function() {
|
|||
return sorted?res.sort():res;
|
||||
}
|
||||
|
||||
goToAnchor=function(anchor){
|
||||
var curHref = window.location.href;
|
||||
curHref=curHref.substringBeforeLast("#");
|
||||
window.location.href=curHref+"#"+anchor;
|
||||
}
|
||||
|
||||
//------------------------------------
|
||||
// utils javascript string extensions
|
||||
//------------------------------------
|
||||
|
|
|
@ -823,8 +823,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4>Content</h4>
|
||||
<h4 id="artifact-content-text-header">Content</h4>
|
||||
<div>
|
||||
<pre id="artifact-content-text"></pre>
|
||||
<pre><code id="artifact-content-text"></code></pre>
|
||||
</div>
|
||||
</script>
|
Loading…
Reference in New Issue