Skip to content

Commit

Permalink
Initial code import
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmmartin committed Dec 17, 2009
1 parent 854b487 commit bdb7c5b
Show file tree
Hide file tree
Showing 13 changed files with 990 additions and 0 deletions.
16 changes: 16 additions & 0 deletions I18n/readme.txt
@@ -0,0 +1,16 @@
If you are interested in translating SimpleModal Login, use simplemodal-login.pot as a template to create a po file for the new translation file.

The resulting translated file should be named with the following format:
- simplemodal-login-
- ISO 639 language code (lowercase)
- an underscore
- ISO 3166-1 alpha-2 country code (uppercase)
- .mo

So for an Italian translation, the file name would be simplemodal-login-it_IT.mo

Please *do not* translate URL's or placeholders, such as %s.

Please send the translated file to eric@ericmmartin.com.

Thanks!
18 changes: 18 additions & 0 deletions I18n/simplemodal-login.pot
@@ -0,0 +1,18 @@
# POT file for SimpleModal Login.
# Copyright (C) 2009 Eric Martin
# This file is distributed under the same license as the SimpleModal Login package.
# Eric Martin <eric@ericmmartin.com>, 2009.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 1.1\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/simplemodal-login\n"
"POT-Creation-Date: 2009-12-10 03:50+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

23 changes: 23 additions & 0 deletions css/simplemodal-login-default.css
@@ -0,0 +1,23 @@
/*
* SimpleModal Login - WordPress Modal Ajax Login
* Theme: default
* Revision:$Id$
* Copyright (c) 2009 Eric Martin http://www.ericmmartin.com
*/

#simplemodal-login-overlay {background-color:#eee;}
#simplemodal-login-container a {color:#666;}
#simplemodal-login-container #login_error {background-color: #ffebe8; border:1px solid #c00; margin-bottom:8px; padding:6px; -moz-border-radius:3px; -khtml-border-radius:3px; -webkit-border-radius:3px; border-radius:3px;}
#simplemodal-login-container #loginform {background:#fff; border:1px solid #e5e5e5; font-weight:normal; margin-left:0 auto; padding:16px 16px 40px 16px; text-align:left; -moz-border-radius:11px; -khtml-border-radius:11px; -webkit-border-radius:11px; border-radius:5px; -moz-box-shadow:rgba(200,200,200,1) 0 4px 18px; -webkit-box-shadow:rgba(200,200,200,1) 0 4px 18px; -khtml-box-shadow:rgba(200,200,200,1) 0 4px 18px; box-shadow:rgba(200,200,200,1) 0 4px 18px;}
#simplemodal-login-container #loginform .forgetmenot {font-weight:normal; float:left; margin-bottom:0; }
#simplemodal-login-container #loginform .submit input {background-color:#257ea8; border:none; border:1px solid; color:#fff; font-weight:bold; padding:3px 10px; font-size:12px; -moz-border-radius:11px; -khtml-border-radius:11px; -webkit-border-radius:11px; border-radius:11px; cursor:pointer; text-decoration:none; margin-top:-3px;}
#simplemodal-login-container #loginform p {margin:0;}
#simplemodal-login-container #loginform label {color:#777; font-size:13px;}
#simplemodal-login-container #loginform .forgetmenot label {font-size:11px; line-height:19px;}
#simplemodal-login-container #loginform .submit {float:right;}
#simplemodal-login-container #loginform .submit input.simplemodal-close {background-color:#c00;}
#simplemodal-login-container #user_pass,
#simplemodal-login-container #user_login,
#simplemodal-login-container #user_email {font-size:24px; width:97%; padding:3px; margin-top:2px; margin-right:6px; margin-bottom:16px; border:1px solid #e5e5e5; background:#fbfbfb;}
#simplemodal-login-container .simplemodal-login-credit {padding-top:4px; text-align:center;}
#simplemodal-login-container .simplemodal-login-credit a {color:#bbb;}
26 changes: 26 additions & 0 deletions css/simplemodal-login-osx.css
@@ -0,0 +1,26 @@
/*
* SimpleModal Login - WordPress Modal Ajax Login
* Theme: osx
* Revision:$Id$
* Copyright (c) 2009 Eric Martin http://www.ericmmartin.com
*/

#simplemodal-login-overlay-osx {background-color:#000; cursor:wait;}
#simplemodal-login-container-osx {background-color:#eee; color:#000; font-family:"Lucida Grande",Arial,sans-serif; font-size:12px; padding-bottom:4px; -moz-border-radius-bottomleft:6px; -webkit-border-bottom-left-radius:6px; -moz-border-radius-bottomright:6px; -webkit-border-bottom-right-radius:6px; -moz-box-shadow:0 0 64px #000; -webkit-box-shadow:0 0 64px #000;}
#simplemodal-login-container-osx #login_error {background-color: #ffebe8; border:1px solid #c00; margin-bottom:8px; padding:6px; -moz-border-radius:3px; -khtml-border-radius:3px; -webkit-border-radius:3px; border-radius:3px;}
#simplemodal-login-container-osx #simplemodal-login-form {text-align:left;}
#simplemodal-login-container-osx #simplemodal-login-form p {margin:0;}
#simplemodal-login-container-osx a {color:#666;}
#simplemodal-login-container-osx .osx-title {color:#000; background-color:#ddd; border-bottom:1px solid #ccc; font-size:14px; font-weight:bold; margin-bottom:10px; padding:6px 8px; text-shadow:0 1px 0 #f4f4f4;}
#simplemodal-login-container-osx .close {display:none; float:right;}
#simplemodal-login-container-osx .close a {display:block; color:#777; font-size:14px; font-weight:bold; padding:6px 12px 0; text-decoration:none; text-shadow:0 1px 0 #f4f4f4;}
#simplemodal-login-container-osx .close a:hover {color:#000; text-decoration:underline;}
#simplemodal-login-container-osx #loginform {padding:0 12px 6px;}
#simplemodal-login-container-osx #loginform .submit {padding:10px 0;}
#simplemodal-login-container-osx #loginform .submit input {background-color:#ddd; border:1px solid #6d6d6d; margin-right:4px; padding:2px 6px; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px;}
#simplemodal-login-container-osx #loginform .submit input:hover {background-color:#63adf6;}
#simplemodal-login-container-osx #user_pass,
#simplemodal-login-container-osx #user_login,
#simplemodal-login-container-osx #user_email {font-size:20px; width:97%; padding:3px; margin-top:2px; margin-right:6px; margin-bottom:12px; border:1px solid #e5e5e5; background:#fbfbfb;}
#simplemodal-login-container-osx .simplemodal-login-credit {text-align:center;}
#simplemodal-login-container-osx .simplemodal-login-credit a {color:#bbb;}
8 changes: 8 additions & 0 deletions js/jquery.simplemodal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

105 changes: 105 additions & 0 deletions js/simplemodal-login-default.js
@@ -0,0 +1,105 @@
/*
* SimpleModal Login
* Theme: default
* Revision: $Id$
* Copyright (c) 2009 Eric Martin http://www.ericmmartin.com
*/
jQuery(function ($) {
var SimpleModalLogin = {
init: function () {
this.error = null;
$('.simplemodal-login').click(function (e) {
e.preventDefault();

$('#simplemodal-login-form').modal({
overlayId: 'simplemodal-login-overlay',
containerId: 'simplemodal-login-container',
opacity:85,
onShow: SimpleModalLogin.show,
position: ['15%',]
});
});
},
show: function (obj) {
var dialog = this,
form = $('#loginform', obj.data[0]);

// focus on username
$('#user_login', form[0]).focus();

form.submit(function (e) {
e.preventDefault();

// remove any existing errors
$('#login_error', form[0]).remove();

if (SimpleModalLogin.isValid(form)) {
$.ajax({
url: form[0].action,
data: form.serialize(),
type: 'POST',
cache: false,
success: function (resp) {
var data = $('<div></div>').append(resp),
error = $('#login_error', data[0]),
loginform = $('#loginform', data[0]);

if (error.length > 0) {
$('p:first', form[0]).before(error);
}
else if (loginform.length > 0) {
SimpleModalLogin.showError(form, 'empty_both');
}
else {
dialog.close();
var redirect = $('#redirect_to', form[0]).val(),
href = location.href;

if (redirect.length > 0) {
href = redirect;
}
window.location = href;
}
}
});
}
else {
SimpleModalLogin.showError(form, SimpleModalLogin.error);
}
});
},
isValid: function (form) {
var log = $.trim($('#user_login', form[0]).val()),
pass = $.trim($('#user_pass', form[0]).val()),
valid = true;

if (!log && !pass) {
SimpleModalLogin.error = 'empty_both';
valid = false;
}
else if (!log) {
SimpleModalLogin.error = 'empty_username';
valid = false;
}
else if (!pass) {
SimpleModalLogin.error = 'empty_password';
valid = false;
}

return valid;
},
message: function (key) {
return SimpleModalLoginL10n[key] ?
SimpleModalLoginL10n[key].replace(/&gt;/g, '>').replace(/&lt;/g, '<') :
key;
},
showError: function (form, key) {
$('p:first', form[0])
.before($('<div id="login_error"></div>').html(
SimpleModalLogin.message(key)
));
}
};

SimpleModalLogin.init();
});

0 comments on commit bdb7c5b

Please sign in to comment.