From adae1958a95d7e801de91d673e927cac348236d9 Mon Sep 17 00:00:00 2001 From: ewinslow Date: Thu, 10 Mar 2011 22:05:49 +0000 Subject: Fixes #2228: Major cleanup of urls -- remove leading pg/ and trailing / from most urls in core and plugins git-svn-id: http://code.elgg.org/elgg/trunk@8653 36083f99-b078-4883-b0ff-0f9b5a30f544 --- js/lib/elgglib.js | 4 ++-- js/lib/languages.js | 2 +- js/lib/userpicker.js | 2 +- js/tests/ElggLibTest.js | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'js') diff --git a/js/lib/elgglib.js b/js/lib/elgglib.js index 12e89392f..3b409d134 100644 --- a/js/lib/elgglib.js +++ b/js/lib/elgglib.js @@ -238,7 +238,7 @@ elgg.inherit = function(Child, Parent) { * If the url is already absolute or protocol-relative, no change is made. * * elgg.normalize_url(''); // 'http://my.site.com/' - * elgg.normalize_url('pg/dashboard'); // 'http://my.site.com/pg/dashboard' + * elgg.normalize_url('dashboard'); // 'http://my.site.com/dashboard' * elgg.normalize_url('http://google.com/'); // no change * elgg.normalize_url('//google.com/'); // no change * @@ -272,7 +272,7 @@ elgg.normalize_url = function(url) { return 'http://' + url; } - // 'pg/page/handler', 'mod/plugin/file.php' + // 'page/handler', 'mod/plugin/file.php' else { // trim off any leading / because the site URL is stored // with a trailing / diff --git a/js/lib/languages.js b/js/lib/languages.js index e464fc0ff..10afa24b0 100644 --- a/js/lib/languages.js +++ b/js/lib/languages.js @@ -25,7 +25,7 @@ elgg.add_translation = function(lang, translations) { */ elgg.reload_all_translations = function(language) { var lang = language || elgg.get_language(); - elgg.getJSON('pg/js/languages%252f' + lang + '.js', { + elgg.getJSON('js/languages%252f' + lang + '.js', { data: { 'viewtype': 'default', 'lastcache': elgg.config.lastcache diff --git a/js/lib/userpicker.js b/js/lib/userpicker.js index 2b3d78d6b..5fc39bce3 100644 --- a/js/lib/userpicker.js +++ b/js/lib/userpicker.js @@ -11,7 +11,7 @@ elgg.userpicker.init = function() { source: function(request, response) { var params = elgg.userpicker.getSearchParams(this); - elgg.get('pg/livesearch', { + elgg.get('livesearch', { data: params, dataType: 'json', success: function(data) { diff --git a/js/tests/ElggLibTest.js b/js/tests/ElggLibTest.js index dda1ecd40..dd0267c5c 100644 --- a/js/tests/ElggLibTest.js +++ b/js/tests/ElggLibTest.js @@ -73,10 +73,10 @@ ElggLibTest.prototype.testNormalizeUrl = function() { [ ['', elgg.config.wwwroot], - ['pg/test', elgg.config.wwwroot + 'pg/test'], + ['test', elgg.config.wwwroot + 'test'], ['http://google.com', 'http://google.com'], ['//example.com', '//example.com'], - ['/pg/page', elgg.config.wwwroot + 'pg/page'], + ['/page', elgg.config.wwwroot + 'page'], ['mod/plugin/index.php', elgg.config.wwwroot + 'mod/plugin/index.php'], ].forEach(function(args) { assertEquals(args[1], elgg.normalize_url(args[0])); -- cgit v1.2.3