mirror of
https://github.com/gmemstr/notdonemywebsite.git
synced 2024-09-19 13:41:10 +01:00
hotfix/add_color - wip
This commit is contained in:
parent
a9fa98b62c
commit
18a4b4f428
|
@ -8,7 +8,14 @@ var getTemplateHtml = template => {
|
||||||
})
|
})
|
||||||
.then(function(html) {
|
.then(function(html) {
|
||||||
document.getElementById('iframe').contentWindow.document.write(html);
|
document.getElementById('iframe').contentWindow.document.write(html);
|
||||||
console.log(document.getElementById('iframe').contentWindow.document)
|
// console.log(document.getElementById('iframe').contentWindow.document)
|
||||||
|
|
||||||
|
var elements = document.getElementById('iframe').contentWindow.document.querySelectorAll("body *");
|
||||||
|
var numElements = elements.length;
|
||||||
|
var i;
|
||||||
|
for (i = 0; i < numElements; i++) {
|
||||||
|
elements[i].addEventListener("click", addColorTrigger);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +25,12 @@ var valueChange = value => {
|
||||||
iframehtml.innerHTML = val
|
iframehtml.innerHTML = val
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var addColorTrigger = (e) => {
|
||||||
|
console.log("click");
|
||||||
|
console.log(e.currentTarget);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
var downloadPage = () => {
|
var downloadPage = () => {
|
||||||
var pageContents = new XMLSerializer().serializeToString(document.getElementById('iframe').contentWindow.document)
|
var pageContents = new XMLSerializer().serializeToString(document.getElementById('iframe').contentWindow.document)
|
||||||
pageContents = pageContents.replace("rep_DEVNAME", document.getElementById("devname").value)
|
pageContents = pageContents.replace("rep_DEVNAME", document.getElementById("devname").value)
|
||||||
|
|
|
@ -22,11 +22,11 @@
|
||||||
<button class="themebtn" id="material" onclick="getTemplateHtml('material')">Material</button>
|
<button class="themebtn" id="material" onclick="getTemplateHtml('material')">Material</button>
|
||||||
</div>
|
</div>
|
||||||
<!-- Colour inputs -->
|
<!-- Colour inputs -->
|
||||||
<!-- <div id="themeclrs">
|
<div id="themeclrs">
|
||||||
<h2>Colours</h2>
|
<h2>Colours</h2>
|
||||||
<input type="color" class="themeclr" id="primary">
|
<input type="color" class="themeclr" id="primary">
|
||||||
<input type="color" class="themeclr" id="secondary">
|
<input type="color" class="themeclr" id="secondary">
|
||||||
</div> -->
|
</div>
|
||||||
<div id="inputs">
|
<div id="inputs">
|
||||||
<h2>Values</h2>
|
<h2>Values</h2>
|
||||||
<label for="sitename">Site name</label>
|
<label for="sitename">Site name</label>
|
||||||
|
|
Loading…
Reference in a new issue