<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -48,7 +48,10 @@ var parse = Processing.parse = function parse( aCode, p ) {
       return &quot;Processing.&quot; + name + &quot; = function &quot; + name + args;
     }
   });
-
+    
+  // Attach import() to p{} bypassing JS command, allowing for extrernal library loading
+  aCode = aCode.replace(/import \(|import\(/g, &quot;p.import(&quot;);
+  
   // Force .length() to be .length
   aCode = aCode.replace(/\.length\(\)/g, &quot;.length&quot;);
 
@@ -117,6 +120,7 @@ var parse = Processing.parse = function parse( aCode, p ) {
       vars
         .replace(/,\s?/g, &quot;;\n  this.&quot;)
         .replace(/\b(var |final |public )+\s*/g, &quot;this.&quot;)
+        .replace(/\b(var |final |public )+\s*/g, &quot;this.&quot;)
         .replace(/this.(\w+);/g, &quot;this.$1 = null;&quot;) + 
         (extend ? &quot;extendClass(this, &quot; + extend + &quot;);\n&quot; : &quot;&quot;) +
         &quot;&lt;CLASS &quot; + name + &quot; &quot; + static + &quot;&gt;&quot; + (typeof last == &quot;string&quot; ? last : name + &quot;(&quot;);
@@ -243,6 +247,9 @@ function buildProcessing( curElement ){
             
   var p = {};
   
+  // Eval imported libraries  
+  //for( var i = 0; var len = libs
+  
   // init
   p.PI = Math.PI;
   p.TWO_PI = 2 * p.PI;
@@ -263,7 +270,7 @@ function buildProcessing( curElement ){
   p.CORNERS = 10;
   p.CLOSE = true;
   p.RGB = 1;
-  p.HSB = 2;
+  p.HSB = 2;  
 
   // mouseButton constants: values adjusted to come directly from e.which
   // CONFLICT: LEFT and RIGHT are keyboard values in Processing already. - F1lT3R         
@@ -305,7 +312,7 @@ function buildProcessing( curElement ){
   var curColorMode = p.RGB;
   var curTint = -1;
   var curTextSize = 12;
-  var curTextFont = &quot;Arial&quot;;  
+  var curTextFont = &quot;Arial&quot;;
   var getLoaded = false;
   var start = (new Date).getTime();
   
@@ -358,7 +365,11 @@ function buildProcessing( curElement ){
        AJAX.send(null);
        return AJAX.responseText;
     }else{return false;}
-  }              
+  }
+  
+  p.import = function import(lib){
+    eval(p.ajax(lib)); 
+  }
   
   // Load a file or URL into strings     
   p.loadStrings = function loadStrings(url) {</diff>
      <filename>processing.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,13 @@
+
 (function(){this.Processing=function Processing(aElement,aCode){if(typeof aElement==&quot;string&quot;)
 aElement=document.getElementById(aElement);var p=buildProcessing(aElement);if(aCode)
 p.init(aCode);return p;};function log(){try{console.log.apply(console,arguments);}catch(e){try{opera.postError.apply(opera,arguments);}catch(e){}}}
-var parse=Processing.parse=function parse(aCode,p){aCode=aCode.replace(/\/\/ .*\n/g,&quot;\n&quot;);aCode=aCode.replace(/([^\s])%([^\s])/g,&quot;$1 % $2&quot;);aCode=aCode.replace(/(?:static )?(\w+ )(\w+)\s*(\([^\)]*\)\s*{)/g,function(all,type,name,args){if(name==&quot;if&quot;||name==&quot;for&quot;||name==&quot;while&quot;){return all;}else{return&quot;Processing.&quot;+name+&quot; = function &quot;+name+args;}});aCode=aCode.replace(/\.length\(\)/g,&quot;.length&quot;);aCode=aCode.replace(/([\(,]\s*)(\w+)((?:\[\])+| )\s*(\w+\s*[\),])/g,&quot;$1$4&quot;);aCode=aCode.replace(/([\(,]\s*)(\w+)((?:\[\])+| )\s*(\w+\s*[\),])/g,&quot;$1$4&quot;);aCode=aCode.replace(/new (\w+)((?:\[([^\]]*)\])+)/g,function(all,name,args){return&quot;new ArrayList(&quot;+args.slice(1,-1).split(&quot;][&quot;).join(&quot;, &quot;)+&quot;)&quot;;});aCode=aCode.replace(/(?:static )?\w+\[\]\s*(\w+)\[?\]?\s*=\s*{.*?};/g,function(all){return all.replace(/{/g,&quot;[&quot;).replace(/}/g,&quot;]&quot;);});var intFloat=/(\n\s*(?:int|float)(?:\[\])?(?:\s*|[^\(]*?,\s*))([a-z]\w*)(;|,)/i;while(intFloat.test(aCode)){aCode=aCode.replace(new RegExp(intFloat),function(all,type,name,sep){return type+&quot; &quot;+name+&quot; = 0&quot;+sep;});}
+var parse=Processing.parse=function parse(aCode,p){aCode=aCode.replace(/\/\/ .*\n/g,&quot;\n&quot;);aCode=aCode.replace(/([^\s])%([^\s])/g,&quot;$1 % $2&quot;);aCode=aCode.replace(/(?:static )?(\w+ )(\w+)\s*(\([^\)]*\)\s*{)/g,function(all,type,name,args){if(name==&quot;if&quot;||name==&quot;for&quot;||name==&quot;while&quot;){return all;}else{return&quot;Processing.&quot;+name+&quot; = function &quot;+name+args;}});aCode=aCode.replace(/import \(|import\(/g,&quot;p.import(&quot;);aCode=aCode.replace(/\.length\(\)/g,&quot;.length&quot;);aCode=aCode.replace(/([\(,]\s*)(\w+)((?:\[\])+| )\s*(\w+\s*[\),])/g,&quot;$1$4&quot;);aCode=aCode.replace(/([\(,]\s*)(\w+)((?:\[\])+| )\s*(\w+\s*[\),])/g,&quot;$1$4&quot;);aCode=aCode.replace(/new (\w+)((?:\[([^\]]*)\])+)/g,function(all,name,args){return&quot;new ArrayList(&quot;+args.slice(1,-1).split(&quot;][&quot;).join(&quot;, &quot;)+&quot;)&quot;;});aCode=aCode.replace(/(?:static )?\w+\[\]\s*(\w+)\[?\]?\s*=\s*{.*?};/g,function(all){return all.replace(/{/g,&quot;[&quot;).replace(/}/g,&quot;]&quot;);});var intFloat=/(\n\s*(?:int|float)(?:\[\])?(?:\s*|[^\(]*?,\s*))([a-z]\w*)(;|,)/i;while(intFloat.test(aCode)){aCode=aCode.replace(new RegExp(intFloat),function(all,type,name,sep){return type+&quot; &quot;+name+&quot; = 0&quot;+sep;});}
 aCode=aCode.replace(/(?:static )?(\w+)((?:\[\])+| ) *(\w+)\[?\]?(\s*[=,;])/g,function(all,type,arr,name,sep){if(type==&quot;return&quot;)
 return all;else
 return&quot;var &quot;+name+sep;});aCode=aCode.replace(/=\s*{((.|\s)*?)};/g,function(all,data){return&quot;= [&quot;+data.replace(/{/g,&quot;[&quot;).replace(/}/g,&quot;]&quot;)+&quot;]&quot;;});aCode=aCode.replace(/static\s*{((.|\n)*?)}/g,function(all,init){return init;});aCode=aCode.replace(/super\(/g,&quot;superMethod(&quot;);var classes=[&quot;int&quot;,&quot;float&quot;,&quot;boolean&quot;,&quot;string&quot;];function ClassReplace(all,name,extend,vars,last){classes.push(name);var static=&quot;&quot;;vars=vars.replace(/final\s+var\s+(\w+\s*=\s*.*?;)/g,function(all,set){static+=&quot; &quot;+name+&quot;.&quot;+set;return&quot;&quot;;});return&quot;function &quot;+name+&quot;() {with(this){\n  &quot;+
 (extend?&quot;var __self=this;function superMethod(){extendClass(__self,arguments,&quot;+extend+&quot;);}\n&quot;:&quot;&quot;)+
-vars.replace(/,\s?/g,&quot;;\n  this.&quot;).replace(/\b(var |final |public )+\s*/g,&quot;this.&quot;).replace(/this.(\w+);/g,&quot;this.$1 = null;&quot;)+
+vars.replace(/,\s?/g,&quot;;\n  this.&quot;).replace(/\b(var |final |public )+\s*/g,&quot;this.&quot;).replace(/\b(var |final |public )+\s*/g,&quot;this.&quot;).replace(/this.(\w+);/g,&quot;this.$1 = null;&quot;)+
 (extend?&quot;extendClass(this, &quot;+extend+&quot;);\n&quot;:&quot;&quot;)+&quot;&lt;CLASS &quot;+name+&quot; &quot;+static+&quot;&gt;&quot;+(typeof last==&quot;string&quot;?last:name+&quot;(&quot;);}
 var matchClasses=/(?:public |abstract |static )*class (\w+)\s*(?:extends\s*(\w+)\s*)?{\s*((?:.|\n)*?)\b\1\s*\(/g;var matchNoCon=/(?:public |abstract |static )*class (\w+)\s*(?:extends\s*(\w+)\s*)?{\s*((?:.|\n)*?)(Processing)/g;aCode=aCode.replace(matchClasses,ClassReplace);aCode=aCode.replace(matchNoCon,ClassReplace);var matchClass=/&lt;CLASS (\w+) (.*?)&gt;/,m;while((m=aCode.match(matchClass))){var left=RegExp.leftContext,allRest=RegExp.rightContext,rest=nextBrace(allRest),className=m[1],staticVars=m[2]||&quot;&quot;;allRest=allRest.slice(rest.length+1);rest=rest.replace(new RegExp(&quot;\\b&quot;+className+&quot;\\(([^\\)]*?)\\)\\s*{&quot;,&quot;g&quot;),function(all,args){args=args.split(/,\s*?/);if(args[0].match(/^\s*$/))
 args.shift();var fn=&quot;if ( arguments.length == &quot;+args.length+&quot; ) {\n&quot;;for(var i=0;i&lt;args.length;i++){fn+=&quot;    var &quot;+args[i]+&quot; = arguments[&quot;+i+&quot;];\n&quot;;}
@@ -20,6 +21,7 @@ return aCode;};function buildProcessing(curElement){var p={};p.PI=Math.PI;p.TWO_
 p.ajax=function(url){if(window.XMLHttpRequest){AJAX=new XMLHttpRequest();}
 else{AJAX=new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);}
 if(AJAX){AJAX.open(&quot;GET&quot;,url,false);AJAX.send(null);return AJAX.responseText;}else{return false;}}
+p.import=function import(lib){eval(p.ajax(lib));}
 p.loadStrings=function loadStrings(url){return p.ajax(url).split(&quot;\n&quot;);};p.color=function color(aValue1,aValue2,aValue3,aValue4){var aColor=&quot;&quot;;if(arguments.length==3){aColor=p.color(aValue1,aValue2,aValue3,opacityRange);}else if(arguments.length==4){var a=aValue4/opacityRange;a=isNaN(a)?1:a;if(curColorMode==p.HSB){var rgb=HSBtoRGB(aValue1,aValue2,aValue3);var r=rgb[0],g=rgb[1],b=rgb[2];}else{var r=getColor(aValue1,redRange);var g=getColor(aValue2,greenRange);var b=getColor(aValue3,blueRange);}
 aColor=&quot;rgba(&quot;+r+&quot;,&quot;+g+&quot;,&quot;+b+&quot;,&quot;+a+&quot;)&quot;;}else if(typeof aValue1==&quot;string&quot;){aColor=aValue1;if(arguments.length==2){var c=aColor.split(&quot;,&quot;);c[3]=(aValue2/opacityRange)+&quot;)&quot;;aColor=c.join(&quot;,&quot;);}}else if(arguments.length==2){aColor=p.color(aValue1,aValue1,aValue1,aValue2);}else if(typeof aValue1==&quot;number&quot;){aColor=p.color(aValue1,aValue1,aValue1,opacityRange);}else{aColor=p.color(redRange,greenRange,blueRange,opacityRange);}
 function HSBtoRGB(h,s,b){h=(h/redRange)*360;s=(s/greenRange)*100;b=(b/blueRange)*100;var br=Math.round(b/100*255);if(s==0){return[br,br,br];}else{var hue=h%360;var f=hue%60;var p=Math.round((b*(100-s))/10000*255);var q=Math.round((b*(6000-s*f))/600000*255);var t=Math.round((b*(6000-s*(60-f)))/600000*255);switch(Math.floor(hue/60)){case 0:return[br,t,p];case 1:return[q,br,p];case 2:return[p,br,t];case 3:return[p,q,br];case 4:return[t,p,br];case 5:return[br,p,q];}}}</diff>
      <filename>processing.min.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>661915cff4a5bb591ad10d04975e48b1e622b409</id>
    </parent>
  </parents>
  <author>
    <name>F1LT3R</name>
    <email>director@hyper-metrix.com</email>
  </author>
  <url>http://github.com/jeresig/processing-js/commit/b0b3cb81375f01d580ff6ca133ad35339cdedd16</url>
  <id>b0b3cb81375f01d580ff6ca133ad35339cdedd16</id>
  <committed-date>2009-05-25T12:35:50-07:00</committed-date>
  <authored-date>2009-05-25T12:35:50-07:00</authored-date>
  <message>Added import(library) support.</message>
  <tree>14a32fd28dee74a0c043c05330f8b621d19fd203</tree>
  <committer>
    <name>F1LT3R</name>
    <email>director@hyper-metrix.com</email>
  </committer>
</commit>
