mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
added apache 2.0 license to build script
This commit is contained in:
parent
89b8f1aa24
commit
b987b48758
@ -1,3 +1,15 @@
|
||||
/**
|
||||
* dat.gui Javascript Controller Library
|
||||
* http://dataarts.github.com/dat.gui
|
||||
*
|
||||
* Copyright 2011 Data Arts Team, Google Creative Lab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
var DAT = DAT || {};
|
||||
|
||||
DAT.GUI = function(parameters) {
|
||||
|
12
build/DAT.GUI.min.js
vendored
12
build/DAT.GUI.min.js
vendored
@ -1,3 +1,15 @@
|
||||
/**
|
||||
* dat.gui Javascript Controller Library
|
||||
* http://dataarts.github.com/dat.gui
|
||||
*
|
||||
* Copyright 2011 Data Arts Team, Google Creative Lab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
var DAT=DAT||{};
|
||||
DAT.GUI=function(a){a==void 0&&(a={});var b=!1;a.height==void 0?a.height=300:b=!0;var d=[],c=[],i=!0,f,h,j=this,g=!0,e=280,q=!1,k,p,n=0,r;this.domElement=document.createElement("div");this.domElement.setAttribute("class","guidat");this.domElement.style.width=e+"px";var l=a.height,m=document.createElement("div");m.setAttribute("class","guidat-controllers");m.style.height=l+"px";m.addEventListener("DOMMouseScroll",function(a){var b=this.scrollTop;a.wheelDelta?b+=a.wheelDelta:a.detail&&(b+=a.detail);
|
||||
a.preventDefault&&a.preventDefault();a.returnValue=!1;m.scrollTop=b},!1);var o=document.createElement("a");o.setAttribute("class","guidat-toggle");o.setAttribute("href","#");o.innerHTML=g?"Close Controls":"Open Controls";var t=!1,C=0,x=0,u=!1,v,y,w,z,D=function(a){y=v;z=w;v=a.pageY;w=a.pageX;a=v-y;if(!g)if(a>0)g=!0,l=k=1,o.innerHTML=p||"Close Controls";else return;var b=z-w;if(a>0&&l>h){var d=DAT.GUI.map(l,h,h+100,1,0);a*=d}t=!0;C+=a;k+=a;l+=a;m.style.height=k+"px";x+=b;e+=b;e=DAT.GUI.constrain(e,
|
||||
|
@ -136,12 +136,12 @@
|
||||
<ul>
|
||||
<li>
|
||||
<a href='https://github.com/dataarts/dat.gui/raw/master/build/DAT.GUI.min.js'><strong>Download the minified source</strong></a>
|
||||
<small id='buildsizemin'>[19.0kb]
|
||||
<small id='buildsizemin'>[19.3kb]
|
||||
</small>
|
||||
</li>
|
||||
<li>
|
||||
<a href='https://github.com/dataarts/dat.gui/raw/master/build/DAT.GUI.js'><strong>Download the uncompressed source</strong></a>
|
||||
<small id='buildsize'>[33.0kb]
|
||||
<small id='buildsize'>[33.3kb]
|
||||
</small>
|
||||
</li>
|
||||
|
||||
|
@ -24,6 +24,20 @@ INDEX = os.path.join(PREFIX,'index.html')
|
||||
BUILD_NAME = 'DAT.GUI'
|
||||
ALL_JS = ['DAT.GUI.js','DAT.GUI']
|
||||
|
||||
LICENSE = """/**
|
||||
* dat.gui Javascript Controller Library
|
||||
* http://dataarts.github.com/dat.gui
|
||||
*
|
||||
* Copyright 2011 Data Arts Team, Google Creative Lab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
"""
|
||||
|
||||
def flatten(l, ltypes=(list, tuple)):
|
||||
ltype = type(l)
|
||||
l = list(l)
|
||||
@ -107,22 +121,25 @@ def build(jssrc, csssrc=list([''])):
|
||||
|
||||
if csssrc:
|
||||
cssfiles = source_list(csssrc, '*.css')
|
||||
print('CSS files being compiled: ', cssfiles)
|
||||
css = '\n'.join([open(f).read() for f in cssfiles])
|
||||
css = re.sub(r'[ \t\n\r]+',' ',css)
|
||||
|
||||
jsfiles = source_list(jssrc, '*.js')
|
||||
print(jsfiles)
|
||||
print('JS files being compiled: ', jsfiles)
|
||||
code = '\n'.join([open(f).read() for f in jsfiles])
|
||||
if csssrc:
|
||||
code += """DAT.GUI.inlineCSS = '%s';\n"""%(css,)
|
||||
|
||||
outpath = os.path.join(BUILD_ROOT, BUILD_NAME+'.js')
|
||||
with open(outpath,'w') as f:
|
||||
f.write(LICENSE)
|
||||
f.write(code)
|
||||
|
||||
compiled = compile(code)
|
||||
outpathmin = os.path.join(BUILD_ROOT, BUILD_NAME+'.min.js')
|
||||
with open(outpathmin,'w') as f:
|
||||
f.write(LICENSE)
|
||||
f.write(compiled)
|
||||
|
||||
size = bytes_to_kb(os.path.getsize(outpath))
|
||||
|
Loading…
Reference in New Issue
Block a user