From 7a3be864d05366d9601ba3ef4fc8181798e65b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Sat, 18 Jul 2015 18:13:01 -0300 Subject: [PATCH] Common: Fix indentation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some parts of the code had funky and inconsistent indentation. This change is trivial in the sense that it was automated by Emacs's indent-region command. This patch tries to make the indentation consistent with the standard of 4 spaces per level. Signed-off-by: Rogério Brito --- Common/MV.js | 293 +++++++++++++++++++++-------------------- Common/initShaders2.js | 72 +++++----- Common/webgl-utils.js | 174 ++++++++++++------------ 3 files changed, 269 insertions(+), 270 deletions(-) diff --git a/Common/MV.js b/Common/MV.js index 737b288..8960259 100644 --- a/Common/MV.js +++ b/Common/MV.js @@ -674,69 +674,69 @@ function printm(m) var i; if(m.length == 2) - for(i=0; i' + - '' + - '
' + - '
' + msg + '
' + - '
' + - ''; -}; + /** + * Creates the HTLM for a failure message + * @param {string} canvasContainerId id of container of th + * canvas. + * @return {string} The html. + */ + var makeFailHTML = function(msg) { + return '' + + '' + + '
' + + '
' + + '
' + msg + '
' + + '
' + + '
'; + }; -/** - * Mesasge for getting a webgl browser - * @type {string} - */ -var GET_A_WEBGL_BROWSER = '' + - 'This page requires a browser that supports WebGL.
' + - 'Click here to upgrade your browser.'; + /** + * Mesasge for getting a webgl browser + * @type {string} + */ + var GET_A_WEBGL_BROWSER = '' + + 'This page requires a browser that supports WebGL.
' + + 'Click here to upgrade your browser.'; -/** - * Mesasge for need better hardware - * @type {string} - */ -var OTHER_PROBLEM = '' + - "It doesn't appear your computer can support WebGL.
" + - 'Click here for more information.'; + /** + * Mesasge for need better hardware + * @type {string} + */ + var OTHER_PROBLEM = '' + + "It doesn't appear your computer can support WebGL.
" + + 'Click here for more information.'; -/** - * Creates a webgl context. If creation fails it will - * change the contents of the container of the - * tag to an error message with the correct links for WebGL. - * @param {Element} canvas. The canvas element to create a - * context from. - * @param {WebGLContextCreationAttirbutes} opt_attribs Any - * creation attributes you want to pass in. - * @return {WebGLRenderingContext} The created context. - */ -var setupWebGL = function(canvas, opt_attribs) { - function showLink(str) { - var container = canvas.parentNode; - if (container) { - container.innerHTML = makeFailHTML(str); - } - }; + /** + * Creates a webgl context. If creation fails it will + * change the contents of the container of the + * tag to an error message with the correct links for WebGL. + * @param {Element} canvas. The canvas element to create a + * context from. + * @param {WebGLContextCreationAttirbutes} opt_attribs Any + * creation attributes you want to pass in. + * @return {WebGLRenderingContext} The created context. + */ + var setupWebGL = function(canvas, opt_attribs) { + function showLink(str) { + var container = canvas.parentNode; + if (container) { + container.innerHTML = makeFailHTML(str); + } + }; - if (!window.WebGLRenderingContext) { - showLink(GET_A_WEBGL_BROWSER); - return null; - } + if (!window.WebGLRenderingContext) { + showLink(GET_A_WEBGL_BROWSER); + return null; + } - var context = create3DContext(canvas, opt_attribs); - if (!context) { - showLink(OTHER_PROBLEM); - } - return context; -}; + var context = create3DContext(canvas, opt_attribs); + if (!context) { + showLink(OTHER_PROBLEM); + } + return context; + }; -/** - * Creates a webgl context. - * @param {!Canvas} canvas The canvas tag to get context - * from. If one is not passed in one will be created. - * @return {!WebGLContext} The created context. - */ -var create3DContext = function(canvas, opt_attribs) { - var names = ["webgl", "experimental-webgl", "webkit-3d", "moz-webgl"]; - var context = null; - for (var ii = 0; ii < names.length; ++ii) { - try { - context = canvas.getContext(names[ii], opt_attribs); - } catch(e) {} - if (context) { - break; - } - } - return context; -}; + /** + * Creates a webgl context. + * @param {!Canvas} canvas The canvas tag to get context + * from. If one is not passed in one will be created. + * @return {!WebGLContext} The created context. + */ + var create3DContext = function(canvas, opt_attribs) { + var names = ["webgl", "experimental-webgl", "webkit-3d", "moz-webgl"]; + var context = null; + for (var ii = 0; ii < names.length; ++ii) { + try { + context = canvas.getContext(names[ii], opt_attribs); + } catch(e) {} + if (context) { + break; + } + } + return context; + }; -return { - create3DContext: create3DContext, - setupWebGL: setupWebGL -}; + return { + create3DContext: create3DContext, + setupWebGL: setupWebGL + }; }(); /** * Provides requestAnimationFrame in a cross browser way. */ window.requestAnimFrame = (function() { - return window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame || - function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) { - window.setTimeout(callback, 1000/60); - }; + return window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) { + window.setTimeout(callback, 1000/60); + }; })();