As soon as you make any changes, they will be automatically saved.
+ -diff --git a/lib/routes.js b/lib/routes.js
index f9e787ed..ca40f985 100644
--- a/lib/routes.js
+++ b/lib/routes.js
@@ -169,8 +169,6 @@ module.exports = function (app) {
var static = sandbox.helpers.urlForStatic('', req.secure);
var referrer = req.get('referer');
- console.log(req.param('page'), pages.indexOf(req.param('page')));
-
var page = pages.indexOf(req.param('page')) === -1 ? false : req.param('page') + '.html';
var addons = [];
diff --git a/public/css/account.css b/public/css/account.css
index b5a4d1d8..27a0dc7e 100644
--- a/public/css/account.css
+++ b/public/css/account.css
@@ -51,7 +51,7 @@ margin-left: 230px;
form input[type="submit"] {
/* width:60%; */
margin:10px 20%;
- font-family: "Helvetica Neue", "Arial";
+/* font-family: "Helvetica Neue", "Arial";
font-size: 0.75em;
background: #f0f0f0;
background: linear-gradient(0deg, #f0f0f0, #fefefe);
@@ -66,10 +66,10 @@ form input[type="submit"] {
box-sizing: border-box;
text-align: center;
text-decoration: none;
- font-weight:600;
+ font-weight:600;*/
}
form input[type="submit"]:hover {
- background: linear-gradient(0deg, #e8e8e8, #f8f8f8);
+ /*background: linear-gradient(0deg, #e8e8e8, #f8f8f8);*/
}
form input {
font-size: 16px;
@@ -138,4 +138,16 @@ form label.mini-desc a {
display: inline;
font-weight: normal;
margin-right: 0;
+}
+
+.loginFeedback {
+ display: none;
+ padding: 3px;
+ background: #EFF3B6;
+ background: rgba(255, 253, 0, 0.2);
+ border: 1px solid rgb(219, 225, 45);
+ margin: 0;
+ white-space: normal;
+ line-height: 18px;
+ margin-bottom: 1em;
}
\ No newline at end of file
diff --git a/public/js/account-settings.js b/public/js/account-settings.js
deleted file mode 100644
index 0496ecbf..00000000
--- a/public/js/account-settings.js
+++ /dev/null
@@ -1,33 +0,0 @@
-;(function(){
-
- function getHash(){
- return window.location.hash.slice(1);
- }
-
- var $contents = $('#content article')
- var $btns = $('.sidebar-btn').click(function(event){
- $btns.removeClass('selected');
- var hash = $(this).addClass('selected')[0].hash.slice(1);
- $contents.hide().filter(function(i, el){
- return el.id === hash
- }).show();
-
- });
-
- // Kick it all off
-
- if(!window.location.hash) {
- window.location.hash = $btns.filter(function(i, el){
- return el.attributes.default;
- })[0].hash;
- }
-
- $contents.filter(function(i, el){
- return el.id === getHash();
- }).show();
-
- $btns.filter(function(i, el){
- return el.hash === window.location.hash;
- }).addClass('selected');
-
-})//()
diff --git a/public/js/account/account-settings.js b/public/js/account/account-settings.js
new file mode 100644
index 00000000..3333ab13
--- /dev/null
+++ b/public/js/account/account-settings.js
@@ -0,0 +1,39 @@
+(function(){
+ 'use strict';
+
+ /* globals $ */
+
+ $('form.login').submit(function (event) {
+ event.preventDefault();
+
+ var form = $(this);
+ var name = form.find('input[name=username]').val();
+ var key = form.find('input[name=password]').val();
+ var email = form.find('input[name=email]').val();
+ var $loginFeedback = form.find('.loginFeedback');
+ var $csrf = $('#_csrf');
+
+ $loginFeedback.show().text('Checking...');
+
+ $.ajax({
+ url: form.attr('action'),
+ data: {
+ username: name,
+ key: key,
+ email: email,
+ _csrf: $csrf.val()
+ },
+ type: 'POST',
+ dataType: 'json',
+ complete: function (jqXHR) {
+ var data = $.parseJSON(jqXHR.responseText) || {};
+ if (jqXHR.status === 200) {
+ if (data.message) {
+ $loginFeedback.text(data.message);
+ }
+ }
+ }
+ });
+ });
+
+})();
\ No newline at end of file
diff --git a/public/js/editor-settings.js b/public/js/account/editor-settings.js
similarity index 99%
rename from public/js/editor-settings.js
rename to public/js/account/editor-settings.js
index c9473280..4ae36880 100644
--- a/public/js/editor-settings.js
+++ b/public/js/account/editor-settings.js
@@ -65,6 +65,7 @@
];
var addonsKeys = [
+ 'activeline',
'closebrackets',
'highlight',
'matchtags',
diff --git a/public/js/account/preferences-settings.js b/public/js/account/preferences-settings.js
new file mode 100644
index 00000000..0a0ab904
--- /dev/null
+++ b/public/js/account/preferences-settings.js
@@ -0,0 +1,118 @@
+(function(){
+ 'use strict';
+
+ /* global $ */
+
+ function getCurrentSettings(){
+ return JSON.parse(localStorage.settings || '{}') || {
+
+ };
+ }
+
+ $.browser = {};
+ // work out the browser platform
+ var ua = navigator.userAgent;
+ if (ua.indexOf(' Mac ') !== -1) {
+ $.browser.platform = 'mac';
+ } else if (/windows|win32/.test(ua)) {
+ $.browser.platform = 'win';
+ } else if (/linux/.test(ua)) {
+ $.browser.platform = 'linux';
+ } else {
+ $.browser.platform = '';
+ }
+
+ // Setup variables
+ var $csrf = $('#_csrf');
+ var currentSettings = {
+ panels: [],
+ includejs: true,
+ focusedPanel: 'html',
+ jshint: true
+ };
+ $.extend(currentSettings, getCurrentSettings());
+ var panels = ['html', 'css', 'javascript', 'console', 'live'];
+ var $panels = {};
+ var $includejs = $('#includejs').prop('checked', currentSettings.includejs);
+ var $focusedPanel = $('#focused-panel').val(currentSettings.focusedPanel);
+ var hints = ['js'];
+ var $hints = {};
+
+ var jshints = {
+ 'forin': 'About unsafe for..in',
+ 'eqnull': 'About == null',
+ 'noempty': 'About empty blocks',
+ 'eqeqeq': 'About unsafe comparisons',
+ 'boss': 'About assignments inside if/for/...',
+ 'undef': 'When variable is undefined',
+ 'unused': 'When variable is defined but not used',
+ 'curly': 'When blocks omit {}'
+ };
+ var source = '';
+
+ for (var i = 0; i < panels.length; i++) {
+ $panels[panels[i]] = $('#panel-' + panels[i])
+ .prop('checked', currentSettings.panels.indexOf(panels[i]) !== -1);
+ }
+
+ for (var m = 0; m < hints.length; m++) {
+ $hints[hints[m]] = $('#' + hints[m] + 'hint')
+ .prop('checked', currentSettings[ hints[m] + 'hint' ]);
+ }
+
+ for (var prop in jshints) {
+ if (jshints.hasOwnProperty(prop)) {
+ source += '
As soon as you make any changes, they will be automatically saved.
+ -Not working right now, come back soon my love!
-