Skip to content

Commit

Permalink
Update docs and files to distribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis committed May 21, 2014
1 parent b09bb14 commit fa05863
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 11 deletions.
65 changes: 60 additions & 5 deletions familysearch-javascript-sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -2513,7 +2513,7 @@ define('user',[
* @function
* @return {String} name of the agent
*/
$getName: function() { return maybe(maybe(this.names)[0]).value; },
$getName: function() { return maybe(maybe(this.names)[0]).value; },

/**
* @ngdoc function
Expand All @@ -2524,16 +2524,39 @@ define('user',[
*/
$getAccountName: function() { return maybe(maybe(this.accounts)[0]).accountName; },


/**
* @ngdoc function
* @name user.types:constructor.Agent#$getEmail
* @methodOf user.types:constructor.Agent
* @function
* @return {String} email of the agent
*/
$getEmail: function() {
$getEmail: function() {
var email = maybe(maybe(this.emails)[0]).resource;
return email ? email.replace(/^mailto:/,'') : email;
},

/**
* @ngdoc function
* @name user.types:constructor.Agent#$getPhoneNumber
* @methodOf user.types:constructor.Agent
* @function
* @return {String} phone number of the agent
*/
$getPhoneNumber: function() {
return maybe(maybe(this.phones)[0]).resource;
},

/**
* @ngdoc function
* @name user.types:constructor.Agent#$getAddress
* @methodOf user.types:constructor.Agent
* @function
* @return {String} postal address of the agent
*/
$getAddress: function() {
return maybe(maybe(this.addresses)[0]).value;
}
};

Expand Down Expand Up @@ -3782,6 +3805,13 @@ define('fact',[
* @return {String} http://gedcomx.org/Birth, etc.
*/

/**
* @ngdoc property
* @name fact.types:constructor.Fact#value
* @propertyOf fact.types:constructor.Fact
* @return {String} Description (some facts have descriptions)
*/

/**
* @ngdoc property
* @name fact.types:constructor.Fact#attribution
Expand Down Expand Up @@ -4151,6 +4181,16 @@ define('name',[
*/
$getNameFormsCount: function() { return this.nameForms ? this.nameForms.length : 0; },

/**
* @ngdoc function
* @name name.types:constructor.Name#$getNameForm
* @methodOf name.types:constructor.Name
* @function
* @param {Number=} i name form to read; defaults to 0
* @return {Number} get the `i`'th name form: each name form has `lang`, `fullText`, and `parts` properties
*/
$getNameForm: function(i) { return maybe(this.nameForms)[i || 0]; },

/**
* @ngdoc function
* @name name.types:constructor.Name#$getFullText
Expand All @@ -4159,7 +4199,17 @@ define('name',[
* @param {Number=} i name form to read; defaults to 0
* @return {String} get the full text of the `i`'th name form
*/
$getFullText: function(i) { return maybe(maybe(this.nameForms)[i || 0]).fullText; },
$getFullText: function(i) { return maybe(this.$getNameForm(i)).fullText; },

/**
* @ngdoc function
* @name name.types:constructor.Name#$getLanguage
* @methodOf name.types:constructor.Name
* @function
* @param {Number=} i name form to read; defaults to 0
* @return {String} get the language of the `i`'th name form
*/
$getLang: function(i) { return maybe(this.$getNameForm(i)).lang; },

/**
* @ngdoc function
Expand All @@ -4172,7 +4222,7 @@ define('name',[
* @return {String} get the specified part of the `i`'th name form
*/
$getNamePart: function(type, i) {
return maybe(helpers.find(maybe(maybe(this.nameForms)[i || 0]).parts, {type: type})).value;
return maybe(helpers.find(maybe(this.$getNameForm(i)).parts, {type: type})).value;
},

/**
Expand Down Expand Up @@ -4234,7 +4284,12 @@ define('name',[
*/
$setType: function(type) {
this.$changed = true;
this.type = type;
if (!!type) {
this.type = type;
}
else {
delete this.type;
}
//noinspection JSValidateTypes
return this;
},
Expand Down
6 changes: 3 additions & 3 deletions familysearch-javascript-sdk.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions js/docs-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ NG_DOCS={
"type": "function",
"moduleName": "fact",
"shortDescription": "Fact",
"keywords": "$getdate $getformaldate $getnormalizeddate $getnormalizedplace $getnormalizedplaceid $getplace $setchangemessage $setdate $setformaldate $setnormalizeddate $setnormalizedplace $setplace $settype api april attributes attribution authorities authority call case change changemessage data event fact form formal formaldate format forms function gedcomx http message normalized normalizeddate normalizedplace object optional org original place property server set sets standard string text type types update user written"
"keywords": "$getdate $getformaldate $getnormalizeddate $getnormalizedplace $getnormalizedplaceid $getplace $setchangemessage $setdate $setformaldate $setnormalizeddate $setnormalizedplace $setplace $settype api april attributes attribution authorities authority call case change changemessage data description descriptions event fact facts form formal formaldate format forms function gedcomx http message normalized normalizeddate normalizedplace object optional org original place property server set sets standard string text type types update user written"
},
{
"section": "api",
Expand Down Expand Up @@ -478,7 +478,7 @@ NG_DOCS={
"type": "function",
"moduleName": "name",
"shortDescription": "Name",
"keywords": "$changed $getfulltext $getgivenname $getnameformscount $getnamepart $getprefix $getsuffix $getsurname $setchangemessage $setfulltext $setgivenname $setnamepart $setpreferred $setprefix $setsuffix $setsurname $settype __note__ api attributes attribution call change changemessage created data defaults flag form forms full fulltext function givenname http initially ispreferred message number object optional org person preferred prefix property read read-only set sets string suffix surname text true type types update"
"keywords": "$changed $getfulltext $getgivenname $getlanguage $getnameform $getnameformscount $getnamepart $getprefix $getsuffix $getsurname $setchangemessage $setfulltext $setgivenname $setnamepart $setpreferred $setprefix $setsuffix $setsurname $settype __note__ api attributes attribution call change changemessage created data defaults flag form forms full fulltext function givenname http initially ispreferred lang language message number object optional org parts person preferred prefix properties property read read-only set sets string suffix surname text true type types update"
},
{
"section": "api",
Expand Down Expand Up @@ -1225,7 +1225,7 @@ NG_DOCS={
"type": "function",
"moduleName": "user",
"shortDescription": "An agent is returned from getAgent.",
"keywords": "$getaccountname $getemail $getname account agent api contact contributor email function functions getagent ids property returned types user"
"keywords": "$getaccountname $getaddress $getemail $getname $getphonenumber account address agent api contact contributor email function functions getagent ids number phone postal property returned types user"
},
{
"section": "api",
Expand Down
4 changes: 4 additions & 0 deletions partials/api/fact.types.constructor.Fact.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ <h4 id="usage_parameters">Parameters</h4><table class="variables-matrix table ta
<div class="type"><h5 id="properties_type_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="fact-types-page fact-types-constructor-fact-type-page"><p><a href="http://gedcomx.org/Birth">http://gedcomx.org/Birth</a>, etc.</p>
</div></td></tr></table></div>
</li>
<li><h3 id="properties_value">value</h3>
<div class="value"><h5 id="properties_value_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="fact-types-page fact-types-constructor-fact-value-page"><p>Description (some facts have descriptions)</p>
</div></td></tr></table></div>
</li>
</ul>
</div>
</div>
10 changes: 10 additions & 0 deletions partials/api/name.types.constructor.Name.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ <h4 id="usage_parameters">Parameters</h4><table class="variables-matrix table ta
</div></td></tr></tbody></table><h5 id="methods_$getgivenname_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="name-types-page name-types-constructor-name-getgivenname-page"><p>get the given part of the <code>i</code>&#39;th name form</p>
</div></td></tr></table></div>
</li>
<li><h3 id="methods_$getlanguage">$getLanguage(i)</h3>
<div class="$getlanguage"><h5 id="methods_$getlanguage_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>i <div><em>(optional)</em></div></td><td><a href="" class="label type-hint type-hint-number">Number</a></td><td><div class="name-types-page name-types-constructor-name-getlanguage-page"><p>name form to read; defaults to 0</p>
</div></td></tr></tbody></table><h5 id="methods_$getlanguage_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="name-types-page name-types-constructor-name-getlanguage-page"><p>get the language of the <code>i</code>&#39;th name form</p>
</div></td></tr></table></div>
</li>
<li><h3 id="methods_$getnameform">$getNameForm(i)</h3>
<div class="$getnameform"><h5 id="methods_$getnameform_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>i <div><em>(optional)</em></div></td><td><a href="" class="label type-hint type-hint-number">Number</a></td><td><div class="name-types-page name-types-constructor-name-getnameform-page"><p>name form to read; defaults to 0</p>
</div></td></tr></tbody></table><h5 id="methods_$getnameform_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-number">Number</a></td><td><div class="name-types-page name-types-constructor-name-getnameform-page"><p>get the <code>i</code>&#39;th name form: each name form has <code>lang</code>, <code>fullText</code>, and <code>parts</code> properties</p>
</div></td></tr></table></div>
</li>
<li><h3 id="methods_$getnameformscount">$getNameFormsCount()</h3>
<div class="$getnameformscount"><h5 id="methods_$getnameformscount_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-number">Number</a></td><td><div class="name-types-page name-types-constructor-name-getnameformscount-page"><p>get the number of name forms</p>
</div></td></tr></table></div>
Expand Down
8 changes: 8 additions & 0 deletions partials/api/user.types.constructor.Agent.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ <h2 id="usage">Usage</h2>
<div class="$getaccountname"><h5 id="methods_$getaccountname_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="user-types-page user-types-constructor-agent-getaccountname-page"><p>account / contact name of the agent</p>
</div></td></tr></table></div>
</li>
<li><h3 id="methods_$getaddress">$getAddress()</h3>
<div class="$getaddress"><h5 id="methods_$getaddress_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="user-types-page user-types-constructor-agent-getaddress-page"><p>postal address of the agent</p>
</div></td></tr></table></div>
</li>
<li><h3 id="methods_$getemail">$getEmail()</h3>
<div class="$getemail"><h5 id="methods_$getemail_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="user-types-page user-types-constructor-agent-getemail-page"><p>email of the agent</p>
</div></td></tr></table></div>
Expand All @@ -23,6 +27,10 @@ <h2 id="usage">Usage</h2>
<div class="$getname"><h5 id="methods_$getname_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="user-types-page user-types-constructor-agent-getname-page"><p>name of the agent</p>
</div></td></tr></table></div>
</li>
<li><h3 id="methods_$getphonenumber">$getPhoneNumber()</h3>
<div class="$getphonenumber"><h5 id="methods_$getphonenumber_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="user-types-page user-types-constructor-agent-getphonenumber-page"><p>phone number of the agent</p>
</div></td></tr></table></div>
</li>
</ul>
</div>
<div class="member property"><h2 id="properties">Properties</h2>
Expand Down

0 comments on commit fa05863

Please sign in to comment.