aboutsummaryrefslogtreecommitdiff
path: root/engine/js/lib/elgglib.js
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-01 20:28:41 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-01 20:28:41 +0000
commit7e4cc929919f05e5b31c6ff7d1ed9b8e53e8a95a (patch)
treeb0d3a33fdd8905577f6ef5701d3f05343e6458a8 /engine/js/lib/elgglib.js
parent8400aa6e4fc0d5941729654487c1b09f9ceb1193 (diff)
downloadelgg-7e4cc929919f05e5b31c6ff7d1ed9b8e53e8a95a.tar.gz
elgg-7e4cc929919f05e5b31c6ff7d1ed9b8e53e8a95a.tar.bz2
Refs #2538: Pulled in some i18n features
git-svn-id: http://code.elgg.org/elgg/trunk@7182 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/js/lib/elgglib.js')
-rw-r--r--engine/js/lib/elgglib.js32
1 files changed, 28 insertions, 4 deletions
diff --git a/engine/js/lib/elgglib.js b/engine/js/lib/elgglib.js
index c0ce69fab..28cae8f8f 100644
--- a/engine/js/lib/elgglib.js
+++ b/engine/js/lib/elgglib.js
@@ -69,6 +69,33 @@ elgg.provide = function(pkg) {
};
/**
+ * Inherit the prototype methods from one constructor into another.
+ *
+ * @example
+ * <pre>
+ * function ParentClass(a, b) { }
+ *
+ * ParentClass.prototype.foo = function(a) { alert(a); }
+ *
+ * function ChildClass(a, b, c) {
+ * //equivalent of parent::__construct(a, b); in PHP
+ * ParentClass.call(this, a, b);
+ * }
+ *
+ * elgg.inherit(ChildClass, ParentClass);
+ *
+ * var child = new ChildClass('a', 'b', 'see');
+ * child.foo('boo!'); // alert('boo!');
+ * </pre>
+ *
+ * @param {Function} childCtor Child class.
+ * @param {Function} parentCtor Parent class.
+ */
+elgg.inherit = function(Child, Parent) {
+ Child.prototype = Parent;
+};
+
+/**
* Prepend elgg.config.wwwroot to a url if the url doesn't already have it.
*
* @param {String} url The url to extend
@@ -122,10 +149,7 @@ elgg.system_messages = function(msgs, delay, type) {
+ '<p>' + msgs.join('</p><p>') + '</p>'
+ '</div>';
- $(messages_html).insertAfter('#layout_header').click(function () {
- $(this).stop().fadeOut('slow');
- return false;
- }).show().animate({opacity:'1.0'},delay).fadeOut('slow');
+ $(messages_html).appendTo('#elgg_system_messages').show().animate({opacity:'1.0'},delay).fadeOut('slow');
};
/**