GitHost.io will be shut down on June 1, 2019. At that point this instance will be unreachable and all data will be irrevocably deleted. More details at https://about.gitlab.com/gitlab-hosted/#githost-is-shutting-down-on-june-1st-2019

Commit e9e21fd8 authored by hannes's avatar hannes

registration

parent 8f47c3b4
......@@ -22,9 +22,11 @@ along with Qvitter. If not, see <http://www.gnu.org/licenses/>.
Setup
-----
You need a webserver with PHP support.
1. You need a webserver with PHP support.
Edit settings.php.
2. Edit settings.php.
3. You should really put some security-by-obscurity-stuff in the registration process. E-mail h@nnesmannerhe.im if you want to copy mine.
(Qvitter uses a slightly modified statusnet API. Some things will not work
if you connect to a site with standard API. Files are included if you want
......@@ -36,13 +38,11 @@ TODO
1. Join _new_ external groups and follow _new_ external users ("New" meaning users/groups that the server don't know yet)
2. Auto suggest mentions
3. Register
2. Creating groups, make admin, block user
4. Background image uploading/editing
3. Background image uploading/editing
5. Color theme
4. Auto suggest mentions
6. Auto url-shortening setting under queet box
......@@ -64,10 +64,10 @@ TODO
15. Queet-page
16. New api for serving _number_ of new items in several streams (to show number of new items in menu/history)
16. Admin-interface
17. New "expand queet" api for getting conversation, retweets, favs and attachment in the same request
16. New api for serving _number_ of new items in several streams (to show number of new items in menu/history)
18. DMs
17. New "expand queet" api for getting conversation, retweets, favs and attachment in the same request
19. Node.js long polling server and an new api that serve aggregate of all polling users requests in one go
19. Node.js long polling server and an new api that serve aggregate of all polling users requests in one go
\ No newline at end of file
......@@ -6,7 +6,11 @@
* actions/apicheckhub.php New api action (not used yet)
* actions/apiexternalprofileshow.php New api action
* actions/apigroupadmins.php New api action
* actions/apiaccountupdatelinkcolor.php New api action
* actions/apiaccountupdatelinkcolor.php New api action
* actions/apiaccountupdatelinkcolor.php New api action
* actions/apichecknickname.php New api action
* actions/apiaccountregister.php New api action
* lib/apiaction.php
......@@ -93,7 +97,14 @@
array('action' => 'ApiAccountUpdateLinkColor'));
$m->connect('api/account/update_background_color.json',
array('action' => 'ApiAccountUpdateBackgroundColor'));
array('action' => 'ApiAccountUpdateBackgroundColor'));
$m->connect('api/account/register.json',
array('action' => 'ApiAccountRegister'));
$m->connect('api/check_nickname.json',
array('action' => 'ApiCheckNickname'));
- also, tags need regexp to work with unicode charachters, e.g. farsi and arabic:
......
This diff is collapsed.
<?php
/**
* StatusNet, the distributed open-source microblogging tool
*
* Check nickname
*
* Returns 1 if nickname is ok, 0 if not
*
* PHP version 5
*
* LICENCE: This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category API
* @package StatusNet
* @author Hannes Mannerheim <h@nnesmannerhe.im>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
if (!defined('STATUSNET')) {
exit(1);
}
require_once INSTALLDIR . '/lib/apiauth.php';
class ApiCheckNicknameAction extends ApiAction
{
function prepare($args)
{
parent::prepare($args);
return true;
}
function handle($args)
{
parent::handle($args);
$nickname = $this->trimmed('nickname');
if ($this->nicknameExists($nickname)) {
$nickname_ok = 0;
} else if (!User::allowed_nickname($nickname)) {
$nickname_ok = 0; }
else {
$nickname_ok = 1;
}
$this->initDocument('json');
$this->showJsonObjects($nickname_ok);
$this->endDocument('json');
}
function nicknameExists($nickname)
{
$user = User::staticGet('nickname', $nickname);
return is_object($user);
}
}
......@@ -489,7 +489,15 @@ class Router
array('action' => 'ApiAccountUpdateLinkColor'));
$m->connect('api/account/update_background_color.json',
array('action' => 'ApiAccountUpdateBackgroundColor'));
array('action' => 'ApiAccountUpdateBackgroundColor'));
$m->connect('api/account/register.json',
array('action' => 'ApiAccountRegister'));
$m->connect('api/check_nickname.json',
array('action' => 'ApiCheckNickname'));
// users
......
......@@ -721,6 +721,7 @@ function expand_queet(q) {
q.find('.inline-reply-queetbox').remove();
}
else {
rememberMyScrollPos(q.children('.queet'),qid,0);
var collapseTime = 200 + q.find('.stream-item.conversation:not(.hidden-conversation)').length*50;
q.find('.expanded-content').slideUp(collapseTime,function(){$(this).remove();});
q.find('.view-more-container-top').slideUp(collapseTime,function(){$(this).remove();});
......@@ -806,8 +807,10 @@ function expand_queet(q) {
// show conversation
showConversation(qid);
// show inline reply form
q.find('#q-' + qid).append(replyFormHtml(q,qid));
// show inline reply form if logged in
if(typeof window.loginUsername != 'undefined') {
q.find('#q-' + qid).append(replyFormHtml(q,qid));
}
}
}
......@@ -1270,14 +1273,12 @@ function addToFeed(feed, after, extraClasses) {
// actions only for logged in users
var queetActions = '';
var expandHTML = '';
if(typeof window.loginUsername != 'undefined') {
queetActions = '<ul class="queet-actions"><li class="action-reply-container"><a class="with-icn"><span class="icon sm-reply"></span> <b>' + window.sL.replyVerb + '</b></a></li>' + requeetHtml + '<li class="action-fav-container">' + favoriteHtml + '</li></ul>';
expandHTML = '<span class="stream-item-expand">' + window.sL.expand + '</span>';
}
var queetTime = parseTwitterDate(obj.retweeted_status.created_at);
var queetHtml = '<div id="stream-item-' + obj.retweeted_status.id + '" class="stream-item ' + extraClassesThisRun + ' ' + requeetedClass + ' ' + favoritedClass + '" data-quitter-id="' + obj.retweeted_status.id + '" data-conversation-id="' + obj.retweeted_status.statusnet_conversation_id + '" data-quitter-id-in-stream="' + obj.id + '" data-in-reply-to-screen-name="' + in_reply_to_screen_name + '" data-in-reply-to-status-id="' + obj.retweeted_status.in_reply_to_status_id + '"><div class="queet" id="q-' + obj.retweeted_status.id + '"><span class="dogear"></span><div class="queet-content"><div class="stream-item-header"><a class="account-group" href="' + obj.retweeted_status.user.statusnet_profile_url + '"><img class="avatar" src="' + obj.retweeted_status.user.profile_image_url + '" /><strong class="name" data-user-id="' + obj.retweeted_status.user.id + '">' + obj.retweeted_status.user.name + '</strong> <span class="screen-name">@' + obj.retweeted_status.user.screen_name + '</span></a><small class="created-at" data-created-at="' + obj.retweeted_status.created_at + '"><a href="' + obj.retweeted_status.uri + '">' + queetTime + '</a></small></div><div class="queet-text">' + $.trim(obj.retweeted_status.statusnet_html) + '</div><div class="stream-item-footer">' + queetActions + '<div class="context" id="requeet-' + obj.id + '"><span class="with-icn"><i class="badge-requeeted"></i><span class="requeet-text"> ' + window.sL.requeetedBy + '<a href="' + obj.user.statusnet_profile_url + '"> <b>' + obj.user.name + '</b></a></span></span></div>' + expandHTML + '</div></div></div></div>';
var queetHtml = '<div id="stream-item-' + obj.retweeted_status.id + '" class="stream-item ' + extraClassesThisRun + ' ' + requeetedClass + ' ' + favoritedClass + '" data-quitter-id="' + obj.retweeted_status.id + '" data-conversation-id="' + obj.retweeted_status.statusnet_conversation_id + '" data-quitter-id-in-stream="' + obj.id + '" data-in-reply-to-screen-name="' + in_reply_to_screen_name + '" data-in-reply-to-status-id="' + obj.retweeted_status.in_reply_to_status_id + '"><div class="queet" id="q-' + obj.retweeted_status.id + '"><span class="dogear"></span><div class="queet-content"><div class="stream-item-header"><a class="account-group" href="' + obj.retweeted_status.user.statusnet_profile_url + '"><img class="avatar" src="' + obj.retweeted_status.user.profile_image_url + '" /><strong class="name" data-user-id="' + obj.retweeted_status.user.id + '">' + obj.retweeted_status.user.name + '</strong> <span class="screen-name">@' + obj.retweeted_status.user.screen_name + '</span></a><small class="created-at" data-created-at="' + obj.retweeted_status.created_at + '"><a href="' + obj.retweeted_status.uri + '">' + queetTime + '</a></small></div><div class="queet-text">' + $.trim(obj.retweeted_status.statusnet_html) + '</div><div class="stream-item-footer">' + queetActions + '<div class="context" id="requeet-' + obj.id + '"><span class="with-icn"><i class="badge-requeeted"></i><span class="requeet-text"> ' + window.sL.requeetedBy + '<a href="' + obj.user.statusnet_profile_url + '"> <b>' + obj.user.name + '</b></a></span></span></div><span class="stream-item-expand">' + window.sL.expand + '</span></div></div></div></div>';
// detect rtl
queetHtml = detectRTL(queetHtml);
......@@ -1368,14 +1369,12 @@ function addToFeed(feed, after, extraClasses) {
// actions only for logged in users
var queetActions = '';
var expandHTML = '';
if(typeof window.loginUsername != 'undefined') {
queetActions = '<ul class="queet-actions"><li class="action-reply-container"><a class="with-icn"><span class="icon sm-reply"></span> <b>' + window.sL.replyVerb + '</b></a></li>' + requeetHtml + '<li class="action-fav-container">' + favoriteHtml + '</li></ul>';
expandHTML = '<span class="stream-item-expand">' + window.sL.expand + '</span>';
}
var queetTime = parseTwitterDate(obj.created_at);
var queetHtml = '<div id="stream-item-' + obj.id + '" class="stream-item ' + extraClassesThisRun + ' ' + requeetedClass + ' ' + favoritedClass + '" data-quitter-id="' + obj.id + '" data-conversation-id="' + obj.statusnet_conversation_id + '" data-quitter-id-in-stream="' + obj.id + '" data-in-reply-to-screen-name="' + in_reply_to_screen_name + '" data-in-reply-to-status-id="' + obj.in_reply_to_status_id + '"><div class="queet" id="q-' + obj.id + '"><span class="dogear"></span><div class="queet-content"><div class="stream-item-header"><a class="account-group" href="' + obj.user.statusnet_profile_url + '"><img class="avatar" src="' + obj.user.profile_image_url + '" /><strong class="name" data-user-id="' + obj.user.id + '">' + obj.user.name + '</strong> <span class="screen-name">@' + obj.user.screen_name + '</span></a><small class="created-at" data-created-at="' + obj.created_at + '"><a href="' + obj.uri + '">' + queetTime + '</a></small></div><div class="queet-text">' + $.trim(obj.statusnet_html) + '</div><div class="stream-item-footer">' + queetActions + expandHTML + '</div></div></div></div>';
var queetHtml = '<div id="stream-item-' + obj.id + '" class="stream-item ' + extraClassesThisRun + ' ' + requeetedClass + ' ' + favoritedClass + '" data-quitter-id="' + obj.id + '" data-conversation-id="' + obj.statusnet_conversation_id + '" data-quitter-id-in-stream="' + obj.id + '" data-in-reply-to-screen-name="' + in_reply_to_screen_name + '" data-in-reply-to-status-id="' + obj.in_reply_to_status_id + '"><div class="queet" id="q-' + obj.id + '"><span class="dogear"></span><div class="queet-content"><div class="stream-item-header"><a class="account-group" href="' + obj.user.statusnet_profile_url + '"><img class="avatar" src="' + obj.user.profile_image_url + '" /><strong class="name" data-user-id="' + obj.user.id + '">' + obj.user.name + '</strong> <span class="screen-name">@' + obj.user.screen_name + '</span></a><small class="created-at" data-created-at="' + obj.created_at + '"><a href="' + obj.uri + '">' + queetTime + '</a></small></div><div class="queet-text">' + $.trim(obj.statusnet_html) + '</div><div class="stream-item-footer">' + queetActions + '<span class="stream-item-expand">' + window.sL.expand + '</span></div></div></div></div>';
// detect rtl
queetHtml = detectRTL(queetHtml);
......
......@@ -126,6 +126,14 @@ window.l.es.settings = 'Configuración';
window.l.es.saveChanges = 'Guardar cambios';
window.l.es.linkColor = 'Color del enlace';
window.l.es.backgroundColor = 'Color de fondo';
window.l.es.newToQuitter = '¿Eres nuevo en Quitter?';
window.l.es.signUp = 'Regístrate';
window.l.es.signUpFullName = 'Nombre completo';
window.l.es.signUpEmail = 'Correo electrónico';
window.l.es.signUpButtonText = 'Regístrate en Quitter';
window.l.es.welcomeHeading = 'Bienvenido a Quitter.';
window.l.es.welcomeText = 'Somos una <span id="federated-tooltip"><div id="what-is-federation">« Federación » significa que ustedes no debeis tener una cuenta Quitter para seguir sus usuarios, estar seguidos o interaccionar con ellos. ¡Podéis registrar con cualquier servidor StatusNet o <a href="http://www.gnu.org/software/social/">GNU Social</a>, o cualquier servicio utilizando el protocolo <a href="http://www.w3.org/community/ostatus/wiki/Main_Page">OStatus</a>! Incluso, no debéis inscribir vosotros o cualquier cosa puesto que podéis tambien instalar el software GNU Social en vuestro propio servidor. (:</div>federación</span> no comercial de microblogs que, como ustedes, se preocupan de la ética y de la solidaridad, y queremos salir de los servicios centralizados capitalistas. Estamos por aquí desde 2010 y siempre seremos sin ánimo de lucro.';
// french
window.l.fr = new Object();
......@@ -216,6 +224,13 @@ window.l.fr.settings = 'Paramètres';
window.l.fr.saveChanges = 'Sauvegarder les modifications';
window.l.fr.linkColor = 'Couleur des liens';
window.l.fr.backgroundColor = 'Couleur de l\'arrière-plan';
window.l.fr.newToQuitter = 'Nouveau sur Quitter ?';
window.l.fr.signUp = 'Inscrivez-vous';
window.l.fr.signUpFullName = 'Nom complet';
window.l.fr.signUpEmail = 'Email';
window.l.fr.signUpButtonText = 'S\'inscrire sur Quitter';
window.l.fr.welcomeHeading = 'Bienvenue sur Quitter.';
window.l.fr.welcomeText = 'Nous sommes une <span id="federated-tooltip"><div id="what-is-federation">La « fédération » signifie que vous n\'êtes pas obligé d\'avoir un compte Quitter pour pouvoir suivre ses utilisateurs, être suivis par eux ou interagir avec eux. Vous pouvez vous enregistrer sur n\'importe quel serveur StatusNet ou <a href="http://www.gnu.org/software/social/">GNU Social</a>, ou n\'importe quel service utilisant le protocole <a href="http://www.w3.org/community/ostatus/wiki/Main_Page">OStatus</a> ! Vous n\'êtes pas même obligés de vous inscrire où que ce soit, puisque vous pouvez aussi installer le programme GNU Social sur votre propre serveur ! :)</div>fédération</span> de microbloggers qui, comme vous, a le souci de l\'éthique, de la solidarité, et de s\'extraire des services centralisés capitalistes. Nous sommes en ligne depuis 2010 et resterons toujours sans but lucratif.';
// deutsch
......@@ -307,7 +322,13 @@ window.l.de.settings = 'Einstellungen';
window.l.de.saveChanges = 'Änderungen speichern';
window.l.de.linkColor = 'Linkfarbe';
window.l.de.backgroundColor = 'Hintergrundfarbe';
window.l.de.newToQuitter = 'Neu bei Quitter?';
window.l.de.signUp = 'Registriere Dich!';
window.l.de.signUpFullName = 'Vollständiger Name';
window.l.de.signUpEmail = 'E-Mail';
window.l.de.signUpButtonText = 'Registriere Dich bei Quitter!';
window.l.de.welcomeHeading = 'Willkommen bei Quitter!';
window.l.de.welcomeText = 'Wir sind eine Community von Microbloggern, verteilt über einen weltweiten <span id="federated-tooltip"><div id="what-is-federation">"Verbund" bedeutet, dass du nicht selbst einen Quitter-Account brauchst, um mit Quitter-Nutzern zu kommunizieren, ihnen zu folgen oder Follower bei Quitter zu haben. Du kannst dich genauso gut bei einem der anderen <a href="http://www.gnu.org/software/social/">GNU-Social</a>-Server registrieren oder einem anderen Dienst, der das <a href="http://www.w3.org/community/ostatus/wiki/Main_Page">OStatus</a>-Protokoll unterstützt. Du kannst sogar ganz ohne Anmeldung teilnehmen, wenn du dir GNU Social auf deinem eigenen Server installierst.</div>Verbund</span> unabhängiger GNU-Social-Server, auch bekannt als StatusNet. Wir sind genau das Richtige für <strong>Leute wie dich</strong>, denen Ethik und Solidarität etwas bedeuten und die sich nicht mehr an zentralisierten kapitalistischen Diensten beteiligen wollen. Es gibt uns schon seit 2010, und wir werden immer Non-Profit bleiben.';
// english
......@@ -399,6 +420,14 @@ window.l.en.settings = 'Settings';
window.l.en.saveChanges = 'Save changes';
window.l.en.linkColor = 'Link color';
window.l.en.backgroundColor = 'Background color';
window.l.en.newToQuitter = 'New to Quitter?';
window.l.en.signUp = 'Sign up';
window.l.en.signUpFullName = 'Full name';
window.l.en.signUpEmail = 'Email';
window.l.en.signUpButtonText = 'Sign up for Quitter';
window.l.en.welcomeHeading = 'Welcome to Quitter.';
window.l.en.welcomeText = 'We are a <span id="federated-tooltip"><div id="what-is-federation">"Federation" means that you don\'t have to have a Quitter account to be able to follow, be followed by or interact with Quitter users. You can register on any site that supports the <a href="http://www.w3.org/community/ostatus/wiki/Main_Page">Ostatus</a> protocol! You don\'t even have to join a service – try installing the lovely <a href="http://www.gnu.org/software/social/">GNU Social</a> software on your own server! :)</div>federated</span> common, for microbloggers like you who care about ethics and solidarity and want to quit the centralised capitalistic services. We\'ve been around since 2010 and will always be non-profit.';
// svenska
......@@ -490,6 +519,14 @@ window.l.sv.settings = 'Inställningar';
window.l.sv.saveChanges = 'Spara ändringarna';
window.l.sv.linkColor = 'Länkfärg';
window.l.sv.backgroundColor = 'Bakgrundsfärg';
window.l.sv.newToQuitter = 'Ny på Quitter?';
window.l.sv.signUp = 'Registrera dig';
window.l.sv.signUpFullName = 'Fullständigt namn';
window.l.sv.signUpEmail = 'E-post';
window.l.sv.signUpButtonText = 'Registrera dig på Quitter';
window.l.sv.welcomeHeading = 'Välkommen till Quitter.';
window.l.sv.welcomeText = 'Vi är en <span id="federated-tooltip"><div id="what-is-federation">"Federering" betyder att du inte behöver ha ett Quitter-konto för att följa, följas av eller prata med quittrare. Du kan registrera dig på vilken sajt som helst som stödjer protokollet <a href="http://www.w3.org/community/ostatus/wiki/Main_Page">Ostatus</a>, eller mikroblogga på en helt egen server, förslagsvis med den fria programvaran <a href="http://www.gnu.org/software/social/">GNU Social</a> (som Quitter bygger på).</div>federerad</span> allmänning, där du som har hoppat av de centraliserade kapitalistiska tjänsterna kan mikroblogga etiskt och solidariskt. Vi har funnits sedan 2010 och sajten drivs helt ideellt.';
......@@ -582,6 +619,14 @@ window.l.fa.settings = 'تنظیمات';
window.l.fa.saveChanges = 'ذخیره تغییرات';
window.l.fa.linkColor = 'رنگ پیوند';
window.l.fa.backgroundColor = 'رنگ پس‌زمینه';
window.l.fa.newToQuitter = 'تازه واردید؟';
window.l.fa.signUp = 'همین حالا ثبت نام کنید';
window.l.fa.signUpFullName = 'نام و نام‌خانوادگی';
window.l.fa.signUpEmail = 'ایمیل';
window.l.fa.signUpButtonText = 'عضو توییتر شوید';
window.l.fa.welcomeHeading = 'به واگذارنده خوش آمدید.';
window.l.fa.welcomeText = '';
// arabic
......@@ -673,6 +718,14 @@ window.l.ar.settings = 'الإعدادات';
window.l.ar.saveChanges = 'حفظ التغييرات';
window.l.ar.linkColor = 'لون الرابط';
window.l.ar.backgroundColor = 'لون الخلفيّة';
window.l.ar.newToQuitter = 'هل أنت جديد على ترك؟';
window.l.ar.signUp = 'سجّل الآن!';
window.l.ar.signUpFullName = 'الاسم الكامل';
window.l.ar.signUpEmail = 'البريد الإلكترونيّ';
window.l.ar.signUpButtonText = 'التسجيل في ترك';
window.l.ar.welcomeHeading = 'مرحبًا بك في ترك.';
window.l.ar.welcomeText = '';
......@@ -704,11 +757,18 @@ else if(selectedLanguage == 'fa') {
window.siteTitle = $('head title').html(); // remember this for later use
// set some static string
$('.front-welcome-text h1').html(window.sL.welcomeHeading);
$('.front-welcome-text p').html(window.sL.welcomeText);
$('#username').attr('placeholder',window.sL.loginUsername);
$('#password').attr('placeholder',window.sL.loginPassword);
$('button#submit-login').html(window.sL.loginSignIn);
$('#rememberme_label').html(window.sL.loginRememberMe);
$('#remember-forgot a').html(window.sL.loginForgotPassword);
$('.front-signup h2').html('<strong>' + window.sL.newToQuitter + '</strong> ' + window.sL.signUp);
$('#signup-user-name').attr('placeholder',window.sL.signUpFullName);
$('#signup-user-email').attr('placeholder',window.sL.signUpEmail);
$('#signup-user-password').attr('placeholder',window.sL.loginPassword);
$('.front-signup button.signup-btn').html(window.sL.signUpButtonText);
$('#user-queets .label').html(window.sL.notices);
$('#user-following .label').html(window.sL.following);
$('#user-followers .label').html(window.sL.followers);
......
......@@ -54,6 +54,53 @@ function localStorageIsEnabled() {
return false;
}
}
/* ·
·
· Checks if register form is valid
·
· @returns true or false
·
· · · · · · · · · */
function validateRegisterForm(o) {
var nickname = o.find('#signup-user-nickname-step2');
var fullname = o.find('#signup-user-name-step2');
var email = o.find('#signup-user-email-step2');
var homepage = o.find('#signup-user-homepage-step2');
var bio = o.find('#signup-user-bio-step2');
var loc = o.find('#signup-user-location-step2');
var password1 = o.find('#signup-user-password1-step2');
var password2 = o.find('#signup-user-password2-step2');
var passwords = o.find('#signup-user-password1-step2,#signup-user-password2-step2');
var allFieldsValid = true;
if(nickname.val().length>1 && /^[a-zA-Z0-9]+$/.test(nickname.val())) {
nickname.removeClass('invalid'); } else { nickname.addClass('invalid'); if(allFieldsValid)allFieldsValid=false; }
if(fullname.val().length < 255) {
fullname.removeClass('invalid'); } else { fullname.addClass('invalid'); if(allFieldsValid)allFieldsValid=false; }
if(/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email.val())) {
email.removeClass('invalid'); } else { email.addClass('invalid'); if(allFieldsValid)allFieldsValid=false; }
if($.trim(homepage.val()).length==0 || /^(ftp|http|https):\/\/[^ "]+$/.test(homepage.val())) {
homepage.removeClass('invalid'); } else { homepage.addClass('invalid'); if(allFieldsValid)allFieldsValid=false; }
if(bio.val().length < 140) {
bio.removeClass('invalid'); } else { bio.addClass('invalid'); if(allFieldsValid)allFieldsValid=false; }
if(loc.val().length < 255) {
loc.removeClass('invalid'); } else { loc.addClass('invalid'); if(allFieldsValid)allFieldsValid=false; }
if(password1.val().length>5 && password2.val().length>5 && password1.val() == password2.val()) {
passwords.removeClass('invalid'); } else { passwords.addClass('invalid'); if(allFieldsValid)allFieldsValid=false; }
return allFieldsValid;
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment