Property | Type | Description | |
---|---|---|---|
KeysOfVariablesThatAreUrlEncoded | HashSet |
Property | Type | Description | |
---|---|---|---|
GatherAttributes | void | ||
GatherDataItemsFromCollectionSettings | |||
GatherDataItemsFromXElement | void | ||
GetOrCreateDataDiv | |||
MigrateData | void | ||
PossiblyCopyFromAnotherLanguage | string | ||
RemoveDataDivElementIfEmptyValue | void | ||
SendDataToDebugConsole | void | ||
SetInnerXmlPreservingLabel | void | ||
SetNodeXml | void | ||
SetUpDisplayOfTopicInBook | void | ||
SynchronizeDataItemsFromContentsOfElement | |||
TextOfInnerHtml | string | ||
UpdateAttributes | void | ||
UpdateBookInfoTags | void | ||
UpdateCredits | void | ||
UpdateDomFromDataSet | void | ||
UpdateImageFromDataSet | bool | ||
UpdateIsbn | void | ||
UpdateSingleTextVariableInDataDiv | void | ||
UpdateSingleTextVariableInDataDiv | void | ||
UpdateTitle | void | ||
UpdateVariablesAndDataDiv | void |
Method | Description | |
---|---|---|
AddDataDivBookVariable ( string key, string lang, string form ) : void | ||
BookData ( |
||
GetFirstAlternativeForm ( SIL.Text.MultiTextBase alternatives ) : LanguageForm | ||
GetMultiTextVariableOrEmpty ( string key ) : SIL.Text.MultiTextBase | ||
GetVariableOrNull ( string key, string writingSystem ) : string | ||
GetWritingSystemCodes ( ) : string>.Dictionary |
||
PrettyPrintLanguage ( string code ) : string |
Give the string the user expects to see as the name of a specified language. This routine uses the user-specified name for the main project language. For the other two project languages, it explicitly uses the appropriate collection settings name for that language, though currently this gives the same result as the final default. This will find a fairly readable name for the languages Palaso knows about and fall back to the code itself if it can't find a name. Most names are not yet localized.
|
|
RemoveAllForms ( string key ) : void | ||
RemoveSingleForm ( string key, string lang ) : void | ||
Set ( string key, string value, bool isCollectionValue ) : void | ||
Set ( string key, string value, string lang ) : void | ||
SetMultilingualContentLanguages ( string language2Code, string language3Code ) : void | ||
SuckInDataFromEditedDom ( |
Create or update the data div with all the data-book values in the document
|
|
SynchronizeDataItemsThroughoutDOM ( ) : void | ||
UpdateDomFromDataset ( ) : void |
given the values in our dataset, push them out to the fields in the pages
|
|
UpdateVariablesAndDataDivThroughDOM ( |
Method | Description | |
---|---|---|
GatherAttributes ( |
||
GatherDataItemsFromCollectionSettings ( |
||
GatherDataItemsFromXElement ( |
walk through the sourceDom, collecting up values from elements that have data-book or data-collection or data-book-attributes attributes.
|
|
GetOrCreateDataDiv ( ) : |
||
MigrateData ( |
||
PossiblyCopyFromAnotherLanguage ( |
In some cases, we're better off copying from another national language than leaving the field empty. This is a tough decision. Without this, if we have, say, an English Contributors list but English isn't the N1 (L2), then the book won't show it at all. An ideal solution would just order them and then "display the first non-empty one", but that would require some java script... not something could be readily done in CSS, far as I can think. For now, I *think* this won't do any harm, and if it does, it's adding data, not losing it. Users had complained about "losing" the contributor data before. |
|
RemoveDataDivElementIfEmptyValue ( string key, string value ) : void | ||
SendDataToDebugConsole ( |
||
SetInnerXmlPreservingLabel ( string key, |
some templates have a element that javascript turns into a bubble describing the field these labels are temporary, so the go away and are not saved to data-book. But when we then take an xmatter template page and replace the contents with what was in data-book, we don't want to clobber the elements that are already in there. BL-3078
|
|
SetNodeXml ( string key, string form, |
||
SetUpDisplayOfTopicInBook ( |
Topics are uni-directional value, react™-style. The UI tells the book to change the topic key, and then eventually the page/book is re-evaluated and the appropriate topic is displayed on the page. To differentiate from fields with @data-book, which are two-way, the topic on the page instead has a @data-derived attribute (in the data-div, it is still a data-book... perhaps that too could change to something like data-book-source, but it's not clear to me yet, so.. not yet). When the topic is changed, the javascript sends c# a message with the new English Key for the topic is set in the data-div, and then the page is re-computed. That leads to this method, which grabs the english topic (which serves as the 'key') from the datadiv. It then finds the placeholder for the topic and fills it with the best translation it can find.
|
|
SynchronizeDataItemsFromContentsOfElement ( |
Go through the document, reading in values from fields, and then pushing variable values back into fields. Here we're calling "fields" the html supplying or receiving the data, and "variables" being key-value pairs themselves, which are, for library variables, saved in a separate file.
|
|
TextOfInnerHtml ( string input ) : string |
The data we extract into title fields of _dataSet is the InnerXml of some XML node. This might have markup, e.g., making a word italic. It will also have the amp, lt, and gt escaped. We want to reduce it to plain text to store in bookInfo.
|
|
UpdateAttributes ( |
||
UpdateBookInfoTags ( |
||
UpdateCredits ( |
||
UpdateDomFromDataSet ( |
Where, for example, somewhere on a page something has data-book='foo' lang='fr', we set the value of that element to French subvalue of the data item 'foo', if we have one.
|
|
UpdateImageFromDataSet ( |
Given a node in the content section of the book that has a data-book attribute, see if this node holds an image and if so, look up the url of the image from the supplied dataset and stick it in there. Handle both img elements and divs that have a background-image in an inline style attribute. At the time of this writing, the only image that is handled here is the cover page. The URLs of images in the content of the book are not known to the data-div. But each time the book is loaded up, we collect up data from the xmatter and stick it in the data-div(in the DOM) / dataSet (in an object here in code), stick in a blank xmatter, then push the values back into the xmatter.
|
|
UpdateIsbn ( |
||
UpdateSingleTextVariableInDataDiv ( string key, SIL.Text.MultiTextBase multiText ) : void |
I (jh) found this labelled UpdateSingleTextVariableThrougoutDom but it actually only updated the datadiv, so I changed the name. |
|
UpdateSingleTextVariableInDataDiv ( string key, string writingSystemId, string form ) : void |
I (jh) found this labelled UpdateSingleTextVariableThrougoutDom but it actually only updated the datadiv, so I changed the name. |
|
UpdateTitle ( |
||
UpdateVariablesAndDataDiv ( |
Create or update the data div with all the data-book values in the document
|
public AddDataDivBookVariable ( string key, string lang, string form ) : void | ||
key | string | |
lang | string | |
form | string | |
return | void |
public BookData ( |
||
dom | Set this parameter to, say, a page that the user just edited, to limit reading to it, so its values don't get overriden by previous pages. /// Supply the whole dom if nothing has priority (which will mean the data-div will win, because it is first) | |
collectionSettings | ||
updateImgNodeCallback | Action |
This is a callback so as not to introduce dependencies on ImageUpdater & the current folder path |
return | System |
public GetFirstAlternativeForm ( SIL.Text.MultiTextBase alternatives ) : LanguageForm | ||
alternatives | SIL.Text.MultiTextBase | |
return | LanguageForm |
public GetMultiTextVariableOrEmpty ( string key ) : SIL.Text.MultiTextBase | ||
key | string | |
return | SIL.Text.MultiTextBase |
public GetVariableOrNull ( string key, string writingSystem ) : string | ||
key | string | |
writingSystem | string | |
return | string |
public GetWritingSystemCodes ( ) : string>.Dictionary |
||
return | string>.Dictionary |
public PrettyPrintLanguage ( string code ) : string | ||
code | string | |
return | string |
public RemoveSingleForm ( string key, string lang ) : void | ||
key | string | |
lang | string | |
return | void |
public Set ( string key, string value, bool isCollectionValue ) : void | ||
key | string | |
value | string | |
isCollectionValue | bool | |
return | void |
public Set ( string key, string value, string lang ) : void | ||
key | string | |
value | string | |
lang | string | |
return | void |
public SetMultilingualContentLanguages ( string language2Code, string language3Code ) : void | ||
language2Code | string | |
language3Code | string | |
return | void |
public SuckInDataFromEditedDom ( |
||
dom | This is either the whole document, or a page div that we just edited and want to read from. | |
return | void |
public SynchronizeDataItemsThroughoutDOM ( ) : void | ||
return | void |
public UpdateVariablesAndDataDivThroughDOM ( |
||
info | ||
return | void |