CojoOS 基于Dojo的Web OS
http://www.satsuns.com/dojo/621.html
基于Dojo的Web OS,提供良好的用户体验,很炫的特效,提供后台数据传输接口。 该项目可用在各个系统上,可让系统界面开发成本大量减少,质量提高!
查看更多内容:SatSun工作室 DOJO
示例代码:
文件类:
dojo.provide("org.cojoos.File"); dojo.require("dijit.Tooltip"); dojo.require("org.cojoos.FileReference"); dojo.require("org.cojoos.FileSummary"); dojo.require("org.cojoos.utils.ColorUtil"); /** * 文件类。 * @author Cory */ dojo.declare( "org.cojoos.File",org.cojoos.FileReference,{ templateString: dojo.cache("org.cojoos","templates/File.html"),baseClass: "cojoosFile",/** * 文件的图标 * @type String */ iconClass: "defaultFileIcon",/** * 文件的摘要。 * @type org.cojoos.FileSummary */ summary: new org.cojoos.FileSummary(),/** * 访问该文件的时间,默认为当前时间 * @type Date */ accesstime: new Date(),/** * 修改该文件的时间,默认为当前时间 * @type Date */ modifiedTime: new Date(),postCreate: function() { this.inherited(arguments); dojo.attr(this.iconMaskNode,{ style: {opacity: 0.5} }); this._setAlign(); },_setAlign: function() { var _t = Math.floor((dojo.marginBox(this.iconContainerNode).h - dojo.marginBox(this.iconNode).h) / 2); dojo.style(this.iconNode,"marginTop",_t + "px"); dojo.style(this.iconMaskNode,_t + "px"); if (!dojo.isIE) { dojo.style(this.iconMaskNode,"marginLeft",Math.floor((dojo.marginBox(this.iconContainerNode).w - dojo.marginBox(this.iconNode).w) / 2) + "px"); } dojo.contentBox(this.nameMaskNode,{w: dojo.contentBox(this.nameNode).w,h: dojo.contentBox(this.nameNode).h}); },/** * 该文件聚焦时触发的事件 * @tags private */ _onFocus: function(/* Event */evt) { dojo.addClass(this.iconMaskNode,"focus"); dojo.addClass(this.nameMaskNode,"focus"); dojo.addClass(this.nameNode,"focus"); dojo.style(this.nameMaskNode,"borderColor",org.cojoos.utils.ColorUtil.invertColor(dojo.style(this.getwindow().containerNode,"backgroundColor").toLowerCase())); this._setNameMaskCurrentHeight(); this.getwindow().set("statusInfo",this.name); this.getwindow().focusedChild = this; this._onHover(); this.onFocus(); },focus: function() { this.domNode.focus(); },/** * 该文件失焦时触发的事件 * @tags private */ _onBlur: function(/* Event */evt) { dojo.removeClass(this.iconMaskNode,"focus"); dojo.removeClass(this.nameMaskNode,"focus"); dojo.removeClass(this.nameNode,"focus"); this._setNameMaskCurrentHeight(); this.getwindow().set("statusInfo",""); this._onUnhover(); this.onBlur(); },_setNameMaskCurrentHeight: function() { dojo.contentBox(this.nameMaskNode,{h: dojo.contentBox(this.nameNode).h}); },_onHover: function() { dijit.showTooltip(this.tooltip || this.name,this.focusNode,["after","before"],true); },_onUnhover: function() { dijit.hidetooltip(this.focusNode); },_onClick: function() { this._onUnhover(); this.onClick(); },_onDblClick: function() {this.onDblClick();} } );