Upgrade functions to load presentations made with older versions of Sozi.
- Source:
Members
(inner, constant) SOZI_NS :string
The Sozi namespace for custom XML elements.
Type:
- string
- Source:
Methods
(static) upgradeFromStorable(storable)
Upgrade presentation data from an earlier version of Sozi.
This function operates on a raw object loaded from a Sozi JSON file.
Parameters:
Name | Type | Description |
---|---|---|
storable |
object | The data loaded from a Sozi JSON file. |
- Source:
(static) upgradeFromSVG(pres, controller)
Read a Sozi 13 presentation.
This function reads the custom XML elements and attributes from the SVG document and populates the presentation data structure.
Parameters:
Name | Type | Description |
---|---|---|
pres |
module:model/Presentation.Presentation | The current presentation object. |
controller |
module:Controller.Controller | The controller that manages the current editor. |
- Source:
(inner) convertTimingFunction(str) → {string}
Get the new name for a Sozi 13 timing function.
Parameters:
Name | Type | Description |
---|---|---|
str |
string | The name of a timing function in Sozi 13. |
- Source:
Returns:
- The name of the corresponding timing function in the current version of Sozi.
- Type
- string
(inner) importAttribute(obj, propName, elts, attrName, fnopt)
Retrieve the value of an XML attribute.
This function is used when upgrading from Sozi 13 where presentation data is kept in custom XML elements and attributes inside the SVG document.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
obj |
object | The object where to copy the value of the attribute. |
||
propName |
string | The name of the property to write in |
||
elts |
Array.<Element> | An array of candidate XML elements where to look up. |
||
attrName |
string | The name of the attribute to read. |
||
fn |
function |
<optional> |
x=>x | A conversion function to apply to the attribute. |
- Source:
(inner) importAttributeNS(obj, propName, elts, nsUri, attrName, fnopt)
Retrieve the value of an XML attribute with namespace.
This function is used when upgrading from Sozi 13 where presentation data is kept in custom XML elements and attributes inside the SVG document.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
obj |
object | The object where to copy the value of the attribute. |
||
propName |
string | The name of the property to write in |
||
elts |
Array.<Element> | An array of candidate XML elements where to look up. |
||
nsUri |
string | The XML namespace URI of the attribute. |
||
attrName |
string | The name of the attribute to read. |
||
fn |
function |
<optional> |
x=>x | A conversion function to apply to the attribute. |
- Source:
(inner) parseBoolean(str) → {boolean}
Convert a string to a boolean.
This function is used when upgrading from Sozi 13 where presentation data is kept in custom XML elements and attributes inside the SVG document.
Parameters:
Name | Type | Description |
---|---|---|
str |
string | A string to parse. |
- Source:
Returns:
true
ifstr
is"true"
.
- Type
- boolean