Global

Members

_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:
Source:

_dirty

Dirty flag, whether the view needs to be rerendered
Source:

_knownDirs

List of directories known to exist. Key is the fullpath and value is boolean, true meaning that the directory was already created so no need to create it again.
Source:

_label

Tab label
Source:

_lastSuggestions :object

Type:
  • object
Source:

_linkShareId

share id of the link share, if applicable
Source:

_pendingOperationsCount :int

Type:
Source:

_pendingUploadDoneCount :int

Count of upload done promises that have not finished yet.
Type:
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:

_renderPermissionChange :boolean|number

Type:
  • boolean | number
Source:
Type:
  • boolean
Source:

_tabViews :Array.<OCA.Files.DetailTabView>

List of detail tab views
Type:
Source:

_template :function

Type:
  • function
Source:

_templates :Object

Type:
  • Object
Source:

_uploads :Array.<OC.FileUpload>

Type:
Source:

className :string

Type:
Source:

configModel :OC.Share.ShareConfigModel

Type:
  • OC.Share.ShareConfigModel
Source:

configModel :OC.Share.ShareConfigModel

Type:
  • OC.Share.ShareConfigModel
Source:

configModel :OC.Share.ShareConfigModel

Type:
  • OC.Share.ShareConfigModel
Source:

configModel :OC.Share.ShareConfigModel

Type:
  • OC.Share.ShareConfigModel
Source:

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:

davClient :OC.Files.Client

Webdav client pointing at the root "dav" endpoint
Type:
Source:

droppedDown

Whether the share dropdown is opened.
Source:

fileInfoModel :OC.Files.FileInfo

Type:
Source:

fileList :OCA.Files.FileList

Type:
Source:

fileList :OCA.Files.FileList

Type:
Source:

filesClient :OC.Files.Client

Type:
Source:

id :string

Type:
Source:

id :string

Type:
Source:

id :string

Type:
Source:

int

Id of the file for which to filter activities by
Source:

itemShares

Deprecated:
  • use OC.Share.currentShares instead
Source:

linkShareView :object

Type:
  • object
Source:

resharerInfoView :object

Type:
  • object
Source:

shareeListView :object

Type:
  • object
Source:
Type:
  • boolean
Source:

showPending :boolean

Type:
  • boolean
Source:

statuses

Full list of all share statuses
Source:

string

Type of the object to filter by
Source:

tagName :string

Type:
Source:

tagName :string

Type:
Source:

Methods

_formatRemoteShare(shareWith, shareWithDisplayName, message) → {String}

Format a remote address
Parameters:
Name Type Description
shareWith String userid, full remote share, or whatever
shareWithDisplayName String
message String
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 Object array of all the recipients
Source:
Returns:
modified list of recipients
Type
Array.<String>

_groupReshares(reshares) → {Object}

Group reshares into a single super share element. Does this by finding the most precise share and combines the permissions to be the most permissive.
Parameters:
Name Type Description
reshares Array
Source:
Returns:
reshare
Type
Object

_isReceivedSharedFile(file) → {bool}

Returns whether the given file is known to be a received shared file
Parameters:
Name Type Description
file Object file
Source:
Returns:
true if the file is a shared file
Type
bool

_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:

_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
*

(private) _shareHasPermission(shareIndex, permission) → {boolean}

whether a share from shares has the requested permission
Parameters:
Name Type Description
shareIndex number
permission number
Source:
Returns:
Type
boolean

_supportAjaxUploadWithProgress()

Function that will allow us to know if Ajax uploads are supported
Source:

_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:

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:

cancelUploads()

cancels all uploads
Source:

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

checkExistingFiles(selection, callbacks)

checks the list of existing files prior to uploading and shows a simple dialog to choose skip all, replace all or choose which files to keep
Parameters:
Name Type Description
selection array of files to upload
callbacks object object with several callback methods
Properties
Name Type Description
onNoConflicts function
onSkipConflicts function
onReplaceConflicts function
onChooseConflicts function
onCancel function
Source:

clear()

Clear uploads
Source:

createPermissionPossible() → {boolean}

Source:
Returns:
Type
boolean

deletePermissionPossible() → {boolean}

Source:
Returns:
Type
boolean

editPermissionPossible() → {boolean}

Source:
Returns:
Type
boolean

editPermissionState() → {string}

Source:
Returns:
The state that the 'can edit' permission checkbox should have. Possible values: - empty string: no permission - 'checked': all applicable permissions - 'indeterminate': some but not all permissions
Type
string

ensureFolderExists(fullPath) → {Promise}

Makes sure that the upload folder and its parents exists
Parameters:
Name Type Description
fullPath String full path
Source:
Returns:
promise that resolves when all parent folders were created
Type
Promise

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

findShareWithIndex(shareId) → {number}

returns the array index of a sharee for a provided shareId
Parameters:
Name Type Description
shareId
Source:
Returns:
Type
number

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
Source:
Returns:
Type
jQuery

getCurrentDirectory()

Returns the current directory
Source:
Returns:
current directory

getDetailViews()

Returns an array with the added DetailFileInfoViews.
Source:
Returns:
Array an array with the added DetailFileInfoViews.
Source:
Returns:
Type
string

getFileInfo() → {OCA.Files.FileInfo}

Returns the file info.
Source:
Returns:
file info
Type
OCA.Files.FileInfo

getFileInfo() → {OCA.Files.FileInfoModel}

Returns the file info.
Source:
Returns:
file info
Type
OCA.Files.FileInfoModel

getFileInfo() → {OCA.Files.FileInfoModel}

Returns the file info.
Source:
Returns:
file info
Type
OCA.Files.FileInfoModel

getFullPath() → {string}

Returns the full path to this file
Source:
Returns:
full path
Type
string

getIcon() → {String}

Returns the tab label
Source:
Returns:
|{null} icon class
Type
String

getLabel() → {String}

Returns the tab label
Source:
Returns:
label
Type
String

getPermissions() → {int}

Source:
Returns:
Type
int

getReshareNote() → {string}

Source:
Returns:
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

getReshareWithDisplayName() → {string}

Source:
Returns:
Type
string

getSharedBy(shareIndex) → {string}

Parameters:
Name Type Description
shareIndex
Source:
Returns:
Type
string

getSharedByDisplayName(shareIndex) → {string}

Parameters:
Name Type Description
shareIndex
Source:
Returns:
Type
string

getShareeList() → {Array}

get an array of sharees' share properties
Source:
Returns:
Type
Array

getShareeObject(shareInfo) → {object}

Parameters:
Name Type Description
shareInfo OC.Share.Types.ShareInfo
Source:
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>

getShareTypes() → {Array.<int>}

Returns a list of share types from the existing shares.
Source:
Returns:
array of share types
Type
Array.<int>

getShareWith(shareIndex) → {string}

Parameters:
Name Type Description
shareIndex
Source:
Returns:
Type
string

getShareWithAvatar(shareIndex) → {string}

Parameters:
Name Type Description
shareIndex
Source:
Returns:
Type
string

getShareWithDisplayName(shareIndex) → {string}

Parameters:
Name Type Description
shareIndex
Source:
Returns:
Type
string

getUpload(data) → {OC.FileUpload}

Returns an upload by id
Parameters:
Name Type Description
data int uploadId
Source:
Returns:
file upload
Type
OC.FileUpload

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

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

init($uploadEl, options)

Initialize the upload object
Parameters:
Name Type Description
$uploadEl Object upload element
options Object
Properties
Name Type Attributes Description
fileList OCA.Files.FileList <optional>
file list object
filesClient OC.Files.Client <optional>
files client object
dropZone Object <optional>
drop zone for drag and drop upload
Source:

initCore()

Initializes core
Source:

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

isHideFileListSet() → {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

isPublicUploadAllowed() → {boolean}

Source:
Returns:
Type
boolean

isPublicUploadEnabled() → {boolean}

Source:
Returns:
Type
boolean

isShareWithLinkAllowed() → {boolean}

Source:
Returns:
Type
boolean

isXHRUpload() → {bool}

Returns whether an XHR upload will be used
Source:
Returns:
true if XHR upload will be used, false for iframe upload
Type
bool

linkSharePermissions() → {int}

Source:
Returns:
Type
int

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:

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:

nextPage()

Load the next page of results
Source:

onAutorename(upload)

handle uploading a file and letting the server decide a new name
Parameters:
Name Type Description
upload object
Source:

onCancel()

callback for the conflicts dialog
Source:

onContinue(conflicts)

callback for the conflicts dialog calls onSkip, onReplace or onAutorename for each conflict
Parameters:
Name Type Description
conflicts object list of conflict elements
Source:

onReplace(data)

handle replacing a file on the server with an uploaded file
Parameters:
Name Type Description
data FileUpload
Source:

onSkip(upload)

handle skipping an upload
Parameters:
Name Type Description
upload OC.FileUpload
Source:

parseMultiStatus(xmlBody)

Parses a multi-status response body.
Parameters:
Name Type Description
xmlBody string
Array
Source:

pendingPopoverMenuTemplate(data) → {string}

renders the pending popover template and returns the resulting HTML
Parameters:
Name Type Description
data Object
Source:
Returns:
Type
string

popoverMenuTemplate(data) → {string}

renders the popover template and returns the resulting HTML
Parameters:
Name Type Description
data Object
Source:
Returns:
Type
string

popoverMenuTemplate(data) → {string}

renders the popover template and returns the resulting HTML
Parameters:
Name Type Description
data Object
Source:
Returns:
Type
string

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:

reloadProperties(properties)

Reloads missing properties from server and set them in the model.
Parameters:
Name Type Description
properties array of properties to be reloaded
Source:
Returns:
ajax call object

removeShare(shareId) → {jQuery}

Deletes the share with the given id
Parameters:
Name Type Description
shareId int share id
Source:
Returns:
Type
jQuery

removeUpload(upload)

Removes an upload from the list of known uploads.
Parameters:
Name Type Description
upload OC.FileUpload the upload to remove.
Source:

(abstract) render()

Renders this details view
Source:

render()

Renders the menu with the currently set items
Source:

render()

Renders this details view
Source:

render()

Renders the menu with the currently set items
Source:

render()

Renders the menu with the currently set items
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

saveLinkShare()

Saves the current link share information. This will trigger an ajax call and, if successful, refetch the model afterwards. Callbacks "success", "error" and "complete" can be given in the options object; "success" is called after a successful save once the model is refetch, "error" is called after a failed save, and "complete" is called both after a successful save and after a failed save. Note that "complete" is called before "success" and "error" are called (unlike in jQuery, in which it is called after them); this ensures that "complete" is called even if refetching the model fails. TODO: this should be a separate model
Source:

selectTab(tabId)

Selects the given tab by id
Parameters:
Name Type Description
tabId string tab id
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
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.FileInfoModel file info to set
Source:
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:

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:

showConflict(file)

Show conflict for the given file object
Parameters:
Name Type Description
file OC.FileUpload upload object
Source:

submitUploads(array)

Submit the given uploads
Parameters:
Name Type Description
array Array of uploads to start
Source:

(private) template() → {function}

Source:
Returns:
from Handlebars
Type
function

(private) template() → {function}

Source:
Returns:
from Handlebars
Type
function

(private) template() → {function}

Source:
Returns:
from Handlebars
Type
function

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