You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Mario Voigt e44f35095a „README.md“ ändern 1 month ago
css Initial fork of https://github.com/JinJunho/Madeleine.js/commit/ffddaf01a9eb91f9c8103cb8bab0e1b5be377b0e 3 months ago
examples Initial fork of https://github.com/JinJunho/Madeleine.js/commit/ffddaf01a9eb91f9c8103cb8bab0e1b5be377b0e 3 months ago
images Initial fork of https://github.com/JinJunho/Madeleine.js/commit/ffddaf01a9eb91f9c8103cb8bab0e1b5be377b0e 3 months ago
models Initial fork of https://github.com/JinJunho/Madeleine.js/commit/ffddaf01a9eb91f9c8103cb8bab0e1b5be377b0e 3 months ago
src readded focus on click 3 months ago
LICENSE Initial fork of https://github.com/JinJunho/Madeleine.js/commit/ffddaf01a9eb91f9c8103cb8bab0e1b5be377b0e 3 months ago
README.md „README.md“ ändern 1 month ago

README.md

Madeleine.js for Gitea

Madeleine.js Integration for Gitea. Does not work for ASCII files (in conjunction with gitea). You can convert ASCII files to binary using admesh. Admesh is available for Windows and Linux.

Example

See https://gitea.fablabchemnitz.de/MarioVoigt/STL-Test/src/branch/master/Bunny-LowPoly.stl (https://www.thingiverse.com/thing:151081/files)

HowTo Steps

Convert ASCII to Binary STL

apt install admesh
admesh ascii-file.stl --write-binary-stl binary.stl

Gitea config

cd /opt/gitea/custom/templates/
mkdir base/
cd base/
vim /opt/gitea/custom/templates/base/footer.tmpl
<script>
function lS(src){
  return new Promise(function(resolve, reject) {
    let s = document.createElement('script')
    s.src = src
    s.addEventListener('load', () => {
      resolve()
    })
    document.body.appendChild(s)
  });
}
if($('.view-raw>a[href$=".stl" i]').length){
  $('body').append('<link href="/Madeleine.js/src/css/Madeleine.css" rel="stylesheet">');
  Promise.all([lS("/Madeleine.js/src/lib/stats.js"),lS("/Madeleine.js/src/lib/detector.js"), lS("/Madeleine.js/src/lib/three.min.js"), lS("/Madeleine.js/src/Madeleine.js")]).then(function() {
    $('.view-raw').attr('id', 'view-raw').attr('style', 'padding: 0;margin-bottom: -10px;');
    new Madeleine({
      target: 'view-raw',
      data: $('.view-raw>a[href$=".stl" i]').attr('href'),
      path: '/Madeleine.js/src'
    });
    $('.view-raw>a[href$=".stl"]').remove()
  });
}
</script>
chown git:git footer.tmpl
chmod 770 footer.tmpl
cd /opt/gitea/custom/
mkdir public/
cd public/
git clone https://github.com/JinJunho/Madeleine.js.git Madeleine.js/
chown -R git:git /opt/gitea/custom/public
service gitea restart

Source code comes from http://jinjunho.github.io/Madeleine.js/