From 425254dbdda17ae0fff3e1258e227b73df8f6773 Mon Sep 17 00:00:00 2001 From: Rick Companje Date: Tue, 23 May 2017 23:08:26 +0200 Subject: [PATCH] pancakebot experiment using Doodle3D FileManager --- www/filemanager/index.html | 2 + www/filemanager/js/main.js | 203 +++++++++++++++++++++++++++++++++++++ 2 files changed, 205 insertions(+) diff --git a/www/filemanager/index.html b/www/filemanager/index.html index a55bcf0..f4eaa57 100644 --- a/www/filemanager/index.html +++ b/www/filemanager/index.html @@ -13,6 +13,8 @@ + +
diff --git a/www/filemanager/js/main.js b/www/filemanager/js/main.js index 6771203..c9f7ac8 100644 --- a/www/filemanager/js/main.js +++ b/www/filemanager/js/main.js @@ -24,6 +24,7 @@ $("#btnSelectAll").click(selectAll); $("#btnDeselectAll").click(deselectAll); $("#uploads").change(upload); $("#btnDownload").click(download); +$("#btnPancake").click(pancake); $("#btnUpload").click(function(e) { e.preventDefault(); @@ -88,12 +89,18 @@ function loadSketch(list,cb) { function addItem(id,svgData,doPrepend) { var path; +// console.log($getBoundingClientRect().width); + if (!svgData) path = ""; else if (typeof(svgData)!='string') path = ""; else if (svgData.indexOf("CDATA")==-1) path = ""; else path = svgData.split('d="')[1].split('"')[0]; + svgWidth = svgData.split("width=\"")[1].split("\"")[0]; + var item = $('
'); + item.attr("data-width",svgWidth); + var svg = ''; item.click(function() { @@ -265,3 +272,199 @@ function download() { }); } +function pointsToGCode(points) { + var gcode = ""; + var wasMove = false; + for (var i=0; i')[0].click(); +}