diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-01 22:11:20 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-01 22:11:20 +0000 |
commit | 4a2721032e5adb4ad2460befd9af77be4996d2a0 (patch) | |
tree | c635a38df6406055a1a0d111bdc02d4dcb41b71b /engine/js/lib | |
parent | 7e4cc929919f05e5b31c6ff7d1ed9b8e53e8a95a (diff) | |
download | elgg-4a2721032e5adb4ad2460befd9af77be4996d2a0.tar.gz elgg-4a2721032e5adb4ad2460befd9af77be4996d2a0.tar.bz2 |
Refs #2538: Added some models, inheritance, more bootstrapping code
git-svn-id: http://code.elgg.org/elgg/trunk@7183 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/js/lib')
-rw-r--r-- | engine/js/lib/elgglib.js | 29 | ||||
-rw-r--r-- | engine/js/lib/languages.js | 4 |
2 files changed, 18 insertions, 15 deletions
diff --git a/engine/js/lib/elgglib.js b/engine/js/lib/elgglib.js index 28cae8f8f..208c02716 100644 --- a/engine/js/lib/elgglib.js +++ b/engine/js/lib/elgglib.js @@ -92,7 +92,8 @@ elgg.provide = function(pkg) { * @param {Function} parentCtor Parent class.
*/
elgg.inherit = function(Child, Parent) {
- Child.prototype = Parent;
+ Child.prototype = new Parent();
+ Child.prototype.constructor = Child;
};
/**
@@ -130,9 +131,9 @@ elgg.system_messages = function(msgs, delay, type) { delay = 6000;
}
- var messages_class = 'messages';
+ classes = ['elgg_system_message', 'radius8'];
if (type == 'error') {
- messages_class = 'messages_error';
+ classes.push('messages_error');
}
//Handle non-arrays
@@ -140,16 +141,20 @@ elgg.system_messages = function(msgs, delay, type) { msgs = [msgs];
}
- var messages_html = '<div class="' + messages_class + '">'
- + '<span class="closeMessages">'
- + '<a href="#">'
- + elgg.echo('systemmessages:dismiss')
- + '</a>'
- + '</span>'
- + '<p>' + msgs.join('</p><p>') + '</p>'
- + '</div>';
+ var messages_html = [];
- $(messages_html).appendTo('#elgg_system_messages').show().animate({opacity:'1.0'},delay).fadeOut('slow');
+ for (var i in msgs) {
+ messages_html.push('<div class="' + classes.join(' ') + '">'
+ + '<span class="closeMessages">'
+ + '<a href="#">'
+ + elgg.echo('systemmessages:dismiss')
+ + '</a>'
+ + '</span>'
+ + '<p>' + msgs[i] + '</p>'
+ + '</div>');
+ }
+
+ $(messages_html.join('')).appendTo('#elgg_system_messages').animate({opacity:'1.0'},delay).fadeOut('slow');
};
/**
diff --git a/engine/js/lib/languages.js b/engine/js/lib/languages.js index 7bae74e6b..6ac83f350 100644 --- a/engine/js/lib/languages.js +++ b/engine/js/lib/languages.js @@ -12,9 +12,7 @@ elgg.config.translations.init = function() { elgg.add_translation = function(lang, translations) {
elgg.provide('elgg.config.translations.' + lang);
- var t = elgg.config.translations;
-
- t[lang] = $.extend(t[lang], translations);
+ $.extend(elgg.config.translations[lang], translations);
}
/**
|