diff options
Diffstat (limited to 'views/default/js')
-rw-r--r-- | views/default/js/admin.php | 45 | ||||
-rw-r--r-- | views/default/js/initialize_elgg.php | 1 | ||||
-rw-r--r-- | views/default/js/lightbox.php | 4 | ||||
-rw-r--r-- | views/default/js/walled_garden.php | 40 |
4 files changed, 45 insertions, 45 deletions
diff --git a/views/default/js/admin.php b/views/default/js/admin.php index d4dd06822..5cefba512 100644 --- a/views/default/js/admin.php +++ b/views/default/js/admin.php @@ -17,9 +17,6 @@ elgg.admin.init = function () { $(this).stop().slideUp('medium'); }); - // plugin screenshot modal - $('.elgg-plugin-screenshot a').click(elgg.admin.displayPluginScreenshot); - // draggable plugin reordering $('#elgg-plugin-list > ul').sortable({ items: 'li:has(> .elgg-state-draggable)', @@ -74,48 +71,6 @@ elgg.admin.movePlugin = function(e, ui) { }; /** - * Display a plugin screenshot. - * - * @param {Object} e The event object. - * @return void - */ -elgg.admin.displayPluginScreenshot = function(e) { - e.preventDefault(); - var lb = $('.elgg-plugin-screenshot-lightbox'); - - if (lb.length < 1) { - $('body').append('<div class="elgg-plugin-screenshot-lightbox"></div>'); - lb = $('.elgg-plugin-screenshot-lightbox'); - - lb.click(function() { - lb.hide(); - }); - - $(document).click(function(e) { - var target = $(e.target); - if (target.is('a') && target.hasClass('elgg-plugin-screenshot-lightbox')) { - lb.hide(); - e.preventDefault(); - } - }); - } - - var html = '<img class="pas" src="' + $(this).attr('href') + '">'; - var desc = $(this).find('img').attr('alt'); - - if (desc) { - html = '<h2 class="pam">' + desc + '</h2>' + html; - } - - lb.html(html); - - top_pos = $(window).scrollTop() + 10 + 'px'; - left_pos = $(window).scrollLeft() + 5 + 'px'; - - lb.css('top', top_pos).css('left', left_pos).show(); -}; - -/** * In-line editing for custom profile fields * * @param string value The new value diff --git a/views/default/js/initialize_elgg.php b/views/default/js/initialize_elgg.php index 09e0b27bc..f8234f84f 100644 --- a/views/default/js/initialize_elgg.php +++ b/views/default/js/initialize_elgg.php @@ -41,6 +41,7 @@ if ($user instanceof ElggUser) { $user_json['subtype'] = $user->getSubtype(); $user_json['url'] = $user->getURL(); + $user_json['admin'] = $user->isAdmin(); echo 'elgg.session.user = new elgg.ElggUser(' . json_encode($user_json) . ');'; } diff --git a/views/default/js/lightbox.php b/views/default/js/lightbox.php index 5f3764756..c45d46098 100644 --- a/views/default/js/lightbox.php +++ b/views/default/js/lightbox.php @@ -5,6 +5,10 @@ * Usage * Apply the class elgg-lightbox to links. * + * Advanced Usage + * Elgg is distributed with the Fancybox jQuery library. Please go to + * http://fancybox.net for more information on the options of this lightbox. + * * Overriding * In a plugin, override this view and override the registration for the * lightbox JavaScript and CSS (@see elgg_views_boot()). diff --git a/views/default/js/walled_garden.php b/views/default/js/walled_garden.php new file mode 100644 index 000000000..46c2934ff --- /dev/null +++ b/views/default/js/walled_garden.php @@ -0,0 +1,40 @@ +<?php +/** + * Walled garden JavaScript + * + * @todo update for new JS lib + */ + +$cancel_button = elgg_view('input/button', array( + 'value' => elgg_echo('cancel'), + 'class' => 'elgg-button-cancel mlm', +)); +$cancel_button = trim($cancel_button); + +?> + +$(document).ready(function() { + + // add cancel button to inline forms + $(".elgg-walledgarden-password").find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>'); + $('.elgg-walledgarden-register').find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>'); + + $(".forgot_link").click(function(event) { + event.preventDefault(); + $(".elgg-walledgarden-password").fadeToggle(); + }); + + $(".registration_link").click(function(event) { + event.preventDefault(); + $(".elgg-walledgarden-register").fadeToggle(); + }); + + $('input.elgg-button-cancel').click(function(event) { + if ($(".elgg-walledgarden-password").is(':visible')) { + $(".forgot_link").click(); + } else if ($('.elgg-walledgarden-register').is(':visible')) { + $(".registration_link").click(); + } + event.preventDefault(); + }); +});
\ No newline at end of file |