mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Closing save dialogue and starting on popout for control panels.
This commit is contained in:
parent
9d33e16ccd
commit
12aa1bb166
10
gui.js
10
gui.js
@ -89,6 +89,16 @@ var GUI = function() {
|
|||||||
|
|
||||||
var my, pmy, mx, pmx;
|
var my, pmy, mx, pmx;
|
||||||
|
|
||||||
|
this.popout = function(e) {
|
||||||
|
|
||||||
|
var w = window.open("index.html",
|
||||||
|
"mywindow",
|
||||||
|
"location=1,status=1,scrollbars=1,width=100,height=100");
|
||||||
|
w.document.title = "gui-dat";
|
||||||
|
console.log(w.document);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
var resize = function(e) {
|
var resize = function(e) {
|
||||||
pmy = my;
|
pmy = my;
|
||||||
pmx = mx;
|
pmx = mx;
|
||||||
|
@ -23,7 +23,9 @@
|
|||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
var timer;
|
var timer;
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
|
|
||||||
GUI.loadJSON({"guis":[{"open":true,"width":280,"openHeight":319,"scroll":0,"values":["gui-dat",1.35,7,0.5425,0.4132,10,false,null,0,null],"timer":{"windowMin":-4225.189783755155,"windowWidth":11596,"playhead":1704,"snapIncrement":250,"useSnap":true,"scrubbers":[{"points":[{"value":"gui-dat","time":-3250},{"value":"over","time":5500},{"value":"time","time":9750}]},{"points":[{"value":1.3499999999999999,"time":644.1387},{"value":1.3499999999999999,"time":9750,"tween":"CircularEaseIn"}]},{"points":[{"value":0,"time":-2750,"tween":"SinusoidalEaseInOut"},{"value":7,"time":659.1556},{"value":7,"time":2211.2348},{"value":5.525,"time":5500},{"value":8.955,"time":6413.8663},{"value":8.339963195382083,"time":12000,"tween":"SinusoidalEaseInOut"},{"value":0,"time":16500}]},{"points":[{"value":0.5049,"time":-532.8902,"tween":"Hold"},{"value":0.5544,"time":1666.4321},{"value":0.01,"time":3382.0743,"tween":"Hold"},{"value":0.9900000000000001,"time":5500},{"value":0.18810000000000002,"time":9500,"tween":"Hold"},{"value":0.3069,"time":9750},{"value":0.1683,"time":11000},{"value":0.0495,"time":11750}]},{"points":[{"value":0.39899999999999997,"time":1652.5592,"tween":"SinusoidalEaseInOut"},{"value":7.6000000000000005,"time":3471.5432,"tween":"Hold"},{"value":0.8,"time":5500},{"value":1.3,"time":6000},{"value":0.1,"time":9750},{"value":0.01,"time":11500,"tween":"SinusoidalEaseInOut"},{"value":1.9000000000000001,"time":15250}]},{"points":[{"value":10,"time":795.5192,"tween":"Hold"},{"value":10,"time":5500},{"value":75,"time":5500,"tween":"CircularEaseOut"},{"value":45,"time":9750}]},{"points":[]},{"points":[{"time":9750}]},{"points":[{"value":0,"time":250,"tween":"Hold"}]},{"points":[{"time":18250}]}]}},{"open":true,"width":280,"openHeight":127,"scroll":0,"values":[null,true,250,null]}]});
|
GUI.loadJSON({"guis":[{"open":true,"width":280,"openHeight":319,"scroll":0,"values":["gui-dat",1.35,7,0.5425,0.4132,10,false,null,0,null],"timer":{"windowMin":-4225.189783755155,"windowWidth":11596,"playhead":1704,"snapIncrement":250,"useSnap":true,"scrubbers":[{"points":[{"value":"gui-dat","time":-3250},{"value":"over","time":5500},{"value":"time","time":9750}]},{"points":[{"value":1.3499999999999999,"time":644.1387},{"value":1.3499999999999999,"time":9750,"tween":"CircularEaseIn"}]},{"points":[{"value":0,"time":-2750,"tween":"SinusoidalEaseInOut"},{"value":7,"time":659.1556},{"value":7,"time":2211.2348},{"value":5.525,"time":5500},{"value":8.955,"time":6413.8663},{"value":8.339963195382083,"time":12000,"tween":"SinusoidalEaseInOut"},{"value":0,"time":16500}]},{"points":[{"value":0.5049,"time":-532.8902,"tween":"Hold"},{"value":0.5544,"time":1666.4321},{"value":0.01,"time":3382.0743,"tween":"Hold"},{"value":0.9900000000000001,"time":5500},{"value":0.18810000000000002,"time":9500,"tween":"Hold"},{"value":0.3069,"time":9750},{"value":0.1683,"time":11000},{"value":0.0495,"time":11750}]},{"points":[{"value":0.39899999999999997,"time":1652.5592,"tween":"SinusoidalEaseInOut"},{"value":7.6000000000000005,"time":3471.5432,"tween":"Hold"},{"value":0.8,"time":5500},{"value":1.3,"time":6000},{"value":0.1,"time":9750},{"value":0.01,"time":11500,"tween":"SinusoidalEaseInOut"},{"value":1.9000000000000001,"time":15250}]},{"points":[{"value":10,"time":795.5192,"tween":"Hold"},{"value":10,"time":5500},{"value":75,"time":5500,"tween":"CircularEaseOut"},{"value":45,"time":9750}]},{"points":[]},{"points":[{"time":9750}]},{"points":[{"value":0,"time":250,"tween":"Hold"}]},{"points":[{"time":18250}]}]}},{"open":true,"width":280,"openHeight":127,"scroll":0,"values":[null,true,250,null]}]});
|
||||||
|
|
||||||
var fizzyText = new FizzyText("gui-dat");
|
var fizzyText = new FizzyText("gui-dat");
|
||||||
|
|
||||||
var gui = new GUI();
|
var gui = new GUI();
|
||||||
@ -53,6 +55,7 @@
|
|||||||
gui.add(fizzyText, "explode");
|
gui.add(fizzyText, "explode");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
timerControls.add(timer, "playPause");
|
timerControls.add(timer, "playPause");
|
||||||
timerControls.add(timer, "useSnap");
|
timerControls.add(timer, "useSnap");
|
||||||
timerControls.add(timer, "snapIncrement");
|
timerControls.add(timer, "snapIncrement");
|
||||||
@ -66,9 +69,6 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gui.add(fizzyText, 'y', -500, 500);
|
gui.add(fizzyText, 'y', -500, 500);
|
||||||
|
|
||||||
|
|
||||||
|
@ -608,7 +608,6 @@ GUI.ScrubberPoint = function(scrubber, time, value) {
|
|||||||
g.strokeStyle='#222';
|
g.strokeStyle='#222';
|
||||||
|
|
||||||
if (p != null && p.time < timer.windowMin) {
|
if (p != null && p.time < timer.windowMin) {
|
||||||
console.log(p.time, timer.windowMin);
|
|
||||||
var t = GUI.map(timer.windowMin, p.time, this.time, 0, 1);
|
var t = GUI.map(timer.windowMin, p.time, this.time, 0, 1);
|
||||||
var yy = GUI.map(p.tween(t), 0, 1, p.y, y);
|
var yy = GUI.map(p.tween(t), 0, 1, p.y, y);
|
||||||
|
|
||||||
|
@ -32,6 +32,10 @@ GUI.getJSON = function() {
|
|||||||
return {guis:guis};
|
return {guis:guis};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GUI.closeSave = function() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
GUI.save = function() {
|
GUI.save = function() {
|
||||||
|
|
||||||
var jsonString = JSON.stringify(GUI.getJSON());
|
var jsonString = JSON.stringify(GUI.getJSON());
|
||||||
@ -47,17 +51,27 @@ GUI.save = function() {
|
|||||||
span2.innerHTML = '… or paste this into the beginning of your source:';
|
span2.innerHTML = '… or paste this into the beginning of your source:';
|
||||||
|
|
||||||
var textarea = document.createElement('textarea');
|
var textarea = document.createElement('textarea');
|
||||||
textarea.setAttribute('disabled', 'true');
|
//textarea.setAttribute('disabled', 'true');
|
||||||
textarea.innerHTML += 'GUI.loadJSON('+jsonString+');';
|
textarea.innerHTML += 'GUI.loadJSON('+jsonString+');';
|
||||||
|
|
||||||
//textarea.select();
|
var close = document.createElement('div');
|
||||||
|
close.setAttribute('id', 'guidat-save-dialogue-close');
|
||||||
|
close.addEventListener('click', function() {
|
||||||
|
GUI.closeSave();
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
|
||||||
dialogue.appendChild(a);
|
dialogue.appendChild(a);
|
||||||
dialogue.appendChild(span2);
|
dialogue.appendChild(span2);
|
||||||
dialogue.appendChild(textarea);
|
dialogue.appendChild(textarea);
|
||||||
|
|
||||||
document.body.appendChild(dialogue);
|
document.body.appendChild(dialogue);
|
||||||
|
|
||||||
|
textarea.addEventListener('click', function() {
|
||||||
|
this.select();
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user