diff options
| author | Oleg Pudeyev <oleg@bsdpower.com> | 2013-01-08 16:36:35 -0500 |
|---|---|---|
| committer | Oleg Pudeyev <oleg@bsdpower.com> | 2013-01-08 16:36:35 -0500 |
| commit | b96a2fce28cc79878b074534e27f0fa6723989f0 (patch) | |
| tree | e55a7870d90d60f4cd4f0fffb47a8a5b71eb4ca3 /phpBB/styles | |
| parent | ef8cc04dc81391f606ccd52f4180fa3cf585924c (diff) | |
| parent | be7719443587d85402813211d78d7c562a93518b (diff) | |
| download | forums-b96a2fce28cc79878b074534e27f0fa6723989f0.tar forums-b96a2fce28cc79878b074534e27f0fa6723989f0.tar.gz forums-b96a2fce28cc79878b074534e27f0fa6723989f0.tar.bz2 forums-b96a2fce28cc79878b074534e27f0fa6723989f0.tar.xz forums-b96a2fce28cc79878b074534e27f0fa6723989f0.zip | |
Merge PR #1178 branch 'marc1706/ticket/10949' into develop
# By Marc Alexander (2) and Callum Macrae (1)
# Via Marc Alexander
* marc1706/ticket/10949:
[ticket/10949] Remove not needed comma
[ticket/10949] Converted missing code to new JS coding guidelines
[ticket/10949] Converted AJAX coding standards to new guidelines.
Diffstat (limited to 'phpBB/styles')
| -rw-r--r-- | phpBB/styles/prosilver/template/ajax.js | 38 | ||||
| -rw-r--r-- | phpBB/styles/prosilver/template/timezone.js | 8 | ||||
| -rw-r--r-- | phpBB/styles/subsilver2/template/timezone.js | 8 |
3 files changed, 24 insertions, 30 deletions
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index 6637df4c3d..8583fb565c 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -14,13 +14,13 @@ phpbb.closeDarkenWrapper = function(delay) { }; // This callback will mark all forum icons read -phpbb.add_ajax_callback('mark_forums_read', function(res) { +phpbb.addAjaxCallback('mark_forums_read', function(res) { var readTitle = res.NO_UNREAD_POSTS; var unreadTitle = res.UNREAD_POSTS; var iconsArray = { 'forum_unread': 'forum_read', 'forum_unread_subforum': 'forum_read_subforum', - 'forum_unread_locked': 'forum_read_locked', + 'forum_unread_locked': 'forum_read_locked' }; $('li.row').find('dl[class*="forum_unread"]').each(function() { @@ -44,7 +44,7 @@ phpbb.add_ajax_callback('mark_forums_read', function(res) { }); // This callback will mark all topic icons read -phpbb.add_ajax_callback('mark_topics_read', function(res) { +phpbb.addAjaxCallback('mark_topics_read', function(res) { var readTitle = res.NO_UNREAD_POSTS; var unreadTitle = res.UNREAD_POSTS; var iconsArray = { @@ -91,16 +91,14 @@ phpbb.add_ajax_callback('mark_topics_read', function(res) { }); // This callback finds the post from the delete link, and removes it. -phpbb.add_ajax_callback('post_delete', function() { +phpbb.addAjaxCallback('post_delete', function() { var el = $(this), - post_id; - - if (el.attr('data-refresh') === undefined) - { - post_id = el[0].href.split('&p=')[1]; - var post = el.parents('#p' + post_id).css('pointer-events', 'none'); - if (post.hasClass('bg1') || post.hasClass('bg2')) - { + postId; + + if (el.attr('data-refresh') === undefined) { + postId = el[0].href.split('&p=')[1]; + var post = el.parents('#p' + postId).css('pointer-events', 'none'); + if (post.hasClass('bg1') || post.hasClass('bg2')) { var posts1 = post.nextAll('.bg1'); post.nextAll('.bg2').removeClass('bg2').addClass('bg1'); posts1.removeClass('bg1').addClass('bg2'); @@ -112,7 +110,7 @@ phpbb.add_ajax_callback('post_delete', function() { }); // This callback removes the approve / disapprove div or link. -phpbb.add_ajax_callback('post_approve', function(res) { +phpbb.addAjaxCallback('post_approve', function(res) { var remove = (res.approved) ? $(this) : $(this).parents('.post'); $(remove).css('pointer-events', 'none').fadeOut(function() { $(this).remove(); @@ -120,12 +118,12 @@ phpbb.add_ajax_callback('post_approve', function(res) { }); // This removes the parent row of the link or form that fired the callback. -phpbb.add_ajax_callback('row_delete', function() { +phpbb.addAjaxCallback('row_delete', function() { $(this).parents('tr').remove(); }); // This handles friend / foe additions removals. -phpbb.add_ajax_callback('zebra', function(res) { +phpbb.addAjaxCallback('zebra', function(res) { var zebra; if (res.success) { @@ -142,8 +140,7 @@ $('[data-ajax]').each(function() { ajax = $this.attr('data-ajax'), fn; - if (ajax !== 'false') - { + if (ajax !== 'false') { fn = (ajax !== 'true') ? ajax : null; phpbb.ajaxify({ selector: this, @@ -177,12 +174,9 @@ phpbb.ajaxify({ filter: function (data) { var action = $('#quick-mod-select').val(); - if (action === 'make_normal') - { + if (action === 'make_normal') { return $(this).find('select option[value="make_global"]').length > 0; - } - else if (action === 'lock' || action === 'unlock') - { + } else if (action === 'lock' || action === 'unlock') { return true; } diff --git a/phpBB/styles/prosilver/template/timezone.js b/phpBB/styles/prosilver/template/timezone.js index da0a2b0bfd..af8206d12d 100644 --- a/phpBB/styles/prosilver/template/timezone.js +++ b/phpBB/styles/prosilver/template/timezone.js @@ -1,19 +1,19 @@ (function($) { // Avoid conflicts with other libraries $('#tz_date').change(function() { - phpbb.timezone_switch_date(false); + phpbb.timezoneSwitchDate(false); }); $('#tz_select_date_suggest').click(function(){ - phpbb.timezone_preselect_select(true); + phpbb.timezonePreselectSelect(true); }); $(document).ready( - phpbb.timezone_enable_date_selection + phpbb.timezoneEnableDateSelection ); $(document).ready( - phpbb.timezone_preselect_select($('#tz_select_date_suggest').attr('data-is-registration') == 'true') + phpbb.timezonePreselectSelect($('#tz_select_date_suggest').attr('data-is-registration') == 'true') ); })(jQuery); // Avoid conflicts with other libraries diff --git a/phpBB/styles/subsilver2/template/timezone.js b/phpBB/styles/subsilver2/template/timezone.js index da0a2b0bfd..af8206d12d 100644 --- a/phpBB/styles/subsilver2/template/timezone.js +++ b/phpBB/styles/subsilver2/template/timezone.js @@ -1,19 +1,19 @@ (function($) { // Avoid conflicts with other libraries $('#tz_date').change(function() { - phpbb.timezone_switch_date(false); + phpbb.timezoneSwitchDate(false); }); $('#tz_select_date_suggest').click(function(){ - phpbb.timezone_preselect_select(true); + phpbb.timezonePreselectSelect(true); }); $(document).ready( - phpbb.timezone_enable_date_selection + phpbb.timezoneEnableDateSelection ); $(document).ready( - phpbb.timezone_preselect_select($('#tz_select_date_suggest').attr('data-is-registration') == 'true') + phpbb.timezonePreselectSelect($('#tz_select_date_suggest').attr('data-is-registration') == 'true') ); })(jQuery); // Avoid conflicts with other libraries |
