seed r808 - in trunk: examples examples/browser examples/clutter-shader examples/clutter-transitions examples/glib examples/opengl examples/pong examples/twitter tests/javascript
- From: hortont svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r808 - in trunk: examples examples/browser examples/clutter-shader examples/clutter-transitions examples/glib examples/opengl examples/pong examples/twitter tests/javascript
- Date: Sun, 25 Jan 2009 10:26:00 +0000 (UTC)
Author: hortont
Date: Sun Jan 25 10:26:00 2009
New Revision: 808
URL: http://svn.gnome.org/viewvc/seed?rev=808&view=rev
Log:
More JSLint fixes. That's all, for tonight.
Modified:
trunk/examples/browser/BrowserView.js
trunk/examples/browser/TabbedBrowser.js
trunk/examples/clutter-shader/ShaderView.js
trunk/examples/clutter-transitions/main.js
trunk/examples/clutter-transitions/transition-library.js
trunk/examples/glib/timeout.js
trunk/examples/opengl/seed-gears.js
trunk/examples/opengl/triangle-actor.js
trunk/examples/pong/pong.js
trunk/examples/poppler.js
trunk/examples/twitter/pretty.js
trunk/examples/twitter/twitter.js
trunk/tests/javascript/struct-union-enumerate.js
Modified: trunk/examples/browser/BrowserView.js
==============================================================================
--- trunk/examples/browser/BrowserView.js (original)
+++ trunk/examples/browser/BrowserView.js Sun Jan 25 10:26:00 2009
@@ -69,7 +69,7 @@
this.set_tab = function (new_tab)
{
tab = new_tab;
- }
+ };
this.get_tab = function ()
{
Modified: trunk/examples/browser/TabbedBrowser.js
==============================================================================
--- trunk/examples/browser/TabbedBrowser.js (original)
+++ trunk/examples/browser/TabbedBrowser.js Sun Jan 25 10:26:00 2009
@@ -19,7 +19,7 @@
{
var new_tab = new BrowserTab();
- if(new_web_view != null)
+ if(new_web_view)
new_tab.set_web_view(new_web_view);
else
new_tab.get_web_view().browse(url);
Modified: trunk/examples/clutter-shader/ShaderView.js
==============================================================================
--- trunk/examples/clutter-shader/ShaderView.js (original)
+++ trunk/examples/clutter-shader/ShaderView.js Sun Jan 25 10:26:00 2009
@@ -39,7 +39,7 @@
shader.enabled = true;
that.actor.set_shader(shader);
that.reflection.set_shader(shader);
- }
+ };
compile.signal.clicked.connect(this.make_shader, this);
}
Modified: trunk/examples/clutter-transitions/main.js
==============================================================================
--- trunk/examples/clutter-transitions/main.js (original)
+++ trunk/examples/clutter-transitions/main.js Sun Jan 25 10:26:00 2009
@@ -3,7 +3,7 @@
Seed.include("transition-library.js");
var stage = new Clutter.Stage();
-stage.signal.hide.connect(function(){Clutter.main_quit()});
+stage.signal.hide.connect(function(){Clutter.main_quit();});
stage.set_size(1024,768);
stage.show_all();
Modified: trunk/examples/clutter-transitions/transition-library.js
==============================================================================
--- trunk/examples/clutter-transitions/transition-library.js (original)
+++ trunk/examples/clutter-transitions/transition-library.js Sun Jan 25 10:26:00 2009
@@ -27,13 +27,13 @@
return Clutter.ALPHA_MAX_ALPHA*(7.5625*time*time);
else if (time < (2/2.75))
return Clutter.ALPHA_MAX_ALPHA*(7.5625 *
- (time-=(1.5/2.75))*time+.75);
+ (time-=(1.5/2.75))*time+0.75);
else if (time < (2.5/2.75))
return Clutter.ALPHA_MAX_ALPHA*(7.5625 *
- (time-=(2.25/2.75))*time+.9375);
+ (time-=(2.25/2.75))*time+0.9375);
else
return Clutter.ALPHA_MAX_ALPHA*(7.5625 * (time-=
- (2.625/2.75))*time+.984375);
+ (2.625/2.75))*time+0.984375);
}
catch (e)
@@ -235,7 +235,7 @@
var timeline = new Clutter.Timeline({num_frames:duration*global_fps, fps:global_fps});
var effect = new Clutter.EffectTemplate.c_new(timeline, Clutter.smoothstep_inc_func);
- var tiles = new Array();
+ var tiles = [ ];
var tile_w = stage.width / 8;
var tile_h = stage.height / 6;
@@ -280,9 +280,10 @@
function tiles(t)
{
+ var timeline;
with(t)
{
- var tiles = new Array();
+ var tiles = [ ];
var tile_w = stage.width / 8;
var tile_h = stage.height / 6;
@@ -313,26 +314,26 @@
for(var til in tiles)
{
- var timeline = new Clutter.Timeline({num_frames:(Math.random()+0.01)*duration*global_fps,
- fps:global_fps});
+ timeline = new Clutter.Timeline({num_frames:(Math.random()+0.01)*duration*global_fps,
+ fps:global_fps});
var effect = new Clutter.EffectTemplate.c_new(timeline, Clutter.ramp_inc_func);
Clutter.effect_rotate(effect, tiles[til], 1, 180, 0, 0, 0, Math.random()>0.5 ? 1 : 0);
Clutter.effect_fade(effect, tiles[til], 0);
}
- var timeline = new Clutter.Timeline({num_frames:duration*global_fps,
- fps:global_fps});
+ timeline = new Clutter.Timeline({num_frames:duration*global_fps,
+ fps:global_fps});
timeline.signal.completed.connect(function (timeline, tiles)
- {
- for(var til in tiles)
- {
- tiles[til].destroy();
- }
-
- done();
- }, tiles);
+ {
+ for(var til in tiles)
+ {
+ tiles[til].destroy();
+ }
+
+ done();
+ }, tiles);
timeline.start();
}
@@ -340,9 +341,10 @@
function tiles_across(t)
{
+ var timeline;
with(t)
{
- var tiles = new Array();
+ var tiles = [ ];
var tile_w = stage.width / 8;
var tile_h = stage.height / 6;
@@ -376,16 +378,16 @@
var multiplier = (((tiles[til].anchor_x*tiles[til].anchor_y)/
(stage.width*stage.height)) + 0.01);
- var timeline = new Clutter.Timeline({num_frames:multiplier*duration*global_fps,
- fps:global_fps});
+ timeline = new Clutter.Timeline({num_frames:multiplier*duration*global_fps,
+ fps:global_fps});
var effect = new Clutter.EffectTemplate.c_new(timeline, Clutter.ramp_inc_func);
Clutter.effect_rotate(effect, tiles[til], 1, 180, 0, 0, 0);
Clutter.effect_fade(effect, tiles[til], 0);
}
- var timeline = new Clutter.Timeline({num_frames:duration*global_fps,
- fps:global_fps});
+ timeline = new Clutter.Timeline({num_frames:duration*global_fps,
+ fps:global_fps});
timeline.signal.completed.connect(function (timeline, tiles)
{
@@ -446,7 +448,7 @@
a.opacity = 0;
- group.scale_x = group.scale_y = .5;
+ group.scale_x = group.scale_y = 0.5;
stage.add_actor(left_tile);
stage.add_actor(right_tile);
Modified: trunk/examples/glib/timeout.js
==============================================================================
--- trunk/examples/glib/timeout.js (original)
+++ trunk/examples/glib/timeout.js Sun Jan 25 10:26:00 2009
@@ -1,4 +1,5 @@
#!/usr/bin/env seed
+
Seed.import_namespace("GLib");
count = 0;
@@ -7,7 +8,7 @@
function()
{
count++;
- Seed.print("Hello from timeout number " + count)
+ Seed.print("Hello from timeout number " + count);
if (count == 5)
Seed.quit();
return true;
Modified: trunk/examples/opengl/seed-gears.js
==============================================================================
--- trunk/examples/opengl/seed-gears.js (original)
+++ trunk/examples/opengl/seed-gears.js Sun Jan 25 10:26:00 2009
@@ -4,6 +4,7 @@
function gear(inner_radius, outer_radius, width, teeth, tooth_depth)
{
+ var i, angle;
var r0 = inner_radius;
var r1 = outer_radius - tooth_depth / 2.0;
var r2 = outer_radius + tooth_depth / 2.0;
@@ -11,14 +12,13 @@
var da = 2.0 * Math.PI / teeth/ 4.0;
GL.ShadeModel(GL.FLAT);
-
GL.Normal3f(0.0, 0.0, 1.0);
GL.Begin(GL.QUAD_STRIP);
- for (var i = 0; i <= teeth; i++)
+ for (i = 0; i <= teeth; i++)
{
- var angle = i * 2.0 * Math.PI / teeth;
+ angle = i * 2.0 * Math.PI / teeth;
GL.Vertex3f(r0 * Math.cos(angle), r0 * Math.sin(angle), width * 0.5);
GL.Vertex3f(r1 * Math.cos(angle), r1 * Math.sin(angle), width * 0.5);
GL.Vertex3f(r0 * Math.cos(angle), r0 * Math.sin(angle), width * 0.5);
@@ -28,8 +28,9 @@
GL.Begin(GL.QUADS);
da = 2.0 * Math.PI / teeth / 4.0;
- for (var i = 0; i < teeth; i++) {
- var angle = (i) * 2.0 * Math.PI / teeth;
+ for (i = 0; i < teeth; i++)
+ {
+ angle = (i) * 2.0 * Math.PI / teeth;
GL.Vertex3f(r2 * Math.cos(angle + 2 * da),
r2 * Math.sin(angle + 2 * da), width * 0.5);
@@ -48,8 +49,9 @@
/* draw back face */
GL.Begin(GL.QUAD_STRIP);
- for (i = 0; i <= teeth; i++) {
- var angle = i * 2.0 * Math.PI / teeth;
+ for (i = 0; i <= teeth; i++)
+ {
+ angle = i * 2.0 * Math.PI / teeth;
GL.Vertex3f(r1 * Math.cos(angle), r1 * Math.sin(angle), -width * 0.5);
GL.Vertex3f(r0 * Math.cos(angle), r0 * Math.sin(angle), -width * 0.5);
GL.Vertex3f(r1 * Math.cos(angle + 3 * da), r1 * Math.sin(angle + 3 * da), -width * 0.5);
@@ -60,8 +62,9 @@
/* draw back sides of teeth */
GL.Begin(GL.QUADS);
da = 2.0 * Math.PI / teeth / 4.0;
- for (var i = 0; i < teeth; i++) {
- var angle = i * 2.0 * Math.PI / teeth;
+ for (i = 0; i < teeth; i++)
+ {
+ angle = i * 2.0 * Math.PI / teeth;
GL.Vertex3f(r1 * Math.cos(angle + 3 * da), r1 * Math.sin(angle + 3 * da), -width * 0.5);
GL.Vertex3f(r2 * Math.cos(angle + 2 * da), r2 * Math.sin(angle + 2 * da), -width * 0.5);
@@ -72,8 +75,9 @@
/* draw outward faces of teeth */
GL.Begin(GL.QUAD_STRIP);
- for (var i = 0; i < teeth; i++) {
- var angle = i * 2.0 * Math.PI / teeth;
+ for (i = 0; i < teeth; i++)
+ {
+ angle = i * 2.0 * Math.PI / teeth;
GL.Vertex3f(r1 * Math.cos(angle), r1 * Math.sin(angle), width * 0.5);
GL.Vertex3f(r1 * Math.cos(angle), r1 * Math.sin(angle), -width * 0.5);
@@ -105,8 +109,9 @@
/* draw inside radius cylinder */
GL.Begin(GL.QUAD_STRIP);
- for (var i = 0; i <= teeth; i++) {
- var angle = i * 2.0 * Math.PI / teeth;
+ for (i = 0; i <= teeth; i++)
+ {
+ angle = i * 2.0 * Math.PI / teeth;
GL.Normal3f(-Math.cos(angle), -Math.sin(angle), 0.0);
GL.Vertex3f(r0 * Math.cos(angle), r0 * Math.sin(angle), -width * 0.5);
GL.Vertex3f(r0 * Math.cos(angle), r0 * Math.sin(angle), width * 0.5);
Modified: trunk/examples/opengl/triangle-actor.js
==============================================================================
--- trunk/examples/opengl/triangle-actor.js (original)
+++ trunk/examples/opengl/triangle-actor.js Sun Jan 25 10:26:00 2009
@@ -1,36 +1,37 @@
#!/usr/bin/env seed
+
Seed.import_namespace("Clutter");
Seed.import_namespace("GL");
Clutter.init(null, null);
var s = new Clutter.Stage();
-
var b = new Clutter.Rectangle();
b.width = b.x = s.width/2;
-
b.y = 250;
s.add_actor(b);
-b.signal["paint"].connect(function(actor)
- {
- with(GL)
- {
- PushMatrix();
- Scalef(200,200,1);
- Begin(TRIANGLES);
- Color3f(1,0,0);
- Vertex3f(-1,-1,0);
- Color3f(0,1,0);
- Vertex3f(1,-1,0);
- Color3f(0,0,1);
- Vertex3f(0,1,0);
- End();
- PopMatrix();
- }
- });
+function triangle_actor ()
+{
+ with(GL)
+ {
+ PushMatrix();
+ Scalef(200,200,1);
+ Begin(TRIANGLES);
+ Color3f(1,0,0);
+ Vertex3f(-1,-1,0);
+ Color3f(0,1,0);
+ Vertex3f(1,-1,0);
+ Color3f(0,0,1);
+ Vertex3f(0,1,0);
+ End();
+ PopMatrix();
+ }
+}
+
+b.signal["paint"].connect(triangle_actor);
s.show();
Clutter.main();
Modified: trunk/examples/pong/pong.js
==============================================================================
--- trunk/examples/pong/pong.js (original)
+++ trunk/examples/pong/pong.js Sun Jan 25 10:26:00 2009
@@ -60,10 +60,10 @@
this.accelerate = function (direction)
{
- if(velocity == 0)
- velocity = direction * 5;
- else
+ if(velocity)
velocity = velocity + (direction*4);
+ else
+ velocity = direction * 5;
};
this.set_velocity = function (new_v)
@@ -92,7 +92,7 @@
// Clutter.sine_inc_func);
//Clutter.effect_scale(effect, this, 1, 1.2);
- }
+ };
this.lost_game = function ()
{
@@ -127,7 +127,7 @@
bkg.filter_quality = Clutter.TextureQuality.HIGH;
this.add_actor(bkg);
bkg.show();
- }
+ };
}
});
@@ -188,7 +188,7 @@
// TODO: Fix "spin" from paddle...
//v_y += paddle.get_velocity() * 2;
}
- }
+ };
bounce_paddle(this, p_one);
bounce_paddle(this, p_two);
@@ -262,7 +262,7 @@
Clutter.color_parse("Black", black);
var stage = new Clutter.Stage();
-stage.signal.hide.connect(function(){Clutter.main_quit()});
+stage.signal.hide.connect(function(){Clutter.main_quit();});
stage.set_size(500,500);
stage.color = black;
@@ -308,7 +308,7 @@
ball.set_velocity(Math.random() * 12 - 6, Math.random() * 12 - 6);
winning_animation = 0;
-};
+}
create_new_ball();
Modified: trunk/examples/poppler.js
==============================================================================
--- trunk/examples/poppler.js (original)
+++ trunk/examples/poppler.js Sun Jan 25 10:26:00 2009
@@ -15,7 +15,7 @@
function draw_document()
{
- if (current_page !== null)
+ if (current_page)
{
drawing_area.window.clear();
cairo = Gdk.cairo_create(drawing_area.window);
Modified: trunk/examples/twitter/pretty.js
==============================================================================
--- trunk/examples/twitter/pretty.js (original)
+++ trunk/examples/twitter/pretty.js Sun Jan 25 10:26:00 2009
@@ -14,7 +14,7 @@
if ( isNaN(day_diff) || day_diff < 0 || day_diff >= 31 )
return;
- return day_diff == 0 && (
+ return !day_diff && (
diff < 60 && "just now" ||
diff < 120 && "1 minute ago" ||
diff < 3600 && Math.floor( diff / 60 ) + " minutes ago" ||
Modified: trunk/examples/twitter/twitter.js
==============================================================================
--- trunk/examples/twitter/twitter.js (original)
+++ trunk/examples/twitter/twitter.js Sun Jan 25 10:26:00 2009
@@ -98,13 +98,13 @@
var dstream = new Gio.DataInputStream.c_new(stream);
var data = JSON.parse(dstream.read_until("", 0));
- messages.foreach(function(m) {messages.remove(m)});
- data.results.forEach(function(m) {messages.pack_start(make_block(m));
- while (GLib.main_context_pending())
- GLib.main_context_iteration()});
+ messages.foreach(function(m) {messages.remove(m);});
+ data.results.forEach(function(m) { messages.pack_start(make_block(m));
+ while (GLib.main_context_pending())
+ GLib.main_context_iteration();});
messages.show_all();
-};
+}
// Define the behavior for the button press by associating an anonymous
// function with the button's click signal handler
Modified: trunk/tests/javascript/struct-union-enumerate.js
==============================================================================
--- trunk/tests/javascript/struct-union-enumerate.js (original)
+++ trunk/tests/javascript/struct-union-enumerate.js Sun Jan 25 10:26:00 2009
@@ -14,7 +14,7 @@
for (prop in e)
{
Seed.print(indent + "* " + prop);
- if (e[prop] !== null && (e[prop].toString().search("struct") > 0 ||
+ if (e[prop] && (e[prop].toString().search("struct") > 0 ||
e[prop].toString().search("union") > 0))
enum_structlike(indent + " ", e[prop]);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]