?? common.js
字號:
function mh_topics_up(){
var objpt = getobjectxy($("mh_topics"));
$("mh_topics").className = "mh_select";
$("mh_topics").firstChild.className = "select";
$("ms_topics").style.left = objpt.x + "px";
if (isiexplorer()){
$("ms_topics").style.top = (objpt.y + objpt.height - 5) + "px";
$("ms_topics").style.width = objpt.width + "px";
}else{
$("ms_topics").style.top = (objpt.y + objpt.height - 1) + "px";
$("ms_topics").style.width = (objpt.width - 2) + "px";
}
$("ms_topics").style.display = "";
}
function mh_topics_down(){
$("mh_topics").className = "mh_normal";
$("mh_topics").firstChild.className = "";
$("ms_topics").style.display = "none";
}
function previewimage(theimage, maxsize){
if (theimage.width>0){
if (theimage.width>maxsize){
theimage.width = maxsize;
theimage.height = Math.floor((theimage.height * maxsize) / theimage.width);
}
}
}
function sc_select_count(element){
if (element==null) return false;
if (typeof(element.length)=="undefined"){
if (element.checked){
return 1;
}else{
return 0;
}
}else{
var icount = 0;
for(i=0;i<element.length;i++){
if (element[i].checked){
icount += 1;
}
}
return icount;
}
}
function sc_select_all(current, element){
if (element==null) return false;
if (typeof(element.length)=="undefined"){
element.checked = current.checked;
}else{
for(i=0;i<element.length;i++){
element[i].checked = current.checked;
}
}
}
function sc_select_state(element){
var parentTag = "checkbox";
var curObject = element;
while(parentTag!="TR"){
if (element.parentElement!=null) {
curObject = curObject.parentElement;
parentTag = curObject.tagName;
}else{
return ;
}
}
if ($("selectall")!=null){
if (element.checked){
curObject.bgColor = "#CEE4ED";
if (!$("selectall").checked) {
var elements = $n(element.name);
if (sc_select_count(elements)==elements.length) { $("selectall").checked = true; }
}
}else{
curObject.bgColor = "#ffffff";
if ($("selectall").checked) { $("selectall").checked = false; }
}
}
}
// ***********************************************************************************||
// 顯示用戶信息
// ***********************************************************************************||
function show_user_card(theobj, userid){
var local = getlocal();
var objpt = getobjectxy(theobj);
var bodyw = document.body.clientWidth;
var bodyh = document.body.clientHeight + document.body.scrollTop;
var ucard = $("user_card_" + userid);
if (ucard!=null){
ucard.style.display = "";
ucard.style.top = ((objpt.y + ucard.offsetHeight + 12) > bodyh?(objpt.y-ucard.offsetHeight - 3):objpt.y + 12) + "px";
ucard.style.left = ((objpt.x + ucard.offsetWidth) > bodyw?(objpt.x-ucard.offsetWidth-12):objpt.x+12) + "px";
}else{
this.loaded = function(t){
ucard.innerHTML = t;
}
var theajax = new ajax(false, this.loaded, null);
ucard = $c("DIV");
ucard.className = "cls_card";
ucard.style.position = "absolute";
ucard.style.top = ((objpt.y + ucard.offsetHeight + 12) > bodyh?(objpt.y-ucard.offsetHeight - 3):objpt.y + 12) + "px";
ucard.style.left = ((objpt.x + ucard.offsetWidth) > bodyw?(objpt.x-ucard.offsetWidth-12):objpt.x+12) + "px";
ucard.id = "user_card_" + userid;
ucard.innerHTML = "<img src=\""+local +"resource/skins/default/icon_loading.gif\" align=\"absmiddle\"> 正在獲取用戶信息,請等待...";
theajax.get(local + "web/service/ajax_action.aspx?Command=User_Detail&UserID=" + userid, true);
ucard.onmouseover = function(){
this.style.display = "";
}
ucard.onmouseout = function(){
this.style.display = "none";
}
$a(ucard);
}
}
function hide_user_card(userid){
if ($("user_card_" + userid)!=null){
$("user_card_" + userid).style.display = "none";
}
}
function do_topic_judge(topicid){
this.success = function(t){
var _result = parseInt(trim(t));
if (_result==0){
window.alert("推薦主題成功。");
}else if (_result==2){
window.alert("對不起!同一個IP或用戶一天只能對一個主題推薦一次。");
}else if (_result==3){
window.alert("對不起!作者不能推薦自己的主題。");
}else if (_result==4){
window.alert("對不起!此主題不存在或已刪除。");
}else if (_result==5){
window.alert("對不起!您還沒有登錄,推薦主題之前請先登錄。");
}else{
window.alert("推薦主題失敗。");
}
}
this.error = function(){
window.alert("推薦主題失敗。");
}
var local = getlocal();
var theajax = new ajax(false, this.success, this.error);
theajax.get(local + "web/service/ajax_action.aspx?Command=Topic_Jugde&TopicID="+topicid, true);
}
function do_special_topic_vote(specialid, topicid){
this.success = function(t){
var _result = parseInt(trim(t));
if (_result==0){
window.alert("為專輯主題投票成功。");
}else if (_result==2){
window.alert("對不起!同一個IP或用戶只能為一個專輯中的一個主題投票一次。");
}else if (_result==3){
window.alert("對不起!您還沒有登錄,投票之前請先登錄。");
}else{
window.alert("為專輯主題投票失敗。");
}
}
this.error = function(){
window.alert("為專輯主題投票失敗。");
}
var local = getlocal();
var theajax = new ajax(false, this.success, this.error);
theajax.get(local + "web/service/ajax_action.aspx?Command=Special_Topic_Jugde&specialid="+specialid+"&topicid="+topicid, true);
}
function on_search_topics(){
if (trim($("skey").value)==""){
window.alert("對不起!搜索關鍵字不能為空。");
$("skey").focus();
return false;
}
return true;
}
function do_topic_quite(quiteid){
if ($("quiteid")!=null){
document.Form1.quiteid.value = quiteid;
}
window.open("#reply", "_self", "");
}
function on_topic_reply(){
if (IWE_Frame!=null){
if (IWE_Design_Mode)
{
document.Form1.content.value = IWE_Filter(IWE_Frame.document.body.innerHTML);
}else{
document.Form1.content.value = IWE_Frame.document.body.innerText
}
}
if (trim(document.Form1.content.value)==""){
window.alert("回復內容不能為空。");
if (IWE_Frame!=null){
IWE_Frame.focus();
}else{
document.Form1.content.focus();
}
return false;
}
return true;
}
function on_topic_action(){
if (trim(document.Form1.remark.value)==""){
window.alert("請在下面選擇或輸入執行此操作的理由。");
document.Form1.remark.focus();
return false;
}
return true;
}
function do_topic_delete(parentid, topicid){
if (parentid==0){
if (confirm("您確定要刪除這個主題嗎?")){
window.open("../Service/Topic_Action.aspx?Command=Topic_Delete&topicid=" + topicid, "_self", "");
}
}else{
if (confirm("您確定要刪除這條回復嗎?")){
window.open("../Service/Topic_Action.aspx?Command=Topic_Delete&topicid=" + topicid, "_self", "");
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -