[pLog-svn] r1091 - in plugins/trunk/smileys: . js js/smileys

mark at devel.plogworld.net mark at devel.plogworld.net
Tue Feb 15 17:44:03 GMT 2005


Author: mark
Date: 2005-02-15 17:44:03 +0000 (Tue, 15 Feb 2005)
New Revision: 1091

Added:
   plugins/trunk/smileys/js/
   plugins/trunk/smileys/js/smileys/
   plugins/trunk/smileys/js/smileys/smileys.js
Removed:
   plugins/trunk/smileys/install/
Modified:
   plugins/trunk/smileys/readme.txt
Log:
Move the js to root of smiles plugin. We don't need to install it to js. Just need to point the javascript url to /plugins/smileys/js/smileys/smileys.

Added: plugins/trunk/smileys/js/smileys/smileys.js
===================================================================
--- plugins/trunk/smileys/js/smileys/smileys.js	2005-02-15 17:16:25 UTC (rev 1090)
+++ plugins/trunk/smileys/js/smileys/smileys.js	2005-02-15 17:44:03 UTC (rev 1091)
@@ -0,0 +1,37 @@
+/**
+ *
+ * Script Name: Write Image Tag
+ * The script is take from http://www.alexking.org
+ * The copyright is belong to http://www.alexking.org
+ *
+ */
+
+function writeImgTag( tag )
+{
+	var myField = document.NewComment.commentText;
+
+	tag = ' ' + tag + ' ';
+	
+	if (document.selection) {
+		myField.focus();
+		sel = document.selection.createRange();
+		sel.text = tag;
+		myField.focus();
+	}
+	else if (myField.selectionStart || myField.selectionStart == '0') {
+		var startPos = myField.selectionStart;
+		var endPos = myField.selectionEnd;
+		var cursorPos = endPos;
+		myField.value = myField.value.substring(0, startPos)
+					  + tag
+					  + myField.value.substring(endPos, myField.value.length);
+		cursorPos += tag.length;
+		myField.focus();
+		myField.selectionStart = cursorPos;
+		myField.selectionEnd = cursorPos;
+	}
+	else {
+		myField.value += tag;
+		myField.focus();
+	}
+}
\ No newline at end of file

Modified: plugins/trunk/smileys/readme.txt
===================================================================
--- plugins/trunk/smileys/readme.txt	2005-02-15 17:16:25 UTC (rev 1090)
+++ plugins/trunk/smileys/readme.txt	2005-02-15 17:44:03 UTC (rev 1091)
@@ -5,15 +5,16 @@
 
 This plugin offers you to show the smileys in comments and articles. Usage as followed:
 
-Install:
-1. Copy the install/js/*.* to your plog installation /js folder.
-
 You can use:
 1. $smileys->generateSmileysBar() to show visual smileys tool bar. 
 
+Notice:
+Your form must has name and id attribute, just like
+<form id="NewComment" name="NewComment" ....>
+
 Example:
 Add the following code to commentForm.template after commentText text area:
 {if $smileys->isEnabled()}
-<script type="text/javascript" src="js/smileys/smileys.js"></script>
+<script type="text/javascript" src="plugins/smileys/js/smileys/smileys.js"></script>
 <br/><label for="simleysBar"></label>{$smileys->generateSmileysBar()}
 {/if}
\ No newline at end of file




More information about the pLog-svn mailing list