mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
docs: Move example *.js and *.js.map files to another repository
This commit is contained in:
parent
d96de18074
commit
e7599a6d85
2
_docs/.gitignore
vendored
Normal file
2
_docs/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
public/example/*.js
|
||||
public/example/*.js.map
|
@ -1,3 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
{{comment .License}}
|
||||
<script src="{{.Example.Name}}.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
window.addEventListener('load', function() {
|
||||
function isProduction() {
|
||||
var l = window.top.location;
|
||||
if (l.hash === '#_production') {
|
||||
return true;
|
||||
}
|
||||
if (l.hostname === 'localhost' || l.hostname === '127.0.0.1') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
var s = document.createElement('script');
|
||||
var src = '{{.Example.Name}}.js';
|
||||
if (isProduction()) {
|
||||
src = 'http://hajimehoshi.github.io/ebiten.pagestorage/{{.CurrentBranch}}/' + src;
|
||||
}
|
||||
s.src = src;
|
||||
document.body.appendChild(s);
|
||||
});
|
||||
</script>
|
||||
|
11
_docs/gen.go
11
_docs/gen.go
@ -55,7 +55,6 @@ func init() {
|
||||
}
|
||||
|
||||
var stableVersion = ""
|
||||
|
||||
var devVersion = ""
|
||||
|
||||
func init() {
|
||||
@ -66,6 +65,15 @@ func init() {
|
||||
stableVersion = strings.TrimSpace(string(b))
|
||||
}
|
||||
|
||||
func currentBranch() string {
|
||||
r, err := ioutil.ReadFile("../.git/HEAD")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
rr := strings.TrimSpace(string(r))
|
||||
return regexp.MustCompile(`^ref: refs/heads/(.+)$`).FindStringSubmatch(rr)[1]
|
||||
}
|
||||
|
||||
func init() {
|
||||
b, err := exec.Command("git", "show", "master:version.txt").Output()
|
||||
if err != nil {
|
||||
@ -219,6 +227,7 @@ func outputExampleContent(e *example) error {
|
||||
data := map[string]interface{}{
|
||||
"License": license,
|
||||
"Copyright": copyright,
|
||||
"CurrentBranch": currentBranch(),
|
||||
"Example": e,
|
||||
}
|
||||
if err := t.Funcs(funcs).Execute(f, data); err != nil {
|
||||
|
@ -35,7 +35,7 @@ pre {
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="http://godoc.org/github.com/hajimehoshi/ebiten">API Docs</a></li>
|
||||
<li><a href="http://github.com/hajimehoshi/ebiten">Source Code</a> (Development version: v{{.DevVersion}})</li>
|
||||
<li><a href="http://github.com/hajimehoshi/ebiten">GitHub project page</a> (Development version: v{{.DevVersion}})</li>
|
||||
</ul>
|
||||
|
||||
<h2>Features</h2>
|
||||
|
@ -14,4 +14,26 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<script src="blocks.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
window.addEventListener('load', function() {
|
||||
function isProduction() {
|
||||
var l = window.top.location;
|
||||
if (l.hash === '#_production') {
|
||||
return true;
|
||||
}
|
||||
if (l.hostname === 'localhost' || l.hostname === '127.0.0.1') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
var s = document.createElement('script');
|
||||
var src = 'blocks.js';
|
||||
if (isProduction()) {
|
||||
src = 'http://hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
|
||||
}
|
||||
s.src = src;
|
||||
document.body.appendChild(s);
|
||||
});
|
||||
</script>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -14,4 +14,26 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<script src="hue.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
window.addEventListener('load', function() {
|
||||
function isProduction() {
|
||||
var l = window.top.location;
|
||||
if (l.hash === '#_production') {
|
||||
return true;
|
||||
}
|
||||
if (l.hostname === 'localhost' || l.hostname === '127.0.0.1') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
var s = document.createElement('script');
|
||||
var src = 'hue.js';
|
||||
if (isProduction()) {
|
||||
src = 'http://hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
|
||||
}
|
||||
s.src = src;
|
||||
document.body.appendChild(s);
|
||||
});
|
||||
</script>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -14,4 +14,26 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<script src="keyboard.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
window.addEventListener('load', function() {
|
||||
function isProduction() {
|
||||
var l = window.top.location;
|
||||
if (l.hash === '#_production') {
|
||||
return true;
|
||||
}
|
||||
if (l.hostname === 'localhost' || l.hostname === '127.0.0.1') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
var s = document.createElement('script');
|
||||
var src = 'keyboard.js';
|
||||
if (isProduction()) {
|
||||
src = 'http://hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
|
||||
}
|
||||
s.src = src;
|
||||
document.body.appendChild(s);
|
||||
});
|
||||
</script>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -14,4 +14,26 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<script src="mosaic.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
window.addEventListener('load', function() {
|
||||
function isProduction() {
|
||||
var l = window.top.location;
|
||||
if (l.hash === '#_production') {
|
||||
return true;
|
||||
}
|
||||
if (l.hostname === 'localhost' || l.hostname === '127.0.0.1') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
var s = document.createElement('script');
|
||||
var src = 'mosaic.js';
|
||||
if (isProduction()) {
|
||||
src = 'http://hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
|
||||
}
|
||||
s.src = src;
|
||||
document.body.appendChild(s);
|
||||
});
|
||||
</script>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -14,4 +14,26 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<script src="paint.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
window.addEventListener('load', function() {
|
||||
function isProduction() {
|
||||
var l = window.top.location;
|
||||
if (l.hash === '#_production') {
|
||||
return true;
|
||||
}
|
||||
if (l.hostname === 'localhost' || l.hostname === '127.0.0.1') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
var s = document.createElement('script');
|
||||
var src = 'paint.js';
|
||||
if (isProduction()) {
|
||||
src = 'http://hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
|
||||
}
|
||||
s.src = src;
|
||||
document.body.appendChild(s);
|
||||
});
|
||||
</script>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -14,4 +14,26 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<script src="perspective.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
window.addEventListener('load', function() {
|
||||
function isProduction() {
|
||||
var l = window.top.location;
|
||||
if (l.hash === '#_production') {
|
||||
return true;
|
||||
}
|
||||
if (l.hostname === 'localhost' || l.hostname === '127.0.0.1') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
var s = document.createElement('script');
|
||||
var src = 'perspective.js';
|
||||
if (isProduction()) {
|
||||
src = 'http://hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
|
||||
}
|
||||
s.src = src;
|
||||
document.body.appendChild(s);
|
||||
});
|
||||
</script>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -14,4 +14,26 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<script src="rotate.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
window.addEventListener('load', function() {
|
||||
function isProduction() {
|
||||
var l = window.top.location;
|
||||
if (l.hash === '#_production') {
|
||||
return true;
|
||||
}
|
||||
if (l.hostname === 'localhost' || l.hostname === '127.0.0.1') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
var s = document.createElement('script');
|
||||
var src = 'rotate.js';
|
||||
if (isProduction()) {
|
||||
src = 'http://hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
|
||||
}
|
||||
s.src = src;
|
||||
document.body.appendChild(s);
|
||||
});
|
||||
</script>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -49,7 +49,7 @@ pre {
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="http://godoc.org/github.com/hajimehoshi/ebiten">API Docs</a></li>
|
||||
<li><a href="http://github.com/hajimehoshi/ebiten">Source Code</a> (Development version: v1.1.0-alpha)</li>
|
||||
<li><a href="http://github.com/hajimehoshi/ebiten">GitHub project page</a> (Development version: v1.1.0-alpha)</li>
|
||||
</ul>
|
||||
|
||||
<h2>Features</h2>
|
||||
|
@ -62,13 +62,14 @@ func SwapBuffers() {
|
||||
}
|
||||
|
||||
func init() {
|
||||
doc := js.Global.Get("document")
|
||||
if doc.Get("body") == nil {
|
||||
ch := make(chan struct{})
|
||||
js.Global.Get("window").Set("onload", func() {
|
||||
js.Global.Get("window").Call("addEventListener", "load", func() {
|
||||
close(ch)
|
||||
})
|
||||
<-ch
|
||||
|
||||
doc := js.Global.Get("document")
|
||||
}
|
||||
doc.Set("onkeydown", func(e js.Object) bool {
|
||||
code := e.Get("keyCode").Int()
|
||||
// Backspace
|
||||
|
Loading…
Reference in New Issue
Block a user