diff --git a/main.spec b/main.spec index 40100e6..e10641f 100644 --- a/main.spec +++ b/main.spec @@ -5,7 +5,7 @@ block_cipher = None a = Analysis(['main.py'], - pathex=['S:\\SIGHTPLACE\\DEV'], + pathex=['S:\\SIGHTPLACE\\DEV\\sightplace-rep'], binaries=[], datas=[], hiddenimports=[], diff --git a/place/js/sight.js b/place/js/sight.js index 2971ee8..6fb27fe 100644 --- a/place/js/sight.js +++ b/place/js/sight.js @@ -4,13 +4,57 @@ if(navigator.userAgent.indexOf("QtWebEngine") > 0) { window.sight = channel.objects.handler; }); } +/* +function docReady(fn) { + if(document.readyState === "complete" || document.readyState === "interactive") { + setTimeout(fn, 1); + } else { + setTimeout(fn, 2); + document.addEventListener("DOMContentLoaded", fn); + } +} + + + document.querySelectorAll('a').forEach(link => { + link.onclick = function() { alert("ss"); } + + link.addEventListener("click", (e) => { + e.preventDefault(); + alert("sds"); + }); + }); + +document.addEventListener('DOMContentLoaded', (event) => { + + + document.querySelectorAll('#screate').forEach(link => { + alert("1"); + link.addEventListener("click", (e) => { + alert("sds"); + }); + }); + + + const screate = document.getElementById("screate"); + screate.addEventListener("click",myFunc); + + document.getElementById("screate").onclick = e => { + alert("ss") + } +});*/ +/* +document.getElementById("screate").onclick = e => { + alert("ss") +}*/ + +/*const screate = document;*/ (function ( $ ) { $.fn.s_create = function() { $(document).on( "click", "#screate", function() { event.preventDefault(); window.sight.create($(this).data("id"), $(this).data("type"), function(sight_id) { - /*alert(sight_id)*/ + }); }) }; @@ -131,13 +175,29 @@ function sclose() { function setTitle(title) { $("#stitle").text(title); } + $(document).ready(function(){ // LOAD the contents into the Sight if (typeof s_contents !== 'undefined') { for ( const [id_name,content_folder] of Object.entries( s_contents ) ) { $("#"+id_name).load("content/"+content_folder+"/content.html"); + /*$("#"+id_name).load("content/"+content_folder+"/content.html", function() { + document.querySelectorAll('#screate').forEach(link => { + link.addEventListener("click", (e) => { + e.preventDefault(); + window.sight.create(e.target.dataset.id, e.target.dataset.type, function(sight_id) { + + }); + }); + }); + });*/ + } } + + + + // INIT the Sight from init_sight variable if (typeof init_sight !== 'undefined') { diff --git a/place/js/sight.js.bak b/place/js/sight.js.bak index 6ab0db4..3686b66 100644 --- a/place/js/sight.js.bak +++ b/place/js/sight.js.bak @@ -4,17 +4,60 @@ if(navigator.userAgent.indexOf("QtWebEngine") > 0) { window.sight = channel.objects.handler; }); } +/* +function docReady(fn) { + if(document.readyState === "complete" || document.readyState === "interactive") { + setTimeout(fn, 1); + } else { + setTimeout(fn, 2); + document.addEventListener("DOMContentLoaded", fn); + } +} + + + document.querySelectorAll('a').forEach(link => { + link.onclick = function() { alert("ss"); } + + link.addEventListener("click", (e) => { + e.preventDefault(); + alert("sds"); + }); + }); + +document.addEventListener('DOMContentLoaded', (event) => { + + + document.querySelectorAll('#screate').forEach(link => { + alert("1"); + link.addEventListener("click", (e) => { + alert("sds"); + }); + }); + + + const screate = document.getElementById("screate"); + screate.addEventListener("click",myFunc); + + document.getElementById("screate").onclick = e => { + alert("ss") + } +});*/ +/* +document.getElementById("screate").onclick = e => { + alert("ss") +}*/ + +/*const screate = document;*/ (function ( $ ) { - $.fn.s_create = function() { +/* $.fn.s_create = function() { $(document).on( "click", "#screate", function() { event.preventDefault(); - var data_id = "" - window.sight.create(data_id, $(this).data("type"), function(sight_id) { - /*alert(sight_id)*/ + window.sight.create($(this).data("id"), $(this).data("type"), function(sight_id) { + }); }) - }; + };*/ $.fn.s_close = function() { $("body").on( "click", "#sclose", function() { event.preventDefault(); @@ -132,13 +175,29 @@ function sclose() { function setTitle(title) { $("#stitle").text(title); } + $(document).ready(function(){ // LOAD the contents into the Sight if (typeof s_contents !== 'undefined') { for ( const [id_name,content_folder] of Object.entries( s_contents ) ) { - $("#"+id_name).load("content/"+content_folder+"/content.html"); + /*$("#"+id_name).load("content/"+content_folder+"/content.html");*/ + $("#"+id_name).load("content/"+content_folder+"/content.html", function() { + document.querySelectorAll('#screate').forEach(link => { + link.addEventListener("click", (e) => { + e.preventDefault(); + window.sight.create(e.target.dataset.id, e.target.dataset.type, function(sight_id) { + + }); + }); + }); + }); + } } + + + + // INIT the Sight from init_sight variable if (typeof init_sight !== 'undefined') { @@ -195,7 +254,7 @@ $(document).ready(function(){ });*/ // INIT END - $( "#screate" ).s_create(); + /*$( "#screate" ).s_create();*/ $( "#sclose" ).s_close(); $( "#sexit" ).s_exit(); $( "#smaximized" ).s_maximized(); diff --git a/place/templates/base/content/main/content.html.bak b/place/templates/base/content/main/content.html.bak index 1cfc492..1362572 100644 --- a/place/templates/base/content/main/content.html.bak +++ b/place/templates/base/content/main/content.html.bak @@ -1 +1,2 @@ -Create an "Other" sight! \ No newline at end of file +Create an "Other" sight! +test \ No newline at end of file diff --git a/place/templates/base/main.html.bak b/place/templates/base/main.html.bak index c756937..56f730f 100644 --- a/place/templates/base/main.html.bak +++ b/place/templates/base/main.html.bak @@ -16,8 +16,8 @@ @@ -30,6 +30,7 @@
+ Open the main inside this sight!
MAIN