Uploading...
";
config.domElement.innerHTML = html;
this.submit = function() {
var cb = {
upload: function(evt) {
if (config.callbacks && config.callbacks.oncomplete) {
config.callbacks.oncomplete();
}
that.dispose();
}
};
config.domElement.firstChild.action = FIRSTCLASS.lang.ensureSlashUrl(config.baseUrl)+FIRSTCLASS.opCodes.Attach;
FIRSTCLASS.util.submitForm(config.domElement.firstChild, true, cb);
// YAHOO.util.Connect.setForm(config.domElement.firstChild, true);
// YAHOO.util.Connect.asyncRequest('POST', FIRSTCLASS.lang.ensureSlashUrl(config.baseUrl)+FIRSTCLASS.opCodes.Attach, cb);
YAHOO.util.Dom.addClass(config.domElement.firstChild, "fcHidden");
YAHOO.util.Dom.removeClass(config.domElement.lastChild, "fcHidden");
};
this.cancel = function() {
that.dispose();
};
/* YAHOO.util.Event.addListener(config.domElement.firstChild, 'submit', onsubmit);*/
this.dispose = function() {
YAHOO.util.Event.purgeElement(config.domElement, true);
};
this.setChangeHandler = function(handler) {
YAHOO.util.Event.on('fcWidgetUpload_input', 'change', function(ev) {
YAHOO.util.Event.stopEvent(ev);
handler();
YAHOO.util.Event.purgeElement('fcWidgetUpload_input');
return true;
});
};
},
setupForGlow: function (btnElement,darkBkgrnd)
{
var hoverBtn = darkBkgrnd ? "dark" : "white";
YAHOO.util.Event.purgeElement(btnElement, true);
YAHOO.util.Dom.setStyle(btnElement,'cursor','pointer');
YAHOO.util.Event.addListener(btnElement,"mouseover", function() {
this.firstChild.firstChild.src = FIRSTCLASS.session.templatebase + '/firstclass/images/ButtonON' + hoverBtn + '_left.png';
YAHOO.util.Dom.setStyle(this.firstChild.nextSibling,'background-image','url(' + FIRSTCLASS.session.templatebase + '/firstclass/images/ButtonON' + hoverBtn + '_mid.png)');
this.lastChild.firstChild.src = FIRSTCLASS.session.templatebase + '/firstclass/images/ButtonON' + hoverBtn + '_right.png';
});
YAHOO.util.Event.addListener(btnElement,"mouseout", function() {
this.firstChild.firstChild.src = FIRSTCLASS.session.templatebase + '/firstclass/images/ButtonOUTLINE_left.png';
YAHOO.util.Dom.setStyle(this.firstChild.nextSibling,'background-image','');
this.lastChild.firstChild.src = FIRSTCLASS.session.templatebase + '/firstclass/images/ButtonOUTLINE_right.png';
});
},
flashButton: function (btnElement) {
var that = this;
if (this._shine & 1) {
btnElement.firstChild.firstChild.src = FIRSTCLASS.session.templatebase + '/firstclass/images/ButtonOUTLINE_left.png';
YAHOO.util.Dom.setStyle(btnElement.firstChild.nextSibling,'background-image','');
btnElement.lastChild.firstChild.src = FIRSTCLASS.session.templatebase + '/firstclass/images/ButtonOUTLINE_right.png';
} else {
btnElement.firstChild.firstChild.src = FIRSTCLASS.session.templatebase + '/firstclass/images/ButtonONdark_left.png';
YAHOO.util.Dom.setStyle(btnElement.firstChild.nextSibling,'background-image','url(' + FIRSTCLASS.session.templatebase + '/firstclass/images/ButtonONdark_mid.png)');
btnElement.lastChild.firstChild.src = FIRSTCLASS.session.templatebase + '/firstclass/images/ButtonONdark_right.png';
}
if (this._shine < 3) {
++this._shine;
setTimeout(function() { that.flashButton(btnElement); }, 750);
}
},
setSubscribeBtn: function (subscribeTD,btnElement,isMyBuddy) {
var that = this;
if (isMyBuddy) {
FIRSTCLASS.ui.Dom.setInnerHTML(btnElement,FIRSTCLASS.locale.profile.stopFollow);
YAHOO.util.Event.removeListener(subscribeTD,'click');
YAHOO.util.Dom.setStyle(subscribeTD,'cursor','default');
YAHOO.util.Event.removeListener(subscribeTD,"mouseover");
} else
FIRSTCLASS.ui.Dom.setInnerHTML(btnElement,FIRSTCLASS.locale.profile.follow);
if (subscribeTD != null) {
that._shine = 0;
setTimeout(function() { that.flashButton(subscribeTD); }, 750);
}
},
setupSubscribing: function () {
var that = this;
var subscribe = document.getElementById('fcMiniProfileSubscribe');
if (subscribe != null) {
var btnTextElem = FIRSTCLASS.ui.Dom.getChildByClassName('fcProfileEditBtns',subscribe);
that.setupForGlow(subscribe,true);
that.setSubscribeBtn(null,btnTextElem,FIRSTCLASS.util.BuddyList.isBuddy(FIRSTCLASS.ui.MiniProfile.lastUID));
YAHOO.util.Event.addListener(subscribe, 'click', function() {
var handleSuccess = function(o) {
var wasActivate = FIRSTCLASS.util.BuddyList._dataSource.isActive();
if (!wasActivate)
FIRSTCLASS.util.BuddyList._dataSource.activate();
setTimeout(function() { FIRSTCLASS.util.BuddyList._dataSource.fetchRows();
if (!wasActivate) { setTimeout(function() { FIRSTCLASS.util.BuddyList._dataSource.deactivate(); }, 3000); }
}, 4000);
that.setSubscribeBtn(subscribe,btnTextElem,true);
};
var handleFailure = function(o) {
if (btnTextElem != null)
FIRSTCLASS.ui.Dom.setInnerHTML(btnTextElem,FIRSTCLASS.locale.profile.failed);
};
var callback = {
success:handleSuccess,
failure: handleFailure
};
if (FIRSTCLASS.ui.MiniProfile.lastUID) {
if (FIRSTCLASS.util.BuddyList.isBuddy(FIRSTCLASS.ui.MiniProfile.lastUID)) {
FIRSTCLASS.util.BuddyList.deleteBuddy(FIRSTCLASS.ui.MiniProfile.lastUID);
that.setSubscribeBtn(subscribe,btnTextElem,false);
} else
FIRSTCLASS.util.BuddyList.addBuddy(null,FIRSTCLASS.ui.MiniProfile.lastUID,callback);
} else
alert("FIRSTCLASS.ui.MiniProfile.lastUID is UNDEFINED");
});
}
},
showMiniProfile: function(domElement, user, callbacks, showoncomplete,showFollowBtn, neverHover) {
var that = this;
var handleProfile = function(response){
var setupListeners = false;
var row = {};
var hasNoProfile = (response.status == "404");
try {
row = FIRSTCLASS.lang.JSON.parse(response.responseText);
} catch(x){
hasNoProfile = true;
//YAHOO.log("JSON Parse Failed", "error", "DataSource.js");
//return;
//debugger;
}
if ((domElement.firstChild == null) || (domElement.firstChild.id != 'miniProfilepopup')) {
var tmp = [];
tmp.push("");
domElement.innerHTML=tmp.join("");
setupListeners = true;
}
if ((typeof that.lastminiProfID == 'undefined') || (that.lastminiProfID != domElement.id)) {
that.lastminiProfID = domElement.id;
that.minipic = FIRSTCLASS.ui.Dom.getChildByIdName('fcMiniProfilePic',domElement);
that.miniUserName = FIRSTCLASS.ui.Dom.getChildByIdName('userName', domElement);
that.ministatMsg = FIRSTCLASS.ui.Dom.getChildByIdName('statusMsg', domElement);
that.ministatMsgTable = FIRSTCLASS.ui.Dom.getChildByIdName('statusMsgTable', domElement);
that.miniOnline = FIRSTCLASS.ui.Dom.getChildByIdName('onlineicon', domElement);
that.miniWorkPos = FIRSTCLASS.ui.Dom.getChildByIdName('workPosition', domElement);
that.miniWorkLocation = FIRSTCLASS.ui.Dom.getChildByIdName('workLocationRow',domElement);
that.miniWorkPhone = FIRSTCLASS.ui.Dom.getChildByIdName('workPhoneRow', domElement);
that.miniWorkEmail = FIRSTCLASS.ui.Dom.getChildByIdName('workEmailRow', domElement);
that.toFollowOrNot = FIRSTCLASS.ui.Dom.getChildByIdName('toFollow', domElement);
}
if (setupListeners && ((typeof neverHover=='undefined') || !neverHover)) {
YAHOO.util.Event.addListener(that.minipic,"mouseover", function() { YAHOO.util.Dom.setStyle(this,"border","2px solid #ffffff"); });
YAHOO.util.Event.addListener(that.minipic,"mouseout", function() { YAHOO.util.Dom.setStyle(this,"border","2px solid #202946"); });
YAHOO.util.Event.addListener(that.miniUserName,"mouseover", function() { YAHOO.util.Dom.setStyle(this,"text-decoration","underline"); });
YAHOO.util.Event.addListener(that.miniUserName,"mouseout", function() { YAHOO.util.Dom.setStyle(this,"text-decoration",""); });
}
if (CIDOfUser != user.uid)
return;
that.minipic.src = FIRSTCLASS.session.templatebase + '/firstclass/images/nopixel.gif';
if (user.uid == 0) {
if (user.name == "")
return;
FIRSTCLASS.util.User.setLargeProfPicUrlByName(that.minipic,user.name, false, true, false, false);
} else {
that.minipic.src = FIRSTCLASS.util.User.getLargeProfPicUrlByCid(user.uid,true);
that.minipic.setAttribute('fcattrs', user.name);
that.minipic.setAttribute('uid', user.uid);
}
if ((typeof user.name == 'undefined') || (user.name == 'undefined')) {
FIRSTCLASS.ui.Dom.setInnerHTML(that.miniUserName,row.name || "");
that.miniUserName.setAttribute('fcattrs', row.name || "");
} else {
FIRSTCLASS.ui.Dom.setInnerHTML(that.miniUserName,user.name);
that.miniUserName.setAttribute('fcattrs', user.name);
}
that.miniUserName.setAttribute('uid', user.uid);
if (((typeof showFollowBtn == 'undefined') || showFollowBtn) && (FIRSTCLASS.session.user.cid != user.uid))
{
YAHOO.util.Dom.setStyle(that.toFollowOrNot.parentNode.parentNode,"display","");
var FollowText = FIRSTCLASS.util.BuddyList.isBuddy(FIRSTCLASS.ui.MiniProfile.lastUID) ? FIRSTCLASS.locale.profile.stopFollow : FIRSTCLASS.locale.profile.follow;
FIRSTCLASS.ui.Dom.setInnerHTML(that.toFollowOrNot,FollowText);
that.setupSubscribing();
} else
YAHOO.util.Dom.setStyle(that.toFollowOrNot.parentNode.parentNode,"display","none");
if (hasNoProfile) {
FIRSTCLASS.ui.Dom.setInnerHTML(that.miniWorkPos,"(' + FIRSTCLASS.util.Date.getFriendlyDateTimeString(FIRSTCLASS.lang.fcTimeToDate(row.col7024)) + ')
');
} else
YAHOO.util.Dom.setStyle(that.ministatMsgTable, "display", "none");
YAHOO.util.Dom.setStyle(that.miniOnline, "display", row.online ? "" : "none");
FIRSTCLASS.ui.Dom.setInnerHTML(that.miniWorkPos,row.position || "");
if (row.location && (row.location != "")) {
YAHOO.util.Dom.setStyle(that.miniWorkLocation, "display", "");
FIRSTCLASS.ui.Dom.setInnerHTML(that.miniWorkLocation.firstChild.nextSibling,row.location);
} else
YAHOO.util.Dom.setStyle(that.miniWorkLocation, "display", "none");
if (row.phone && (row.phone != "")) {
YAHOO.util.Dom.setStyle(that.miniWorkPhone, "display", "");
that.miniWorkPhone.firstChild.nextSibling.firstChild.href = "callto:" + row.phone;
FIRSTCLASS.ui.Dom.setInnerHTML(that.miniWorkPhone.firstChild.nextSibling.firstChild,row.phone);
} else
YAHOO.util.Dom.setStyle(that.miniWorkPhone, "display", "none");
if (row.email && (row.email != "")) {
YAHOO.util.Dom.setStyle(that.miniWorkEmail, "display", "");
that.miniWorkEmail.firstChild.nextSibling.firstChild.href = "mailto:" + row.email;
FIRSTCLASS.ui.Dom.setInnerHTML(that.miniWorkEmail.firstChild.nextSibling.firstChild,row.email);
} else
YAHOO.util.Dom.setStyle(that.miniWorkEmail, "display", "none");
}
var applyParams = function(el,neverHover) {
if (neverHover) {
if (el.getAttribute) {
el.setAttribute('fcid', '');
el.setAttribute('fcevents', '');
el.setAttribute('fcattrs', '');
el.setAttribute('nohover', 'true');
el.setAttribute('uid', '');
}
}
else {
if (el.getAttribute && (!el.getAttribute('fcid') || el.getAttribute('uid') != user.uid)) {
el.setAttribute('fcid', 'user');
el.setAttribute('fcevents', 'mouseout,mouseover,mousemove');
el.setAttribute('fcattrs', row.name);
el.setAttribute('nohover', 'true');
el.setAttribute('uid', user.uid);
}
}
};
var walkNodes = function(el, func,neverHover) {
func(el,neverHover);
if (el.childNodes) {
for (var i = 0; i < el.childNodes.length; i++) {
walkNodes(el.childNodes[i],func,neverHover);
}
}
};
walkNodes(domElement.firstChild, applyParams,neverHover);
if (callbacks && callbacks.loaded) {
callbacks.loaded();
}
YAHOO.util.Dom.setStyle(domElement,'height',(domElement.firstChild.clientHeight + 5)+ 'px');
if (domElement.parentNode.parentNode.id == FIRSTCLASS.ui.MiniProfile.overlayBox.id) {
YAHOO.util.Dom.setStyle(FIRSTCLASS.ui.MiniProfile.overlayBox,'height',(domElement.firstChild.clientHeight + 5)+ 'px');
YAHOO.util.Dom.setStyle(FIRSTCLASS.ui.MiniProfile.overlayBox.firstChild,'height',(domElement.firstChild.clientHeight + 5)+ 'px');
}
if (showoncomplete) {
FIRSTCLASS.ui.MiniProfile.showBoxNow();
}
};
var callback = {
success: handleProfile,
failure: handleProfile
};
var theURL = "";
if (user.uid && user.uid > 0) {
theURL = FIRSTCLASS.util.User.getProfileUrlByCid(user.uid);
} else {
theURL = FIRSTCLASS.util.User.getProfileUrlByName(user.name);
}
if (theURL.indexOf("undefined") > 0) {
//debugger;
}
theURL += "FCXResume?Templates=JS";
CIDOfUser = user.uid;
var request = YAHOO.util.Connect.asyncRequest('GET', theURL, callback);
}/*,
miniProfile: function(hoverBox, domElement, listelement, hbox) {
var callback = {
loaded: function() {
hoverBox.show();
},
click: function() {
hbox.hide();
}
};
hoverBox.hide();
FIRSTCLASS.ui.widgets.showMiniProfile(domElement, listelement, callback);
}*/
},
/**
* set the current document's title in the browser window and fcNavBar
*
* @method setDocumentTitle
* @param {string} newTitle (required) the new title string
* @static
*/
setDocumentTitle: function(newTitle) {
var titleElement = $("fcNavTitle");
if (titleElement) {
FIRSTCLASS.ui.navBar.setTitle(newTitle);
FIRSTCLASS.ui._docTitle = newTitle;
var svTitle = (FIRSTCLASS.session.serverName)?(": " + FIRSTCLASS.session.serverName):"";
document.title = newTitle + svTitle;
}
},
Dom: {
updateViewportBounds: function() {
if (!this._viewportBounds) {
FIRSTCLASS.ui.Dom.onViewportTimeout();
} else {
if (this.viewportTimeout) {
window.clearTimeout(this.viewportTimeout);
}
this.viewportTimeout = window.setTimeout(FIRSTCLASS.ui.Dom.onViewportTimeout, 50);
}
},
onViewportTimeout: function() {
FIRSTCLASS.ui.Dom._viewportBounds = {
//wd:YAHOO.util.Dom.getViewportWidth(),
wd: YAHOO.util.Dom.getViewportWidth(),
ht: YAHOO.util.Dom.getViewportHeight()
};
if (FIRSTCLASS.session.getActiveApplication()
&& FIRSTCLASS.session.getActiveApplication().resizeEvent) {
FIRSTCLASS.session.getActiveApplication().resizeEvent();
}
FIRSTCLASS.ui.Dom._viewportTimeout = false;
},/*
updateViewportBounds: function(wd, ht) {
if (!wd) {
wd = document.width;
}
if (!ht) {
ht = YAHOO.util.Dom.getViewportHeight();
}
this._viewportBounds = {
//wd:YAHOO.util.Dom.getViewportWidth(),
wd: wd,
ht: ht
};
},*/
getViewportBounds: function() {
if (!this._viewportBounds) {
this.updateViewportBounds();
}
return this._viewportBounds;
},
getViewportHeight: function() {
if (!this._viewportBounds) {
this.updateViewportBounds();
}
return this._viewportBounds.ht;
},
getViewportWidth: function() {
if (!this._viewportBounds) {
this.updateViewportBounds();
}
return this._viewportBounds.wd;
},
clearElementChildren: function(element) {
var newContainer = document.createElement("div");
while (element.firstChild) {
var child = element.firstChild;
FIRSTCLASS.ui.Dom.reparentNode(child, newContainer);
}
return newContainer;
},
setInnerHTML: function(element, html) {
try {
element.innerHTML = html;
} catch(e) {
var tmp = document.createElement("div");
tmp.innerHTML = html;
FIRSTCLASS.ui.Dom.replaceChildrenWithChildren(element,tmp);
}
},
replaceChildrenWithChildren: function(element, from) {
var newcontainer = FIRSTCLASS.ui.Dom.clearElementChildren(element);
while (from.firstChild) {
var child = from.firstChild;
FIRSTCLASS.ui.Dom.reparentNode(child, element);
}
return newcontainer;
},
replaceContentsWithElement: function(element, newcontents) {
var newContainer = FIRSTCLASS.ui.Dom.clearElementChildren(element);
element.appendChild(newcontents);
return newContainer;
},
replaceContents: function(element, replace) {
FIRSTCLASS.ui.Dom.clearElementChildren(element);
while (replace.firstChild) {
FIRSTCLASS.ui.Dom.reparentNode(replace.firstChild, element);
}
},
reparentNode: function(element, newparent) {
var parent = element.parentNode;
if (parent) {
parent.removeChild(element);
}
newparent.appendChild(element);
return parent;
},
getChildByFCID: function(fcid, node) {
var firstChild = YAHOO.util.Dom.getFirstChild(node)
var child = firstChild;
var cfcid = "";
while (child) {
cfcid = child.getAttribute('fcid');
if (cfcid && cfcid == fcid) {
return child;
}
child = YAHOO.util.Dom.getNextSibling(child);
}
var child = firstChild;
while (child) {
var tmpchild = FIRSTCLASS.ui.Dom.getChildByFCID(fcid, child);
if (tmpchild) {
return tmpchild;
}
child = YAHOO.util.Dom.getNextSibling(child);
}
return null;
},
getChildByClassName: function(classname, node, depth) {
var firstChild = YAHOO.util.Dom.getFirstChild(node)
var child = firstChild;
while (child) {
if (YAHOO.util.Dom.hasClass(child, classname)) {
return child;
}
child = YAHOO.util.Dom.getNextSibling(child);
}
var child = firstChild;
while (child) {
var tmpchild = FIRSTCLASS.ui.Dom.getChildByClassName(classname, child);
if (tmpchild) {
return tmpchild;
}
child = YAHOO.util.Dom.getNextSibling(child);
}
return null;
},
getChildByIdName: function(idname, node) {
var firstChild = YAHOO.util.Dom.getFirstChild(node)//.childNodes[0];
var child = firstChild;
while (child) {
if ((typeof child.id !== "undefined") && (child.id==idname)) {
return child;
}
//child = child.nextSibling;//
child = YAHOO.util.Dom.getNextSibling(child);
}
var child = firstChild;
while (child) {
var tmpchild = FIRSTCLASS.ui.Dom.getChildByIdName(idname, child);
if (tmpchild) {
return tmpchild;
}
//child = child.nextSibling;//
child = YAHOO.util.Dom.getNextSibling(child);
}
return null;
},
getCurrTimestamp: function () {
var d = new Date();
return "time=" + d.getFullYear() + FIRSTCLASS.ui.Dom.zeroPad(d.getMonth(),2) + FIRSTCLASS.ui.Dom.zeroPad(d.getDate(),2) + FIRSTCLASS.ui.Dom.zeroPad(d.getHours(),2) + FIRSTCLASS.ui.Dom.zeroPad(d.getMinutes(),2) + FIRSTCLASS.ui.Dom.zeroPad(d.getSeconds(),2);
},
zeroPad: function (num,count) {
var numZeropad = num + '';
while(numZeropad.length < count) { numZeropad = "0" + numZeropad; }
return numZeropad;
}
},
hover: {
apply:function(el, hclass) {
YAHOO.util.Dom.addClass(el, hclass);
},
remove:function(el, hclass) {
YAHOO.util.Dom.removeClass(el, hclass);
}
},
hoverBar: {
make: function(bar, hover, control, timeout) {
timeout = timeout || 1000;
YAHOO.util.Event.addListener(hover,"mouseover", function() {
bar.mouseOver = true;
if (!hover.timeout) {
hover.timeout = window.setTimeout(function() {
if (bar.mouseOver) {
if (control.elementWithHoverBar != hover) {
FIRSTCLASS.ui.hoverBar.hide(control);
}
YAHOO.util.Dom.removeClass(bar, "fcHoverHidden");
control.elementWithHoverBar = hover;
}
}, timeout);
}
});
YAHOO.util.Event.addListener(hover, "mouseout", function(evt) {
bar.mouseOver = false;
if (!YAHOO.util.Dom.isAncestor(hover.parentNode, evt.relatedTarget) && hover != evt.relatedTarget) {
hover.removeHoverBar();
}
if (!YAHOO.util.Dom.isAncestor(hover, evt.relatedTarget)) {
if (hover.timeout) {
window.clearTimeout(hover.timeout);
hover.timeout = false;
}
}
});
hover.removeHoverBar = function() {
YAHOO.util.Dom.addClass(bar, "fcHoverHidden");
};
hover.removeHoverBar();
},
hide: function(control) {
if (control.elementWithHoverBar && control.elementWithHoverBar.removeHoverBar) {
control.elementWithHoverBar.removeHoverBar();
control.elementWithHoverBar = false;
}
}
},
initializeSearchBox: function(id) {
var input = $(id);
YAHOO.util.Event.addListener(input, "keydown", function(evt) {
YAHOO.util.Event.stopPropagation(evt);
});
YAHOO.util.Event.addListener(input, "keyup", function(evt) {
if(evt.keyCode == 13) {
FIRSTCLASS.search({key:input.value});
// top.location.hash="#__Search/?Srch=" + escape(input.value);
} else if (evt.keyCode == 27) {
input.typing = false;
YAHOO.util.Dom.removeClass(input, "focussed");
input.value = FIRSTCLASS.locale.desktop.search;
input.blur();
}
YAHOO.util.Event.stopPropagation(evt);
});
YAHOO.util.Event.addListener(input, "blur", function(evt) {
if (input.value == "") {
input.value = FIRSTCLASS.locale.desktop.search;
}
YAHOO.util.Dom.removeClass(input, "focussed");
});
YAHOO.util.Event.addListener(input, "focus", function(evt) {
if (input.value == FIRSTCLASS.locale.desktop.search) {
input.value = "";
} else {
input.select();
}
YAHOO.util.Dom.addClass(input, "focussed");
});
},
initializeQuickSendBox: function(id) {
var input = $(id);
var buildQuickSendUrl= function(str) {
var postData = "BODY="+ FIRSTCLASS.lang.uesc(str) + "&Subject=" + FIRSTCLASS.lang.uesc(str) + "&BODYTYPE=PLAIN&CharSet=UTF-8&Send=1&KeepNames=1";
/*if (FIRSTCLASS.lexi.isUrl(str)) {
postData += "&FormID=FIXME";
} else if(FIRSTCLASS.lexi.isQuestion(str)) {
// build question
postData += "&FormID=FIXME";
} else {
// send message
}*/
return postData;
};
input.typing = false;
YAHOO.util.Event.addListener(input, "keydown", function(evt) {
YAHOO.util.Event.stopPropagation(evt);
});
YAHOO.util.Event.addListener(input, "keyup", function(evt) {
if(evt.keyCode == 13) {
if (input.value == "") {
return;
}
// enter
//FIRSTCLASS.search({key:input.value});
var postData = buildQuickSendUrl(input.value);
var url = FIRSTCLASS.session.getActiveObject() + "__Send";
input.value = "Sending...";
input.disabled = true;
input.typing = false;
input.blur();
YAHOO.util.Dom.removeClass(input, "focussed");
YAHOO.util.Connect.asyncRequest("POST", url, {
success:function(o) {
input.value="Send Succeeded";
input.disabled = false;
},
failure: function(o) {
input.value = "Send Failed";
input.disabled = false;
}
}, postData);
} else if (evt.keyCode == 27) {
input.typing = false;
YAHOO.util.Dom.removeClass(input, "focussed");
input.value = "Send";
input.blur();
} else {
input.typing = true;
}
YAHOO.util.Event.stopPropagation(evt);
});
YAHOO.util.Event.addListener(input, "blur", function(evt) {
if ((!input.typing || input.value == "") && input.value != "Send Succeeded" && input.value != "Sending...") {
input.value = "Send";
}
YAHOO.util.Dom.removeClass(input, "focussed");
});
YAHOO.util.Event.addListener(input, "focus", function(evt) {
if (!input.typing) {
input.value = "";
}
YAHOO.util.Dom.addClass(input, "focussed");
});
},
tags: {
defines: {
separator: String.fromCharCode(0x02),
countdelimiter: String.fromCharCode(0x03),
// separator: ',', //String.fromCharCode(0x02),
// countdelimiter: '.', //String.fromCharCode(0x03),
legacy: {
separator: ',',
countdelimiter: '.'
}
},
arrayToServerTags: function(arrayofstrings) {
return arrayofstrings.join(FIRSTCLASS.ui.tags.defines.separator) + FIRSTCLASS.ui.tags.defines.separator;
}
},
parseServerTags: function (stags, defaultkeys) {
var cloud = [];
if (stags != "") {
var legacymode = false;
var tags = stags.split(FIRSTCLASS.ui.tags.defines.separator);
if (stags.indexOf(FIRSTCLASS.ui.tags.defines.separator) < 0) {
// new mode tags are always terminated with a separator
legacymode = true;
tags = stags.split(FIRSTCLASS.ui.tags.defines.legacy.separator);
}
for (var i in tags) {
var tag = tags[i];
var ts = tag.split(FIRSTCLASS.ui.tags.defines.countdelimiter);
if (legacymode) {
ts = tag.split(FIRSTCLASS.ui.tags.defines.legacy.countdelimiter);
}
if (ts.length >= 1 ){
var thetag = ts[0];
if (thetag.indexOf(""" >= 0)) {
thetag = thetag.replace(/"/g, "");
}
ts[0] = thetag;
}
var item = {"tag": ts[0],"weight": 1};
if (ts.length == 2) {
item = {"tag": ts[0],"weight": parseInt(ts[1])};
}
for (var i in defaultkeys) {
item[i] = defaultkeys[i];
}
if (item.tag) {
cloud.push(item);
}
}
}
if (cloud.length > 0 && !cloud[cloud.length-1].tag) {
cloud = cloud.splice(0,cloud.length-1);
}
return cloud;
},
generateCloud: function(atagsa, makefunctiontext) {
var calculateTagWeights = function(atags) {
var min = -1;
var max = -1;
var avg = 0;
for (var i in atags) {
if (min == -1) {
min = atags[i].weight;
}
if (min > atags[i].weight) {
min = atags[i].weight;
}
if (max < atags[i].weight) {
max = atags[i].weight;
}
avg += atags[i].weight;
}
var range = (max - min)/6;
for (var i in atags) {
var n = atags[i].weight;
if (n == min) {
atags[i].fw = 0;
} else if (n > min && n < min + range) {
atags[i].fw = 1;
} else if (n >= min+range && n < min +2*range) {
atags[i].fw = 2;
} else if (n >= min+2*range && n < min +3*range) {
atags[i].fw = 3;
} else if (n >= min+3*range && n < min +4*range) {
atags[i].fw = 4;
} else if (n >= min+4*range && n <= max) {
atags[i].fw = 5;
}
}
};
var defaultfunctiontext = function(tag) {
return "FIRSTCLASS.search({key:\""
+ tag
+ "\"});";
};
var generateTag = function(cfg, mode) {
var html = [
"');
bottomText.innerHTML = html.join("");//"