home *** CD-ROM | disk | FTP | other *** search
/ Freelog 100 / FreelogNo100-NovembreDecembre2010.iso / Graphisme / GoogleSketchUp / GoogleSketchUpWFR.exe / GoogleSketchUp8.msi / SketchUpMeta.cab / functions.js.78D17A5F_0E0A_44D2_877D_2C56D45D16B7 < prev    next >
Encoding:
Text File  |  2010-08-26  |  10.1 KB  |  304 lines

  1. //  Copyright: Copyright 2008 Google Inc.
  2. //  License: All Rights Reserved.
  3.  
  4. /**
  5.  * @fileoverview Adds the functionList object to our comp namespace (defined
  6.  * in components.js.) Supports embedded function documentation inside the
  7.  * SketchUp Create Options dialog panel.
  8.  */
  9.  
  10. // Export comp namespace. See components.js for definition.
  11. var comp = window.comp;
  12.  
  13. /**
  14.  * This object contains names and summaries for the functions
  15.  * that are currently supported in Dynamic Components.
  16.  * @type {Object}
  17.  */
  18. comp.functionList = {
  19.   'Math Functions': [{
  20.       name: 'ABS (number)',
  21.       summary: 'Returns the absolute value of a given number.'
  22.     },{
  23.       name: 'CEILING (number,significance)',
  24.       summary: 'Rounds up to the nearest integer or multiple of significance.'
  25.     },{
  26.       name: 'DEGREES (number)',
  27.       summary: 'Converts a given number in radians to degrees.'
  28.     },{
  29.       name: 'EVEN (number)',
  30.       summary: 'Rounds a given number up to the nearest even integer.'
  31.     },{
  32.       name: 'EXP (number)',
  33.       summary: 'Returns e raised to the power of a given number.'
  34.     },{
  35.       name: 'FLOOR (number,significance)',
  36.       summary: 'Rounds down to the nearest integer or multiple of significance.'
  37.     },{
  38.       name: 'INT (number)',
  39.       summary: 'Rounds a given number down to the nearest integer.'
  40.     },{
  41.       name: 'ISEVEN (number)',
  42.       summary: 'Returns TRUE if a given value is even,or FALSE if not.'
  43.     },{
  44.       name: 'ISODD (number)',
  45.       summary: 'Returns TRUE if a given value is odd,or FALSE if not.'
  46.     },{
  47.       name: 'LN (number)',
  48.       summary: 'Returns natural logarithm based on constant e of a number.'
  49.     },{
  50.       name: 'LOG10 (number)',
  51.       summary: 'Returns the base-10 logarithm of a given number.'
  52.     },{
  53.       name: 'ODD (number)',
  54.       summary: 'Rounds a given number up to the nearest odd integer.'
  55.     },{
  56.       name: 'POWER (base,power)',
  57.       summary: 'Returns a base number raised to a power.'
  58.     },{
  59.       name: 'PI ()',
  60.       summary: 'Returns the value of PI.'
  61.     },{
  62.       name: 'RADIANS (number)',
  63.       summary: 'Converts a given number in degrees to radians.'
  64.     },{
  65.       name: 'RAND ()',
  66.       summary: 'Returns a random number between 0 and 1.'
  67.     },{
  68.       name: 'RANDBETWEEN (bottom,top)',
  69.       summary: 'Returns random integer between bottom and top (inclusive).'
  70.     },{
  71.       name: 'ROUND (number,decimal_places)',
  72.       summary: 'Rounds a given value to a given number of decimal places.'
  73.     },{
  74.       name: 'SIGN (number)',
  75.       summary: 'Returns 1 for a positive number,-1 for negative,or 0.'
  76.     },{
  77.       name: 'SQRT (number)',
  78.       summary: 'Returns the square root of a given positive number.'
  79.     }
  80.   ],
  81.   'SketchUp Functions': [{
  82.       name: 'CHOOSE (index,value1,value2,...valueN)',
  83.       summary: 'Returns a value from a list,based on an index into that list.'
  84.     },{
  85.       name: 'CURRENT ("attributeName")',
  86.       summary: 'Returns the current attribute value,as last set by the user.'
  87.     },{
  88.       name: 'EDGES ()',
  89.       summary: 'Returns total ungrouped edges in current component.'
  90.     },{
  91.       name: 'FACEAREA ("materialName")',
  92.       summary: 'Returns area (in square inches) painted with a given material.'
  93.     },{
  94.       name: 'FACES ()',
  95.       summary: 'Returns total ungrouped faces in current component.'
  96.     },{
  97.       name: 'LARGEST (value1,value2,...valueN)',
  98.       summary: 'Returns the largest of the values in a list.'
  99.     },{
  100.       name: 'LAT ()',
  101.       summary: 'Returns the latitude of the current SketchUp model.'
  102.     },{
  103.       name: 'LNG ()',
  104.       summary: 'Returns the longitude of the current SketchUp model.'
  105.     },{
  106.       name: 'NEAREST (originalValue,value1,value2,...valueN)',
  107.       summary: 'Compares a number with a list,and returns closest match.'
  108.     },{
  109.       name: 'OPTIONINDEX ("attributeName")',
  110.       summary: 'Returns selected index from an attribute\'s option list.'
  111.     },{
  112.       name: 'OPTIONLABEL ("attributeName")',
  113.       summary: 'Returns selected label from an attribute\'s option list.'
  114.     },{
  115.       name: 'SMALLEST (value1,value2,...valueN)',
  116.       summary: 'Returns the smallest of the values in a list.'
  117.     },{
  118.       name: 'SUNANGLE ()',
  119.       summary: 'Returns the angle (in degrees) between the sun and north.'
  120.     },{
  121.       name: 'SUNELEVATION ()',
  122.       summary: 'Returns the elevation (in degrees) of the sun.'
  123.     }
  124.   ],
  125.   'Text Functions': [{
  126.       name: 'CHAR (number)',
  127.       summary: 'Converts an ASCII code between 0 and 255 to a character.'
  128.     },{
  129.       name: 'CODE (text)',
  130.       summary: 'Returns the ASCII code for the first letter in some text.'
  131.     },{
  132.       name: 'CONCATENATE (text1,text2,...textN)',
  133.       summary: 'Combines several text strings into one string.'
  134.     },{
  135.       name: 'DOLLAR (value,decimals)',
  136.       summary: 'Formats number as currency,to 2 decimal places by default.'
  137.     },{
  138.       name: 'EXACT (text1,text2)',
  139.       summary: 'Compares two strings and returns TRUE if they are identical.'
  140.     },{
  141.       name: 'FIND (findText,text,position)',
  142.       summary: 'Returns the position of findText inside text.'
  143.     },{
  144.       name: 'LEFT (text,number)',
  145.       summary: 'Returns the first character or characters in a text string.'
  146.     },{
  147.       name: 'LEN (text)',
  148.       summary: 'Returns the length of a string including spaces.'
  149.     },{
  150.       name: 'LOWER (text)',
  151.       summary: 'Converts all uppercase letters in a text string to lowercase.'
  152.     },{
  153.       name: 'MID (text,start,number)',
  154.       summary: 'Returns a substring from a given start and length.'
  155.     },{
  156.       name: 'PROPER (text)',
  157.       summary: 'Capitalizes the first letter in all words of a text string.'
  158.     },{
  159.       name: 'REPLACE (text,position,length,new)',
  160.       summary: 'Replaces part of one text string with another.'
  161.     },{
  162.       name: 'REPT (text,number)',
  163.       summary: 'Repeats a character string by a given number of copies.'
  164.     },{
  165.       name: 'RIGHT (text,number)',
  166.       summary: 'Returns the last character or characters in a text string.'
  167.     },{
  168.       name: 'SUBSTITUTE (text,searchText,newText,occurrence)',
  169.       summary: 'Substitutes new text for search text in a string.'
  170.     },{
  171.       name: 'TRIM (text)',
  172.       summary: 'Removes spaces that are in front of a string.'
  173.     },{
  174.       name: 'UPPER (text)',
  175.       summary: 'Converts all lowercase letters in a text string to uppercase.'
  176.     },{
  177.       name: 'VALUE (text)',
  178.       summary: 'Converts a text string into a number.'
  179.     }
  180.   ],
  181.   'Trig Functions': [{
  182.       name: 'ACOS (number)',
  183.       summary: 'Returns inverse cosine of a number in degrees.'
  184.     },{
  185.       name: 'ACOSH (number)',
  186.       summary: 'Returns inverse hyperbolic cosine of a number in degrees.'
  187.     },{
  188.       name: 'ASIN (number)',
  189.       summary: 'Returns inverse sine of a number in degrees.'
  190.     },{
  191.       name: 'ASINH (number)',
  192.       summary: 'Returns inverse hyperbolic sine of a number in degrees.'
  193.     },{
  194.       name: 'ATAN (number)',
  195.       summary: 'Returns inverse tangent of a number in degrees.'
  196.     },{
  197.       name: 'ATANH (number)',
  198.       summary: 'Returns inverse hyperbolic tangent of a number in degrees.'
  199.     },{
  200.       name: 'COS (number)',
  201.       summary: 'Returns the cosine of a number (angle in degrees).'
  202.     },{
  203.       name: 'COSH (number)',
  204.       summary: 'Returns hyperbolic cosine of a number (angle in degrees).'
  205.     },{
  206.       name: 'SIN (number)',
  207.       summary: 'Returns the sine of a number (angle in degrees).'
  208.     },{
  209.       name: 'SINH (number)',
  210.       summary: 'Returns hyperbolic sine of a number (angle in degrees).'
  211.     },{
  212.       name: 'TAN (number)',
  213.       summary: 'Returns the tangent of a number (angle in degrees).'
  214.     },{
  215.       name: 'TANH (number)',
  216.       summary: 'Returns hyperbolic tangent of a number (angle in degrees).'
  217.     }
  218.   ],
  219.   'Logical Functions': [{
  220.       name: 'AND (logicalValue1,logicalValue2,...logicalValueN)',
  221.       summary: 'Returns TRUE if all arguments are TRUE.'
  222.     },{
  223.       name: 'FALSE ()',
  224.       summary: 'Returns FALSE.'
  225.     },{
  226.       name: 'IF (test,thenValue,elseValue)',
  227.       summary: 'Performs a logical test,then returns one of two results.'
  228.     },{
  229.       name: 'NOT (logicalValue)',
  230.       summary: 'Reverses the logical value.'
  231.     },{
  232.       name: 'OR (logicalValue1,logicalValue2,...logicalValueN)',
  233.       summary: 'Returns TRUE if at least one argument is TRUE.'
  234.     },{
  235.       name: 'TRUE ()',
  236.       summary: 'Returns TRUE.'
  237.     }
  238.   ],
  239.   'onClick Functions': [{
  240.       name: 'ALERT ("message")',
  241.       summary: 'Shows an alert box with a text string.'
  242.     },{
  243.       name: 'ANIMATE ("attribute",state1,state2,...stateN)',
  244.       summary: 'Animates an attribute over .5 seconds with default easing.'
  245.     },{
  246.       name: 'ANIMATEFAST ("attribute",state1,state2,...stateN)',
  247.       summary: 'Animates an attribute over .25 seconds with default easing.'
  248.     },{
  249.       name: 'ANIMATECUSTOM ("att",time,easein,out,state1,...stateN)',
  250.       summary: 'Animates over arbitrary time with custom easing (0-100)'
  251.     },{
  252.       name: 'ANIMATESLOW ("attribute",state1,state2,...stateN)',
  253.       summary: 'Animates an attribute over 1 second with default easing.'
  254.     },{
  255.       name: 'GOTOSCENE ("sceneName",time,easein,easeout)',
  256.       summary: 'Animates camera to a scene identified by name or by number.'
  257.     },{
  258.       name: 'REDRAW ()',
  259.       summary: 'Redraws the component that contains this function.'
  260.     },{
  261.       name: 'SET ("attribute",state1,state2,...stateN)',
  262.       summary: 'Sets a given attribute to the next value in a list.'
  263.     }
  264.   ],
  265.   'Operators': [{
  266.       name: '+',
  267.       summary: 'Addition of numbers.'
  268.     },{
  269.       name: '-',
  270.       summary: 'Subtraction of numbers.'
  271.     },{
  272.       name: '*',
  273.       summary: 'Multiplication of numbers.'
  274.     },{
  275.       name: '/',
  276.       summary: 'Division of numbers.'
  277.     },{
  278.       name: '&',
  279.       summary: 'Concatenation of text.'
  280.     },{
  281.       name: '()',
  282.       summary: 'Parenthesis (for grouping).'
  283.     },{
  284.       name: '<',
  285.       summary: 'Less than.'
  286.     },{
  287.       name: '>',
  288.       summary: 'Greater than.'
  289.     },{
  290.       name: '=',
  291.       summary: 'Equal to.'
  292.     },{
  293.       name: '<=',
  294.       summary: 'Less than or equal to.'
  295.     },{
  296.       name: '>=',
  297.       summary: 'Greater than or equal to.'
  298.     },{
  299.       name: '<>',
  300.       summary: 'Not equal to.'
  301.     }
  302.   ]
  303. }
  304.