Skip to content

Commit

Permalink
Fixed up staff and tasks on projects
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonNguyen committed Feb 8, 2012
1 parent 7cbd37f commit 6be5fcd
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 8 deletions.
10 changes: 6 additions & 4 deletions interact.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
currentMethodName = $(this).attr("alt");

//Extract the fields from the selected method
$('#fields').html(exploreFields(currentElementMethods[currentMethodName]));
$('#fields').html(exploreFields(currentElementMethods[currentMethodName], 0));

$('#currentCurlCommand').html(currentElementName + '.' + currentMethodName);

Expand Down Expand Up @@ -209,7 +209,7 @@
});

// Recursively traverses the json object building the html form
function exploreFields(root) {
function exploreFields(root, level) {
var fields = "";

$.each(root, function(key, val) {
Expand All @@ -218,11 +218,13 @@
fields += '<h3>' + key + '</h3>';

// Enable element duplication
if (key == 'lines' || key == 'gateways' || key == 'contacts') {
if (key == 'lines' || key == 'gateways' || key == 'contacts' || (key == 'staff' && level == 1) || key == 'tasks') {
console.log(key);
console.log(level);
fields += '<a href="#" class="duplicate">Add more</a>';
}

fields += exploreFields(val);
fields += exploreFields(val, level + 1);
fields +='</div>';
} else {
fields += '<label>' + key + '</label>';
Expand Down
26 changes: 24 additions & 2 deletions js/definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -1423,8 +1423,17 @@ var functions = {
_text:""
},
tasks:{
task_id:{
_text:""
task: {
task_id:{
_text:""
}
}
},
staff:{
staff:{
staff_id:{
_text:""
}
}
}
}
Expand Down Expand Up @@ -1459,6 +1468,13 @@ var functions = {
task_id:{
_text:""
}
},
staff:{
staff:{
staff_id:{
_text:""
}
}
}
}
},
Expand Down Expand Up @@ -1799,6 +1815,12 @@ var functions = {
},
folder:{
_text:""
},
date_from:{
_text:""
},
date_to:{
_text:""
}
},
"lines.add":{
Expand Down
5 changes: 3 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "FreshBooks Easy API",
"version": "1.0.0",
"version": "2.2",
"description": "Easily interact and experiment with the FreshBooks API!",
"icons": {"16": "media/leaf.png", "48": "media/leaf.png", "128": "media/leaf.png"},
"permissions": ["tabs",
Expand All @@ -12,5 +12,6 @@
"default_title": "FreshBooks",
"default_icon": "media/leaf.png",
"popup": "popup.html"
}
},
"update_url" : "https://github.com/downloads/AntonNguyen/FreshBooks-API-Chrome-Extension/update.xml"
}
6 changes: 6 additions & 0 deletions update.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='imgckindlihkhagpiifenfhipjdkangp'>
<updatecheck codebase='https://github.com/downloads/AntonNguyen/FreshBooks-API-Chrome-Extension/FreshBooks-API-Chrome-Extension.crx' version='2.2' />
</app>
</gupdate>

0 comments on commit 6be5fcd

Please sign in to comment.