From 361e974d2a4c53cda90ec6e962f2ea996eb4f1e4 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Mon, 25 Apr 2016 07:54:42 -0400 Subject: [PATCH] weekend work --- controller/Controller.class.php | 11 +- controller/action/ContentActions.class.php | 48 -------- controller/action/CreditActions.class.php | 2 +- controller/action/DownloadActions.class.php | 107 ++++++++++++++++++ controller/action/MailActions.class.php | 11 +- lib/exception/ErrorException.class.php | 11 -- model/CreditApi.class.php | 2 +- view/View.class.php | 3 +- view/template/download/_betaNotice.php | 4 + view/template/download/_developers.php | 3 + view/template/download/_linux.php | 17 +++ view/template/download/_list.php | 11 ++ view/template/download/_osx.php | 6 + view/template/download/_reward.php | 35 ++++++ view/template/download/_unavailable.php | 1 + .../{get => download}/feedback-prompt.php | 0 view/template/{page => download}/get.php | 0 view/template/download/get2.php | 28 +++++ view/template/{page => fund}/fund.php | 0 view/template/get/alphaNotice.php | 4 - view/template/get/getSharedApp.php | 31 ----- view/template/layout/basic.php | 2 +- view/template/page/feedback.php | 2 +- view/template/page/home-new.php | 71 ------------ view/template/page/home.php | 6 +- view/template/page/join-list.php | 2 +- view/template/page/linux.php | 22 ---- view/template/page/navframe.php | 4 - view/template/page/osx.php | 12 -- web/js/global.js | 2 +- web/scss/_basic.scss | 7 +- web/scss/_blog.scss | 1 - web/scss/_content.scss | 7 ++ web/scss/_cover.scss | 2 +- web/scss/_global.scss | 4 +- web/scss/_grid.scss | 4 +- web/scss/_reset.scss | 2 +- web/scss/_sale.scss | 1 + 38 files changed, 252 insertions(+), 234 deletions(-) create mode 100644 controller/action/DownloadActions.class.php delete mode 100644 lib/exception/ErrorException.class.php create mode 100644 view/template/download/_betaNotice.php create mode 100644 view/template/download/_developers.php create mode 100644 view/template/download/_linux.php create mode 100644 view/template/download/_list.php create mode 100644 view/template/download/_osx.php create mode 100644 view/template/download/_reward.php create mode 100644 view/template/download/_unavailable.php rename view/template/{get => download}/feedback-prompt.php (100%) rename view/template/{page => download}/get.php (100%) create mode 100644 view/template/download/get2.php rename view/template/{page => fund}/fund.php (100%) delete mode 100644 view/template/get/alphaNotice.php delete mode 100644 view/template/get/getSharedApp.php delete mode 100644 view/template/page/home-new.php delete mode 100644 view/template/page/linux.php delete mode 100644 view/template/page/navframe.php delete mode 100644 view/template/page/osx.php diff --git a/controller/Controller.class.php b/controller/Controller.class.php index b91296e3..c763d3ac 100644 --- a/controller/Controller.class.php +++ b/controller/Controller.class.php @@ -11,7 +11,9 @@ class Controller { try { - list($viewTemplate, $viewParameters) = static::execute($uri); + $viewAndParams = static::execute($uri); + $viewTemplate = $viewAndParams[0]; + $viewParameters = isset($viewAndParams[1]) ? $viewAndParams[1] : []; if ($viewTemplate === null) { @@ -42,7 +44,12 @@ class Controller case '/fund': return CreditActions::executeFund(); case '/get': - return ContentActions::executeGet(); + case '/windows': + case '/ios': + case '/android': + case '/linux': + case '/osx': + return DownloadActions::executeGet(); case '/postcommit': return OpsActions::executePostCommit(); case '/log-upload': diff --git a/controller/action/ContentActions.class.php b/controller/action/ContentActions.class.php index 424f0da6..d80cdd0e 100644 --- a/controller/action/ContentActions.class.php +++ b/controller/action/ContentActions.class.php @@ -14,52 +14,4 @@ class ContentActions extends Actions 'totalPeople' => CreditApi::getTotalPeople() ]]; } - - public static function executeGet() - { - $hasEmail = isset($_GET['email']) && $_GET['email']; - if ($hasEmail && Session::get(Session::KEY_LIST_SUB_ERROR)) - { - Controller::redirect('/get'); - } - return ['page/get', [ - 'isSubscribed' => $hasEmail || in_array(Mailchimp::LIST_GENERAL_ID, Session::get(Session::KEY_MAILCHIMP_LIST_IDS, [])) - ]]; - } -// -// protected static function validateDownloadAccess() -// { -// $seshionKey = 'has-download-access'; -// if (Session::get($seshionKey)) -// { -// return true; -// } -// -// if ($_SERVER['REQUEST_METHOD'] === 'POST') -// { -// $accessCodes = include ROOT_DIR . '/data/secret/access_list.php'; -// $today = date('Y-m-d H:i:s'); -// foreach($accessCodes as $code => $date) -// { -// if ($_POST['invite'] == $code && $today <= $date) -// { -// Session::set($seshionKey, true); -// Controller::redirect('/get', 302); -// } -// } -// -// if ($_POST['invite']) -// { -// Session::set('invite_error', 'Please provide a valid invite code.'); -// } -// else -// { -// Session::set('invite_error', 'Please provide an invite code.'); -// } -// -// Controller::redirect('/get', 401); -// } -// -// return false; -// } } diff --git a/controller/action/CreditActions.class.php b/controller/action/CreditActions.class.php index 94692977..b9aed065 100644 --- a/controller/action/CreditActions.class.php +++ b/controller/action/CreditActions.class.php @@ -11,7 +11,7 @@ class CreditActions extends Actions { $fundStartTime = strtotime('2015-11-15'); $daysActive = floor((time() - $fundStartTime) / (60*60*24)); - return ['page/fund', [ + return ['fund/fund', [ 'creditsPerDollar' => CreditApi::getCreditsPerDollar($daysActive), 'creditsPerDollarTomorrow' => CreditApi::getCreditsPerDollar($daysActive + 1), ]]; diff --git a/controller/action/DownloadActions.class.php b/controller/action/DownloadActions.class.php new file mode 100644 index 00000000..2cc2432f --- /dev/null +++ b/controller/action/DownloadActions.class.php @@ -0,0 +1,107 @@ + ['/linux', 'Linux', 'icon-linux', '_linux'], + static::OS_ANDROID => ['/android', 'Android', 'icon-android', '_android'], + static::OS_OSX => ['/osx', 'OS X', 'icon-apple', '_osx'], + static::OS_WINDOWS => ['/windows', 'Windows', 'icon-windows', '_windows'], + static::OS_IOS => ['/ios', 'iOS', 'icon-ios', '_ios'] + ]; + } + + public static function executeGet() + { + $osChoices = static::getOses(); + $os = static::guessOs(); + if (isset($osChoices[$os])) + { + list($uri, $osTitle, $osIcon, $partial) = $osChoices[$os]; + return ['download/get2', [ + 'os' => $os, + 'osTitle' => $osTitle, + 'osIcon' => $osIcon, + 'downloadHtml' => View::exists('download/' . $partial) ? + View::render('download/' . $partial) : + false + ]]; + } + return ['download/get', [ + 'isSubscribed' => in_array(Mailchimp::LIST_GENERAL_ID, Session::get(Session::KEY_MAILCHIMP_LIST_IDS, [])) + ]]; + } + + public static function prepareListPartial(array $vars) + { + return $vars + ['osChoices' => isset($vars['excludeOs']) ? + array_diff_key(static::getOses(), [$vars['excludeOs'] => null]) : + static::getOses() + ]; + } + + //implement me! + protected static function guessOs() + { + $uri = strtok($_SERVER['REQUEST_URI'], '?'); + foreach(static::getOses() as $os => $osChoice) + { + if ($osChoice[0] == $uri) + { + return $os; + } + } +// $oses = ['linux', 'windows', 'osx', 'ios', 'android']; + $oses = ['linux', 'windows', 'osx']; + return $oses[rand(0, count($oses) - 1)]; + } + +// protected static function validateDownloadAccess() +// { +// $seshionKey = 'has-get-access'; +// if (Session::get($seshionKey)) +// { +// return true; +// } +// +// if ($_SERVER['REQUEST_METHOD'] === 'POST') +// { +// $accessCodes = include ROOT_DIR . '/data/secret/access_list.php'; +// $today = date('Y-m-d H:i:s'); +// foreach($accessCodes as $code => $date) +// { +// if ($_POST['invite'] == $code && $today <= $date) +// { +// Session::set($seshionKey, true); +// Controller::redirect('/get', 302); +// } +// } +// +// if ($_POST['invite']) +// { +// Session::set('invite_error', 'Please provide a valid invite code.'); +// } +// else +// { +// Session::set('invite_error', 'Please provide an invite code.'); +// } +// +// Controller::redirect('/get', 401); +// } +// +// return false; +// } +} diff --git a/controller/action/MailActions.class.php b/controller/action/MailActions.class.php index a56e0415..9fb72235 100644 --- a/controller/action/MailActions.class.php +++ b/controller/action/MailActions.class.php @@ -21,11 +21,11 @@ class MailActions extends Actions $email = $_POST['email']; if (!$email|| !filter_var($email, FILTER_VALIDATE_EMAIL)) { - Session::set('list_error', $email ? __('Please provide a valid email address.') : __('Please provide an email address.')); + Session::set(Session::KEY_LIST_SUB_ERROR, $email ? __('Please provide a valid email address.') : __('Please provide an email address.')); } elseif (!$_POST['listId']) { - Session::set('list_error', __('List not provided.')); + Session::set(Session::KEY_LIST_SUB_ERROR, __('List not provided.')); } else { @@ -42,7 +42,7 @@ class MailActions extends Actions else { $error = $mcApi->errorMessage ?: __('Something went wrong adding you to the list.'); - Session::set('list_error', $error); + Session::set(Session::KEY_LIST_SUB_ERROR, $error); } } @@ -56,8 +56,8 @@ class MailActions extends Actions if (Session::get(Session::KEY_LIST_SUB_SIGNATURE) == $vars['listSig']) { - $vars['error'] = Session::get('list_error'); - Session::unsetKey('list_error'); + $vars['error'] = Session::get(Session::KEY_LIST_SUB_ERROR); + Session::unsetKey(Session::KEY_LIST_SUB_ERROR); $vars['success'] = Session::get(Session::KEY_LIST_SUB_SUCCESS) ? __('Great success! Welcome to LBRY.') : false; $vars['fbEvent'] = Session::get(Session::KEY_LIST_SUB_FB_EVENT) ?: 'Lead'; @@ -72,5 +72,4 @@ class MailActions extends Actions return $vars; } - } \ No newline at end of file diff --git a/lib/exception/ErrorException.class.php b/lib/exception/ErrorException.class.php deleted file mode 100644 index 81e2d9d1..00000000 --- a/lib/exception/ErrorException.class.php +++ /dev/null @@ -1,11 +0,0 @@ - + This is a pre-release, beta version of LBRY. + Something something something. + \ No newline at end of file diff --git a/view/template/download/_developers.php b/view/template/download/_developers.php new file mode 100644 index 00000000..cf52ac03 --- /dev/null +++ b/view/template/download/_developers.php @@ -0,0 +1,3 @@ +
+

Developers

+
\ No newline at end of file diff --git a/view/template/download/_linux.php b/view/template/download/_linux.php new file mode 100644 index 00000000..1b2eb359 --- /dev/null +++ b/view/template/download/_linux.php @@ -0,0 +1,17 @@ +
Choose your install level.
+
+
+

Casuals

+

+ Download .deb +

+
+
+

Masochists Professionals

+
    +
  1. Clone and follow the build steps for lbryum, a lightweight client for LBRY.
  2. +
  3. Clone and follow the build steps for lbry, a console based application for using the LBRY protocol.
  4. +
+
+
+ diff --git a/view/template/download/_list.php b/view/template/download/_list.php new file mode 100644 index 00000000..5d22d460 --- /dev/null +++ b/view/template/download/_list.php @@ -0,0 +1,11 @@ +
+

Other Systems

+ + +

+ + + +

+ +
\ No newline at end of file diff --git a/view/template/download/_osx.php b/view/template/download/_osx.php new file mode 100644 index 00000000..dcb5ae57 --- /dev/null +++ b/view/template/download/_osx.php @@ -0,0 +1,6 @@ +

+ Download for OS X +

+

Or, view the source and compile instructions on + GitHub. +

diff --git a/view/template/download/_reward.php b/view/template/download/_reward.php new file mode 100644 index 00000000..bf77f3b7 --- /dev/null +++ b/view/template/download/_reward.php @@ -0,0 +1,35 @@ + +
+

Test and Earn

+ +

Test Your Install

+
    +
  1. Double click the app (LBRY will open in your browser)
  2. +
  3. Search and stream wonderfullife
  4. +
  5. Continue to play as you desire
  6. +
+

Feedback

+

+ In addition to , your feedback will be personally read by the developers and help signal + interest in LBRY to investors. +

+ Provide Your Feedback +
+ +
+

Test and Earn

+ +

Test Your Install

+
    +
  1. Double click the app (LBRY will open in your browser)
  2. +
  3. Search and stream wonderfullife
  4. +
  5. Continue to play as you desire
  6. +
+

Feedback

+

+ In addition to , your feedback will be personally read by the developers and help signal + interest in LBRY to investors. +

+ Provide Your Feedback +
*/ ?> \ No newline at end of file diff --git a/view/template/download/_unavailable.php b/view/template/download/_unavailable.php new file mode 100644 index 00000000..96b2c861 --- /dev/null +++ b/view/template/download/_unavailable.php @@ -0,0 +1 @@ +not avail \ No newline at end of file diff --git a/view/template/get/feedback-prompt.php b/view/template/download/feedback-prompt.php similarity index 100% rename from view/template/get/feedback-prompt.php rename to view/template/download/feedback-prompt.php diff --git a/view/template/page/get.php b/view/template/download/get.php similarity index 100% rename from view/template/page/get.php rename to view/template/download/get.php diff --git a/view/template/download/get2.php b/view/template/download/get2.php new file mode 100644 index 00000000..aea522b0 --- /dev/null +++ b/view/template/download/get2.php @@ -0,0 +1,28 @@ + $osTitle])) ?> + + false]) ?> + +
+
+
+

LBRY for

+ + + + + + +
+ + + +
+
+ $os + ]) ?> + +
+
+ + diff --git a/view/template/page/fund.php b/view/template/fund/fund.php similarity index 100% rename from view/template/page/fund.php rename to view/template/fund/fund.php diff --git a/view/template/get/alphaNotice.php b/view/template/get/alphaNotice.php deleted file mode 100644 index 7cbe6b82..00000000 --- a/view/template/get/alphaNotice.php +++ /dev/null @@ -1,4 +0,0 @@ -
- This is a pre-release, alpha version of LBRY. It is only designed to show what LBRY makes possible. - Future releases will involve a full network reboot. -
\ No newline at end of file diff --git a/view/template/get/getSharedApp.php b/view/template/get/getSharedApp.php deleted file mode 100644 index 1d93b323..00000000 --- a/view/template/get/getSharedApp.php +++ /dev/null @@ -1,31 +0,0 @@ - - false]) ?> - -
-
-
- -
-
-
- -
-

Test and Earn

- -

Test Your Install

-
    -
  1. Double click the app (LBRY will open in your browser)
  2. -
  3. Search and stream wonderfullife
  4. -
  5. Continue to play as you desire
  6. -
-

Feedback

-

- In addition to , your feedback will be personally read by the developers and help signal - interest in LBRY to investors. -

- Provide Your Feedback -
-
-
- - \ No newline at end of file diff --git a/view/template/layout/basic.php b/view/template/layout/basic.php index 2d4acf90..05d6bbea 100644 --- a/view/template/layout/basic.php +++ b/view/template/layout/basic.php @@ -12,7 +12,7 @@ 'LBRY' ?> <?php echo $title ?> - + diff --git a/view/template/page/feedback.php b/view/template/page/feedback.php index d805cddb..89df4907 100644 --- a/view/template/page/feedback.php +++ b/view/template/page/feedback.php @@ -7,7 +7,7 @@

- +
diff --git a/view/template/page/home-new.php b/view/template/page/home-new.php deleted file mode 100644 index 6c367deb..00000000 --- a/view/template/page/home-new.php +++ /dev/null @@ -1,71 +0,0 @@ -
- - - true]) ?> -
-
-
-
-
-

Stream, Share, Earn.

-
- - -
- - - others in - - ', $labels) ?> - -
-
-
- Fund LBRY -
- -
-
- -
-
-
-
- -
-
- -
-
-
-
-
- -Stream, Share, Earn. -
-

Join a fully distributed network that makes information open to everyone.

-
-
- Get LBRY -
- -
-
- */ ?> \ No newline at end of file diff --git a/view/template/page/home.php b/view/template/page/home.php index 030d9054..0cec27a4 100644 --- a/view/template/page/home.php +++ b/view/template/page/home.php @@ -1,6 +1,6 @@
- + true]) ?>
@@ -22,7 +22,7 @@
- + others in ', $labels) ?> @@ -41,7 +41,7 @@
-

+

'Go', 'listId' => Mailchimp::LIST_GENERAL_ID, diff --git a/view/template/page/join-list.php b/view/template/page/join-list.php index 44d0031b..903471dc 100644 --- a/view/template/page/join-list.php +++ b/view/template/page/join-list.php @@ -1,5 +1,5 @@ - + false ]) ?>
diff --git a/view/template/page/linux.php b/view/template/page/linux.php deleted file mode 100644 index 397988b1..00000000 --- a/view/template/page/linux.php +++ /dev/null @@ -1,22 +0,0 @@ - - -

Install LBRY on Linux

- -
Choose your install level.
-
-
-

Casuals

-

- Download .deb -

-
-
-

Masochists Professionals

-
    -
  1. Clone and follow the build steps for lbryum, a lightweight client for LBRY.
  2. -
  3. Clone and follow the build steps for lbry, a console based application for using the LBRY protocol.
  4. -
-
-
- - $html]) ?> diff --git a/view/template/page/navframe.php b/view/template/page/navframe.php deleted file mode 100644 index 61279681..00000000 --- a/view/template/page/navframe.php +++ /dev/null @@ -1,4 +0,0 @@ - - - - false]) ?> \ No newline at end of file diff --git a/view/template/page/osx.php b/view/template/page/osx.php deleted file mode 100644 index ce31dff3..00000000 --- a/view/template/page/osx.php +++ /dev/null @@ -1,12 +0,0 @@ - - -

Install LBRY on OS X

- -

- Download for OS X -

-

Or, view the source and compile instructions on - GitHub. -

- - $html]) ?> diff --git a/web/js/global.js b/web/js/global.js index 426559cd..74e13f98 100644 --- a/web/js/global.js +++ b/web/js/global.js @@ -1,5 +1,5 @@ window.lbry = {}; -document.domain = 'lbry.io'; +//document.domain = 'lbry.io'; jQuery.fn.extend({ jFor: function() { diff --git a/web/scss/_basic.scss b/web/scss/_basic.scss index 521ddeb4..b460d7ec 100644 --- a/web/scss/_basic.scss +++ b/web/scss/_basic.scss @@ -11,7 +11,6 @@ html body { font-family: $font-body; - font-weight: 400; line-height: 1.3333; min-height: 100%; position: relative; @@ -38,7 +37,6 @@ code { font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, De h1, h2, h3, h4, h5, h6 { font-family: $font-header; - font-weight: 500; } h1, h2, h3, h4 { @@ -51,9 +49,8 @@ h3 { font-size: 1.75em; } h4 { font-size: 1.4em; } nav { - font-size: 1.2em; + font-size: 1.1em; font-family: $font-header; - font-weight: 400; } sup, sub { vertical-align: baseline; @@ -122,8 +119,6 @@ a:hover img text-decoration: none; border: 0 none; text-align: center; - font-family: $font-header; - font-size: 1.15em; } .btn-primary diff --git a/web/scss/_blog.scss b/web/scss/_blog.scss index c7fd0544..a981500e 100644 --- a/web/scss/_blog.scss +++ b/web/scss/_blog.scss @@ -14,7 +14,6 @@ .post-content { - max-width: $max-content-width - 200; margin-left: auto; margin-right: auto; a[href] diff --git a/web/scss/_content.scss b/web/scss/_content.scss index 17790c3c..95a416ba 100644 --- a/web/scss/_content.scss +++ b/web/scss/_content.scss @@ -29,6 +29,13 @@ margin-top: $spacing-vertical * 1.5; } } + .meta + { + + h1, + h2, + h3, + h4 + { + margin-top: $spacing-vertical * 0.5; + } + } &.content-dark { diff --git a/web/scss/_cover.scss b/web/scss/_cover.scss index 38e11f80..daf7b7e6 100644 --- a/web/scss/_cover.scss +++ b/web/scss/_cover.scss @@ -17,7 +17,7 @@ .cover-full { height: 100vh; - font-size: 1.4em; + font-size: 1.2em; } @media (max-width: $mobile-width-threshold) { .cover { padding: $spacing-vertical $spacing-vertical * 2 / 3; } diff --git a/web/scss/_global.scss b/web/scss/_global.scss index caf2e458..930e6d2a 100644 --- a/web/scss/_global.scss +++ b/web/scss/_global.scss @@ -8,14 +8,14 @@ $color-text-dark: #000; $color-money: #216C2A; $color-meta-light: #505050; -$font-size: 16px; +$font-size: 18px; $mobile-width-threshold: 801px; $max-content-width: 1000px; $max-text-width: 660px; $font-header: 'Raleway', sans-serif; -$font-body: 'Merriweather', sans-serif; +$font-body: 'Raleway', sans-serif; @mixin anchor($color) { diff --git a/web/scss/_grid.scss b/web/scss/_grid.scss index 5a86cb5b..ed594bae 100644 --- a/web/scss/_grid.scss +++ b/web/scss/_grid.scss @@ -20,11 +20,10 @@ $gutter_fluid: 4; .span2 { width: 16.666%; } .span1 { width: 8.333%; } -.row-fluid { +.row-fluid, .row-fluid-always { width: 100%; > [class*="span"] { float: left; - width: 100%; margin-left: 1% * $gutter_fluid; &:first-child { @@ -60,6 +59,7 @@ $gutter_fluid: 4; @include flex-wrap(wrap); > [class*="span"] { @include display-flex(); + @include flex-wrap(wrap); @include flex(1 0 auto); overflow: hidden; @include justify-content(center); diff --git a/web/scss/_reset.scss b/web/scss/_reset.scss index ad5ca8e4..5f32e3bb 100644 --- a/web/scss/_reset.scss +++ b/web/scss/_reset.scss @@ -18,7 +18,7 @@ fieldset, img, iframe } h1, h2, h3, h4, h5, h6 { - font-weight:normal; + font-weight: inherit; } ol, ul { diff --git a/web/scss/_sale.scss b/web/scss/_sale.scss index 201242f1..c8103083 100644 --- a/web/scss/_sale.scss +++ b/web/scss/_sale.scss @@ -36,6 +36,7 @@ } .sale-call-prep, .sale-call-verb { + vertical-align: super; // font-size: 0.85em; } .sale-ctas