Browse Source

Fixed a couple of stupid errors in the quote tag and properly extended InsertQuote and getText

Signed-off-by: emanuele <[email protected]>
emanuele 13 years ago
parent
commit
25adcf966f

+ 4 - 23
Themes/default/GenericControls.template.php

@@ -38,12 +38,11 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
 						var bIsSource = this.inSourceMode();
 
 						// @TODO make it put the quote close to the current selection
-						// @TODO there must be a cleaner mode to get the proper text...
 
 						if (!bIsSource)
 							this.toggleTextMode();
 
-						var current_value = this.getWysiwygEditorValue() + "\n" + text;
+						var current_value = this.getTextareaValue(false) + "\n" + text;
 						this.setTextareaValue(current_value);
 
 						if (!bIsSource)
@@ -51,28 +50,10 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
 
 					},
 					getText: function() {
-						var bIsSource = this.inSourceMode();
-
-						// @TODO there must be a cleaner mode to get the proper text...
-
-						if (!bIsSource)
-						{
-							this.toggleTextMode();
-							this.toggleTextMode();
-						}
+						if(this.inSourceMode())
+							var current_value = this.getTextareaValue(false);
 						else
-							this.toggleTextMode();
-
-						var current_value = this.getWysiwygEditorValue();
-
-						if (!bIsSource)
-						{
-							this.toggleTextMode();
-							this.toggleTextMode();
-						}
-
-						return current_value;
-
+							var current_value = this.getWysiwygEditorValue();
 					}
 				};
 

+ 5 - 3
Themes/default/scripts/jquery.sceditor.bbcode.js

@@ -991,6 +991,8 @@
 				}
 			},
 			format: function(element, content) {
+				if (element.attr('data-sceditor-emoticon') == '')
+					return content;
 				return element.attr('data-sceditor-emoticon') + content;
 			},
 			html: '{0}'
@@ -1123,11 +1125,11 @@
 				}
 				else
 				{
-					if ($(element).attr('author') != undefined);
+					if ($(element).attr('author') != undefined)
 						author = ' author=' + $(element).attr('author').php_unhtmlspecialchars();
-					if ($(element).attr('date') != undefined);
+					if ($(element).attr('date') != undefined)
 						date = ' date=' + $(element).attr('date');
-					if ($(element).attr('link') != undefined);
+					if ($(element).attr('link') != undefined)
 						link = ' link=' + $(element).attr('link');
 				}