Add files via upload

Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
Mateiadrielrafael 2018-06-25 12:00:37 +03:00 committed by prescientmoon
parent 2953fc4918
commit 85ef8916af
Signed by: prescientmoon
SSH key fingerprint: SHA256:WFp/cO76nbarETAoQcQXuV+0h7XJsEsOCI0UsyPIy6U
12 changed files with 37 additions and 29 deletions

View file

@ -68,6 +68,8 @@
<option value = "nand3">Nand gate (3 inputs)</option> <option value = "nand3">Nand gate (3 inputs)</option>
<option value = "xor">Xor gate</option> <option value = "xor">Xor gate</option>
</select> </select>
Quantity:
<input id = "times" type = "number">
</div> </div>
<div class = "modal-footer"> <div class = "modal-footer">
<button type="button" onclick = '$("#addel").modal("hide"); addel();' class="btn btn-primmary" id = "done"> <button type="button" onclick = '$("#addel").modal("hide"); addel();' class="btn btn-primmary" id = "done">

View file

@ -75,7 +75,7 @@ function and(id){
function addclk(ob){ function addclk(ob){
var rep = ob.rep; var rep = ob.rep;
$((ob.img)).mousedown(function(e){ $((ob.img)).on("mousedown touchstart",function(e){
e.preventDefault(); e.preventDefault();
var svg = document.getElementById("svg1"); var svg = document.getElementById("svg1");
$(svg).append(ob.rep); $(svg).append(ob.rep);
@ -85,17 +85,17 @@ function addclk(ob){
$(svg).append($(ob.skin)); $(svg).append($(ob.skin));
selected = ob.id; selected = ob.id;
}); });
$((ob.img)).mouseup(function(e){ $((ob.img)).on("mouseup touchend",function(e){
selected = "yay"; selected = "yay";
}); });
} }
/* /*
function noname(ob){ function noname(ob){
$((ob.img)).mousedown(function(e){ $((ob.img)).on("mousedown touchstart",function(e){
selected = ob.id; selected = ob.id;
console.log("Clicked!!!"); console.log("Clicked!!!");
}); });
$((ob.img)).mouseup(function(e){ $((ob.img)).on("mouseup touchend",function(e){
selected = "yay"; selected = "yay";
}); });
} }

View file

@ -38,7 +38,7 @@ function but(id){
} }
function addevt(ob){ function addevt(ob){
/* /*
$((ob.rep)).click(function(){ $((ob.rep)).on("click touchstart",function(){
ob.val = (ob.val+1)%2; ob.val = (ob.val+1)%2;
if (ob.val){ if (ob.val){
$((ob.rep)).attr("fill","red"); $((ob.rep)).attr("fill","red");
@ -49,12 +49,12 @@ function addevt(ob){
}); });
*/ */
$((ob.rep)).mousedown(function(e){ $((ob.rep)).on("mousedown touchstart",function(e){
var svg = document.getElementById("svg1"); var svg = document.getElementById("svg1");
$(svg).append(ob.rep); $(svg).append(ob.rep);
$(svg).append($(ob.o.rep)); $(svg).append($(ob.o.rep));
selected = ob.id; selected = ob.id;
e.preventDefault();
if (ob.wait){ if (ob.wait){
ob.val = (ob.val+1)%2; ob.val = (ob.val+1)%2;
if (ob.val){ if (ob.val){
@ -66,7 +66,7 @@ function addevt(ob){
ob.wait = false; ob.wait = false;
} }
}); });
$((ob.rep)).mouseup(function(e){ $((ob.rep)).on("mouseup touchend",function(e){
selected = "yay"; selected = "yay";
ob.wait = true; ob.wait = true;
}); });

View file

@ -69,7 +69,8 @@ function edge(start,end){
} }
function rem_edge(ob){ function rem_edge(ob){
$((ob.rep)).click(function(e){ $((ob.rep)).on("click touchstart",function(e){
e.preventDefault();
//removing the edge from the array //removing the edge from the array
for (var i = 0; i < lines.length; i++) { for (var i = 0; i < lines.length; i++) {
if (lines[i] == (ob.id)) { if (lines[i] == (ob.id)) {

View file

@ -63,7 +63,7 @@ var xbeg = 0;
var ybeg = 0; var ybeg = 0;
var moveing = false; var moveing = false;
$("svg").mousemove(function(e){ $("svg").on("mousemove touchmove",function(e){
if (moveing && selected == "yay"){ if (moveing && selected == "yay"){
if (!(zooming)){ if (!(zooming)){
zooming = true; zooming = true;
@ -93,13 +93,13 @@ $("svg").mousemove(function(e){
}); });
$("svg").mousedown(function(e){ $("svg").on("mousedown touchstart",function(e){
//e.preventDefault(); //e.preventDefault();
moveing = true; moveing = true;
}); });
$("svg").mouseup(function(e){ $("svg").on("mouseup touchend",function(e){
e.preventDefault(); e.preventDefault();
selected = "yay"; selected = "yay";
zooming = false; zooming = false;

View file

@ -69,7 +69,8 @@ function light(id){
function addclk_light(ob){ function addclk_light(ob){
var rep = ob.rep; var rep = ob.rep;
$(ob.rep).mousedown(function(e){ $(ob.rep).on("mousedown touchstart",function(e){
e.preventDefault();
var svg = document.getElementById("svg1"); var svg = document.getElementById("svg1");
$(svg).append(ob.rep); $(svg).append(ob.rep);
$(svg).append($(ob.i.rep)); $(svg).append($(ob.i.rep));

View file

@ -21,7 +21,7 @@ var pieces = [];
var modal = add(40,40,"blue","black","butt",false); var modal = add(40,40,"blue","black","butt",false);
//adding the event for clicking //adding the event for clicking
$(modal).mousedown(function(e){ $(modal).on("mousedown touchstart",function(e){
//showing the modal //showing the modal
//actually 'modal' is just the button //actually 'modal' is just the button
@ -36,7 +36,7 @@ $(modal).mousedown(function(e){
}); });
//the event for finishing the drag and drop on the blue box //the event for finishing the drag and drop on the blue box
$(modal).mouseup(function(e){ $(modal).on("mouseup touchend",function(e){
//telling that we dont want to drag it anymore //telling that we dont want to drag it anymore
selected = "yay"; selected = "yay";
}); });
@ -60,7 +60,9 @@ function getname(){
//the function that fires when you tap 'add' //the function that fires when you tap 'add'
function addel(){ function addel(){
for (var i = 0;i < parseFloat($("#times").val());i++){
var added = eval("new "+$("#sel option:selected").attr("value")+"(getname())"); var added = eval("new "+$("#sel option:selected").attr("value")+"(getname())");
}
} }
@ -69,14 +71,14 @@ function addel(){
//================================preventing deafult actions========================== //================================preventing deafult actions==========================
//nothing to say here //nothing to say here
$("img,rect,circle,p,foreignObject").mousedown(function(e){ $("img,rect,circle,p,foreignObject").on("mousedown touchstart",function(e){
e.preventDefault(); e.preventDefault();
}); });
$("*").mouseup(function(e){ $("*").on("mouseup touchend",function(e){
e.preventDefault(); e.preventDefault();
moveing = false; moveing = false;
}); });
$("img").click(function(e){ $("img").on("click touchstart",function(e){
e.preventDefault(); e.preventDefault();
}); });
@ -103,15 +105,15 @@ let snap = false;
//nothing to say here... //nothing to say here...
//just some basic things //just some basic things
$("body").mousemove(function(e){ $("body").on("mousemove touchmove",function(e){
//calling the drag function //calling the drag function
drag(e,selected); drag(e,selected);
}); });
$("body").mouseup(function(e){ $("body").on("mouseup touchend",function(e){
selected = "yay"; selected = "yay";
console.log("got a mouse up"); console.log("got a mouse up");
}); });
$("body").mousedown(function(e){ $("body").on("mousedown touchstart",function(e){
//beeing sure that we actually want to drag something //beeing sure that we actually want to drag something
if (selected!="yay"){ if (selected!="yay"){

View file

@ -76,7 +76,8 @@ function nand3(id){
function clk(ob,arr){ function clk(ob,arr){
var rep = ob.rep; var rep = ob.rep;
$((ob.img)).mousedown(function(e){ $((ob.img)).on("mousedown touchstart",function(e){
e.preventDefault();
var svg = document.getElementById("svg1"); var svg = document.getElementById("svg1");
$(svg).append(ob.rep); $(svg).append(ob.rep);
$(svg).append($(ob.pin1.rep)); $(svg).append($(ob.pin1.rep));
@ -86,7 +87,7 @@ function clk(ob,arr){
$(svg).append($(ob.skin)); $(svg).append($(ob.skin));
selected = ob.id; selected = ob.id;
}); });
$((ob.img)).mouseup(function(e){ $((ob.img)).on("mouseup touchend",function(e){
selected = "yay"; selected = "yay";
}); });
} }

View file

@ -73,7 +73,7 @@ function not(id){
function addclk11(ob){ function addclk11(ob){
var rep = ob.rep; var rep = ob.rep;
$((ob.img)).mousedown(function(e){ $((ob.img)).on("mousedown touchstart",function(e){
e.preventDefault(); e.preventDefault();
var svg = document.getElementById("svg1"); var svg = document.getElementById("svg1");
$(svg).append(ob.rep); $(svg).append(ob.rep);
@ -82,7 +82,7 @@ function addclk11(ob){
$(svg).append($(ob.skin)); $(svg).append($(ob.skin));
selected = ob.id; selected = ob.id;
}); });
$((ob.img)).mouseup(function(e){ $((ob.img)).on("mouseup touchend",function(e){
selected = "yay"; selected = "yay";
}); });
} }

View file

@ -75,7 +75,7 @@ function or(id){
/* /*
function addclk(ob){ function addclk(ob){
var rep = ob.rep; var rep = ob.rep;
$(ob.rep).mousedown(function(e){ $(ob.rep).on("mousedown touchstart",function(e){
var svg = document.getElementById("svg1"); var svg = document.getElementById("svg1");
$(svg).append(ob.rep); $(svg).append(ob.rep);
$(svg).append($(ob.pin1.rep)); $(svg).append($(ob.pin1.rep));

View file

@ -46,7 +46,8 @@ function pin(type){
} }
function clicked(ob){ function clicked(ob){
$(ob.rep).click(function(e){ $(ob.rep).on("click touchstart",function(e){
e.preventDefault();
if (ob.type == true){ if (ob.type == true){
sels = ob; sels = ob;
} }

View file

@ -26,7 +26,7 @@ function text(parent,value){
var elem = document.getElementById("svg1"); var elem = document.getElementById("svg1");
elem.appendChild(g); elem.appendChild(g);
this.rep = el; this.rep = el;
$((this.rep)).click(function(e){ $((this.rep)).on("click touchstart",function(e){
e.preventDefault(); e.preventDefault();
}); });