Members
$el :Object
jQuery element containing the config list
Type:
_allAuthMechanisms :Object.<string, Object>
List of all supported authentication mechanisms
Type:
_allBackends :Object.<string, Object>
List of supported backends
Type:
_context :OCA.Files.FileActionContext
Current context
Type:
- Source:
_currentTabId :string
Id of the currently selected tab
Type:
- Source:
_detailFileInfoViews :Array.<OCA.Files.DetailFileInfoView>
List of detail file info views
Type:
- Array.<OCA.Files.DetailFileInfoView>
- Source:
_dirty
Dirty flag, whether the view needs to be rerendered
- Source:
_isPersonal :bool
Flag whether the list is about user storage configs (true)
or global storage configs (false)
Type:
- bool
_label
Tab label
- Source:
_linkShareId
- Source:
_REMOTE_OWNER_REGEXP
Regular expression for splitting parts of remote share owners:
"user@example.com/path/to/owncloud"
"user@anotherexample.com@example.com/path/to/owncloud
- Source:
_showLink :boolean
Type:
- boolean
- Source:
_storageConfigClass :Class
Storage config class
Type:
- Class
_tabViews :Array.<OCA.Files.DetailTabView>
List of detail tab views
Type:
- Array.<OCA.Files.DetailTabView>
- Source:
_template :function
Type:
- function
_template :function
Type:
- function
_template :function
Type:
- function
_template :function
Type:
- function
_templates :Object
Type:
- Source:
_userListLimit :int
Page size in applicable users dropdown
Type:
className :string
Type:
configModel :OC.Share.ShareConfigModel
Type:
- OC.Share.ShareConfigModel
configModel :OC.Share.ShareConfigModel
Type:
- OC.Share.ShareConfigModel
- Source:
configModel :OC.Share.ShareConfigModel
Type:
- OC.Share.ShareConfigModel
configModel :OC.Share.ShareConfigModel
Type:
- OC.Share.ShareConfigModel
configModel :OC.Share.ShareConfigModel
Type:
- OC.Share.ShareConfigModel
currentShares
Shares for the currently selected file.
(for which the dropdown is open)
Key is item type and value is an array or
shares of the given item type.
- Source:
droppedDown
Whether the share dropdown is opened.
- Source:
expirationView :object
Type:
- Source:
fileInfoModel :OC.Files.FileInfo
Type:
- Source:
fileList :OCA.Files.FileList
Type:
- Source:
id :string
Type:
id :string
Type:
id :string
Type:
id :string
Type:
int
Id of the file for which to filter activities by
itemShares
- Deprecated:
- use OC.Share.currentShares instead
- Source:
linkShareView :object
Type:
- Source:
loginToken
Creates a new authentication token and loads the updater URL
Object
Dropdown element
oc_debug
Disable console output unless DEBUG mode is enabled.
Add
'debug' => true,
To the definition of $CONFIG in config/config.php to enable debug mode.
The undefined checks fix the broken ie8 console
- Source:
resharerInfoView :object
Type:
- Source:
shareeListView :object
Type:
- Source:
showLink :boolean
Type:
- boolean
showLink :boolean
Type:
- boolean
statuses
Full list of all share statuses
- Source:
string
Type of the object to filter by
tagName :string
Type:
tagName :string
Type:
- Source:
Methods
_formatRemoteShare(remoteAddress) → {String}
Format a remote address
Parameters:
Name | Type | Description |
---|---|---|
remoteAddress |
String | full remote share |
- Source:
Returns:
HTML code to display
- Type
- String
_formatShareList(recipients) → {Array.<String>}
Loop over all recipients in the list and format them using
all kind of fancy magic.
Parameters:
Name | Type | Description |
---|---|---|
recipients |
Array.<String> | array of all the recipients |
- Source:
Returns:
modified list of recipients
- Type
- Array.<String>
_initEvents()
Initialize DOM event handlers
_legacyFillCurrentShares()
Updates OC.Share.itemShares and OC.Share.statuses.
This is required in case the user navigates away and comes back,
the share statuses from the old arrays are still used to fill in the icons
in the file list.
- Source:
_onClickAction(event)
Event handler whenever an action has been clicked within the menu
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | event object |
- Source:
_onClickAction(event)
Event handler whenever an action has been clicked within the menu
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | event object |
- Source:
_parseTime(time) → {*}
Parses a string to an valid integer (unix timestamp)
Parameters:
Name | Type | Description |
---|---|---|
time |
- Source:
Returns:
- Type
- *
_showMountOptionsDropdown($tr)
Toggles the mount options dropdown
Parameters:
Name | Type | Description |
---|---|---|
$tr |
Object | configuration row |
_suggestMountPoint(defaultMountPoint)
Suggest mount point name that doesn't conflict with the existing names in the list
Parameters:
Name | Type | Description |
---|---|---|
defaultMountPoint |
string | default name |
_updateTabVisibilities()
Update tab headers based on the current model
- Source:
addDetailView(detail)
Adds a detail view for file info.
Parameters:
Name | Type | Description |
---|---|---|
detail |
OCA.Files.DetailFileInfoView | view |
- Source:
addFormData(formData, newData)
Add form data into the given form data
Parameters:
Name | Type | Description |
---|---|---|
formData |
Array | Object | form data which can either be an array or an object |
newData |
Object | key-values to add to the form data |
- Source:
Returns:
updated form data
addMenuEntry(actionSpec)
Add a new item menu entry in the “New” file menu (in
last position). By clicking on the item, the
`actionHandler` function is called.
Parameters:
Name | Type | Description |
---|---|---|
actionSpec |
Object | item’s properties |
- Source:
addTabView(tab)
Adds a tab in the tab view
Parameters:
Name | Type | Description |
---|---|---|
tab |
OCA.Files.DetailTabView | view |
- Source:
areAvatarsEnabled() → {boolean}
- Source:
Returns:
- Type
- boolean
canDisplay(fileInfo) → {bool}
Returns whether the current tab is able to display
the given file info, for example based on mime type.
Parameters:
Name | Type | Description |
---|---|---|
fileInfo |
OCA.Files.FileInfoModel | file info model |
- Source:
Returns:
whether to display this tab
- Type
- bool
configureAuthMechanism($tr, authMechanism, onCompletion)
Configure the storage config with a new authentication mechanism
Parameters:
Name | Type | Description |
---|---|---|
$tr |
jQuery | config row |
authMechanism |
string | |
onCompletion |
jQuery.Deferred |
createPermissionPossible() → {boolean}
- Source:
Returns:
- Type
- boolean
deletePermissionPossible() → {boolean}
- Source:
Returns:
- Type
- boolean
deleteStorageConfig($tr, Function)
Deletes the storage from the given tr
Parameters:
Name | Type | Description |
---|---|---|
$tr |
storage row | |
Function |
callback callback to call after save |
editPermissionPossible() → {boolean}
- Source:
Returns:
- Type
- boolean
escapeHTML(s) → {string}
Sanitizes a HTML string by replacing all potential dangerous characters with HTML entities
Parameters:
Name | Type | Description |
---|---|---|
s |
string | String to sanitize |
- Source:
Returns:
Sanitized string
- Type
- string
fetchNext()
Fetch the next set of results
fileDownloadPath(file, dir) → {string}
Get the path to download a file
Parameters:
Name | Type | Description |
---|---|---|
file |
string | The filename |
dir |
string | The directory the file is in - e.g. $('#dir').val() |
- Deprecated:
- use Files.getDownloadURL() instead
- Source:
Returns:
Path to download the file
- Type
- string
formatDate(timestamp) → {string}
Format an UNIX timestamp to a human understandable format
Parameters:
Name | Type | Description |
---|---|---|
timestamp |
number | UNIX timestamp |
- Source:
Returns:
Human readable format
- Type
- string
get$() → {jQuery}
returns the jQuery object for HTML output
- Source:
Returns:
- Type
- jQuery
get$() → {jQuery}
returns the jQuery object for HTML output
Returns:
- Type
- jQuery
getCurrentDirectory()
Returns the current directory
- Source:
Returns:
current directory
getFederatedShareDocLink() → {string}
- Source:
Returns:
- Type
- string
getFileInfo() → {OCA.Files.FileInfo}
Returns the file info.
Returns:
file info
- Type
- OCA.Files.FileInfo
getFileInfo() → {OCA.Files.FileInfoModel}
Returns the file info.
- Source:
Returns:
file info
getFileInfo() → {OCA.Files.FileInfoModel}
Returns the file info.
- Source:
Returns:
file info
getFullPath() → {string}
Returns the full path to this file
- Source:
Returns:
full path
- Type
- string
getLabel() → {String}
Returns the tab label
- Source:
Returns:
label
- Type
- String
getReshareOwner() → {string}
- Source:
Returns:
- Type
- string
getReshareOwnerDisplayname() → {string}
- Source:
Returns:
- Type
- string
getReshareType() → {number}
- Source:
Returns:
- Type
- number
getReshareWith() → {string}
- Source:
Returns:
- Type
- string
getScrollBarWidth()
- Deprecated:
- use OC.Util.getScrollBarWidth() instead
- Source:
getShareeObject(shareInfo) → {object}
Parameters:
Name | Type | Description |
---|---|---|
shareInfo |
OC.Share.Types.ShareInfo |
Returns:
- Type
- object
getSharesWithCurrentItem() → {Array.<OC.Share.Types.ShareInfo>}
Returns all share entries that only apply to the current item
(file/folder)
- Source:
Returns:
- Type
- Array.<OC.Share.Types.ShareInfo>
getShareWith(shareIndex) → {string}
Parameters:
Name | Type | Description |
---|---|---|
shareIndex |
- Source:
Returns:
- Type
- string
getShareWithDisplayName(shareIndex) → {string}
Parameters:
Name | Type | Description |
---|---|---|
shareIndex |
- Source:
Returns:
- Type
- string
getStorageConfig($tr) → {OCA.External.StorageConfig}
Gets the storage model from the given row
Parameters:
Name | Type | Description |
---|---|---|
$tr |
row element |
Returns:
storage model instance
- Type
- OCA.External.StorageConfig
getURLParameter(name) → {string}
Get the value of a URL parameter
Parameters:
Name | Type | Description |
---|---|---|
name |
string | URL parameter |
- Source:
Returns:
- Type
- string
hasCreatePermission(shareIndex) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
shareIndex |
number |
- Source:
Returns:
- Type
- boolean
hasDeletePermission(shareIndex) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
shareIndex |
number |
- Source:
Returns:
- Type
- boolean
hasEditPermission() → {boolean}
- Source:
Returns:
- Type
- boolean
hasLinkShare() → {bool}
Returns whether this item has a link share
- Source:
Returns:
true if a link share exists, false otherwise
- Type
- bool
hasReshare() → {boolean}
whether this item has reshare information
- Source:
Returns:
- Type
- boolean
hasSharePermission(shareIndex) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
shareIndex |
number |
- Source:
Returns:
- Type
- boolean
hasUpdatePermission(shareIndex) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
shareIndex |
number |
- Source:
Returns:
- Type
- boolean
hasUserShares() → {boolean}
whether this item has user share information
- Source:
Returns:
- Type
- boolean
humanFileSize(size, skipSmallSizes) → {string}
Returns a human readable file size
Parameters:
Name | Type | Description |
---|---|---|
size |
number | Size in bytes |
skipSmallSizes |
boolean | return '< 1 kB' for small files |
- Source:
Returns:
- Type
- string
initCore()
Initializes core
- Source:
initialize($el, optionsopt)
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
$el |
Object | DOM object containing the list | |||||||||
options |
Object |
<optional> |
Properties
|
initialize()
Initialize the details view
- Source:
isDirectory() → {boolean}
Returns whether this file is a directory
- Source:
Returns:
true if this is a directory, false otherwise
- Type
- boolean
isFile() → {boolean}
- Source:
Returns:
- Type
- boolean
isFolder() → {boolean}
- Source:
Returns:
- Type
- boolean
isImage() → {boolean}
Returns whether this file is an image
- Source:
Returns:
true if this is an image, false otherwise
- Type
- boolean
isMailNotificationEnabled() → {boolean}
- Source:
Returns:
- Type
- boolean
isMailPublicNotificationEnabled() → {boolean}
- Source:
Returns:
- Type
- boolean
isPublicUploadAllowed() → {boolean}
- Source:
Returns:
- Type
- boolean
isPublicUploadEnabled() → {boolean}
- Source:
Returns:
- Type
- boolean
isShareWithLinkAllowed() → {boolean}
- Source:
Returns:
- Type
- boolean
loadIcons(itemType, fileList, callback)
Loads ALL share statuses from server, stores them in
OC.Share.statuses then calls OC.Share.updateIcons() to update the
files "Share" icon to "Shared" according to their share status and
share type.
If a callback is specified, the update step is skipped.
Parameters:
Name | Type | Description |
---|---|---|
itemType |
item type | |
fileList |
file list instance, defaults to OCA.Files.App.fileList | |
callback |
function to call after the shares were loaded |
- Source:
loadItem(itemType, itemSource, callback) → {OC.Share.Types.ShareInfo}
Parameters:
Name | Type | Description |
---|---|---|
itemType |
||
itemSource |
||
callback |
optional. If a callback is given this method works asynchronous and the callback will be provided with data when the request is done. |
- Source:
Returns:
loadStorages()
Load storages into config rows
markFileAsShared($tr, hasShares, hasLink)
Marks/unmarks a given file as shared by changing its action icon
and folder icon.
Parameters:
Name | Type | Description |
---|---|---|
$tr |
file element to mark as shared | |
hasShares |
whether shares are available | |
hasLink |
whether link share is available |
- Source:
newStorage(storageConfig, onCompletion) → {jQuery}
Create a config row for a new storage
Parameters:
Name | Type | Description |
---|---|---|
storageConfig |
StorageConfig | storage config to pull values from |
onCompletion |
jQuery.Deferred |
Returns:
created row
- Type
- jQuery
nextPage()
Load the next page of results
- Source:
object()
prototypical inheritance functions
- Source:
- To Do:
-
- Write documentation usage: MySubObject=object(MyObject)
parseMultiStatus(xmlBody)
Parses a multi-status response body.
Parameters:
Name | Type | Description |
---|---|---|
xmlBody |
string | |
|
Array |
- Source:
recheckStorageConfig($tr) → {boolean}
Recheck storage availability
Parameters:
Name | Type | Description |
---|---|---|
$tr |
jQuery | storage row |
Returns:
success
- Type
- boolean
relative_modified_date(timestamp)
Takes an absolute timestamp and return a string with a human-friendly relative date
Parameters:
Name | Type | Description |
---|---|---|
timestamp |
number | A Unix timestamp |
- Source:
removeShare(shareId) → {jQuery}
Deletes the share with the given id
Parameters:
Name | Type | Description |
---|---|---|
shareId |
int | share id |
- Source:
Returns:
- Type
- jQuery
render()
Renders the menu with the currently set items
- Source:
render()
Renders the menu with the currently set items
- Source:
(abstract) render()
Renders this details view
- Source:
render()
Renders this details view
- Source:
replaceSVG($el)
Replace all svg images with png for browser compatibility
Parameters:
Name | Type | Description |
---|---|---|
$el |
- Deprecated:
- use OC.Util.replaceSVG instead
- Source:
request(method, url, headers, body) → {Promise}
Performs a HTTP request, and returns a Promise
Parameters:
Name | Type | Description |
---|---|---|
method |
string | HTTP method |
url |
string | Relative or absolute url |
headers |
Object | HTTP headers as an object. |
body |
string | HTTP request body. |
- Source:
Returns:
- Type
- Promise
revert()
Restores the original file to this revision
saveLinkShare()
Saves the current link share information.
This will trigger an ajax call and refetch the model afterwards.
TODO: this should be a separate model
- Source:
saveStorageConfig($tr, Function, concurrentTimer)
Saves the storage from the given tr
Parameters:
Name | Type | Description |
---|---|---|
$tr |
storage row | |
Function |
callback callback to call after save | |
concurrentTimer |
only update if the timer matches this |
selectTab(tabId)
Selects the given tab by id
Parameters:
Name | Type | Description |
---|---|---|
tabId |
string | tab id |
- Source:
sendEmailPrivateLink(recipientEmail)
Send the link share information by email
Parameters:
Name | Type | Description |
---|---|---|
recipientEmail |
string | recipient email address |
- Source:
sendNotificationForShare(shareType, shareWith, state)
Sends an email notification for the given share
Parameters:
Name | Type | Description |
---|---|---|
shareType |
int | share type |
shareWith |
string | recipient |
state |
bool | whether to set the notification flag or remove it |
- Source:
setFileInfo(fileInfo)
Sets the file info to be displayed in the view
Parameters:
Name | Type | Description |
---|---|---|
fileInfo |
OCA.Files.FileInfoModel | file info to set |
- Source:
setFileInfo(fileInfo)
Sets the file info to be displayed in the view
Parameters:
Name | Type | Description |
---|---|---|
fileInfo |
OCA.Files.FileInfo | file info to set |
setFileInfo(fileInfo)
Sets the file info to be displayed in the view
Parameters:
Name | Type | Description |
---|---|---|
fileInfo |
OCA.Files.FileInfoModel | file info to set |
- Source:
setShowLink(showLink)
sets whether share by link should be displayed or not. Default is
true.
Parameters:
Name | Type | Description |
---|---|---|
showLink |
bool |
- Source:
sharePermissionPossible() → {boolean}
- Source:
Returns:
- Type
- boolean
show(context, $trigger)
Displays the menu under the given element
Parameters:
Name | Type | Description |
---|---|---|
context |
OCA.Files.FileActionContext | context |
$trigger |
Object | trigger element |
- Source:
showAt($target)
Displays the menu under the given element
Parameters:
Name | Type | Description |
---|---|---|
$target |
Object | target element |
- Source:
supportAjaxUploadWithProgress()
Function that will allow us to know if Ajax uploads are supported
- Source:
SVGSupport() → {boolean}
check if the browser support svg images
- Source:
Returns:
- Type
- boolean
updateIcons(itemType, fileList)
Updates the files' "Share" icons according to the known
sharing states stored in OC.Share.statuses.
(not reloaded from server)
Parameters:
Name | Type | Description |
---|---|---|
itemType |
item type | |
fileList |
file list instance defaults to OCA.Files.App.fileList |
- Source:
updatePermissionPossible() → {boolean}
- Source:
Returns:
- Type
- boolean
updateStatus($tr, status, message)
Update status display
Parameters:
Name | Type | Description |
---|---|---|
$tr |
jQuery | |
status |
int | |
message |
string |
whenSelectBackend()
Custom JS event handlers
Trigger callback for all existing configurations
writeParameterInput($td, parameter, placeholder, classes) → {jQuery}
Parameters:
Name | Type | Description |
---|---|---|
$td |
jQuery | |
parameter |
string | |
placeholder |
string | |
classes |
Array |
Returns:
newly created input
- Type
- jQuery