Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /var/www/mambo.fm/private/_inc/include.php on line 195
function Mambo_reCAPTCHA_onSolved() { Mambo.reCAPTCHA.onSolved(); } function Mambo_reCAPTCHA_onLoad() { Mambo.reCAPTCHA.onLoad(); } var Mambo = { csrf: '47e661d82b63c0026f0f59ca', init: function() { if(document.domain !== 'getmambo.com' && document.domain !== 'mambo.fm') { return; } if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))) { Mambo.Utils.isMobile = true; } $('#header-search').submit(function(e) { e.preventDefault(); return false; }); $('label').inFieldLabels(); $('[data-toggle=tooltip]').tooltip(); $('body').on('click', '[hs-location]', function(e) { e.stopPropagation(); Mambo.Utils.location($(this).attr('hs-location')); }); $('body').on('click', 'a', function(e) { if(typeof $(this).attr('href') === 'string' && $(this).attr('href').length > 0) { if($(this).attr('href') !== 'javascript:void(0);' && $(this).attr('href') !== 'javascript:void(0)' && $(this).attr('href') !== 'javascript:void();' && $(this).attr('href') !== 'javascript:void()') { if(!Mambo.Utils.ctrlPressed && $(this).attr('target') !== '_blank') { Mambo.Utils.progress(true); } } } }); var ReleaseCTRL = null; $('body').keydown(function(e) { Mambo.Utils.ctrlPressed = e.ctrlKey; clearTimeout(ReleaseCTRL); ReleaseCTRL = setTimeout(function() { Mambo.Utils.ctrlPressed = false; }, 1000); }); $('body').keyup(function(e) { Mambo.Utils.ctrlPressed = false; }); $('body').on('keyup', '[hs-max-length-key]', function() { key = $(this).attr('hs-max-length-key'); max_length = $(this).attr('hs-max-length'); value_length = $(this).val().length; $('[hs-max-length-counter="' + key + '"]').html(max_length - value_length); if (value_length > max_length) { $(this).css('color', 'red'); $('[hs-max-length-counter="' + key + '"]').css('color', 'red'); } else { $(this).css('color', ''); $('[hs-max-length-counter="' + key + '"]').css('color', ''); } }); clipboard = new Clipboard('[data-clipboard-text]'); clipboard.on('success', function(e) { toastr.success('You can PASTE this URL wherever you want', 'COPIED!', { timeOut: 10 * 1000 }); e.clearSelection(); }); $('div.modal').on('show.bs.modal', function() { var modal = this; var hash = modal.id; window.location.hash = hash; window.onhashchange = function() { if (!location.hash){ $(modal).modal('hide'); } } }); $('div.modal').on('hide.bs.modal', function() { var hash = this.id; history.pushState('', document.title, window.location.pathname); }); var SearchTimer; $('[hs-search-form=text]').keyup(function() { if ($(this).val().length == 0) { html = '
  • '; html += ' '; html += ' Write to search'; html += ' '; html += '
  • '; $('[hs-search-form=result]').html(html); } else if ($(this).val().length >= 2) { clearTimeout(SearchTimer); html = '
  • '; html += ' '; html += ' Searching...'; html += ' '; html += '
  • '; $('[hs-search-form=result]').html(html); SearchTimer = setTimeout(function() { $.ajax({ url: 'https://mambo.fm/library/com/Search.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), search: $('[hs-search-form=text]').val() }, success: function(response, textStatus, jqXHR) { if (response == 'CAPTCHA') { return Mambo.reCAPTCHA.show(); } try { response = JSON.parse(response); html = ''; for (i7316 = 0; i7316 < response.people.length; i7316++) { html += '
  • '; html += ' '; html += '
    '; html += ' '; html += '
    '; html += ' ' + response.people[i7316].username; if (response.people[i7316].full_name) { html += ' | ' + response.people[i7316].full_name; } html += ' '; html += '
    '; html += '
  • '; } for (i3189 = 0; i3189 < response.place.length; i3189++) { html += '
  • '; html += ' '; html += '
    '; html += ' ' + response.place[i3189].name + ''; html += '
    '; html += '
  • '; } for (i5885 = 0; i5885 < response.place_edu.length; i5885++) { html += '
  • '; html += ' '; html += '
    '; html += ' ' + response.place_edu[i5885].name + ''; html += '
    '; html += '
  • '; } if (html == '') { html = '
  • '; html += ' '; html += ' No results'; html += ' '; html += '
  • '; } $('[hs-search-form=result]').html(html); } catch (e) { html = '
  • '; html += ' '; html += ' Error'; html += ' '; html += '
  • '; $('[hs-search-form=result]').html(html); } }, error: function(jqXHR, textStatus, errorThrown) { html = '
  • '; html += ' '; html += ' Error'; html += ' '; html += '
  • '; $('[hs-search-form=result]').html(html); } }); }, 750); } else { html = '
  • '; html += ' '; html += ' Write to search'; html += ' '; html += '
  • '; $('[hs-search-form=result]').html(html); } }); $('.modal.closeonback').on('show.bs.modal', function() { var modal = this; var hash = modal.id; window.location.hash = hash; window.onhashchange = function() { if (!location.hash) { $(modal).modal('hide'); } } }); $('.modal.closeonback').on('hide.bs.modal', function() { var hash = this.id; history.pushState('', document.title, window.location.pathname); }); if (!Mambo.Utils.isEmptyObject(Mambo.Session)) { setInterval(function() { Mambo.Model.Notification.hasNew(function(response) { if (response === 'CAPTCHA') { return Mambo.reCAPTCHA.show(); } if (typeof response === 'object') { if (response.has_notifications) { $('[hs-header-button-notifications]').show(); } else { $('[hs-header-button-notifications]').hide(); } if (response.unread_conversations > 0) { $('[hs-header-button-messages]').html(response.unread_conversations).show(); } else { $('[hs-header-button-messages]').hide(); } } }); }, 20 * 1000); if (typeof messaging !== 'undefined') { if (!window.localStorage.getItem('FCM_TokenSent') && window.localStorage.getItem('FCM_Token')) { Mambo.Model.UserNotificationToken.FCM(window.localStorage.getItem('FCM_Token'), function(response) { if (response === 'CAPTCHA') { return Mambo.reCAPTCHA.show(); } if (response === 'SUCCESS') { window.localStorage.setItem('FCM_TokenSent', 1); } }); } messaging.onTokenRefresh(function() { messaging.getToken().then(function(token) { window.localStorage.setItem('FCM_Token', token); window.localStorage.setItem('FCM_TokenSent', 0); Mambo.Model.UserNotificationToken.FCM(window.localStorage.getItem('FCM_Token'), function(response) { if (response === 'CAPTCHA') { return Mambo.reCAPTCHA.show(); } if (response === 'SUCCESS') { window.localStorage.setItem('FCM_TokenSent', 1); } }); }).catch(function(e) {}); }); messaging.getToken().then(function(token) { if (token) { if (!Mambo.Storage.Cookies.get('FCM_TokenSent_force')) { Mambo.Storage.Cookies.set('FCM_TokenSent_force', 'wait', 60); window.localStorage.setItem('FCM_Token', token); Mambo.Model.UserNotificationToken.FCM(window.localStorage.getItem('FCM_Token'), function(response) { if (response === 'CAPTCHA') { return Mambo.reCAPTCHA.show(); } if (response === 'SUCCESS') { window.localStorage.setItem('FCM_TokenSent', 1); } }); } } }).catch(function(err) { window.localStorage.setItem('FCM_TokenSent', 0); }); messaging.onMessage(function(payload) { try { showNotification = true; if (payload && payload.data) { if(payload.data.notification_json) { payload.data.notification_json = JSON.parse(payload.data.notification_json); } if(payload.data.notification_type == 'UserConversationMessage' && Mambo.Context.name == 'conversation/message') { if(Mambo.Context.data.user_id == payload.data.notification_json.user.id || Mambo.Session.User.id == payload.data.notification_json.user.id) { showNotification = false; } } if(payload.data.notification_type == 'UserConversationMessage') { payload.data.notification_tag = payload.data.notification_type + '-' + payload.data.notification_json.user.id; } else { payload.data.notification_tag = payload.data.notification_type + '-' + (Math.floor(Math.random() * 6) + 1); } if(showNotification) { navigator.serviceWorker.ready.then(function(registration) { registration.showNotification(payload.data.notification_title, { body: payload.data.notification_body, tag: payload.data.notification_tag, icon: payload.data.notification_icon, data: payload.data }); }); } } } catch (e) { } }); $('[hs-activate-notifications=activate]').click(function() { messaging.requestPermission().then(function() { messaging.getToken().then(function(token) { if (token) { if (window.localStorage.getItem('FCM_Token') && token == window.localStorage.getItem('FCM_Token') && window.localStorage.getItem('FCM_TokenSent')) { return; } window.localStorage.setItem('FCM_Token', token); Mambo.Model.UserNotificationToken.FCM(window.localStorage.getItem('FCM_Token'), function(response) { if (response === 'CAPTCHA') { return Mambo.reCAPTCHA.show(); } if (response === 'SUCCESS') { window.localStorage.setItem('FCM_TokenSent', 1); } }); } }).catch(function(err) { window.localStorage.setItem('FCM_TokenSent', 0); }); }).catch(function(e) {}); }); $('[hs-activate-notifications=not_now]').click(function() { Mambo.Storage.Cookies.set('ActivateNotifications', 'wait', 60 * 60); }); if (typeof Notification !== 'undefined' && Notification.permission !== 'granted' && Notification.permission !== 'denied') { if (!Mambo.Storage.Cookies.get('ActivateNotifications')) { $('[hs-popup=enable_notifications]').modal({ backdrop: 'static', keyboard: false }); } } } if (typeof navigator !== 'undefined') { if ('serviceWorker' in navigator) { window.addEventListener('load', function() { navigator.serviceWorker.register('https://mambo.fm/firebase-messaging-sw.js', { scope: '/' }).then(function(registration) { Mambo.Context.sw = registration; }).catch(function(e) {}); }); } } } else { $('[hs-login-form=submit]').click(function() { if ($('[hs-login-form=submit]').attr('lock')) { return; } $('[hs-login-form=status]').hide(); $('[hs-login-form=submit]').html('Loading...'); $('[hs-login-form=submit]').attr('lock', 'lock'); $.ajax({ url: 'https://mambo.fm/library/com/Login.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), id: $('[hs-login-form=id]').val(), password: $('[hs-login-form=password]').val() }, success: function(response, textStatus, jqXHR) { $('[hs-login-form=submit]').removeAttr('lock'); $('[hs-login-form=submit]').html('Log in'); if (response == 'CAPTCHA') { return Mambo.reCAPTCHA.show(); } try { response = JSON.parse(response); if (response.errors) { $('[hs-login-form=status]').html(response.errors[0]).show(); } else { $('[hs-login-form=status]').html('Internal error').show(); } } catch (e) { if (response == 'SUCCESS') { $('[hs-login-form=submit]').html('Success!'); Mambo.Utils.location('https://mambo.fm/me'); } else { $('[hs-login-form=status]').html('Internal error').show(); } } }, error: function(jqXHR, textStatus, errorThrown) { $('[hs-login-form=submit]').removeAttr('lock'); $('[hs-login-form=submit]').html('Log in'); $('[hs-login-form=status]').html('Internal error').show(); } }); }); $('[hs-signup-form=submit]').click(function() { if ($('[hs-signup-form=submit]').attr('lock')) { return; } if ($('[hs-signup-form=password]').val() != $('[hs-signup-form=password_confirm]').val()) { $('[hs-signup-form=status]').html('Passwords do not match').show(); return; } $('[hs-signup-form=status]').hide(); $('[hs-signup-form=submit]').html('Loading...'); $('[hs-signup-form=submit]').attr('lock', 'lock'); $.ajax({ url: 'https://mambo.fm/library/com/Signup.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), email: $('[hs-signup-form=email]').val(), username: $('[hs-signup-form=username]').val(), password: $('[hs-signup-form=password]').val(), }, success: function(response, textStatus, jqXHR) { $('[hs-signup-form=submit]').removeAttr('lock'); $('[hs-signup-form=submit]').html('Sign up'); if (response == 'CAPTCHA') { return Mambo.reCAPTCHA.show(); } try { response = JSON.parse(response); if (response.errors) { $('[hs-signup-form=status]').html(response.errors[0]).show(); } else { $('[hs-signup-form=status]').html('Internal error').show(); } } catch (e) { if (response.substring(0, 7) == 'SUCCESS') { try { fbq("track", "CompleteRegistration", {value: 0.01, currency: "EUR"}); } catch(e) {} $('[hs-signup-form=submit]').attr('lock', 'lock'); $('[hs-signup-form=submit]').html('Success!'); if(document.domain === 'getmambo.com') { response = JSON.parse(response.substring(8)); html = '
    '; for(var tmp911 in response) { if(response.hasOwnProperty(tmp911)) { html += ''; } } html += '
    '; $(html).appendTo('body').submit(); } else { Mambo.Utils.location('https://mambo.fm/user/update'); } } else { $('[hs-signup-form=status]').html('Internal error').show(); } } }, error: function(jqXHR, textStatus, errorThrown) { $('[hs-signup-form=submit]').removeAttr('lock'); $('[hs-signup-form=submit]').html('Sign up'); $('[hs-signup-form=status]').html('Internal error').show(); } }); }); $('[hs-recover-password-form=submit]').click(function() { if ($('[hs-recover-password-form=submit]').attr('lock')) { return; } $('[hs-recover-password-form=status]').hide(); $('[hs-recover-password-form=submit]').html('Loading...'); $('[hs-recover-password-form=submit]').attr('lock', 'lock'); $.ajax({ url: 'https://mambo.fm/library/com/RecoverPassword.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), id: $('[hs-recover-password-form=id]').val() }, success: function(response, textStatus, jqXHR) { $('[hs-recover-password-form=submit]').removeAttr('lock'); $('[hs-recover-password-form=submit]').html('Recover'); if (response == 'CAPTCHA') { return Mambo.reCAPTCHA.show(); } try { response = JSON.parse(response); if (response.errors) { $('[hs-recover-password-form=status]').html(response.errors[0]).show(); } else { $('[hs-recover-password-form=status]').html('Internal error').show(); } } catch (e) { if (response == 'SUCCESS') { $('[hs-recover-password-form=submit]').html('Success!'); $('[hs-recover-password-form=submit]').attr('lock', 'lock'); Mambo.Utils.alert('Check your email', 'Check your email inbox, there will be an email with a link to reset your password'); } else { $('[hs-recover-password-form=status]').html('Internal error').show(); } } }, error: function(jqXHR, textStatus, errorThrown) { $('[hs-recover-password-form=submit]').removeAttr('lock'); $('[hs-recover-password-form=submit]').html('Recover'); $('[hs-recover-password-form=status]').html('Internal error').show(); } }); }); $('[hs-change-password-form=submit]').click(function() { if($('[hs-change-password-form=submit]').attr('lock')) { return; } $('[hs-change-password-form=status]').hide(); $('[hs-change-password-form=submit]').html('Loading...'); $.ajax({ url: 'https://mambo.fm/library/com/ChangePassword.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), token: $('[hs-change-password-form=token]').val(), password: $('[hs-change-password-form=password]').val(), password_confirm: $('[hs-change-password-form=password_confirm]').val(), // google_recaptcha_response: Mambo.reCAPTCHA.getResponse() }, success: function(response, textStatus, jqXHR) { $('[hs-change-password-form=submit]').removeAttr('lock'); $('[hs-change-password-form=submit]').html('Change password'); if(response == 'CAPTCHA') { return Mambo.reCAPTCHA.show(); } try { response = JSON.parse(response); $('[hs-change-password-form=submit]').removeAttr('lock'); $('[hs-change-password-form=submit]').html('Change password'); if(response.errors) { $('[hs-change-password-form=status]').html(response.errors[0]).show(); } else { $('[hs-change-password-form=status]').html('Internal error').show(); } } catch (e) { if(response == 'SUCCESS') { $('[hs-change-password-form=submit]').html('Success!'); location.href = 'https://mambo.fm/me'; } else { $('[hs-change-password-form=status]').html('Internal error').show(); } } }, error: function(jqXHR, textStatus, errorThrown) { $('[hs-change-password-form=submit]').removeAttr('lock'); $('[hs-change-password-form=submit]').html('Change password'); $('[hs-change-password-form=status]').html('Internal error').show(); } }); }); } }, Context: { name: 'general', data: {} }, Session: {}, Utils: { isMobile: false, staticDomain: function() { if (Mambo.Storage.Cookies.get('static_domain')) { return Mambo.Storage.Cookies.get('static_domain'); } return 'dvhn1eay1i7pi.cloudfront.net'; }, progress: function(start = false) { if (start) { $('[hs-progress]').show(); setTimeout(function() { $('[hs-progress]').hide(); }, 30 * 1000); } if (!$('[hs-progress]').is(":visible")) { return; } $('[hs-progress]').css('width', '0%'); $({ property: 0 }).animate({ property: 105 }, { duration: 1 * 1000, step: function() { percent = Math.round(this.property); $('[hs-progress]').css('width', percent + '%'); if (percent >= 105) { $('[hs-progress]').css('width', '0%'); } }, complete: Mambo.Utils.progress }); }, ctrlPressed: false, isEmptyObject: function(object) { if (object == null) return true; if (object.length > 0) return false; if (object.length === 0) return true; if (typeof object !== "object") return true; for (var key in object) { if (hasOwnProperty.call(object, key)) return false; } return true; }, unixTime: function() { return Math.floor(Date.now() / 1000); }, mentions2Links: function(text) { try { text = text.replace(/(?:https:\/\/)?(?:http:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=)?(.+)/g, ''); } catch (e) {} try { text = text.replace(/@([a-zA-Z0-9._]+)/ig, ' @$1 '); } catch (e) {} try { text = Autolinker.link ( text, { className: 'link-pink' } ); } catch (e) {} return text; }, location: function(url) { if (Mambo.Utils.ctrlPressed) { window.open(url, "_blank"); } else { Mambo.Utils.progress(true); location.href = url; } }, alert: function(title, description, forceCloseWithButton) { $("[hs-popup-alert=title]").html(title); $("[hs-popup-alert=description]").html(description); if (forceCloseWithButton) { $("[hs-popup-alert=hs-popup-alert]").modal({ backdrop: 'static', keyboard: false }); } else { $("[hs-popup-alert=hs-popup-alert]").modal(); } } }, Constants: { Media: { MaxSize: { image: { bytes: 10 * 1024 * 1024 }, audio: { bytes: 10 * 1024 * 1024 }, video: { bytes: 200 * 1024 * 1024 } } } }, Storage: { SessionStorage: { isSupported: function() { if (value === 'value' || (window.sessionStorage && window.sessionStorage.getItem('key') === 'value')) { return true; } else { return false; } }, set: function(key, value) { if (!Mambo.Storage.SessionStorage.isSupported()) { return; } window.sessionStorage.setItem(key, value); window.sessionStorage.setItem(key + '_time', Mambo.UnixTime()); }, get: function(key, value) { if (!Mambo.Storage.SessionStorage.isSupported()) { return; } if (window.sessionStorage.getItem(key)) { if ((Mambo.UnixTime - window.sessionStorage.getItem(key + '_time')) > (60 * 2)) { return; } return window.sessionStorage.getItem(key); } }, delete: function(key) { window.sessionStorage.removeItem(key); window.sessionStorage.removeItem(key + '_time'); } }, Cookies: { set: function(name, value, seconds) { expires = ''; if (seconds) { date = new Date(); date.setTime(date.getTime() + (seconds * 1000)); expires = '; expires=' + date.toUTCString(); } document.cookie = name + '=' + value + '; domain=.' + document.domain + '; path=/' + expires; }, get: function(name) { tmp3 = name + '='; tmp1 = document.cookie.split(';'); for (i1670 = 0; i1670 < tmp1.length; i1670++) { tmp2 = tmp1[i1670]; while (tmp2.charAt(0) == ' ') { tmp2 = tmp2.substring(1, tmp2.length) } if (tmp2.indexOf(tmp3) == 0) { return tmp2.substring(tmp3.length, tmp2.length) } } return null; }, delete: function(name) { Mambo.Storage.Cookies.set(name, '', -1) } } }, reCAPTCHA: { loaded: false, pendingShow: false, getResponse: function() { try { if (typeof grecaptcha !== 'undefined') { return grecaptcha.getResponse(); } } catch (e) {} return null; }, show: function(callback = null) { try { if(typeof callback === 'function') { Mambo.reCAPTCHA.onSolvedUserFN = callback; } if (typeof grecaptcha !== 'undefined') { grecaptcha.render('zqSnAE2m', { 'theme' : 'light', 'sitekey': '6Lf1Dx4UAAAAAI8shqA15uQgeS1sCoqNFBVXsdq4', 'callback': Mambo_reCAPTCHA_onSolved }); } else { Mambo.reCAPTCHA.pendingShow = true; } } catch(e) { Mambo.reCAPTCHA.pendingShow = true; } $('[hs-popup=recaptcha]').modal({ backdrop: 'static', keyboard: false }); }, onSolvedUserFN : null, onSolved: function() { $.ajax({ url: 'https://mambo.fm/library/com/reCAPTCHA.php', type: "POST", data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse() } }); $('[hs-popup=recaptcha]').modal('toggle'); if(typeof Mambo.reCAPTCHA.onSolvedUserFN === 'function') { Mambo.reCAPTCHA.onSolvedUserFN(); } }, onLoad: function() { Mambo.reCAPTCHA.loaded = true; if(Mambo.reCAPTCHA.pendingShow) { Mambo.reCAPTCHA.show(); } } }, Model: { User: { get: function(username, callback = null) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/get.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, getPartial: function(username, callback = null) { if (Mambo.Storage.SessionStorage.get('UserPartial:' + username)) { if (typeof callback === 'function') { return callback(Mambo.Storage.SessionStorage.get('UserPartial:' + username)); } } if (typeof callback === 'function') { callback(null); } }, uploadProfilePhoto: function(file, callback, xhr) { data = new FormData(); data.append('csrf', Mambo.Storage.Cookies.get('csrf')); data.append('google_recaptcha_response', Mambo.reCAPTCHA.getResponse()); data.append('media', file); $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/uploadProfilePhoto.php', type: 'POST', data: data, dataType: 'text', processData: false, contentType: false, xhr: xhr, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, removeProfilePhoto: function(callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/removeProfilePhoto.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse() }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, uploadBackgroundPhoto: function(file, callback, xhr) { data = new FormData(); data.append('csrf', Mambo.Storage.Cookies.get('csrf')); data.append('google_recaptcha_response', Mambo.reCAPTCHA.getResponse()); data.append('media', file); $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/uploadBackgroundPhoto.php', type: 'POST', data: data, dataType: 'text', processData: false, contentType: false, xhr: xhr, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, removeBackgroundPhoto: function(callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/removeBackgroundPhoto.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse() }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, visit: function(username, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/visit.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, block: function(username, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/block.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username }, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, unblock: function(username, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/unblock.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username }, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, getBlockedUsers: function(callback = null) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/getBlockedUsers.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse() }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, follow: function(username, callback = null) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/follow.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, unfollow: function(username, callback = null) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/unfollow.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, getFollowers: function(username, callback = null) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/getFollowers.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, getFollowing: function(username, callback = null) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/getFollowing.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, vote: function(username, stars, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/vote.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username, stars: stars }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, update: function(data, callback) { data.csrf = Mambo.Storage.Cookies.get('csrf'); data.google_recaptcha_response = Mambo.reCAPTCHA.getResponse(); $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/update.php', type: 'POST', data: data, success: function(response) { try { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, updatePlaces: function(data, callback) { data.csrf = Mambo.Storage.Cookies.get('csrf'); data.google_recaptcha_response = Mambo.reCAPTCHA.getResponse(); $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/updatePlaces.php', type: 'POST', data: data, success: function(response) { try { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, changeEmail: function(currentPassword, newEmail, callback) { data = {}; data.csrf = Mambo.Storage.Cookies.get('csrf'); data.google_recaptcha_response = Mambo.reCAPTCHA.getResponse(); data.current_password = currentPassword; data.email = newEmail; $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/changeEmail.php', type: 'POST', data: data, success: function(response) { try { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, changePassword: function(currentPassword, newPassword, callback) { data = {}; data.csrf = Mambo.Storage.Cookies.get('csrf'); data.google_recaptcha_response = Mambo.reCAPTCHA.getResponse(); data.current_password = currentPassword; data.new_password = newPassword; data.password_confirm = newPassword; $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/changePassword.php', type: 'POST', data: data, success: function(response) { try { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, deleteAccount: function(currentPassword, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/deleteAccount.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), current_password: currentPassword }, success: function(response) { try { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, report: function(username, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/User/report.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username }, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); } }, UserWall: { row2html: { comment: function(row, withArticle) { html = ''; if (withArticle) { html += '
    '; } html += '
    '; html += '
    '; html += '

    '; if (row.comment.user) { html += ' ' + row.comment.user.username + ''; } else { html += ' Anonymous'; } html += ' '; html += '

    '; html += '

    '; html += ' '; html += ' ' + row.comment.comment.likes_count + ''; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; html += '
    '; if (row.comment.user) { html += ' '; html += ' '; html += ' '; } else { html += ' '; } html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (row.comment.comment.text) { html += Mambo.Utils.mentions2Links(row.comment.comment.text); } if (row.comment.comment.media) { if (row.comment.comment.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.comment.comment.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again '; } html += '
    '; html += ' '; } else if (row.comment.comment.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.comment.comment.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.comment.comment.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Share'; html += ' · '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; if (!Mambo.Utils.isEmptyObject(row.response)) { html += '
    '; html += '
    '; html += '
    '; html += '
    '; html += ' '; html += '
    '; html += '
    '; html += '
    '; html += '

    '; html += ' ' + row.response.user.username + ''; if (!Mambo.Utils.isEmptyObject(row.response.response.text)) { html += Mambo.Utils.mentions2Links(row.response.response.text); } if (!Mambo.Utils.isEmptyObject(row.response.response.media)) { if (row.response.response.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.response.response.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again '; } html += '
    '; html += ' '; } else if (row.response.response.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.response.response.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.response.response.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Share'; html += ' · '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; html += '
    '; } else { if (!Mambo.Utils.isEmptyObject(Mambo.Session.User) && Mambo.Session.User.id == row.user.id) { html += ' '; html += '
    '; html += ' '; html += '
    '; html += '

    '; html += ' ' + Mambo.Session.User.username + ' '; html += '

    '; html += '

    '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; html += '
    '; html += ' '; html += '
    '; html += '
    '; html += '
    '; html += '
    '; html += ' ​'; html += '
    '; html += ' '; html += '
    '; html += ' '; html += ' '; html += ' '; html += ' '; html += ' Reply'; html += '
    '; html += '
    '; html += '
    '; } else { html += ' '; } } html += '
    '; if (!Mambo.Utils.isEmptyObject(Mambo.Session.User) && Mambo.Session.User.id == row.user.id) { if (Mambo.Utils.isEmptyObject(row.response)) { html += ' Reply '; } } html += '
    '; if (withArticle) { html += '
    '; } html += ' '; html += ' '; return html; }, response: function(row) { html = ''; if (!Mambo.Utils.isEmptyObject(row.response)) { html += '
    '; html += '
    '; html += '
    '; html += ' '; html += '
    '; html += '
    '; html += '
    '; html += '

    '; html += ' ' + row.response.user.username + ''; if (row.response.response.text) { html += Mambo.Utils.mentions2Links(row.response.response.text); } if (row.response.response.media) { if (row.response.response.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.response.response.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again '; } html += '
    '; html += ' '; } else if (row.response.response.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.response.response.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.response.response.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Share'; html += ' · '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; } return html; } }, get: function(username, comment_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserWall/get.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username, comment_id: comment_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, likes: function(username, comment_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserWall/likes.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username, comment_id: comment_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, like: function(username, comment_id, type, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserWall/like.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username, comment_id: comment_id, type: type }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, load: function(username, comment_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserWall/load.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username, comment_id: comment_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, comment: function(form, callback, xhr) { data = new FormData(); data.append('csrf', Mambo.Storage.Cookies.get('csrf')); data.append('google_recaptcha_response', Mambo.reCAPTCHA.getResponse()); if (form.username) { data.append('username', form.username); } if (form.text) { data.append('text', form.text); } if (form.media) { data.append('media', form.media); } if (form.anonymous) { data.append('anonymous', form.anonymous); } $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserWall/comment.php', type: 'POST', data: data, dataType: 'text', processData: false, contentType: false, xhr: xhr, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, answer: function(form, callback, xhr) { data = new FormData(); data.append('csrf', Mambo.Storage.Cookies.get('csrf')); data.append('google_recaptcha_response', Mambo.reCAPTCHA.getResponse()); if (form.comment_id) { data.append('comment_id', form.comment_id); } if (form.text) { data.append('text', form.text); } if (form.media) { data.append('media', form.media); } $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserWall/answer.php', type: 'POST', data: data, dataType: 'text', processData: false, contentType: false, xhr: xhr, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, delete: function(comment_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserWall/delete.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), comment_id: comment_id }, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, report: function(username, comment_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserWall/report.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username, comment_id: comment_id }, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); } }, UserWallPending: { row2html: function(row) { html = ''; html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (row.comment.user) { html += ' ' + row.comment.user.username + ' '; } else { html += ' Anonymous '; } html += ' '; html += '

    '; html += '
    '; html += '
    '; html += '
    '; if (row.comment.user) { html += ' '; html += ' '; html += ' '; } else { html += ' '; } html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (row.comment.comment.text) { html += Mambo.Utils.mentions2Links(row.comment.comment.text); } if (row.comment.comment.media) { if (row.comment.comment.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.comment.comment.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again '; } html += '
    '; html += ' '; } else if (row.comment.comment.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.comment.comment.media.type == 'image') { html += ' '; } } html += '

    '; html += '
    '; html += '
    '; html += '
    '; html += ' '; html += '
    '; html += '
    '; html += ' ​ '; html += '
    '; html += ' '; html += '
    '; html += ' '; html += ' '; html += ' '; html += ' '; html += ' '; html += '
    '; html += '

    '; html += ' Delete '; html += ' Post '; html += '

    '; html += '
    '; html += '
    '; html += '
    '; html += ' '; return html; }, load: function(callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserWallPending/load.php', type: 'POST', data: data, dataType: 'text', processData: false, contentType: false, xhr: xhr, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, answer: function(form, callback, xhr) { data = new FormData(); data.append('csrf', Mambo.Storage.Cookies.get('csrf')); data.append('google_recaptcha_response', Mambo.reCAPTCHA.getResponse()); if (form.comment_id) { data.append('comment_id', form.comment_id); } if (form.text) { data.append('text', form.text); } if (form.media) { data.append('media', form.media); } $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserWallPending/answer.php', type: 'POST', data: data, dataType: 'text', processData: false, contentType: false, xhr: xhr, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, delete: function(comment_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserWallPending/delete.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), comment_id: comment_id }, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); } }, UserPost: { row2html: { gallery: function(row) { html = ''; html += '
  • '; if (row.post.media.type == 'video') { html += ' '; html += ' '; html += ' '; } else if (row.post.media.type == 'image') { html += ' '; html += ' '; html += ' '; } html += '

    '; html += ' '; html += ' ' + row.post.likes_count + ''; html += ' '; html += ' '; html += ' ' + row.post.comments_count + ''; html += ' '; html += '

    '; html += '
  • '; return html; } }, upload: function(form, callback, xhr) { data = new FormData(); data.append('csrf', Mambo.Storage.Cookies.get('csrf')); data.append('google_recaptcha_response', Mambo.reCAPTCHA.getResponse()); if (form.media) { data.append('media', form.media); } if (form.caption) { data.append('caption', form.caption); } $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserPost/upload.php', type: 'POST', data: data, dataType: 'text', processData: false, contentType: false, xhr: xhr, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, get: function(username, post_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserPost/get.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username, post_id: post_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, like: function(username, post_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserPost/like.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username, post_id: post_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, likes: function(username, post_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserPost/likes.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username, post_id: post_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, gallery: function(username, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserPost/gallery.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, delete: function(post_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserPost/delete.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), post_id: post_id }, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, report: function(username, post_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserPost/report.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username, post_id: post_id }, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); } }, UserPostComment: { row2html: { comment: function(row, withDiv) { html = ''; if (withDiv) { html += '
    '; } html += '
    '; html += '
    '; html += ' '; html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (!Mambo.Utils.isEmptyObject(row.user)) { html += ' ' + row.user.username + ''; } else { html += ' Anonymous'; } if (!Mambo.Utils.isEmptyObject(row.comment.text)) { html += Mambo.Utils.mentions2Links(row.comment.text); } if (!Mambo.Utils.isEmptyObject(row.comment.media)) { if (row.comment.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.comment.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again '; } html += '
    '; html += ' '; } else if (row.comment.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.comment.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.comment.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Reply'; html += ' · '; html += ' '; if (!Mambo.Utils.isEmptyObject(Mambo.Session.User) && Mambo.Session.User.id == row.post.user_id) { html += ' · '; html += ' '; html += ' '; html += ' '; } html += ' '; html += '

    '; html += '
    '; if (withDiv) { html += '
    '; } html += ' '; return html; } }, comment: function(form, callback) { data = {}; data.csrf = Mambo.Storage.Cookies.get('csrf'); data.google_recaptcha_response = Mambo.reCAPTCHA.getResponse(); if (form.username) { data.username = form.username; } if (form.post_id) { data.post_id = form.post_id; } if (form.text) { data.text = form.text; } $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserPostComment/comment.php', type: 'POST', data: data, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, like: function(username, post_id, comment_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserPostComment/like.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username, post_id: post_id, comment_id: comment_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, likes: function(username, post_id, comment_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserPostComment/likes.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username, post_id: post_id, comment_id: comment_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, delete: function(post_id, comment_id, callback) { data = {}; data.csrf = Mambo.Storage.Cookies.get('csrf'); data.google_recaptcha_response = Mambo.reCAPTCHA.getResponse(); data.post_id = post_id; data.comment_id = comment_id; $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserPostComment/delete.php', type: 'POST', data: data, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, report: function(form, callback) { data = {}; data.csrf = Mambo.Storage.Cookies.get('csrf'); data.google_recaptcha_response = Mambo.reCAPTCHA.getResponse(); if (form.post_id) { data.post_id = form.post_id; } if (form.comment_id) { data.comment_id = form.comment_id; } $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserPost/report.php', type: 'POST', data: data, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); } }, Conversation: { row2html: { conversation: function(row) { html = ''; html += '
  • '; html += '
    '; html += '
    '; html += ' '; html += ' '; html += ' '; html += '
    '; html += '

    '; html += ' '; html += ' ' + row.user.username + ' ' + ((!row.conversation.read) ? 'UNREAD' : '') + ''; html += ' '; html += '

    '; html += '

    ' + ((row.conversation.text) ? Mambo.Utils.mentions2Links(row.conversation.text) : '') + ((row.conversation.media) ? ' 📸' : '') + '

    '; html += '
    '; html += '
    '; html += '

    '; html += ' '; html += ' '; html += ' '; html += '

    '; html += '

    '; html += '
    '; html += '
  • '; html += ' '; html += ' '; return html; } }, load: function(callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/Conversation/load.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse() }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, delete: function(username, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/Conversation/delete.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username }, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); } }, ConversationMessage: { row2html: { message: function(row) { html = ''; if (row.user.id == Mambo.Session.User.id) { html += '
    '; html += '
    '; html += '
    '; html += ' '; html += '
    '; html += '
    '; html += '
    '; html += '

    '; html += ' You'; if (!Mambo.Utils.isEmptyObject(row.message.text)) { html += Mambo.Utils.mentions2Links(row.message.text); } if (!Mambo.Utils.isEmptyObject(row.message.media)) { if (row.message.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.message.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again '; } html += '
    '; html += ' '; } else if (row.message.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.message.media.type == 'image') { html += ' '; } } html += ' '; html += '

    '; html += '
    '; html += '
    '; } else { html += '
    '; html += '
    '; html += '
    '; html += ' '; html += '
    '; html += '
    '; html += '
    '; html += '

    '; html += ' ' + row.user.username + ''; if (!Mambo.Utils.isEmptyObject(row.message.text)) { html += Mambo.Utils.mentions2Links(row.message.text); } if (!Mambo.Utils.isEmptyObject(row.message.media)) { if (row.message.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.message.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again '; } html += '
    '; html += ' '; } else if (row.message.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.message.media.type == 'image') { html += ' '; } } html += ' '; html += '

    '; html += '
    '; html += '
    '; } return html; } }, load: function(username, message_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/ConversationMessage/load.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), username: username, message_id: message_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, send: function(form, callback, xhr) { data = new FormData(); data.append('csrf', Mambo.Storage.Cookies.get('csrf')); data.append('google_recaptcha_response', Mambo.reCAPTCHA.getResponse()); if (form.username) { data.append('username', form.username); } if (form.text) { data.append('text', form.text); } if (form.media) { data.append('media', form.media); } $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/ConversationMessage/send.php', type: 'POST', data: data, dataType: 'text', processData: false, contentType: false, xhr: xhr, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); } }, Place: { get: function(place, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/Place/get.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), place: place }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, ranking: function(place, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/Place/ranking.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), place: place }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, gallery: function(place, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/Place/gallery.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), place: place }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); } }, PlaceWallComment: { row2html: { comment: function(row, withArticle) { html = ''; if (withArticle) { html += '
    '; } html += '
    '; html += '
    '; html += '

    '; if (!Mambo.Utils.isEmptyObject(row.comment.user)) { html += ' ' + row.comment.user.username + ''; } else { html += ' Anonymous '; } html += ' '; html += '

    '; html += '

    '; html += ' '; html += ' ' + row.comment.comment.likes_count + ''; html += ' '; html += ' '; html += ' ' + row.comment.comment.responses_count + ''; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; html += '
    '; if (!Mambo.Utils.isEmptyObject(row.comment.user)) { html += ' '; html += ' '; html += ' '; } else { html += ' '; } html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (!Mambo.Utils.isEmptyObject(row.comment.comment.text)) { html += Mambo.Utils.mentions2Links(row.comment.comment.text); } if (!Mambo.Utils.isEmptyObject(row.comment.comment.media)) { if (row.comment.comment.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.comment.comment.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again'; } html += '
    '; html += ' '; } else if (row.comment.comment.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.comment.comment.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.comment.comment.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Reply'; html += ' · '; html += ' Share'; html += ' · '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; hasResponses = false; showLoadMoreResponses = false; if (!Mambo.Utils.isEmptyObject(row.response) || !Mambo.Utils.isEmptyObject(row.responses)) { hasResponses = true; } if (!Mambo.Utils.isEmptyObject(row.responses)) { if (row.comment.comment.responses_count > row.responses.length) { showLoadMoreResponses = true; } } html += '
    '; html += ' Load more comments'; html += '
    '; if (!Mambo.Utils.isEmptyObject(row.responses)) { for (k = 0; k < row.responses.length; k++) { html += '
    '; html += '
    '; html += '
    '; if (!Mambo.Utils.isEmptyObject(row.responses[k].user)) { html += ' '; html += ' '; html += ' '; } else { html += ' '; } html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (!Mambo.Utils.isEmptyObject(row.responses[k].user)) { html += ' ' + row.responses[k].user.username + ''; } else { html += ' Anonymous'; } if (!Mambo.Utils.isEmptyObject(row.responses[k].response.text)) { html += Mambo.Utils.mentions2Links(row.responses[k].response.text); } if (!Mambo.Utils.isEmptyObject(row.responses[k].response.media)) { if (row.responses[k].response.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.responses[k].response.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again'; } html += '
    '; html += ' '; } else if (row.responses[k].response.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.responses[k].response.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.responses[k].response.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Reply'; html += ' · '; html += ' Share'; html += ' · '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; } } else if (!Mambo.Utils.isEmptyObject(row.response)) { html += ' View all responses'; html += '
    '; html += '
    '; html += '
    '; if (!Mambo.Utils.isEmptyObject(row.response.user)) { html += ' '; html += ' '; html += ' '; } else { html += ' '; } html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (!Mambo.Utils.isEmptyObject(row.response.user)) { html += ' ' + row.response.user.username + ''; } else { html += ' Anonymous'; } if (!Mambo.Utils.isEmptyObject(row.response.response.text)) { html += Mambo.Utils.mentions2Links(row.response.response.text); } if (!Mambo.Utils.isEmptyObject(row.response.response.media)) { if (row.response.response.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.response.response.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again'; } html += '
    '; html += ' '; } else if (row.response.response.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.response.response.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.response.response.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Reply'; html += ' · '; html += ' Share'; html += ' · '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; } html += '
    '; html += '
    '; html += '
    '; html += ' '; html += '
    '; html += '

    '; if (!Mambo.Utils.isEmptyObject(Mambo.Session.User)) { html += ' ' + Mambo.Session.User.username + ''; html += ' '; } else { html += ' Anonymous'; } html += '

    '; html += '

    '; html += ' '; html += ' '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; if (!Mambo.Utils.isEmptyObject(Mambo.Session.User)) { html += '
    '; html += ' '; html += '
    '; html += ' '; } else { html += '
    '; html += ' '; html += '
    '; } html += '
    '; html += '
    '; html += '
    '; html += ' '; html += '
    '; html += ' 500'; html += '
    '; html += ' '; html += ' '; html += ' '; html += ' '; html += ' Reply'; html += '
    '; html += '
    '; html += '
    '; html += ' '; if (withArticle) { html += '
    '; } return html; } }, get: function(place, comment_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/PlaceWallComment/get.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), place: place, comment_id: comment_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, like: function(place, comment_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/PlaceWallComment/like.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), place: place, comment_id: comment_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, likes: function(place, comment_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/PlaceWallComment/likes.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), place: place, comment_id: comment_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, load: function(place, comment_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/PlaceWallComment/load.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), place: place, comment_id: comment_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, write: function(form, callback, xhr) { data = new FormData(); data.append('csrf', Mambo.Storage.Cookies.get('csrf')); data.append('google_recaptcha_response', Mambo.reCAPTCHA.getResponse()); if (form.place) { data.append('place', form.place); } if (form.text) { data.append('text', form.text); } if (form.media) { data.append('media', form.media); } if (form.anonymous) { data.append('anonymous', form.anonymous); } $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/PlaceWallComment/write.php', type: 'POST', data: data, dataType: 'text', processData: false, contentType: false, xhr: xhr, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, report: function(place, comment_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/PlaceWallComment/report.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), place: place, comment_id: comment_id }, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); } }, PlaceWallMedia: { row2html: { gallery: function(row) { html = ''; html += '
  • '; if (row.media.media.type == 'video') { html += ' '; html += ' '; html += ' '; } else if (row.media.media.type == 'image') { html += ' '; html += ' '; html += ' '; } html += '

    '; html += ' '; html += ' ' + row.media.likes_count + ''; html += ' '; html += ' '; html += ' ' + row.media.responses_count + ''; html += ' '; html += '

    '; html += '
  • '; return html; } } }, PlaceWallCommentResponse: { row2html: { response: function(row, withDiv) { html = ''; if(withDiv) { html += '
    '; } html += '
    '; html += '
    '; if (!Mambo.Utils.isEmptyObject(row.user)) { html += ' '; html += ' '; html += ' '; } else { html += ' '; } html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (!Mambo.Utils.isEmptyObject(row.user)) { html += ' ' + row.user.username + ''; } else { html += ' Anonymous'; } if (!Mambo.Utils.isEmptyObject(row.response.text)) { html += Mambo.Utils.mentions2Links(row.response.text); } if (!Mambo.Utils.isEmptyObject(row.response.media)) { if (row.response.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.response.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again'; } html += '
    '; html += ' '; } else if (row.response.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.response.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.response.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Reply'; html += ' · '; html += ' Share'; html += ' · '; html += ' '; html += ' '; html += '

    '; html += '
    '; if(withDiv) { html += '
    '; } return html; } }, get: function(place, comment_id, response_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/PlaceWallCommentResponse/get.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), place: place, comment_id: comment_id, response_id: response_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, like: function(place, comment_id, response_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/PlaceWallCommentResponse/like.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), place: place, comment_id: comment_id, response_id: response_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, likes: function(place, comment_id, response_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/PlaceWallCommentResponse/likes.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), place: place, comment_id: comment_id, response_id: response_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, load: function(place, comment_id, response_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/PlaceWallCommentResponse/load.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), place: place, comment_id: comment_id, response_id: response_id }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, write: function(form, callback, xhr) { data = new FormData(); data.append('csrf', Mambo.Storage.Cookies.get('csrf')); data.append('google_recaptcha_response', Mambo.reCAPTCHA.getResponse()); if (form.place) { data.append('place', form.place); } if (form.comment_id) { data.append('comment_id', form.comment_id); } if (form.text) { data.append('text', form.text); } if (form.media) { data.append('media', form.media); } if (form.anonymous) { data.append('anonymous', form.anonymous); } $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/PlaceWallCommentResponse/write.php', type: 'POST', data: data, dataType: 'text', processData: false, contentType: false, xhr: xhr, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, report: function(place, comment_id, response_id, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/PlaceWallCommentResponse/report.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), place: place, comment_id: comment_id, response_id: response_id }, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); } }, Notification: { load: function(callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/Notification/load.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse() }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, read: function(callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/Notification/read.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse() }, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, clear: function(callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/Notification/clear.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse() }, success: function(response) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); }, hasNew: function(callback) { data = { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse() }; if (Mambo.Context.name == 'conversation/message') { data.context = Mambo.Context.name; keys = Object.keys(Mambo.Context.data); for (i8179 = 0; i8179 < keys.length; i8179++) { data[keys[i8179]] = Mambo.Context.data[keys[i8179]]; } } $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/Notification/hasNew.php', type: 'POST', data: data, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); } }, UserNotificationToken: { FCM: function(token, callback) { $.ajax({ metadata: { callback: callback }, url: 'https://mambo.fm/library/com/UserNotificationToken/FCM.php', type: 'POST', data: { csrf: Mambo.Storage.Cookies.get('csrf'), google_recaptcha_response: Mambo.reCAPTCHA.getResponse(), token: token }, success: function(response) { try { response = JSON.parse(response); if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } catch (e) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback(response); } } }, error: function(jqXHR, textStatus, errorThrown) { if (this.metadata && this.metadata.callback && typeof this.metadata.callback === 'function') { this.metadata.callback('INTERNAL_ERROR'); } } }); } }, UserList: { row2html: { li: function(row) { html = ''; html += '
  • '; html += '
    '; html += '
    '; html += ' '; html += ' '; html += ' '; html += '
    '; html += '

    '; html += ' '; html += ' ' + row.username + ''; html += ' '; html += '

    '; html += '

    ' + ((row.biography) ? row.biography : '') + '

    '; html += '

    '; html += '
    '; html += '
    '; html += '  '; html += '
    '; html += '
  • '; return html; }, liRank: function(position, row) { html = ''; html += '
  • '; html += '
    '; html += '
    '; html += ' '; html += ' '; html += ' '; html += '
    '; html += '

    '; html += ' '; html += ' ' + position + ' ' + row.username + ''; html += ' '; html += '

    '; html += ' '; html += '

    '; html += ' '; html += ' '; html += ' '; html += ' '; html += ' '; html += ' ' + row.points + ''; html += '

    '; html += '
    '; html += '
    '; html += '

    '; html += ' ' + row.votes + ' votes'; html += '

    '; html += '
    '; html += '
  • '; return html; } } }, Feed: { row2html: { userWall: { comment: function(row) { if(row.type !== 'UserWall') { return ''; } html = ''; html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (row.data.comment.user) { html += ' ' + row.data.comment.user.username + ' ⇒ ' + row.data.user.username + ''; } else { html += ' Anonymous ⇒ ' + row.data.user.username + ''; } html += ' '; html += '

    '; html += '

    '; html += ' '; html += ' ' + row.data.comment.comment.likes_count + ''; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; html += '
    '; if (row.data.comment.user) { html += ' '; html += ' '; html += ' '; } else { html += ' '; } html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (row.data.comment.comment.text) { html += Mambo.Utils.mentions2Links(row.data.comment.comment.text); } if (row.data.comment.comment.media) { if (row.data.comment.comment.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.data.comment.comment.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again '; } html += '
    '; html += ' '; } else if (row.data.comment.comment.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.data.comment.comment.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.data.comment.comment.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Share'; html += ' · '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; if (!Mambo.Utils.isEmptyObject(row.data.response)) { html += '
    '; html += '
    '; html += '
    '; html += '
    '; html += ' '; html += ' '; html += ' '; html += '
    '; html += '
    '; html += '
    '; html += '

    '; html += ' ' + row.data.response.user.username + ''; if (!Mambo.Utils.isEmptyObject(row.data.response.response.text)) { html += Mambo.Utils.mentions2Links(row.data.response.response.text); } if (!Mambo.Utils.isEmptyObject(row.data.response.response.media)) { if (row.data.response.response.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.data.response.response.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again'; } html += '
    '; html += ' '; } else if (row.data.response.response.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.data.response.response.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.data.response.response.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Share'; html += ' · '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; html += '
    '; } else { if (!Mambo.Utils.isEmptyObject(Mambo.Session.User) && Mambo.Session.User.id == row.data.user.id) { html += ''; html += '
    '; html += ' '; html += '
    '; html += '

    '; html += ' ' + Mambo.Session.User.username + ''; html += '

    '; html += '

    '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; html += '
    '; html += ' '; html += '
    '; html += '
    '; html += '
    '; html += '
    '; html += ' '; html += '
    '; html += ' '; html += '
    '; html += ' '; html += ' '; html += ' '; html += ' '; html += ' Reply'; html += '
    '; html += '
    '; html += '
    '; } else { html += ''; } } html += '
    '; if (!Mambo.Utils.isEmptyObject(Mambo.Session.User) && Mambo.Session.User.id == row.data.user.id) { if (Mambo.Utils.isEmptyObject(row.data.response)) { html += ' Reply'; } } html += '
    '; html += '
    '; html += ''; html += ''; return html; }, response: function(row) { html = ''; if (!Mambo.Utils.isEmptyObject(row.response)) { html += '
    '; html += '
    '; html += '
    '; html += ' '; html += '
    '; html += '
    '; html += '
    '; html += '

    '; html += ' ' + row.response.user.username + ''; if (row.response.response.text) { html += Mambo.Utils.mentions2Links(row.response.response.text); } if (row.response.response.media) { if (row.response.response.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.response.response.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again '; } html += '
    '; html += ' '; } else if (row.response.response.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.response.response.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.response.response.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Share'; html += ' · '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; } return html; } }, userPost: function(row) { if(row.type !== 'UserPost') { return ''; } html = ''; html += '
    '; html += '
    '; html += '
    '; html += '

    '; html += ' ' + row.data.user.username + ''; html += ' Has made a new publication'; html += ' '; html += '

    '; html += '

    '; html += ' '; html += ' ' + row.data.post.likes_count + ''; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; html += '
    '; html += ' '; html += ' '; html += ' '; html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (row.data.post.caption) { html += Mambo.Utils.mentions2Links(row.data.post.caption); } if (row.data.post.media) { if (row.data.post.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.data.post.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again '; } html += '
    '; html += ' '; } else if (row.data.post.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.data.post.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.data.post.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Share'; html += ' · '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; html += '
    '; html += ''; return html; }, placeWallComment: function(row) { if(row.type !== 'PlaceWallComment') { return ''; } html = ''; html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (!Mambo.Utils.isEmptyObject(row.data.comment.user)) { html += ' ' + row.data.comment.user.username + ' ⇒ ' + row.data.place.place.name + ' '; } else { html += ' Anonymous ⇒ ' + row.data.place.place.name + ''; } html += ' '; html += '

    '; html += '

    '; html += ' '; html += ' ' + row.data.comment.comment.likes_count + ''; html += ' '; html += ' '; html += ' ' + row.data.comment.comment.responses_count + ''; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; html += '
    '; if(!Mambo.Utils.isEmptyObject(row.data.comment.user)) { html += ' '; html += ' '; html += ' '; } else { html += ' '; html += ' '; html += ' '; } html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (!Mambo.Utils.isEmptyObject(row.data.comment.comment.text)) { html += Mambo.Utils.mentions2Links(row.data.comment.comment.text); } if (!Mambo.Utils.isEmptyObject(row.data.comment.comment.media)) { if (row.data.comment.comment.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.data.comment.comment.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again '; } html += '
    '; html += ' '; } else if (row.data.comment.comment.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.data.comment.comment.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.data.comment.comment.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Reply'; html += ' · '; html += ' Share'; html += ' · '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; hasResponses = false; showLoadMoreResponses = false; if (!Mambo.Utils.isEmptyObject(row.data.responses)) { hasResponses = true; } if (!Mambo.Utils.isEmptyObject(row.data.responses)) { if (row.data.comment.comment.responses_count > row.data.responses.length) { showLoadMoreResponses = true; } } html += '
    '; html += ' Load more comments'; html += '
    '; if (!Mambo.Utils.isEmptyObject(row.data.responses)) { for (k = 0; k < row.data.responses.length; k++) { html += '
    '; html += '
    '; html += '
    '; if (!Mambo.Utils.isEmptyObject(row.data.responses[k].user)) { html += ' '; html += ' '; html += ' '; } else { html += ' '; html += ' '; html += ' '; } html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (!Mambo.Utils.isEmptyObject(row.data.responses[k].user)) { html += ' ' + row.data.responses[k].user.username + ''; } else { html += ' Anonymous'; } if (!Mambo.Utils.isEmptyObject(row.data.responses[k].response.text)) { html += Mambo.Utils.mentions2Links(row.data.responses[k].response.text); } if (!Mambo.Utils.isEmptyObject(row.data.responses[k].response.media)) { if (row.data.responses[k].response.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.data.responses[k].response.time) < 60) { html += '
    '; html += ' The video may be processing. If you can not see it, wait a few seconds and try again'; } html += '
    '; html += ' '; } else if (row.data.responses[k].response.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.data.responses[k].response.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.data.responses[k].response.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Reply'; html += ' · '; html += ' Share'; html += ' · '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; } } html += '
    '; html += '
    '; html += '
    '; html += ' '; html += '
    '; html += '

    '; if (!Mambo.Utils.isEmptyObject(Mambo.Session.User)) { html += ' ' + Mambo.Session.User.username + ''; html += ' '; } else { html += ' Anonymous'; } html += '

    '; html += '

    '; html += ' '; html += ' '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; if (!Mambo.Utils.isEmptyObject(Mambo.Session.User)) { html += '
    '; html += ' '; html += '
    '; html += ' '; } else { html += '
    '; html += ' '; html += '
    '; } html += '
    '; html += '
    '; html += '
    '; html += ' '; html += '
    '; html += ' 500'; html += '
    '; html += ' '; html += ' '; html += ' '; html += ' '; html += ' Reply'; html += '
    '; html += '
    '; html += '
    '; html += ' '; html += '
    '; return html; }, placeWallCommentResponse: function(row) { html = ''; html += '
    '; html += '
    '; html += '
    '; if (!Mambo.Utils.isEmptyObject(row.user)) { html += ' '; html += ' '; html += ' '; } else { html += ' '; } html += '
    '; html += '
    '; html += '
    '; html += '

    '; if (!Mambo.Utils.isEmptyObject(row.user)) { html += ' ' + row.user.username + ''; } else { html += ' Anonymous'; } if (!Mambo.Utils.isEmptyObject(row.response.text)) { html += Mambo.Utils.mentions2Links(row.response.text); } if (!Mambo.Utils.isEmptyObject(row.response.media)) { if (row.response.media.type == 'video') { if ((Mambo.Utils.unixTime() - row.response.time) < 60) { html += '
    '; html += 'The video may be processing. If you can not see it, wait a few seconds and try again '; } html += '
    '; html += ' '; } else if (row.response.media.type == 'audio') { html += '
    '; html += ' '; } else if (row.response.media.type == 'image') { html += ' '; } } html += ' '; html += ' '; html += ' ' + row.response.likes_count + ''; html += ' · '; html += ' '; html += ' Like'; html += ' · '; html += ' Reply'; html += ' · '; html += ' Share'; html += ' · '; html += ' '; html += ' '; html += '

    '; html += '
    '; html += '
    '; return html; } } } } }