From 733807c1fd596fe88b5aeda4bf4cac5d88bfbf63 Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Thu, 24 Nov 2016 21:31:43 -0500 Subject: [PATCH 01/90] test --- public_html/backend/twilio/twilio.php | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 public_html/backend/twilio/twilio.php diff --git a/public_html/backend/twilio/twilio.php b/public_html/backend/twilio/twilio.php new file mode 100644 index 0000000..5bae8b5 --- /dev/null +++ b/public_html/backend/twilio/twilio.php @@ -0,0 +1,7 @@ + Date: Fri, 25 Nov 2016 19:32:11 -0500 Subject: [PATCH 02/90] Testing delete exec button --- .gitignore | 2 +- composer.lock | 20 +++++++++---------- .../backend/assets/js/website-submit.js | 7 +++++++ public_html/backend/website.php | 5 ++++- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index a345556..ea372bc 100644 --- a/.gitignore +++ b/.gitignore @@ -152,4 +152,4 @@ dw_php_codehinting.config # Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -# composer.lock +composer.lock diff --git a/composer.lock b/composer.lock index 77cb3a4..4a8e25a 100644 --- a/composer.lock +++ b/composer.lock @@ -253,16 +253,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.8.10", + "version": "v2.8.14", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "889983a79a043dfda68f38c38b6dba092dd49cd8" + "reference": "25c576abd4e0f212e678fe8b2bd9a9a98c7ea934" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/889983a79a043dfda68f38c38b6dba092dd49cd8", - "reference": "889983a79a043dfda68f38c38b6dba092dd49cd8", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/25c576abd4e0f212e678fe8b2bd9a9a98c7ea934", + "reference": "25c576abd4e0f212e678fe8b2bd9a9a98c7ea934", "shasum": "" }, "require": { @@ -309,22 +309,22 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-07-28 16:56:28" + "time": "2016-10-13 01:43:15" } ], "packages-dev": [ { "name": "heroku/heroku-buildpack-php", - "version": "v110", + "version": "v114", "source": { "type": "git", "url": "https://github.com/heroku/heroku-buildpack-php.git", - "reference": "b5c4a0b77a725c4ab9dc1736e5a8217824790093" + "reference": "a2222b58a1591c789fc987e797cc824e5a7e125d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/b5c4a0b77a725c4ab9dc1736e5a8217824790093", - "reference": "b5c4a0b77a725c4ab9dc1736e5a8217824790093", + "url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/a2222b58a1591c789fc987e797cc824e5a7e125d", + "reference": "a2222b58a1591c789fc987e797cc824e5a7e125d", "shasum": "" }, "bin": [ @@ -355,7 +355,7 @@ "nginx", "php" ], - "time": "2016-08-26 14:02:29" + "time": "2016-11-10 23:19:38" } ], "aliases": [], diff --git a/public_html/backend/assets/js/website-submit.js b/public_html/backend/assets/js/website-submit.js index 1f0065c..9fe9f53 100644 --- a/public_html/backend/assets/js/website-submit.js +++ b/public_html/backend/assets/js/website-submit.js @@ -171,6 +171,13 @@ function fileSubmit(self) { return false; } + +// deletes the executive at position index by removing the accompanying dom element +function removeExecutive(index) { + $('#exec-info-' + index).remove(); +} + + function uploadExecPic(self) { var theForm = document.getElementById('website-form'), parseUser = theForm.dataset.parseuser, diff --git a/public_html/backend/website.php b/public_html/backend/website.php index 526c886..52d05e1 100644 --- a/public_html/backend/website.php +++ b/public_html/backend/website.php @@ -181,7 +181,7 @@ class="form-control col-md-7 col-xs-12" } } ?> -
+
@@ -195,6 +195,9 @@ class="img-circle profile_img preview-exec-img" + Date: Fri, 25 Nov 2016 19:41:38 -0500 Subject: [PATCH 04/90] removing exec --- public_html/backend/assets/js/website-submit.js | 2 +- public_html/backend/website.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public_html/backend/assets/js/website-submit.js b/public_html/backend/assets/js/website-submit.js index 9fe9f53..7398e3e 100644 --- a/public_html/backend/assets/js/website-submit.js +++ b/public_html/backend/assets/js/website-submit.js @@ -174,7 +174,7 @@ function fileSubmit(self) { // deletes the executive at position index by removing the accompanying dom element function removeExecutive(index) { - $('#exec-info-' + index).remove(); + document.getElementById('exec-info-' + index).remove(); } diff --git a/public_html/backend/website.php b/public_html/backend/website.php index 77aa217..88600d5 100644 --- a/public_html/backend/website.php +++ b/public_html/backend/website.php @@ -192,7 +192,7 @@ class="img-circle profile_img preview-exec-img"
-
- - Date: Sun, 4 Dec 2016 17:20:12 -0500 Subject: [PATCH 12/90] fixed logo upload css issue --- public_html/backend/website.php | 1 + 1 file changed, 1 insertion(+) diff --git a/public_html/backend/website.php b/public_html/backend/website.php index 6055f3e..b4a5979 100644 --- a/public_html/backend/website.php +++ b/public_html/backend/website.php @@ -151,6 +151,7 @@ class="form-control col-md-7 col-xs-12"

From 3579d7b39d349c8d4752e4008aa7bd99ef37b150 Mon Sep 17 00:00:00 2001 From: Jashan S Date: Sun, 4 Dec 2016 17:30:39 -0500 Subject: [PATCH 13/90] testing new file upload button fix --- public_html/backend/website.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public_html/backend/website.php b/public_html/backend/website.php index b4a5979..55849a8 100644 --- a/public_html/backend/website.php +++ b/public_html/backend/website.php @@ -149,10 +149,13 @@ class="form-control col-md-7 col-xs-12"


- +
From 3bd2f76f9f91b30648591216f732a86aecea7a8e Mon Sep 17 00:00:00 2001 From: Jashan S Date: Mon, 26 Dec 2016 23:25:32 +0530 Subject: [PATCH 14/90] Added ability to create new website sections --- public_html/backend/assets/css/sweetalert.css | 935 ++++++++++++++++++ .../backend/assets/js/sweetalert.min.js | 1 + .../backend/assets/js/website-submit.js | 63 +- public_html/backend/htmlFooter.php | 2 + public_html/backend/htmlHeader.php | 3 + public_html/backend/website.php | 5 + 6 files changed, 1005 insertions(+), 4 deletions(-) create mode 100644 public_html/backend/assets/css/sweetalert.css create mode 100644 public_html/backend/assets/js/sweetalert.min.js diff --git a/public_html/backend/assets/css/sweetalert.css b/public_html/backend/assets/css/sweetalert.css new file mode 100644 index 0000000..f2af7e3 --- /dev/null +++ b/public_html/backend/assets/css/sweetalert.css @@ -0,0 +1,935 @@ +body.stop-scrolling { + height: 100%; + overflow: hidden; } + +.sweet-overlay { + background-color: black; + /* IE8 */ + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; + /* IE8 */ + background-color: rgba(0, 0, 0, 0.4); + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + display: none; + z-index: 10000; } + +.sweet-alert { + background-color: white; + font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; + width: 478px; + padding: 17px; + border-radius: 5px; + text-align: center; + position: fixed; + left: 50%; + top: 50%; + margin-left: -256px; + margin-top: -200px; + overflow: hidden; + display: none; + z-index: 99999; } + @media all and (max-width: 540px) { + .sweet-alert { + width: auto; + margin-left: 0; + margin-right: 0; + left: 15px; + right: 15px; } } + .sweet-alert h2 { + color: #575757; + font-size: 30px; + text-align: center; + font-weight: 600; + text-transform: none; + position: relative; + margin: 25px 0; + padding: 0; + line-height: 40px; + display: block; } + .sweet-alert p { + color: #797979; + font-size: 16px; + text-align: center; + font-weight: 300; + position: relative; + text-align: inherit; + float: none; + margin: 0; + padding: 0; + line-height: normal; } + .sweet-alert fieldset { + border: none; + position: relative; } + .sweet-alert .sa-error-container { + background-color: #f1f1f1; + margin-left: -17px; + margin-right: -17px; + overflow: hidden; + padding: 0 10px; + max-height: 0; + webkit-transition: padding 0.15s, max-height 0.15s; + transition: padding 0.15s, max-height 0.15s; } + .sweet-alert .sa-error-container.show { + padding: 10px 0; + max-height: 100px; + webkit-transition: padding 0.2s, max-height 0.2s; + transition: padding 0.25s, max-height 0.25s; } + .sweet-alert .sa-error-container .icon { + display: inline-block; + width: 24px; + height: 24px; + border-radius: 50%; + background-color: #ea7d7d; + color: white; + line-height: 24px; + text-align: center; + margin-right: 3px; } + .sweet-alert .sa-error-container p { + display: inline-block; } + .sweet-alert .sa-input-error { + position: absolute; + top: 29px; + right: 26px; + width: 20px; + height: 20px; + opacity: 0; + -webkit-transform: scale(0.5); + transform: scale(0.5); + -webkit-transform-origin: 50% 50%; + transform-origin: 50% 50%; + -webkit-transition: all 0.1s; + transition: all 0.1s; } + .sweet-alert .sa-input-error::before, .sweet-alert .sa-input-error::after { + content: ""; + width: 20px; + height: 6px; + background-color: #f06e57; + border-radius: 3px; + position: absolute; + top: 50%; + margin-top: -4px; + left: 50%; + margin-left: -9px; } + .sweet-alert .sa-input-error::before { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); } + .sweet-alert .sa-input-error::after { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); } + .sweet-alert .sa-input-error.show { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); } + .sweet-alert input { + width: 100%; + box-sizing: border-box; + border-radius: 3px; + border: 1px solid #d7d7d7; + height: 43px; + margin-top: 10px; + margin-bottom: 17px; + font-size: 18px; + box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.06); + padding: 0 12px; + display: none; + -webkit-transition: all 0.3s; + transition: all 0.3s; } + .sweet-alert input:focus { + outline: none; + box-shadow: 0px 0px 3px #c4e6f5; + border: 1px solid #b4dbed; } + .sweet-alert input:focus::-moz-placeholder { + transition: opacity 0.3s 0.03s ease; + opacity: 0.5; } + .sweet-alert input:focus:-ms-input-placeholder { + transition: opacity 0.3s 0.03s ease; + opacity: 0.5; } + .sweet-alert input:focus::-webkit-input-placeholder { + transition: opacity 0.3s 0.03s ease; + opacity: 0.5; } + .sweet-alert input::-moz-placeholder { + color: #bdbdbd; } + .sweet-alert input::-ms-clear { + display: none; } + .sweet-alert input:-ms-input-placeholder { + color: #bdbdbd; } + .sweet-alert input::-webkit-input-placeholder { + color: #bdbdbd; } + .sweet-alert.show-input input { + display: block; } + .sweet-alert .sa-confirm-button-container { + display: inline-block; + position: relative; } + .sweet-alert .la-ball-fall { + position: absolute; + left: 50%; + top: 50%; + margin-left: -27px; + margin-top: 4px; + opacity: 0; + visibility: hidden; } + .sweet-alert button { + background-color: #8CD4F5; + color: white; + border: none; + box-shadow: none; + font-size: 17px; + font-weight: 500; + -webkit-border-radius: 4px; + border-radius: 5px; + padding: 10px 32px; + margin: 26px 5px 0 5px; + cursor: pointer; } + .sweet-alert button:focus { + outline: none; + box-shadow: 0 0 2px rgba(128, 179, 235, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.05); } + .sweet-alert button:hover { + background-color: #7ecff4; } + .sweet-alert button:active { + background-color: #5dc2f1; } + .sweet-alert button.cancel { + background-color: #C1C1C1; } + .sweet-alert button.cancel:hover { + background-color: #b9b9b9; } + .sweet-alert button.cancel:active { + background-color: #a8a8a8; } + .sweet-alert button.cancel:focus { + box-shadow: rgba(197, 205, 211, 0.8) 0px 0px 2px, rgba(0, 0, 0, 0.0470588) 0px 0px 0px 1px inset !important; } + .sweet-alert button[disabled] { + opacity: .6; + cursor: default; } + .sweet-alert button.confirm[disabled] { + color: transparent; } + .sweet-alert button.confirm[disabled] ~ .la-ball-fall { + opacity: 1; + visibility: visible; + transition-delay: 0s; } + .sweet-alert button::-moz-focus-inner { + border: 0; } + .sweet-alert[data-has-cancel-button=false] button { + box-shadow: none !important; } + .sweet-alert[data-has-confirm-button=false][data-has-cancel-button=false] { + padding-bottom: 40px; } + .sweet-alert .sa-icon { + width: 80px; + height: 80px; + border: 4px solid gray; + -webkit-border-radius: 40px; + border-radius: 40px; + border-radius: 50%; + margin: 20px auto; + padding: 0; + position: relative; + box-sizing: content-box; } + .sweet-alert .sa-icon.sa-error { + border-color: #F27474; } + .sweet-alert .sa-icon.sa-error .sa-x-mark { + position: relative; + display: block; } + .sweet-alert .sa-icon.sa-error .sa-line { + position: absolute; + height: 5px; + width: 47px; + background-color: #F27474; + display: block; + top: 37px; + border-radius: 2px; } + .sweet-alert .sa-icon.sa-error .sa-line.sa-left { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + left: 17px; } + .sweet-alert .sa-icon.sa-error .sa-line.sa-right { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + right: 16px; } + .sweet-alert .sa-icon.sa-warning { + border-color: #F8BB86; } + .sweet-alert .sa-icon.sa-warning .sa-body { + position: absolute; + width: 5px; + height: 47px; + left: 50%; + top: 10px; + -webkit-border-radius: 2px; + border-radius: 2px; + margin-left: -2px; + background-color: #F8BB86; } + .sweet-alert .sa-icon.sa-warning .sa-dot { + position: absolute; + width: 7px; + height: 7px; + -webkit-border-radius: 50%; + border-radius: 50%; + margin-left: -3px; + left: 50%; + bottom: 10px; + background-color: #F8BB86; } + .sweet-alert .sa-icon.sa-info { + border-color: #C9DAE1; } + .sweet-alert .sa-icon.sa-info::before { + content: ""; + position: absolute; + width: 5px; + height: 29px; + left: 50%; + bottom: 17px; + border-radius: 2px; + margin-left: -2px; + background-color: #C9DAE1; } + .sweet-alert .sa-icon.sa-info::after { + content: ""; + position: absolute; + width: 7px; + height: 7px; + border-radius: 50%; + margin-left: -3px; + top: 19px; + background-color: #C9DAE1; + left: 50%; } + .sweet-alert .sa-icon.sa-success { + border-color: #A5DC86; } + .sweet-alert .sa-icon.sa-success::before, .sweet-alert .sa-icon.sa-success::after { + content: ''; + -webkit-border-radius: 40px; + border-radius: 40px; + border-radius: 50%; + position: absolute; + width: 60px; + height: 120px; + background: white; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); } + .sweet-alert .sa-icon.sa-success::before { + -webkit-border-radius: 120px 0 0 120px; + border-radius: 120px 0 0 120px; + top: -7px; + left: -33px; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + -webkit-transform-origin: 60px 60px; + transform-origin: 60px 60px; } + .sweet-alert .sa-icon.sa-success::after { + -webkit-border-radius: 0 120px 120px 0; + border-radius: 0 120px 120px 0; + top: -11px; + left: 30px; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + -webkit-transform-origin: 0px 60px; + transform-origin: 0px 60px; } + .sweet-alert .sa-icon.sa-success .sa-placeholder { + width: 80px; + height: 80px; + border: 4px solid rgba(165, 220, 134, 0.2); + -webkit-border-radius: 40px; + border-radius: 40px; + border-radius: 50%; + box-sizing: content-box; + position: absolute; + left: -4px; + top: -4px; + z-index: 2; } + .sweet-alert .sa-icon.sa-success .sa-fix { + width: 5px; + height: 90px; + background-color: white; + position: absolute; + left: 28px; + top: 8px; + z-index: 1; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); } + .sweet-alert .sa-icon.sa-success .sa-line { + height: 5px; + background-color: #A5DC86; + display: block; + border-radius: 2px; + position: absolute; + z-index: 2; } + .sweet-alert .sa-icon.sa-success .sa-line.sa-tip { + width: 25px; + left: 14px; + top: 46px; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); } + .sweet-alert .sa-icon.sa-success .sa-line.sa-long { + width: 47px; + right: 8px; + top: 38px; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); } + .sweet-alert .sa-icon.sa-custom { + background-size: contain; + border-radius: 0; + border: none; + background-position: center center; + background-repeat: no-repeat; } + +/* + * Animations + */ +@-webkit-keyframes showSweetAlert { + 0% { + transform: scale(0.7); + -webkit-transform: scale(0.7); } + 45% { + transform: scale(1.05); + -webkit-transform: scale(1.05); } + 80% { + transform: scale(0.95); + -webkit-transform: scale(0.95); } + 100% { + transform: scale(1); + -webkit-transform: scale(1); } } + +@keyframes showSweetAlert { + 0% { + transform: scale(0.7); + -webkit-transform: scale(0.7); } + 45% { + transform: scale(1.05); + -webkit-transform: scale(1.05); } + 80% { + transform: scale(0.95); + -webkit-transform: scale(0.95); } + 100% { + transform: scale(1); + -webkit-transform: scale(1); } } + +@-webkit-keyframes hideSweetAlert { + 0% { + transform: scale(1); + -webkit-transform: scale(1); } + 100% { + transform: scale(0.5); + -webkit-transform: scale(0.5); } } + +@keyframes hideSweetAlert { + 0% { + transform: scale(1); + -webkit-transform: scale(1); } + 100% { + transform: scale(0.5); + -webkit-transform: scale(0.5); } } + +@-webkit-keyframes slideFromTop { + 0% { + top: 0%; } + 100% { + top: 50%; } } + +@keyframes slideFromTop { + 0% { + top: 0%; } + 100% { + top: 50%; } } + +@-webkit-keyframes slideToTop { + 0% { + top: 50%; } + 100% { + top: 0%; } } + +@keyframes slideToTop { + 0% { + top: 50%; } + 100% { + top: 0%; } } + +@-webkit-keyframes slideFromBottom { + 0% { + top: 70%; } + 100% { + top: 50%; } } + +@keyframes slideFromBottom { + 0% { + top: 70%; } + 100% { + top: 50%; } } + +@-webkit-keyframes slideToBottom { + 0% { + top: 50%; } + 100% { + top: 70%; } } + +@keyframes slideToBottom { + 0% { + top: 50%; } + 100% { + top: 70%; } } + +.showSweetAlert[data-animation=pop] { + -webkit-animation: showSweetAlert 0.3s; + animation: showSweetAlert 0.3s; } + +.showSweetAlert[data-animation=none] { + -webkit-animation: none; + animation: none; } + +.showSweetAlert[data-animation=slide-from-top] { + -webkit-animation: slideFromTop 0.3s; + animation: slideFromTop 0.3s; } + +.showSweetAlert[data-animation=slide-from-bottom] { + -webkit-animation: slideFromBottom 0.3s; + animation: slideFromBottom 0.3s; } + +.hideSweetAlert[data-animation=pop] { + -webkit-animation: hideSweetAlert 0.2s; + animation: hideSweetAlert 0.2s; } + +.hideSweetAlert[data-animation=none] { + -webkit-animation: none; + animation: none; } + +.hideSweetAlert[data-animation=slide-from-top] { + -webkit-animation: slideToTop 0.4s; + animation: slideToTop 0.4s; } + +.hideSweetAlert[data-animation=slide-from-bottom] { + -webkit-animation: slideToBottom 0.3s; + animation: slideToBottom 0.3s; } + +@-webkit-keyframes animateSuccessTip { + 0% { + width: 0; + left: 1px; + top: 19px; } + 54% { + width: 0; + left: 1px; + top: 19px; } + 70% { + width: 50px; + left: -8px; + top: 37px; } + 84% { + width: 17px; + left: 21px; + top: 48px; } + 100% { + width: 25px; + left: 14px; + top: 45px; } } + +@keyframes animateSuccessTip { + 0% { + width: 0; + left: 1px; + top: 19px; } + 54% { + width: 0; + left: 1px; + top: 19px; } + 70% { + width: 50px; + left: -8px; + top: 37px; } + 84% { + width: 17px; + left: 21px; + top: 48px; } + 100% { + width: 25px; + left: 14px; + top: 45px; } } + +@-webkit-keyframes animateSuccessLong { + 0% { + width: 0; + right: 46px; + top: 54px; } + 65% { + width: 0; + right: 46px; + top: 54px; } + 84% { + width: 55px; + right: 0px; + top: 35px; } + 100% { + width: 47px; + right: 8px; + top: 38px; } } + +@keyframes animateSuccessLong { + 0% { + width: 0; + right: 46px; + top: 54px; } + 65% { + width: 0; + right: 46px; + top: 54px; } + 84% { + width: 55px; + right: 0px; + top: 35px; } + 100% { + width: 47px; + right: 8px; + top: 38px; } } + +@-webkit-keyframes rotatePlaceholder { + 0% { + transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); } + 5% { + transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); } + 12% { + transform: rotate(-405deg); + -webkit-transform: rotate(-405deg); } + 100% { + transform: rotate(-405deg); + -webkit-transform: rotate(-405deg); } } + +@keyframes rotatePlaceholder { + 0% { + transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); } + 5% { + transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); } + 12% { + transform: rotate(-405deg); + -webkit-transform: rotate(-405deg); } + 100% { + transform: rotate(-405deg); + -webkit-transform: rotate(-405deg); } } + +.animateSuccessTip { + -webkit-animation: animateSuccessTip 0.75s; + animation: animateSuccessTip 0.75s; } + +.animateSuccessLong { + -webkit-animation: animateSuccessLong 0.75s; + animation: animateSuccessLong 0.75s; } + +.sa-icon.sa-success.animate::after { + -webkit-animation: rotatePlaceholder 4.25s ease-in; + animation: rotatePlaceholder 4.25s ease-in; } + +@-webkit-keyframes animateErrorIcon { + 0% { + transform: rotateX(100deg); + -webkit-transform: rotateX(100deg); + opacity: 0; } + 100% { + transform: rotateX(0deg); + -webkit-transform: rotateX(0deg); + opacity: 1; } } + +@keyframes animateErrorIcon { + 0% { + transform: rotateX(100deg); + -webkit-transform: rotateX(100deg); + opacity: 0; } + 100% { + transform: rotateX(0deg); + -webkit-transform: rotateX(0deg); + opacity: 1; } } + +.animateErrorIcon { + -webkit-animation: animateErrorIcon 0.5s; + animation: animateErrorIcon 0.5s; } + +@-webkit-keyframes animateXMark { + 0% { + transform: scale(0.4); + -webkit-transform: scale(0.4); + margin-top: 26px; + opacity: 0; } + 50% { + transform: scale(0.4); + -webkit-transform: scale(0.4); + margin-top: 26px; + opacity: 0; } + 80% { + transform: scale(1.15); + -webkit-transform: scale(1.15); + margin-top: -6px; } + 100% { + transform: scale(1); + -webkit-transform: scale(1); + margin-top: 0; + opacity: 1; } } + +@keyframes animateXMark { + 0% { + transform: scale(0.4); + -webkit-transform: scale(0.4); + margin-top: 26px; + opacity: 0; } + 50% { + transform: scale(0.4); + -webkit-transform: scale(0.4); + margin-top: 26px; + opacity: 0; } + 80% { + transform: scale(1.15); + -webkit-transform: scale(1.15); + margin-top: -6px; } + 100% { + transform: scale(1); + -webkit-transform: scale(1); + margin-top: 0; + opacity: 1; } } + +.animateXMark { + -webkit-animation: animateXMark 0.5s; + animation: animateXMark 0.5s; } + +@-webkit-keyframes pulseWarning { + 0% { + border-color: #F8D486; } + 100% { + border-color: #F8BB86; } } + +@keyframes pulseWarning { + 0% { + border-color: #F8D486; } + 100% { + border-color: #F8BB86; } } + +.pulseWarning { + -webkit-animation: pulseWarning 0.75s infinite alternate; + animation: pulseWarning 0.75s infinite alternate; } + +@-webkit-keyframes pulseWarningIns { + 0% { + background-color: #F8D486; } + 100% { + background-color: #F8BB86; } } + +@keyframes pulseWarningIns { + 0% { + background-color: #F8D486; } + 100% { + background-color: #F8BB86; } } + +.pulseWarningIns { + -webkit-animation: pulseWarningIns 0.75s infinite alternate; + animation: pulseWarningIns 0.75s infinite alternate; } + +@-webkit-keyframes rotate-loading { + 0% { + transform: rotate(0deg); } + 100% { + transform: rotate(360deg); } } + +@keyframes rotate-loading { + 0% { + transform: rotate(0deg); } + 100% { + transform: rotate(360deg); } } + +/* Internet Explorer 9 has some special quirks that are fixed here */ +/* The icons are not animated. */ +/* This file is automatically merged into sweet-alert.min.js through Gulp */ +/* Error icon */ +.sweet-alert .sa-icon.sa-error .sa-line.sa-left { + -ms-transform: rotate(45deg) \9; } + +.sweet-alert .sa-icon.sa-error .sa-line.sa-right { + -ms-transform: rotate(-45deg) \9; } + +/* Success icon */ +.sweet-alert .sa-icon.sa-success { + border-color: transparent\9; } + +.sweet-alert .sa-icon.sa-success .sa-line.sa-tip { + -ms-transform: rotate(45deg) \9; } + +.sweet-alert .sa-icon.sa-success .sa-line.sa-long { + -ms-transform: rotate(-45deg) \9; } + +/*! + * Load Awesome v1.1.0 (http://github.danielcardoso.net/load-awesome/) + * Copyright 2015 Daniel Cardoso <@DanielCardoso> + * Licensed under MIT + */ +.la-ball-fall, +.la-ball-fall > div { + position: relative; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } + +.la-ball-fall { + display: block; + font-size: 0; + color: #fff; } + +.la-ball-fall.la-dark { + color: #333; } + +.la-ball-fall > div { + display: inline-block; + float: none; + background-color: currentColor; + border: 0 solid currentColor; } + +.la-ball-fall { + width: 54px; + height: 18px; } + +.la-ball-fall > div { + width: 10px; + height: 10px; + margin: 4px; + border-radius: 100%; + opacity: 0; + -webkit-animation: ball-fall 1s ease-in-out infinite; + -moz-animation: ball-fall 1s ease-in-out infinite; + -o-animation: ball-fall 1s ease-in-out infinite; + animation: ball-fall 1s ease-in-out infinite; } + +.la-ball-fall > div:nth-child(1) { + -webkit-animation-delay: -200ms; + -moz-animation-delay: -200ms; + -o-animation-delay: -200ms; + animation-delay: -200ms; } + +.la-ball-fall > div:nth-child(2) { + -webkit-animation-delay: -100ms; + -moz-animation-delay: -100ms; + -o-animation-delay: -100ms; + animation-delay: -100ms; } + +.la-ball-fall > div:nth-child(3) { + -webkit-animation-delay: 0ms; + -moz-animation-delay: 0ms; + -o-animation-delay: 0ms; + animation-delay: 0ms; } + +.la-ball-fall.la-sm { + width: 26px; + height: 8px; } + +.la-ball-fall.la-sm > div { + width: 4px; + height: 4px; + margin: 2px; } + +.la-ball-fall.la-2x { + width: 108px; + height: 36px; } + +.la-ball-fall.la-2x > div { + width: 20px; + height: 20px; + margin: 8px; } + +.la-ball-fall.la-3x { + width: 162px; + height: 54px; } + +.la-ball-fall.la-3x > div { + width: 30px; + height: 30px; + margin: 12px; } + +/* + * Animation + */ +@-webkit-keyframes ball-fall { + 0% { + opacity: 0; + -webkit-transform: translateY(-145%); + transform: translateY(-145%); } + 10% { + opacity: .5; } + 20% { + opacity: 1; + -webkit-transform: translateY(0); + transform: translateY(0); } + 80% { + opacity: 1; + -webkit-transform: translateY(0); + transform: translateY(0); } + 90% { + opacity: .5; } + 100% { + opacity: 0; + -webkit-transform: translateY(145%); + transform: translateY(145%); } } + +@-moz-keyframes ball-fall { + 0% { + opacity: 0; + -moz-transform: translateY(-145%); + transform: translateY(-145%); } + 10% { + opacity: .5; } + 20% { + opacity: 1; + -moz-transform: translateY(0); + transform: translateY(0); } + 80% { + opacity: 1; + -moz-transform: translateY(0); + transform: translateY(0); } + 90% { + opacity: .5; } + 100% { + opacity: 0; + -moz-transform: translateY(145%); + transform: translateY(145%); } } + +@-o-keyframes ball-fall { + 0% { + opacity: 0; + -o-transform: translateY(-145%); + transform: translateY(-145%); } + 10% { + opacity: .5; } + 20% { + opacity: 1; + -o-transform: translateY(0); + transform: translateY(0); } + 80% { + opacity: 1; + -o-transform: translateY(0); + transform: translateY(0); } + 90% { + opacity: .5; } + 100% { + opacity: 0; + -o-transform: translateY(145%); + transform: translateY(145%); } } + +@keyframes ball-fall { + 0% { + opacity: 0; + -webkit-transform: translateY(-145%); + -moz-transform: translateY(-145%); + -o-transform: translateY(-145%); + transform: translateY(-145%); } + 10% { + opacity: .5; } + 20% { + opacity: 1; + -webkit-transform: translateY(0); + -moz-transform: translateY(0); + -o-transform: translateY(0); + transform: translateY(0); } + 80% { + opacity: 1; + -webkit-transform: translateY(0); + -moz-transform: translateY(0); + -o-transform: translateY(0); + transform: translateY(0); } + 90% { + opacity: .5; } + 100% { + opacity: 0; + -webkit-transform: translateY(145%); + -moz-transform: translateY(145%); + -o-transform: translateY(145%); + transform: translateY(145%); } } diff --git a/public_html/backend/assets/js/sweetalert.min.js b/public_html/backend/assets/js/sweetalert.min.js new file mode 100644 index 0000000..500bf92 --- /dev/null +++ b/public_html/backend/assets/js/sweetalert.min.js @@ -0,0 +1 @@ +!function(e,t,n){"use strict";!function o(e,t,n){function a(s,l){if(!t[s]){if(!e[s]){var i="function"==typeof require&&require;if(!l&&i)return i(s,!0);if(r)return r(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=t[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return a(n?n:t)},c,c.exports,o,e,t,n)}return t[s].exports}for(var r="function"==typeof require&&require,s=0;s=0;)n=n.replace(" "+t+" "," ");e.className=n.replace(/^\s+|\s+$/g,"")}},i=function(e){var n=t.createElement("div");return n.appendChild(t.createTextNode(e)),n.innerHTML},u=function(e){e.style.opacity="",e.style.display="block"},c=function(e){if(e&&!e.length)return u(e);for(var t=0;t0?setTimeout(a,t):e.style.display="none"};o()},b=function(n){if("function"==typeof MouseEvent){var o=new MouseEvent("click",{view:e,bubbles:!1,cancelable:!0});n.dispatchEvent(o)}else if(t.createEvent){var a=t.createEvent("MouseEvents");a.initEvent("click",!1,!1),n.dispatchEvent(a)}else t.createEventObject?n.fireEvent("onclick"):"function"==typeof n.onclick&&n.onclick()},h=function(t){"function"==typeof t.stopPropagation?(t.stopPropagation(),t.preventDefault()):e.event&&e.event.hasOwnProperty("cancelBubble")&&(e.event.cancelBubble=!0)};a.hasClass=r,a.addClass=s,a.removeClass=l,a.escapeHtml=i,a._show=u,a.show=c,a._hide=d,a.hide=f,a.isDescendant=p,a.getTopMargin=m,a.fadeIn=v,a.fadeOut=y,a.fireClick=b,a.stopEventPropagation=h},{}],5:[function(t,o,a){Object.defineProperty(a,"__esModule",{value:!0});var r=t("./handle-dom"),s=t("./handle-swal-dom"),l=function(t,o,a){var l=t||e.event,i=l.keyCode||l.which,u=a.querySelector("button.confirm"),c=a.querySelector("button.cancel"),d=a.querySelectorAll("button[tabindex]");if(-1!==[9,13,32,27].indexOf(i)){for(var f=l.target||l.srcElement,p=-1,m=0;m"),i.innerHTML=e.html?e.text:(0,s.escapeHtml)(e.text||"").split("\n").join("
"),e.text&&(0,s.show)(i),e.customClass)(0,s.addClass)(t,e.customClass),t.setAttribute("data-custom-class",e.customClass);else{var d=t.getAttribute("data-custom-class");(0,s.removeClass)(t,d),t.setAttribute("data-custom-class","")}if((0,s.hide)(t.querySelectorAll(".sa-icon")),e.type&&!(0,a.isIE8)()){var f=function(){for(var o=!1,a=0;ao;o++)n=parseInt(e.substr(2*o,2),16),n=Math.round(Math.min(Math.max(0,n+n*t),255)).toString(16),a+=("00"+n).substr(n.length);return a};o.extend=a,o.hexToRgb=r,o.isIE8=s,o.logStr=l,o.colorLuminance=i},{}]},{},[1]),"function"==typeof define&&define.amd?define(function(){return sweetAlert}):"undefined"!=typeof module&&module.exports&&(module.exports=sweetAlert)}(window,document); \ No newline at end of file diff --git a/public_html/backend/assets/js/website-submit.js b/public_html/backend/assets/js/website-submit.js index 913b06d..3975c49 100644 --- a/public_html/backend/assets/js/website-submit.js +++ b/public_html/backend/assets/js/website-submit.js @@ -38,7 +38,7 @@ function formSubmit(theForm) { var formWebExec = [], execBlocks = document.getElementsByClassName('exec-group'); - for (i = 0; i < execBlocks.length; i++) { + for (var i = 0; i < execBlocks.length; i++) { formWebExec[i] = {}; formWebExec[i].pictureid = execBlocks[i].getElementsByClassName('input-exec-img')[0].dataset.parsedb; formWebExec[i].name = execBlocks[i].getElementsByClassName('exec-name')[0].value; @@ -50,7 +50,7 @@ function formSubmit(theForm) { switchSection(document.getElementsByClassName('content-select')[0]); var contentFields = document.getElementsByClassName('content-field'), formWebContent = {"data":[]}; - for (i = 0; i < contentFields.length; i++) { + for (var i = 0; i < contentFields.length; i++) { formWebContent.data[i] = {}; formWebContent.data[i].name = contentFields[i].dataset.namefield; formWebContent.data[i].content = contentFields[i].innerHTML; @@ -329,8 +329,8 @@ function switchSection(self) { oldField = editor.dataset.contentold, oldData = editor.innerHTML, newField = self.value; - var oldField = oldField.indexOf(" ") == -1 ? oldField : oldField.substr(0, oldField.indexOf(" ")), - newField = newField.indexOf(" ") == -1 ? newField : newField.substr(0, newField.indexOf(" ")); + oldField = oldField.indexOf(" ") == -1 ? oldField : oldField.substr(0, oldField.indexOf(" ")); + newField = newField.indexOf(" ") == -1 ? newField : newField.substr(0, newField.indexOf(" ")); var oldFieldDiv = document.querySelectorAll('[data-namefield~="' + oldField + '"]')[0]; oldFieldDiv.innerHTML = oldData; @@ -339,3 +339,58 @@ function switchSection(self) { editor.dataset.contentold = newField; return; } + + +/** + * @param title The title of the new section + * @description Allows clients to add new sections to the website + */ +function makeSection(title) { + // this div will have no inner html as new sections have no content + var newSectionDiv = document.createElement('div'); + newSectionDiv.setAttribute('class', 'content-field'); + newSectionDiv.setAttribute('style', 'display: none;'); + newSectionDiv.setAttribute('data-namefield', title); + + // add up the div to the document for useful referencing + document.body.appendChild(newSectionDiv); + + // add the section as an option to the selector + var newSectionOption = document.createElement('option'); + newSectionOption.setAttribute('value', title); + newSectionOption.innerHTML = title; + + document.getElementById('heard').appendChild(newSectionOption); + + // switch the heard option selector to the new section + document.getElementById('heard').value = title; + + // switch to the new section, the same way it worked before + switchSection(newSectionOption); +} + + +/** + * @description Prompts the user to create a new section on the website + */ +function promptNewSection() { + swal({ + title: 'New Section', + text: 'Please enter the title for the new section', + type: 'input', + showCancelBUtton: true, + animation: 'slide-from-top', + inputPlaceHolder: 'Enter your new title...' + }, function(inputValue) { + if (inputValue === false) + return false; + + if (inputValue === '') { + swal.showInputError('You need to enter a title'); + return false; + } + + // create the new section with the given title + makeSection(inputValue); + }) +} diff --git a/public_html/backend/htmlFooter.php b/public_html/backend/htmlFooter.php index 8965e1a..791f109 100644 --- a/public_html/backend/htmlFooter.php +++ b/public_html/backend/htmlFooter.php @@ -36,6 +36,8 @@ + + diff --git a/public_html/backend/htmlHeader.php b/public_html/backend/htmlHeader.php index ccc5a67..1e6fd35 100644 --- a/public_html/backend/htmlHeader.php +++ b/public_html/backend/htmlHeader.php @@ -73,6 +73,9 @@ + + + diff --git a/public_html/backend/website.php b/public_html/backend/website.php index 55849a8..d91fbb1 100644 --- a/public_html/backend/website.php +++ b/public_html/backend/website.php @@ -364,6 +364,11 @@ class="fa fa-repeat">
+ + + Date: Mon, 26 Dec 2016 23:31:39 +0530 Subject: [PATCH 15/90] Bug fix for creating new sections --- public_html/backend/assets/js/website-submit.js | 5 +++++ public_html/backend/website.php | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/public_html/backend/assets/js/website-submit.js b/public_html/backend/assets/js/website-submit.js index 3975c49..d4ba6ce 100644 --- a/public_html/backend/assets/js/website-submit.js +++ b/public_html/backend/assets/js/website-submit.js @@ -13,6 +13,11 @@ $(document).ready(function () { addExec(); }); + $('#make-section-button').click(function(e) { + e.preventDefault(); + promptNewSection(); + }); + /* Dropzone override TODO-michael: this does ignites the dropzone div */ Dropzone.autoDiscover = false; $("div#galleryDrop").dropzone({url: "website.php"}); diff --git a/public_html/backend/website.php b/public_html/backend/website.php index d91fbb1..93a4635 100644 --- a/public_html/backend/website.php +++ b/public_html/backend/website.php @@ -366,8 +366,7 @@ class="fa fa-repeat"> data-contentold=""> - From 7094637c3e6797177dd80add015858517ac7b9c6 Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Thu, 5 Jan 2017 14:05:22 -0500 Subject: [PATCH 16/90] typo --- documentations/cms-vision.md | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 documentations/cms-vision.md diff --git a/documentations/cms-vision.md b/documentations/cms-vision.md new file mode 100644 index 0000000..a232e5b --- /dev/null +++ b/documentations/cms-vision.md @@ -0,0 +1,39 @@ +# CMS Vision + +| Written by | Harrison Chow | + +TLDR; The Developers’ Foundation’s Content Management System (CMS) will be a platform that will be used by tens, and hundred of Charities to support their own cause. The goal of this infrastructure is to help charities easily manage their content from a customized personal dashboard. + +### Back Story +Since the beginning, we have developed websites for our clients, and the development cycle is as follows: +1. Discovery: Learning more about the client themselves and discovering the possibilities of Developers' Foundation +2. Specifications: Defining the specifics of the project by specifications built with the client +3. Content request: TPM requests and receives content from the client, including but not limited to pictures, documents, paragraphs etc +4. Initial development and designs: Development team and designers give a first crack at the project with what they have, this usually starts before step three if product content is slow +5. Alpha show and tell: Developers and TPM shows alpha version of the product to the client +6. Touch ups and fixes: Changes are applied based on client feedback +7. Product complete and deployment: Product is officially deployed +8. Fix and corrections iterations: Changes can be done if requested by clients + +The problem we had with this type of product development is that steps with interactions with the client has been delaying the product completion times. Such as content request step (3) has been our greatest barrier to finishing the products, especially since developers and designers do not know what approach to take on the product. This has led to a long list of products yet to be completed. By implementing the CMS, we hope to solve this great issue in the product development cycle. + +The CMS should allow clients to access it via a simple username and password access, and allow them to add and edit the content on the website. With this type of content submission system in place, the client is free to change or add content to their site at their own discretion and pace. The development can also then be done as long as a design has been agreed on, where the developers will only need to put in "data pulling" tags in where data should appear. + +### Current Development + +Current CMS development is done by Harrison Chow (Western) and Jashan (Waterloo). Current status of the CMS is as follows: +- Core framework +- Basic database connections +- Basic user management +- Microsoft 360 implementations +- Basic website edit features + + +### Future Development + +TODOs: +- Endpoints on CMS +- PHP plugin to allow one-line integration +- Client login system +- Extended Microsoft 360 implementations (other features such as oneDrive) +- Other services implementations (Cloudflare - DNS controls, Google Analytics etc) From 14e19967bf459199ef09dba5a0d58e34873b3dfe Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Thu, 5 Jan 2017 14:09:48 -0500 Subject: [PATCH 17/90] typo --- documentations/cms-manual.md | 80 ++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 documentations/cms-manual.md diff --git a/documentations/cms-manual.md b/documentations/cms-manual.md new file mode 100644 index 0000000..37b82e1 --- /dev/null +++ b/documentations/cms-manual.md @@ -0,0 +1,80 @@ +#
Developer's Foundation
+####
HQ Developer Manual
+###### _
Author: Jashan Shewakramani
_ + +I would like to officially welcome you to your journey as an HQ Software Engineer +at Developer's Foundation. We're a group of passionate university students, spread +all around the world, hoping to empower both students and non-profits across borders. +We're ambitious, with a long road of growth ahead of us -- and I can't wait to see +the amazing work we'll soon accomplish, taking our services to the next level. +
+This guide aims to provide a brief overview of our Content Management System, and your +responsibilities and roles working as a developer with us. I hope that you find it helpful +in understanding what the product is, how it works, and why it is necessary. The backend +can get quite complicated, and I wouldn't expect you to understand how everything works +immediately. Please do feel free to reach out to me if you have any questions at all. + + +#### The Content Management System (CMS) + +We build websites for clients -- and websites often need updating, with new mission +statements, goals, achievements, contact information, photographs, and much more. In the +past, clients have had their website's content updated by simply calling us, sending us +their assets, and waiting for us to make the changes in static html. As we seek to expand +with an increasing number of clients, this approach is not scaleable -- and as students, +we often simply don't have the time to always be 100% responsive. + +This motivates the development of a rich CMS, which allows clients to efficiently make changes, +with solid, immediate, real-time feedback. Our CMS is still far from complete, both in terms of the +features it offers, and its stability and security, but we're hoping to deliver a Minimum Viable +Product as soon as possible. + +##### The Core Technologies: PHP and ParseDB + +Fundamentally, our application servers are powered by PHP 7.0 and our databases by ParseDB. +Do not worry if you haven't worked with these technologies before -- I certainly hadn't when +I started working here. I would first recommend exploring the code on our git repository, and then +spending some time reading about the technologies you need through W3C or any other online resource +to attain a better understanding of what's really going on under the hood. + +But before any of that, you'll need to get your system set up. If you use macOS or Linux, the +easiest way to get PHP set up is via Homebrew or your local package manager. ParseDB additionally +requires Node.js and NPM, both of which are easily available. With NPM ready, setting up Parse is +incredibly straightforward. Simply execute the following command in your terminal: + +`npm install -g parse-dashboard` + +This globally installs the core node modules you will need to see and manipulate the database. +During development, you will need to connect to our production database server in order to understand +the schema, and see how everything works together. We currently have our database deplopyed on Heroku, +and you can connect to it via the following command and authentication credentials: + +`parse-dashboard --appId developers-foundation-db --masterKey Abcd1234 --serverURL "https://developers-foundation-db.herokuapp.com/parse"` + +We'll be turning up the security here. *Abcd1234* isn't exactly the safest of passwords, +but it does the job for the moment. Assuming you have everything set up correctly, this +command should set up a local server on your machine. Opening this in your browser will give +you complete access to the database. Be careful with it. + + + +*
The Parse Dashboard, in all its glory
* +
+ +As a side note, I personally like to save this long command as a shell script, simply +so that I don't have to keep re-entering the credentials over and over again. Before continuing, +I'd also recommend checking out Parse's documentation for the dashboard and PHP API [here](https://www.parse.com/docs). + +Moving on to the PHP and actual application, the entire CMS is stored in its entirety in the +`/public_html/backend` directory of the git repository. Fundamentally, what's happening here +is quite simple. We have the PHP talking to our database, dynamically retrieving data, +populating HTML templates with it, and sending it to the client. All user interactivity, +and requests to update the database are made entirely through HTML forms and JavaScript +(that also talks directly to our Parse server). + +I won't be discussing the code here in too much depth, mostly because it is subject to a lot of change, +and questions here are more efficiently addressed if you contact me directly. I encourage you to +play around with the code, and inspect it. Try and match the collections and fields in +the database to the points in code where resources are being accessed and updated. And of course, +feel free to contact me if you're looking for answers, explanations, or even pointers to good resources +where you could pick a skill or two. From 6fe043c3e1bc349b36491bd1a0d379d00b233f77 Mon Sep 17 00:00:00 2001 From: Jashan S Date: Sat, 7 Jan 2017 13:13:05 -0500 Subject: [PATCH 18/90] Added jQuery UI CSS for autocomplete fix --- public_html/backend/htmlHeader.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public_html/backend/htmlHeader.php b/public_html/backend/htmlHeader.php index 1e6fd35..726552b 100644 --- a/public_html/backend/htmlHeader.php +++ b/public_html/backend/htmlHeader.php @@ -45,6 +45,8 @@ + + From 333b6cb047a8def839d9df94460e4d17c38d815e Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Wed, 18 Jan 2017 16:59:29 -0500 Subject: [PATCH 19/90] try fix --- documentations/README.md | 2 ++ documentations/developers-manual.md | 1 + public_html/backend/assets/js/website-submit.js | 9 +++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 documentations/README.md create mode 100644 documentations/developers-manual.md diff --git a/documentations/README.md b/documentations/README.md new file mode 100644 index 0000000..e9fd6dd --- /dev/null +++ b/documentations/README.md @@ -0,0 +1,2 @@ +# Table of Contents + diff --git a/documentations/developers-manual.md b/documentations/developers-manual.md new file mode 100644 index 0000000..b034dd6 --- /dev/null +++ b/documentations/developers-manual.md @@ -0,0 +1 @@ +step by step + tips \ No newline at end of file diff --git a/public_html/backend/assets/js/website-submit.js b/public_html/backend/assets/js/website-submit.js index d4ba6ce..176892a 100644 --- a/public_html/backend/assets/js/website-submit.js +++ b/public_html/backend/assets/js/website-submit.js @@ -2,6 +2,8 @@ * Created by harrisonchow on 7/10/16. */ +var debug = true; + /* Doc Ready Functions */ $(document).ready(function () { $("#web-logo").change(function () { @@ -61,7 +63,10 @@ function formSubmit(theForm) { formWebContent.data[i].content = contentFields[i].innerHTML; } - Parse.User.logIn(parseUser, parsePwd).then(function () { + Parse.User.logIn(parseUser, parsePwd).then(function (u) { + if (debug) console.log("User Logged In"); + if (debug) console.log(u); + var Websites = Parse.Object.extend("Website"); var query = new Parse.Query(Websites); return query.get(websiteID); @@ -145,7 +150,7 @@ function formSubmit(theForm) { $(function () { new PNotify({ title: 'Oh No!', - text: 'Failed to submit form :( Error ' + error.code + ': ' + error.message, + text: 'Failed to submit form :(\nError ' + error.code + ': ' + error.message, type: 'error', nonblock: { nonblock: true From f802b29fd9ada55928755a5d96a34649231d427e Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Wed, 18 Jan 2017 17:05:56 -0500 Subject: [PATCH 20/90] try fix --- public_html/backend/assets/js/website-submit.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public_html/backend/assets/js/website-submit.js b/public_html/backend/assets/js/website-submit.js index 176892a..42bddad 100644 --- a/public_html/backend/assets/js/website-submit.js +++ b/public_html/backend/assets/js/website-submit.js @@ -3,6 +3,7 @@ */ var debug = true; +if (debug) console.debug("Debug mode is ON") /* Doc Ready Functions */ $(document).ready(function () { @@ -71,6 +72,7 @@ function formSubmit(theForm) { var query = new Parse.Query(Websites); return query.get(websiteID); }).then(function (obj) { + if (debug) console.log("Website Query OK"); // Promise system to make async var promise = Parse.Promise.as(); @@ -126,10 +128,15 @@ function formSubmit(theForm) { } promise = promise.then(function () { + if (debug) console.log("Saving:"); + if (debug) console.log(obj); return obj.save(); }); + + if (debug) console.log("Save done"); return promise; }).then(function (obj) { + if (debug) console.log("Save OK"); // Object saved $(function () { new PNotify({ From c53c3c97983a37f594d514fab7a7fd4c6e6a09cf Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Wed, 25 Jan 2017 18:46:52 -0500 Subject: [PATCH 21/90] env var --- public_html/assets/mail/mailer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/assets/mail/mailer.php b/public_html/assets/mail/mailer.php index c557d59..a78ea98 100644 --- a/public_html/assets/mail/mailer.php +++ b/public_html/assets/mail/mailer.php @@ -14,7 +14,7 @@ require '../../../vendor/autoload.php'; $getPost = (array)json_decode(file_get_contents('php://input')); -$sendgrid = new SendGrid('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'); +$sendgrid = new SendGrid($_ENV["SENDGRID_API_KEY"]); $email = new SendGrid\Email(); $email From 315b05e4dc09a127f41f39fcc0b3cd4dbc9e5c2a Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Wed, 25 Jan 2017 18:51:42 -0500 Subject: [PATCH 22/90] env var --- public_html/assets/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/assets/js/main.js b/public_html/assets/js/main.js index 220dccc..cf0500d 100644 --- a/public_html/assets/js/main.js +++ b/public_html/assets/js/main.js @@ -214,7 +214,7 @@ $(document).ready(function() { var statusDiv = $(".form-status")[0]; $.ajax({ - url: 'mail/mailer.php', + url: 'assets/mail/mailer.php', crossDomain: false, data: sendData, method: "POST", From b85f4a969e99c395e95cd42d01c42fd62bb3bc75 Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Wed, 25 Jan 2017 19:09:08 -0500 Subject: [PATCH 23/90] env var --- nob_api/mailer/mailer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nob_api/mailer/mailer.php b/nob_api/mailer/mailer.php index 1ae180b..6556228 100644 --- a/nob_api/mailer/mailer.php +++ b/nob_api/mailer/mailer.php @@ -14,7 +14,7 @@ require '../../../vendor/autoload.php'; // MAKE SURE THIS POINTS TO YOUR COMPOSER VENDOR FOLDER $getPost = (array)json_decode(file_get_contents('php://input')); -$sendgrid = new SendGrid('SUB IN A REAL API KEY HERE'); +$sendgrid = new SendGrid($_ENV["SENDGRID_API_KEY"]); // MAKE SURE THE API KEY IS INSIDE THE ENV VARIABLE $email = new SendGrid\Email(); $email From 3bbef5dd533759c5f9363cf78d77ebc957a8713c Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Wed, 25 Jan 2017 19:11:18 -0500 Subject: [PATCH 24/90] env var --- nob_api/!blank_project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nob_api/!blank_project b/nob_api/!blank_project index b7d1c20..230f712 160000 --- a/nob_api/!blank_project +++ b/nob_api/!blank_project @@ -1 +1 @@ -Subproject commit b7d1c204cc425575b297e8e049db7c7b923df437 +Subproject commit 230f7120104880ce864447a686045e4a0adfb458 From 15888d9b2aeadda73de3b54c6c1a6cace2b67977 Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Sun, 29 Jan 2017 19:04:06 -0500 Subject: [PATCH 25/90] test stripe Signed-off-by: Nobody Random --- composer.json | 3 +- composer.lock | 59 +++++++++++++++++++++++++++++++++++-- nob_api/!blank_project | 2 +- nob_api/stripe/README.txt | 1 + nob_api/stripe/main.html | 41 ++++++++++++++++++++++++++ nob_api/stripe/main.js | 40 +++++++++++++++++++++++++ nob_api/stripe/stripe.php | 33 +++++++++++++++++++++ public_html/test/main.html | 41 ++++++++++++++++++++++++++ public_html/test/main.js | 40 +++++++++++++++++++++++++ public_html/test/stripe.php | 33 +++++++++++++++++++++ 10 files changed, 289 insertions(+), 4 deletions(-) create mode 100644 nob_api/stripe/README.txt create mode 100644 nob_api/stripe/main.html create mode 100644 nob_api/stripe/main.js create mode 100644 nob_api/stripe/stripe.php create mode 100644 public_html/test/main.html create mode 100644 public_html/test/main.js create mode 100644 public_html/test/stripe.php diff --git a/composer.json b/composer.json index 12ed9d6..6e626a2 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,7 @@ "ext-memcached": "*", "sendgrid/sendgrid": "4.0.4", "parse/php-sdk": "1.2.0", - "twilio/sdk": "5.4.2" + "twilio/sdk": "5.4.2", + "stripe/stripe-php": "v4.4.0" } } diff --git a/composer.lock b/composer.lock index 33cb42c..54699ac 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "f90529deab7842f857bfe42ba0185c3d", - "content-hash": "6649f3442ec3a32b20a4c54790db6a75", + "hash": "44077116d2ae9022a9b695b2f8c2653d", + "content-hash": "1117b533954b63b2baa290571491e6a6", "packages": [ { "name": "guzzle/guzzle", @@ -251,6 +251,61 @@ ], "time": "2015-04-14 02:37:45" }, + { + "name": "stripe/stripe-php", + "version": "v4.4.0", + "source": { + "type": "git", + "url": "https://github.com/stripe/stripe-php.git", + "reference": "9ec772fe502995850954dbc15b1f38e6f9159a4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/9ec772fe502995850954dbc15b1f38e6f9159a4d", + "reference": "9ec772fe502995850954dbc15b1f38e6f9159a4d", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "satooshi/php-coveralls": "~0.6.1", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Stripe\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stripe and contributors", + "homepage": "https://github.com/stripe/stripe-php/contributors" + } + ], + "description": "Stripe PHP Library", + "homepage": "https://stripe.com/", + "keywords": [ + "api", + "payment processing", + "stripe" + ], + "time": "2017-01-18 18:55:45" + }, { "name": "symfony/event-dispatcher", "version": "v2.8.14", diff --git a/nob_api/!blank_project b/nob_api/!blank_project index 230f712..20a2211 160000 --- a/nob_api/!blank_project +++ b/nob_api/!blank_project @@ -1 +1 @@ -Subproject commit 230f7120104880ce864447a686045e4a0adfb458 +Subproject commit 20a22118753bb2618b2322ea4cc9688ab3e986d7 diff --git a/nob_api/stripe/README.txt b/nob_api/stripe/README.txt new file mode 100644 index 0000000..1323457 --- /dev/null +++ b/nob_api/stripe/README.txt @@ -0,0 +1 @@ +This feature is still under development. Email me at harrison@developersfoundation.ca for more info \ No newline at end of file diff --git a/nob_api/stripe/main.html b/nob_api/stripe/main.html new file mode 100644 index 0000000..2bdb9ed --- /dev/null +++ b/nob_api/stripe/main.html @@ -0,0 +1,41 @@ + + + +
+ + +
+ +
+ +
+ + / + +
+ +
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/nob_api/stripe/main.js b/nob_api/stripe/main.js new file mode 100644 index 0000000..cd9642c --- /dev/null +++ b/nob_api/stripe/main.js @@ -0,0 +1,40 @@ +/** + * Created by harrisonchow on 1/29/17. + */ + +Stripe.setPublishableKey('pk_test_QChjrSlxnapDTftVFe5aHKmy'); +$(function() { + var $form = $('#payment-form'); + $form.submit(function(event) { + // Disable the submit button to prevent repeated clicks: + $form.find('.submit').prop('disabled', true); + + // Request a token from Stripe: + Stripe.card.createToken($form, stripeResponseHandler); + + // Prevent the form from being submitted: + return false; + }); +}); + +function stripeResponseHandler(status, response) { + // Grab the form: + var $form = $('#payment-form'); + + if (response.error) { // Problem! + // Show the errors on the form: + $form.find('.payment-errors').text(response.error.message); + $form.find('.submit').prop('disabled', false); // Re-enable submission + + } else { // Token was created! + + // Get the token ID: + var token = response.id; +console.log(token); + // Insert the token ID into the form so it gets submitted to the server: + $form.append($('').val(token)); + + // Submit the form: + $form.get(0).submit(); + } +}; \ No newline at end of file diff --git a/nob_api/stripe/stripe.php b/nob_api/stripe/stripe.php new file mode 100644 index 0000000..c26e9e9 --- /dev/null +++ b/nob_api/stripe/stripe.php @@ -0,0 +1,33 @@ + 1000, + "currency" => "cad", + "description" => "Example charge", + "source" => $token, +)); \ No newline at end of file diff --git a/public_html/test/main.html b/public_html/test/main.html new file mode 100644 index 0000000..2bdb9ed --- /dev/null +++ b/public_html/test/main.html @@ -0,0 +1,41 @@ + + + +
+ + +
+ +
+ +
+ + / + +
+ +
+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/public_html/test/main.js b/public_html/test/main.js new file mode 100644 index 0000000..cd9642c --- /dev/null +++ b/public_html/test/main.js @@ -0,0 +1,40 @@ +/** + * Created by harrisonchow on 1/29/17. + */ + +Stripe.setPublishableKey('pk_test_QChjrSlxnapDTftVFe5aHKmy'); +$(function() { + var $form = $('#payment-form'); + $form.submit(function(event) { + // Disable the submit button to prevent repeated clicks: + $form.find('.submit').prop('disabled', true); + + // Request a token from Stripe: + Stripe.card.createToken($form, stripeResponseHandler); + + // Prevent the form from being submitted: + return false; + }); +}); + +function stripeResponseHandler(status, response) { + // Grab the form: + var $form = $('#payment-form'); + + if (response.error) { // Problem! + // Show the errors on the form: + $form.find('.payment-errors').text(response.error.message); + $form.find('.submit').prop('disabled', false); // Re-enable submission + + } else { // Token was created! + + // Get the token ID: + var token = response.id; +console.log(token); + // Insert the token ID into the form so it gets submitted to the server: + $form.append($('').val(token)); + + // Submit the form: + $form.get(0).submit(); + } +}; \ No newline at end of file diff --git a/public_html/test/stripe.php b/public_html/test/stripe.php new file mode 100644 index 0000000..c26e9e9 --- /dev/null +++ b/public_html/test/stripe.php @@ -0,0 +1,33 @@ + 1000, + "currency" => "cad", + "description" => "Example charge", + "source" => $token, +)); \ No newline at end of file From 82c95c778d57927a25fd58fff7f13784850e9e9e Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Sun, 29 Jan 2017 19:05:46 -0500 Subject: [PATCH 26/90] test stripe Signed-off-by: Nobody Random --- public_html/test/stripe.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/public_html/test/stripe.php b/public_html/test/stripe.php index c26e9e9..79e044d 100644 --- a/public_html/test/stripe.php +++ b/public_html/test/stripe.php @@ -14,13 +14,8 @@ // Token is created using Stripe.js or Checkout! // Get the payment token submitted by the form: -$getPost = (array)json_decode(file_get_contents('php://input')); - -var_dump($_POST); -var_dump($getPost); - -//$token = $_POST['stripeToken']; -$token = $getPost['stripeToken']; +$token = $_POST['stripeToken']; +//$token = $getPost['stripeToken']; echo $token; From 6e0ce2ea2e49a77aa48cdbcd70f641569cf01a04 Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Mon, 30 Jan 2017 21:06:25 -0500 Subject: [PATCH 27/90] test stripe Signed-off-by: Nobody Random --- nob_api/stripe/stripe.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/nob_api/stripe/stripe.php b/nob_api/stripe/stripe.php index c26e9e9..79e044d 100644 --- a/nob_api/stripe/stripe.php +++ b/nob_api/stripe/stripe.php @@ -14,13 +14,8 @@ // Token is created using Stripe.js or Checkout! // Get the payment token submitted by the form: -$getPost = (array)json_decode(file_get_contents('php://input')); - -var_dump($_POST); -var_dump($getPost); - -//$token = $_POST['stripeToken']; -$token = $getPost['stripeToken']; +$token = $_POST['stripeToken']; +//$token = $getPost['stripeToken']; echo $token; From 0bf3231e3edf313f3ec8148aade23d33d3d8e5d2 Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Mon, 30 Jan 2017 21:07:30 -0500 Subject: [PATCH 28/90] add Signed-off-by: Nobody Random --- nob_api/stripe/README.txt | 12 +++++++++++- nob_api/stripe/main.js | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/nob_api/stripe/README.txt b/nob_api/stripe/README.txt index 1323457..03285f9 100644 --- a/nob_api/stripe/README.txt +++ b/nob_api/stripe/README.txt @@ -1 +1,11 @@ -This feature is still under development. Email me at harrison@developersfoundation.ca for more info \ No newline at end of file +This feature is still under development. Email me at harrison@developersfoundation.ca for more info + +Requirements: +- Comfortable in using php and composer +- Able to use JS as the middleman script +- Able to make a GUI for the form (dynamic GUI) + +composer.json: +``` +"stripe/stripe-php": "v4.4.0" +``` diff --git a/nob_api/stripe/main.js b/nob_api/stripe/main.js index cd9642c..991fac1 100644 --- a/nob_api/stripe/main.js +++ b/nob_api/stripe/main.js @@ -30,7 +30,7 @@ function stripeResponseHandler(status, response) { // Get the token ID: var token = response.id; -console.log(token); + console.log(token); // Insert the token ID into the form so it gets submitted to the server: $form.append($('').val(token)); From 4bd96c47186ccfcb4fec23d5885f795402053a27 Mon Sep 17 00:00:00 2001 From: Jashan S Date: Tue, 31 Jan 2017 10:02:35 -0500 Subject: [PATCH 29/90] Added Admin restrictions for creating new sections --- public_html/backend/phpHeader.php | 7 ++++++- public_html/backend/website.php | 14 ++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/public_html/backend/phpHeader.php b/public_html/backend/phpHeader.php index d65f808..20635fc 100644 --- a/public_html/backend/phpHeader.php +++ b/public_html/backend/phpHeader.php @@ -53,13 +53,18 @@ // Find all available websites and put into side bar (with get links) $websiteQuery = new ParseQuery("Website"); $websiteQuery->ascending("nickname"); + +// useful variable for permissions; don't modify +$isAdmin = false; + $websiteMenu = ""; try { $results = $websiteQuery->find(); for ($i = 0; $i < count($results); $i++) { $website = $results[$i]; $theACL = $website->getACL(); - if ($theACL->getUserWriteAccess($parseUser) || ParseCloud::run("isAdmin", ["username" => $parseUser->getUsername()])) { + $isAdmin = ParseCloud::run("isAdmin", ["username" => $parseUser->getUsername()]); + if ($theACL->getUserWriteAccess($parseUser) || $isAdmin) { $websiteMenu = $websiteMenu . '
  • ' . $website->get('nickname') . '
  • '; } } diff --git a/public_html/backend/website.php b/public_html/backend/website.php index 93a4635..5fee1ed 100644 --- a/public_html/backend/website.php +++ b/public_html/backend/website.php @@ -366,10 +366,16 @@ class="fa fa-repeat"> data-contentold=""> - - + + + + ' . $content[$i]['content'] . ''; From 70ba293851dcb125b9046f2145a6e5e63995f9bb Mon Sep 17 00:00:00 2001 From: Jashan S Date: Tue, 31 Jan 2017 10:25:41 -0500 Subject: [PATCH 30/90] Testing new gallery db implementation --- public_html/backend/website.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public_html/backend/website.php b/public_html/backend/website.php index 5fee1ed..19278bb 100644 --- a/public_html/backend/website.php +++ b/public_html/backend/website.php @@ -24,6 +24,8 @@ echo $ex->getMessage(); exit(); } + +$galleryInfo = $theWebsite->get("gallery")["galleries"]; ?> @@ -382,8 +384,14 @@ class="btn btn-default">Create a new section } ?> +
    + testing gallery schema' . $galleryInfo[$i] . '

    '; + } + ?>

    Drag multiple files to the box below for multi upload or click to select files. This is for demonstration purposes only, the files are not uploaded to any From 8267fdccb76b577789c0e0a999d1a440c9391813 Mon Sep 17 00:00:00 2001 From: Jashan S Date: Tue, 31 Jan 2017 10:29:17 -0500 Subject: [PATCH 31/90] more gallery db testing --- public_html/backend/website.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/public_html/backend/website.php b/public_html/backend/website.php index 19278bb..a03c18b 100644 --- a/public_html/backend/website.php +++ b/public_html/backend/website.php @@ -26,6 +26,8 @@ } $galleryInfo = $theWebsite->get("gallery")["galleries"]; +echo '

    ' . $galleryInfo[0]['name'] . '

    '; +echo '

    ' . $galleryInfo[0]['files'][0] . '

    '; ?> @@ -387,11 +389,6 @@ class="btn btn-default">Create a new section
    - testing gallery schema' . $galleryInfo[$i] . '

    '; - } - ?>

    Drag multiple files to the box below for multi upload or click to select files. This is for demonstration purposes only, the files are not uploaded to any From 147879dad681af4f4d662c121137077d202656f4 Mon Sep 17 00:00:00 2001 From: Jashan S Date: Tue, 31 Jan 2017 10:38:57 -0500 Subject: [PATCH 32/90] testing db gallery rendering (CSS + Bootstrap needed) --- public_html/backend/website.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/public_html/backend/website.php b/public_html/backend/website.php index a03c18b..a900609 100644 --- a/public_html/backend/website.php +++ b/public_html/backend/website.php @@ -26,8 +26,6 @@ } $galleryInfo = $theWebsite->get("gallery")["galleries"]; -echo '

    ' . $galleryInfo[0]['name'] . '

    '; -echo '

    ' . $galleryInfo[0]['files'][0] . '

    '; ?> @@ -389,6 +387,20 @@ class="btn btn-default">Create a new section
    + + + +

    Drag multiple files to the box below for multi upload or click to select files. This is for demonstration purposes only, the files are not uploaded to any From 0f0b1004df1d8609eb3d3cd5ffec178147fe1b8d Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Mon, 6 Feb 2017 20:33:26 -0500 Subject: [PATCH 33/90] add Signed-off-by: Nobody Random --- public_html/test/stripe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/test/stripe.php b/public_html/test/stripe.php index 79e044d..028cb8a 100644 --- a/public_html/test/stripe.php +++ b/public_html/test/stripe.php @@ -22,7 +22,7 @@ // Charge the user's card: $charge = \Stripe\Charge::create(array( "amount" => 1000, - "currency" => "cad", + "currency" => "hkd", "description" => "Example charge", "source" => $token, )); \ No newline at end of file From c29751a239659730a566837ccbc80999b23d3d09 Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Mon, 6 Feb 2017 20:35:29 -0500 Subject: [PATCH 34/90] add Signed-off-by: Nobody Random --- public_html/test/stripe.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public_html/test/stripe.php b/public_html/test/stripe.php index 028cb8a..1577c6c 100644 --- a/public_html/test/stripe.php +++ b/public_html/test/stripe.php @@ -10,7 +10,7 @@ // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys -\Stripe\Stripe::setApiKey("sk_test_aGnS14vnHRLMFYc9Jlzb4SPT"); +\Stripe\Stripe::setApiKey($_ENV["STRIPE_API"]); // Token is created using Stripe.js or Checkout! // Get the payment token submitted by the form: @@ -24,5 +24,5 @@ "amount" => 1000, "currency" => "hkd", "description" => "Example charge", - "source" => $token, + "source" => $token )); \ No newline at end of file From 8e6c9a6e36101e0f12ed880d2b747ee6caa9e592 Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Mon, 6 Feb 2017 22:14:13 -0500 Subject: [PATCH 35/90] add Signed-off-by: Nobody Random --- public_html/test/stripe.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public_html/test/stripe.php b/public_html/test/stripe.php index 1577c6c..f22104c 100644 --- a/public_html/test/stripe.php +++ b/public_html/test/stripe.php @@ -21,8 +21,8 @@ // Charge the user's card: $charge = \Stripe\Charge::create(array( - "amount" => 1000, - "currency" => "hkd", + "amount" => 30, + "currency" => "cad", "description" => "Example charge", "source" => $token )); \ No newline at end of file From ddaad515c03e180436315f69e3f14ceaa89ad7d3 Mon Sep 17 00:00:00 2001 From: Nobody Random Date: Mon, 6 Feb 2017 22:18:27 -0500 Subject: [PATCH 36/90] add Signed-off-by: Nobody Random --- public_html/test/stripe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/test/stripe.php b/public_html/test/stripe.php index f22104c..1f88b24 100644 --- a/public_html/test/stripe.php +++ b/public_html/test/stripe.php @@ -21,7 +21,7 @@ // Charge the user's card: $charge = \Stripe\Charge::create(array( - "amount" => 30, + "amount" => 3000, "currency" => "cad", "description" => "Example charge", "source" => $token From 8c25325d805dbf58fa8a8fbd014d43b3f0b9c28b Mon Sep 17 00:00:00 2001 From: Jashan S Date: Wed, 8 Feb 2017 07:10:59 -0500 Subject: [PATCH 37/90] testing gallery upload and rendering --- .../backend/assets/js/gallery-submit.js | 49 +++++++++++++++++++ .../backend/assets/js/website-submit.js | 2 +- public_html/backend/htmlFooter.php | 3 ++ public_html/backend/website.php | 8 +++ 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 public_html/backend/assets/js/gallery-submit.js diff --git a/public_html/backend/assets/js/gallery-submit.js b/public_html/backend/assets/js/gallery-submit.js new file mode 100644 index 0000000..03c3308 --- /dev/null +++ b/public_html/backend/assets/js/gallery-submit.js @@ -0,0 +1,49 @@ +/** + * Created by: Jashan Shewakramani + * Date: Friday, 3rd February 2017 + * + * Description: Separate JS for handling gallery submission on website.php + **/ + +$(document).ready(function() { + + // listen for gallery clicks + $('.add-gallery-pic').click(function (event) { + event.preventDefault(); + var element = event.target; // get the dom element that triggered the click + + var galleryName = element.getAttribute('data-gallery-name'); + + if (element.files.length > 0) { + var file = element.files[0]; + var parseFile = new Parse.File(file.name, file); // name doesn't really matter + + var Gallery = Parse.Object.extend("Gallery"); + + var galleryObject = new Gallery(); + galleryObject.set('image', parseFile); + + galleryObject.save().then(function(galleryObj) { + var photoUrl = galleryObj.url(); + addPhotoUrl(galleryName, photoUrl); + + }, + function(err) { + alert("Error saving file: " + err); + }); + } + }); + +}); + +function addPhotoUrl(galleryName, url) { + var Website = Parse.Object.extend('Website'); + var query = new Parse.Query(Website); + + var websiteid = document.getElementById('website-form').dataset.websiteid; + + query.get(websiteid).then(function(website) { + var gallery = website.get('gallery'); + console.log('fetched gallery: ' + gallery); + }); +} \ No newline at end of file diff --git a/public_html/backend/assets/js/website-submit.js b/public_html/backend/assets/js/website-submit.js index 42bddad..bd18586 100644 --- a/public_html/backend/assets/js/website-submit.js +++ b/public_html/backend/assets/js/website-submit.js @@ -3,7 +3,7 @@ */ var debug = true; -if (debug) console.debug("Debug mode is ON") +if (debug) console.debug("Debug mode is ON"); /* Doc Ready Functions */ $(document).ready(function () { diff --git a/public_html/backend/htmlFooter.php b/public_html/backend/htmlFooter.php index 791f109..ecf0620 100644 --- a/public_html/backend/htmlFooter.php +++ b/public_html/backend/htmlFooter.php @@ -304,6 +304,9 @@ function showErrorAlert(reason, detail) { '; echo ""; + + // add gallery file submit functionality + echo ""; } elseif ($analytics) { echo ' diff --git a/public_html/backend/website.php b/public_html/backend/website.php index a900609..e1cda66 100644 --- a/public_html/backend/website.php +++ b/public_html/backend/website.php @@ -398,6 +398,12 @@ class="btn btn-default">Create a new section Ëš

    + + Add a picture to + @@ -527,6 +533,8 @@ class="btn btn-default">Create a new section
    + + Date: Wed, 8 Feb 2017 07:20:24 -0500 Subject: [PATCH 38/90] further testing for gallery --- .../backend/assets/js/gallery-submit.js | 34 +++++++++---------- public_html/backend/website.php | 4 +-- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/public_html/backend/assets/js/gallery-submit.js b/public_html/backend/assets/js/gallery-submit.js index 03c3308..6bea26c 100644 --- a/public_html/backend/assets/js/gallery-submit.js +++ b/public_html/backend/assets/js/gallery-submit.js @@ -5,25 +5,27 @@ * Description: Separate JS for handling gallery submission on website.php **/ -$(document).ready(function() { +$('#website-form-submit').click(function() { + $('.add-gallery-pic').each(function(e) { + uploadGallery(e); + }); +}); - // listen for gallery clicks - $('.add-gallery-pic').click(function (event) { - event.preventDefault(); - var element = event.target; // get the dom element that triggered the click +// listen for gallery clicks +var uploadGallery = function (element) { - var galleryName = element.getAttribute('data-gallery-name'); + var galleryName = element.getAttribute('data-gallery-name'); - if (element.files.length > 0) { - var file = element.files[0]; - var parseFile = new Parse.File(file.name, file); // name doesn't really matter + if (element.files.length > 0) { + var file = element.files[0]; + var parseFile = new Parse.File(file.name, file); // name doesn't really matter - var Gallery = Parse.Object.extend("Gallery"); + var Gallery = Parse.Object.extend("Gallery"); - var galleryObject = new Gallery(); - galleryObject.set('image', parseFile); + var galleryObject = new Gallery(); + galleryObject.set('image', parseFile); - galleryObject.save().then(function(galleryObj) { + galleryObject.save().then(function(galleryObj) { var photoUrl = galleryObj.url(); addPhotoUrl(galleryName, photoUrl); @@ -31,10 +33,8 @@ $(document).ready(function() { function(err) { alert("Error saving file: " + err); }); - } - }); - -}); + } +}; function addPhotoUrl(galleryName, url) { var Website = Parse.Object.extend('Website'); diff --git a/public_html/backend/website.php b/public_html/backend/website.php index e1cda66..7ed2c53 100644 --- a/public_html/backend/website.php +++ b/public_html/backend/website.php @@ -367,7 +367,6 @@ class="fa fa-repeat"> contenteditable="true" data-contentold=""> -

    Drag multiple files to the box below for multi upload or click to select files. This is for demonstration purposes only, the files are not uploaded to any From 070821857f11a7d95cef02d2e923ec5d5533c039 Mon Sep 17 00:00:00 2001 From: Jashan S Date: Wed, 1 Mar 2017 17:53:16 -0500 Subject: [PATCH 53/90] testing gallery fix bug --- public_html/backend/assets/js/website-submit.js | 3 ++- public_html/backend/website.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public_html/backend/assets/js/website-submit.js b/public_html/backend/assets/js/website-submit.js index 90da773..871076d 100644 --- a/public_html/backend/assets/js/website-submit.js +++ b/public_html/backend/assets/js/website-submit.js @@ -416,7 +416,8 @@ function promptNewSection() { } // add functionality to create new gallery -function promptNewGallery() { +function promptNewGallery(e) { + e.preventDefault(); swal({ title: 'Create New Gallery', text: 'Please enter the title for the new gallery', diff --git a/public_html/backend/website.php b/public_html/backend/website.php index 5c3fd91..2b36dac 100644 --- a/public_html/backend/website.php +++ b/public_html/backend/website.php @@ -409,7 +409,7 @@ class="btn btn-default add-gallery-pic"> + onclick="promptNewGallery(event)">Create New Gallery

    Drag multiple files to the box below for multi upload or click to select files. This is for demonstration purposes only, the files are not uploaded to any From dc800c138931c7697ba943218f7bd76ba2884176 Mon Sep 17 00:00:00 2001 From: Jashan S Date: Fri, 3 Mar 2017 17:13:07 -0500 Subject: [PATCH 54/90] improved gallery upload UX --- public_html/backend/assets/js/gallery-submit.js | 9 ++++++--- public_html/backend/assets/js/website-submit.js | 3 ++- public_html/backend/website.php | 9 +++++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/public_html/backend/assets/js/gallery-submit.js b/public_html/backend/assets/js/gallery-submit.js index 7c4ff3f..bf5c719 100644 --- a/public_html/backend/assets/js/gallery-submit.js +++ b/public_html/backend/assets/js/gallery-submit.js @@ -6,9 +6,12 @@ **/ // event is only triggered when the input field values change -$('.add-gallery-pic').change(function(e) { +$('.gallery-upload').click(function(e) { var clickedElem = e.target; - uploadGallery(clickedElem); + var galleryId = e.getAttribute('data-gallery'); + var inputElem = document.getElementById('gallery-upload-' + galleryId); + + uploadGallery(inputElem); }); @@ -29,7 +32,7 @@ var uploadGallery = function (element) { galleryObject.save().then(function(galleryObj) { var photoUrl = galleryObj.get('image').url(); addPhotoUrl(galleryName, photoUrl); - + element.files = []; }, function(err) { alert("Error saving file: " + err); diff --git a/public_html/backend/assets/js/website-submit.js b/public_html/backend/assets/js/website-submit.js index 871076d..f259ec3 100644 --- a/public_html/backend/assets/js/website-submit.js +++ b/public_html/backend/assets/js/website-submit.js @@ -431,10 +431,11 @@ function promptNewGallery(e) { if (galleryName == '') { swal.showInputError('You need to enter a title'); - return false; } makeGallery(galleryName); + + swal('Done', galleryName + ' created', 'success'); }) } diff --git a/public_html/backend/website.php b/public_html/backend/website.php index 2b36dac..7d1be12 100644 --- a/public_html/backend/website.php +++ b/public_html/backend/website.php @@ -402,10 +402,15 @@ class="btn btn-default">Create a new section + id="gallery-upload-"> +

    +