This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| smutbook:classes:inventory:inventoryui [2023/08/09 17:11] – lee | smutbook:classes:inventory:inventoryui [2023/08/09 17:20] (current) – lee | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| FIXME mention the CSS yadda yadda. | FIXME mention the CSS yadda yadda. | ||
| + | |||
| + | FIXME talk about how the default implementations function. | ||
| ===== InventoryUI.render( config ) ===== | ===== InventoryUI.render( config ) ===== | ||
| Line 19: | Line 21: | ||
| ===== The Configuration Object ===== | ===== The Configuration Object ===== | ||
| + | |||
| + | **Type:** Plain Old Javascript Object (acting as an associative array) | ||
| The configuration object is just a plain old javascript object containing a number of configuration fields and their values. | The configuration object is just a plain old javascript object containing a number of configuration fields and their values. | ||
| Line 147: | Line 151: | ||
| * //item//: The item we are moving to the right-hand inventory. | * //item//: The item we are moving to the right-hand inventory. | ||
| * //config//: The config object that was passed to InventoryUI.render(). | * //config//: The config object that was passed to InventoryUI.render(). | ||
| - | * **Returns: | + | * **Returns: |
| * **Throws:** Nothing | * **Throws:** Nothing | ||
| * **Default Value:** the builtin implementation, | * **Default Value:** the builtin implementation, | ||
| - | === moveFromRight( item, config ) === | + | ==== moveFromRight( item, config ) ==== |
| Function to call to move item from right to left inventory. If undefined, the built-in implementation will be used. | Function to call to move item from right to left inventory. If undefined, the built-in implementation will be used. | ||
| - | * Type: Function | + | |
| - | * Returns: Void | + | * **Arguments:** |
| - | * //item//: The item which we are checking whether or not we should show. | + | * //item//: The item we are moving to the left-hand inventory. |
| - | * //config//: The config object that was passed to InventoryIU.render(). | + | * //config//: The config object that was passed to InventoryUI.render(). |
| - | * **Default Value:** the builtin implementation | + | * **Returns: |
| + | * **Throws:** Nothing | ||
| + | * **Default Value:** the builtin implementation, defined in InventoryUI.js | ||
| - | === leftTitle === | + | ==== leftTitle |
| Override the left title. | Override the left title. | ||
| - | * Type: String | + | |
| - | * **Default Value:** if the left inventory is a Person then " | + | * **Default Value:** if the left inventory is a Person then " |
| - | === rightTitle === | + | ==== rightTitle |
| Override the right title. | Override the right title. | ||
| - | * Type: String | + | |
| - | * **Default Value:** if the right inventory is a Person then " | + | * **Default Value:** if the right inventory is a Person then " |
| - | === leftName( item, config ) === | + | ==== leftName( item, config ) ==== |
| Override the left label for item. | Override the left label for item. | ||
| - | * Type: Function | + | |
| - | * Returns: String | + | * **Arguments:** |
| - | * //item//: The item which we are checking whether or not we should show. | + | * //item//: The item we want the label for. |
| - | * //config//: The config object that was passed to InventoryIU.render(). | + | * //config//: The config object that was passed to InventoryUI.render(). |
| - | * **Default Value:** the item' | + | * **Returns: |
| + | * **Throws:** Nothing | ||
| + | * **Default Value:** the item.AName() | ||
| - | === rightName( item, config ) === | + | ==== rightName( item, config ) ==== |
| Override the right label for item. | Override the right label for item. | ||
| - | * Type: Function | + | |
| - | * Returns: String | + | * **Arguments:** |
| - | * //item//: The item which we are checking whether or not we should show. | + | * //item//: The item we want the label for. |
| - | * //config//: The config object that was passed to InventoryIU.render(). | + | * //config//: The config object that was passed to InventoryUI.render(). |
| - | * **Default Value:** the item' | + | * **Returns: |
| + | * **Throws:** Nothing | ||
| + | * **Default Value:** the item.AName() | ||
| - | === outerTpl === | + | ==== outerTpl |
| Override the builtin outer HTML template. | Override the builtin outer HTML template. | ||
| - | * Type: String | + | |
| * **Default Value:** undefined | * **Default Value:** undefined | ||
| - | === listitemTplLeft === | + | ==== listitemTplLeft |
| Override the builtin left list item HTML template. | Override the builtin left list item HTML template. | ||
| - | * Type: String | + | |
| * **Default Value:** undefined | * **Default Value:** undefined | ||
| - | === listitemTplRight === | + | ==== listitemTplRight |
| Override the builtin right list item HTML template. | Override the builtin right list item HTML template. | ||
| - | * Type: String | Function(config) returning String | + | |
| * **Default Value:** undefined | * **Default Value:** undefined | ||
| - | === detailsTpl === | + | ==== detailsTpl |
| Override the builtin item details HTML template. | Override the builtin item details HTML template. | ||
| - | * Type: String | Function(config) returning String | + | |
| * **Default Value:** undefined | * **Default Value:** undefined | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | ==== .someFunction( args ) ==== | ||
| - | Description. | ||
| - | |||
| - | * **Type:** Function | ||
| - | * **Arguments: | ||
| - | * //arg1//: desc | ||
| - | * //arg2//: desc | ||
| - | * //arg3//: desc | ||
| - | * //arg4//: desc | ||
| - | * //arg5//: desc | ||
| - | * //arg6//: desc | ||
| - | * **Returns: | ||
| - | * **Throws:** Nothing | ||
| - | |||
| - | Example:< | ||
| - | FIXME | ||
| - | </ | ||
| - | |||