Skip to content

Commit d35218a

Browse files
committed
Publish
1 parent 032d9df commit d35218a

449 files changed

Lines changed: 331540 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.DS_Store

8 KB
Binary file not shown.

ex1.htm

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
5+
<title>basic.js Code Editor</title>
6+
7+
<meta charset="UTF-8">
8+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
9+
10+
<!-- LIBRARY FILES -->
11+
<script src="library/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
12+
<link rel="stylesheet" type="text/css" href="library/basic.min.css">
13+
<script src="library/basic.min.js" type="text/javascript" charset="utf-8"></script>
14+
<script src="js/basic-editor.js" type="text/javascript" charset="utf-8"></script>
15+
16+
<style>
17+
18+
body {
19+
overflow: hidden;
20+
}
21+
22+
.editor {
23+
24+
position:absolute;
25+
margin:0px;
26+
border-radius: 6px;
27+
font-size: 11px;
28+
29+
}
30+
31+
</style>
32+
33+
<script>
34+
35+
var start = function() {
36+
37+
basicEditor.create(document.getElementById("code-example").innerHTML);
38+
39+
}
40+
41+
</script>
42+
43+
</head>
44+
<body>
45+
46+
<div id="code-example" style="display:none">
47+
// VARIABLES
48+
49+
var btnBlue
50+
51+
// SPECIAL FUNCTIONS
52+
53+
// First running function.
54+
var start = function() {
55+
56+
// BUTTON: First Button. Parameters: (left, top, width, height)
57+
btnBlue = createButton(40, 40, 180, 50)
58+
that.text = "First Button"
59+
that.minimal = 1
60+
//that.color = "orangered"
61+
62+
that.onClick(printHelloWorld)
63+
64+
}
65+
66+
// OTHER FUNCTIONS
67+
68+
var printHelloWorld = function() {
69+
70+
print("Hello World")
71+
72+
}
73+
</div>
74+
75+
</body>
76+
</html>

ex10.htm

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
5+
<title>basic.js Code Editor</title>
6+
7+
<meta charset="UTF-8">
8+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
9+
10+
<!-- LIBRARY FILES -->
11+
<script src="library/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
12+
<link rel="stylesheet" type="text/css" href="library/basic.min.css">
13+
<script src="library/basic.min.js" type="text/javascript" charset="utf-8"></script>
14+
<script src="js/basic-editor.js" type="text/javascript" charset="utf-8"></script>
15+
16+
<style>
17+
18+
body {
19+
overflow: hidden;
20+
}
21+
22+
.editor {
23+
24+
position:absolute;
25+
margin:0px;
26+
border-radius: 6px;
27+
font-size: 11px;
28+
29+
}
30+
31+
</style>
32+
33+
<script>
34+
35+
var start = function() {
36+
37+
basicEditor.create(document.getElementById("code-example").innerHTML);
38+
39+
}
40+
41+
</script>
42+
43+
</head>
44+
<body>
45+
46+
<div id="code-example" style="display:none">
47+
var plantDataList = [
48+
{ id: "1", name: "Broccoli", description: "Vegetable", filePath: "images/broccoli.png" },
49+
{ id: "2", name: "Strawberry", description: "Fruit", filePath: "images/strawberry.png" },
50+
{ id: "3", name: "Carrot", description: "Vegetable", filePath: "images/carrot.png" },
51+
]
52+
53+
var plantList = [];
54+
55+
var boxItems
56+
57+
var start = function() {
58+
59+
page.color = "whitesmoke"
60+
61+
// BOX: Fruit items container box.
62+
boxItems = createBox(40, 40, 300, 230)
63+
that.color = "white"
64+
that.round = 13
65+
that.scrollY = 1
66+
that.center()
67+
68+
for(var i = 0; i < plantDataList.length; i++) {
69+
70+
// PLANTITEM: Every item.
71+
createPlantItem(plantDataList[i].name, plantDataList[i].description, plantDataList[i].filePath)
72+
boxItems.add(that)
73+
74+
plantList.push(that)
75+
76+
}
77+
78+
page.onResize(pageResized)
79+
80+
}
81+
82+
var pageResized = function() {
83+
84+
boxItems.center()
85+
86+
}
87+
88+
var createPlantItem = function(titleText, descriptionText, iconFullPath) {
89+
90+
var ITEM_WIDTH = 300
91+
92+
// BOX: Object container box
93+
var box = createBox(0, 0, ITEM_WIDTH, 94)
94+
that.color = "transparent"
95+
// Disable coordinate system.
96+
that.element.style.position = "relative"
97+
98+
// BOX: Item background box
99+
box.boxBackground = createBox(4, 2, ITEM_WIDTH - 8, 90)
100+
box.add(that)
101+
that.color = "rgba(0, 0, 0, 0.01)"
102+
that.round = 13
103+
that.border = 1
104+
that.borderColor = "rgba(0, 0, 0, 0.04)"
105+
that.setMotion("background-color 0.3s")
106+
107+
// IMAGE: Item icon image
108+
box.imgLogo = createImage(30, 12, 70, 70)
109+
box.add(that)
110+
that.load(iconFullPath)
111+
that.round = 4
112+
that.color = "transparent"
113+
that.border = 0
114+
115+
// LABEL: Item title text
116+
box.lblTitle = createLabel(120, 25, 280, "auto")
117+
box.add(that)
118+
that.text = titleText
119+
120+
// LABEL: Item description text
121+
box.lblDesc = createLabel(120, 49, 280, "auto")
122+
box.add(that)
123+
that.text = descriptionText
124+
that.textColor = "gray"
125+
that.fontSize = 14
126+
127+
makeBasicObject(box)
128+
return box
129+
130+
}
131+
</div>
132+
133+
</body>
134+
</html>

ex2.htm

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
5+
<title>basic.js Code Editor</title>
6+
7+
<meta charset="UTF-8">
8+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
9+
10+
<!-- LIBRARY FILES -->
11+
<script src="library/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
12+
<link rel="stylesheet" type="text/css" href="library/basic.min.css">
13+
<script src="library/basic.min.js" type="text/javascript" charset="utf-8"></script>
14+
<script src="js/basic-editor.js" type="text/javascript" charset="utf-8"></script>
15+
16+
<style>
17+
18+
body {
19+
overflow: hidden;
20+
}
21+
22+
.editor {
23+
24+
position:absolute;
25+
margin:0px;
26+
border-radius: 6px;
27+
font-size: 11px;
28+
29+
}
30+
31+
</style>
32+
33+
<script>
34+
35+
var start = function() {
36+
37+
basicEditor.create(document.getElementById("code-example").innerHTML);
38+
39+
}
40+
41+
</script>
42+
43+
</head>
44+
<body>
45+
46+
<div id="code-example" style="display:none">
47+
// VARIABLES
48+
49+
var lblBottomInfo
50+
51+
// SPECIAL FUNCTIONS
52+
53+
// First running function.
54+
var start = function() {
55+
56+
// LABEL: Bottom Info. Parameters: (left, top, width, height)
57+
lblBottomInfo = createLabel(0, 0, page.width, "auto")
58+
that.text = "This is a label"
59+
that.bottom = 20
60+
that.textAlign = "center"
61+
that.color = "gold"
62+
that.textColor = "rgba(0, 0, 0, 0.4)"
63+
that.spaceY = 10
64+
65+
page.onResize(pageResized)
66+
67+
}
68+
69+
// OTHER FUNCTIONS
70+
71+
var pageResized = function() {
72+
73+
lblBottomInfo.width = page.width
74+
75+
}
76+
</div>
77+
78+
</body>
79+
</html>

ex3.htm

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
5+
<title>basic.js Code Editor</title>
6+
7+
<meta charset="UTF-8">
8+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
9+
10+
<!-- LIBRARY FILES -->
11+
<script src="library/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
12+
<link rel="stylesheet" type="text/css" href="library/basic.min.css">
13+
<script src="library/basic.min.js" type="text/javascript" charset="utf-8"></script>
14+
<script src="js/basic-editor.js" type="text/javascript" charset="utf-8"></script>
15+
16+
<style>
17+
18+
body {
19+
overflow: hidden;
20+
}
21+
22+
.editor {
23+
24+
position:absolute;
25+
margin:0px;
26+
border-radius: 6px;
27+
font-size: 11px;
28+
29+
}
30+
31+
</style>
32+
33+
<script>
34+
35+
var start = function() {
36+
37+
basicEditor.create(document.getElementById("code-example").innerHTML);
38+
39+
}
40+
41+
</script>
42+
43+
</head>
44+
<body>
45+
46+
<div id="code-example" style="display:none">
47+
// VARIABLES
48+
49+
var imgIcon
50+
51+
// SPECIAL FUNCTIONS
52+
53+
// First running function.
54+
var start = function() {
55+
56+
// IMAGE: Bottom Info. Parameters: (left, top, width, height)
57+
imgIcon = createImage(0, 20, 128, 128)
58+
that.load("images/strawberry.png")
59+
that.right = 20
60+
that.space = 15
61+
that.color = "rgba(0, 0, 0, 0.05)"
62+
that.onLoad(printImageSizes)
63+
64+
}
65+
66+
// OTHER FUNCTIONS
67+
68+
var printImageSizes = function(self) {
69+
70+
print("Width: " + self.naturalWidth)
71+
print("Height: " + self.naturalHeight)
72+
73+
}
74+
</div>
75+
76+
</body>
77+
</html>

0 commit comments

Comments
 (0)