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

@ -81,7 +81,7 @@ class ContentActions extends Actions
if (!$slug) { if (!$slug) {
$allPosts = Post::find(static::VIEW_FOLDER_FAQ, Post::SORT_ORD_ASC); $allPosts = Post::find(static::VIEW_FOLDER_FAQ, Post::SORT_ORD_ASC);
$allCategories = [ $allCategories = [
'LBRY 101' => 'Intro to LBRY', 'LBRY 101' => 'Intro to LBRY',
'getstarted' => 'Getting Started', 'getstarted' => 'Getting Started',
'publisher' => 'Publishers and Creators', 'publisher' => 'Publishers and Creators',

View file

@ -7,7 +7,7 @@ class DeveloperActions extends Actions
public static function executeQuickstart(string $step = null) public static function executeQuickstart(string $step = null)
{ {
$stepLabels = [ $stepLabels = [
'' => 'Home', '' => 'Home',
'install' => 'Installation', 'install' => 'Installation',
'api' => 'The API', 'api' => 'The API',

View file

@ -63,7 +63,7 @@ class MailActions extends Actions
public static function editEmailSettings(string $token) public static function editEmailSettings(string $token)
{ {
list($status, $headers, $response) = LBRY::emailStatus($token); list($status, $headers, $response) = LBRY::emailStatus($token);
if( $status == 403){ if ($status == 403) {
//Catch 403 to return elegant error message. //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."; $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

@ -35,7 +35,7 @@ class OpsActions extends Actions
} }
$rawPost = file_get_contents('php://input'); $rawPost = file_get_contents('php://input');
$secret = Config::get(Config::GITHUB_KEY); $secret = Config::get(Config::GITHUB_KEY);
if ($hash !== hash_hmac($algo, $rawPost, $secret)) { if ($hash !== hash_hmac($algo, $rawPost, $secret)) {
return NavActions::execute400(['error' => 'Hash does not match.']); return NavActions::execute400(['error' => 'Hash does not match.']);
} }

View file

@ -858,7 +858,7 @@ class S3
{ {
$rest = new S3Request('PUT', $bucket, '', self::$endpoint); $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__); self::__triggerError("S3::setBucketRedirect({$bucket}, {$location}): Empty parameter.", __FILE__, __LINE__);
return false; return false;
} }
@ -876,10 +876,10 @@ class S3
$rest->setHeader('Content-Type', 'application/xml'); $rest->setHeader('Content-Type', 'application/xml');
$rest = $rest->getResponse(); $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'); $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", self::__triggerError(sprintf("S3::setBucketRedirect({$bucket}, {$location}): [%s] %s",
$rest->error['code'], $rest->error['message']), __FILE__, __LINE__); $rest->error['code'], $rest->error['message']), __FILE__, __LINE__);
return false; return false;

View file

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

View file

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

View file

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

View file

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

View file

@ -2,7 +2,7 @@ $(document).ready(function () {
var status_token = localStorage.getItem("status_token"); var status_token = localStorage.getItem("status_token");
var lbry_channel_name_sync = localStorage.getItem("lbry_channel_name_sync"); 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; var url = "/youtube/status/" + status_token;
$("#sync-status").show(); $("#sync-status").show();
$("#sync-status").html("Hey, " + lbry_channel_name_sync + "! " + "<a href='" + url + "'>" + "See your channel sync status here</a>."); $("#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 response = JSON.parse(this._xhr.responseText);
var price = parseFloat(response[0].price_usd); var price = parseFloat(response[0].price_usd);
var lines = Array.prototype.slice.call(document.getElementsByClassName('line'),0); 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 subscriber = line.getElementsByTagName('p')[0];
var monthly = line.getElementsByTagName('p')[1]; var monthly = line.getElementsByTagName('p')[1];
var amount = line.getElementsByTagName('p')[2]; var amount = line.getElementsByTagName('p')[2];
@ -106,7 +106,7 @@ App.prototype._goToTop = function() {
App.prototype._onTick = function() { App.prototype._onTick = function() {
// Header animation // Header animation
this._points.forEach(function(point,i){ this._points.forEach(function(point,i) {
var line = this._lines[i]; var line = this._lines[i];
var path = line.getElement(); var path = line.getElement();
var index = parseFloat(path.getAttribute('data-from')); var index = parseFloat(path.getAttribute('data-from'));
@ -154,7 +154,7 @@ App.prototype._onTick = function() {
TweenLite.set(this._journey,{width:this._percent+'%'}); TweenLite.set(this._journey,{width:this._percent+'%'});
this._steps.forEach(function(step){ this._steps.forEach(function(step) {
var enableAt = parseFloat(step.getAttribute('data-enable')); var enableAt = parseFloat(step.getAttribute('data-enable'));
if (this._percent > enableAt) { if (this._percent > enableAt) {
if (step.className.indexOf('enabled') !== -1) { if (step.className.indexOf('enabled') !== -1) {
@ -167,7 +167,7 @@ App.prototype._onTick = function() {
} }
},this); },this);
} else { } else {
this._steps.forEach(function(step){ this._steps.forEach(function(step) {
if (step.className.indexOf('enabled') === -1) { if (step.className.indexOf('enabled') === -1) {
step.className += ' enabled'; step.className += ' enabled';
} }
@ -176,7 +176,7 @@ App.prototype._onTick = function() {
}; };
App.prototype._onResize = function() { App.prototype._onResize = function() {
this._points.forEach(function(point,i){ this._points.forEach(function(point,i) {
point.resetOrigin(); point.resetOrigin();
},this); },this);
this._start = this._how.offsetTop - this._how.scrollTop - window.innerHeight / 2 - this._offset; 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); var myVideo = document.getElementById(id);
myVideo.play(); myVideo.play();