From 7e13ed59a868e917dcccce5f550b3c4ad2619af9 Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Wed, 3 Aug 2016 15:22:54 -0500 Subject: [PATCH 1/2] added jquery to live-coder iframes --- .../javascripts/{live-coder.js => live-coder.js.erb} | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename app/assets/javascripts/{live-coder.js => live-coder.js.erb} (93%) diff --git a/app/assets/javascripts/live-coder.js b/app/assets/javascripts/live-coder.js.erb similarity index 93% rename from app/assets/javascripts/live-coder.js rename to app/assets/javascripts/live-coder.js.erb index 099766b..360b996 100644 --- a/app/assets/javascripts/live-coder.js +++ b/app/assets/javascripts/live-coder.js.erb @@ -14,19 +14,24 @@ function updateResults(elem) { codeFrame.setAttribute("height", "100%"); resultsContainer.appendChild(codeFrame); + var jqueryNode = document.createElement("script"); + jqueryNode.setAttribute("type", "text/javascript"); + jqueryNode.setAttribute("src", "<%= "//#{ENV['full_app_url']}#{javascript_path "jquery"}" %>"); + iHead.appendChild(jqueryNode); + var codeStyle = document.createElement("style"); codeStyle.setAttribute("type", "text/css"); var rulesNode = document.createTextNode(codeCss); codeStyle.appendChild(rulesNode); iHead.appendChild(codeStyle); - iDoc.appendChild(iHead); + iDoc.appendChild(iHead); iBody.innerHTML = codeHtml; iDoc.appendChild(iBody); var codeScript = document.createElement("script"); codeScript.setAttribute("type", "text/javascript"); - var scriptNode = document.createTextNode(codeJs); + var scriptNode = document.createTextNode("setTimeout(function(){ " + codeJs + "}, 800);"); codeScript.appendChild(scriptNode); iDoc.appendChild(codeScript); From 1680445c18f85e4c7c60fa9fd2a44fb33811fa7b Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Wed, 3 Aug 2016 16:45:00 -0500 Subject: [PATCH 2/2] fixed font paths --- app/assets/stylesheets/atoms/_fonts.scss | 103 ++++++++++++----------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/app/assets/stylesheets/atoms/_fonts.scss b/app/assets/stylesheets/atoms/_fonts.scss index 6066979..4d2b0c4 100644 --- a/app/assets/stylesheets/atoms/_fonts.scss +++ b/app/assets/stylesheets/atoms/_fonts.scss @@ -3,62 +3,63 @@ @font-face { font-family: 'HalisR'; src:local('Halis R Thin'), - font-path('HalisR-Thin.woff2') format('woff2'), - font-path('HalisR-Thin.woff') format('woff'), - font-path('HalisR-Thin.otf') format('opentype'); + font_url('HalisR-Thin.woff2') format('woff2'), + font_url('HalisR-Thin.woff') format('woff'), + font_url('HalisR-Thin.otf') format('opentype'); font-weight:100; } + @font-face { font-family: 'HalisR'; src:local('Halis R Light'), - font-path('HalisR-Light.woff2') format('woff2'), - font-path('HalisR-Light.woff') format('woff'), - font-path('HalisR-Light.otf') format('opentype'); + font_url('HalisR-Light.woff2') format('woff2'), + font_url('HalisR-Light.woff') format('woff'), + font_url('HalisR-Light.otf') format('opentype'); font-weight:200; } @font-face { font-family: 'HalisR'; src:local('Halis R Book'), - font-path('HalisR-Book.woff2') format('woff2'), - font-path('HalisR-Book.woff') format('woff'), - font-path('HalisR-Book.otf') format('opentype'); + font_url('HalisR-Book.woff2') format('woff2'), + font_url('HalisR-Book.woff') format('woff'), + font_url('HalisR-Book.otf') format('opentype'); font-weight:300; } @font-face { font-family: 'HalisR'; src:local('Halis R Regular'), - font-path('HalisR-Regular.woff2') format('woff2'), - font-path('HalisR-Regular.woff') format('woff'), - font-path('HalisR-Regular.otf') format('opentype'); + font_url('HalisR-Regular.woff2') format('woff2'), + font_url('HalisR-Regular.woff') format('woff'), + font_url('HalisR-Regular.otf') format('opentype'); font-weight:500; } @font-face { font-family: 'HalisR'; src:local('Halis R Medium'), - font-path('HalisR-Medium.woff2') format('woff2'), - font-path('HalisR-Medium.woff') format('woff'), - font-path('HalisR-Medium.otf') format('opentype'); + font_url('HalisR-Medium.woff2') format('woff2'), + font_url('HalisR-Medium.woff') format('woff'), + font_url('HalisR-Medium.otf') format('opentype'); font-weight:600; } @font-face { font-family: 'HalisR'; src:local('Halis R Bold'), - font-path('HalisR-Bold.woff2') format('woff2'), - font-path('HalisR-Bold.woff') format('woff'), - font-path('HalisR-Bold.otf') format('opentype'); + font_url('HalisR-Bold.woff2') format('woff2'), + font_url('HalisR-Bold.woff') format('woff'), + font_url('HalisR-Bold.otf') format('opentype'); font-weight:700; } @font-face { font-family: 'HalisR'; src:local('Halis R Black'), - font-path('HalisR-Black.woff2') format('woff2'), - font-path('HalisR-Black.woff') format('woff'), - font-path('HalisR-Black.otf') format('opentype'); + font_url('HalisR-Black.woff2') format('woff2'), + font_url('HalisR-Black.woff') format('woff'), + font_url('HalisR-Black.otf') format('opentype'); font-weight:900; } @@ -69,44 +70,44 @@ @font-face { font-family: 'Lato'; src:local('Lato Hairline'), - font-path('Lato-Hairline.woff2') format('woff2'), - font-path('Lato-Hairline.woff') format('woff'), - font-path('Lato-Hairline.ttf') format('truetype'); + font_url('Lato-Hairline.woff2') format('woff2'), + font_url('Lato-Hairline.woff') format('woff'), + font_url('Lato-Hairline.ttf') format('truetype'); font-weight:100; } @font-face { font-family: 'Lato'; src:local('Lato Light'), - font-path('Lato-Light.woff2') format('woff2'), - font-path('Lato-Light.woff') format('woff'), - font-path('Lato-Light.ttf') format('truetype'); + font_url('Lato-Light.woff2') format('woff2'), + font_url('Lato-Light.woff') format('woff'), + font_url('Lato-Light.ttf') format('truetype'); font-weight:300; } @font-face { font-family: 'Lato'; src:local('Lato Regular'), - font-path('Lato-Regular.woff2') format('woff2'), - font-path('Lato-Regular.woff') format('woff'), - font-path('Lato-Regular.ttf') format('truetype'); + font_url('Lato-Regular.woff2') format('woff2'), + font_url('Lato-Regular.woff') format('woff'), + font_url('Lato-Regular.ttf') format('truetype'); font-weight:500; } @font-face { font-family: 'Lato'; src:local('Lato Bold'), - font-path('Lato-Bold.woff2') format('woff2'), - font-path('Lato-Bold.woff') format('woff'), - font-path('Lato-Bold.ttf') format('truetype'); + font_url('Lato-Bold.woff2') format('woff2'), + font_url('Lato-Bold.woff') format('woff'), + font_url('Lato-Bold.ttf') format('truetype'); font-weight:700; } @font-face { font-family: 'Lato'; src:local('Lato Black'), - font-path('Lato-Black.woff2') format('woff2'), - font-path('Lato-Black.woff') format('woff'), - font-path('Lato-Black.ttf') format('truetype'); + font_url('Lato-Black.woff2') format('woff2'), + font_url('Lato-Black.woff') format('woff'), + font_url('Lato-Black.ttf') format('truetype'); font-weight:900; } @@ -115,18 +116,18 @@ @font-face { font-family: 'Lato'; src:local('Lato Hairline Italic'), - font-path('Lato-HairlineItalic.woff2') format('woff2'), - font-path('Lato-HairlineItalic.woff') format('woff'), - font-path('Lato-HairlineItalic.ttf') format('truetype'); + font_url('Lato-HairlineItalic.woff2') format('woff2'), + font_url('Lato-HairlineItalic.woff') format('woff'), + font_url('Lato-HairlineItalic.ttf') format('truetype'); font-weight:100; font-style: italic; } @font-face { font-family: 'Lato'; src:local('Lato Light Italic'), - font-path('Lato-LightItalic.woff2') format('woff2'), - font-path('Lato-LightItalic.woff') format('woff'), - font-path('Lato-LightItalic.ttf') format('truetype'); + font_url('Lato-LightItalic.woff2') format('woff2'), + font_url('Lato-LightItalic.woff') format('woff'), + font_url('Lato-LightItalic.ttf') format('truetype'); font-weight:300; font-style: italic; } @@ -134,9 +135,9 @@ @font-face { font-family: 'Lato'; src:local('Lato Italic'), - font-path('Lato-Italic.woff2') format('woff2'), - font-path('Lato-Italic.woff') format('woff'), - font-path('Lato-Italic.ttf') format('truetype'); + font_url('Lato-Italic.woff2') format('woff2'), + font_url('Lato-Italic.woff') format('woff'), + font_url('Lato-Italic.ttf') format('truetype'); font-weight:500; font-style: italic; } @@ -144,9 +145,9 @@ @font-face { font-family: 'Lato'; src:local('Lato Bold Italic'), - font-path('Lato-BoldItalic.woff2') format('woff2'), - font-path('Lato-BoldItalic.woff') format('woff'), - font-path('Lato-BoldItalic.ttf') format('truetype'); + font_url('Lato-BoldItalic.woff2') format('woff2'), + font_url('Lato-BoldItalic.woff') format('woff'), + font_url('Lato-BoldItalic.ttf') format('truetype'); font-weight:700; font-style: italic; } @@ -154,9 +155,9 @@ @font-face { font-family: 'Lato'; src:local('Lato Black Italic'), - font-path('Lato-BlackItalic.woff2') format('woff2'), - font-path('Lato-BlackItalic.woff') format('woff'), - font-path('Lato-BlackItalic.ttf') format('truetype'); + font_url('Lato-BlackItalic.woff2') format('woff2'), + font_url('Lato-BlackItalic.woff') format('woff'), + font_url('Lato-BlackItalic.ttf') format('truetype'); font-weight:900; font-style: italic; }