Skip to content

Commit b6704d2

Browse files
committed
....
1 parent 82aa154 commit b6704d2

35 files changed

+13004
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/node_modules/
2+
/dev_example/

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.1.0] - 2023-05-05
11+
12+
### Added
13+
14+
-

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Neptune CSS
3+
Copyright (c) 2023 Neptune CSS contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

javascriptAPI.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/**
2+
*
3+
* @class
4+
*
5+
* @name Neptune_DOMElement
6+
*
7+
* @description Create a new HTML DOM element
8+
*
9+
* @param {string} parentId - ID of the parent element
10+
* @param {string} elementType - Is it a **div** or a **span**
11+
* @param {string} elementId - ID of the new DOM element
12+
*
13+
* @example
14+
* ```
15+
* const myDiv = new Neptune_DOMElement("body", "div", "testid");
16+
* ```
17+
*
18+
*/
19+
export default class Neptune_DOMElement {
20+
constructor(parentId, elementType, elementId) {
21+
this.parentId = parentId;
22+
this.elementType = elementType;
23+
this.elementId = elementId;
24+
25+
this.create();
26+
}
27+
28+
create() {
29+
// Create new element
30+
const newDOMElement = document.createElement(this.elementType);
31+
newDOMElement.id = this.elementId;
32+
33+
// Append new element to parent element
34+
const parentElement = document.getElementById(this.parentId);
35+
parentElement.appendChild(newDOMElement);
36+
}
37+
}
38+
39+
/**
40+
*
41+
* @class
42+
*
43+
* @name Neptune_Button
44+
* @description Create default button
45+
*
46+
* @param {string} parentId - ID of parent element
47+
* @param {string} elementType - Type of element is always ** * button * **
48+
* @param {string} buttonName - Button title
49+
* @param {string} elementId - ID of the new button element
50+
*
51+
* @example
52+
* const defaultButton = new Neptune_Button("body", "Default Button", "buttonID");
53+
*
54+
*/
55+
export class Neptune_Button extends Neptune_DOMElement {
56+
constructor(parentId, elementType, buttonName, elementId) {
57+
super(parentId, elementType = 'button', 'Test 123', elementId);
58+
this.buttonName = buttonName;
59+
this.create();
60+
}
61+
62+
create() {
63+
var newButton = new Neptune_DOMElement(this.parentId, "button", this.elementId);
64+
this.innerHTML = this.buttonName;
65+
}
66+
}

out/Neptune_Button.html

Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>JSDoc: Class: Neptune_Button</title>
6+
7+
<script src="scripts/prettify/prettify.js"> </script>
8+
<script src="scripts/prettify/lang-css.js"> </script>
9+
<!--[if lt IE 9]>
10+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11+
<![endif]-->
12+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14+
</head>
15+
16+
<body>
17+
18+
<div id="main">
19+
20+
<h1 class="page-title">Class: Neptune_Button</h1>
21+
22+
23+
24+
25+
26+
27+
<section>
28+
29+
<header>
30+
31+
<h2><span class="attribs"><span class="type-signature"></span></span>Neptune_Button<span class="signature">(parentId, elementType, buttonName, elementId)</span><span class="type-signature"></span></h2>
32+
33+
34+
</header>
35+
36+
<article>
37+
<div class="container-overview">
38+
39+
40+
41+
42+
43+
44+
<h4 class="name" id="Neptune_Button"><span class="type-signature"></span>new Neptune_Button<span class="signature">(parentId, elementType, buttonName, elementId)</span><span class="type-signature"></span></h4>
45+
46+
47+
48+
49+
50+
51+
<div class="description">
52+
Create default button
53+
</div>
54+
55+
56+
57+
58+
59+
60+
61+
62+
63+
<h5>Parameters:</h5>
64+
65+
66+
<table class="params">
67+
<thead>
68+
<tr>
69+
70+
<th>Name</th>
71+
72+
73+
<th>Type</th>
74+
75+
76+
77+
78+
79+
<th class="last">Description</th>
80+
</tr>
81+
</thead>
82+
83+
<tbody>
84+
85+
86+
<tr>
87+
88+
<td class="name"><code>parentId</code></td>
89+
90+
91+
<td class="type">
92+
93+
94+
<span class="param-type">string</span>
95+
96+
97+
98+
</td>
99+
100+
101+
102+
103+
104+
<td class="description last">ID of parent element</td>
105+
</tr>
106+
107+
108+
109+
<tr>
110+
111+
<td class="name"><code>elementType</code></td>
112+
113+
114+
<td class="type">
115+
116+
117+
<span class="param-type">string</span>
118+
119+
120+
121+
</td>
122+
123+
124+
125+
126+
127+
<td class="description last">Type of element is always ** * button * **</td>
128+
</tr>
129+
130+
131+
132+
<tr>
133+
134+
<td class="name"><code>buttonName</code></td>
135+
136+
137+
<td class="type">
138+
139+
140+
<span class="param-type">string</span>
141+
142+
143+
144+
</td>
145+
146+
147+
148+
149+
150+
<td class="description last">Button title</td>
151+
</tr>
152+
153+
154+
155+
<tr>
156+
157+
<td class="name"><code>elementId</code></td>
158+
159+
160+
<td class="type">
161+
162+
163+
<span class="param-type">string</span>
164+
165+
166+
167+
</td>
168+
169+
170+
171+
172+
173+
<td class="description last">ID of the new button element</td>
174+
</tr>
175+
176+
177+
</tbody>
178+
</table>
179+
180+
181+
182+
183+
184+
185+
<dl class="details">
186+
187+
188+
189+
190+
191+
192+
193+
194+
195+
196+
197+
198+
199+
200+
201+
202+
203+
204+
205+
206+
207+
208+
209+
210+
211+
212+
<dt class="tag-source">Source:</dt>
213+
<dd class="tag-source"><ul class="dummy"><li>
214+
<a href="javascriptAPI.js.html">javascriptAPI.js</a>, <a href="javascriptAPI.js.html#line39">line 39</a>
215+
</li></ul></dd>
216+
217+
218+
219+
220+
221+
222+
223+
</dl>
224+
225+
226+
227+
228+
229+
230+
231+
232+
233+
234+
235+
236+
237+
238+
239+
240+
241+
242+
243+
<h5>Example</h5>
244+
245+
<pre class="prettyprint"><code>const defaultButton = new Neptune_Button("body", "Default Button", "buttonID");</code></pre>
246+
247+
248+
249+
250+
</div>
251+
252+
253+
254+
255+
256+
257+
258+
259+
260+
261+
262+
263+
264+
265+
266+
267+
268+
269+
270+
271+
</article>
272+
273+
</section>
274+
275+
276+
277+
278+
</div>
279+
280+
<nav>
281+
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Neptune_Button.html">Neptune_Button</a></li><li><a href="Neptune_DOMElement.html">Neptune_DOMElement</a></li></ul>
282+
</nav>
283+
284+
<br class="clear">
285+
286+
<footer>
287+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Sat May 06 2023 03:00:31 GMT+0200 (Mitteleuropäische Sommerzeit)
288+
</footer>
289+
290+
<script> prettyPrint(); </script>
291+
<script src="scripts/linenumber.js"> </script>
292+
</body>
293+
</html>

0 commit comments

Comments
 (0)