Code: Select all
Gui Add, ActiveX, vWB w500 h500, Shell.Explorer
WB.Navigate("about:blank") ; We first navigate to an empty page
; Now we need to write the html code
html =
(
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" charset="utf-8">
<title>title</title>
<style>
#videourl {
display: inline;
flex-flow: column nowrap;
position: fixed;
padding: 5px 5px 5px 5px;
}
div.row {
display: inline;
flex-flow: row nowrap;
height: 100`%;
}
div.url {
margin: 14px 14px;
width: 100px;
height: 150px;
</style>
</head>
<body>
<ul id="title">
<div></div>
</ul>
<ul id="videourl">
<div class="row"></div>
</ul>
</body>
</html>
)
GUI, New
GUI Add, ActiveX, vAXWrapperObject xm y30 w550 h775, about:<!DOCTYPE html><meta http-equiv="X-UA-Compatible" content="IE=edge" charset="utf-8">
doc := AXWrapperObject.document
doc.write(html)
urls := doc.getElementsByClassName("url")
;<><><><><><><><><><><><><><><><><><><>
GUI, +Resize
GUI, Margin, 5, 5
GUI Add, Button, x5 y5 w100 gpushURL, Add Video
Gui, Add, Button, x400 y5 w10, Delete
;Gui, Add, Button, x450 y5 w10, Save
Gui, add, button,gSubmit x500 y5,&Set
Gui, Add, Edit, x150 y5 w250 vSubmit, Enter Title
GUI, Show
rowMax := 5, columnMax := 5
rowCurrent := 0, columnCurrent := 0
cells := rowMax * columnMax
return
GUISize: ; https://www.autohotkey.com/docs/commands/Gui.htm#GuiSize
GuiControl, Move, MyButton, % "w" A_GuiWidth - 10
GuiControl, Move, AXWrapperObject, % "w" A_GuiWidth - 10 "h" A_GuiHeight - 40 ; resize the control so that it fits the new GUI dimensions
return
pushURL:
if not (urls.length < cells)
return
playlist := "https://www.youtube.com/embed/QM8jQHE5AAk"
url := "<iframe src=""" . playlist . """></iframe>"
;url := "<iframe src=""" . playlist . """></iframe>"
;url := "<iframe src=""http://www.youtube.com/embed/" . video . """></iframe>"
;url := "<iframe src=""" . playlist . "" . video . """></iframe>"
;url := "<iframe src="" . http://www.youtube.com/embed/QM8jQHE5AAk . ""></iframe>"
if (columnCurrent < columnMax) {
Gosub, subLabel
return
} else {
columnCurrent := 0
doc.getElementById("videourl").innerHTML .= "<div class='row'></div>" ; create a new row
rowCurrent++
}
subLabel:
doc.getElementsByClassName("row")[rowCurrent].innerHTML .= "<div class='url'>" . url . "" ; create a new column
columnCurrent++
return
set:
Submit: