Index: branches/unlabeled/unlabeled-1.3.2/core/admin_templates/js/toolbar.js
===================================================================
diff -u -r7014 -r7027
--- branches/unlabeled/unlabeled-1.3.2/core/admin_templates/js/toolbar.js (.../toolbar.js) (revision 7014)
+++ branches/unlabeled/unlabeled-1.3.2/core/admin_templates/js/toolbar.js (.../toolbar.js) (revision 7027)
@@ -4,6 +4,14 @@
this.CheckTitleModule();
this.Alt = RemoveTranslationLink(alt || '');
+ if (this.Alt.match(/(.*)::(.*)/)) {
+ this.Alt = RegExp.$1;
+ this.Label = RegExp.$2
+ }
+ else {
+ this.Label = this.Alt;
+ }
+
if (typeof(onclick) == 'function') {
this.onClick = onclick;
}
@@ -47,17 +55,24 @@
}
ToolBarButton.prototype.GetHTML = function() {
- return '
';
+ var o = '
'
+ return o;
}
-ToolBarButton.prototype.GetToolID = function() {
- return this.Prefix == '' ? 'tool_' + this.Title : 'tool_['+this.Prefix+'][' + this.Title+']'
+ToolBarButton.prototype.GetToolID = function(item) {
+ if (!item) item = 'tool'
+ return this.Prefix == '' ? item+'_' + this.Title : item+'_['+this.Prefix+'][' + this.Title+']'
}
ToolBarButton.prototype.Init = function() {
img = document.getElementById(this.GetToolID());
this.imgObject = img;
+ this.Container = document.getElementById(this.GetToolID('div')) ? document.getElementById(this.GetToolID('div')) : false;
+ this.Container.btn = this;
img.btn = this;
this.SetOnMouseOver();
this.SetOnMouseOut();
@@ -66,24 +81,24 @@
}
ToolBarButton.prototype.SetOnMouseOver = function() {
- this.imgObject.onmouseover = function() {
- this.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '_f2.gif';
+ this.Container.onmouseover = function() {
+ this.btn.imgObject.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '_f2.gif';
};
}
ToolBarButton.prototype.SetOnMouseOut = function() {
- this.imgObject.onmouseout = function() {
- this.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '.gif';
+ this.Container.onmouseout = function() {
+ this.btn.imgObject.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '.gif';
};
}
ToolBarButton.prototype.SetOnClick = function() {
- this.imgObject.onmouseout = function() {
- this.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '.gif';
+ this.Container.onmouseout = function() {
+ this.btn.imgObject.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '.gif';
};
- this.imgObject.inClick = false;
+ this.Container.inClick = false;
if (typeof(this.onClick) != 'function') {
- this.imgObject.onclick = function() {
+ this.Container.onclick = function() {
if (this.inClick) return;
this.inClick = true;
if (eval('typeof('+this.btn.Title+')') == 'function')
@@ -92,7 +107,7 @@
}
}
else {
- this.imgObject.onclick = function() {
+ this.Container.onclick = function() {
if (this.inClick) return;
this.inClick = true;
this.btn.onClick();
@@ -103,7 +118,7 @@
// the following lines are correct, as long as mozilla understands 'pointer', but IE 'hand',
// do not change the order of these lines!
if (is.ie6up || is.gecko) {
- this.imgObject.style.cursor = 'pointer';
+ this.Container.style.cursor = 'pointer';
}
else {
// somehow set cursor hand for IE 5/ 5.5
@@ -114,10 +129,10 @@
ToolBarButton.prototype.Disable = function() {
if ( !this.Enabled ) return;
this.imgObject.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '_f3.gif';
- this.imgObject.onmouseover = null;
- this.imgObject.onmouseout = null;
- this.imgObject.onclick = null;
- this.imgObject.style.cursor = 'default';
+ this.Container.onmouseover = null;
+ this.Container.onmouseout = null;
+ this.Container.onclick = null;
+ this.Container.style.cursor = 'default';
this.Enabled = false;
}
@@ -131,12 +146,12 @@
}
ToolBarButton.prototype.Hide = function() {
- this.imgObject.style.display = 'none';
+ this.Container.style.display = 'none';
this.Hidden = true;
}
ToolBarButton.prototype.Show = function() {
- this.imgObject.style.display = '';
+ this.Container.style.display = '';
this.Hidden = false;
}
@@ -149,7 +164,7 @@
ToolBarSeparator.prototype = new ToolBarButton;
ToolBarSeparator.prototype.GetHTML = function() {
- return '
';
+ return '';
}
ToolBarSeparator.prototype.Init = function() {