Benoît Bar avatar Benoît Bar committed af4d36b

fixbugs

Comments (0)

Files changed (5)

example/notifier/main.js

 $(document).ready(function(){
-    var notifier = new _.Notifier(_.notifier.stacking.APPEND, 2000);
+    var notifier = new jscop.Notifier(jscop.notifier.stacking.APPEND, 2000);
     $(document).click(function(event){
         notifier.notify('Position : ' + event.pageX + ', ' + event.pageY);
     });

misc/build/build.properties

 #jscop/game/canvas.js, jscop/game/shape.js, jscop/game/frame.js, jscop/game/control.js, jscop/game/parallax.js, jscop/game/collision.js
 #jquery
 #jscop/jquery/rating.js, jscop/jquery/scrollcall.js, jscop/jquery/imageloader.js
-js.list = jscop/jscop.js, jscop/core/string.js, jscop/core/date.js, jscop/core/array.js, jscop/core/math.js, jscop/core/extend.js, jscop/core/utils.js, jscop/core/logger.js, jscop/display/loader.js, jscop/jquery/scrollcall.js, jscop/jquery/imageloader.js 
+js.list = jscop/jscop.js, jscop/core/string.js, jscop/core/date.js, jscop/core/array.js, jscop/core/math.js, jscop/core/extend.js, jscop/core/utils.js, jscop/core/logger.js, jscop/game/canvas.js, jscop/game/shape.js
 js.version = 0.3
 compressor.jar = misc/lib/yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar

misc/build/build.xml

 		<delete file="${file}" quiet="true"/>
 	</target>
 	
-    <target name="compress" depends="-init">
-    	<java jar="${jsdoc.dir}/jsrun.jar" fork="true" failonerror="true">
+	<target name="doc" depends="-init">
+		<java jar="${jsdoc.dir}/jsrun.jar" fork="true" failonerror="true">
             <arg line="${jsdoc.dir}/app/run.js"/>
             <arg line="-a"/>
             <arg line="-t=${jsdoc.dir}/templates/codeview.1.2"/>
             <arg line="-r=4"/>
             <arg line="${src.dir}"/>
         </java>
+	</target>
+	
+    <target name="compress" depends="-init">
         <antcall target="concat">
             <param name="dest" value="${dist.dir}/jscop-${js.version}.js"/>
             <param name="filelist" value="${js.list}"/>

src/jscop/display/loader.js

 
 /**
  * @ignore
- * @param container
- * @param options
- * @returns {ImageLoader}
  */
 jscop.ImageLoader = function ImageLoader(container, options){
+	var self = this;
 	var defaults = {
 		img : jscop.IMG_URL+'loader.gif',
 		alt : '...',
 		height : '16',
 		effect : 'fadeIn',
 		effectspeed : undefined,
-		onload: function(){}
+		onload: function(img){
+			img.attr('width', self.cache_width);
+			img.attr('height', self.cache_height);
+		}
 	};
 	this.opts = $.extend(defaults, options);
 		
 	this.container.attr('width', this.opts.width);
 	this.container.attr('height', this.opts.height);
 	this.container.addClass('inprogress');
-	
-	this.img = $('<img />', {
-		src: this.cache_src
-	});
-	
-	var self = this;
+
+	this.img = $('<img />');
 	this.img.bind('load', function(){
 		self.container.hide();
 		self.container.attr('src', self.cache_src);
 		self.container.attr('alt', self.cache_alt);
-		self.container.attr('width', self.cache_width);
-		self.container.attr('height', self.cache_height);
+		self.container.attr('width', self.img.get(0).width);
+		self.container.attr('height', self.img.get(0).height);
 		self.container.removeClass('inprogress');
 		self.container[self.opts.effect](self.opts.effectspeed);
 		self.opts.onload(self.container);
 	});
-};
+	
+	this.img.attr('src', this.cache_src);
+};

src/jscop/game/shape.js

     this.color = '#000000';
     this.width = width;
     this.height = height;
-    this.color = '#000000';
 };
 
 jscop.Rectangle.method('draw', function(graphics){
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.