Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Optionally attach a link to LogoWidget or RepositorySimpleLabel via a…
Browse files Browse the repository at this point in the history
…jxpOptions.
  • Loading branch information
cdujeu committed Nov 13, 2013
1 parent ce0d093 commit bcfed71
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/ajaxplorer.js

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer/class.LogoWidget.js
Expand Up @@ -23,6 +23,36 @@ Class.create("LogoWidget", AjxpPane, {
$super(element, options);
var configs = ajaxplorer.getPluginConfigs("guidriver");
this.updateConfig(configs);
if(options.link){
var linkTitle;
if(options.linkTitle){
if(MessageHash[options.linkTitle]) linkTitle = MessageHash[options.linkTitle];
else linkTitle = options.linkTitle;
}
if(this.image){
if(linkTitle) this.image.writeAttribute("title", linkTitle);
this.image.observe("click", function(){
if(options.linkTarget && options.linkTarget == 'new'){
window.open(options.link);
}else{
document.location.href = options.link;
}
});
this.image.addClassName("linked");
}
if(this.titleDiv){
if(linkTitle) this.titleDiv.writeAttribute("title", linkTitle);
this.titleDiv.observe("click", function(){
if(options.linkTarget && options.linkTarget == 'new'){
window.open(options.link);
}else{
document.location.href = options.link;
}
});
this.titleDiv.addClassName("linked");
}
}

},

updateConfig : function(configs){
Expand Down
Expand Up @@ -33,6 +33,22 @@ Class.create("RepositorySimpleLabel", AjxpPane, {

this.htmlElement.update('<div class="repository_legend">Workspace</div>');
this.htmlElement.insert('<div class="repository_title"></div>');
if(options.link){
var linkTitle;
if(options.linkTitle){
if(MessageHash[options.linkTitle]) linkTitle = MessageHash[options.linkTitle];
else linkTitle = options.linkTitle;
this.htmlElement.down('div.repository_title').writeAttribute("title", linkTitle);
}
this.htmlElement.down("div.repository_title").observe("click", function(){
if(options.linkTarget && options.linkTarget == 'new'){
window.open(options.link);
}else{
document.location.href = options.link;
}
});
this.htmlElement.down("div.repository_title").addClassName("linked");
}
this.observer = function(e){

this.htmlElement.down("div.repository_title").update(this._defaultString);
Expand Down
Expand Up @@ -52,6 +52,10 @@ a:link, a:visited, a:hover, a:active, a:focus {
color: rgb(111, 121, 131);
}

.linked{
cursor: pointer;
}

body, html
{
margin: 0;
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/themes/vision/css/allz.css

Large diffs are not rendered by default.

0 comments on commit bcfed71

Please sign in to comment.