19 $(
'.forgot_link,.registration_link').removeClass(
'elgg-lightbox');
20 $(
'.forgot_link[rel="popup"],.registration_link[rel="popup"]').prop(
'rel',
false);
22 $(
document).
on(
'click',
'.forgot_link', walled_garden.load(
'lost_password'));
23 $(
document).
on(
'click',
'.registration_link', walled_garden.load(
'register'));
25 $(
document).
on(
'click',
'input.elgg-button-cancel',
function (event) {
26 var $wgs = $(
'.elgg-walledgarden-single');
27 if ($wgs.is(
':visible')) {
28 $(
'.elgg-walledgarden-double').fadeToggle();
32 event.preventDefault();
36 walled_garden.init = elgg.nullFunction;
44 load:
function (
view) {
45 return function (event) {
46 var
id =
'#elgg-walledgarden-' +
view;
47 id =
id.replace(
'_',
'-');
49 ajax.path(
'walled_garden/' +
view).done(
function (data, statusText, jqXHR) {
50 if (jqXHR.AjaxData.status === -1) {
54 var $wg = $(
'.elgg-body-walledgarden');
57 $(id).find(
'input.elgg-button-submit').after($(
'#elgg-walled-garden-cancel').
html());
59 if (
view ===
'register' && $wg.hasClass(
'hidden')) {
61 $(
'#elgg-walledgarden-login').toggle(
false);
63 $wg.removeClass(
'hidden');
65 $(
'#elgg-walledgarden-login').fadeToggle();
70 event.preventDefault();
75 require([
'elgg/ready'],
function () {
76 elgg.register_hook_handler(
'init',
'system', walled_garden.init);
81 elgg.provide(
'elgg.walled_garden');
82 elgg.walled_garden.init =
function () {
83 elgg.deprecated_notice(
'elgg.walled_garden.init has been deprecated. Use elgg/walled_garden#init AMD method instead',
'2.3');
84 return walled_garden.init.apply(
this, arguments);
86 elgg.walled_garden.load =
function () {
87 elgg.deprecated_notice(
'elgg.walled_garden.load has been deprecated. Use elgg/walled_garden#load AMD method instead',
'2.3');
88 return walled_garden.init.apply(
this, arguments);
$CONFIG view
The current view type.
$CONFIG walled_garden
Is current site in walled garden mode?
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed on
elgg ajax
Wrapper function for jQuery.ajax which ensures that the url being called is relative to the elgg site...
elgg require
Throw an error if the required package isn't present.
GNU GENERAL PUBLIC LICENSE June Free Software Inc Franklin Fifth MA USA Everyone is permitted to copy and distribute verbatim copies of this license document
define(function(require){var elgg=require('elgg');var $=require('jquery');var Ajax=require('elgg/Ajax');var ajax=new Ajax();var walled_garden={init:function(){$('.forgot_link,.registration_link').removeClass('elgg-lightbox');$('.forgot_link[rel="popup"],.registration_link[rel="popup"]').prop('rel', false);$(document).on('click', '.forgot_link', walled_garden.load('lost_password'));$(document).on('click', '.registration_link', walled_garden.load('register'));$(document).on('click', 'input.elgg-button-cancel', function(event){var $wgs=$('.elgg-walledgarden-single');if($wgs.is(':visible')){$('.elgg-walledgarden-double').fadeToggle();$wgs.fadeToggle();$wgs.remove();}event.preventDefault();});walled_garden.init=elgg.nullFunction;}, load:function(view){return function(event){var id= '#elgg-walledgarden-'+view;id=id.replace('_', '-');ajax.path('walled_garden/'+view).done(function(data, statusText, jqXHR){if(jqXHR.AjaxData.status===-1){return;}var $wg=$('.elgg-body-walledgarden');$wg.append(data);$(id).find('input.elgg-button-submit').after($('#elgg-walled-garden-cancel').html());if(view=== 'register'&&$wg.hasClass('hidden')){$('#elgg-walledgarden-login').toggle(false);$(id).toggle();$wg.removeClass('hidden');}else{$('#elgg-walledgarden-login').fadeToggle();$(id).fadeToggle();}});event.preventDefault();};}}require(['elgg/ready'], function(){elgg.register_hook_handler('init', 'system', walled_garden.init);});elgg.provide('elgg.walled_garden');elgg.walled_garden.init=function(){elgg.deprecated_notice('elgg.walled_garden.init has been deprecated.Use elgg/walled_garden#init AMD method instead', '2.3');return walled_garden.init.apply(this, arguments);};elgg.walled_garden.load=function(){elgg.deprecated_notice('elgg.walled_garden.load has been deprecated.Use elgg/walled_garden#load AMD method instead', '2.3');return walled_garden.init.apply(this, arguments);};return walled_garden;})
elgg/walled_garden