Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #46

Merged
merged 74 commits into from
Jul 9, 2015
Merged

Dev #46

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
ae40924
All fields are required for contact form. Refs #18
MathieuNls May 25, 2015
c5d1681
Add sao paulo to timezones. Refs #23
MathieuNls May 25, 2015
552484f
Add check on email fields for sign up and contact. Refs #19
MathieuNls May 25, 2015
cb3f77a
Design for facebook login. Refs #20
MathieuNls May 25, 2015
a64e36f
Buisiness logic for Facebook login. Refs #20
MathieuNls May 25, 2015
3da7239
Watch tips blog. Refs #25
MathieuNls Jun 1, 2015
521144f
Change database settings for stage wordpress. Refs #25
MathieuNls Jun 1, 2015
cb4b2e7
2 digits precision for measures. Refs #27
MathieuNls Jun 1, 2015
46415f3
new skin for facebook login. Refs #20
MathieuNls Jun 1, 2015
782b515
2 digits accuracy. Refs #27
MathieuNls Jun 1, 2015
ab63d81
Make application results more viral. Refs #26
MathieuNls Jun 4, 2015
30a2689
add signup w/ fb button. Refs #20
MathieuNls Jun 4, 2015
7b6a3b0
cherry pick adb4d81fdc81f0f149a7be44c1802768cc905588
MathieuNls Jun 4, 2015
337f71d
Fix #27
MathieuNls Jun 4, 2015
639fc00
social sharing without photo. Refs 26
MathieuNls Jun 4, 2015
08068d2
merge
MathieuNls Jun 4, 2015
2d815c3
remove decimals on countdown for measures. Refs #34
MathieuNls Jun 8, 2015
964a24e
add newMeasure action. Refs #33
MathieuNls Jun 8, 2015
3f4bff0
Home page. Video + header. #32
MathieuNls Jun 8, 2015
5954ef4
Home page. Small fixes for small screens #32
MathieuNls Jun 8, 2015
09c1cf3
Home page. Fix not logged measures button. Refs #32
MathieuNls Jun 8, 2015
302af5d
Text to the right. Refs #32
MathieuNls Jun 8, 2015
c1fb322
Home page. Fix not logged measures button. Refs #32
MathieuNls Jun 8, 2015
a6b4589
third screen and footer on homepage. #32
MathieuNls Jun 15, 2015
366095d
fix resize issues Refs #32
MathieuNls Jun 15, 2015
e90ac86
Add assests img #32
MathieuNls Jun 15, 2015
e4ef7cb
Mobile version. #32
MathieuNls Jun 15, 2015
3dc8f7f
add scrips. #32
MathieuNls Jun 15, 2015
b079152
Report system. Refs #17
MathieuNls Jun 16, 2015
0cc6b60
add pictures home. Refs #32
MathieuNls Jun 16, 2015
30f30e9
Social header and css fixes. Refs #29, Refs #30
MathieuNls Jun 17, 2015
1e2d485
AutoSlide + AutoReset of Demo screen + Title on mosaic screen. #32
MathieuNls Jun 17, 2015
da21ece
Fix social media sharing & Display Refs #26
MathieuNls Jun 17, 2015
dadff46
Fix links in Home Refs #32
MathieuNls Jun 17, 2015
aa11a90
test integratin
MathieuNls Jul 6, 2015
b35efa5
Change pricision to 10th of sec on dashboard. #38
MathieuNls Jul 7, 2015
4ec5c78
Change pricision to 10th of sec on result page. #38
MathieuNls Jul 7, 2015
5362d81
24h hours format is now enforced on the measures / accuracy pages. #37
MathieuNls Jul 7, 2015
79c9cc3
New measure action is now accessible during the 'Check your accuracy'…
MathieuNls Jul 7, 2015
44f4e05
Remove some white space and fix social urls. #26
MathieuNls Jul 7, 2015
24bfc83
Demo input now ranges from -2 to +6 with 10th of second precision. #32
MathieuNls Jul 7, 2015
e97da2f
Change header menu. #32
MathieuNls Jul 7, 2015
c1f9ff6
Preprod is now hidden from outside world. #21
MathieuNls Jul 7, 2015
8cd82c2
Fix typo. #21
MathieuNls Jul 7, 2015
4145b93
Fix typo. #21
MathieuNls Jul 7, 2015
0d90daf
watch tips is now in one line. #32
MathieuNls Jul 7, 2015
30aa685
Add admin attributs to user. #21
MathieuNls Jul 7, 2015
eff2212
Insanely Simple is now on a new line. #32
MathieuNls Jul 7, 2015
b550942
Fix mobile home-page. #32
MathieuNls Jul 7, 2015
09c346c
Fix mobile version of result page. #32
MathieuNls Jul 7, 2015
4a0f923
add webhooks. #40
MathieuNls Jul 7, 2015
d671cf6
Change mosaic pictures and add a special share img. #32
MathieuNls Jul 7, 2015
ad66a1e
New videos. #32
MathieuNls Jul 7, 2015
60d4c24
remove play button on mobile. #32
MathieuNls Jul 8, 2015
55b5f89
remove play button on mobile, fix brand rand outside range and autopl…
MathieuNls Jul 8, 2015
9e6bc80
add bounce bar script. #43
MathieuNls Jul 8, 2015
9405f9d
change descriptions. #39
MathieuNls Jul 8, 2015
b81e951
Try to fix header coverup. #43
MathieuNls Jul 8, 2015
1c392da
BounceBar f*ucked up the homepage. #43
MathieuNls Jul 8, 2015
c63db50
BounceBar still f*ucked up the homepage. #43
MathieuNls Jul 8, 2015
cb1a6ba
add some margins on description. #39
MathieuNls Jul 8, 2015
ca715df
add pinterest auth #45
MathieuNls Jul 9, 2015
28dd7a9
Fix scroll navigation w/ the Bounce Bar #43
MathieuNls Jul 9, 2015
25f8d65
Change the Omega video. #32
MathieuNls Jul 9, 2015
f2a9efa
Mobile devices now have pictures instead of videos + light refactorin…
MathieuNls Jul 9, 2015
8941a21
New measure is no start a new measure. #33
MathieuNls Jul 9, 2015
d1d03be
serve wristreview ourselves to prevent broken https warning. #32
MathieuNls Jul 9, 2015
9db2a33
change wristreview to 0777 mode #32
MathieuNls Jul 9, 2015
c5f2b29
Change facebook login flow. Fix #20
MathieuNls Jul 9, 2015
45df131
Did a bouncebar myself. Much simpler. #43
MathieuNls Jul 9, 2015
9c2ec88
change twitter account
MathieuNls Jul 9, 2015
68dc3fa
Add a 's' to productS. #39
MathieuNls Jul 9, 2015
2fff353
Improve the regex for 24h hour format. #37
MathieuNls Jul 9, 2015
63835e5
Remove the br. #32
MathieuNls Jul 9, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 32 additions & 5 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteEngine On
RewriteBase /
#CI_FOLDER is the Location of your CI files.

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

</IfModule>

<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php
</IfModule>
4 changes: 2 additions & 2 deletions application/config/autoload.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
*/

$autoload['libraries'] = array('session', 'database');
$autoload['libraries'] = array('session', 'database', 'user_agent');


/*
Expand Down Expand Up @@ -109,7 +109,7 @@
|
*/

$autoload['model'] = array('user');
$autoload['model'] = array('user', 'event');


/* End of file autoload.php */
Expand Down
1 change: 1 addition & 0 deletions application/config/routes.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

$route['reset-password/(:any)'] = "home/resetPassword/$1";
$route['logout'] = "home/logout";
$route['result'] = "home/result";
$route['about'] = "home/about";
$route['help'] = "home/help";
$route['contact'] = "home/contact";
Expand Down
83 changes: 83 additions & 0 deletions application/controllers/ajax.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ function login()
$password = $this->input->post('password');
if($this->user->login($email, $password))
{
$this->event->add($this->event->LOGIN_EMAIL);
$result['success'] = true;
}
else
{
$this->event->add($this->event->LOGIN_FAIL);
$result['success'] = false;
}

Expand All @@ -48,6 +50,73 @@ function checkEmail()
echo json_encode($result);
}
}

function facebookSignup()
{
$result['success'] = false;

if($this->input->post('email'))
{

$email = $this->input->post('email');
$password = "FB_"+$this->input->post('id');
$name = $this->input->post('last_name');
$firstname = $this->input->post('firstname');
$timezone = $this->input->post('timezone');
$country = $this->input->post('country');

$emailExists = $this->user->checkUserEmail($email);

if(!$emailExists){

if($this->user->signup($email, $password, $name, $firstname, $timezone, $country))
{

$this->event->add($this->event->SIGN_UP_FB);

$this->load->helper('mcapi');
$api = new MCAPI('eff18c4c882e5dc9b4c708a733239c82-us9');
$api->listSubscribe('7f94c4aa71', $email, '');

$this->load->library('email');

$config['protocol'] = "smtp";
$config['smtp_host'] = "smtp.mandrillapp.com";
$config['smtp_port'] = "587";
$config['smtp_user'] = "[email protected]";
$config['smtp_pass'] = "pUOMLUusBKdoR604DpcOnQ";
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['newline'] = "\r\n";

$this->email->initialize($config);

$this->email->from('[email protected]', 'Toolwatch');
$this->email->to($email, $name.' '.$firstname);
$this->email->reply_to('[email protected]', 'Toolwatch');

$this->email->subject('Welcome to Toolwatch!');

$message = $this->load->view('email/signup', '', true);
$this->email->message($message);

if($this->email->send())
{
$result['success'] = "signup";
$this->user->login($email, $password);
}

}
}else if($this->user->login($email, $password)){

$this->event->add($this->event->LOGIN_FB);

$result['success'] = "signin";
}
}

echo json_encode($result);
}

function signup()
{
Expand All @@ -65,6 +134,8 @@ function signup()

if($this->user->signup($email, $password, $name, $firstname, $timezone, $country))
{

$this->event->add($this->event->SIGN_UP);

if('true' == $mailingList)
{
Expand Down Expand Up @@ -109,6 +180,8 @@ function signup()
}
else
{
$this->event->add($this->event->SIGN_UP_FAIL);

$result['success'] = false;
}

Expand All @@ -129,6 +202,8 @@ function askResetPassword()

if($resetToken != '')
{
$this->event->add($this->event->RESET_PASSWORD);

$this->load->library('email');

$config['protocol'] = "smtp";
Expand Down Expand Up @@ -175,6 +250,9 @@ function resetPassword()
{
if($this->input->post('resetToken'))
{

$this->event->add($this->event->RESET_PASSWORD_USE);

$result = array();

$resetToken = $this->input->post('resetToken');
Expand All @@ -201,6 +279,9 @@ function getReferenceTime()
function accuracyMeasure(){
if($this->input->post('measureId'))
{

$this->event->add($this->event->NEW_ACCURACY);

$referenceTime = $this->session->userdata('referenceTime');
$userTimezone = $this->input->post('userTimezone');

Expand Down Expand Up @@ -229,6 +310,8 @@ function baseMeasure()
{
if($this->input->post('watchId'))
{
$this->event->add($this->event->NEW_MEASURE);

$result = array();

$watchId = $this->input->post('watchId');
Expand Down
70 changes: 60 additions & 10 deletions application/controllers/home.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,78 @@

class Home extends MY_Controller
{

//TODO: Can we overide load view to append .mobile ?
private $viewName = "home/home";

function __construct()
{
parent::__construct();
$this->load->model('measure');


if($this->agent->is_mobile()){
$this->viewName = "home/home-mobile";
}

}

function index()
{

if(!$this->agent->is_mobile()){
array_push($this->_headerData['javaScripts'], "home.logic", "watch.animation");
}else{
array_push($this->_headerData['javaScripts'], "home.logic.mobile");
}

$this->load->view('header', $this->_headerData);
$this->load->view('home');
$this->load->view($this->viewName, $this->homeMessage());
$this->load->view('footer');
}

function result(){

if(!$this->agent->is_mobile()){
array_push($this->_headerData['javaScripts'], "home.logic", "watch.animation");
}else{
array_push($this->_headerData['javaScripts'], "home.logic.mobile");
}

$this->_headerData["meta_img"] = img_url("accuracy.jpg");

$this->load->view('header', $this->_headerData);
$this->load->view($this->viewName, $this->homeMessage());
$this->load->view('footer');
}

private function homeMessage(){

$randBrands = rand ( 0 , 2 );

$watchBrands = array('Seiko', 'Rolex', 'Omega');
$videos = array('Omega', 'Rolex', 'Zenith', 'Vacheron');

$video = vid_url('Zenith.mp4');

if(!$this->agent->is_mobile()){
return array('title'=>$this->measure
->getMeasuresCountByWatchBrand($watchBrands[$randBrands]) .
' ' . $watchBrands[$randBrands] . ' measured on Toolwatch.io',
'video_url'=>vid_url($videos[rand ( 0 , 3 )]) . '.mp4');
}else{
return array('title'=>$this->measure
->getMeasuresCountByWatchBrand($watchBrands[$randBrands]) .
' ' . $watchBrands[$randBrands] . ' measured on Toolwatch.io',
'video_url'=>img_url($videos[rand ( 0 , 3 )]) . '.png');
}

}

function logout()
{
$this->event->add($this->event->LOGOUT);

$this->user->logout();
redirect(base_url());
}
Expand Down Expand Up @@ -45,15 +103,7 @@ function about()
$this->load->view('about');
$this->load->view('footer');
}

/*function help()
{
$this->_headerData['headerClass'] = 'blue';
$this->load->view('header', $this->_headerData);
$this->load->view('help');
$this->load->view('footer');
}*/


function contact()
{
$this->_headerData['headerClass'] = 'blue';
Expand Down
62 changes: 62 additions & 0 deletions application/controllers/hooks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Hooks extends CI_Controller
{

private $quotes = array("Did no one come to save me just because they missed me?",
"I can let you drown...",
"The world’s still the same. There’s just less in it.",
"Did everyone see that? Because I will not be doing it again.",
"Why is all the rum gone?",
"Close your eyes and pretend all a bad dream. That’s how I get by.",
"Better to not know which moment may be your last alive to be mystery of it all.",
"I regret nothing, ever",
"My tremendous intuitive sense of the female creature informs me that you are in trouble.",
"What a man can do and what a man can’t do.",
"The problem is not the problem. The problem is your attitude about the problem. Do you understand?",
"The seas may be rough, but I am the Captain! No matter how difficult I will always prevail.",
"This is the day you will always remember as the day you almost caught Captain Jack Sparrow",
"Wherever we want to go, we go...",
"Why fight when you can negotiate?",
"If you choose to lock your heart away, you’ll lose it for certain",
"You’ve stolen me and I’m here to take myself back",
"Not all treasure is silver and gold mate",
"My spirit will live on");

function __construct()
{
parent::__construct();
$this->load->model('watch');
$this->load->model('measure');
}

function index()
{

if($this->input->post('token') === "bPiAi9XNEa3p9FF1lQnZfuUY"){

$text = $this->input->post('text');
$quote = $this->quotes[rand ( 0 , 18 )];
$result = "";

if($text === "Jack nbusers"){

$result["text"] = $this->user->count_all() . ". " . $quote;

}else if($text === "Jack nbmeasures"){

$result["text"] = $this->measure->count_all() . ". " . $quote;

}else if($text === "Jack nbwatches"){

$result["text"] = $this->watch->count_all() . ". " . $quote;

}

echo json_encode($result);
}


}

}
Empty file modified application/controllers/index.html
100644 → 100755
Empty file.
Loading