mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-30 22:51:01 +02:00
Implement set window title for each application with a default title field or define an app specific custom get title
This commit is contained in:
@ -804,5 +804,15 @@ app.classes.addressbook = AppJS.extend(
|
|||||||
}, this).sendRequest();
|
}, this).sendRequest();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get title in order to set it as document title
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
getWindowTitle: function()
|
||||||
|
{
|
||||||
|
var widget = this.et2.getWidgetById('n_fn');
|
||||||
|
if(widget) return widget.options.value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -510,5 +510,15 @@ app.classes.infolog = AppJS.extend(
|
|||||||
action_id: typeof action_id.join != "undefined" ? action_id.join(',') : action_id
|
action_id: typeof action_id.join != "undefined" ? action_id.join(',') : action_id
|
||||||
};
|
};
|
||||||
egw.open('','infolog','add',extras);
|
egw.open('','infolog','add',extras);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get title in order to set it as document title
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
getWindowTitle: function()
|
||||||
|
{
|
||||||
|
var widget = this.et2.getWidgetById('info_subject');
|
||||||
|
if(widget) return widget.options.value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -4195,5 +4195,26 @@ app.classes.mail = AppJS.extend(
|
|||||||
clearInterval(this.W_INTERVALS[i]);
|
clearInterval(this.W_INTERVALS[i]);
|
||||||
delete this.W_INTERVALS[i];
|
delete this.W_INTERVALS[i];
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Window title getter function in order to set the window title
|
||||||
|
*
|
||||||
|
* @returns {string} window title
|
||||||
|
*/
|
||||||
|
getWindowTitle: function ()
|
||||||
|
{
|
||||||
|
var widget = {};
|
||||||
|
switch(this.et2._inst.name)
|
||||||
|
{
|
||||||
|
case 'mail.display':
|
||||||
|
widget = this.et2.getWidgetById('mail_displaysubject');
|
||||||
|
if (widget) return widget.options.value;
|
||||||
|
break;
|
||||||
|
case 'mail.compose':
|
||||||
|
widget = this.et2.getWidgetById('subject');
|
||||||
|
if (widget) return widget.get_value();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -141,6 +141,7 @@ var AppJS = Class.extend(
|
|||||||
}
|
}
|
||||||
this.et2 = et2.widgetContainer;
|
this.et2 = et2.widgetContainer;
|
||||||
this._fix_iFrameScrolling();
|
this._fix_iFrameScrolling();
|
||||||
|
if (this.egw.is_popup()) this._set_Window_title();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -729,5 +730,37 @@ var AppJS = Class.extend(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set document title, uses getWindowTitle to get the correct title,
|
||||||
|
* otherwise set it with uniqueID as default title
|
||||||
|
*/
|
||||||
|
_set_Window_title: function ()
|
||||||
|
{
|
||||||
|
var title = this.getWindowTitle();
|
||||||
|
if (title)
|
||||||
|
{
|
||||||
|
document.title = this.et2._inst.uniqueId + ": " + title;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Window title getter function in order to set the window title
|
||||||
|
* this can be overridden on each application app.js file to customize the title value
|
||||||
|
*
|
||||||
|
* @returns {string} window title
|
||||||
|
*/
|
||||||
|
getWindowTitle: function ()
|
||||||
|
{
|
||||||
|
var titleWidget = this.et2.getWidgetById('title');
|
||||||
|
if (titleWidget)
|
||||||
|
{
|
||||||
|
return titleWidget.get_value();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.et2._inst.uniqueId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -117,5 +117,15 @@ app.classes.timesheet = AppJS.extend(
|
|||||||
{
|
{
|
||||||
ts_project.set_blur(_widget.getValue() ? _widget.search.val() : '');
|
ts_project.set_blur(_widget.getValue() ? _widget.search.val() : '');
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get title in order to set it as document title
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
getWindowTitle: function()
|
||||||
|
{
|
||||||
|
var widget = this.et2.getWidgetById('ts_title');
|
||||||
|
if(widget) return widget.options.value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user