-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathChooseScene.qml
98 lines (78 loc) · 2.71 KB
/
ChooseScene.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import qmlweb.components
Item {
//text: "http://pavelvasev.github.io/qmlweb.run/"
id: scen
Text {
font.pixelSize:15
text: "Qmlweb.Run"
x: cols.x
y: parent.height/4
}
Column {
anchors.horizontalCenter: parent.horizontalCenter
y: parent.height/3
spacing: 10
id: cols
Row {
spacing: 7
TextField {
id: inp
placeholderText: "Enter URL to qml file (links to github files are allowed)"
width: 500
onAccepted: btn.clicked()
}
Button {
id: btn
text: inp.text && inp.text.length > 30 ? "GO" : "Go"
width:100
onClicked: {
var dpos = window.location.href.indexOf("#");
var loc = dpos >= 0 ? window.location.href.slice( 0, dpos) : window.location.href;
var s = loc.replace("s--","q--");
s = s.replace("s=","sold=");
window.open( s + "?s=" + encodeURIComponent(inp.text) );
}
}
}
Row {
spacing: 5
Text {
y: 3
text: "Examples:"
}
Button {
width: 100
text: "QmlWeb tests"
onClicked: inp.text = "QmlwebTestsViewer.qml";
}
Button {
width: 180
text: "Qmlweb.components tests"
onClicked: {
inp.text = "https://github.com/pavelvasev/qmlweb.components/blob/master/src/test/Index.qml"
}
}
Button {
width: 90
text: "Gist red rect"
onClicked: {
inp.text = "https://gist.github.com/pavelvasev/21659c30797720842cee"
}
}
Button {
width: 100
text: "movie maker"
onClicked: {
inp.text = "https://github.com/pavelvasev/simple_movie_maker/blob/gh-pages/Maker.qml"
}
}
} // row of tests
Text {
property var tag: "left"
font.pixelSize: 12
text: "Qmlweb.Run may run links from github and <a target='_blank' href='https://gist.github.com/'>gist</a>.\n"+
"Use this JS-bookmark to run file in Qmlweb.Run: "+
"<a href='javascript:(function(){window.location.href=\"http://pavelvasev.github.io/qmlweb.run/?s=\"+window.location.href.toString(); } )()'>See in Qmlweb.Run</a>"
}
} // column
}