From edcb766b63694948b91094995ca7720c1ea222c3 Mon Sep 17 00:00:00 2001 From: Jason Croft Date: Fri, 13 May 2016 10:00:34 -0400 Subject: [PATCH] Apply "snippets_enabled only" logic to import modal. Better parsing for snippet import. Add python filetype. --- public/js/index.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/public/js/index.js b/public/js/index.js index fbaf95f..a1e0445 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -250,8 +250,9 @@ var fileTypes = { "php": "php", "sh": "bash", "rb": "ruby", - "html": "html" -} + "html": "html", + "py": "python" +}; //editor settings var textit = document.getElementById("textit"); @@ -1248,6 +1249,9 @@ ui.toolbar.import.snippet.click(function () { return (a.path_with_namespace < b.path_with_namespace) ? -1 : ((a.path_with_namespace > b.path_with_namespace) ? 1 : 0); }); data.projects.forEach(function(project) { + if (!project.snippets_enabled) { + return; + } $('