pixmicat

Subversion Repositories:
Compare Path: Rev
With Path: Rev
/PMC2Prototype/ @ 368  →  /PMC2Prototype/ @ 369
/PMC2Prototype/resource/pixmicat-ajax.tmpl
@@ -7,15 +7,69 @@
<link rel="stylesheet" type="text/css" href="<?php echo PMCCore_getConfig('ENV.FOLDER.RESOURCE');?>/mainstyle.css" />
<script type="text/javascript" src="<?php echo PMCCore_getConfig('ENV.FOLDER.RESOURCE');?>/mainscript.js"></script>
<script type="text/javascript" src="<?php echo PMCCore_getConfig('ENV.FOLDER.RESOURCE');?>/xmlhttp.js"></script>
<script type="text/javascript">
// <![CDATA[
Taction.self = '<?php echo PMCCore_getConfig('ENV.PHP_SELF');?>';
// ]]>
</script>
</head>
<body>
 
<div id="header">
<div id="toplink">[<a href="#" onclick="javascript:Txmlhttp.get('<?php echo PMCCore_getConfig('ENV.PHP_SELF');?>/search', function(txt){ alert(txt); });">搜尋</a>] [<a href="#" onclick="javascript:Txmlhttp.get('<?php echo PMCCore_getConfig('ENV.PHP_SELF');?>/action/status', Trender.status);">系統資訊</a>] [<a href="<?php echo PMCCore_getConfig('ENV.PHP_SELF');?>/admin">管理區</a>] [<a href="<?php echo PMCCore_getConfig('ENV.PHP_SELF');?>?">重新整理</a>]</div><br />
<div id="toplink">[<a href="#search" rel="ajaxlink">搜尋</a>] [<a href="#status" rel="ajaxlink">系統資訊</a>] [<a href="<?php echo PMCCore_getConfig('ENV.PHP_SELF');?>/admin">管理區</a>] [<a href="<?php echo PMCCore_getConfig('ENV.PHP_SELF');?>?">重新整理</a>]</div><br />
<h1><?php echo PMCCore_getConfig('TITLE');?></h1>
<hr class="top" />
</div>
 
<form action="<?php echo PMCCore_getConfig('ENV.PHP_SELF');?>/posts" method="post" enctype="multipart/form-data" onsubmit="return c();" id="postform_main">
<div id="postform">
[<span id="show" class="hide" onmouseover="showform();" onclick="showform();">投稿</span><span id="hide" class="show" onmouseover="hideform();" onclick="hideform();">隱藏表單</span>]
<input type="hidden" name="MAX_FILE_SIZE" value="524288" />
<input type="hidden" name="upfile_path" value="" />
<div style="text-align: center;">
<table cellpadding="1" cellspacing="1" id="postform_tbl" style="margin: 0px auto; text-align: left;">
<tr><td class="Form_bg"><b>名 稱</b></td><td><input class="hide" type="text" name="name" value="spammer" /><input type="text" name="kjbnhjVyt" id="fname" size="28" /></td></tr>
<tr><td class="Form_bg"><b>E-mail</b></td><td><input type="text" name="vHjdfiDFr" id="femail" size="28" /><input type="text" class="hide" name="email" value="[email protected]" /></td></tr>
<tr><td class="Form_bg"><b>標 題</b></td><td><input class="hide" value="DO NOT FIX THIS" type="text" name="sub" /><input type="text" name="hjYIgijUB" id="fsub" size="28" /><input type="submit" name="sendbtn" value="送 出" /></td></tr>
<tr><td class="Form_bg"><b>內 文</b></td><td><textarea name="<?php echo PMCCore_getConfig('FIELDTRAP.COMMENT');?>" id="fcom" cols="48" rows="4" style="width: 400px; height: 80px;"></textarea><textarea name="com" class="hide" cols="48" rows="4">EID OG SMAPS</textarea></td></tr>
<tr><td class="Form_bg"><b>附加圖檔</b></td><td><input type="file" name="upfile" id="fupfile" size="25" /> <input class="hide" type="checkbox" name="reply" value="yes" />[<input type="checkbox" name="noimg" id="noimg" value="on" /><label for="noimg">無貼圖</label>] [<input type="checkbox" name="up_series" id="up_series" value="on" /><label for="up_series">連貼機能</label>]</td></tr>
<tr><td class="Form_bg"><b>刪除用密碼</b></td><td><input type="password" name="pwd" size="8" maxlength="8" value="" /><small>(刪除文章用。英數字8字元以內)</small></td></tr>
<tr><td colspan="2">
<div id="postinfo">
<ul>
<li>可附加圖檔類型:GIF, JPG, PNG,瀏覽器才能正常附加圖檔</li>
<li>附加圖檔最大上傳資料量為 512 KB。當回文時E-mail填入sage為不推文功能</li>
<li>當檔案超過寬 200 像素、高 200 像素時會自動縮小尺寸顯示</li>
<li>目前附加圖檔使用量大小: 23387 KB / 25000 KB</li>
</ul>
<noscript><div>*您選擇關閉了JavaScript,但這對您的瀏覽及發文應無巨大影響</div></noscript>
</div>
</td></tr>
</table>
</div>
<script type="text/javascript">l1();</script>
<hr />
</div>
</form>
<script type="text/javascript">hideform();</script>
 
<form action="<?php echo PMCCore_getConfig('ENV.PHP_SELF');?>/search" method="post">
<div id="TrenderSearch" style="display: none;">
<div class="bar_admin">搜尋</div>
<ul>
<li>請輸入要搜尋的關鍵字,設定好搜尋目標之後,按下「搜尋」按鈕。</li>
<li>關鍵字使用半形空白可以區隔多個搜尋關鍵字作搜尋。</li>
<li>如果有多個關鍵字,可以選擇搜尋方法,系統提供 AND(交集) 和 OR(聯集) 方式搜尋。<p />
關鍵字:<input type="text" name="keyword" size="30" />
搜尋目標:<select name="field"><option value="com" selected="selected">內文</option><option value="name">名稱</option><option value="sub">標題</option><option value="no">編號</option></select>
搜尋方法:<select name="method"><option value="AND" selected="selected">AND</option><option value="OR">OR</option></select>
<input type="submit" value=" 搜尋 " />
</li>
</ul>
<hr />
</div>
</form>
 
<div id="TrenderStatus" style="text-align: center; display: none;">
<div class="bar_admin">系統資訊</div>
 
@@ -48,11 +102,13 @@
<tr><td align="center" colspan="3">伺服器支援情報</td></tr>
<tr align="center"><td colspan="2">GD函式庫 bundled (2.0.28 compatible)</td><td><span style="color: blue;">已開啟</span></td></tr>
</table>
<hr />
</div>
 
<div id="TrenderShow">
TEST<br />
show form &amp; thread structure here. using <a href="<?php echo PMCCore_getConfig('ENV.PHP_SELF');?>/show/1">ajax</a> to load thread.
<hr />
</div>
 
<div id="footer">
/PMC2Prototype/resource/xmlhttp.js
@@ -1,14 +1,14 @@
// XMLHttpRequest
var Txmlhttp = {
xmlhttpclip : [],
__newXMLHttpRequest : function (){
__newXMLHttpRequest : function(){
for(var i = 0, ccount = Txmlhttp.xmlhttpclip.length; i < ccount; i++){
if(Txmlhttp.xmlhttpclip[i].readyState===0 || Txmlhttp.xmlhttpclip[i].readyState==4){ // 舊有可用
return Txmlhttp.xmlhttpclip[i];
}
}
// 新增個體
Txmlhttp.xmlhttpclip.push(function (){
Txmlhttp.xmlhttpclip.push(function(){
var xmlhttp = null;
if(typeof XMLHttpRequest != 'undefined'){ xmlhttp = new XMLHttpRequest(); }
/*@cc_on @*/
@@ -25,10 +25,10 @@
}());
return Txmlhttp.xmlhttpclip[Txmlhttp.xmlhttpclip.length - 1];
},
get : function (rURL, succFunc, failFunc){
get : function(rURL, succFunc, failFunc){
var xmlhttp = Txmlhttp.__newXMLHttpRequest();
xmlhttp.open('GET', rURL, true);
xmlhttp.onreadystatechange = function (){
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState==4){
if(xmlhttp.status==200 || xmlhttp.status==304){ succFunc(xmlhttp.responseText); } // 成功
else if(typeof failFunc=='function'){ failFunc(); } // 失敗
@@ -47,13 +47,13 @@
__show : function(tarName){
var Tdivs = document.getElementsByTagName('div');
for(var i = 0, TL = Tdivs.length; i < TL; i++){
T = Tdivs[i];
var T = Tdivs[i];
if(T.id.substr(0, 7)=='Trender'){
T.style.display = (T.id==tarName) ? '' : 'none';
}
}
},
// 顯示 [系統資訊] 頁面
// 成像 [系統資訊] 頁面
status : function(txt){
var result = Trender.parseJSON(txt);
var tableTxt = $('TrenderStatus').innerHTML;
@@ -61,4 +61,81 @@
$('TrenderStatus').innerHTML = tableTxt;
Trender.__show('TrenderStatus');
}
};
};
 
// 動作顯示
var Taction = {
flag : {}, // 執行旗標
self : '', // PHP URL
main : function(hash){
switch(hash){
case 'search':
Trender.__show('TrenderSearch');
break;
case 'status':
if(typeof Taction.flag['status']=='undefined'){
Taction.flag['status'] = true;
Txmlhttp.get(Taction.self+'/action/status', Trender.status);
}else{
Trender.__show('TrenderStatus');
}
break;
case '':
Trender.__show('TrenderShow');
}
}
};
 
// AJAX 頁面歷史模擬
var Thistory = {
eventFunction : Taction.main,
currentHash : document.location.hash,
// 初始化
init : function(){
var iframe, i2;
if(window.ActiveXObject){
if (Thistory.currentHash===''){ Thistory.currentHash = '#'; } // IE 錨點預設值
iframe = document.createElement('iframe');
iframe.setAttribute('id', 'pIEHistory'); iframe.style.display = 'none';
document.body.insertBefore(iframe, document.body.firstChild);
i2 = iframe.contentWindow.document;
i2.open(); i2.close();
i2.location.hash = Thistory.currentHash;
}
Thistory.__onRegister(); // 修改連結事件
Thistory.eventFunction(Thistory.currentHash.replace(/^#/, ''));
setInterval(Thistory.__check, 200);
},
// 檢查器
__check : function(){
var newestHash = window.ActiveXObject ? document.getElementById('pIEHistory').contentWindow.document.location.hash : document.location.hash; // the hash after changing page
if(newestHash != Thistory.currentHash){ // 錨點改變 (頁面改變)
if(window.ActiveXObject){ document.location.hash = newestHash; }
Thistory.currentHash = newestHash;
Thistory.eventFunction(newestHash.replace(/^#/, ''));
}
},
// IE 產生頁面歷史更動
register : function(){
var hash = this.href.replace(/^.*#/, ''), iframe, i2;
if(window.ActiveXObject){ // IE
iframe = document.getElementById('pIEHistory');
i2 = iframe.contentWindow.document || iframe.contentDocument;
i2.open(); i2.close();
i2.location.hash = '#' + hash;
} // Fx, Op 不需處理
},
// 幫連結自動增加頁面歷史更動事件 (僅 rel='ajaxlink' 連結)
__onRegister : function(){
var affectLinks = document.getElementsByTagName('a'), aL;
for(var i = 0, aLL = affectLinks.length; i < aLL; i++){
aL = affectLinks[i];
if(aL.getAttribute('rel')=='ajaxlink'){
aL.onclick = Thistory.register;
}
}
}
};
// onload initialization
if(window.attachEvent){ window.attachEvent('onload', Thistory.init); }
else{ window.addEventListener('load', Thistory.init, false); }