From bda3a99797df33f8bff48960318b14a0d81c52a3 Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 16 Apr 2025 01:04:34 +0100 Subject: remove .pyc files --- site/app/twist/index.html | 2 ++ site/app/twist/twist.js | 30 +++++++++++++++++++++++++++++- site/app/twist/twist_ui.js | 12 ++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) (limited to 'site/app/twist') diff --git a/site/app/twist/index.html b/site/app/twist/index.html index 4652991..c629b31 100644 --- a/site/app/twist/index.html +++ b/site/app/twist/index.html @@ -90,6 +90,8 @@ diff --git a/site/app/twist/twist.js b/site/app/twist/twist.js index a7a248c..515235c 100644 --- a/site/app/twist/twist.js +++ b/site/app/twist/twist.js @@ -108,7 +108,7 @@ var Twist = function() { }; } - twist.version = 1; + twist.version = 1.1; this.currentTransform = null; var errorState; var instanceIndex = 0; @@ -967,6 +967,34 @@ var Twist = function() { app.insertScore("twst_getbuffers", [0, 1, cbid]); }; + this.loadFileFromURL = async function(url, name, onComplete) { + if (!name) name = url.split("/").reverse()[0]; + await app.copyUrlToLocal(url, name); + var cbid = app.createCallback(async function(ndata){ + twirl.loading.hide(); + if (ndata.status > 0) { + if (waveformTabs.length == 0) { + self.createNewInstance(true); + instanceIndex = 0; + } + self.waveformTab.text(name); + await globalCallbackHandler(ndata); + waveformFiles[instanceIndex] = name; + waveformLoaded[instanceIndex] = true; + } else if (ndata.status == -1) { + twirl.prompt.show("File not valid"); + } else if (ndata.status == -2) { + twirl.prompt.show("File too large"); + } else { + twirl.prompt.show("File loading error"); + } + if (onComplete) { + onComplete(ndata); + } + }); + app.insertScore("twst_loadfile", [0, 1, name]); + }; + this.loadFileFromClipboard = function() { if (!twist.hasClipboard) { return twirl.prompt.show("Cannot create: clipboard is empty"); diff --git a/site/app/twist/twist_ui.js b/site/app/twist/twist_ui.js index 08e5fe1..15e7b44 100644 --- a/site/app/twist/twist_ui.js +++ b/site/app/twist/twist_ui.js @@ -143,6 +143,9 @@ var twistTopMenuData = [ {name: "Help", click: function(twist){ $("#twist_documentation")[0].click(); }}, + {name: "Walkthrough video", click: function(twist){ + $("#twist_video")[0].click(); + }}, {name: "Developer reference", click: function(twist){ $("#twist_developer_documentation")[0].click(); }}, @@ -155,6 +158,9 @@ var twistTopMenuData = [ {name: "Submit transform code", click: function(twist){ $("#twist_developer_submit")[0].click(); }}, + {name: "Source code", click: function(twist){ + $("#twist_sourcecode")[0].click(); + }}, {name: "About", click: function(twist) { twist.ui.showAbout(); }}, @@ -474,6 +480,12 @@ var TwistUI = function(twist) { }); }; + this.globalFiles = function() { + //twirl.getSharedFiles(); + + //"/sounddb/" + path + }; + this.developerConsole = function() { $("#twist_developer").show(); $("#twist_inject_devcsound").click(async function() { -- cgit v1.2.3