/**
*
* Copyright 2005 Sabre Airline Solutions
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
**/
//-------------------- rico.js
var Rico = {
Version: '1.1-beta2'
}
Rico.ArrayExtensions = new Array();
if (Object.prototype.extend) {
// in prototype.js...
Rico.ArrayExtensions[ Rico.ArrayExtensions.length ] = Object.prototype.extend;
}
if (Array.prototype.push) {
// in prototype.js...
Rico.ArrayExtensions[ Rico.ArrayExtensions.length ] = Array.prototype.push;
}
if (!Array.prototype.remove) {
Array.prototype.remove = function(dx) {
if( isNaN(dx) || dx > this.length )
return false;
for( var i=0,n=0; i<this.length; i++ )
if( i != dx )
this[n++]=this[i];
this.length-=1;
};
Rico.ArrayExtensions[ Rico.ArrayExtensions.length ] = Array.prototype.remove;
}
if (!Array.prototype.removeItem) {
Array.prototype.removeItem = function(item) {
for ( var i = 0 ; i < this.length ; i++ )
if ( this[i] == item ) {
this.remove(i);
break;
}
};
Rico.ArrayExtensions[ Rico.ArrayExtensions.length ] = Array.prototype.removeItem;
}
if (!Array.prototype.indices) {
Array.prototype.indices = function() {
var indexArray = new Array();
for ( index in this ) {
var ignoreThis = false;
for ( var i = 0 ; i < Rico.ArrayExtensions.length ; i++ ) {
if ( this[index] == Rico.ArrayExtensions[i] ) {
ignoreThis = true;
break;
}
}
if ( !ignoreThis )
indexArray[ indexArray.length ] = index;
}
return indexArray;
}
Rico.ArrayExtensions[ Rico.ArrayExtensions.length ] = Array.prototype.indices;
}
// Create the loadXML method and xml getter for Mozilla
if ( window.DOMParser &&
window.XMLSerializer &&
window.Node && Node.prototype && Node.prototype.__defineGetter__ ) {
if (!Document.prototype.loadXML) {
Document.prototype.loadXML = function (s) {
var doc2 = (new DOMParser()).parseFromString(s, "text/xml");
while (this.hasChildNodes())
this.removeChild(this.lastChild);
for (var i = 0; i < doc2.childNodes.length; i++) {
this.appendChild(this.importNode(doc2.childNodes[i], true));
}
};
}
Document.prototype.__defineGetter__( "xml",
function () {
return (new XMLSerializer()).serializeToString(this);
}
);
}
document.getElementsByTagAndClassName = function(tagName, className) {
if ( tagName == null )
tagName = '*';
var children = document.getElementsByTagName(tagName) || document.all;
var elements = new Array();
if ( className == null )
return children;
for (var i = 0; i < children.length; i++) {
var child = children[i];
var classNames = child.className.split(' ');
for (var j = 0; j < classNames.length; j++) {
if (classNames[j] == className) {
elements.push(child);
break;
}
}
}
return elements;
}
//-------------------- ricoAccordion.js
Rico.Accordion = Class.create();
Rico.Accordion.prototype = {
initialize: function(container, options) {
this.container = $(container);
this.lastExpandedTab = null;
this.accordionTabs = new Array();
this.setOptions(options);
this._attachBehaviors();
this.container.style.borderBottom = '1px solid ' + this.options.borderColor;
// set the initial visual state...
for ( var i=1 ; i < this.accordionTabs.length ; i++ )
{
this.accordionTabs[i].collapse();
this.accordionTabs[i].content.style.display = 'none';
}
this.lastExpandedTab = this.accordionTabs[0];
this.lastExpandedTab.content.style.height = this.options.panelHeight + "px";
this.lastExpandedTab.showExpanded();
this.lastExpandedTab.titleBar.style.fontWeight = this.options.expandedFontWeight;
},
setOptions: function(options) {
this.options = {
expandedBg : '#63699c',
hoverBg : '#63699c',
collapsedBg : '#6b79a5',
expandedTextColor : '#ffffff',
expandedFontWeight : 'bold',
hoverTextColor : '#ffffff',
collapsedTextColor : '#ced7ef',
collapsedFontWeight : 'normal',
hoverTextColor : '#ffffff',
borderColor : '#1f669b',
panelHeight : 200,
onHideTab : null,
onShowTab : null
}.extend(options || {});
},
showTabByIndex: function( anIndex, animate ) {
var doAnimate = arguments.length == 1 ? true : animate;
this.showTab( this.accordionTabs[anIndex], doAnimate );
},
showTab: function( accordionTab, animate ) {
var doAnimate = arguments.length == 1 ? true : animate;
if ( this.options.onHideTab )
this.options.onHideTab(this.lastExpandedTab);
this.lastExpandedTab.showCollapsed();
var accordion = this;
var lastExpandedTab = this.lastExpandedTab;
this.lastExpandedTab.content.style.height = (this.options.panelHeight - 1) + 'px';
accordionTab.content.style.display = '';
accordionTab.titleBar.style.fontWeight = this.options.expandedFontWeight;
if ( doAnimate ) {
new Effect.AccordionSize( this.lastExpandedTab.content,
accordionTab.content,
1,
this.options.panelHeight,
100, 10,
{ complete: function() {accordion.showTabDone(lastExpandedTab)} } );
this.lastExpandedTab = accordionTab;
}
else {
this.lastExpandedTab.content.style.height = "1px";
accordionTab.content.style.height = this.options.panelHeight + "px";
this.lastExpandedTab = accordionTab;
this.showTabDone(lastExpandedTab);
}
},
showTabDone: function(collapsedTab) {
collapsedTab.content.style.display = 'none';
this.lastExpandedTab.showExpanded();
if ( this.options.onShowTab )
this.options.onShowTab(this.lastExpandedTab);
},
_attachBehaviors: function() {
var panels = this._getDirectChildrenByTag(this.container, 'DIV');
for ( var i = 0 ; i < panels.length ; i++ ) {
var tabChildren = this._getDirectChildrenByTag(panels[i],'DIV');
if ( tabChildren.length != 2 )
continue; // unexpected
var tabTitleBar = tabChildren[0];
var tabContentBox = tabChildren[1];
this.accordionTabs.push( new Rico.Accordion.Tab(this,tabTitleBar,tabContentBox) );
}
},
_getDirectChildrenByTag: function(e, tagName) {
var kids = new Array();
var allKids = e.childNodes;
for( var i = 0 ; i < allKids.length ; i++ )
if ( allKids[i] && allKids[i].tagName && allKids[i].tagName == tagName )
kids.push(allKids[i]);
return kids;
}
};
Rico.Accordion.Tab = Class.create();
Rico.Accordion.Tab.prototype = {
initialize: function(accordion, titleBar, content) {
this.accordion = accordion;
this.titleBar = titleBar;
this.content = content;
this._attachBehaviors();
},
collapse: function() {
this.showCollapsed();
this.content.style.height = "1px";
},
showCollapsed: function() {
this.expa
没有合适的资源?快使用搜索试试~ 我知道了~
经典读物《Grails入门指南》全书所有示例的完整源代码
共1073个文件
gif:480个
js:143个
groovy:119个
需积分: 3 17 下载量 86 浏览量
2009-05-17
10:40:29
上传
评论
收藏 15.57MB ZIP 举报
温馨提示
经典读物:《Grails入门指南》全书所有示例的完整源代码。 该书要下载请访问:http://download.csdn.net/source/1318818 Grails是一套用于快速Web应用开发的开源框架,它基于Groovy编程语言,并构建于Spring、Hibernate和其它标准Java框架之上,从而为大家带来一套能实现超高生产力的一站式框架。 Ruby on Rails开创了将一门强大的编程语言和一个坚持己见、提倡用通情达理的默认设置代替复杂配置的框架进行创造性结合的先河。然而,还有许多组织并没有做好从Java的安全保护伞下走出的准备,也没有打算放弃他们目前在Java上的投入。而Grails的出现,使得在一个以Java为中心的环境中实现同等生产力的想法成为可能。
资源推荐
资源详情
资源评论
收起资源包目录
经典读物《Grails入门指南》全书所有示例的完整源代码 (1073个子文件)
.classpath 4KB
.classpath 4KB
.classpath 4KB
.classpath 4KB
.classpath 4KB
.classpath 4KB
public.css 5KB
public.css 5KB
public.css 5KB
menu.css 4KB
menu.css 4KB
menu.css 4KB
menu.css 4KB
menu.css 4KB
menu.css 4KB
container.css 3KB
container.css 3KB
container.css 3KB
container.css 3KB
container.css 3KB
container.css 3KB
tree.css 3KB
tree.css 3KB
tree.css 3KB
tree.css 3KB
tree.css 3KB
tree.css 3KB
tree.css 3KB
tree.css 3KB
tree.css 3KB
tree.css 3KB
tree.css 3KB
tree.css 3KB
calendar.css 2KB
calendar.css 2KB
calendar.css 2KB
calendar.css 2KB
calendar.css 2KB
calendar.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
tree.css 2KB
main.css 2KB
main.css 2KB
main.css 2KB
main.css 2KB
main.css 2KB
main.css 2KB
Thumbs.db 14KB
Thumbs.db 14KB
Thumbs.db 14KB
Thumbs.db 14KB
Thumbs.db 14KB
Thumbs.db 14KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
loading.gif 3KB
loading.gif 3KB
loading.gif 3KB
loading.gif 3KB
loading.gif 3KB
loading.gif 3KB
loading.gif 3KB
loading.gif 3KB
loading.gif 3KB
loading.gif 3KB
共 1073 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
资源评论
imliuli
- 粉丝: 233
- 资源: 1358
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功