id
int64
0
1.29M
original_id
stringlengths
32
32
swhid
stringlengths
100
170
sha1
stringlengths
40
40
repo_name
stringlengths
2
45
repo_group
stringclasses
12 values
filepath
stringlengths
5
153
name
stringlengths
1
14.9k
type
stringclasses
3 values
code
stringlengths
7
2.12M
6,700
4018fbcf9bf47344d625dc465f6b3f3f
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
ZA::uncache
function
uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_,a=e.length;for(let s=0,o=arguments.length;s!==o;++s){const o=arguments[s].uuid,c=t[o];if(void 0!==c)if(delete t[o],c<r){const s=--r,o=e[s],l=--a,h=e[l];t[o.uuid]=c,e[c]=o,t[h.uuid]=s,e[s]=h,e.pop();for(let e=0,t...
6,701
c746e920db484d1874609626581ee382
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
gf::init
function
init(){return uf||(uf="undefined"!=typeof fetch?fetch("data:application/wasm;base64,"+ff).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,pf)).then(this._init):WebAssembly.instantiate(Buffer.from(ff,"base64"),pf).then(this._init),uf)}
6,702
f2cadbdb8d647433cb27005a6deb86a0
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
hs::translate
function
translate(e){return this.constant-=e.dot(this.normal),this}
6,703
68f2a3c8e1d0cd5299183d1448a869eb
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
al::setUsage
function
setUsage(e){return this.usage=e,this}
6,704
9e4eda0b870f3578f6da1ff75699e8bd
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Lh::update
function
update(){const e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}
6,705
e784b3494aefb0fb94596ac84b1e8a7c
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
_h::constructor
function
constructor(e=new Ma,t=new ph){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}
6,706
9628e1373f0ea59fc62c5211f47af0b1
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Ma::computeTangents::f
function
function f(e,t,n){c.fromBufferAttribute(i,e),l.fromBufferAttribute(i,t),h.fromBufferAttribute(i,n),u.fromBufferAttribute(r,e),d.fromBufferAttribute(r,t),A.fromBufferAttribute(r,n),l.sub(c),h.sub(c),d.sub(u),A.sub(u);const a=1/(d.x*A.y-A.x*d.y);isFinite(a)&&(p.copy(l).multiplyScalar(A.y).addScaledVector(h,-d.y).multiply...
6,707
19b0134088063a7f38dd117207b5521f
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
$i::normalize
function
normalize(){return this.divideScalar(this.length()||1)}
6,708
fc0cee0c50a4f622f0bd3294b1f90e0a
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
jr::equals
function
equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}
6,709
f87ad1dd604791c35ab364ed18c07c87
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
la::applyNormalMatrix
function
applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)oa.fromBufferAttribute(this,t),oa.applyNormalMatrix(e),this.setXYZ(t,oa.x,oa.y,oa.z);return this}
6,710
9ea50ee5cbf319553e50a004ecf8c041
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
cr::makePerspective
function
makePerspective(e,t,i,n,r,a,s=Qi){const o=this.elements,c=2*r/(t-e),l=2*r/(i-n),h=(t+e)/(t-e),u=(i+n)/(i-n);let d,A;if(s===Qi)d=-(a+r)/(a-r),A=-2*a*r/(a-r);else{if(s!==Fi)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);d=-a/(a-r),A=-a*r/(a-r)}return o[0]=c,o[4]=0,o[8]=h,o[12]=0,o[1]=0,...
6,711
57fef681071d4f48632aae31e145858e
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
ba::constructor
function
constructor(e,t,i){super(new Float32Array(e),t,i)}
6,712
0702147562e30e712eab2ef3a2d00796
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
_o
function
function _o(e,t){const i=this.cache,n=t.elements;if(void 0===n){if(uo(i,t))return;e.uniformMatrix3fv(this.addr,!1,t),Ao(i,t)}else{if(uo(i,n))return;co.set(n),e.uniformMatrix3fv(this.addr,!1,co),Ao(i,n)}}
6,713
86141c592b73c426a6b684da9c1cb718
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Wd::constructor
function
constructor(e){super(e)}
6,714
4247326fbcc7b75d8c0ae7a3e8a31e97
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
dA::set
function
set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}
6,715
cfb74e2cbbf8a9db5dcd554630288c1c
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Ao
function
function Ao(e,t){for(let i=0,n=t.length;i<n;i++)e[i]=t[i]}
6,716
31de18c6b7055e4c986d38f25d84a89f
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Ln::max
function
max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}
6,717
3b9e573d8e894e2d254dc844964afff8
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
$i::floor
function
floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}
6,718
22ea2c64c21d4060867d90240e37550c
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Ur::applyMatrix4
function
applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}
6,719
3f35f06a666f17e8e25a343e4870f7e4
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Ur::rotateX
function
rotateX(e){return this.rotateOnAxis(wr,e)}
6,720
8089c7cfdd327d3b0c1ac650c77442fd
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
su::constructor
function
constructor(e=[new $i(0,-.5),new $i(.5,0),new $i(0,.5)],t=12,i=0,n=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:n},t=Math.floor(t),n=Wi(n,0,2*Math.PI);const r=[],a=[],s=[],o=[],c=[],l=1/t,h=new Ln,u=new $i,d=new Ln,A=new Ln,p=new Ln;let g=0,f=0;for(let t=0;t<=e....
6,721
d59a6ca9ea586d9b38c6a03167233acb
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Wu
function
function Wu(e,t){for(let i=0;i<t.length;i++)e.push(t[i].x),e.push(t[i].y)}
6,722
cc5ac4b8382866c14442a40d0b31f42b
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Od::parse
function
parse(){}
6,723
16739a1fbe06abfd6e04fd2a16c377a3
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Wd::load::o
function
function o(){l(),Nd.add(e,this),t&&t(this),r.manager.itemEnd(e)}
6,724
dc4dae1f6cc8d271711c7bc63059e52f
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
unbind
function
unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}
6,725
aa8dc440027945691cb4eebf7fccce27
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
cp::setFromCamera
function
setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).tr...
6,726
55cf34a38ce58c9ba50dd78f6f3e52ba
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Wg::_getIdleWorker
function
_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}
6,727
66626ee9a4b41f54a640025ec23906f7
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Xc::init
function
init(e,t,i){if(null===this.texture){const n=new yn;e.properties.get(n).__webglTexture=t.texture,t.depthNear==i.depthNear&&t.depthFar==i.depthFar||(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}
6,728
3813aa9d83c8636a0f97f22721623224
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Ah::setCustomSort
function
setCustomSort(e){return this.customSort=e,this}
6,729
bd0cbe473f278ca8b2c4565d44a4f762
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
eu::copy
function
copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}
6,730
672d6daf20d3d4b173dbf9842c99a31a
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Ln::manhattanDistanceTo
function
manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}
6,731
b4f14a36881e98050b09bcb2c3886a85
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
en::determinant
function
determinant(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],s=e[5],o=e[6],c=e[7],l=e[8];return t*a*l-t*s*c-i*r*l+i*s*o+n*r*c-n*a*o}
6,732
a33133b55e1cc7ed7c7f924b6a4290b1
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
en::translate
function
translate(e,t){return this.premultiply(tn.makeTranslation(e,t)),this}
6,733
c4c7985d1353789a757bdfbc7bf04b05
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
br::setFromQuaternion
function
setFromQuaternion(e,t,i){return fr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(fr,t,i)}
6,734
c50e08536b637cdba885ce8fb766188c
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
fs::copy
function
copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}
6,735
3790097166b14c7c335f96022909053f
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
iA::dispose
function
dispose(){this.shadow.dispose()}
6,736
b7c1b2816c24d560c6bae0ea84d0c6e3
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
KA::findNode
function
static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(void 0!==i)return i}if(e.children){const i=function(e){for(let n=0;n<e.length;n++){const r=e[n];if(r.name===t||r.uuid===t)return r;const a=i(r.children);if(a)return a}return...
6,737
d791e1a7b015b540b91790bcf181ea0e
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
Jl::computeBoundingSphere
function
computeBoundingSphere(){const e=this.geometry,t=this.count;null===this.boundingSphere&&(this.boundingSphere=new $n),null===e.boundingSphere&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,zl),Yl.copy(e.boundingSphere).applyMatrix4(zl),this.boundingSphere.union(Yl)}
6,738
a1c183241ba99486d01da92ae96ae8e5
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
tp::update
function
update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,n=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1;for(let s=0;s!==i;++s)t[s]._update(n,e,r,a);const s=this._bindings,o=this._nActiveBindings;for(let e=0;e!==o;++e)s[e].apply(a);return this}
6,739
225c3defa542edaa544ae22751a90732
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
hf
function
function hf(e){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(e):Buffer.from(e).toString("utf8")}
6,740
fe60015bb87aec69f9c190857db896f7
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
mp::closestPointToPoint
function
closestPointToPoint(e,t,i){const n=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(n).add(this.start)}
6,741
1ecd3bb253dd362de7d3f1335f7c7b69
swh:1:cnt:be74c3579b5363eb79f06cff064cd3a615bd1ecc;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=2-2/
c74be198cc8f55ea5c6bd42cc70f0c8872bd4ae2
3D
deployed
modules/lib/three/three.js
dp::clone
function
clone(){return(new this.constructor).copy(this)}
6,742
fd112c6fbaf8c8cd871798ac6d46c59f
swh:1:cnt:33f59e5c22f508032d8f34d5ece3ca5e21a00442;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=31-130/
b7a098f8f94bc55ea7d664f5acbc0b41638e0da6
3D
deployed
src/Hooks.php
Hooks
type
class Hooks implements BeforePageDisplayHook, UploadFormInitDescriptorHook, UploadForm_getInitialPageTextHook { public function __construct( private readonly RepoGroup $repoGroup ) { } /** * @param OutputPage $out * @param Skin $skin */ public function onBeforePageDisplay( $out, $skin ): void { $titl...
6,743
ca49da84f64ce8cf0856900b712fa20e
swh:1:cnt:33f59e5c22f508032d8f34d5ece3ca5e21a00442;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=36-39/
b7a098f8f94bc55ea7d664f5acbc0b41638e0da6
3D
deployed
src/Hooks.php
Hooks::__construct( private readonly RepoGroup $repoGroup )
function
public function __construct( private readonly RepoGroup $repoGroup ) { }
6,744
904b23a1e78a73bb056246fec9fdf171
swh:1:cnt:33f59e5c22f508032d8f34d5ece3ca5e21a00442;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=59-106/
b7a098f8f94bc55ea7d664f5acbc0b41638e0da6
3D
deployed
src/Hooks.php
Hooks::onUploadFormInitDescriptor( &$descriptor )
function
/** * @param array &$descriptor */ public function onUploadFormInitDescriptor( &$descriptor ) { if ( !array_key_exists( 'License', $descriptor ) ) { return; } $patentMsg = PatentFormField::getMessageFromParams( [] ); if ( $patentMsg === '' || $patentMsg === '-' ) { return; } // no JS should be ...
6,745
453deb82939d3586b6904561f4ad9284
swh:1:cnt:33f59e5c22f508032d8f34d5ece3ca5e21a00442;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=108-129/
b7a098f8f94bc55ea7d664f5acbc0b41638e0da6
3D
deployed
src/Hooks.php
Hooks::onUploadForm_getInitialPageText( &$pageText, $msg, $config )
function
/** * @param string &$pageText * @param array $msg * @param Config $config */ public function onUploadForm_getInitialPageText( &$pageText, $msg, $config ) { $patent = RequestContext::getMain()->getRequest()->getText( 'wpPatent' ); if ( $patent === '' ) { // no patent text to be added return; } $...
6,746
58215f3db9670e960112193c81ddb0de
swh:1:cnt:33f59e5c22f508032d8f34d5ece3ca5e21a00442;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=41-57/
b7a098f8f94bc55ea7d664f5acbc0b41638e0da6
3D
deployed
src/Hooks.php
Hooks::onBeforePageDisplay( $out, $skin )
function
/** * @param OutputPage $out * @param Skin $skin */ public function onBeforePageDisplay( $out, $skin ): void { $title = $out->getTitle(); if ( $title->getNamespace() === NS_FILE ) { $file = $this->repoGroup->findFile( $title ); if ( $file && $file->getMediaType() === MEDIATYPE_3D ) { // Load JS on ...
6,747
80174c98c031c7546688091a172a958f
swh:1:cnt:3e7e2c53ef87414f8b207fca7eb389b5def3b513;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=24-84/
909a8c02b39976ad0f7fd452cbee141fa1dd0552
3D
deployed
src/PatentFormField.php
PatentFormField
type
class PatentFormField extends Licenses { /** * @inheritDoc */ public static function getMessageFromParams( $params ) { global $wgLanguageCode; if ( !empty( $params['patents'] ) ) { return $params['patents']; } // The 3d-patents page is in $wgForceUIMsgAsContentMsg (its translations will // be in su...
6,748
b1f164bf67e45f94e87101a72d9705a7
swh:1:cnt:3e7e2c53ef87414f8b207fca7eb389b5def3b513;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=25-43/
909a8c02b39976ad0f7fd452cbee141fa1dd0552
3D
deployed
src/PatentFormField.php
PatentFormField::getMessageFromParams( $params )
function
/** * @inheritDoc */ public static function getMessageFromParams( $params ) { global $wgLanguageCode; if ( !empty( $params['patents'] ) ) { return $params['patents']; } // The 3d-patents page is in $wgForceUIMsgAsContentMsg (its translations will // be in subpages). If such translation can't be foun...
6,749
1574f32b71d71174715bae0c7c0c3af3
swh:1:cnt:3e7e2c53ef87414f8b207fca7eb389b5def3b513;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=70-83/
909a8c02b39976ad0f7fd452cbee141fa1dd0552
3D
deployed
src/PatentFormField.php
PatentFormField::getOptionsArray()
function
/** * @return array */ protected function getOptionsArray() { $lines = $this->getLines(); $options = []; foreach ( $lines as $line ) { $msgObj = $this->msg( $line->text ); $text = $msgObj->exists() ? $msgObj->text() : $line->text; $options[$text] = $line->template; } return $options; }
6,750
ef7775e4ecfcf6c563a8ba2ee4650c6f
swh:1:cnt:3e7e2c53ef87414f8b207fca7eb389b5def3b513;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=45-51/
909a8c02b39976ad0f7fd452cbee141fa1dd0552
3D
deployed
src/PatentFormField.php
PatentFormField::buildLine( $line )
function
/** * @param string $line * @return PatentLine */ protected function buildLine( $line ) { return new PatentLine( $line ); }
6,751
7b7d819ebcbb3e4e1bd75ffa1988bb00
swh:1:cnt:3e7e2c53ef87414f8b207fca7eb389b5def3b513;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=53-68/
909a8c02b39976ad0f7fd452cbee141fa1dd0552
3D
deployed
src/PatentFormField.php
PatentFormField::getInputHTML( $value )
function
/** * @inheritDoc */ public function getInputHTML( $value ) { $options = []; $options[$this->msg( '3d-nopatent' )->text()] = ''; $options += $this->getOptionsArray(); $field = new HTMLRadioField( [ 'parent' => $this->mParent, 'fieldname' => 'Patent', 'id' => 'wpPatent', 'options' => $options, ...
6,752
fcc434fefe68a11c2c47484ccc126bfe
swh:1:cnt:e2d96bf1947d48cf8d5567a24560bb5561f278e0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=24-34/
89ec0291df167605d8fb6f92aeda95a7653e3546
3D
deployed
src/PatentLine.php
PatentLine
type
class PatentLine extends License { /** * @inheritDoc */ protected function parse( $str ) { // the split method is quite crude, so we'll first attempt to parse the text // as a message, so some acceptable wikitext (e.g. [[link|]]) won't confuse // our splitting return ( new RawMessage( $str ) )->parse(); ...
6,753
5354ec18f47f032e32b595c7d6e999b9
swh:1:cnt:e2d96bf1947d48cf8d5567a24560bb5561f278e0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=25-33/
89ec0291df167605d8fb6f92aeda95a7653e3546
3D
deployed
src/PatentLine.php
PatentLine::parse( $str )
function
/** * @inheritDoc */ protected function parse( $str ) { // the split method is quite crude, so we'll first attempt to parse the text // as a message, so some acceptable wikitext (e.g. [[link|]]) won't confuse // our splitting return ( new RawMessage( $str ) )->parse(); }
6,754
129c38072992d84657d3ed8d4278fb24
swh:1:cnt:09e6a3379b49e215fbcc5883a6a47599dcd721a0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=30-176/
372113d64fbd4724f37cdc5db44962ab45d950d3
3D
deployed
src/ThreeDHandler.php
ThreeDHandler
type
class ThreeDHandler extends ImageHandler { /** * @param File $file * @return bool */ public function mustRender( $file ) { return true; } /** * @param File $file * @return bool */ public function isVectorized( $file ) { return true; } /** * @param File $image * @param array &$params * @re...
6,755
e314649cb64dca9de6436025fab77bbf
swh:1:cnt:09e6a3379b49e215fbcc5883a6a47599dcd721a0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=31-37/
372113d64fbd4724f37cdc5db44962ab45d950d3
3D
deployed
src/ThreeDHandler.php
ThreeDHandler::mustRender( $file )
function
/** * @param File $file * @return bool */ public function mustRender( $file ) { return true; }
6,756
8d7a7ef1702493f02e5f6fe0f145eae0
swh:1:cnt:09e6a3379b49e215fbcc5883a6a47599dcd721a0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=47-86/
372113d64fbd4724f37cdc5db44962ab45d950d3
3D
deployed
src/ThreeDHandler.php
ThreeDHandler::normaliseParams( $image, &$params )
function
/** * @param File $image * @param array &$params * @return bool */ public function normaliseParams( $image, &$params ) { global $wgSVGMaxSize; if ( !parent::normaliseParams( $image, $params ) ) { return false; } // Note: the annotation below is incomplete to save up space, expand if necessary '@ph...
6,757
7e59f807b5163980a25da161b9ebabd5
swh:1:cnt:09e6a3379b49e215fbcc5883a6a47599dcd721a0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=39-45/
372113d64fbd4724f37cdc5db44962ab45d950d3
3D
deployed
src/ThreeDHandler.php
ThreeDHandler::isVectorized( $file )
function
/** * @param File $file * @return bool */ public function isVectorized( $file ) { return true; }
6,758
60824f47b7e62bc1a6387a01f0314167
swh:1:cnt:09e6a3379b49e215fbcc5883a6a47599dcd721a0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=148-156/
372113d64fbd4724f37cdc5db44962ab45d950d3
3D
deployed
src/ThreeDHandler.php
ThreeDHandler::getImageSize( $file, $path, $metadata = false )
function
/** * @param File $file * @param string $path Unused * @param bool|array $metadata * @return array */ public function getImageSize( $file, $path, $metadata = false ) { return [ 5120, 2880 ]; }
6,759
91107c2d83c287e932a4af17aecf6d71
swh:1:cnt:09e6a3379b49e215fbcc5883a6a47599dcd721a0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=88-146/
372113d64fbd4724f37cdc5db44962ab45d950d3
3D
deployed
src/ThreeDHandler.php
ThreeDHandler::doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 )
function
/** * @param File $image * @param string $dstPath * @param string $dstUrl * @param array $params * @param int $flags * * @return MediaTransformError|MediaTransformOutput|ThumbnailImage|TransformParameterError */ public function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) { global $w...
6,760
73995b86a96b21bf1b942753c97f8c24
swh:1:cnt:09e6a3379b49e215fbcc5883a6a47599dcd721a0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=158-166/
372113d64fbd4724f37cdc5db44962ab45d950d3
3D
deployed
src/ThreeDHandler.php
ThreeDHandler::getThumbType( $ext, $mime, $params = null )
function
/** * @param string $ext * @param string $mime * @param array|null $params * @return array */ public function getThumbType( $ext, $mime, $params = null ) { return [ 'png', 'image/png' ]; }
6,761
a599d4aad4eaa3ee82dd8dfebf5c47d5
swh:1:cnt:09e6a3379b49e215fbcc5883a6a47599dcd721a0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=168-174/
372113d64fbd4724f37cdc5db44962ab45d950d3
3D
deployed
src/ThreeDHandler.php
ThreeDHandler::parserTransformHook( $parser, $file )
function
/** * @param Parser $parser * @param File $file */ public function parserTransformHook( $parser, $file ) { $parser->getOutput()->addModuleStyles( [ 'ext.3d.styles' ] ); }
6,762
3f7ee287aaf1ab0ea03f5efeab9885e6
swh:1:cnt:88e02e8745763f9fbeb5fa02149e6fe2e4f2f877;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=24-39/
28772cbae21983b6108235789a41e3a3ed6d3a84
3D
deployed
src/ThreeDThumbnailImage.php
ThreeDThumbnailImage
type
class ThreeDThumbnailImage extends ThumbnailImage { /** * @inheritDoc */ public function toHtml( $options = [] ) { return Html::rawElement( 'span', [ 'class' => 'mw-3d-wrapper', // Image is part of the content, so this message must be in the content language 'data-label' => wfMessage( '3d-badg...
6,763
e3f583d052d37002231f6bd8d173f29e
swh:1:cnt:88e02e8745763f9fbeb5fa02149e6fe2e4f2f877;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/3D.git;lines=25-38/
28772cbae21983b6108235789a41e3a3ed6d3a84
3D
deployed
src/ThreeDThumbnailImage.php
ThreeDThumbnailImage::toHtml( $options = [] )
function
/** * @inheritDoc */ public function toHtml( $options = [] ) { return Html::rawElement( 'span', [ 'class' => 'mw-3d-wrapper', // Image is part of the content, so this message must be in the content language 'data-label' => wfMessage( '3d-badge-text' )->inContentLanguage()->text() ], paren...
6,764
564c827a3d6d8007f631a592f11cb3eb
swh:1:cnt:323f9756ff9e7b2c71562d18e6d8a3106f200ff0;origin=https://github.com/commons-app/apps-android-commons;lines=14-137/
d07f685e4c666ffcb8bdc58e78b3542bda2982ec
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/CheckBoxTriStates.java
CheckBoxTriStates
type
/** * Base on https://stackoverflow.com/a/40939367/3950497 answer. */ public class CheckBoxTriStates extends AppCompatCheckBox { static public final int UNKNOWN = -1; static public final int UNCHECKED = 0; static public final int CHECKED = 1; private int state=UNKNOWN; private Callback callba...
6,765
97c65042dc9e7b58faece8e1bbf113fc
swh:1:cnt:323f9756ff9e7b2c71562d18e6d8a3106f200ff0;origin=https://github.com/commons-app/apps-android-commons;lines=29-31/
d07f685e4c666ffcb8bdc58e78b3542bda2982ec
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/CheckBoxTriStates.java
CheckBoxTriStates::Callback
type
public interface Callback{ void filterByMarkerType(@Nullable List<Label> selectedLabels, int state, boolean b, boolean b1); }
6,766
89fe7c042cbe526ab3b90882cb80e4d4
swh:1:cnt:323f9756ff9e7b2c71562d18e6d8a3106f200ff0;origin=https://github.com/commons-app/apps-android-commons;lines=84-97/
d07f685e4c666ffcb8bdc58e78b3542bda2982ec
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/CheckBoxTriStates.java
CheckBoxTriStates::setState(int state)
function
public void setState(int state) { if(this.state != state) { this.state = state; if(this.clientListener != null) { this.clientListener.onCheckedChanged(this, this.isChecked()); } if (NearbyController.currentLocation != null) { call...
6,767
16ede16386214e465183865e0ce99ef2
swh:1:cnt:323f9756ff9e7b2c71562d18e6d8a3106f200ff0;origin=https://github.com/commons-app/apps-android-commons;lines=43-56/
d07f685e4c666ffcb8bdc58e78b3542bda2982ec
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/CheckBoxTriStates.java
CheckBoxTriStates::onCheckedChanged(CompoundButton buttonView, boolean isChecked)
function
// checkbox status is changed from uncheck to checked. public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { switch (state) { case UNKNOWN: setState(UNCHECKED); break; case UNCHECKED: s...
6,768
f0a6210def7b9b800abe9bff4d9985db
swh:1:cnt:323f9756ff9e7b2c71562d18e6d8a3106f200ff0;origin=https://github.com/commons-app/apps-android-commons;lines=112-115/
d07f685e4c666ffcb8bdc58e78b3542bda2982ec
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/CheckBoxTriStates.java
CheckBoxTriStates::init()
function
private void init() { state = UNKNOWN; updateBtn(); }
6,769
a788927c68cffc4bdfaf55f7fa34cc38
swh:1:cnt:323f9756ff9e7b2c71562d18e6d8a3106f200ff0;origin=https://github.com/commons-app/apps-android-commons;lines=80-82/
d07f685e4c666ffcb8bdc58e78b3542bda2982ec
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/CheckBoxTriStates.java
CheckBoxTriStates::getState()
function
public int getState() { return state; }
6,770
954f00729f075ceaa57264686ddcd891
swh:1:cnt:323f9756ff9e7b2c71562d18e6d8a3106f200ff0;origin=https://github.com/commons-app/apps-android-commons;lines=33-35/
d07f685e4c666ffcb8bdc58e78b3542bda2982ec
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/CheckBoxTriStates.java
CheckBoxTriStates::setCallback(Callback callback)
function
public void setCallback(Callback callback) { this.callback = callback; }
6,771
224325da3dc5b778d4723f815dbb1c5c
swh:1:cnt:323f9756ff9e7b2c71562d18e6d8a3106f200ff0;origin=https://github.com/commons-app/apps-android-commons;lines=99-110/
d07f685e4c666ffcb8bdc58e78b3542bda2982ec
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/CheckBoxTriStates.java
CheckBoxTriStates::setOnCheckedChangeListener(@Nullable OnCheckedChangeListener listener)
function
@Override public void setOnCheckedChangeListener(@Nullable OnCheckedChangeListener listener) { // we never truly set the listener to the client implementation, instead we only hold // a reference to it and evoke it when needed. if(this.privateListener != listener) { this.clientL...
6,772
1873ba25f7b078f12bc5528ddfc32814
swh:1:cnt:323f9756ff9e7b2c71562d18e6d8a3106f200ff0;origin=https://github.com/commons-app/apps-android-commons;lines=117-119/
d07f685e4c666ffcb8bdc58e78b3542bda2982ec
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/CheckBoxTriStates.java
CheckBoxTriStates::addAction()
function
public void addAction() { setOnCheckedChangeListener(this.privateListener); }
6,773
47e028c05fb10a7ef6285eafc52be4ec
swh:1:cnt:323f9756ff9e7b2c71562d18e6d8a3106f200ff0;origin=https://github.com/commons-app/apps-android-commons;lines=121-136/
d07f685e4c666ffcb8bdc58e78b3542bda2982ec
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/CheckBoxTriStates.java
CheckBoxTriStates::updateBtn()
function
private void updateBtn() { int btnDrawable = R.drawable.ic_indeterminate_check_box_black_24dp; switch (state) { case UNKNOWN: btnDrawable = R.drawable.ic_indeterminate_check_box_black_24dp; break; case UNCHECKED: btnDrawable = R.dra...
6,774
a519b86d0669fcae9b0b5f0147091bdd
swh:1:cnt:323f9756ff9e7b2c71562d18e6d8a3106f200ff0;origin=https://github.com/commons-app/apps-android-commons;lines=30-30/
d07f685e4c666ffcb8bdc58e78b3542bda2982ec
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/CheckBoxTriStates.java
CheckBoxTriStates::Callback::filterByMarkerType(@Nullable List<Label> selectedLabels, int state, boolean b, boolean b1)
function
void filterByMarkerType(@Nullable List<Label> selectedLabels, int state, boolean b, boolean b1);
6,775
102c9ecd88e64d530b70824bc4549437
swh:1:cnt:dda7a87b4fd3d63353ace91d03831cf0c50331c5;origin=https://github.com/commons-app/apps-android-commons;lines=16-126/
da2e6e43dae27ec530c475b34dc78754beaffc39
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/Label.java
Label
type
/** * See https://github.com/commons-app/apps-android-commons/issues/250 * Most common types of desc: building, house, cottage, farmhouse, * village, civil parish, church, railway station, * gatehouse, milestone, inn, secondary school, hotel */ public enum Label { BOOKMARKS(0, R.drawable.ic_filled_star_24dp),...
6,776
7743e2db87c82c41297269df1623ef10
swh:1:cnt:dda7a87b4fd3d63353ace91d03831cf0c50331c5;origin=https://github.com/commons-app/apps-android-commons;lines=75-91/
da2e6e43dae27ec530c475b34dc78754beaffc39
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/Label.java
Label::init(final Context context)
function
/** * Loads Q-IDs from Android resources * * @param context any Android context applicationContext - much safer */ public static void init(final Context context) { final Resources res = context.getResources(); for (final Label label : values()) { if (label.arrayResId ...
6,777
aa16534016e9f406427d199338184b3a
swh:1:cnt:dda7a87b4fd3d63353ace91d03831cf0c50331c5;origin=https://github.com/commons-app/apps-android-commons;lines=102-104/
da2e6e43dae27ec530c475b34dc78754beaffc39
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/Label.java
Label::isSelected()
function
public boolean isSelected() { return selected; }
6,778
653f1c1c8753603e17dc1f3abd338e48
swh:1:cnt:dda7a87b4fd3d63353ace91d03831cf0c50331c5;origin=https://github.com/commons-app/apps-android-commons;lines=110-113/
da2e6e43dae27ec530c475b34dc78754beaffc39
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/Label.java
Label::getIcon()
function
@DrawableRes public int getIcon() { return icon; }
6,779
12f1d241baaadc3a1a6f3659b24eb884
swh:1:cnt:dda7a87b4fd3d63353ace91d03831cf0c50331c5;origin=https://github.com/commons-app/apps-android-commons;lines=106-108/
da2e6e43dae27ec530c475b34dc78754beaffc39
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/Label.java
Label::getText()
function
public String getText() { return name(); }
6,780
6b4f9b6282a89f340e8565df91b1e308
swh:1:cnt:dda7a87b4fd3d63353ace91d03831cf0c50331c5;origin=https://github.com/commons-app/apps-android-commons;lines=115-121/
da2e6e43dae27ec530c475b34dc78754beaffc39
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/Label.java
Label::fromText(final String text)
function
public static Label fromText(final String text) { if ("BOOKMARK".equals(text)) { return BOOKMARKS; } final Label label = TEXT_TO_DESCRIPTION.get(text); return label == null ? UNKNOWN : label; }
6,781
1d54655d46a3fbf243645f387e6f1809
swh:1:cnt:dda7a87b4fd3d63353ace91d03831cf0c50331c5;origin=https://github.com/commons-app/apps-android-commons;lines=123-125/
da2e6e43dae27ec530c475b34dc78754beaffc39
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/Label.java
Label::valuesAsList()
function
public static List<Label> valuesAsList() { return Arrays.asList(Label.values()); }
6,782
495b6c38839df4eb084172344a5877e9
swh:1:cnt:dda7a87b4fd3d63353ace91d03831cf0c50331c5;origin=https://github.com/commons-app/apps-android-commons;lines=93-100/
da2e6e43dae27ec530c475b34dc78754beaffc39
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/Label.java
Label::setSelected(final boolean isSelected)
function
/** * Will be used for nearby filter, to determine if place type is selected or not * * @param isSelected true if user selected the place type */ public void setSelected(final boolean isSelected) { this.selected = isSelected; }
6,783
ab51498f60851fd46d7cbec47075b846
swh:1:cnt:c2474adc3330d42e313268130ec06d2b8d040174;origin=https://github.com/commons-app/apps-android-commons;lines=3-27/
ad9922c2413f45165459b6c91bc53e810628470e
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/MarkerPlaceGroup.java
MarkerPlaceGroup
type
/** * This class groups visual map item Marker with the reated data of displayed place and information * of bookmark */ public class MarkerPlaceGroup { private boolean isBookmarked; // True if user bookmarked the place private Place place; // Place of the location displayed by the marker public MarkerPl...
6,784
79e936d896d5b3390d8729c70a11743b
swh:1:cnt:c2474adc3330d42e313268130ec06d2b8d040174;origin=https://github.com/commons-app/apps-android-commons;lines=16-18/
ad9922c2413f45165459b6c91bc53e810628470e
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/MarkerPlaceGroup.java
MarkerPlaceGroup::getPlace()
function
public Place getPlace() { return place; }
6,785
42f655b8a40057b3ef0feeaaf7153019
swh:1:cnt:c2474adc3330d42e313268130ec06d2b8d040174;origin=https://github.com/commons-app/apps-android-commons;lines=20-22/
ad9922c2413f45165459b6c91bc53e810628470e
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/MarkerPlaceGroup.java
MarkerPlaceGroup::getIsBookmarked()
function
public boolean getIsBookmarked() { return isBookmarked; }
6,786
8193e419c5376fc4d77bd05f60004925
swh:1:cnt:c2474adc3330d42e313268130ec06d2b8d040174;origin=https://github.com/commons-app/apps-android-commons;lines=24-26/
ad9922c2413f45165459b6c91bc53e810628470e
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/MarkerPlaceGroup.java
MarkerPlaceGroup::setIsBookmarked(boolean isBookmarked)
function
public void setIsBookmarked(boolean isBookmarked) { this.isBookmarked = isBookmarked; }
6,787
5eba59286f3a91014278f042877f1262
swh:1:cnt:ebe5bc1115d072c663aff27f7c7ee1ca00d587b8;origin=https://github.com/commons-app/apps-android-commons;lines=21-326/
8982e278dd4d30680d45f8603a0f22f7372c06bc
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java
NearbyController
type
public class NearbyController extends MapController { private final NearbyPlaces nearbyPlaces; public static final int MAX_RESULTS = 1000; // Flag to track if an internal upload flow is active. public boolean isInternalUploadInProgress = false; public static double currentLocationSearchRadius = 10....
6,788
95cea81590601b24ab20bf01fc7a9de9
swh:1:cnt:ebe5bc1115d072c663aff27f7c7ee1ca00d587b8;origin=https://github.com/commons-app/apps-android-commons;lines=122-127/
8982e278dd4d30680d45f8603a0f22f7372c06bc
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java
NearbyController::getPlacesAsKML(LatLng currentLocation)
function
public String getPlacesAsKML(LatLng currentLocation) throws Exception { return nearbyPlaces.getPlacesAsKML( calculateSouthWest(currentLocation.getLatitude(), currentLocation.getLongitude(), 10), calculateNorthEast(currentLocation.getLatitude(), currentLocation.getLongitude(), 10) ...
6,789
36e1f79902b0feafbfb9739bddb4cfd2
swh:1:cnt:ebe5bc1115d072c663aff27f7c7ee1ca00d587b8;origin=https://github.com/commons-app/apps-android-commons;lines=136-145/
8982e278dd4d30680d45f8603a0f22f7372c06bc
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java
NearbyController::getPlaces(List<Place> placeList)
function
/** * Retrieves a list of places based on the provided list of places and language. * * @param placeList A list of Place objects for which to fetch information. * @return A list of Place objects obtained from the Wikidata query. * @throws Exception If an error occurs during the retrieval proces...
6,790
429f64821fe141c0a5c6610028c07944
swh:1:cnt:ebe5bc1115d072c663aff27f7c7ee1ca00d587b8;origin=https://github.com/commons-app/apps-android-commons;lines=167-258/
8982e278dd4d30680d45f8603a0f22f7372c06bc
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java
NearbyController::loadAttractionsFromLocation(final LatLng currentLatLng, final fr.free.nrw.commons.location.LatLng screenTopRight, final fr.free.nrw.commons.location.LatLng screenBottomLeft, final LatLng searchLatLng, final boolean returnClosestResult, final boolean checkingAroundCurrentLocatio...
function
/** * Prepares Place list to make their distance information update later. * * @param currentLatLng The current latitude and longitude. * @param screenTopRight The top right corner of the screen (latitude, * longitude). * ...
6,791
3e0afe7b4750b5d2a59a4a9fee4a756c
swh:1:cnt:ebe5bc1115d072c663aff27f7c7ee1ca00d587b8;origin=https://github.com/commons-app/apps-android-commons;lines=277-306/
8982e278dd4d30680d45f8603a0f22f7372c06bc
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java
NearbyController::loadAttractionsFromLocationToBaseMarkerOptions( LatLng currentLatLng, List<Place> placeList)
function
/** * Loads attractions from location for map view, we need to return BaseMarkerOption data type. * * @param currentLatLng users current location * @param placeList list of nearby places in Place data type * @return BaseMarkerOptions list that holds nearby places */ public static L...
6,792
c703a1774db0e09ff51e4bbf853ede6a
swh:1:cnt:ebe5bc1115d072c663aff27f7c7ee1ca00d587b8;origin=https://github.com/commons-app/apps-android-commons;lines=309-325/
8982e278dd4d30680d45f8603a0f22f7372c06bc
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java
NearbyController::updateMarkerLabelListBookmark(Place place, boolean isBookmarked)
function
/** * Updates makerLabelList item isBookmarked value * * @param place place which is bookmarked * @param isBookmarked true is bookmarked, false if bookmark removed */ @MainThread public static void updateMarkerLabelListBookmark(Place place, boolean isBookmarked) { for (Li...
6,793
6c554802490daf03bf042becccbd509e
swh:1:cnt:ebe5bc1115d072c663aff27f7c7ee1ca00d587b8;origin=https://github.com/commons-app/apps-android-commons;lines=147-155/
8982e278dd4d30680d45f8603a0f22f7372c06bc
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java
NearbyController::calculateNorthEast(double latitude, double longitude, double distance)
function
public static LatLng calculateNorthEast(double latitude, double longitude, double distance) { double lat1 = Math.toRadians(latitude); double deltaLat = distance * 0.008; double deltaLon = distance / Math.cos(lat1)*0.008; double lat2 = latitude + deltaLat; double lon2 = longitude ...
6,794
9795c27cae21b240ee912e4827d1e8e0
swh:1:cnt:ebe5bc1115d072c663aff27f7c7ee1ca00d587b8;origin=https://github.com/commons-app/apps-android-commons;lines=129-134/
8982e278dd4d30680d45f8603a0f22f7372c06bc
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java
NearbyController::getPlacesAsGPX(LatLng currentLocation)
function
public String getPlacesAsGPX(LatLng currentLocation) throws Exception { return nearbyPlaces.getPlacesAsGPX( calculateSouthWest(currentLocation.getLatitude(), currentLocation.getLongitude(), 10), calculateNorthEast(currentLocation.getLatitude(), currentLocation.getLongitude(), 10) ...
6,795
bf599a154dbe6a41f9e8107503c27910
swh:1:cnt:ebe5bc1115d072c663aff27f7c7ee1ca00d587b8;origin=https://github.com/commons-app/apps-android-commons;lines=40-120/
8982e278dd4d30680d45f8603a0f22f7372c06bc
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java
NearbyController::loadAttractionsFromLocation(final LatLng currentLatLng, final LatLng searchLatLng, final boolean returnClosestResult, final boolean checkingAroundCurrentLocation, @Nullable final String customQuery)
function
/** * Prepares Place list to make their distance information update later. * * @param currentLatLng current location for user * @param searchLatLng the location user wants to search around * @param returnClosestResult if this search is done to find closest result or all results ...
6,796
44cd6c44356eb2b4239498cb23b96823
swh:1:cnt:ebe5bc1115d072c663aff27f7c7ee1ca00d587b8;origin=https://github.com/commons-app/apps-android-commons;lines=157-165/
8982e278dd4d30680d45f8603a0f22f7372c06bc
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java
NearbyController::calculateSouthWest(double latitude, double longitude, double distance)
function
public static LatLng calculateSouthWest(double latitude, double longitude, double distance) { double lat1 = Math.toRadians(latitude); double deltaLat = distance * 0.008; double deltaLon = distance / Math.cos(lat1)*0.008; double lat2 = latitude - deltaLat; double lon2 = longitude ...
6,797
ac3511c8bf780f614d7480b92a7f3027
swh:1:cnt:ebe5bc1115d072c663aff27f7c7ee1ca00d587b8;origin=https://github.com/commons-app/apps-android-commons;lines=260-275/
8982e278dd4d30680d45f8603a0f22f7372c06bc
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java
NearbyController::loadAttractionsFromLocation(final LatLng currentLatLng, final LatLng searchLatLng, final boolean returnClosestResult, final boolean checkingAroundCurrentLocation)
function
/** * Prepares Place list to make their distance information update later. * * @param currentLatLng current location for user * @param searchLatLng the location user wants to search around * @param returnClosestResult if this search is done to find closest result or all results ...
6,798
b02f04d365e69d67193bbdbf1d9f2460
swh:1:cnt:491c1abffb34746a4af569567b8f5092be03a17e;origin=https://github.com/commons-app/apps-android-commons;lines=7-21/
37987cffd43423390cf2d91f522798aabadd489d
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/NearbyfilterSearchListView.java
NearbyfilterSearchListView
type
public class NearbyfilterSearchListView extends ListView { public NearbyfilterSearchListView(Context context) { super(context); } public NearbyfilterSearchListView(Context context, AttributeSet attrs) { super(context, attrs); } public NearbyfilterSearchListView(Context context, Att...
6,799
5df024047da6fc8b7c4e4177452ee062
swh:1:cnt:53e9970a6527a6b3c357c68bd51e783b1f33e59b;origin=https://github.com/commons-app/apps-android-commons;lines=22-181/
8c0c298a119dca82868cfcbfc279c46078425b2e
apps-android-commons
apps
app/src/main/java/fr/free/nrw/commons/nearby/NearbyFilterSearchRecyclerViewAdapter.java
NearbyFilterSearchRecyclerViewAdapter
type
public class NearbyFilterSearchRecyclerViewAdapter extends RecyclerView.Adapter<NearbyFilterSearchRecyclerViewAdapter.RecyclerViewHolder> implements Filterable { private final LayoutInflater inflater; private Context context; private ArrayList<Label> labels; private ArrayList<Label> dis...