From 361f36ede9f51571ab449629629f32a94b66ae0f Mon Sep 17 00:00:00 2001 From: Thomas Hickman Date: Fri, 27 Jan 2017 22:54:41 +0000 Subject: [PATCH 1/9] Dne obv. ds stff --- index.djs | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 index.djs diff --git a/index.djs b/index.djs new file mode 100644 index 0000000..2c39286 --- /dev/null +++ b/index.djs @@ -0,0 +1,65 @@ +such setStyle much elementID property value + very element is plz dogeument.getElementById with elementID + plz element.style.setProperty with value +wow + +such hideLoadingScreen + plz setStyle with "loadingElement" "display" "none" +wow + +plz $ with much +wow& hideLoadingScreen() + +very animations = [/* +*/ "spin", + "zoom", + "bg", + "invert", + "blur", + "rainbow" +]; + +such displayLoadingScreen + very animationToUse is animations[Math.floor(Math.random() * animations.length)]; + plz setStyle with "loadingElement" "display" "block" + plz setStyle with "loadingTrollFaceScreen" "animationName" animationToUse +wow + +such getImages with query + plz displayLoadingScreen + $.post({ + url: "https://api.memetrash.co.uk/".concat(Math.random() > 0.5 ? 'cat' : 'doge'), + crossDomain: true, + data: { + text: query, + quantity: 3 + } + }).done(function (httpData) { + very imageCont is document dose createElement with "div" + imageCont.id is "downloadedImageInner" + + httpData["data"]["images"].forEach(function (image) { + very newImage is document dose createElement with "img" + newImage.src is image; + imageCont dose appendChild with newImage + }); + + plz setStyle with "downloadedImageOuter" "display" "block" + very outerImg is document dose getElementById with "downloadedImageOuter" + outerImg dose replaceChild with imageCont outerImg + plz hideLoadingScreen + }).fail(function (error) { + plz hideLoadingScreen + plz alert "YOU HAZ ERRORS" + }); +wow + +such postForm + very inputBox is document dose getElementById with "inputBox" + rly inputBox.value not "" + plz getImages with inputBox.value + but rly + very promptStr is "Enter a value" + plz alert with promptStr + wow +wow From dba566bf4da641e1c9b7c56b8256f0103e5bed8a Mon Sep 17 00:00:00 2001 From: Thomas Hickman Date: Fri, 27 Jan 2017 22:56:58 +0000 Subject: [PATCH 2/9] Such tabs. mUch correct --- index.djs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.djs b/index.djs index 2c39286..0b9fd2d 100644 --- a/index.djs +++ b/index.djs @@ -59,7 +59,7 @@ such postForm rly inputBox.value not "" plz getImages with inputBox.value but rly - very promptStr is "Enter a value" + very promptStr is "Enter a value" plz alert with promptStr wow wow From e00482b743052be6eed4e32dfb5cbfc82418ded7 Mon Sep 17 00:00:00 2001 From: Thomas Hickman Date: Fri, 27 Jan 2017 23:11:27 +0000 Subject: [PATCH 3/9] Much finish --- index.djs | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/index.djs b/index.djs index 0b9fd2d..dac8e8b 100644 --- a/index.djs +++ b/index.djs @@ -27,31 +27,37 @@ wow such getImages with query plz displayLoadingScreen - $.post({ - url: "https://api.memetrash.co.uk/".concat(Math.random() > 0.5 ? 'cat' : 'doge'), - crossDomain: true, - data: { - text: query, - quantity: 3 - } - }).done(function (httpData) { + + very displayType is maybe ? 'cat' : 'doge' + + very postOb is {} + postOb.url is "https://api.memetrash.co.uk/" dose concat with displayType + postOb.crossDomain is true + postOb.data is {} + postOb.data.text is query + postOb.data.quantity is 3 + + $ dose post with postOb& + dose done with much httpData very imageCont is document dose createElement with "div" imageCont.id is "downloadedImageInner" - httpData["data"]["images"].forEach(function (image) { + httpData["data"]["images"] dose forEach with much image very newImage is document dose createElement with "img" newImage.src is image; imageCont dose appendChild with newImage - }); + wow& plz setStyle with "downloadedImageOuter" "display" "block" + very outerImg is document dose getElementById with "downloadedImageOuter" outerImg dose replaceChild with imageCont outerImg plz hideLoadingScreen - }).fail(function (error) { + wow& + .plz fail with much error plz hideLoadingScreen plz alert "YOU HAZ ERRORS" - }); + wow& wow such postForm From eed03ec95dea2203ac46ca0ad19bb985f7085b56 Mon Sep 17 00:00:00 2001 From: Thomas Hickman Date: Sat, 28 Jan 2017 11:02:46 +0000 Subject: [PATCH 4/9] Debugged djs file --- index.djs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/index.djs b/index.djs index dac8e8b..bd8b221 100644 --- a/index.djs +++ b/index.djs @@ -1,6 +1,6 @@ such setStyle much elementID property value very element is plz dogeument.getElementById with elementID - plz element.style.setProperty with value + plz element.style.setProperty with property value wow such hideLoadingScreen @@ -20,15 +20,17 @@ very animations = [/* ]; such displayLoadingScreen - very animationToUse is animations[Math.floor(Math.random() * animations.length)]; + very animationToUse is animations[Math.floor(Math.random() * animations.length)] plz setStyle with "loadingElement" "display" "block" plz setStyle with "loadingTrollFaceScreen" "animationName" animationToUse wow -such getImages with query +such getImages much query plz displayLoadingScreen - very displayType is maybe ? 'cat' : 'doge' + very rnd is maybe shh Keep this comment + shh Keep this line as well + very displayType is rnd ? 'cat' : 'doge' very postOb is {} postOb.url is "https://api.memetrash.co.uk/" dose concat with displayType @@ -51,7 +53,9 @@ such getImages with query plz setStyle with "downloadedImageOuter" "display" "block" very outerImg is document dose getElementById with "downloadedImageOuter" - outerImg dose replaceChild with imageCont outerImg + very innerImg is document dose getElementById with "downloadedImageInner" + + outerImg dose replaceChild with imageCont innerImg plz hideLoadingScreen wow& .plz fail with much error @@ -64,7 +68,7 @@ such postForm very inputBox is document dose getElementById with "inputBox" rly inputBox.value not "" plz getImages with inputBox.value - but rly + but very promptStr is "Enter a value" plz alert with promptStr wow From b4b8736d4876a92b2911d2d6ec6fe3f65745a5fa Mon Sep 17 00:00:00 2001 From: Thomas Hickman Date: Sat, 28 Jan 2017 11:18:18 +0000 Subject: [PATCH 5/9] Added dogescript compile on load --- .gitignore | 1 + compile.js | 16 ++++++++++++++++ index.html | 3 ++- package.json | 15 +++++++++++++++ webpack.config.js | 9 +++++++++ 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 compile.js create mode 100644 package.json create mode 100644 webpack.config.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/compile.js b/compile.js new file mode 100644 index 0000000..e65efbd --- /dev/null +++ b/compile.js @@ -0,0 +1,16 @@ +var dogescript = require("dogescript"); + +var dsScripts = Array.from(document.querySelectorAll("script")).filter(function (x) { + return x.type === "text/dogescript"; +}); + +dsScripts.forEach(function (script) { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange = function () { + if (xhr.readyState == XMLHttpRequest.DONE) { + eval.call(window, dogescript(xhr.responseText, false, false)); + } + }; + xhr.open('GET', script.src, true); + xhr.send(); +}); diff --git a/index.html b/index.html index 09e4fa8..905dacf 100644 --- a/index.html +++ b/index.html @@ -49,6 +49,7 @@

- + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..4362381 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "meme-generator-web", + "version": "1.0.0", + "description": "", + "main": "compile.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "prepublish": "npm run-script build", + "build": "webpack -p" + }, + "private": true, + "dependencies": { + "dogescript": "^2.3.0" + } +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..f0af6b1 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,9 @@ +module.exports = { + entry: './compile.js', + output: { + filename: './compileDJS.js' + }, + resolve: { + extensions: ['', '.webpack.js', '.web.js', '.js', '.json'] + } +} From c2a680d0783b0a77b5100338d6fb4492b27f47a3 Mon Sep 17 00:00:00 2001 From: Thomas Hickman Date: Sat, 28 Jan 2017 11:18:40 +0000 Subject: [PATCH 6/9] Added webpack bundle to compile dogescript files --- compileDJS.js | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 compileDJS.js diff --git a/compileDJS.js b/compileDJS.js new file mode 100644 index 0000000..69bae29 --- /dev/null +++ b/compileDJS.js @@ -0,0 +1,2 @@ +!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var i=n(3),r=Array.from(document.querySelectorAll("script")).filter(function(t){return"text/dogescript"===t.type});r.forEach(function(t){var e=new XMLHttpRequest;e.onreadystatechange=function(){e.readyState==XMLHttpRequest.DONE&&eval.call(window,i(e.responseText,!1,!1))},e.open("GET",t.src,!0),e.send()})},function(t,e,n){var i;!function(){function r(t,e){function n(){return d=t.charAt(++T)}function i(){return t.charAt(T+1)}function r(e){for(var i=T;n();)if("\\"===d)n(),n();else{if(d===e)break;if("\n"===d)break}return t.substring(i,T+1)}function s(){for(var t=T;g.test(i());)T++;return T!==t}function a(){var t=T;do;while(g.test(n()));return T!==t+1}function _(){var e=T;for(n();n();)if("*"===d&&"/"===i()){T++;break}return t.substring(e,T+1)}function o(e){return t.substring(T-e.length,T).toLowerCase()===e}function h(){m++,v+=x}function l(){m--,v=v.slice(0,-c)}e=e||{};var c=e.indent_size||4,u=e.indent_char||" ",f=!0;void 0!=e.selector_separator_newline&&(f=e.selector_separator_newline);var p=e.end_with_newline||!1;"string"==typeof c&&(c=parseInt(c,10));var d,g=/^\s+$/,T=-1,v=t.match(/^[\r\n]*[\t ]*/)[0],x=Array(c+1).join(u),m=0,A={};A["{"]=function(t){A.singleSpace(),K.push(t),A.newLine()},A["}"]=function(t){A.newLine(),K.push(t),A.newLine()},A._lastCharWhitespace=function(){return g.test(K[K.length-1])},A.newLine=function(t){if(!t)for(;A._lastCharWhitespace();)K.pop();K.length&&K.push("\n"),v&&K.push(v)},A.singleSpace=function(){K.length&&!A._lastCharWhitespace()&&K.push(" ")};var K=[];v&&K.push(v);for(var E=!1;;){var w=a();if(!d)break;if("/"===d&&"*"===i()){A.newLine(),K.push(_(),"\n",v);var O=o("");O&&A.newLine()}else"{"===d?(s(),"}"==i()?(n(),K.push(" {}")):(h(),A["{"](d))):"}"===d?(l(),A["}"](d),E=!1):":"===d?(s(),K.push(d," "),E=!0):'"'===d||"'"===d?K.push(r(d)):";"===d?K.push(d,"\n",v):"("===d?o("url")?(K.push(d),s(),n()&&(")"!==d&&'"'!==d&&"'"!==d?K.push(r(")")):T--)):(w&&A.singleSpace(),K.push(d),s()):")"===d?K.push(d):","===d?(s(),K.push(d),!E&&f?A.newLine():A.singleSpace()):"]"===d?K.push(d):"["===d||"="===d?(s(),K.push(d)):(w&&A.singleSpace(),K.push(d))}var b=K.join("").replace(/[\n ]+$/,""),y=p,N=/\n$/.test(b);return y&&!N?b+="\n":!y&&N&&(b=b.slice(0,-1)),b}i=function(t,e,n){e.css_beautify=r}.call(e,n,e,t),!(void 0!==i&&(t.exports=i))}()},function(t,e,n){var i,r;!function(){function n(t,e){"use strict";var n=new s(t,e);return n.beautify()}function s(t,e){"use strict";function n(t,e){var n=0;t&&(n=t.indentation_level,n+=t.var_line&&t.var_line_reindented?1:0,!o()&&t.line_indent_level>n&&(n=t.line_indent_level));var i={mode:e,parent:t,last_text:t?t.last_text:"",last_word:t?t.last_word:"",var_line:!1,var_line_tainted:!1,var_line_reindented:!1,in_html_comment:!1,multiline_frame:!1,if_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,line_indent_level:t?t.line_indent_level:n,start_line_index:Q.length,had_comment:!1,ternary_depth:0};return i}function i(){return{text:[]}}function r(t){if(t=void 0!==t&&t,Q.length)for(s(Q[Q.length-1],t);t&&Q.length>1&&0===Q[Q.length-1].text.length;)Q.pop(),s(Q[Q.length-1],t)}function s(t){for(;t.text.length&&(" "===t.text[t.text.length-1]||t.text[t.text.length-1]===J||t.text[t.text.length-1]===vt);)t.text.pop()}function a(t){return t.replace(/^\s+|\s+$/g,"")}function _(t){t=t.replace(/\x0d/g,"");for(var e=[],n=t.indexOf("\n");n!==-1;)e.push(t.substring(0,n)),t=t.substring(n+1),n=t.indexOf("\n");return t.length&&e.push(t),e}function o(){var t=Q[Q.length-1];return 0===t.text.length}function h(){if(o()){if(1===Q.length)return!0;var t=Q[Q.length-2];return 0===t.text.length}return!1}function l(t){if(t=void 0!==t&&t,Tt.wrap_line_length&&!t){var e=Q[Q.length-1],n=0;e.text.length>0&&(n=e.text.join("").length+q.length+(ct?1:0),n>=Tt.wrap_line_length&&(t=!0))}(Tt.preserve_newlines&&ht||t)&&!o()&&(c(!1,!0),m(V.mode)||A(V.mode)||(lt=!0))}function c(t,e){if(lt=!1,ct=!1,!e&&";"!==V.last_text)for(;V.mode===gt.Statement&&!V.if_block&&!V.do_block;)K();1===Q.length&&o()||!t&&o()||(V.multiline_frame=!0,Q.push(i()))}function u(){if(o()){var t=Q[Q.length-1];if(Tt.keep_array_indentation&&m(V.mode)&&ht){t.text.push("");for(var e=0;e1){var e=Q[Q.length-1];V.line_indent_level=t;for(var n=0;n0&&(!V.parent||V.indentation_level>V.parent.indentation_level)&&(V.indentation_level-=1)}function v(t){if(!t.multiline_frame)for(var e,n=t.start_line_index,i=0;n0&&(tt=V,V=et.pop())}function E(){return V.mode===gt.ObjectLiteral&&":"===V.last_text&&0===V.ternary_depth}function w(){return("do"===V.last_text||"else"===V.last_text&&"if"!==q||"TK_END_EXPR"===H&&(tt.mode===gt.ForInitializer||tt.mode===gt.Conditional))&&(l(y(q,["do","for","if","while"])),x(gt.Statement),o()&&(g(),lt=!1),!0)}function O(t,e){for(var n=0;n=0&&a<32){i+="x"===e?"\\x"+s:"\\u"+s;continue}if(34===a||39===a||92===a)i+="\\"+String.fromCharCode(a);else{if("x"===e&&a>126&&a<=255)return t;i+=String.fromCharCode(a)}}else"\\"===e?n=!0:i+=e;return i}function k(t){for(var e=st,n=$.charAt(e);y(n,nt)&&n!==t;){if(e++,e>=ut)return!1;n=$.charAt(e)}return n===t}function S(){var t;if(ft=0,st>=ut)return["","TK_EOF"];ht=!1,pt=[];var e=$.charAt(st);for(st+=1;y(e,nt);){if("\n"===e?(ft+=1,pt=[]):ft&&(e===J?pt.push(J):"\r"!==e&&pt.push(" ")),st>=ut)return["","TK_EOF"];e=$.charAt(st),st+=1}if(y(e,it)){if(st=ut)););return st+=2,s&&0===ft?["/*"+r+"*/","TK_INLINE_COMMENT"]:["/*"+r+"*/","TK_BLOCK_COMMENT"]}if("/"===$.charAt(st)){for(r=e;"\r"!==$.charAt(st)&&"\n"!==$.charAt(st)&&(r+=$.charAt(st),st+=1,!(st>=ut)););return[r,"TK_COMMENT"]}}if("'"===e||'"'===e||("/"===e||Tt.e4x&&"<"===e&&$.slice(st-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])\s*([-a-zA-Z:0-9_.]+=('[^']*'|"[^"]*"|{[^{}]*})\s*)*\/?\s*>/))&&("TK_WORD"===H&&b(V.last_text)||"TK_END_EXPR"===H&&y(tt.mode,[gt.Conditional,gt.ForInitializer])||y(H,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var _=e,o=!1,h=!1;if(t=e,st=ut)return[t,"TK_STRING"]}else if(Tt.e4x&&"<"===_){var c=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])\s*([-a-zA-Z:0-9_.]+=('[^']*'|"[^"]*"|{[^{}]*})\s*)*(\/?)\s*>/g,u=$.slice(st-1),f=c.exec(u);if(f&&0===f.index){for(var p=f[2],d=0;f;){var g=!!f[1],T=f[2],v=!!f[f.length-1]||"![CDATA["===T.slice(0,8);if(T!==p||v||(g?--d:++d),d<=0)break;f=c.exec(u)}var x=f?f.index+f[0].length:u.length;return st+=x-1,[u.slice(0,x),"TK_STRING"]}}else for(;o||$.charAt(st)!==_;)if(t+=$.charAt(st),o?("x"!==$.charAt(st)&&"u"!==$.charAt(st)||(h=!0),o=!1):o="\\"===$.charAt(st),st+=1,st>=ut)return[t,"TK_STRING"];if(st+=1,t+=_,h&&Tt.unescape_strings&&(t=N(t)),"/"===_)for(;st"===$.substring(st-1,st+2))return V.in_html_comment=!1,st+=2,["-->","TK_COMMENT"];if("."===e)return[e,"TK_DOT"];if(y(e,rt)){for(;st=ut)););return","===e?[e,"TK_COMMA"]:"="===e?[e,"TK_EQUALS"]:[e,"TK_OPERATOR"]}return[e,"TK_UNKNOWN"]}function R(){w();var t=gt.Expression;if("["===q){if("TK_WORD"===H||")"===V.last_text)return y(V.last_text,at)&&(ct=!0),x(t),d(),g(),void(Tt.space_in_paren&&(ct=!0));t=gt.ArrayLiteral,m(V.mode)&&("["!==V.last_text&&(","!==V.last_text||"]"!==Z&&"}"!==Z)||Tt.keep_array_indentation||c())}else"for"===V.last_text?t=gt.ForInitializer:y(V.last_text,["if","while"])&&(t=gt.Conditional);";"===V.last_text||"TK_START_BLOCK"===H?c():"TK_END_EXPR"===H||"TK_START_EXPR"===H||"TK_END_BLOCK"===H||"."===V.last_text?(l(ht),lt=!1):"TK_WORD"!==H&&"TK_OPERATOR"!==H?ct=!0:"function"===V.last_word||"typeof"===V.last_word?Tt.jslint_happy&&(ct=!0):(y(V.last_text,at)||"catch"===V.last_text)&&Tt.space_before_conditional&&(ct=!0),"("===q&&("TK_EQUALS"!==H&&"TK_OPERATOR"!==H||E()||l()),x(t),d(),Tt.space_in_paren&&(ct=!0),g()}function C(){for(;V.mode===gt.Statement;)K();"]"===q&&m(V.mode)&&V.multiline_frame&&!Tt.keep_array_indentation&&c(),V.multiline_frame&&l(),Tt.space_in_paren&&("TK_START_EXPR"===H?(r(),ct=!1):ct=!0),"]"===q&&Tt.keep_array_indentation?(d(),K()):(K(),d()),v(tt),V.do_while&&tt.mode===gt.Conditional&&(tt.mode=gt.Expression,V.do_block=!1,V.do_while=!1)}function L(){x(gt.BlockStatement);var t=k("}"),e=t&&"function"===V.last_word&&"TK_END_EXPR"===H;"expand"===Tt.brace_style?"TK_OPERATOR"!==H&&(e||"TK_EQUALS"===H||b(V.last_text)&&"else"!==V.last_text)?ct=!0:c():"TK_OPERATOR"!==H&&"TK_START_EXPR"!==H?"TK_START_BLOCK"===H?c():ct=!0:m(tt.mode)&&","===V.last_text&&("}"===Z?ct=!0:c()),d(),g()}function I(){for(;V.mode===gt.Statement;)K();var t="TK_START_BLOCK"===H;"expand"===Tt.brace_style?t||c():t||(m(V.mode)&&Tt.keep_array_indentation?(Tt.keep_array_indentation=!1,c(),Tt.keep_array_indentation=!0):c()),K(),d()}function M(){if(w()||!ht||A(V.mode)||"TK_OPERATOR"===H&&"--"!==V.last_text&&"++"!==V.last_text||"TK_EQUALS"===H||!Tt.preserve_newlines&&"var"===V.last_text||c(),V.do_block&&!V.do_while){if("while"===q)return ct=!0,d(),ct=!0,void(V.do_while=!0);c(),V.do_block=!1}if(V.if_block&&"else"!==q){for(;V.mode===gt.Statement;)K();V.if_block=!1}if("case"===q||"default"===q&&V.in_case_statement)return c(),(V.case_body||Tt.jslint_happy)&&(T(),V.case_body=!1),d(),V.in_case=!0,void(V.in_case_statement=!0);if("function"===q&&(V.var_line&&"TK_EQUALS"!==H&&(V.var_line_reindented=!0),(y(V.last_text,["}",";"])||o()&&!y(V.last_text,["{",":","=",","]))&&(h()||V.had_comment||(c(),c(!0))),"TK_WORD"===H?"get"===V.last_text||"set"===V.last_text||"new"===V.last_text||"return"===V.last_text?ct=!0:c():"TK_OPERATOR"===H||"="===V.last_text?ct=!0:A(V.mode)||c()),"TK_COMMA"!==H&&"TK_START_EXPR"!==H&&"TK_EQUALS"!==H&&"TK_OPERATOR"!==H||E()||l(),"function"===q)return d(),void(V.last_word=q);if(ot="NONE","TK_END_BLOCK"===H?y(q,["else","catch","finally"])?"expand"===Tt.brace_style||"end-expand"===Tt.brace_style?ot="NEWLINE":(ot="SPACE",ct=!0):ot="NEWLINE":"TK_SEMICOLON"===H&&V.mode===gt.BlockStatement?ot="NEWLINE":"TK_SEMICOLON"===H&&A(V.mode)?ot="SPACE":"TK_STRING"===H?ot="NEWLINE":"TK_WORD"===H?ot="SPACE":"TK_START_BLOCK"===H?ot="NEWLINE":"TK_END_EXPR"===H&&(ct=!0,ot="NEWLINE"),y(q,at)&&")"!==V.last_text&&(ot="else"===V.last_text?"SPACE":"NEWLINE"),y(q,["else","catch","finally"]))if("TK_END_BLOCK"!==H||"expand"===Tt.brace_style||"end-expand"===Tt.brace_style)c();else{r(!0);var t=Q[Q.length-1];"}"!==t.text[t.text.length-1]&&c(),ct=!0}else"NEWLINE"===ot?b(V.last_text)?ct=!0:"TK_END_EXPR"!==H?"TK_START_EXPR"===H&&"var"===q||":"===V.last_text||("if"===q&&"else"===V.last_word&&"{"!==V.last_text?ct=!0:(V.var_line=!1,V.var_line_reindented=!1,c())):y(q,at)&&")"!==V.last_text&&(V.var_line=!1,V.var_line_reindented=!1,c()):m(V.mode)&&","===V.last_text&&"}"===Z?c():"SPACE"===ot&&(ct=!0);d(),V.last_word=q,"var"===q&&(V.var_line=!0,V.var_line_reindented=!1,V.var_line_tainted=!1),"do"===q&&(V.do_block=!0),"if"===q&&(V.if_block=!0)}function P(){for(w()&&(ct=!1);V.mode===gt.Statement&&!V.if_block&&!V.do_block;)K();d(),V.var_line=!1,V.var_line_reindented=!1,V.mode===gt.ObjectLiteral&&(V.mode=gt.BlockStatement)}function D(){w()?ct=!0:"TK_WORD"===H?ct=!0:"TK_COMMA"===H||"TK_START_EXPR"===H||"TK_EQUALS"===H||"TK_OPERATOR"===H?E()||l():c(),d()}function U(){V.var_line&&(V.var_line_tainted=!0),ct=!0,d(),ct=!0}function B(){return V.var_line?((A(V.mode)||"TK_END_BLOCK"===H)&&(V.var_line_tainted=!1),V.var_line&&(V.var_line_reindented=!0),d(),void(V.var_line_tainted?(V.var_line_tainted=!1,c()):ct=!0)):void("TK_END_BLOCK"===H&&V.mode!==gt.Expression?(d(),V.mode===gt.ObjectLiteral&&"}"===V.last_text?c():ct=!0):V.mode===gt.ObjectLiteral?(d(),c()):(d(),ct=!0))}function j(){var t=!0,e=!0;return b(V.last_text)?(ct=!0,void d()):"*"!==q||"TK_DOT"!==H||Z.match(/^\d+$/)?":"===q&&V.in_case?(V.case_body=!0,g(),d(),c(),void(V.in_case=!1)):"::"===q?void d():(!ht||"--"!==q&&"++"!==q||c(),y(q,["--","++","!"])||y(q,["-","+"])&&(y(H,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||y(V.last_text,at)||","===V.last_text)?(t=!1,e=!1,";"===V.last_text&&A(V.mode)&&(t=!0),"TK_WORD"===H&&y(V.last_text,at)&&(t=!0),V.mode!==gt.BlockStatement&&V.mode!==gt.Statement||"{"!==V.last_text&&";"!==V.last_text||c()):":"===q?0===V.ternary_depth?(V.mode===gt.BlockStatement&&(V.mode=gt.ObjectLiteral),t=!1):V.ternary_depth-=1:"?"===q&&(V.ternary_depth+=1),ct=ct||t,d(),void(ct=e)):void d()}function z(){var t,e=_(q),n=!1;for(c(!1,!0),e.length>1&&O(e.slice(1),"*")&&(n=!0),d(e[0]),t=1;t0;)J+=Tt.indent_char,Tt.indent_size-=1;for(;t&&(" "===t.charAt(0)||"\t"===t.charAt(0));)vt+=t.charAt(0),t=t.substring(1);$=t,ut=t.length,H="TK_START_BLOCK",Z="",Q=[i()],lt=!1,ct=!1,pt=[],et=[],x(gt.BlockStatement),st=0,this.beautify=function(){for(var t,e,n,i;;){if(t=S(),q=t[0],Y=t[1],"TK_EOF"===Y)break;if(n=Tt.keep_array_indentation&&m(V.mode),ht=ft>0,n)for(e=0;e0);else if(Tt.max_preserve_newlines&&ft>Tt.max_preserve_newlines&&(ft=Tt.max_preserve_newlines),Tt.preserve_newlines&&ft>1)for(c(),e=1;e ",smallerish:" <= ",biggerish:" >= ",notrly:" ! "},a="";if(null===e)return t+"\n";if(r.indexOf(e[0])===-1&&"is"!==e[1]&&"dose"!==e[1]||n&&"loud"!==e[0])return t+"\n";if("trained"===e[0]&&(a+='"use strict";\n'),"such"===e[0])if(a+="function "+e[1],"much"===e[2]){a+=" (";for(var _=3;_4){for(var h="",_=3;_2){for(var h="",_=2;_=this.input.length)return e.length?e.join(""):["","TK_EOF"];if(this.traverse_whitespace())e.length&&(n=!0);else{if(indent_handlebars){var i=this.input.substr(this.pos,3);if("{{#"===i||"{{/"===i)break;if("{{"===this.input.substr(this.pos,2)&&"{{else}}"===this.get_tag(!0))break}t=this.input.charAt(this.pos),this.pos++,n&&(this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,e),this.print_indentation(e)):(this.line_char_count++,e.push(" ")),n=!1),this.line_char_count++,e.push(t)}}return e.length?e.join(""):""},this.get_contents_to=function(t){if(this.pos===this.input.length)return["","TK_EOF"];var e="",n=new RegExp("","igm");n.lastIndex=this.pos;var i=n.exec(this.input),r=i?i.index:this.input.length;return this.pos=this.input.length)return t&&(this.pos=o,this.line_char_count=h),s.length?s.join(""):["","TK_EOF"];if(r=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(r,this.Utils.whitespace))_=!0;else{if("'"!==r&&'"'!==r||(r+=this.get_unformatted(r),_=!0),"="===r&&(_=!1),s.length&&"="!==s[s.length-1]&&">"!==r&&_&&(this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,s),this.print_indentation(s)):(s.push(" "),this.line_char_count++),_=!1),indent_handlebars&&"<"===i&&r+this.input.charAt(this.pos)==="{{"&&(r+=this.get_unformatted("}}"),s.length&&" "!==s[s.length-1]&&"<"!==s[s.length-1]&&(r=" "+r),_=!0),"<"!==r||i||(e=this.pos-1,i="<"),indent_handlebars&&!i&&s.length>=2&&"{"===s[s.length-1]&&"{"==s[s.length-2]&&(e="#"===r||"/"===r?this.pos-3:this.pos-2,i="{"),this.line_char_count++,s.push(r),s[1]&&"!"===s[1]){s=[this.get_comment(e)];break}if(indent_handlebars&&"{"===i&&s.length>2&&"}"===s[s.length-2]&&"}"===s[s.length-1])break}}while(">"!==r);var l,c,u=s.join("");l=u.indexOf(" ")!==-1?u.indexOf(" "):"{"===u[0]?u.indexOf("}"):u.indexOf(">"),c="<"!==u[0]&&indent_handlebars?"#"===u[2]?3:2:1;var p=u.substring(c,l).toLowerCase();return"/"===u.charAt(u.length-2)||this.Utils.in_array(p,this.Utils.single_token)?t||(this.tag_type="SINGLE"):indent_handlebars&&"{"===u[0]&&"else"===p?t||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):"script"===p?t||(this.record_tag(p),this.tag_type="SCRIPT"):"style"===p?t||(this.record_tag(p),this.tag_type="STYLE"):this.is_unformatted(p,f)?(a=this.get_unformatted("",u),s.push(a),e>0&&this.Utils.in_array(this.input.charAt(e-1),this.Utils.whitespace)&&s.splice(0,0,this.input.charAt(e-1)),n=this.pos-1,this.Utils.in_array(this.input.charAt(n+1),this.Utils.whitespace)&&s.push(this.input.charAt(n+1)),this.tag_type="SINGLE"):"!"===p.charAt(0)?t||(this.tag_type="SINGLE",this.traverse_whitespace()):t||("/"===p.charAt(0)?(this.retrieve_tag(p.substring(1)),this.tag_type="END",this.traverse_whitespace()):(this.record_tag(p),"html"!==p.toLowerCase()&&(this.indent_content=!0),this.tag_type="START",this.traverse_whitespace()),this.Utils.in_array(p,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&"\n"!==this.output[this.output.length-2]&&this.print_newline(!0,this.output))),t&&(this.pos=o,this.line_char_count=h),s.join("")},this.get_comment=function(t){var e="",n=">",i=!1;for(this.pos=t,input_char=this.input.charAt(this.pos),this.pos++;this.pos<=this.input.length&&(e+=input_char,e[e.length-1]!==n[n.length-1]||e.indexOf(n)===-1);)!i&&e.length<10&&(0===e.indexOf("",i=!0):0===e.indexOf("",i=!0):0===e.indexOf("",i=!0):0===e.indexOf("",i=!0)),input_char=this.input.charAt(this.pos),this.pos++;return e},this.get_unformatted=function(t,e){if(e&&e.toLowerCase().indexOf(t)!==-1)return"";var n="",i="",r=0,s=!0;do{if(this.pos>=this.input.length)return i;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!s){this.line_char_count--;continue}if("\n"===n||"\r"===n){i+="\n",this.line_char_count=0;continue}}i+=n,this.line_char_count++,s=!0,indent_handlebars&&"{"===n&&i.length&&"{"===i[i.length-2]&&(i+=this.get_unformatted("}}"),r=i.length)}while(i.toLowerCase().indexOf(t,r)===-1);return i},this.get_token=function(){var t;if("TK_TAG_SCRIPT"===this.last_token||"TK_TAG_STYLE"===this.last_token){var e=this.last_token.substr(7);return t=this.get_contents_to(e),"string"!=typeof t?t:[t,"TK_"+e]}if("CONTENT"===this.current_mode)return t=this.get_content(),"string"!=typeof t?t:[t,"TK_CONTENT"];if("TAG"===this.current_mode){if(t=this.get_tag(),"string"!=typeof t)return t;var n="TK_TAG_"+this.tag_type;return[t,n]}},this.get_full_indent=function(t){return t=this.indent_level+t||0,t<1?"":Array(t+1).join(this.indent_string)},this.is_unformatted=function(t,e){if(!this.Utils.in_array(t,e))return!1;if("a"!==t.toLowerCase()||!this.Utils.in_array("a",e))return!0;var n=this.get_tag(!0),i=(n||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);return!(i&&!this.Utils.in_array(i,e))},this.printer=function(t,e,n,i,r){this.input=t||"",this.output=[],this.indent_character=e,this.indent_string="",this.indent_size=n,this.brace_style=r,this.indent_level=0,this.wrap_line_length=i,this.line_char_count=0;for(var s=0;s1&&"\n"===t[t.length-1]?(this.output.push(t.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(t));for(var e=0;e0,this.output);this.newlines=0},this.indent=function(){this.indent_level++},this.unindent=function(){this.indent_level>0&&this.indent_level--}},this}var _,o,h,l,c,u,f,p,d;for(e=e||{},void 0!==e.wrap_line_length&&0!==parseInt(e.wrap_line_length,10)||void 0!==e.max_char&&0!==parseInt(e.max_char,10)||(e.wrap_line_length=e.max_char),o=e.indent_inner_html||!1,h=parseInt(e.indent_size||4,10),l=e.indent_char||" ",u=e.brace_style||"collapse",c=0===parseInt(e.wrap_line_length,10)?32786:parseInt(e.wrap_line_length||250,10),f=e.unformatted||["a","span","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","pre","address","dt","h1","h2","h3","h4","h5","h6"],p=e.preserve_newlines||!0,d=p?parseInt(e.max_preserve_newlines||32786,10):0,indent_handlebars=e.indent_handlebars||!1,_=new r,_.printer(t,l,h,c,u);;){var g=_.get_token();if(_.token_text=g[0],_.token_type=g[1],"TK_EOF"===_.token_type)break;switch(_.token_type){case"TK_TAG_START":_.print_newline(!1,_.output),_.print_token(_.token_text),_.indent_content&&(_.indent(),_.indent_content=!1),_.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":_.print_newline(!1,_.output),_.print_token(_.token_text),_.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===_.last_token&&""===_.last_text){var T=_.token_text.match(/\w+/)[0],v=null;_.output.length&&(v=_.output[_.output.length-1].match(/(?:<|{{#)\s*(\w+)/)), +null!==v&&v[1]===T||_.print_newline(!1,_.output)}_.print_token(_.token_text),_.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var x=_.token_text.match(/^\s*<([a-z]+)/i);x&&_.Utils.in_array(x[1],f)||_.print_newline(!1,_.output),_.print_token(_.token_text),_.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":_.print_token(_.token_text),_.indent_content&&(_.indent(),_.indent_content=!1),_.current_mode="CONTENT";break;case"TK_CONTENT":_.print_token(_.token_text),_.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==_.token_text){_.print_newline(!1,_.output);var m,A=_.token_text,K=1;"TK_SCRIPT"===_.token_type?m="function"==typeof n&&n:"TK_STYLE"===_.token_type&&(m="function"==typeof i&&i),"keep"===e.indent_scripts?K=0:"separate"===e.indent_scripts&&(K=-_.indent_level);var E=_.get_full_indent(K);if(m)A=m(A.replace(/^\s*/,E),e);else{var w=A.match(/^\s*/)[0],O=w.match(/[^\n\r]*$/)[0].split(_.indent_string).length-1,b=_.get_full_indent(K-O);A=A.replace(/^\s*/,E).replace(/\r\n|\r|\n/g,"\n"+b).replace(/\s+$/,"")}A&&(_.print_token_raw(E+s(A)),_.print_newline(!1,_.output))}_.current_mode="TAG"}_.last_token=_.token_type,_.last_text=_.token_text}return _.output.join("")}i=[n(2),n(1)],r=function(t,e){return{html_beautify:function(n,i){return _(n,i,t,e)}}}.apply(e,i),!(void 0!==r&&(t.exports=r))}()}]); \ No newline at end of file From 8530da61fe74a57cf9ceb88112170bd2b35932aa Mon Sep 17 00:00:00 2001 From: Thomas Hickman Date: Sat, 28 Jan 2017 11:31:11 +0000 Subject: [PATCH 7/9] Added powered by dogescript --- index.css | 13 +++++++++++++ index.html | 3 +++ 2 files changed, 16 insertions(+) diff --git a/index.css b/index.css index d2f2446..6b148d9 100644 --- a/index.css +++ b/index.css @@ -191,3 +191,16 @@ form{ } } +/* modified from https://gist.github.com/ratbeard/9076500 */ +.rainbow-text { + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-image: -webkit-gradient(linear, left top, right top, + color-stop(0.00, red), + color-stop(16%, orange), + color-stop(32%, yellow), + color-stop(48%, green), + color-stop(60%, blue), + color-stop(76%, indigo), + color-stop(1.00, violet)); + } diff --git a/index.html b/index.html index 905dacf..9b80b80 100644 --- a/index.html +++ b/index.html @@ -46,6 +46,9 @@

© Mike freeman
+

+ Powered by Dogescript +

From 9044cde6f513efb8693e52d7d8d9845d2ddad10d Mon Sep 17 00:00:00 2001 From: Thomas Hickman Date: Sun, 29 Jan 2017 13:54:43 +0000 Subject: [PATCH 8/9] Contructed animations using statements This is a much less hacky method of setting the value of animations than using a javascript initialiser list --- index.djs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/index.djs b/index.djs index bd8b221..18bcffc 100644 --- a/index.djs +++ b/index.djs @@ -10,14 +10,13 @@ wow plz $ with much wow& hideLoadingScreen() -very animations = [/* -*/ "spin", - "zoom", - "bg", - "invert", - "blur", - "rainbow" -]; +very animations is [] +animations dose push "spin" +animations dose push "zoom" +animations dose push "bg" +animations dose push "invert" +animations dose push "blur" +animations dose push "rainbow" such displayLoadingScreen very animationToUse is animations[Math.floor(Math.random() * animations.length)] From be12f674fba4dc50b222721990da765b924d8edd Mon Sep 17 00:00:00 2001 From: Thomas Hickman Date: Sun, 29 Jan 2017 13:50:21 +0000 Subject: [PATCH 9/9] Locked down the version of dogescript --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4362381..6d2ae2b 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,6 @@ }, "private": true, "dependencies": { - "dogescript": "^2.3.0" + "dogescript": "2.3.0" } }