1. Christian Fischer
  2. wcf-smileybox

Commits

Christian Fischer  committed 061d958

  • Participants
  • Parent commits 9056cfd
  • Branches default

Comments (0)

Files changed (4)

File dist/net.northshirebund.wbb.smileybox-0.1.tar

Binary file modified.

File dist/net.northshirebund.wbb.smileybox-0.1.tar.gz

Binary file modified.

File dist/net.northshirebund.wbb.smileybox-0.1.zip

Binary file modified.

File templates/smileybox.tpl

View file
 	<tr style="height:20px;"><td colspan="{$cols}">
 		<table border="0" cellspacing="0" style="width:100%;">
 		<tr>
-			<!--td style="text-align:center;"><a href="#" onClick="openSmilieboxPage(0);">&lt;&nbsp;&lt;</a></td-->
-			<td style="text-align:center;"><img src="{@RELATIVE_WCF_DIR}icon/previousS.png" alt="" onClick="openSmilieboxPage(page - 1);"  style="cursor:pointer;"/></td>
-			<td style="text-align:center;"><img src="{@RELATIVE_WCF_DIR}icon/nextS.png" alt="" onClick="openSmilieboxPage(page + 1);"  style="cursor:pointer;"/></td>
-			<!--td style="text-align:center;"><a href="#" onClick="openSmilieboxPage(maxpage);">&gt;&nbsp;&gt;</a></td-->
+			<!--td style="text-align:center;"><a href="#" onclick="openSmilieboxPage(0);">&lt;&nbsp;&lt;</a></td-->
+			<td style="text-align:center;"><img id="smileyboxPrevIcon" src="{@RELATIVE_WCF_DIR}icon/previousDisabledS.png" alt="" onclick="openSmilieboxPage(page - 1);"  style="cursor:pointer;"/></td>
+			<td style="text-align:center;"><img id="smileyboxNextIcon" src="{@RELATIVE_WCF_DIR}icon/nextDisabledS.png" alt="" onclick="openSmilieboxPage(page + 1);"  style="cursor:pointer;"/></td>
+			<!--td style="text-align:center;"><a href="#" onclick="openSmilieboxPage(maxpage);">&gt;&nbsp;&gt;</a></td-->
 		</tr>
 		</table>
 	</td></tr>
 </table>
-<script language="javascript" type="text/javascript">
+<script type="text/javascript">
 //<![CDATA[
 	
 	var page                 = 0;
 	var perpage              = {$col} * {$row};
 	var smilieboxAjaxRequest = null;
 	
+{*
+	var smileys = new Array(
+		{foreach item=$smiley from=$this->getCache()->get('smilies')}
+			'<img src="{$smiley->getURL()}" onclick="smilieboxAppendCode(\''{$smiley->smileyCode}'\')" style="cursor:pointer;"/>',
+		{/foreach}
+	);
+*}
+	
+	
 	function openSmilieboxPage(page) {
 		if (this.smilieboxAjaxRequest == null && page>=0 && page<=this.maxpage) {
 			this.smilieboxAjaxRequest = new AjaxRequest();
 			return this.smilieboxAjaxRequest.openPost(
 								'index.php?page=GetSmilies&output=xml' + SID_ARG_2ND,
 								'from=' + (this.page * this.perpage) + '&count=' + this.perpage,
-								function() { handleSmillieboxRequest(); }
+								function() { handleSmileyboxRequest(); }
 			);
 		}
 		
 	}
 	
 	
-	function smilieboxAppendCode(code) {
-		var target = document.getElementById('{$target}');
-		
-		if (target != null) {
-			target.value += code;
-			target.focus();
-		}
-		
-		return;
-	}
-	
-	
-	function handleSmillieboxRequest() {
+	function handleSmileyboxRequest() {
 		if (this.smilieboxAjaxRequest && this.smilieboxAjaxRequest.xmlHttpRequest.readyState == 4) {
 			if(this.smilieboxAjaxRequest.xmlHttpRequest.status == 200 && this.smilieboxAjaxRequest.xmlHttpRequest.responseXML) {
 				var lines = this.smilieboxAjaxRequest.xmlHttpRequest.responseXML.getElementsByTagName('smilies');
 						var td   = document.getElementById('smiliebox_'+c+'_'+r);
 						
 						if (td != null) {
-							td.innerHTML = '<img src="'+node.getAttribute('url')+'" onClick="smilieboxAppendCode(\''+node.getAttribute('code')+'\')" style="cursor:pointer;"/>';
+							td.innerHTML = '<img src="'+node.getAttribute('url')+'" onclick="smilieboxAppendCode(\''+node.getAttribute('code')+'\')" style="cursor:pointer;"/>';
 						}
 					}
 					
 					}
 				}
 				
+				document.getElementById('smileyboxPrevIcon').src = ((page<=0) ? '{@RELATIVE_WCF_DIR}icon/previousDisabledS.png' : '{@RELATIVE_WCF_DIR}icon/previousS.png');
+				document.getElementById('smileyboxNextIcon').src = ((page>=maxpage) ? '{@RELATIVE_WCF_DIR}icon/nextDisabledS.png' : '{@RELATIVE_WCF_DIR}icon/nextS.png');
+				
 				this.smilieboxAjaxRequest = null;
 			}
 		}
 	}
 	
 	
+	function smilieboxAppendCode(code) {
+		var target = document.getElementById('{$target}');
+		
+		if (target != null) {
+			target.value += code;
+			target.focus();
+		}
+		
+		return;
+	}
+	
+	
 	setTimeout('openSmilieboxPage(0);', 100);