From be4e0bb7e41cf5e4e10db6ddd2603be429311c9b Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Thu, 13 Feb 2014 10:37:50 +0000 Subject: [PATCH] misc. js&css for account/* --- public/css/profile-settings.css | 31 +++++++++++++++++++++++++++++++ public/js/account-settings.js | 33 +++++++++++++++++++++++++++++++++ public/js/editor-settings.js | 5 +++++ 3 files changed, 69 insertions(+) create mode 100644 public/css/profile-settings.css create mode 100644 public/js/account-settings.js create mode 100644 public/js/editor-settings.js diff --git a/public/css/profile-settings.css b/public/css/profile-settings.css new file mode 100644 index 00000000..ce4a92ed --- /dev/null +++ b/public/css/profile-settings.css @@ -0,0 +1,31 @@ +form input[type="submit"] { + width:60%; + margin:10px 20%; + font-family: "Helvetica Neue", "Arial"; + font-size: 0.75em; + background: #f0f0f0; + background: linear-gradient(0deg, #f0f0f0, #fefefe); + box-shadow: 0 3px 2px 0px #eee; + border: 1px solid rgba(0,0,0,0.5); + border-radius: 2px; + border-bottom:1px solid rgba(0,0,0,0.5); + padding: 5px 10px; + cursor: pointer; + display: inline; + -moz-box-sizing: border-box; + box-sizing: border-box; + text-align: center; + text-decoration: none; + font-weight:600; +} +form input[type="submit"]:hover { + background: linear-gradient(0deg, #e8e8e8, #f8f8f8); +} +form input { + width:100%; + font-size:1.1em; + margin:0px 0px 15px; +} +form label { + font-size:0.9em; +} diff --git a/public/js/account-settings.js b/public/js/account-settings.js new file mode 100644 index 00000000..0496ecbf --- /dev/null +++ b/public/js/account-settings.js @@ -0,0 +1,33 @@ +;(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/editor-settings.js b/public/js/editor-settings.js new file mode 100644 index 00000000..bfcd8075 --- /dev/null +++ b/public/js/editor-settings.js @@ -0,0 +1,5 @@ +var $textarea = $('textarea'); + +var editor = CodeMirror.fromTextArea($textarea[0], { + mode: "javascript" +}); \ No newline at end of file