Skip to content

Commit

Permalink
perl -pi -e 's/Sky/Meteor/g' **/*
Browse files Browse the repository at this point in the history
  • Loading branch information
n1mmy committed Jan 5, 2012
1 parent 8b04fec commit 3faff2d
Show file tree
Hide file tree
Showing 32 changed files with 159 additions and 159 deletions.
2 changes: 1 addition & 1 deletion app/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var run = function (bundle_dir) {
// start up app
__meteor_bootstrap__ = {require: require, startup_hooks: [], app: app};
Fiber(function () {
// (put in a fiber to let Sky.db operations happen during loading)
// (put in a fiber to let Meteor.db operations happen during loading)

// pass in database info
__meteor_bootstrap__.mongo_url = mongo_url;
Expand Down
2 changes: 1 addition & 1 deletion app/skybreak/skel/client/~name~.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Sky.subscribe('clicks');
Meteor.subscribe('clicks');

Template.button_demo.events = {
'click input': function () {
Expand Down
6 changes: 3 additions & 3 deletions app/skybreak/skel/model.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Clicks = Sky.Collection('clicks');
Clicks = Meteor.Collection('clicks');

if (Sky.is_server) {
Sky.publish('clicks', {});
if (Meteor.is_server) {
Meteor.publish('clicks', {});
}
16 changes: 8 additions & 8 deletions examples/leaderboard/leaderboard.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// Set up a collection to contain player information. On the server,
// it is backed by a MongoDB collection named "players."
Players = Sky.Collection("players");
Players = Meteor.Collection("players");

/*** Client ***/

if (Sky.is_client) {
if (Meteor.is_client) {
// Get the top 10 players from the server, updated continuously.
Sky.subscribe("top10");
Meteor.subscribe("top10");

// Start with no player selected.
Session.set("selected_player", null);

$(document).ready(function () {
// List the players by score. You can click to select a player.
var leaderboard_elt = $('<div class="leaderboard"></div>')[0];
Sky.ui.renderList(Players, leaderboard_elt, {
Meteor.ui.renderList(Players, leaderboard_elt, {
sort: {score: -1}, // sort from high to low score
render: function (player) {
if (Session.equals("selected_player", player._id))
Expand All @@ -35,7 +35,7 @@ if (Sky.is_client) {
$('body').append(leaderboard_elt);

// Details area, showing the currently selected player.
var details_elt = Sky.ui.render(function () {
var details_elt = Meteor.ui.render(function () {
var selected_player = Session.get("selected_player");
if (!selected_player)
return $('<div class="none">Click a player to select</div>')[0];
Expand All @@ -54,13 +54,13 @@ if (Sky.is_client) {

/*** Server ***/

if (Sky.is_server) {
if (Meteor.is_server) {
// Publish the top 10 players, live, to any client that wants them.
Sky.publish("top10", {collection: Players, sort: {score: -1},
Meteor.publish("top10", {collection: Players, sort: {score: -1},
limit: 10});

// On server startup, create some players if the database is empty.
Sky.startup(function () {
Meteor.startup(function () {
if (Players.find().length === 0) {
var names = ["Glinnes Hulden", "Shira Hulden", "Denzel Warhound",
"Lute Casagave", "Akadie", "Thammas, Lord Gensifer",
Expand Down
14 changes: 7 additions & 7 deletions examples/todos/client/todos.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Session.set('editing_addtag', null);
Session.set('editing_listname', null);
Session.set('editing_itemname', null);

Sky.subscribe('lists', {}, function () {
Meteor.subscribe('lists', {}, function () {
// Once the lists have loaded, select the first one.
if (!Session.get('list_id')) {
var lists = Lists.find({}, {sort: {name: 1}, limit: 1});
Expand All @@ -13,10 +13,10 @@ Sky.subscribe('lists', {}, function () {
}
});

Sky.autosubscribe(function () {
Meteor.autosubscribe(function () {
var list_id = Session.get('list_id');
if (list_id)
Sky.subscribe('todos', {list: list_id});
Meteor.subscribe('todos', {list: list_id});
});

////////// Tag Filter //////////
Expand Down Expand Up @@ -77,7 +77,7 @@ Template.list_item.events = {
'dblclick': function (evt) { // start editing list name
var top = $(evt.target).parents('.list');
Session.set('editing_listname', this._id);
Sky.flush();
Meteor.flush();
top.find('.edit input').val(this.name).focus().select();
},
'blur .edit input, keypress .edit input': function (evt) {
Expand Down Expand Up @@ -184,14 +184,14 @@ Template.todo_item.events = {
'click .addtag': function (evt) {
var top = $(evt.target).closest('li.todo');
Session.set('editing_addtag', this._id);
Sky.flush();
Meteor.flush();
top.find('.edittag input').focus();
},

'dblclick': function (evt) {
var top = $(evt.target).closest('li.todo');
Session.set('editing_itemname', this._id);
Sky.flush();
Meteor.flush();
top.find('.edit input').val(this.text).focus().select();
},

Expand Down Expand Up @@ -243,7 +243,7 @@ Router = new TodosRouter;

////////// Startup //////////

Sky.startup(function () {
Meteor.startup(function () {
$('body').layout({north__minSize: 50,
spacing_open: 10,
north__fxSettings: { direction: "vertical" }});
Expand Down
8 changes: 4 additions & 4 deletions examples/todos/model.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Lists = Sky.Collection("lists");
Lists = Meteor.Collection("lists");

Todos = Sky.Collection("todos");
Todos = Meteor.Collection("todos");

/* Schema support coming soon!
Expand All @@ -11,8 +11,8 @@ Todos.schema({text: String,
tags: [String]});
*/

Sky.publish('lists');
Sky.publish('todos', {
Meteor.publish('lists');
Meteor.publish('todos', {
selector: function (params) {
return {list_id: params.list};
}
Expand Down
2 changes: 1 addition & 1 deletion examples/todos/server/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// if the database is empty on server start, create some sample data.
Sky.startup(function () {
Meteor.startup(function () {
if (Lists.find().length === 0) {
var data = [
{name: "* Seven Principles *",
Expand Down
10 changes: 5 additions & 5 deletions examples/unfinished/azrael/client/azrael.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Sky.subscribe('rooms');
Meteor.subscribe('rooms');

Session.set('current_room', null);
Session.set('editing_room_name', false);

Sky.autosubscribe(function () {
Meteor.autosubscribe(function () {
var room_id = Session.get('current_room');
if (room_id) Sky.subscribe('room-detail', {room: room_id});
if (room_id) Meteor.subscribe('room-detail', {room: room_id});
});

// XXX would be nice to eliminate this function and have people just
Expand Down Expand Up @@ -49,7 +49,7 @@ Template.add_room.events = {
// principled way to do this is to narrow the scope of the
// rerender to not include the <input>.
Session.set('editing_room_name', true);
Sky.ui.focus('#room_name_input');
Meteor.ui.focus('#room_name_input');
}
};

Expand All @@ -61,7 +61,7 @@ Template.room.events = {
Session.set('editing_room_name', true);
// XXX XXX doesn't generalize.. the element might very reasonably
// not have a unique id. may need a different strategy..
Sky.ui.focus('#room_name_input');
Meteor.ui.focus('#room_name_input');
},
'blur input': function (evt) {
Session.set('editing_room_name', false);
Expand Down
8 changes: 4 additions & 4 deletions examples/unfinished/azrael/model.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// XXX it is actually very dangerous to store times as Number. use
// Date type once it's implemented in minimongo
Rooms = Sky.Collection("rooms");
Rooms = Meteor.Collection("rooms");
Rooms.schema({name: String, created: Number});

Chat = Sky.Collection("chat");
Chat = Meteor.Collection("chat");
Chat.schema({room: String, message: String,
username: String, created: Number});

Sky.publish('rooms');
Meteor.publish('rooms');

// XXX should limit to just a certain amount of recent chat ..
Sky.publish('room-detail', {
Meteor.publish('room-detail', {
collection: Chat,
selector: function (params) {
return {room: params.room};
Expand Down
2 changes: 1 addition & 1 deletion examples/unfinished/coffeeless/client/coffeeless.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Sky.subscribe 'presses'
Meteor.subscribe 'presses'

Template.button_demo.events =
'click input': ->
Expand Down
4 changes: 2 additions & 2 deletions examples/unfinished/coffeeless/model.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
root = exports ? this # export Presses globally.
root.Presses = Sky.Collection 'presses'
root.Presses = Meteor.Collection 'presses'

Sky.publish 'presses'
Meteor.publish 'presses'
2 changes: 1 addition & 1 deletion examples/unfinished/todos-backbone/client/todos.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Load the application once the DOM is ready, using `jQuery.ready`:
$(function(){
// ask for all the todos in my cache
Sky.subscribe('todos');
Meteor.subscribe('todos');

// helper functions

Expand Down
4 changes: 2 additions & 2 deletions examples/unfinished/todos-backbone/common.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Todos = Sky.Collection("todos");
Todos = Meteor.Collection("todos");
Todos.schema({text: String, done: Boolean, order: Number});

Sky.publish('todos');
Meteor.publish('todos');
12 changes: 6 additions & 6 deletions examples/unfinished/todos-underscore/client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ $(function () {

// render individual todo list, stash kill function
current_list_stop =
Sky.ui.renderList(Todos, $('#item-list'), {
Meteor.ui.renderList(Todos, $('#item-list'), {
selector: query,
sort: {timestamp: 1},
render: renderItem,
Expand All @@ -125,7 +125,7 @@ $(function () {
};

// render list of lists in the left sidebar.
Sky.ui.renderList(Lists, $('#lists'), {
Meteor.ui.renderList(Lists, $('#lists'), {
sort: {name: 1},
template: $('#list-template'),
events: {
Expand Down Expand Up @@ -174,7 +174,7 @@ $(function () {
// support aggregate queries, construct a local collection to serve
// the same purpose, and drive the renderList() off of it.

var LocalTags = Sky.Collection();
var LocalTags = Meteor.Collection();
(function () {
function updateLocalTags() {
var real = _(Todos.find()).chain().pluck('tags').compact().flatten().uniq().value();
Expand Down Expand Up @@ -205,7 +205,7 @@ $(function () {

Session.set('tag_filter', null);

Sky.ui.renderList(LocalTags, $('#tag-filter'), {
Meteor.ui.renderList(LocalTags, $('#tag-filter'), {
sort: {tag: 1},
template: $('#tag-filter-template'),
events: {
Expand All @@ -229,7 +229,7 @@ $(function () {

// subscribe to all available todo lists. once the inital load
// completes, navigate to the list specified by URL, if any.
Sky.subscribe('lists', {}, function () {
Meteor.subscribe('lists', {}, function () {
var initial_list_id = window.location.pathname.split('/')[1];
var list;

Expand All @@ -254,5 +254,5 @@ $(function () {

// subscribe to all the items in each list. no need for a callback
// here: todo items are never queried using collection.find().
Sky.subscribe('todos');
Meteor.subscribe('todos');
});
8 changes: 4 additions & 4 deletions examples/unfinished/todos-underscore/common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Lists = Sky.Collection("lists");
Lists = Meteor.Collection("lists");

Todos = Sky.Collection("todos");
Todos = Meteor.Collection("todos");

/* Schema support coming soon!
Expand All @@ -11,5 +11,5 @@ Todos.schema({text: String,
tags: [String]});
*/

Sky.publish('lists');
Sky.publish('todos');
Meteor.publish('lists');
Meteor.publish('todos');
2 changes: 1 addition & 1 deletion examples/unfinished/todos-underscore/server/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// if the database is empty on server start, create some sample data.
Sky.startup(function () {
Meteor.startup(function () {
if (Lists.find().length === 0) {
var list1 = Lists.insert({name: 'Things to do'});
Todos.insert({list_id: list1._id,
Expand Down
6 changes: 3 additions & 3 deletions packages/deps/deps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if (typeof Sky === "undefined") Sky = {};
if (typeof Meteor === "undefined") Meteor = {};

(function () {
var pending_invalidate = [];
Expand Down Expand Up @@ -30,7 +30,7 @@ if (typeof Sky === "undefined") Sky = {};
if (!this._invalidated) {
this._invalidated = true;
if (!pending_invalidate.length)
setTimeout(Sky.flush, 0);
setTimeout(Meteor.flush, 0);
pending_invalidate.push(this);
}
},
Expand All @@ -44,7 +44,7 @@ if (typeof Sky === "undefined") Sky = {};
}
});

_.extend(Sky, {
_.extend(Meteor, {
// XXX specify what happens when flush calls flush. eg, flushing
// causes a dom update, which causes onblur, which invokes an
// event handler that calls flush. it's probably an exception --
Expand Down
Loading

0 comments on commit 3faff2d

Please sign in to comment.