aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/lib/elgglib.js2
-rw-r--r--js/lib/ui.js16
-rw-r--r--js/lib/ui.widgets.js1
-rw-r--r--js/tests/ElggLibTest.js2
4 files changed, 17 insertions, 4 deletions
diff --git a/js/lib/elgglib.js b/js/lib/elgglib.js
index 81209ebd0..dc7c07165 100644
--- a/js/lib/elgglib.js
+++ b/js/lib/elgglib.js
@@ -283,7 +283,7 @@ elgg.normalize_url = function(url) {
}
// 'javascript:'
- else if (url.indexOf('javascript:') === 0) {
+ else if (url.indexOf('javascript:') === 0 || url.indexOf('mailto:') === 0 ) {
return url;
}
diff --git a/js/lib/ui.js b/js/lib/ui.js
index c26cbe389..2a4d269d6 100644
--- a/js/lib/ui.js
+++ b/js/lib/ui.js
@@ -257,7 +257,7 @@ elgg.ui.loginHandler = function(hook, type, params, options) {
* @return void
*/
elgg.ui.initDatePicker = function() {
- if ($('.elgg-input-date').length) {
+ var loadDatePicker = function() {
$('.elgg-input-date').datepicker({
// ISO-8601
dateFormat: 'yy-mm-dd',
@@ -273,9 +273,21 @@ elgg.ui.initDatePicker = function() {
}
}
});
+ };
+
+ if ($('.elgg-input-date').length && elgg.get_language() == 'en') {
+ loadDatePicker();
+ } else if ($('.elgg-input-date').length) {
+ elgg.get({
+ url: elgg.config.wwwroot + 'vendors/jquery/i18n/jquery.ui.datepicker-'+ elgg.get_language() +'.js',
+ dataType: "script",
+ cache: true,
+ success: loadDatePicker,
+ error: loadDatePicker // english language is already loaded.
+ });
}
};
elgg.register_hook_handler('init', 'system', elgg.ui.init);
elgg.register_hook_handler('init', 'system', elgg.ui.initDatePicker);
-elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.loginHandler); \ No newline at end of file
+elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.loginHandler);
diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js
index b7d4b2fe4..26020bb4b 100644
--- a/js/lib/ui.widgets.js
+++ b/js/lib/ui.widgets.js
@@ -58,6 +58,7 @@ elgg.ui.widgets.add = function(event) {
handler: type,
owner_guid: elgg.get_page_owner_guid(),
context: $("input[name='widget_context']").val(),
+ show_access: $("input[name='show_access']").val(),
default_widgets: $("input[name='default_widgets']").val() || 0
},
success: function(json) {
diff --git a/js/tests/ElggLibTest.js b/js/tests/ElggLibTest.js
index a29ebf743..2a676e22a 100644
--- a/js/tests/ElggLibTest.js
+++ b/js/tests/ElggLibTest.js
@@ -99,7 +99,7 @@ ElggLibTest.prototype.testNormalizeUrl = function() {
['/mod/plugin/file.php', elgg.config.wwwroot + 'mod/plugin/file.php'],
['/mod/plugin/file.php?p=v&p2=v2', elgg.config.wwwroot + 'mod/plugin/file.php?p=v&p2=v2'],
['/rootfile.php', elgg.config.wwwroot + 'rootfile.php'],
- ['/rootfile.php?p=v&p2=v2', elgg.config.wwwroot + 'rootfile.php?p=v&p2=v2'],
+ ['/rootfile.php?p=v&p2=v2', elgg.config.wwwroot + 'rootfile.php?p=v&p2=v2']
].forEach(function(args) {
assertEquals(args[1], elgg.normalize_url(args[0]));