Skip to content

Commit

Permalink
fix forking
Browse files Browse the repository at this point in the history
  • Loading branch information
max-mapper committed Mar 23, 2012
1 parent 73eab62 commit 3ea616a
Show file tree
Hide file tree
Showing 18 changed files with 4,300 additions and 76 deletions.
22 changes: 13 additions & 9 deletions attachments/script/edit.js
Expand Up @@ -10,9 +10,9 @@ var app = {
emitter: util.registerEmitter()
};

couch.dbPath = app.baseURL + "api/";
couch.rootPath = couch.dbPath + "couch/";
app.io = io.connect('/');
couch.dbPath = app.baseURL + "api/"
couch.rootPath = couch.dbPath + "couch/"
app.io = io.connect(app.baseURL);

app.handler = function(route) {
if (route.params && route.params.id) {
Expand All @@ -36,11 +36,15 @@ app.routes = {
modals: {
browse: function() {
couch.request({url: app.baseURL + "api/templates"}).then(function(templates) {
var templateData = {templates: _(templates.rows).map(function(row) {
return _.extend({}, row.doc, {
screenshot: app.baseURL + "api/" + row.doc._id + '/screenshot.png'
})
})}
var valid = []
_(templates.rows).each(function(row) {
if (!row.doc.name || !row.doc.description) return
valid.push(_.extend({}, row.doc, {
screenshot: app.baseURL + "api/templates/" + row.doc._id + '/screenshot.png',
ddoc: row.doc._id.split('/')[1]
}))
})
var templateData = {templates: valid}
recline.showDialog("appTemplates", templateData);
})
},
Expand All @@ -59,7 +63,7 @@ app.routes = {
edit: function() { recline.showDialog('editDatasetInfo', app.datasetInfo) },
loggedIn: function() { },
fork: function(id) {
monocles.ensureProfile().then(function(profile) {
monocles.fetchProfile().then(function(profile) {
recline.showDialog('busy', {message: "Forking to your account..."});
couch.request({url: app.baseURL + "api/" + id }).then( function( dataset ) {
couch.request({url: couch.rootPath + "_uuids"}).then( function( data ) {
Expand Down
2 changes: 1 addition & 1 deletion attachments/script/lib/jquery.couch2.js
Expand Up @@ -32,7 +32,7 @@
dfd.resolve(successResponse);
},
function(errorResponse) {
if(ajaxOpts.type !== "HEAD") app.emitter.emit("Fatal XHR Error", 'error');
if (ajaxOpts.type !== "HEAD") app.emitter.emit("Fatal XHR Error", 'error');
dfd.reject(errorResponse);
}
)
Expand Down
2 changes: 1 addition & 1 deletion attachments/script/monocles.js
Expand Up @@ -24,7 +24,7 @@ $(function(){
}

// gets user's stored profile info from couch
function fetchProfile(session) {
function fetchProfile() {
var dfd = $.Deferred();
couch.request({url: app.baseURL + "api/profile"}).then(
function(profile) {
Expand Down
1 change: 1 addition & 0 deletions node_modules/JSONStream/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 0 additions & 35 deletions node_modules/JSONStream/bench.js

This file was deleted.

3 changes: 1 addition & 2 deletions node_modules/JSONStream/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 32 additions & 6 deletions node_modules/JSONStream/node_modules/jsonparse/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 38 additions & 12 deletions node_modules/JSONStream/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3ea616a

Please sign in to comment.