From f99718daa0c051fbc97edf0b66b22506e6542e20 Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Sat, 14 Mar 2015 01:51:28 -0700 Subject: [PATCH 1/2] update meta og:image --- views/partials/meta.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/partials/meta.jade b/views/partials/meta.jade index 31a92ee4dc..ebaba6a9b2 100644 --- a/views/partials/meta.jade +++ b/views/partials/meta.jade @@ -10,7 +10,7 @@ meta(name='twitter:widgets:csp', content='on') meta(name='p:domain_verify', content='d0bc047a482c03c24f1168004c2a216a') meta(property="og:url", content="http://www.freecodecamp.com") meta(property="og:description", content="Free Code Camp is a community of busy people who learn to code by collaborating on projects for nonprofits. Build your full stack JavaScript Portfolio today.") -meta(property="og:image", content="https://pbs.twimg.com/profile_images/522961310212833280/XE6vGAaO.jpeg") +meta(property="og:image", content="https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png") meta(property="og:type", content="article") meta(property="article:publisher", content="https://www.facebook.com/freecodecamp") meta(property="article:section", content="Responsive") From 191e38472e35985777d702ae29dd6caab912ae05 Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Sat, 14 Mar 2015 15:07:05 -0700 Subject: [PATCH 2/2] make selected indenting and outdenting work on courseware HTML, JS and Bonfires --- .../js/lib/bonfire/bonfireFramework_v0.1.2.js | 16 ++++++++++++++-- .../coursewaresHCJQFramework_v0.1.1.js | 17 +++++++++++++++-- .../lib/coursewares/coursewaresJSFramework.js | 16 ++++++++++++++-- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/public/js/lib/bonfire/bonfireFramework_v0.1.2.js b/public/js/lib/bonfire/bonfireFramework_v0.1.2.js index 4b2edebb0e..a4ae597c07 100644 --- a/public/js/lib/bonfire/bonfireFramework_v0.1.2.js +++ b/public/js/lib/bonfire/bonfireFramework_v0.1.2.js @@ -18,8 +18,20 @@ editor.setSize("100%", "auto"); // Hijack tab key to enter two spaces intead editor.setOption("extraKeys", { Tab: function(cm) { - var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); - cm.replaceSelection(spaces); + if (cm.somethingSelected()){ + cm.indentSelection("add"); + } else { + var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); + cm.replaceSelection(spaces); + } + }, + "Shift-Tab": function(cm) { + if (cm.somethingSelected()){ + cm.indentSelection("subtract"); + } else { + var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); + cm.replaceSelection(spaces); + } }, "Ctrl-Enter": function() { bonfireExecute(); diff --git a/public/js/lib/coursewares/coursewaresHCJQFramework_v0.1.1.js b/public/js/lib/coursewares/coursewaresHCJQFramework_v0.1.1.js index 236c80b05a..d7928afc20 100644 --- a/public/js/lib/coursewares/coursewaresHCJQFramework_v0.1.1.js +++ b/public/js/lib/coursewares/coursewaresHCJQFramework_v0.1.1.js @@ -22,10 +22,23 @@ var editor = myCodeMirror; // Hijack tab key to insert two spaces instead editor.setOption("extraKeys", { Tab: function(cm) { - var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); - cm.replaceSelection(spaces); + if (cm.somethingSelected()){ + cm.indentSelection("add"); + } else { + var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); + cm.replaceSelection(spaces); + } + }, + "Shift-Tab": function(cm) { + if (cm.somethingSelected()){ + cm.indentSelection("subtract"); + } else { + var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); + cm.replaceSelection(spaces); + } }, "Ctrl-Enter": function() { + bonfireExecute(); return false; } }); diff --git a/public/js/lib/coursewares/coursewaresJSFramework.js b/public/js/lib/coursewares/coursewaresJSFramework.js index 60af334324..ee89e7eaf4 100644 --- a/public/js/lib/coursewares/coursewaresJSFramework.js +++ b/public/js/lib/coursewares/coursewaresJSFramework.js @@ -18,8 +18,20 @@ editor.setSize("100%", "auto"); // Hijack tab key to enter two spaces intead editor.setOption("extraKeys", { Tab: function(cm) { - var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); - cm.replaceSelection(spaces); + if (cm.somethingSelected()){ + cm.indentSelection("add"); + } else { + var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); + cm.replaceSelection(spaces); + } + }, + "Shift-Tab": function(cm) { + if (cm.somethingSelected()){ + cm.indentSelection("subtract"); + } else { + var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); + cm.replaceSelection(spaces); + } }, "Ctrl-Enter": function() { bonfireExecute();