Fixed spacing to make it consistent throughout project

This commit is contained in:
Arpit Pandey 2018-10-23 17:27:07 +05:30
parent 8ed5d6a9d5
commit ada937ab1e
12 changed files with 29 additions and 30 deletions

View file

@ -63,7 +63,7 @@ class MailActions extends Actions
public static function editEmailSettings(string $token)
{
list($status, $headers, $response) = LBRY::emailStatus($token);
if( $status == 403){
if ($status == 403) {
//Catch 403 to return elegant error message.
$response['error'] = "This email link is invalid. If you clicked this from an older email it may have been expired for security purposes. Please email help@lbry.io for a valid one.";
}

View file

@ -858,7 +858,7 @@ class S3
{
$rest = new S3Request('PUT', $bucket, '', self::$endpoint);
if( empty($bucket) || empty($location) ) {
if (empty($bucket) || empty($location)) {
self::__triggerError("S3::setBucketRedirect({$bucket}, {$location}): Empty parameter.", __FILE__, __LINE__);
return false;
}
@ -876,10 +876,10 @@ class S3
$rest->setHeader('Content-Type', 'application/xml');
$rest = $rest->getResponse();
if ($rest->error === false && $rest->code !== 200)
if ($rest->error === false && $rest->code !== 200) {
$rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
if ($rest->error !== false)
{
}
if ($rest->error !== false) {
self::__triggerError(sprintf("S3::setBucketRedirect({$bucket}, {$location}): [%s] %s",
$rest->error['code'], $rest->error['message']), __FILE__, __LINE__);
return false;

View file

@ -10,7 +10,7 @@
<?php $isRewardClaimed = $statusData['is_reward_claimed'] ?? false ?>
<?php if (IS_PRODUCTION): ?>
<?php js_start() ?>
if(!localStorage.getItem('status_token')) {
if (!localStorage.getItem('status_token')) {
ga('send', 'event', 'YT Sync', '<?php echo $isSyncAgreed ? "pending" : "queued" ?>', '');
fbq('track', 'Lead');

View file

@ -1,11 +1,11 @@
<?php js_start() ?>
if(localStorage.getItem('status_token')){
if (localStorage.getItem('status_token')) {
var status_token = localStorage.getItem('status_token');
url = '/youtube/status/' + status_token;
$(location).attr('href', url);
}
else{
else {
$(location).attr('href', '/youtube');
}
<?php js_end() ?>

View file

@ -5,7 +5,7 @@ lbry.emailSettingsForm = function (formSelector, tags, userAuthToken) {
tagSection = form.find('.tag-section'),
tagMap = new Map();
$.each(tags, function(tag, enabled){
$.each(tags, function(tag, enabled) {
tagMap[tag] = enabled;
});

View file

@ -1,6 +1,6 @@
var is_first_time = true;
function submitEditForm(){
function submitEditForm() {
$("#youtube_settings").submit(function (event) {
// get value from id
@ -12,21 +12,20 @@ function submitEditForm(){
$('#email-error').hide();
// If the channel name is invalid or blank stop the post request
if(!validateLBRYName(lbry_channel_name) || lbry_channel_name === ''){
if (!validateLBRYName(lbry_channel_name) || lbry_channel_name === '') {
$('#lbry_channel_name').addClass('error_form');
$('#channel-name-error').show();
event.preventDefault();
}
if(!validateEmail(email) || email === ''){
if (!validateEmail(email) || email === '') {
$('#email').addClass('error_form');
$('#email-error').show();
event.preventDefault();
}
else if(!validateEmailIsNotGooglePlus(email)){
else if (!validateEmailIsNotGooglePlus(email)) {
$('#email').addClass('error_form');
if(is_first_time){
if (is_first_time) {
$('#email').addClass('error_form');
$('#email-google-plus-error').show();
is_first_time = false;
@ -49,7 +48,7 @@ function submitDetailsForm() {
$('#lbry_error').hide();
// If the lbry name is invalid or blank stop the post request
if(!validateLBRYName(lbry_channel_name) || lbry_channel_name === '') {
if (!validateLBRYName(lbry_channel_name) || lbry_channel_name === '') {
$('#lbry_channel_name').addClass('error_form');
$('#lbry_error').show();
event.preventDefault();
@ -62,17 +61,17 @@ function validateEmail(email) {
return re.test(email);
}
function validateLBRYName(lbry_channel_name){
function validateLBRYName(lbry_channel_name) {
var re = /^[@A-Za-z0-9-]*$/g;
return re.test(lbry_channel_name);
}
function validateYoutubeChannelUrl(youtube_channel_url){
function validateYoutubeChannelUrl(youtube_channel_url) {
var re = /^UC[A-Za-z0-9_-]{22}$/;
return re.test(youtube_channel_url);
}
function validateEmailIsNotGooglePlus(email){
function validateEmailIsNotGooglePlus(email) {
var re = /^[A-Za-z0-9._%+-]+@(?!plusgoogle.com)[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/;
return re.test(email);
}

View file

@ -2,7 +2,7 @@ $(document).ready(function () {
var status_token = localStorage.getItem("status_token");
var lbry_channel_name_sync = localStorage.getItem("lbry_channel_name_sync");
if (status_token || lbry_channel_name_sync){
if (status_token || lbry_channel_name_sync) {
var url = "/youtube/status/" + status_token;
$("#sync-status").show();
$("#sync-status").html("Hey, " + lbry_channel_name_sync + "! " + "<a href='" + url + "'>" + "See your channel sync status here</a>.");

View file

@ -64,7 +64,7 @@ App.prototype._onReadyStateChange = function(e) {
var response = JSON.parse(this._xhr.responseText);
var price = parseFloat(response[0].price_usd);
var lines = Array.prototype.slice.call(document.getElementsByClassName('line'),0);
lines.forEach(function(line){
lines.forEach(function(line) {
var subscriber = line.getElementsByTagName('p')[0];
var monthly = line.getElementsByTagName('p')[1];
var amount = line.getElementsByTagName('p')[2];
@ -106,7 +106,7 @@ App.prototype._goToTop = function() {
App.prototype._onTick = function() {
// Header animation
this._points.forEach(function(point,i){
this._points.forEach(function(point,i) {
var line = this._lines[i];
var path = line.getElement();
var index = parseFloat(path.getAttribute('data-from'));
@ -154,7 +154,7 @@ App.prototype._onTick = function() {
TweenLite.set(this._journey,{width:this._percent+'%'});
this._steps.forEach(function(step){
this._steps.forEach(function(step) {
var enableAt = parseFloat(step.getAttribute('data-enable'));
if (this._percent > enableAt) {
if (step.className.indexOf('enabled') !== -1) {
@ -167,7 +167,7 @@ App.prototype._onTick = function() {
}
},this);
} else {
this._steps.forEach(function(step){
this._steps.forEach(function(step) {
if (step.className.indexOf('enabled') === -1) {
step.className += ' enabled';
}
@ -176,7 +176,7 @@ App.prototype._onTick = function() {
};
App.prototype._onResize = function() {
this._points.forEach(function(point,i){
this._points.forEach(function(point,i) {
point.resetOrigin();
},this);
this._start = this._how.offsetTop - this._how.scrollTop - window.innerHeight / 2 - this._offset;

View file

@ -1,5 +1,5 @@
function playVideo(id){
function playVideo(id) {
var myVideo = document.getElementById(id);
myVideo.play();