├── misc ├── Press_Release.txt ├── .dockerignore ├── server-old.zip ├── docker-compose.yml ├── Dockerfile └── addRemotes ├── client ├── assets │ ├── n.png │ ├── n_s.png │ ├── gh_mk.png │ ├── gh_oc.jpg │ ├── subl.png │ ├── N_square.png │ ├── avatar.png │ ├── gh_eh.jpeg │ ├── gh_gy.jpeg │ ├── n_white.png │ ├── nfavicon.png │ ├── photo.jpeg │ ├── subl_bw.png │ ├── n_blue_lg.png │ ├── n_white_lg.png │ ├── n_square_big.png │ ├── octocat_white.png │ ├── material-icons-font.woff2 │ ├── material-icons.css │ └── codemirror-themes │ │ ├── eclipse.css │ │ ├── cobalt.css │ │ ├── rubyblue.css │ │ ├── yeti.css │ │ ├── zenburn.css │ │ ├── 3024-day.css │ │ ├── paraiso-light.css │ │ ├── twilight.css │ │ ├── material.css │ │ └── mdn-like.css ├── font │ ├── roboto │ │ ├── Roboto-Bold.eot │ │ ├── Roboto-Bold.ttf │ │ ├── Roboto-Bold.woff │ │ ├── Roboto-Bold.woff2 │ │ ├── Roboto-Light.eot │ │ ├── Roboto-Light.ttf │ │ ├── Roboto-Light.woff │ │ ├── Roboto-Medium.eot │ │ ├── Roboto-Medium.ttf │ │ ├── Roboto-Thin.eot │ │ ├── Roboto-Thin.ttf │ │ ├── Roboto-Thin.woff │ │ ├── Roboto-Thin.woff2 │ │ ├── Roboto-Light.woff2 │ │ ├── Roboto-Medium.woff │ │ ├── Roboto-Medium.woff2 │ │ ├── Roboto-Regular.eot │ │ ├── Roboto-Regular.ttf │ │ ├── Roboto-Regular.woff │ │ └── Roboto-Regular.woff2 │ └── material-design-icons │ │ ├── Material-Design-Icons.eot │ │ ├── Material-Design-Icons.ttf │ │ ├── Material-Design-Icons.woff │ │ └── Material-Design-Icons.woff2 ├── nevercode-sublime-setup.zip ├── js │ └── tinymce │ │ ├── plugins │ │ ├── media │ │ │ └── moxieplayer.swf │ │ ├── emoticons │ │ │ ├── img │ │ │ │ ├── smiley-cool.gif │ │ │ │ ├── smiley-cry.gif │ │ │ │ ├── smiley-frown.gif │ │ │ │ ├── smiley-kiss.gif │ │ │ │ ├── smiley-smile.gif │ │ │ │ ├── smiley-wink.gif │ │ │ │ ├── smiley-yell.gif │ │ │ │ ├── smiley-sealed.gif │ │ │ │ ├── smiley-embarassed.gif │ │ │ │ ├── smiley-innocent.gif │ │ │ │ ├── smiley-laughing.gif │ │ │ │ ├── smiley-surprised.gif │ │ │ │ ├── smiley-tongue-out.gif │ │ │ │ ├── smiley-undecided.gif │ │ │ │ ├── smiley-money-mouth.gif │ │ │ │ └── smiley-foot-in-mouth.gif │ │ │ └── plugin.min.js │ │ ├── print │ │ │ └── plugin.min.js │ │ ├── hr │ │ │ └── plugin.min.js │ │ ├── nonbreaking │ │ │ └── plugin.min.js │ │ ├── code │ │ │ └── plugin.min.js │ │ ├── directionality │ │ │ └── plugin.min.js │ │ ├── contextmenu │ │ │ └── plugin.min.js │ │ ├── wordcount │ │ │ └── plugin.min.js │ │ ├── noneditable │ │ │ └── plugin.min.js │ │ ├── save │ │ │ └── plugin.min.js │ │ ├── visualblocks │ │ │ ├── plugin.min.js │ │ │ └── css │ │ │ │ └── visualblocks.css │ │ ├── colorpicker │ │ │ └── plugin.min.js │ │ ├── pagebreak │ │ │ └── plugin.min.js │ │ ├── visualchars │ │ │ └── plugin.min.js │ │ ├── tabfocus │ │ │ └── plugin.min.js │ │ ├── preview │ │ │ └── plugin.min.js │ │ ├── autoresize │ │ │ └── plugin.min.js │ │ ├── autolink │ │ │ └── plugin.min.js │ │ ├── insertdatetime │ │ │ └── plugin.min.js │ │ ├── autosave │ │ │ └── plugin.min.js │ │ ├── importcss │ │ │ └── plugin.min.js │ │ ├── textpattern │ │ │ └── plugin.min.js │ │ ├── layer │ │ │ └── plugin.min.js │ │ ├── codesample │ │ │ └── css │ │ │ │ └── prism.css │ │ ├── bbcode │ │ │ └── plugin.min.js │ │ ├── legacyoutput │ │ │ └── plugin.min.js │ │ ├── textcolor │ │ │ └── plugin.min.js │ │ ├── template │ │ │ └── plugin.min.js │ │ └── link │ │ │ └── plugin.min.js │ │ └── skins │ │ └── lightgray │ │ ├── img │ │ ├── anchor.gif │ │ ├── loader.gif │ │ ├── object.gif │ │ └── trans.gif │ │ ├── fonts │ │ ├── tinymce.eot │ │ ├── tinymce.ttf │ │ ├── tinymce.woff │ │ ├── tinymce-small.eot │ │ ├── tinymce-small.ttf │ │ └── tinymce-small.woff │ │ ├── content.inline.min.css │ │ └── content.min.css ├── app │ ├── services │ │ ├── index.js │ │ ├── Public.js │ │ ├── UrlEncoding.js │ │ ├── Auth.js │ │ ├── Folders.js │ │ └── Snippets.js │ ├── modals │ │ ├── index.js │ │ ├── foldermodal │ │ │ ├── foldermodal.html │ │ │ └── foldermodal.js │ │ ├── editormodal │ │ │ ├── editormodal.js │ │ │ └── editorModal.html │ │ ├── movemodal │ │ │ ├── moveModal.html │ │ │ └── moveModal.js │ │ └── authmodals │ │ │ ├── authmodal.js │ │ │ ├── signin.html │ │ │ └── signup.html │ ├── controllers │ │ ├── main │ │ │ ├── about │ │ │ │ ├── about.js │ │ │ │ └── about.html │ │ │ ├── editor │ │ │ │ ├── snippets │ │ │ │ │ ├── favorites.html │ │ │ │ │ └── snippets.js │ │ │ │ ├── search │ │ │ │ │ ├── search.js │ │ │ │ │ └── search.html │ │ │ │ └── profile │ │ │ │ │ ├── profile.js │ │ │ │ │ └── profile.html │ │ │ ├── download │ │ │ │ ├── download.js │ │ │ │ └── download.html │ │ │ ├── public │ │ │ │ ├── public.js │ │ │ │ └── public.html │ │ │ └── main.js │ │ └── index.js │ ├── redux │ │ ├── actions.js │ │ ├── reducers.js │ │ └── fileTree.js │ └── app.js ├── index.html └── styles │ └── materialize.scss ├── user-server ├── noncluster.js ├── server.js ├── config │ ├── middleware.js │ ├── routes.js │ └── utils.js ├── cluster.js └── models │ └── users.js ├── files-server ├── noncluster.js ├── server.js ├── config │ ├── middleware.js │ ├── utils.js │ └── routes.js ├── cluster.js └── models │ └── snippets.js ├── .jshintignore ├── README.md ├── .jshintrc ├── .gitignore ├── setup.example.js ├── webpack.config.js ├── test └── TestingOutline.txt ├── nginx-server └── nevercode.com ├── Gruntfile.js └── package.json /misc/Press_Release.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /misc/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | .editorconfig 4 | node_modules 5 | *.log 6 | -------------------------------------------------------------------------------- /client/assets/n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/n.png -------------------------------------------------------------------------------- /client/assets/n_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/n_s.png -------------------------------------------------------------------------------- /misc/server-old.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/misc/server-old.zip -------------------------------------------------------------------------------- /client/assets/gh_mk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/gh_mk.png -------------------------------------------------------------------------------- /client/assets/gh_oc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/gh_oc.jpg -------------------------------------------------------------------------------- /client/assets/subl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/subl.png -------------------------------------------------------------------------------- /user-server/noncluster.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | let startServer = require('./server.js'); 3 | 4 | startServer(); 5 | -------------------------------------------------------------------------------- /client/assets/N_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/N_square.png -------------------------------------------------------------------------------- /client/assets/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/avatar.png -------------------------------------------------------------------------------- /client/assets/gh_eh.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/gh_eh.jpeg -------------------------------------------------------------------------------- /client/assets/gh_gy.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/gh_gy.jpeg -------------------------------------------------------------------------------- /client/assets/n_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/n_white.png -------------------------------------------------------------------------------- /client/assets/nfavicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/nfavicon.png -------------------------------------------------------------------------------- /client/assets/photo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/photo.jpeg -------------------------------------------------------------------------------- /client/assets/subl_bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/subl_bw.png -------------------------------------------------------------------------------- /files-server/noncluster.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | let startServer = require('./server.js'); 3 | 4 | startServer(); 5 | -------------------------------------------------------------------------------- /client/assets/n_blue_lg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/n_blue_lg.png -------------------------------------------------------------------------------- /client/assets/n_white_lg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/n_white_lg.png -------------------------------------------------------------------------------- /client/assets/n_square_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/n_square_big.png -------------------------------------------------------------------------------- /client/assets/octocat_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/octocat_white.png -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Bold.eot -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Bold.ttf -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Bold.woff -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Bold.woff2 -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Light.eot -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Light.ttf -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Light.woff -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Medium.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Medium.eot -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Medium.ttf -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Thin.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Thin.eot -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Thin.ttf -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Thin.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Thin.woff -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Thin.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Thin.woff2 -------------------------------------------------------------------------------- /client/nevercode-sublime-setup.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/nevercode-sublime-setup.zip -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Light.woff2 -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Medium.woff -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Medium.woff2 -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Regular.eot -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Regular.ttf -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Regular.woff -------------------------------------------------------------------------------- /client/assets/material-icons-font.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/assets/material-icons-font.woff2 -------------------------------------------------------------------------------- /client/font/roboto/Roboto-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/roboto/Roboto-Regular.woff2 -------------------------------------------------------------------------------- /client/js/tinymce/plugins/media/moxieplayer.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/media/moxieplayer.swf -------------------------------------------------------------------------------- /client/js/tinymce/skins/lightgray/img/anchor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/skins/lightgray/img/anchor.gif -------------------------------------------------------------------------------- /client/js/tinymce/skins/lightgray/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/skins/lightgray/img/loader.gif -------------------------------------------------------------------------------- /client/js/tinymce/skins/lightgray/img/object.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/skins/lightgray/img/object.gif -------------------------------------------------------------------------------- /client/js/tinymce/skins/lightgray/img/trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/skins/lightgray/img/trans.gif -------------------------------------------------------------------------------- /client/js/tinymce/skins/lightgray/fonts/tinymce.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/skins/lightgray/fonts/tinymce.eot -------------------------------------------------------------------------------- /client/js/tinymce/skins/lightgray/fonts/tinymce.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/skins/lightgray/fonts/tinymce.ttf -------------------------------------------------------------------------------- /client/js/tinymce/skins/lightgray/fonts/tinymce.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/skins/lightgray/fonts/tinymce.woff -------------------------------------------------------------------------------- /.jshintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | client/js 3 | /client/assets 4 | /client/dist 5 | /client/font 6 | test/ 7 | setup.example.js 8 | setup.js 9 | /client/app/tinymce 10 | -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-cool.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-cool.gif -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-cry.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-cry.gif -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-frown.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-frown.gif -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-kiss.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-kiss.gif -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-smile.gif -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-wink.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-wink.gif -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-yell.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-yell.gif -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-sealed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-sealed.gif -------------------------------------------------------------------------------- /client/js/tinymce/skins/lightgray/fonts/tinymce-small.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/skins/lightgray/fonts/tinymce-small.eot -------------------------------------------------------------------------------- /client/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf -------------------------------------------------------------------------------- /client/js/tinymce/skins/lightgray/fonts/tinymce-small.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/skins/lightgray/fonts/tinymce-small.woff -------------------------------------------------------------------------------- /client/font/material-design-icons/Material-Design-Icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/material-design-icons/Material-Design-Icons.eot -------------------------------------------------------------------------------- /client/font/material-design-icons/Material-Design-Icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/material-design-icons/Material-Design-Icons.ttf -------------------------------------------------------------------------------- /client/font/material-design-icons/Material-Design-Icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/material-design-icons/Material-Design-Icons.woff -------------------------------------------------------------------------------- /client/font/material-design-icons/Material-Design-Icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/font/material-design-icons/Material-Design-Icons.woff2 -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-embarassed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-embarassed.gif -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-innocent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-innocent.gif -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-laughing.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-laughing.gif -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-surprised.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-surprised.gif -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-tongue-out.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-tongue-out.gif -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-undecided.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-undecided.gif -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-money-mouth.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-money-mouth.gif -------------------------------------------------------------------------------- /client/js/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/precocious-tangerine/nevercode/HEAD/client/js/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [](https://waffle.io/precocious-tangerine/evercode) 2 | #nevercode 3 | Helping engineers build their personal code library. 4 | -------------------------------------------------------------------------------- /client/app/services/index.js: -------------------------------------------------------------------------------- 1 | import Snippets from './Snippets.js'; 2 | import Public from './Public.js'; 3 | import Folders from './Folders.js'; 4 | import Auth from './Auth.js'; 5 | import UrlEncoding from './UrlEncoding.js'; 6 | 7 | 8 | export {Snippets, Public, Folders, Auth, UrlEncoding}; -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | 4 | "curly": true, 5 | "latedef": true, 6 | "quotmark": true, 7 | "unused": true, 8 | "trailing": true, 9 | "esversion": 6, 10 | "browser": true, 11 | "undef": true, 12 | "predef": ["angular", "-Promise", "Materialize", "$"], 13 | "-W138": false 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /client/js/tinymce/plugins/print/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("print",function(a){a.addCommand("mcePrint",function(){a.getWin().print()}),a.addButton("print",{title:"Print",cmd:"mcePrint"}),a.addShortcut("Meta+P","","mcePrint"),a.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Meta+P",context:"file"})}); -------------------------------------------------------------------------------- /misc/docker-compose.yml: -------------------------------------------------------------------------------- 1 | evercode: 2 | image: orlandoc1618/pt-evercode:v3 3 | links: 4 | - redis 5 | - mongodb 6 | ports: 7 | - "3000:3000" 8 | 9 | mongodb: 10 | image: mongo 11 | ports: 12 | - "27017" 13 | 14 | redis: 15 | image: redis 16 | ports: 17 | - "6379" 18 | command: redis-server -------------------------------------------------------------------------------- /client/app/modals/index.js: -------------------------------------------------------------------------------- 1 | import createEditorModal from './editormodal/editormodal.js'; 2 | import createFolderModal from './foldermodal/foldermodal.js'; 3 | import createAuthModal from './authmodals/authmodal.js'; 4 | import createMoveModal from './movemodal/moveModal.js'; 5 | 6 | export {createAuthModal, createFolderModal, createEditorModal, createMoveModal}; -------------------------------------------------------------------------------- /client/js/tinymce/plugins/hr/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("hr",function(a){a.addCommand("InsertHorizontalRule",function(){a.execCommand("mceInsertContent",!1,"
23 | {{snippet.description}} 24 |
25 |"+e+"
"):a.insertContent(e)}),a.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),a.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),a.on("ResolveName",function(c){"IMG"==c.target.nodeName&&a.dom.hasClass(c.target,b)&&(c.name="pagebreak")}),a.on("click",function(c){c=c.target,"IMG"===c.nodeName&&a.dom.hasClass(c,b)&&a.selection.select(c)}),a.on("BeforeSetContent",function(a){a.content=a.content.replace(d,e)}),a.on("PreInit",function(){a.serializer.addNodeFilter("img",function(b){for(var d,e,f=b.length;f--;)if(d=b[f],e=d.attr("class"),e&&-1!==e.indexOf("mce-pagebreak")){var g=d.parent;if(a.schema.getBlockElements()[g.name]&&a.settings.pagebreak_split_block){g.type=3,g.value=c,g.raw=!0,d.remove();continue}d.type=3,d.value=c,d.raw=!0}})})}); -------------------------------------------------------------------------------- /client/app/controllers/main/download/download.js: -------------------------------------------------------------------------------- 1 | import * as Actions from '../../../redux/actions.js'; 2 | 3 | class DownloadCtrl { 4 | constructor($ngRedux, $http) { 5 | this.$http = $http; 6 | this.activeUser = {}; 7 | $ngRedux.connect(this.mapStateToThis, this.mapDispatchToThis)(this); 8 | } 9 | 10 | confirmCopyAction() { 11 | Materialize.toast('Client secret added to your clipboard!', 3000, 'rounded'); 12 | } 13 | 14 | mapDispatchToThis(dispatch) { 15 | return { 16 | generateNewSecret() { 17 | this.$http.get('/user/api/sublime-secret') 18 | .then(res => { 19 | let sublimeSecret = res.data; 20 | let newUser = Object.assign({}, this.activeUser, {sublimeSecret}); 21 | dispatch(Actions.setActiveUser(newUser)); 22 | }) 23 | .catch(console.log); 24 | } 25 | }; 26 | } 27 | mapStateToThis(state) { 28 | return { 29 | activeUser: state.activeUser ? state.activeUser: {} 30 | }; 31 | } 32 | } 33 | 34 | const downloadPage = () => { 35 | return { 36 | url: '/download', 37 | controllerAs: 'downloadCtrl', 38 | controller: DownloadCtrl, 39 | template: require('./download.html'), 40 | scope: {}, 41 | access: {restricted: true} 42 | }; 43 | }; 44 | 45 | export default downloadPage; 46 | 47 | -------------------------------------------------------------------------------- /client/app/modals/movemodal/moveModal.js: -------------------------------------------------------------------------------- 1 | class MoveSnippetModalCtrl { 2 | constructor(Snippets) { 3 | this.Snippets = Snippets; 4 | } 5 | 6 | moveSnippet(newPath){ 7 | let oldPath = this.selectedsnippet.value.filePath; 8 | let snippetToMove = Object.assign({}, 9 | this.selectedsnippet.value, { 10 | filePath: newPath + '/' + this.selectedsnippet.value.name 11 | }); 12 | this.Snippets.updateSnippet(snippetToMove, oldPath); 13 | this.hideModal(); 14 | } 15 | 16 | hideModal() { 17 | this.show = false; 18 | } 19 | 20 | } 21 | 22 | let createMoveModal = () => { 23 | return { 24 | restrict: 'E', 25 | scope: { 26 | show: '=', 27 | selectedsnippet: '=', 28 | name: '=', 29 | paths: '=' 30 | }, 31 | link(scope, element, attrs) { 32 | scope.dialogStyle = {}; 33 | if(attrs.width) { 34 | scope.dialogStyle.width = attrs.width; 35 | } 36 | if(attrs.height) { 37 | scope.dialogStyle.height = attrs.height; 38 | } 39 | }, 40 | controllerAs: 'moveSnippetModalCtrl', 41 | controller: MoveSnippetModalCtrl, 42 | bindToController: true, 43 | template: require(`./moveModal.html`) 44 | }; 45 | }; 46 | 47 | export default createMoveModal; -------------------------------------------------------------------------------- /client/js/tinymce/plugins/visualchars/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("visualchars",function(a){function b(b){function c(a){return''+a+""}function f(){var a,b="";for(a in n)b+=a;return new RegExp("["+b+"]","g")}function g(){var a,b="";for(a in n)b&&(b+=","),b+="span.mce-"+n[a];return b}var h,i,j,k,l,m,n,o,p=a.getBody(),q=a.selection;if(n={"\xa0":"nbsp","\xad":"shy"},d=!d,e.state=d,a.fire("VisualChars",{state:d}),o=f(),b&&(m=q.getBookmark()),d)for(i=[],tinymce.walk(p,function(a){3==a.nodeType&&a.nodeValue&&o.test(a.nodeValue)&&i.push(a)},"childNodes"),j=0;j
11 |
12 |
14 |
15 | GERRIT YNTENMA
16 |
17 |
19 |
20 | EDISON D. HUFF
21 |
22 |
24 |
25 | ORLANDO CASTILLO
26 |
27 |
29 |
30 | MAKSYM KROSHKA
31 |
32 | 
8 | created by: {{snippetNode.value.username}}
35 | language: {{snippetNode.value.language}}
36 |
{{snippetNode.value.description}}
39 |41 | {{ tag }} 42 |
43 |]*>/gi,"[quote]"),b(/<\/blockquote>/gi,"[/quote]"),b(/
/gi,"\n"),b(/
/gi,"\n"),b(/
/gi,"\n"),b(//gi,""),b(/<\/p>/gi,"\n"),b(/ |\u00a0/gi," "),b(/"/gi,'"'),b(/</gi,"<"),b(/>/gi,">"),b(/&/gi,"&"),a},_punbb_bbcode2html:function(a){function b(b,c){a=a.replace(b,c)}return a=tinymce.trim(a),b(/\n/gi,"
"),b(/\[b\]/gi,""),b(/\[\/b\]/gi,""),b(/\[i\]/gi,""),b(/\[\/i\]/gi,""),b(/\[u\]/gi,""),b(/\[\/u\]/gi,""),b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2'),b(/\[url\](.*?)\[\/url\]/gi,'$1'),b(/\[img\](.*?)\[\/img\]/gi,''),b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2'),b(/\[code\](.*?)\[\/code\]/gi,'$1 '),b(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),a}}),tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)}(); -------------------------------------------------------------------------------- /client/js/tinymce/plugins/legacyoutput/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.on("AddEditor",function(a){a.editor.settings.inline_styles=!1}),a.PluginManager.add("legacyoutput",function(b,c,d){b.on("init",function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",d=a.explode(b.settings.font_size_style_values),e=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignjustify:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(b){return a.inArray(d,b.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),a.each("b,i,u,strike".split(","),function(a){e.addValidElements(a+"[*]")}),e.getElementRule("font")||e.addValidElements("font[face|size|color|style]"),a.each(c.split(","),function(a){var b=e.getElementRule(a);b&&(b.attributes.align||(b.attributes.align={},b.attributesOrder.push("align")))})}),b.addButton("fontsizeselect",function(){var a=[],c="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",d=b.settings.fontsize_formats||c;return b.$.each(d.split(" "),function(b,c){var d=c,e=c,f=c.split("=");f.length>1&&(d=f[0],e=f[1]),a.push({text:d,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:a,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),c?a.value(c.size):a.value("")})},onclick:function(a){a.control.settings.value&&b.execCommand("FontSize",!1,a.control.settings.value)}}}),b.addButton("fontselect",function(){function a(a){a=a.replace(/;$/,"").split(";");for(var b=a.length;b--;)a[b]=a[b].split("=");return a}var c="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",e=[],f=a(b.settings.font_formats||c);return d.each(f,function(a,b){e.push({text:{raw:b[0]},value:b[1],textStyle:-1==b[1].indexOf("dings")?"font-family:"+b[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:e,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),c?a.value(c.face):a.value("")})},onselect:function(a){a.control.settings.value&&b.execCommand("FontName",!1,a.control.settings.value)}}})})}(tinymce); -------------------------------------------------------------------------------- /client/app/app.js: -------------------------------------------------------------------------------- 1 | import angular from 'angular'; 2 | import createLogger from 'redux-logger'; 3 | import {finalReducer} from './redux/reducers.js'; 4 | import {Folders, Auth, Snippets, Public, UrlEncoding} from './services/index.js'; 5 | import {createFolderModal, createEditorModal, createMoveModal, createAuthModal} from './modals/index.js'; 6 | import {mainPage, publicPage, editor, snippets, profile, downloadPage, aboutPage, search} from './controllers/index.js'; 7 | import setup from '../../setup.js'; 8 | import 'angular-ui-router'; 9 | import 'satellizer'; 10 | import 'ng-redux'; 11 | import 'angular-ui-codemirror'; 12 | import 'ngclipboard'; 13 | import 'angular-animate'; 14 | import './tinymce/tinymce.js'; 15 | import 'ng-focus-on'; 16 | 17 | angular.module('evercode', ['ngRedux', 'ui.router', 'satellizer','ui.codemirror', 'ngclipboard', 'ngAnimate', 'ui.tinymce', 'focusOn']) 18 | .config(($stateProvider, $urlRouterProvider, $httpProvider, $ngReduxProvider, $authProvider) => { 19 | 20 | $authProvider.oauth2({ 21 | name: 'github', 22 | url: '/user/auth/github', 23 | clientId: setup.githubClientId, 24 | redirectUri: window.location.origin, 25 | authorizationEndpoint: 'https://github.com/login/oauth/authorize' 26 | }); 27 | 28 | $urlRouterProvider.otherwise('/main/public'); 29 | $stateProvider 30 | .state('main', mainPage()) 31 | .state('main.public', publicPage()) 32 | .state('main.editor', editor()) 33 | .state('main.editor.snippets', snippets('/snippets')) 34 | .state('main.editor.favorites', snippets('/favorites')) 35 | .state('main.editor.profile', profile()) 36 | .state('main.editor.search', search()) 37 | .state('main.download', downloadPage()) 38 | .state('main.about', aboutPage()); 39 | 40 | $httpProvider.interceptors.push('AttachTokens'); 41 | $ngReduxProvider.createStoreWith(finalReducer, [createLogger()]); 42 | }) 43 | .service('Auth', Auth) 44 | .service('Folders', Folders) 45 | .service('Snippets', Snippets) 46 | .service('Public', Public) 47 | .service('UrlEncoding', UrlEncoding) 48 | .directive('signin', createAuthModal('/signin')) 49 | .directive('signup', createAuthModal('/signup')) 50 | .directive('editor', createEditorModal) 51 | .directive('folder', createFolderModal) 52 | .directive('move', createMoveModal) 53 | .factory('AttachTokens', ($window) => { 54 | var attach = { 55 | request: (object) => { 56 | var jwt = $window.localStorage.getItem('satellizer_token'); 57 | if (jwt) { 58 | object.headers.Authorization = jwt; 59 | } 60 | object.headers['Allow-Control-Allow-Origin'] = '*'; 61 | return object; 62 | } 63 | }; 64 | return attach; 65 | }) 66 | .run(($rootScope, $state, $auth, $location) => { 67 | $rootScope.$on('$stateChangeStart', (event, next, toParams, fromState) => { 68 | if (($location.absUrl().indexOf('?') === -1) && !$auth.isAuthenticated() && (next.access.restricted || next.name === 'main.editor')) { 69 | if (!fromState.name) { 70 | $state.go('main.public'); 71 | } 72 | event.preventDefault(); 73 | Materialize.toast('Please sign in first', 2000, 'rounded'); 74 | } 75 | }); 76 | $rootScope.$on('$stateChangeSuccess', () => { 77 | $('.material-tooltip').css('display', 'none'); 78 | if ($state.is('main')) { 79 | $state.go('.public'); 80 | } 81 | }); 82 | }); 83 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "evercode", 3 | "version": "0.0.1", 4 | "description": "A place to store and easily retrieve pieces of code.", 5 | "dependencies": { 6 | "angular": "^1.5.0", 7 | "angular-animate": "^1.5.2", 8 | "angular-route": "^1.5.0", 9 | "angular-ui-codemirror": "^0.3.0", 10 | "angular-ui-router": "^0.2.18", 11 | "babel": "^6.5.2", 12 | "babel-preset-es2015": "^6.6.0", 13 | "bcrypt": "^0.8.5", 14 | "bluebird": "^3.3.4", 15 | "body-parser": "^1.15.0", 16 | "cluster": "^0.7.7", 17 | "codemirror": "^5.12.0", 18 | "email-verification": "^0.3.1", 19 | "express": "^4.4.5", 20 | "google-auth-library": "^0.9.7", 21 | "googleapis": "^3.1.0", 22 | "grunt": "^0.4.5", 23 | "html-webpack-plugin": "^2.10.0", 24 | "jshint": "^2.9.1", 25 | "jsonwebtoken": "^5.7.0", 26 | "materialize-css": "0.97.5", 27 | "mocks": "0.0.15", 28 | "mongoose": "^4.4.6", 29 | "morgan": "^1.7.0", 30 | "ng-focus-on": "^0.2.2", 31 | "ng-redux": "^3.3.3", 32 | "ngclipboard": "^1.1.1", 33 | "passport": "^0.3.2", 34 | "passport-github": "^1.1.0", 35 | "path": "^0.12.7", 36 | "precommit-hook": "^3.0.0", 37 | "querystring": "^0.2.0", 38 | "ramda": "^0.19.1", 39 | "raw-loader": "^0.5.1", 40 | "readline": "^1.3.0", 41 | "redis": "^2.5.0-1", 42 | "redux": "^3.3.1", 43 | "redux-logger": "^2.6.1", 44 | "request": "^2.69.0", 45 | "satellizer": "^0.14.0", 46 | "source-map-loader": "^0.1.5", 47 | "supertest": "^1.2.0", 48 | "webpack": "^1.12.14", 49 | "webpack-dev-server": "^1.14.1" 50 | }, 51 | "devDependencies": { 52 | "babel-core": "^6.7.2", 53 | "babel-loader": "^6.2.4", 54 | "babel-polyfill": "^6.5.0", 55 | "chai": "^3.4.1", 56 | "eslint": "^2.1.0", 57 | "eslint-config-hackreactor": "git://github.com/hackreactor-labs/eslint-config-hackreactor", 58 | "grunt-contrib-concat": "^1.0.0", 59 | "grunt-contrib-cssmin": "^1.0.1", 60 | "grunt-contrib-uglify": "^1.0.1", 61 | "grunt-ng-annotate": "^2.0.1", 62 | "gulp": "^3.9.1", 63 | "gulp-nodemon": "^1.0.4", 64 | "gulp-shell": "^0.2.7", 65 | "load-grunt-tasks": "^3.4.1", 66 | "mocha": "^2.3.4", 67 | "webpack-dev-server": "^1.14.1" 68 | }, 69 | "scripts": { 70 | "nginx": "sudo nginx", 71 | "user-server": "nodemon --harmony-destructuring user-server/noncluster.js", 72 | "files-server": "nodemon --harmony-destructuring files-server/noncluster.js", 73 | "start-servers": "npm run user-server & npm run files-server", 74 | "css": "node-sass client/styles/materialize.scss client/styles/materialize.css", 75 | "test": "mocha test --harmony-destructuring", 76 | "start": "node --harmony-destructuring server/noncluster.js", 77 | "cluster": "node --harmony-destructuring server/cluster.js", 78 | "dev": "webpack-dev-server --devtool source-map --progress --colors --hot --content-base client", 79 | "lint": "jshint .", 80 | "validate": "npm ls" 81 | }, 82 | "repository": { 83 | "type": "git", 84 | "url": "https://github.com/precocious-tangerine/nevercode.git" 85 | }, 86 | "author": "Edison D. Huff, Gerrit Yntema, Max Kroshka, Orlando Castillo", 87 | "license": "UNLICENSED", 88 | "bugs": { 89 | "url": "https://github.com/precocious-tangerine/nevercode.git/issues" 90 | }, 91 | "homepage": "https://github.com/precocious-tangerine/nevercode.git#readme", 92 | "pre-commit": [ 93 | "lint", 94 | "test" 95 | ] 96 | } 97 | -------------------------------------------------------------------------------- /client/app/modals/editormodal/editorModal.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |69 | 70 | -------------------------------------------------------------------------------- /client/app/services/Auth.js: -------------------------------------------------------------------------------- 1 | import * as Actions from '../redux/actions.js'; 2 | 3 | export default class Auth { 4 | constructor($http, $auth, $ngRedux, Folders) { 5 | $ngRedux.connect(this.mapStateToThis, this.mapDispatchToThis)(this); 6 | this.$http = $http; 7 | this.Folders = Folders; 8 | this.$auth = $auth; 9 | } 10 | mapDispatchToThis(dispatch) { 11 | return { 12 | signin(user) { 13 | return this.$http({ 14 | method: 'POST', 15 | url: 'user/signin', 16 | data: user 17 | }).then((res) => { 18 | this.$auth.setToken(res.data.token); 19 | this.getUserInfo(); 20 | $('#snippets-modal').closeModal({ 21 | dismissible: true, 22 | complete: () => { 23 | $('.lean-overlay').remove(); 24 | } 25 | }); 26 | Materialize.toast('Successfully signed in!', 5000, 'rounded'); 27 | }) 28 | .catch(error => { 29 | console.error(error); 30 | }); 31 | }, 32 | 33 | githubSignin() { 34 | this.$auth.authenticate('github') 35 | .then(() => { 36 | this.getUserInfo(); 37 | Materialize.toast('Successfully signed in!', 5000, 'rounded'); 38 | }) 39 | .catch(error => { 40 | console.error(error); 41 | }); 42 | }, 43 | 44 | signup(user) { 45 | return this.$http({ 46 | method: 'POST', 47 | url: 'user/signup', 48 | data: user 49 | }) 50 | .then(() => { 51 | Materialize.toast('Success! Check your e-mail for verification', 4000, 'rounded'); 52 | }) 53 | .catch(error => { 54 | this.failed = false; 55 | console.error(error); 56 | }); 57 | }, 58 | 59 | getUserInfo() { 60 | return this.$http({ 61 | method: 'GET', 62 | url: '/user/api/userInfo' 63 | }).then(res => { 64 | dispatch(Actions.setActiveUser(res.data)); 65 | this.Folders.getFileTree(); 66 | if(res.data.selectedSnippet) { 67 | dispatch(Actions.setSelectedSnippet(res.data.selectedSnippet)); 68 | } 69 | }) 70 | .catch(error => { 71 | console.error(error); 72 | }); 73 | }, 74 | 75 | updateUser(userObj) { 76 | return this.$http({ 77 | method: 'PUT', 78 | url: 'user/api/userInfo', 79 | data: userObj 80 | }).then(res => { 81 | dispatch(Actions.setActiveUser(res.data)); 82 | }) 83 | .catch(error => { 84 | console.error(error); 85 | }); 86 | }, 87 | 88 | updatePassword(infoObj){ 89 | return this.$http({ 90 | method: 'PUT', 91 | url: 'user/api/updatePassword', 92 | data: infoObj 93 | }).then(() => { 94 | Materialize.toast('Password was succesfully changed!', 4000, 'rounded'); 95 | }).catch(err => { 96 | console.error(err); 97 | }); 98 | }, 99 | 100 | signout() { 101 | this.$auth.logout(); 102 | dispatch(Actions.removeActiveUser()); 103 | dispatch(Actions.removeSelectedFolder()); 104 | dispatch(Actions.removeSelectedSnippet()); 105 | dispatch(Actions.clearSnippetMap()); 106 | } 107 | }; 108 | } 109 | } -------------------------------------------------------------------------------- /client/js/tinymce/plugins/textcolor/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("textcolor",function(a){function b(b){var c;return a.dom.getParents(a.selection.getStart(),function(a){var d;(d=a.style["forecolor"==b?"color":"background-color"])&&(c=d)}),c}function c(){var b,c,d=[];for(c=a.settings.textcolor_map||["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],b=0;b4 |68 |X5 |6 | {{editorModal.snippetObj.name}}9 |
7 | {{editorModal.snippetObj.description}} 8 |10 | 14 |15 |16 | 23 |24 |25 | 61 |67 |65 |66 | '+(c?"×":"")+""}var d,e,f,g,h,k,l,m=this,n=m._id,o=0;for(d=c(),d.push({text:tinymce.translate("No color"),color:"transparent"}),f='',g=d.length-1,k=0;j>k;k++){for(f+="
"}function e(b,c){a.undoManager.transact(function(){a.focus(),a.formatter.apply(b,{value:c}),a.nodeChanged()})}function f(b){a.undoManager.transact(function(){a.focus(),a.formatter.remove(b,{value:null},null,!0),a.nodeChanged()})}function g(c){function d(a){k.hidePanel(),k.color(a),e(k.settings.format,a)}function g(){k.hidePanel(),k.resetColor(),f(k.settings.format)}function h(a,b){a.style.background=b,a.setAttribute("data-mce-color",b)}var j,k=this.parent();tinymce.DOM.getParent(c.target,".mce-custom-color-btn")&&(k.hidePanel(),a.settings.color_picker_callback.call(a,function(a){var b,c,e,f=k.panel.getEl().getElementsByTagName("table")[0];for(b=tinymce.map(f.rows[f.rows.length-1].childNodes,function(a){return a.firstChild}),e=0;e",h=0;i>h;h++)l=k*i+h,l>g?f+=" "}if(a.settings.color_picker_callback){for(f+='":(e=d[l],f+=b(e.color,e.text));f+=" ",f+=" ",h=0;i>h;h++)f+=b("","Custom color");f+=" "}return f+="e;e++)h(b[e],b[e+1].getAttribute("data-mce-color"));h(c,a),d(a)},b(k.settings.format))),j=c.target.getAttribute("data-mce-color"),j?(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),c.target.setAttribute("aria-selected",!0),this.lastId=c.target.id,"transparent"==j?g():d(j)):null!==j&&k.hidePanel()}function h(){var a=this;a._color?e(a.settings.format,a._color):f(a.settings.format)}var i,j;j=a.settings.textcolor_rows||5,i=a.settings.textcolor_cols||8,a.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h}),a.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h})}); -------------------------------------------------------------------------------- /client/app/controllers/main/editor/search/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
78 | 87 | -------------------------------------------------------------------------------- /client/app/modals/authmodals/signup.html: -------------------------------------------------------------------------------- 1 |4 |77 |5 |8 |Found by Name
6 |
7 |9 |22 |10 | 11 | 12 | 13 | code{{snippet.name}} 14 | 15 | 16 | 17 |21 |18 | {{snippet.description}} 19 |
20 |23 |26 |Found by Content
24 |
25 |27 |40 |28 | 29 | 30 | 31 | code{{snippet.name}} 32 | 33 | 34 | 35 |39 |36 | {{snippet.description}} 37 |
38 |41 |44 |Found by Description
42 |
43 |45 |58 |46 | 47 | 48 | 49 | code{{snippet.name}} 50 | 51 | 52 | 53 |57 |54 | {{snippet.description}} 55 |
56 |59 |62 |Found by Tag
60 |
61 |63 |76 |64 | 65 | 66 | 67 | code{{snippet.name}} 68 | 69 | 70 | 71 |75 |72 | {{snippet.description}} 73 |
74 |2 | 3 |53 | -------------------------------------------------------------------------------- /client/app/controllers/main/editor/profile/profile.html: -------------------------------------------------------------------------------- 1 | 75 | 76 | -------------------------------------------------------------------------------- /client/app/services/Folders.js: -------------------------------------------------------------------------------- 1 | import * as Actions from '../redux/actions.js'; 2 | import { convertToTree, createBoundMethods } from '../redux/fileTree.js'; 3 | 4 | export default class Folders { 5 | constructor($http, $ngRedux) { 6 | this.$http = $http; 7 | $ngRedux.connect(this.mapStateToThis, this.mapDispatchToThis)(this); 8 | } 9 | 10 | mapDispatchToThis(dispatch) { 11 | return { 12 | getFileTree(snippetPath) { 13 | return this.$http({ 14 | method: 'GET', 15 | url: 'files/api/user/snippets' 16 | }) 17 | .then(res => { 18 | var snippetMap = convertToTree(res.data); 19 | dispatch(Actions.setSnippetMap(snippetMap)); 20 | if(!this.selectedFolder) { 21 | dispatch(Actions.setSelectedFolder('/' + this.email)); 22 | } 23 | if(snippetPath) { 24 | dispatch(Actions.setSelectedSnippet(snippetPath)); 25 | } 26 | }) 27 | .catch(error => { 28 | console.error(error); 29 | }); 30 | }, 31 | 32 | addFolder(folder) { 33 | return this.$http({ 34 | method: 'POST', 35 | url: 'files/api/folders', 36 | data: folder 37 | }) 38 | .then(snippet => { 39 | dispatch(Actions.addSnippetMap(snippet.data.filePath, snippet.data)); 40 | }) 41 | .catch(error => { 42 | console.error(error); 43 | }); 44 | }, 45 | 46 | selectFolder(folderPath) { 47 | dispatch(Actions.setSelectedFolder(folderPath)); 48 | }, 49 | 50 | renameFolder(oldNode, newName) { 51 | let boundFT = createBoundMethods(this.snippetMap); 52 | let oldParent = boundFT.parent(oldNode.filePath); 53 | let newNode = Object.assign({}, oldNode, {value: newName, filePath: oldParent.filePath + '/' + newName}); 54 | 55 | let newChildren = []; 56 | 57 | let changeAllChildFolders = (node, currFilePath, parentFilePath) => { 58 | if(!node) { 59 | return; 60 | } 61 | if(typeof node.value === 'object') { 62 | let newValue = Object.assign({}, node.value, {filePath: currFilePath}); 63 | let newNode = Object.assign({}, node, {parent: parentFilePath, filePath: currFilePath, value: newValue}); 64 | newChildren.push(newNode); 65 | return; 66 | } else { 67 | node.children.forEach(child => { 68 | let childPathArr = child.split('/'); 69 | let newPath = currFilePath + '/' + childPathArr[childPathArr.length-1]; 70 | changeAllChildFolders(this.snippetMap[child], newPath, currFilePath); 71 | }); 72 | } 73 | }; 74 | 75 | changeAllChildFolders(newNode, newNode.filePath); 76 | 77 | newChildren.forEach((currChild, index) => { 78 | return this.$http ({ 79 | method: 'PUT', 80 | url: 'files/api/snippets', 81 | data: {snippetId: currChild.value._id, value: currChild.value} 82 | }) 83 | .then(() => { 84 | if(index === newChildren.length-1) { 85 | this.getFileTree(); 86 | } 87 | }); 88 | }); 89 | }, 90 | 91 | removeFolder(folderPath) { 92 | return this.$http({ 93 | method: 'DELETE', 94 | url: 'files/api/folders', 95 | params: { filePath: folderPath } 96 | }).then(() => { 97 | dispatch(Actions.removeSnippetMap(folderPath)); 98 | }) 99 | .catch(error => { 100 | console.error(error); 101 | }); 102 | } 103 | }; 104 | } 105 | 106 | mapStateToThis(state) { 107 | return { 108 | snippetMap: state.snippetMap, 109 | selectedFolder: state.selectedFolder, 110 | selectedSnippet: state.selectedSnippet, 111 | email: state.activeUser.email 112 | }; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /user-server/models/users.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | let mongoose = require('mongoose'); 3 | let setup = require('../../setup.js'); 4 | let db = mongoose.createConnection(setup.mongodbHost + setup.mongodbPort + setup.mongodbUsersName); 5 | 6 | let Promise = require('bluebird'); 7 | let bcrypt = Promise.promisifyAll(require('bcrypt')); 8 | let utils = require('../config/utils.js'); 9 | 10 | let userSchema = mongoose.Schema({ 11 | _password: { type: String }, 12 | _createdAt: { type: Date, default: new Date() }, 13 | _updatedAt: { type: Date, default: new Date() }, 14 | github: { type: Number }, 15 | avatar_url: { type: String }, 16 | username: { type: String, required: true }, 17 | email: { type: String, required: true, unique: true, dropDups: true }, 18 | theme: { type: String, default: 'eclipse' }, 19 | language: { type: String, default: 'javascript' }, 20 | selectedSnippet: { type: String }, 21 | sublimeSecret: { type: String, default: 'No secret issued;' } 22 | }); 23 | 24 | 25 | let userStatics = { 26 | makeUser(userObj, callback) { 27 | let pw = userObj._password; 28 | if (typeof pw === 'string' && pw !== '') { 29 | bcrypt.genSaltAsync(13) 30 | .then((salt) => bcrypt.hashAsync(pw, salt)) 31 | .then((hash) => { 32 | userObj._password = hash; 33 | return utils.createRootFolderAsync(userObj); 34 | }) 35 | .then(() => this.create(userObj)) 36 | .then(result => { 37 | callback(null, result); 38 | }) 39 | .catch(err => callback(err, null)); 40 | } else if (userObj.github) { 41 | // OAuth based login (no supplied password) 42 | utils.createRootFolderAsync(userObj) 43 | .then(() => this.create(userObj)) 44 | .then(() => callback(null, userObj)) 45 | .catch(err => callback(err, null)); 46 | } else { 47 | callback(new Error('must login via github or local session'), null); 48 | } 49 | }, 50 | getUser(email, callback) { 51 | this.findOne({ email }) 52 | .then((userObj) => { 53 | callback(null, userObj); 54 | }) 55 | .catch(callback); 56 | }, 57 | updateUser(email, newProps, callback) { 58 | newProps._updatedAt = new Date(); 59 | this.update({ email }, newProps, { multi: false }, callback); 60 | }, 61 | removeUser(email, callback) { 62 | this.findOne({ email }).remove(callback); 63 | }, 64 | checkCredentials(email, attempt, callback) { 65 | let userData = {}; 66 | this.findOne({ email }) 67 | .then(foundUser => { 68 | if (foundUser) { 69 | userData = foundUser.toObject(); 70 | bcrypt.compareAsync(attempt, foundUser._password) 71 | .then(success => { 72 | if (success) { 73 | delete userData._password; 74 | callback(null, userData); 75 | } else { 76 | callback(new Error('Incorrect Password'), null); 77 | } 78 | }) 79 | .catch(callback); 80 | } else { 81 | callback(new Error('Email not found'), null); 82 | } 83 | }); 84 | }, 85 | createSublimeSecretAsync(email) { 86 | return this.findOne({ email }) 87 | .then(foundUser => { 88 | if (foundUser) { 89 | var newseed = (Math.random() * 100).toString(); 90 | return bcrypt.genSaltAsync(13) 91 | .then(salt => bcrypt.hashAsync(newseed, salt)) 92 | .then(hash => { 93 | foundUser.sublimeSecret = hash; 94 | return this.updateUserAsync(foundUser.email, foundUser); 95 | }) 96 | .then(() => { 97 | return foundUser.sublimeSecret; 98 | }); 99 | } 100 | else { 101 | return new Promise((_,reject) => reject('User not found')); 102 | } 103 | }); 104 | }, 105 | exchangeSecretForTokenAsync(sublimeSecret) { 106 | return this.findOne({ sublimeSecret }); 107 | } 108 | }; 109 | 110 | let userStaticsAsync = Promise.promisifyAll(userStatics); 111 | Object.assign(userSchema.statics, userStaticsAsync); 112 | let User = db.model('User', userSchema); 113 | module.exports = User; -------------------------------------------------------------------------------- /client/js/tinymce/plugins/template/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("template",function(a){function b(b){return function(){var c=a.settings.templates;return"function"==typeof c?void c(b):void("string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):b(c))}}function c(b){function c(b){function c(b){if(-1==b.indexOf("")){var c="";tinymce.each(a.contentCSS,function(b){c+=''}),b=""+c+""+b+""}b=f(b,"template_preview_replace_values");var e=d.find("iframe")[0].getEl().contentWindow.document;e.open(),e.write(b),e.close()}var g=b.control.value();g.url?tinymce.util.XHR.send({url:g.url,success:function(a){e=a,c(e)}}):(e=g.content,c(e)),d.find("#description")[0].text(b.control.value().description)}var d,e,h=[];if(!b||0===b.length){var i=a.translate("No templates defined.");return void a.notificationManager.open({text:i,type:"info"})}tinymce.each(b,function(a){h.push({selected:!h.length,text:a.title,value:{url:a.url,content:a.content,description:a.description}})}),d=a.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:h,onselect:c}}]},{type:"label",name:"description",label:"Description",text:"\xa0"},{type:"iframe",flex:1,border:1}],onsubmit:function(){g(!1,e)},width:a.getParam("template_popup_width",600),height:a.getParam("template_popup_height",500)}),d.find("listbox")[0].fire("select")}function d(b,c){function d(a,b){if(a=""+a,a.length0&&(i=k.create("div",null),i.appendChild(j[0].cloneNode(!0))),h(k.select("*",i),function(b){g(b,a.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_cdate_format",a.getLang("template.cdate_format")))),g(b,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_mdate_format",a.getLang("template.mdate_format")))),g(b,a.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(b.innerHTML=l)}),e(i),a.execCommand("mceInsertContent",!1,i.innerHTML),a.addVisual()}var h=tinymce.each;a.addCommand("mceInsertTemplate",g),a.addButton("template",{title:"Insert template",onclick:b(c)}),a.addMenuItem("template",{text:"Insert template",onclick:b(c),context:"insert"}),a.on("PreProcess",function(b){var c=a.dom;h(c.select("div",b.node),function(b){c.hasClass(b,"mceTmpl")&&(h(c.select("*",b),function(b){c.hasClass(b,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_mdate_format",a.getLang("template.mdate_format"))))}),e(b))})})}); -------------------------------------------------------------------------------- /client/app/services/Snippets.js: -------------------------------------------------------------------------------- 1 | import * as Actions from '../redux/actions.js'; 2 | 3 | export default class Snippets { 4 | constructor($http, $ngRedux, Folders, Auth) { 5 | this.$http = $http; 6 | this.Folders = Folders; 7 | this.Auth = Auth; 8 | $ngRedux.connect(this.mapStateToThis, this.mapDispatchToThis)(this); 9 | } 10 | 11 | mapDispatchToThis(dispatch) { 12 | return { 13 | getSnippet(snippetId) { 14 | return this.$http({ 15 | method: 'GET', 16 | url: 'files/api/snippets?_id=' + snippetId 17 | }); 18 | }, 19 | 20 | addSnippet(snippetObj) { 21 | return this.$http({ 22 | method: 'POST', 23 | url: 'files/api/snippets', 24 | data: snippetObj 25 | }).then((res) => { 26 | dispatch(Actions.addSnippetMap(res.data.filePath, res.data)); 27 | dispatch(Actions.removeSelectedPublicSnippet()); 28 | this.changeSelectedSnippet(res.data.filePath); 29 | Materialize.toast('Snippet added!', 3000, 'rounded'); 30 | }) 31 | .catch(error => { 32 | console.error(error); 33 | }); 34 | }, 35 | 36 | updateSnippet(snippetObj, oldFilePath) { 37 | //delete old id so mongoose doesn't get upset 38 | let snippetId = snippetObj._id; 39 | delete snippetObj.Id; 40 | return this.$http({ 41 | method: 'PUT', 42 | url: 'files/api/snippets', 43 | data: { snippetId, value: snippetObj } 44 | }).then(res => { 45 | let nodeToPass = Object.assign({}, this.snippetMap[oldFilePath], { filePath: res.data.filePath, value: res.data }); 46 | Materialize.toast('Snippet updated!', 3000, 'rounded'); 47 | dispatch(Actions.updateSnippetMap(oldFilePath, res.data.filePath, nodeToPass)); 48 | if(this.activeUser.selectedSnippet === oldFilePath) { 49 | this.Auth.updateUser({ selectedSnippet: res.data.filePath }); 50 | } 51 | if(this.selectedPublicSnippet === oldFilePath) { 52 | dispatch(Actions.setSelectedPublicSnippet(res.data.filePath)); 53 | } 54 | dispatch(Actions.setSelectedSnippet(res.data.filePath)); 55 | }) 56 | .catch(error => { 57 | console.error(error); 58 | }); 59 | 60 | }, 61 | 62 | removeSnippet(snippetObj) { 63 | return this.$http({ 64 | method: 'DELETE', 65 | url: 'files/api/snippets', 66 | params: { snippetId: snippetObj.value._id } 67 | }).then(() => { 68 | this.deselectSnippet(); 69 | dispatch(Actions.removeSnippetMap(snippetObj.filePath)); 70 | if(this.activeUser.selectedSnippet === snippetObj.filePath) { 71 | this.Auth.updateUser({ selectedSnippet: null }); 72 | } 73 | Materialize.toast('Successfully removed!', 3000, 'rounded'); 74 | }) 75 | .catch(error => { 76 | console.error(error); 77 | }); 78 | }, 79 | 80 | changeSelectedSnippet(snippetFilePath) { 81 | dispatch(Actions.removeSelectedPublicSnippet()); 82 | dispatch(Actions.setSelectedSnippet(snippetFilePath)); 83 | this.Auth.updateUser({ selectedSnippet: snippetFilePath }); 84 | }, 85 | 86 | deselectSnippet() { 87 | dispatch(Actions.removeSelectedSnippet()); 88 | }, 89 | 90 | updateUsername(userObj) { 91 | return this.$http({ 92 | method: 'PUT', 93 | url: 'files/api/user/snippets', 94 | data: userObj 95 | }).then(() => { 96 | this.Auth.updateUser({ username: userObj.username }); 97 | this.Folders.getFileTree(); 98 | }) 99 | .catch(error => { 100 | console.error(error); 101 | }); 102 | } 103 | }; 104 | } 105 | mapStateToThis(state) { 106 | return { 107 | snippetMap: state.snippetMap, 108 | selectedFolder: state.selectedFolder, 109 | selectedSnippet: state.selectedSnippet, 110 | activeUser: state.activeUser, 111 | selectedPublicSnippet: state.selectedPublicSnippet 112 | }; 113 | } 114 | 115 | } 116 | -------------------------------------------------------------------------------- /client/js/tinymce/plugins/link/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("link",function(a){function b(b){return function(){var c=a.settings.link_list;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):"function"==typeof c?c(b):b(c)}}function c(a,b,c){function d(a,c){return c=c||[],tinymce.each(a,function(a){var e={text:a.text||a.title};a.menu?e.menu=d(a.menu):(e.value=a.value,b&&b(e)),c.push(e)}),c}return d(a,c||[])}function d(b){function d(a){var b=l.find("#text");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),l.find("#href").value(a.control.value())}function e(b){var c=[];return tinymce.each(a.dom.select("a:not([href])"),function(a){var d=a.name||a.id;d&&c.push({text:d,value:"#"+d,selected:-1!=b.indexOf("#"+d)})}),c.length?(c.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:c,onselect:d}):void 0}function f(){!k&&0===u.text.length&&m&&this.parent().parent().find("#text")[0].value(this.value())}function g(b){var c=b.meta||{};o&&o.value(a.convertURL(this.value(),"href")),tinymce.each(b.meta,function(a,b){l.find("#"+b).value(a)}),c.text||f.call(this)}function h(a){var b=v.getContent();if(/]+>[^<]+<\/a>$/.test(b)||-1==b.indexOf("href=")))return!1;if(a){var c,d=a.childNodes;if(0===d.length)return!1;for(c=d.length-1;c>=0;c--)if(3!=d[c].nodeType)return!1}return!0}var i,j,k,l,m,n,o,p,q,r,s,t,u={},v=a.selection,w=a.dom;i=v.getNode(),j=w.getParent(i,"a[href]"),m=h(),u.text=k=j?j.innerText||j.textContent:v.getContent({format:"text"}),u.href=j?w.getAttrib(j,"href"):"",j?u.target=w.getAttrib(j,"target"):a.settings.default_link_target&&(u.target=a.settings.default_link_target),(t=w.getAttrib(j,"rel"))&&(u.rel=t),(t=w.getAttrib(j,"class"))&&(u["class"]=t),(t=w.getAttrib(j,"title"))&&(u.title=t),m&&(n={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){u.text=this.value()}}),b&&(o={type:"listbox",label:"Link list",values:c(b,function(b){b.value=a.convertURL(b.value||b.url,"href")},[{text:"None",value:""}]),onselect:d,value:a.convertURL(u.href,"href"),onPostRender:function(){o=this}}),a.settings.target_list!==!1&&(a.settings.target_list||(a.settings.target_list=[{text:"None",value:""},{text:"New window",value:"_blank"}]),q={name:"target",type:"listbox",label:"Target",values:c(a.settings.target_list)}),a.settings.rel_list&&(p={name:"rel",type:"listbox",label:"Rel",values:c(a.settings.rel_list)}),a.settings.link_class_list&&(r={name:"class",type:"listbox",label:"Class",values:c(a.settings.link_class_list,function(b){b.value&&(b.textStyle=function(){return a.formatter.getCssText({inline:"a",classes:[b.value]})})})}),a.settings.link_title!==!1&&(s={name:"title",type:"textbox",label:"Title",value:u.title}),l=a.windowManager.open({title:"Insert link",data:u,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:g,onkeyup:f},n,s,e(u.href),o,p,q,r],onSubmit:function(b){function c(b,c){var d=a.selection.getRng();tinymce.util.Delay.setEditorTimeout(a,function(){a.windowManager.confirm(b,function(b){a.selection.setRng(d),c(b)})})}function d(){var b={href:e,target:u.target?u.target:null,rel:u.rel?u.rel:null,"class":u["class"]?u["class"]:null,title:u.title?u.title:null};j?(a.focus(),m&&u.text!=k&&("innerText"in j?j.innerText=u.text:j.textContent=u.text),w.setAttribs(j,b),v.select(j),a.undoManager.add()):m?a.insertContent(w.createHTML("a",b,w.encode(u.text))):a.execCommand("mceInsertLink",!1,b)}var e;return u=tinymce.extend(u,b.data),(e=u.href)?e.indexOf("@")>0&&-1==e.indexOf("//")&&-1==e.indexOf("mailto:")?void c("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(a){a&&(e="mailto:"+e),d()}):a.settings.link_assume_external_targets&&!/^\w+:/i.test(e)||!a.settings.link_assume_external_targets&&/^\s*www[\.|\d\.]/i.test(e)?void c("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(a){a&&(e="http://"+e),d()}):void d():void a.execCommand("unlink")}})}a.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Meta+K",onclick:b(d),stateSelector:"a[href]"}),a.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),a.addShortcut("Meta+K","",b(d)),a.addCommand("mceLink",b(d)),this.showDialog=d,a.addMenuItem("link",{icon:"link",text:"Insert/edit link",shortcut:"Meta+K",onclick:b(d),stateSelector:"a[href]",context:"insert",prependToContext:!0})}); -------------------------------------------------------------------------------- /files-server/models/snippets.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | let mongoose = require('mongoose'); 3 | let setup = require('../../setup.js'); 4 | let db = mongoose.createConnection(setup.mongodbHost + setup.mongodbPort + setup.mongodbFilesName); 5 | 6 | let Promise = require('bluebird'); 7 | 8 | let snippetSchema = mongoose.Schema({ 9 | _createdAt: { type: Date, default: new Date() }, 10 | _updatedAt: { type: Date, default: new Date() }, 11 | createdBy: { type: String, required: true }, 12 | username: { type: String, required: true }, 13 | data: { type: String, default: '' }, 14 | name: { type: String, required: true }, 15 | filePath: { type: String, required: true }, 16 | tags: { type: [String], default: [] }, 17 | annotation: { type: String }, 18 | description: { type: String }, 19 | public: { type: Boolean, default: true }, 20 | favorite: { type: Boolean, default: false }, 21 | shortcut: { type: String }, 22 | language: { type: String, default: 'javascript' } 23 | }); 24 | 25 | let snippetStatics = { 26 | makeSnippet(snippetObj, callback) { 27 | this.findOne({filePath: snippetObj.filePath}) 28 | .then(result => { 29 | if (!result) { 30 | this.create(snippetObj) 31 | .then((result) => callback(null, result)) 32 | .catch(callback); 33 | } else { 34 | callback(null, result); 35 | } 36 | }); 37 | }, 38 | 39 | getSnippet(_id, callback) { 40 | this.findOne({_id: mongoose.Types.ObjectId(_id)}) 41 | .then(snippetObj => callback(null, snippetObj)) 42 | .catch(callback); 43 | }, 44 | 45 | updateSnippet(_id, newProps, callback) { 46 | newProps._updatedAt = new Date(); 47 | this.update({ _id: mongoose.Types.ObjectId(_id) }, newProps, { multi: false }, callback); 48 | }, 49 | 50 | removeSnippet(_id, callback) { 51 | this.findOne({ _id: mongoose.Types.ObjectId(_id) }).remove(callback); 52 | }, 53 | 54 | getSnippetsByUser(email, callback) { 55 | this.find({ createdBy: email }) 56 | .then((foundSnippets) => { 57 | if (Array.isArray(foundSnippets) && foundSnippets.length !== 0) { 58 | callback(null, foundSnippets); 59 | } else { 60 | callback(new Error('no snippets found'), null); 61 | } 62 | }) 63 | .catch(callback); 64 | }, 65 | 66 | updateSnippetsByUser(email, newProps, callback) { 67 | newProps._updatedAt = new Date(); 68 | this.update({ createdBy: email }, newProps, {multi: true}, callback); 69 | }, 70 | 71 | getSnippetsByFolder(email, folder, callback) { 72 | this.find({ createdBy: email, filePath: new RegExp(folder + '.*', 'igm') }) 73 | .then((foundSnippets) => { 74 | if (Array.isArray(foundSnippets) && foundSnippets.length !== 0) { 75 | callback(null, foundSnippets); 76 | } else { 77 | callback(new Error('password invalid'), null); 78 | } 79 | }).catch(callback); 80 | }, 81 | 82 | makeSubFolder(email, username, filepath, callback) { 83 | filepath = (filepath.charAt(0) !== '/') ? '/' + filepath : filepath; 84 | this.makeSnippet({ name: '.config', data: '..', createdBy: email, username: username, filePath: filepath + '/.config' }, callback); 85 | }, 86 | 87 | makeRootFolder(email, username, callback) { 88 | this.makeSnippet({ name: '.config', data: '..', createdBy: email, username: username, filePath: '/' + email + '/.config' }, callback); 89 | }, 90 | 91 | removeFolder(email, folder, callback) { 92 | this.getSnippetsByFolder(email, folder, (err, snippets) => { 93 | if (err) { 94 | callback(err); 95 | } else { 96 | let removeSnippetAsync = Promise.promisify(this.removeSnippet.bind(this)); 97 | let promiseArray = snippets.map(snip => removeSnippetAsync(snip._id)); 98 | Promise.all(promiseArray) 99 | .then(response => { 100 | callback(null, response); 101 | }) 102 | .catch(callback); 103 | } 104 | }); 105 | }, 106 | 107 | getPublic(page, callback) { 108 | page = page || 0; 109 | this.find({ public: 1, name: { $ne: '.config' } },{}, {limit:24 , skip: 24 * page}) 110 | .then((foundSnippets) => { 111 | callback(null, foundSnippets.sort({ _createdAt: -1 })); 112 | }) 113 | .catch(callback); 114 | } 115 | }; 116 | 117 | let snippetStaticsAsync = Promise.promisifyAll(snippetStatics); 118 | 119 | Object.assign(snippetSchema.statics, snippetStaticsAsync); 120 | let Snippet = db.model('Snippet', snippetSchema); 121 | 122 | module.exports = Snippet; 123 | -------------------------------------------------------------------------------- /client/app/controllers/main/editor/snippets/snippets.js: -------------------------------------------------------------------------------- 1 | import { getAllFoldersPaths } from '../../../../redux/fileTree.js'; 2 | 3 | class SnippetsCtrl { 4 | constructor($ngRedux, Snippets, Folders, Public, $state, focus) { 5 | $ngRedux.connect(this.mapStateToThis)(this); 6 | this.Public = Public; 7 | this.Folders = Folders; 8 | this.Snippets = Snippets; 9 | this.folderInput = false; 10 | this.folderModalShow = false; 11 | this.moveModalShow = false; 12 | this.folderModal = {}; 13 | this.moveModal = {}; 14 | this.$state = $state; 15 | this.focus = focus; 16 | } 17 | 18 | focusNameInput(filePath) { 19 | this.changeSelectedSnippet(filePath); 20 | this.focus('snippet-input-name'); 21 | } 22 | 23 | toggleFolderModal(folderObj) { 24 | this.folderModal = folderObj; 25 | this.folderModalShow = !this.folderModalShow; 26 | } 27 | 28 | toggleMoveModal(snippetObj) { 29 | this.paths = getAllFoldersPaths(this.snippetMap, this.snippetMap.__root.filePath); 30 | this.moveModal = snippetObj; 31 | this.moveModalShow = !this.moveModalShow; 32 | } 33 | 34 | addFolder() { 35 | let path = this.selectedFolder + '/' + this.subFolder.name; 36 | if (!this.snippetMap[path]) { 37 | this.Folders.addFolder({ path: path }); 38 | this.subFolder.name = ''; 39 | } else { 40 | Materialize.toast('Can not use duplicate name', 3000, 'rounded'); 41 | } 42 | } 43 | removeFolder(folderPath) { 44 | this.Folders.removeFolder(folderPath); 45 | } 46 | changeActiveTab(folderPath) { 47 | this.Folders.selectFolder(folderPath); 48 | } 49 | toggleFolderNameInput() { 50 | this.folderInput = !this.folderInput; 51 | } 52 | copySnippet(snippet) { 53 | this.Snippets.getSnippet({ snippetId: snippet._id }); 54 | } 55 | toggleFavorite(snippet) { 56 | let _id = snippet.value ? snippet.value._id : snippet._id; 57 | let favorite = snippet.value ? !snippet.value.favorite : !snippet.favorite; 58 | this.Snippets.updateSnippet({ _id, favorite }, snippet.filePath); 59 | } 60 | changeSelectedSnippet(snippetPath) { 61 | if (this.selectedPublicSnippet) { 62 | if (this.selectedPublicSnippet !== snippetPath) { 63 | this.Public.setSelectedPublicSnippet(snippetPath); 64 | } 65 | } else { 66 | if (this.selectedSnippet !== snippetPath) { 67 | this.Snippets.changeSelectedSnippet(snippetPath); 68 | } 69 | } 70 | } 71 | deselectSnippet() { 72 | this.Public.removeSelectedPublicSnippet(); 73 | this.Snippets.deselectSnippet(); 74 | this.focus('snippet-input-name'); 75 | } 76 | removeSnippet(snippetObj) { 77 | this.Snippets.removeSnippet(snippetObj); 78 | } 79 | 80 | closeSideNav() { 81 | this.$state.go('main.editor'); 82 | } 83 | 84 | showToolbar(id) { 85 | $('#' + id).toggle(400); 86 | $('.tooltipped').tooltip({ delay: 50 }); 87 | } 88 | 89 | mapStateToThis(state) { 90 | let { selectedFolder, snippetMap, selectedSnippet, selectedPublicSnippet, publicList } = state; 91 | let visibleFolders = [], 92 | visibleSnippets = []; 93 | let selectedFolderObj = snippetMap[selectedFolder]; 94 | if (selectedPublicSnippet) { 95 | visibleSnippets = publicList; 96 | } else if (selectedFolderObj) { 97 | selectedFolderObj.children.forEach(childKey => { 98 | let child = snippetMap[childKey]; 99 | if (typeof child.value === 'string') { 100 | visibleFolders.push(child); 101 | } else if (child.value.name !== '.config') { 102 | visibleSnippets.push(child); 103 | } 104 | }); 105 | } 106 | let favoritesArr = []; 107 | Object.keys(snippetMap).forEach(key => { 108 | let snippetVal = snippetMap[key].value; 109 | if (typeof snippetVal === 'object') { 110 | if (snippetVal.name !== '.config' && snippetVal.name !== '/.config') { 111 | favoritesArr.push(snippetVal); 112 | } 113 | } 114 | }); 115 | return { 116 | selectedPublicSnippet, 117 | visibleSnippets, 118 | visibleFolders, 119 | selectedFolderObj, 120 | selectedFolder, 121 | selectedSnippet, 122 | snippetMap, 123 | favoritesArr 124 | }; 125 | } 126 | } 127 | 128 | const snippets = (url) => { 129 | return { 130 | url: url, 131 | controllerAs: 'snippets', 132 | controller: SnippetsCtrl, 133 | template: require(`.${url}.html`), 134 | access: { restricted: true } 135 | }; 136 | }; 137 | 138 | export default snippets; 139 | -------------------------------------------------------------------------------- /client/app/redux/fileTree.js: -------------------------------------------------------------------------------- 1 | export const getNode = (tree, filePath) => { 2 | return tree[filePath] ? Object.assign({}, tree[filePath]) : null; 3 | }; 4 | export let getParent = (tree, filePath) => { 5 | return tree[filePath] && tree[filePath].parent ? getNode(tree,tree[filePath].parent) : null; 6 | }; 7 | export let getChildren = (tree, filePath, showConfigs) => { 8 | let children = tree[filePath].children.map(childPath => getNode(tree, childPath)); 9 | if(!showConfigs) { 10 | return children.filter(child => child.value.name !== '.config'); 11 | } else { 12 | return children; 13 | } 14 | }; 15 | export let getAllParents = (tree, filePath) => { 16 | let results = [], parent = getParent(tree,filePath); 17 | while (parent) { 18 | results = [...results, parent]; 19 | filePath = parent.filePath; 20 | parent = getParent(tree,filePath); 21 | } 22 | return results; 23 | }; 24 | export let getAllChildren = (tree, filePath, showConfigs) => { 25 | let children = getChildren(tree, filePath, showConfigs); 26 | if(children.length === 0) { 27 | return []; 28 | } else { 29 | return children.reduce((results, child) => { 30 | let childPath = child.filePath; 31 | let children = getChildren(tree, childPath, showConfigs); 32 | return results.concat(child, children); 33 | }, []); 34 | } 35 | }; 36 | export const insertNode = (origTree, filePath, node) => { 37 | let tree = Object.assign({}, origTree, {__root: origTree.__root}); 38 | let folders = filePath.split('/').filter(a => a).concat(node); 39 | let allOK = folders.reduce((prevPath, currItem) => { 40 | if(typeof currItem === 'object') { 41 | tree[prevPath].value = currItem; 42 | return true; 43 | } else { 44 | let currPath = prevPath + '/' + currItem; 45 | let parentObj = tree[prevPath], currObj = tree[currPath]; 46 | if(prevPath && !parentObj) { 47 | tree[prevPath] = {filePath: prevPath, children: []}; 48 | } 49 | if(parentObj && parentObj.children.indexOf(currPath) === -1) { 50 | tree[prevPath].children.push(currPath); 51 | } 52 | tree[currPath] = currObj ? currObj : {children: []}; 53 | tree[currPath].parent = prevPath; 54 | tree[currPath].value = currItem; 55 | tree[currPath].filePath = currPath; 56 | if(tree.__root === undefined) { 57 | Object.defineProperty(tree, '__root', { 58 | value: tree[currPath] 59 | }); 60 | } 61 | return currPath; 62 | } 63 | }, ''); 64 | return allOK ? tree : new Error('Error parsing filepath'); 65 | }; 66 | export const deleteNode = (origTree, filePath) => { 67 | let tree = Object.assign({}, origTree, {__root: origTree.__root}); 68 | let childrenPaths = getAllChildren(tree, filePath, true).map(child => child.filePath); 69 | let parent = getParent(tree, filePath); 70 | childrenPaths.forEach(childPath => { 71 | delete tree[childPath]; 72 | }); 73 | parent.children.splice(parent.children.indexOf(filePath), 1); 74 | // parent.children = parent.children.filter(childPath => childPath !== filePath); 75 | delete tree[filePath]; 76 | return tree; 77 | }; 78 | export const updateNode = (origTree, origFilePath, updatedFilePath, updatedNode) => { 79 | let tree = Object.assign({}, origTree); 80 | let nodeToUpdate = Object.assign({}, tree[origFilePath], updatedNode); 81 | tree = deleteNode(tree, origFilePath); 82 | return insertNode(tree, updatedFilePath, nodeToUpdate.value); 83 | }; 84 | export const convertToTree = (snippetObj) => { 85 | let userTreeMap = Object.keys(snippetObj).reduce( (prevTree, key) => { 86 | return insertNode(prevTree, key, snippetObj[key]); 87 | }, {}); 88 | return userTreeMap; 89 | }; 90 | export let getAllFoldersPaths = (tree, rootPath) => { 91 | let results = []; 92 | let traverse = (nodePath) => { 93 | if(typeof tree[nodePath].value === 'string') { 94 | results.push(tree[nodePath].filePath); 95 | tree[nodePath].children.forEach(childPath => { 96 | traverse(childPath); 97 | }); 98 | } 99 | }; 100 | traverse(rootPath); 101 | return results; 102 | }; 103 | export const createBoundMethods = (...args) => { 104 | return { 105 | node: getNode.bind(null,...args), 106 | parent: getParent.bind(null,...args), 107 | children: getChildren.bind(null,...args), 108 | parents: getAllParents.bind(null,...args), 109 | allChildren: getAllChildren.bind(null,...args) 110 | }; 111 | 112 | }; 113 | -------------------------------------------------------------------------------- /client/assets/codemirror-themes/mdn-like.css: -------------------------------------------------------------------------------- 1 | /* 2 | MDN-LIKE Theme - Mozilla 3 | Ported to CodeMirror by Peter Kroon4 |52 |X5 |6 |51 |7 |50 |8 |49 |9 |19 | 20 | 47 | Already have an account? Signin ... 48 |log in
10 | 18 |4 | Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues 5 | GitHub: @peterkroon 6 | 7 | The mdn-like theme is inspired on the displayed code examples at: https://developer.mozilla.org/en-US/docs/Web/CSS/animation 8 | 9 | */ 10 | .cm-s-mdn-like.CodeMirror { color: #999; background-color: #fff; } 11 | .cm-s-mdn-like div.CodeMirror-selected { background: #cfc; } 12 | .cm-s-mdn-like .CodeMirror-line::selection, .cm-s-mdn-like .CodeMirror-line > span::selection, .cm-s-mdn-like .CodeMirror-line > span > span::selection { background: #cfc; } 13 | .cm-s-mdn-like .CodeMirror-line::-moz-selection, .cm-s-mdn-like .CodeMirror-line > span::-moz-selection, .cm-s-mdn-like .CodeMirror-line > span > span::-moz-selection { background: #cfc; } 14 | 15 | .cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; } 16 | .cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; padding-left: 8px; } 17 | .cm-s-mdn-like .CodeMirror-cursor { border-left: 2px solid #222; } 18 | 19 | .cm-s-mdn-like .cm-keyword { color: #6262FF; } 20 | .cm-s-mdn-like .cm-atom { color: #F90; } 21 | .cm-s-mdn-like .cm-number { color: #ca7841; } 22 | .cm-s-mdn-like .cm-def { color: #8DA6CE; } 23 | .cm-s-mdn-like span.cm-variable-2, .cm-s-mdn-like span.cm-tag { color: #690; } 24 | .cm-s-mdn-like span.cm-variable-3, .cm-s-mdn-like span.cm-def { color: #07a; } 25 | 26 | .cm-s-mdn-like .cm-variable { color: #07a; } 27 | .cm-s-mdn-like .cm-property { color: #905; } 28 | .cm-s-mdn-like .cm-qualifier { color: #690; } 29 | 30 | .cm-s-mdn-like .cm-operator { color: #cda869; } 31 | .cm-s-mdn-like .cm-comment { color:#777; font-weight:normal; } 32 | .cm-s-mdn-like .cm-string { color:#07a; font-style:italic; } 33 | .cm-s-mdn-like .cm-string-2 { color:#bd6b18; } /*?*/ 34 | .cm-s-mdn-like .cm-meta { color: #000; } /*?*/ 35 | .cm-s-mdn-like .cm-builtin { color: #9B7536; } /*?*/ 36 | .cm-s-mdn-like .cm-tag { color: #997643; } 37 | .cm-s-mdn-like .cm-attribute { color: #d6bb6d; } /*?*/ 38 | .cm-s-mdn-like .cm-header { color: #FF6400; } 39 | .cm-s-mdn-like .cm-hr { color: #AEAEAE; } 40 | .cm-s-mdn-like .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } 41 | .cm-s-mdn-like .cm-error { border-bottom: 1px solid red; } 42 | 43 | div.cm-s-mdn-like .CodeMirror-activeline-background { background: #efefff; } 44 | div.cm-s-mdn-like span.CodeMirror-matchingbracket { outline:1px solid grey; color: inherit; } 45 | 46 | .cm-s-mdn-like.CodeMirror { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAyCAYAAAAp8UeFAAAHvklEQVR42s2b63bcNgyEQZCSHCdt2vd/0tWF7I+Q6XgMXiTtuvU5Pl57ZQKkKHzEAOtF5KeIJBGJ8uvL599FRFREZhFx8DeXv8trn68RuGaC8TRfo3SNp9dlDDHedyLyTUTeRWStXKPZrjtpZxaRw5hPqozRs1N8/enzIiQRWcCgy4MUA0f+XWliDhyL8Lfyvx7ei/Ae3iQFHyw7U/59pQVIMEEPEz0G7XiwdRjzSfC3UTtz9vchIntxvry5iMgfIhJoEflOz2CQr3F5h/HfeFe+GTdLaKcu9L8LTeQb/R/7GgbsfKedyNdoHsN31uRPWrfZ5wsj/NzzRQHuToIdU3ahwnsKPxXCjJITuOsi7XLc7SG/v5GdALs7wf8JjTFiB5+QvTEfRyGOfX3Lrx8wxyQi3sNq46O7QahQiCsRFgqddjBouVEHOKDgXAQHD9gJCr5sMKkEdjwsarG/ww3BMHBU7OBjXnzdyY7SfCxf5/z6ATccrwlKuwC/jhznnPF4CgVzhhVf4xp2EixcBActO75iZ8/fM9zAs2OMzKdslgXWJ9XG8PQoOAMA5fGcsvORgv0doBXyHrCwfLJAOwo71QLNkb8n2Pl6EWiR7OCibtkPaz4Kc/0NNAze2gju3zOwekALDaCFPI5vjPFmgGY5AZqyGEvH1x7QfIb8YtxMnA/b+QQ0aQDAwc6JMFg8CbQZ4qoYEEHbRwNojuK3EHwd7VALSgq+MNDKzfT58T8qdpADrgW0GmgcAS1lhzztJmkAzcPNOQbsWEALBDSlMKUG0Eq4CLAQWvEVQ9WU57gZJwZtgPO3r9oBTQ9WO8TjqXINx8R0EYpiZEUWOF3FxkbJkgU9B2f41YBrIj5ZfsQa0M5kTgiAAqM3ShXLgu8XMqcrQBvJ0CL5pnTsfMB13oB8athpAq2XOQmcGmoACCLydx7nToa23ATaSIY2ichfOdPTGxlasXMLaL0MLZAOwAKIM+y8CmicobGdCcbbK9DzN+yYGVoNNI5iUKTMyYOjPse4A8SM1MmcXgU0toOq1yO/v8FOxlASyc7TgeYaAMBJHcY1CcCwGI/TK4AmDbDyKYBBtFUkRwto8gygiQEaByFgJ00BH2M8JWwQS1nafDXQCidWyOI8AcjDCSjCLk8ngObuAm3JAHAdubAmOaK06V8MNEsKPJOhobSprwQa6gD7DclRQdqcwL4zxqgBrQcabUiBLclRDKAlWp+etPkBaNMA0AKlrHwTdEByZAA4GM+SNluSY6wAzcMNewxmgig5Ks0nkrSpBvSaQHMdKTBAnLojOdYyGpQ254602ZILPdTD1hdlggdIm74jbTp8vDwF5ZYUeLWGJpWsh6XNyXgcYwVoJQTEhhTYkxzZjiU5npU2TaB979TQehlaAVq4kaGpiPwwwLkYUuBbQwocyQTv1tA0+1UFWoJF3iv1oq+qoSk8EQdJmwHkziIF7oOZk14EGitibAdjLYYK78H5vZOhtWpoI0ATGHs0Q8OMb4Ey+2bU2UYztCtA0wFAs7TplGLRVQCcqaFdGSPCeTI1QNIC52iWNzof6Uib7xjEp07mNNoUYmVosVItHrHzRlLgBn9LFyRHaQCtVUMbtTNhoXWiTOO9k/V8BdAc1Oq0ArSQs6/5SU0hckNy9NnXqQY0PGYo5dWJ7nINaN6o958FWin27aBaWRka1r5myvLOAm0j30eBJqCxHLReVclxhxOEN2JfDWjxBtAC7MIH1fVaGdoOp4qJYDgKtKPSFNID2gSnGldrCqkFZ+5UeQXQBIRrSwocbdZYQT/2LwRahBPBXoHrB8nxaGROST62DKUbQOMMzZIC9abkuELfQzQALWTnDNAm8KHWFOJgJ5+SHIvTPcmx1xQyZRhNL5Qci689aXMEaN/uNIWkEwDAvFpOZmgsBaaGnbs1NPa1Jm32gBZAIh1pCtG7TSH4aE0y1uVY4uqoFPisGlpP2rSA5qTecWn5agK6BzSpgAyD+wFaqhnYoSZ1Vwr8CmlTQbrcO3ZaX0NAEyMbYaAlyquFoLKK3SPby9CeVUPThrSJmkCAE0CrKUQadi4DrdSlWhmah0YL9z9vClH59YGbHx1J8VZTyAjQepJjmXwAKTDQI3omc3p1U4gDUf6RfcdYfrUp5ClAi2J3Ba6UOXGo+K+bQrjjssitG2SJzshaLwMtXgRagUNpYYoVkMSBLM+9GGiJZMvduG6DRZ4qc04DMPtQQxOjEtACmhO7K1AbNbQDEggZyJwscFpAGwENhoBeUwh3bWolhe8BTYVKxQEWrSUn/uhcM5KhvUu/+eQu0Lzhi+VrK0PrZZNDQKs9cpYUuFYgMVpD4/NxenJTiMCNqdUEUf1qZWjppLT5qSkkUZbCwkbZMSuVnu80hfSkzRbQeqCZSAh6huR4VtoM2gHAlLf72smuWgE+VV7XpE25Ab2WFDgyhnSuKbs4GuGzCjR+tIoUuMFg3kgcWKLTwRqanJQ2W00hAsenfaApRC42hbCvK1SlE0HtE9BGgneJO+ELamitD1YjjOYnNYVcraGhtKkW0EqVVeDx733I2NH581k1NNxNLG0i0IJ8/NjVaOZ0tYZ2Vtr0Xv7tPV3hkWp9EFkgS/J0vosngTaSoaG06WHi+xObQkaAdlbanP8B2+2l0f90LmUAAAAASUVORK5CYII=); } 47 | -------------------------------------------------------------------------------- /client/app/controllers/main/download/download.html: -------------------------------------------------------------------------------- 1 | 2 |11 |3 |4 |10 |5 | 8 |
Easily integrate your code snippets and templates with sublime's snippet templates
9 |
12 |13 |32 |14 | Client Secret:{{downloadCtrl.activeUser.sublimeSecret}} 15 | 22 | assignment 23 | 24 | 25 |26 | 31 |33 |35 | 36 |
34 |37 |80 | 81 | -------------------------------------------------------------------------------- /client/js/tinymce/plugins/visualblocks/css/visualblocks.css: -------------------------------------------------------------------------------- 1 | .mce-visualblocks p { 2 | padding-top: 10px; 3 | border: 1px dashed #BBB; 4 | margin-left: 3px; 5 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); 6 | } 7 | 8 | .mce-visualblocks h1 { 9 | padding-top: 10px; 10 | border: 1px dashed #BBB; 11 | margin-left: 3px; 12 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); 13 | } 14 | 15 | .mce-visualblocks h2 { 16 | padding-top: 10px; 17 | border: 1px dashed #BBB; 18 | margin-left: 3px; 19 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); 20 | } 21 | 22 | .mce-visualblocks h3 { 23 | padding-top: 10px; 24 | border: 1px dashed #BBB; 25 | margin-left: 3px; 26 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); 27 | } 28 | 29 | .mce-visualblocks h4 { 30 | padding-top: 10px; 31 | border: 1px dashed #BBB; 32 | margin-left: 3px; 33 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); 34 | } 35 | 36 | .mce-visualblocks h5 { 37 | padding-top: 10px; 38 | border: 1px dashed #BBB; 39 | margin-left: 3px; 40 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); 41 | } 42 | 43 | .mce-visualblocks h6 { 44 | padding-top: 10px; 45 | border: 1px dashed #BBB; 46 | margin-left: 3px; 47 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); 48 | } 49 | 50 | .mce-visualblocks div:not([data-mce-bogus]) { 51 | padding-top: 10px; 52 | border: 1px dashed #BBB; 53 | margin-left: 3px; 54 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); 55 | } 56 | 57 | .mce-visualblocks section { 58 | padding-top: 10px; 59 | border: 1px dashed #BBB; 60 | margin: 0 0 1em 3px; 61 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); 62 | } 63 | 64 | .mce-visualblocks article { 65 | padding-top: 10px; 66 | border: 1px dashed #BBB; 67 | margin: 0 0 1em 3px; 68 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); 69 | } 70 | 71 | .mce-visualblocks blockquote { 72 | padding-top: 10px; 73 | border: 1px dashed #BBB; 74 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); 75 | } 76 | 77 | .mce-visualblocks address { 78 | padding-top: 10px; 79 | border: 1px dashed #BBB; 80 | margin: 0 0 1em 3px; 81 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); 82 | } 83 | 84 | .mce-visualblocks pre { 85 | padding-top: 10px; 86 | border: 1px dashed #BBB; 87 | margin-left: 3px; 88 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); 89 | } 90 | 91 | .mce-visualblocks figure { 92 | padding-top: 10px; 93 | border: 1px dashed #BBB; 94 | margin: 0 0 1em 3px; 95 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); 96 | } 97 | 98 | .mce-visualblocks hgroup { 99 | padding-top: 10px; 100 | border: 1px dashed #BBB; 101 | margin: 0 0 1em 3px; 102 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); 103 | } 104 | 105 | .mce-visualblocks aside { 106 | padding-top: 10px; 107 | border: 1px dashed #BBB; 108 | margin: 0 0 1em 3px; 109 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); 110 | } 111 | 112 | .mce-visualblocks figcaption { 113 | border: 1px dashed #BBB; 114 | } 115 | 116 | .mce-visualblocks ul { 117 | padding-top: 10px; 118 | border: 1px dashed #BBB; 119 | margin: 0 0 1em 3px; 120 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==) 121 | } 122 | 123 | .mce-visualblocks ol { 124 | padding-top: 10px; 125 | border: 1px dashed #BBB; 126 | margin: 0 0 1em 3px; 127 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); 128 | } 129 | 130 | .mce-visualblocks dl { 131 | padding-top: 10px; 132 | border: 1px dashed #BBB; 133 | margin: 0 0 1em 3px; 134 | background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); 135 | } 136 | --------------------------------------------------------------------------------Sublime Plugin Guide
38 |
39 |Automatic Installation (supported only on OS X)
40 |41 |
46 |- Download the compressed file below and unzip it in a local directory
42 |- Run the setup file by clicking on "setup.command" If this doesn't run in a terminal emulator, navigate to the folder in your terminal and run "./setup.command". (Modify the executable permissions by typing "chmod +x ./setup.command" in your terminal if this doesn't work)
43 |- A prompt will appear asking for your valid Nevercode client secret. Copy it above using the clipboard button, paste it into the setup script, and allow the script to run.
44 |- Once setup is complete, your Sublime Editor should now contain a "Nevercode" menu in Preferences with two options, "Sync with Nevercode" and "Input Client Secret"
45 |
47 |Manual Installation
48 |49 |
55 |- Copy the compressed zip file above to a local directory and decompress the file
50 |- Inside the uncompressed archive, there should be a file called "setup.sh" and a folder called "Nevercode". Copy the Nevercode folder into your Sublime's "Packages" folder.
51 |- Re-open Sublime and there should now be a "Nevercode Menu" with two options, "Sync with Nevercode" and "Input Client Secret". Click on "Input Client Secret" and an input box should appear at the bottom of your test editor
52 |- Copy the client secret on your account to your clipboard, pase it into the input field in Sublime, and then hit enter
53 |- A dialog box should appear indicating your client secret is valid. Once you see this, installation has completed.
54 |
56 |Syncing your local Snippets with Sublime
57 |58 |
62 |- Inside the "Nevercode" menu which is nested inside of "Preferences", click "Sync with Nevercode"
59 |- A new window should appear in sublime which indicates the progress of the plugin. Once it is completed, a dialog box should appear indicating the new snippets which have been downloaded locally and integrated with Sublime.
60 |- All shortcuts which are set in Nevercode are first prefixed with "NC_" are set as triggers for pasting the snippets into your code. So, for example, if you set a shortcut for a particular snippet to be "NchooseK", you could input this snippet into your text by typing "NC_NchooseK" then hitting the Tab button
61 |
63 |Uploading Snippet to Nevercode
64 |65 |
70 |- If you compose a snippet in Sublime and wish to upload it to your Nevercode account, highlight the code, right-click, and then click "Upload Selection to Nevercode". 66 |
- The input box should appear at the bottom of the page asking you to input a name for the file. Enter a name and then hit Enter.
67 |- Another input box should appear at the botom of the page asking for a shortcut. This will be the shortcut that you use in order to paste the code into your current open file. Enter a unique shortcut and then hit Enter.
68 |- A dialogue box should appear indicating the result of the upload. If sucessful, be sure to re-sync in order to store snippet locally. 69 |
71 |Resetting your Client Secret
72 |73 |
79 |- In the event that your client secret has been compromised, generate a new client secret by clicking the corresponding button on the Sublime plugin link page.
74 |- A new client secret should then appear. Copy the client secret to your clipboard and then open Sublime.
75 |- Open the "Nevercode" submenu nested inside of "Preferences" and click on "Input Client Secret"
76 |- An input box should appear at the bottom of the page with an old client secret. Erase it and paste your new client secret, then hit enter
77 |- A dialogue box should appear once the client secret is confirmed as valid by the server. Click OK to finish setting up your new secret
78 |