From 4ea176d65686ca6f274de15dde9e2603f3d6eda8 Mon Sep 17 00:00:00 2001 From: Shiung Date: Wed, 22 Jul 2015 19:05:35 +0800 Subject: [PATCH 1/9] First commit --- _Shiung.txt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 _Shiung.txt diff --git a/_Shiung.txt b/_Shiung.txt new file mode 100644 index 0000000..f4c8345 --- /dev/null +++ b/_Shiung.txt @@ -0,0 +1,8 @@ +150722 == First Log == + +Shiung here on first commit and setup. + +TODO: Add in a component that changes app color theme (background and font). +TODO: Add in recognition of simple terms such as "TODO". +TODO: Add in programming syntax recognition and formatting. + From 814e65aef912410f5e8f937fed3fed798d541812 Mon Sep 17 00:00:00 2001 From: Shiung Date: Wed, 22 Jul 2015 19:08:21 +0800 Subject: [PATCH 2/9] Created wip branch --- _Shiung.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_Shiung.txt b/_Shiung.txt index f4c8345..6b2f5c6 100644 --- a/_Shiung.txt +++ b/_Shiung.txt @@ -1,6 +1,8 @@ 150722 == First Log == Shiung here on first commit and setup. +Updated with log file and create "wip" branch for development. +Forgotted and made the first commit to master. TODO: Add in a component that changes app color theme (background and font). TODO: Add in recognition of simple terms such as "TODO". From 1cc10f1876ff164d54e7a3b4f696abf5445337d0 Mon Sep 17 00:00:00 2001 From: Shiung Date: Tue, 18 Aug 2015 08:40:58 +0800 Subject: [PATCH 3/9] changed Ruby and Rails version --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index e72101e..30e6bd7 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' -ruby '1.9.3' -gem 'rails', '3.2.13' +ruby '2.2.2' +gem 'rails', '4.2.3' gem 'pg' From 4b4475ff078c3ac55e91811d53191daba6777f17 Mon Sep 17 00:00:00 2001 From: Shiung Date: Tue, 18 Aug 2015 08:55:18 +0800 Subject: [PATCH 4/9] Updated Gemfile to run app locally. Met DEPRECATION WARNING when starting up with --- Gemfile | 19 +---- Gemfile.lock | 202 ++++++++++++++++++++++++-------------------- log/development.log | 1 + tmp/pids/server.pid | 1 - 4 files changed, 117 insertions(+), 106 deletions(-) delete mode 100644 tmp/pids/server.pid diff --git a/Gemfile b/Gemfile index 30e6bd7..5bfc287 100644 --- a/Gemfile +++ b/Gemfile @@ -8,21 +8,10 @@ gem 'pg' # Gems used only for assets and not required # in production environments by default. group :assets do - gem 'sass-rails', '~> 3.2.3' - gem 'coffee-rails', '~> 3.2.1' - gem 'uglifier', '>= 1.0.3' + gem 'sass-rails' + gem 'coffee-rails', '~> 4.1.0' + gem 'uglifier', '~> 2.7.1' end gem 'jquery-rails' - -# To use ActiveModel has_secure_password -# gem 'bcrypt-ruby', '~> 3.0.0' - -# To use Jbuilder templates for JSON -# gem 'jbuilder' - -# Deploy with Capistrano -# gem 'capistrano' - -# To use debugger -# gem 'debugger' +gem 'jquery-ui-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 6b06a9f..5987b18 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,111 +1,133 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (3.2.13) - actionpack (= 3.2.13) - mail (~> 2.5.3) - actionpack (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - builder (~> 3.0.0) + actionmailer (4.2.3) + actionpack (= 4.2.3) + actionview (= 4.2.3) + activejob (= 4.2.3) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.3) + actionview (= 4.2.3) + activesupport (= 4.2.3) + rack (~> 1.6) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.3) + activesupport (= 4.2.3) + builder (~> 3.1) erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.5) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) - activemodel (3.2.13) - activesupport (= 3.2.13) - builder (~> 3.0.0) - activerecord (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - activesupport (3.2.13) - i18n (= 0.6.1) - multi_json (~> 1.0) - arel (3.0.2) - builder (3.0.4) - coffee-rails (3.2.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (4.2.3) + activesupport (= 4.2.3) + globalid (>= 0.3.0) + activemodel (4.2.3) + activesupport (= 4.2.3) + builder (~> 3.1) + activerecord (4.2.3) + activemodel (= 4.2.3) + activesupport (= 4.2.3) + arel (~> 6.0) + activesupport (4.2.3) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + arel (6.0.3) + builder (3.2.2) + coffee-rails (4.1.0) coffee-script (>= 2.2.0) - railties (~> 3.2.0) - coffee-script (2.2.0) + railties (>= 4.0.0, < 5.0) + coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.6.2) + coffee-script-source (1.9.1.1) erubis (2.7.0) - execjs (1.4.0) - multi_json (~> 1.0) - hike (1.2.3) - i18n (0.6.1) - journey (1.0.4) - jquery-rails (3.0.1) - railties (>= 3.0, < 5.0) + execjs (2.6.0) + globalid (0.3.6) + activesupport (>= 4.1.0) + i18n (0.7.0) + jquery-rails (4.0.4) + rails-dom-testing (~> 1.0) + railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (1.8.0) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mime-types (1.23) - multi_json (1.7.7) - pg (0.15.1) - polyglot (0.3.3) - rack (1.4.5) - rack-cache (1.2) - rack (>= 0.4) - rack-ssl (1.3.3) - rack - rack-test (0.6.2) + jquery-ui-rails (5.0.5) + railties (>= 3.2.16) + json (1.8.3) + loofah (2.0.3) + nokogiri (>= 1.5.9) + mail (2.6.3) + mime-types (>= 1.16, < 3) + mime-types (2.6.1) + mini_portile (0.6.2) + minitest (5.8.0) + nokogiri (1.6.6.2) + mini_portile (~> 0.6.0) + pg (0.18.2) + rack (1.6.4) + rack-test (0.6.3) rack (>= 1.0) - rails (3.2.13) - actionmailer (= 3.2.13) - actionpack (= 3.2.13) - activerecord (= 3.2.13) - activeresource (= 3.2.13) - activesupport (= 3.2.13) - bundler (~> 1.0) - railties (= 3.2.13) - railties (3.2.13) - actionpack (= 3.2.13) - activesupport (= 3.2.13) - rack-ssl (~> 1.3.2) + rails (4.2.3) + actionmailer (= 4.2.3) + actionpack (= 4.2.3) + actionview (= 4.2.3) + activejob (= 4.2.3) + activemodel (= 4.2.3) + activerecord (= 4.2.3) + activesupport (= 4.2.3) + bundler (>= 1.3.0, < 2.0) + railties (= 4.2.3) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.7) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6.0) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.0.2) + loofah (~> 2.0) + railties (4.2.3) + actionpack (= 4.2.3) + activesupport (= 4.2.3) rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (10.1.0) - rdoc (3.12.2) - json (~> 1.4) - sass (3.2.9) - sass-rails (3.2.6) - railties (~> 3.2.0) - sass (>= 3.1.10) - tilt (~> 1.3) - sprockets (2.2.2) - hike (~> 1.2) - multi_json (~> 1.0) + thor (>= 0.18.1, < 2.0) + rake (10.4.2) + sass (3.4.16) + sass-rails (5.0.3) + railties (>= 4.0.0, < 5.0) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (~> 1.1) + sprockets (3.3.1) rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - thor (0.18.1) + sprockets-rails (2.3.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + sprockets (>= 2.8, < 4.0) + thor (0.19.1) + thread_safe (0.3.5) tilt (1.4.1) - treetop (1.4.14) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.37) - uglifier (2.1.1) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (2.7.1) execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) + json (>= 1.8.0) PLATFORMS ruby DEPENDENCIES - coffee-rails (~> 3.2.1) + coffee-rails (~> 4.1.0) jquery-rails + jquery-ui-rails pg - rails (= 3.2.13) - sass-rails (~> 3.2.3) - uglifier (>= 1.0.3) + rails (= 4.2.3) + sass-rails + uglifier (~> 2.7.1) + +BUNDLED WITH + 1.10.6 diff --git a/log/development.log b/log/development.log index 66f0e8d..1766ce3 100644 --- a/log/development.log +++ b/log/development.log @@ -432,3 +432,4 @@ Connecting to database specified by database.yml Connecting to database specified by database.yml Connecting to database specified by database.yml Connecting to database specified by database.yml +DEPRECATION WARNING: You didn't set `secret_key_base`. Read the upgrade documentation to learn more about this new config option. (called from service at /Users/Shiung/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138) diff --git a/tmp/pids/server.pid b/tmp/pids/server.pid deleted file mode 100644 index a5cd10d..0000000 --- a/tmp/pids/server.pid +++ /dev/null @@ -1 +0,0 @@ -2491 \ No newline at end of file From ed7bb15da29b266a2ee6278c4ed41dd588b8df82 Mon Sep 17 00:00:00 2001 From: Shiung Date: Tue, 18 Aug 2015 09:07:18 +0800 Subject: [PATCH 5/9] tweaking database errors --- Gemfile | 1 - Gemfile.lock | 3 --- _Shiung.txt | 20 +++++++++++++++++++- app/assets/stylesheets/style.css | 29 +++++++++++++++++++++++------ 4 files changed, 42 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 5bfc287..8abe61d 100644 --- a/Gemfile +++ b/Gemfile @@ -14,4 +14,3 @@ group :assets do end gem 'jquery-rails' -gem 'jquery-ui-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 5987b18..9f056d6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -54,8 +54,6 @@ GEM rails-dom-testing (~> 1.0) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (5.0.5) - railties (>= 3.2.16) json (1.8.3) loofah (2.0.3) nokogiri (>= 1.5.9) @@ -123,7 +121,6 @@ PLATFORMS DEPENDENCIES coffee-rails (~> 4.1.0) jquery-rails - jquery-ui-rails pg rails (= 4.2.3) sass-rails diff --git a/_Shiung.txt b/_Shiung.txt index 6b2f5c6..bc02402 100644 --- a/_Shiung.txt +++ b/_Shiung.txt @@ -1,10 +1,28 @@ 150722 == First Log == +Recreated a new clone from the original repository. Shiung here on first commit and setup. Updated with log file and create "wip" branch for development. Forgotted and made the first commit to master. TODO: Add in a component that changes app color theme (background and font). -TODO: Add in recognition of simple terms such as "TODO". +TODO: Add in recognition of simple terms such as "TODO", "BUG", "ERROR", "DONE", "HELP", "HACK". TODO: Add in programming syntax recognition and formatting. +150818 == Second Log == +Created WIP branch to separate changes. + +Updated gems in Gemfile to the latest available versions. +Removed original 'Gemfile.lock'. + +Validated that app works locally. +Noticed a WARNING about missing secret keys when running "rails s" + +ERROR: config.eagar_load is set to nil. Please update your config/environments/*.rb files accordingly: + * development - set to false + * test - set to false + * production - set it to true + +Updated CSS formatting in assets/stylesheets/style.css + +Updated log. diff --git a/app/assets/stylesheets/style.css b/app/assets/stylesheets/style.css index 0cb2d56..e1c742e 100755 --- a/app/assets/stylesheets/style.css +++ b/app/assets/stylesheets/style.css @@ -2,9 +2,26 @@ * ==|== normalize ========================================================== */ -textarea { background-color:black; color:white; font-size:20px; resize:none; line-spacing:200%; height:40px; display: block; -width: 800px; height:800px; margin: 0 auto; margin-top:100px;overflow: hidden; - cursor:default; - outline:none; //remove blue border - font-family: verdana, arial, helvetica, sans-serif;border:none;} -body{ background: black; color: #EBEBEB;} +textarea { + background-color:black; + color:white; + font-size:20px; + resize:none; + line-spacing:200%; + height:40px; + display: block; + width: 800px; + height:800px; + margin: 0 auto; + margin-top:100px; + overflow: hidden; + cursor:default; + outline:none; //remove blue border + font-family: verdana, arial, helvetica, sans-serif; + border:none; +} + +body{ + background: black; + color: #EBEBEB; +} From 037d470dc9ce111507e370ce08985afe6cabe9a0 Mon Sep 17 00:00:00 2001 From: Shiung Date: Tue, 18 Aug 2015 09:16:31 +0800 Subject: [PATCH 6/9] Tweaked text in README.rdoc and updated log --- README.rdoc | 14 +++++--------- _Shiung.txt | 11 +++++++++++ app/assets/stylesheets/style.css | 4 ---- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/README.rdoc b/README.rdoc index 5318108..3a4b56c 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,18 +1,14 @@ -== Brighter +== Brighter -Brighter is an ultra simple, web-based, distraction free writer. Focus on writing, that's all it matters. +Brighter is an ultra simple, web-based, distraction free writer. Focus on writing, that's all it matters. == Info -1. There is no backend. Hence, there is no tracking. nothing is saved. +1. There is no backend. Hence, there is no tracking. nothing is saved. -2. It works on all desktop browsers. Tested on Firefox, Safari and Chrome on a mac. +2. It works on all desktop browsers. Tested on Firefox, Safari and Chrome on a Mac. -3. On a mac, Cmd+f for full screen mode. On PC, Ctrl+f for full screen. +3. On a mac, **Cmd + Ctrl + f** for full screen mode. On PC, **Ctrl + f** for full screen. 4. Uses behave.js for IDE style behaviors. - - - - diff --git a/_Shiung.txt b/_Shiung.txt index bc02402..2a8eb93 100644 --- a/_Shiung.txt +++ b/_Shiung.txt @@ -25,4 +25,15 @@ ERROR: config.eagar_load is set to nil. Please update your config/environments/* Updated CSS formatting in assets/stylesheets/style.css +Noticed that some files were using "Briter" instead of "Brighter" + * app/assets/views/layout/application.html.erb + * config/initializers/secret_token.rb + * config/initializers/session_store.rb + * config/locales/application.rb + * config/locales/environment.rb + * config/locales/routes.rb + +Updated README.rdoc +Another README is located in doc/README_FOR_APP + Updated log. diff --git a/app/assets/stylesheets/style.css b/app/assets/stylesheets/style.css index e1c742e..876cd93 100755 --- a/app/assets/stylesheets/style.css +++ b/app/assets/stylesheets/style.css @@ -1,7 +1,3 @@ -/* HTML5 ✰ Boilerplate - * ==|== normalize ========================================================== - */ - textarea { background-color:black; color:white; From d8eb9e7502244d5066b2fca81de69bf466a9f503 Mon Sep 17 00:00:00 2001 From: Shiung Date: Tue, 18 Aug 2015 09:43:26 +0800 Subject: [PATCH 7/9] merged wip, changed README.rdoc to README.md, updated text. --- README.rdoc => README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename README.rdoc => README.md (95%) diff --git a/README.rdoc b/README.md similarity index 95% rename from README.rdoc rename to README.md index 3a4b56c..a9dfe88 100644 --- a/README.rdoc +++ b/README.md @@ -1,9 +1,9 @@ -== Brighter +# Brighter Brighter is an ultra simple, web-based, distraction free writer. Focus on writing, that's all it matters. -== Info +# Info 1. There is no backend. Hence, there is no tracking. nothing is saved. From e0c0056c412ad20660bbcb656377b7aceb1d39f6 Mon Sep 17 00:00:00 2001 From: Shiung Date: Tue, 18 Aug 2015 09:45:24 +0800 Subject: [PATCH 8/9] tweaked README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a9dfe88..37f9c0f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Brighter is an ultra simple, web-based, distraction free writer. Focus on writing, that's all it matters. -# Info +## Info 1. There is no backend. Hence, there is no tracking. nothing is saved. From 6c9a317827be6f4f70d058bc4f2b526590e4a88e Mon Sep 17 00:00:00 2001 From: Shiung Date: Tue, 18 Aug 2015 21:21:56 +0800 Subject: [PATCH 9/9] Added in behave.js in JS assets --- app/assets/javascripts/behave.js | 633 +++++++++++++++++++++++++++++++ 1 file changed, 633 insertions(+) create mode 100644 app/assets/javascripts/behave.js diff --git a/app/assets/javascripts/behave.js b/app/assets/javascripts/behave.js new file mode 100644 index 0000000..5e75f60 --- /dev/null +++ b/app/assets/javascripts/behave.js @@ -0,0 +1,633 @@ +/* + * Behave.js + * + * Copyright 2013, Jacob Kelley - http://jakiestfu.com/ + * Released under the MIT Licence + * http://opensource.org/licenses/MIT + * + * Github: http://github.com/jakiestfu/Behave.js/ + * Version: 1.5 + */ + + +(function(undefined){ + + 'use strict'; + + var BehaveHooks = BehaveHooks || (function(){ + var hooks = {}; + + return { + add: function(hookName, fn){ + if(typeof hookName == "object"){ + var i; + for(i=0; i>> 0; + if (typeof func != "function"){ + throw new TypeError(); + } + var res = [], + thisp = arguments[1]; + for (var i = 0; i < len; i++) { + if (i in t) { + var val = t[i]; + if (func.call(thisp, val, i, t)) { + res.push(val); + } + } + } + return res; + }; + } + + var defaults = { + textarea: null, + replaceTab: true, + softTabs: true, + tabSize: 4, + autoOpen: true, + overwrite: true, + autoStrip: true, + autoIndent: true, + fence: false + }, + tab, + newLine, + charSettings = { + + keyMap: [ + { open: "\"", close: "\"", canBreak: false }, + { open: "'", close: "'", canBreak: false }, + { open: "(", close: ")", canBreak: false }, + { open: "[", close: "]", canBreak: true }, + { open: "{", close: "}", canBreak: true } + ] + + }, + utils = { + + _callHook: function(hookName, passData){ + var hooks = BehaveHooks.get(hookName); + passData = typeof passData=="boolean" && passData === false ? false : true; + + if(hooks){ + if(passData){ + var theEditor = defaults.textarea, + textVal = theEditor.value, + caretPos = utils.cursor.get(), + i; + + for(i=0; i -1) { + start = end = len; + } else { + start = -textInputRange.moveStart("character", -len); + start += normalizedValue.slice(0, start).split(newLine).length - 1; + + if (textInputRange.compareEndPoints("EndToEnd", endRange) > -1) { + end = len; + } else { + end = -textInputRange.moveEnd("character", -len); + end += normalizedValue.slice(0, end).split(newLine).length - 1; + } + } + } + } + + return start==end ? false : { + start: start, + end: end + }; + } + }, + editor: { + getLines: function(textVal){ + return (textVal).split("\n").length; + }, + get: function(){ + return defaults.textarea.value.replace(/\r/g,''); + }, + set: function(data){ + defaults.textarea.value = data; + } + }, + fenceRange: function(){ + if(typeof defaults.fence == "string"){ + + var data = utils.editor.get(), + pos = utils.cursor.get(), + hacked = 0, + matchedFence = data.indexOf(defaults.fence), + matchCase = 0; + + while(matchedFence>=0){ + matchCase++; + if( pos < (matchedFence+hacked) ){ + break; + } + + hacked += matchedFence+defaults.fence.length; + data = data.substring(matchedFence+defaults.fence.length); + matchedFence = data.indexOf(defaults.fence); + + } + + if( (hacked) < pos && ( (matchedFence+hacked) > pos ) && matchCase%2===0){ + return true; + } + return false; + } else { + return true; + } + }, + isEven: function(_this,i){ + return i%2; + }, + levelsDeep: function(){ + var pos = utils.cursor.get(), + val = utils.editor.get(); + + var left = val.substring(0, pos), + levels = 0, + i, j; + + for(i=0; i=0 ? finalLevels : 0; + }, + deepExtend: function(destination, source) { + for (var property in source) { + if (source[property] && source[property].constructor && + source[property].constructor === Object) { + destination[property] = destination[property] || {}; + utils.deepExtend(destination[property], source[property]); + } else { + destination[property] = source[property]; + } + } + return destination; + }, + addEvent: function addEvent(element, eventName, func) { + if (element.addEventListener){ + element.addEventListener(eventName,func,false); + } else if (element.attachEvent) { + element.attachEvent("on"+eventName, func); + } + }, + removeEvent: function addEvent(element, eventName, func){ + if (element.addEventListener){ + element.removeEventListener(eventName,func,false); + } else if (element.attachEvent) { + element.detachEvent("on"+eventName, func); + } + }, + + preventDefaultEvent: function(e){ + if(e.preventDefault){ + e.preventDefault(); + } else { + e.returnValue = false; + } + } + }, + intercept = { + tabKey: function (e) { + + if(!utils.fenceRange()){ return; } + + if (e.keyCode == 9) { + utils.preventDefaultEvent(e); + + var toReturn = true; + utils._callHook('tab:before'); + + var selection = utils.cursor.selection(), + pos = utils.cursor.get(), + val = utils.editor.get(); + + if(selection){ + + var tempStart = selection.start; + while(tempStart--){ + if(val.charAt(tempStart)=="\n"){ + selection.start = tempStart + 1; + break; + } + } + + var toIndent = val.substring(selection.start, selection.end), + lines = toIndent.split("\n"), + i; + + if(e.shiftKey){ + for(i = 0; i