Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="csrf-token" content="7F6YWCJ1DunHcbDgmKBnQWihnXnDod8FxQ3gQBjR">
- <title>Media Manager</title>
- <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
- </head>
- <body>
- <section id="app" v-cloak>
- <div class="notif-container">
- <my-notification></my-notification>
- </div>
- <div class="container is-fluid">
- <div class="columns">
- <div class="column">
- <media-manager inline-template
- v-cloak
- class='hide-native-scrollbar'
- :config="{"baseUrl":"https:\/\/trainanywhere.app\/storage\/","hideFilesExt":true,"mimeTypes":{"image":["binary\/octet-stream"],"archive":["application\/x-tar","application\/zip"]},"broadcasting":false,"gfi":true,"ratioBar":true,"previewFilesBeforeUpload":true}"
- :routes="{"files":"https:\/\/trainanywhere.app\/media\/get-files","lock":"https:\/\/trainanywhere.app\/media\/lock-file","visibility":"https:\/\/trainanywhere.app\/media\/change-visibility","upload":"https:\/\/trainanywhere.app\/media\/upload","locked_list":"https:\/\/trainanywhere.app\/media\/get-locked-list"}"
- :translations="{"add_to_list":"Add To List","added":"Added","already_exists":"A File\/Folder Already Exists With That Name","application":"Application","audio":"Audio","bm_add_to_list":"Save Current Path","bm":"Bookmarks","clear":"Clear selection","copy_success":"Successfully Copied","copy":"Copy","create_folder_notif":"New Folder Was Created","create_success":"Successfully Created","crop_apply":"Apply Changes","crop_flip_horizontal":"Flip Horizontal","crop_flip_vertical":"Flip Vertical","crop_reset_filters":"Clear Filters","crop_reset":"Reset All","crop_rotate_left":"Rotate Left","crop_rotate_right":"Rotate Right","crop_zoom_in":"Zoom In","crop_zoom_out":"Zoom Out","crop":"Crop","delete_success":"Successfully Deleted","delete":"Delete","description":"Description","diff":"Toggle Diff","dimension":"Dimensions","downloaded":"Downloaded","editor":"Editor","error_altered_fwli":"Can't Be Moved, Renamed Or Deleted Because It Has Some Locked Items","filter_by":"Filter By ","filtration":"Filters & Sorting","find":"Find...","focals":"Focal Points","folder":"Folder","found":"Found","glbl_search_avail":"Global Search Is Now Available.","glbl_search":"Global Search","go_to_folder":"Go To Folder !","image":"Image","last_modified":"Last Modified","locked":"Locked","move_clear":"Movable List Successfully Cleared","move_success":"Successfully Moved","move":"Move","name":"Name","new_uploads_notif":"New Items Were Uploaded","no_val":"Maybe You Should Add Something First !!!","non":"Non","nothing_found":"Nothing Found","open":"Open","options":"Options","presets":"Presets","refresh_notif":"Press The Refresh Button To View Them","rename_success":"Successfully Renamed","rename":"Rename","reset":"Reset All","save_success":"Successfully Saved As","save":"Save","selected":"Selected","sep_download":"Folders Should Be Downloaded Separately","size":"Size","sort_by":"Sort By","stand_by":"Please Stand By ...","text":"Text","to_cp":"Copy Link To Clipboard","upload_in_progress":"Upload Is Already In Progress","upload_success":"Successfully Uploaded","video":"Video"}"
- :in-modal="false"
- :hide-ext="[]"
- :hide-path="[]"
- :restrict="{}"
- :user-id="0"
- :upload-panel-img-list="["\/assets\/vendor\/MediaManager\/patterns\/gif\/5b98026bab87a.gif","\/assets\/vendor\/MediaManager\/patterns\/still\/nyc-candy.png"]">
- <div class="media-manager"
- :class="[
- {'__stack-reverse': waitingForUpload},
- {'top-space': !inModal}
- ]">
- <transition name="mm-list" mode="out-in">
- <content-ratio v-if="config.ratioBar && allItemsCount"
- :list="allFiles"
- :total="allItemsCount"
- :file-type-is="fileTypeIs">
- </content-ratio>
- </transition>
- <global-search-panel
- :trans="trans"
- :file-type-is="fileTypeIs"
- :add-to-movable-list="addToMovableList"
- :in-movable-list="inMovableList"
- :no-scroll="noScroll"
- :browser-support="browserSupport">
- </global-search-panel>
- <usage-intro-panel :no-scroll="noScroll"></usage-intro-panel>
- <transition name="mm-list" mode="out-in">
- <nav class="media-manager__toolbar level" v-show="toolBar">
- <div class="level-left">
- <div class="level-item">
- <div class="field" :class="{'has-addons': !isBulkSelecting()}">
- <div class="control" v-if="!isBulkSelecting()">
- <button class="button"
- ref="upload"
- :disabled="isLoading"
- @click.stop="toggleUploadPanel()"
- v-tippy
- title="u">
- <span class="icon"><icon name="shopping-basket"></icon></span>
- <span>Upload</span>
- </button>
- </div>
- <div class="control">
- <button class="button"
- :disabled="isLoading"
- @click.stop="createNewFolder()">
- <span class="icon"><icon name="folder"></icon></span>
- <span>Add Folder</span>
- </button>
- </div>
- </div>
- </div>
- <div class="level-item">
- <div class="field has-addons">
- <div class="control">
- <button class="button is-link"
- ref="move"
- :disabled="isLoading || !movableItemsCount"
- v-tippy
- title="m / p"
- @click.stop="moveItem()">
- <span class="icon"><icon name="share" scale="0.8"></icon></span>
- <span>Move</span>
- </button>
- </div>
- <div class="control" v-if="!isBulkSelecting()">
- <button class="button is-link"
- ref="rename"
- :disabled="ops_btn_disable"
- @click.stop="renameItem()">
- <span class="icon"><icon name="terminal"></icon></span>
- <span>Rename</span>
- </button>
- </div>
- <div class="control" v-show="!isBulkSelecting()">
- <button class="button is-link"
- ref="editor"
- :disabled="editor_btn_disable"
- v-tippy
- title="e"
- @click.stop="imageEditor()">
- <span class="icon"><icon name="object-ungroup" scale="1.2"></icon></span>
- <span>Editor</span>
- </button>
- </div>
- <div class="control">
- <button class="button is-link"
- ref="delete"
- :disabled="ops_btn_disable"
- v-tippy
- title="d / del"
- @click.stop="deleteItem()">
- <span class="icon"><icon name="trash"></icon></span>
- <span>Delete</span>
- </button>
- </div>
- </div>
- </div>
- <div class="level-item">
- <div class="field has-addons">
- <div class="control" v-if="!isBulkSelecting()">
- <v-touch class="button is-primary"
- ref="refresh"
- :disabled="isLoading"
- tag="button"
- v-tippy
- title="(R) efresh"
- @tap="refresh()"
- @hold="clearAll()">
- <span class="icon">
- <icon name="refresh" :spin="isLoading"></icon>
- </span>
- </v-touch>
- </div>
- <div class="control">
- <button class="button is-warning"
- ref="lock"
- :disabled="lock_btn_disable"
- v-tippy
- title="(L) ock"
- @click.stop="lockFileForm()">
- <span class="icon">
- <icon :name="IsLocked(selectedFile) ? 'lock' : 'unlock'"></icon>
- </span>
- </button>
- </div>
- <div class="control">
- <button class="button"
- :class="IsVisible(selectedFile) ? 'is-light' : 'is-danger'"
- ref="visibility"
- :disabled="vis_btn_disable"
- v-tippy
- title="(V) isibility"
- @click.stop="FileVisibilityForm()">
- <span class="icon">
- <icon :name="IsVisible(selectedFile) ? 'eye' : 'eye-slash'"></icon>
- </span>
- </button>
- </div>
- </div>
- </div>
- </div>
- <div class="level-right" v-if="!waitingForUpload">
- <div class="level-item">
- <div class="field" :class="{'has-addons' : isBulkSelecting()}">
- <div class="control">
- <button @click.stop="blkSlctAll()"
- ref="bulkSelectAll"
- class="button"
- :class="{'is-warning' : bulkSelectAll}"
- v-show="isBulkSelecting()"
- :disabled="searchItemsCount == 0 || isLoading"
- v-tippy
- title="a">
- <template v-if="bulkSelectAll">
- <span class="icon"><icon name="minus" scale="0.8"></icon></span>
- <span>Select Non</span>
- </template>
- <template v-else>
- <span class="icon"><icon name="plus" scale="0.8"></icon></span>
- <span>Select All</span>
- </template>
- </button>
- </div>
- <div class="control">
- <button @click.stop="blkSlct()"
- ref="bulkSelect"
- class="button"
- :class="{'is-danger' : bulkSelect}"
- :disabled="searchItemsCount == 0 || !allItemsCount || isLoading"
- v-tippy
- title="b">
- <span class="icon"><icon name="puzzle-piece"></icon></span>
- <span>Bulk Select</span>
- </button>
- </div>
- </div>
- </div>
- <template>
- <div class="level-item" v-if="searchItemsCount != 0 && allItemsCount">
- <filter-and-sorting :disabled="isLoading"
- :filter-name-is="filterNameIs"
- :sort-name-is="sortNameIs"
- :set-filter-name="setFilterName"
- :set-sort-name="setSortName"
- :have-a-file-of-type="haveAFileOfType"
- :trans="trans">
- </filter-and-sorting>
- </div>
- <div class="level-item" v-if="!restrictModeIsOn && firstRun">
- <dir-bookmarks :disabled="isLoading"
- :dir-bookmarks="dirBookmarks"
- :path="files.path"
- :trans="trans">
- </dir-bookmarks>
- </div>
- <div class="level-item" v-if="allItemsCount">
- <div class="control">
- <div class="field has-addons">
- <p class="control" v-if="!restrictModeIsOn">
- <global-search-btn
- route="https://trainanywhere.app/media/global-search"
- :is-loading="isLoading"
- :trans="trans"
- :show-notif="showNotif">
- </global-search-btn>
- </p>
- <p class="control has-icons-left">
- <input class="input"
- :disabled="isLoading"
- type="text"
- ref="search"
- v-model="searchFor"
- :placeholder="trans('find')">
- <span class="icon is-left">
- <icon name="search"></icon>
- </span>
- </p>
- <p class="control">
- <button class="button is-black" :disabled="!searchFor"
- v-tippy
- title="Clear Search"
- @click.stop="resetInput('searchFor')">
- <span class="icon"><icon name="times"></icon></span>
- </button>
- </p>
- </div>
- </div>
- </div>
- </template>
- </div>
- </nav>
- </transition>
- <section>
- <div class="media-manager__dz" :class="{'__dz-active': uploadArea}">
- <form id="new-upload" :style="uploadPanelImg">
- <input type="hidden" name="upload_path" :value="files.path">
- <input type="hidden" name="random_names" :value="useRandomNamesForUpload">
- <div class="dz-message title is-4">Drag & Drop Files<br>Or<br>Click To Upload</div>
- <div class="form-switcher"
- title="Use Random Names ?"
- v-tippy="{arrow: true, placement: 'right'}">
- <input type="checkbox" id="random_names" v-model="useRandomNamesForUpload">
- <label class="switcher" for="random_names"></label>
- </div>
- <div class="save_link" @click.stop="toggleModal('save_link_modal')" v-if="!restrictUpload()">
- <span class="icon is-large"
- title="Upload Image From Url"
- v-tippy="{arrow: true, placement: 'left'}">
- <icon>
- <icon class="circle" name="circle" scale="2.5"></icon>
- <icon class="anchor" name="link"></icon>
- </icon>
- </span>
- </div>
- </form>
- </div>
- <transition name="mm-list">
- <div v-show="showProgress" id="uploadProgress" class="progress">
- <div class="progress-bar is-success progress-bar-striped active" :style="{width: progressCounter}"></div>
- </div>
- </transition>
- </section>
- <transition-group tag="ul"
- class="__stack-breadcrumb-mobile is-hidden-desktop"
- ref="bc"
- v-if="pathBarDirsList.length > 0"
- name="mm-list">
- <li id="library-bc" key="library-bc">
- <a v-if="pathBarDirsList.length > 0 && !(isBulkSelecting() || isLoading)"
- v-tippy
- title="BackSpace"
- @click.stop="goToFolder(0)">
- Home
- </a>
- <p v-else>Home</p>
- </li>
- <li v-for="(folder, index) in pathBarDirsList" :id="folder + '-bc'" :key="`${index}_${folder}`">
- <p v-if="isLastItemByIndex(index, pathBarDirsList) || isBulkSelecting() || isLoading">{{ folder }}</p>
- <a v-else
- v-tippy
- title="BackSpace"
- @click.stop="pathBarDirsList.length > 1 ? goToFolder(index+1) : false">
- {{ folder }}
- </a>
- </li>
- </transition-group>
- <div class="media-manager__stack">
- <section class="__stack-container">
- <div id="uploadPreview">
- <div class="dz-preview-ops btn-animate extra-func-btns">
- <button v-tippy="{arrow: true, placement: 'left'}"
- title="Add More Files (u)"
- @click.stop="toggleUploadPanel()"
- class="btn-plain">
- <span class="icon is-large">
- <icon>
- <icon name="circle" scale="2.5"></icon>
- <icon class="icon-btn" name="cloud-upload"/>
- </icon>
- </span>
- </button>
- <button v-tippy="{arrow: true, placement: 'left'}"
- title="Upload (Enter)"
- ref="process-dropzone"
- class="btn-plain">
- <span class="icon is-large">
- <icon>
- <icon name="circle" scale="2.5"></icon>
- <icon class="icon-btn" name="check"/>
- </icon>
- </span>
- </button>
- <button v-tippy="{arrow: true, placement: 'left'}"
- title="Clear (Esc)"
- ref="clear-dropzone"
- class="btn-plain">
- <span class="icon is-large">
- <icon>
- <icon name="circle" scale="2.5"></icon>
- <icon class="icon-btn" name="times"/>
- </icon>
- </span>
- </button>
- </div>
- <section class="sidebar-container">
- <div class="sidebar"></div>
- </section>
- <template v-for="file in uploadPreviewList">
- <keep-alive v-if="checkForUploadedFile(file.name)">
- <upload-preview v-if="file.name == selectedUploadPreviewName"
- :key="file.name"
- :file="file"
- :file-type-is="fileTypeIs"
- :trans="trans">
- </upload-preview>
- </keep-alive>
- </template>
- </div>
- <div>
- <div id="loading_files" v-show="loading_files">
- <div id="loading_files_anim" data-json="https://trainanywhere.app/assets/vendor/MediaManager/lottie/world.json"></div>
- <transition name="mm-list" mode="out-in">
- <h3 key="1" v-if="showProgress" class="mm-animated pulse">
- Please Stand By ...
- <strong>{{ progressCounter }}</strong>
- </h3>
- <h3 key="2" v-else>Loading Files</h3>
- </transition>
- </div>
- <div id="ajax_error" v-show="ajax_error">
- <div id="ajax_error_anim" data-json="https://trainanywhere.app/assets/vendor/MediaManager/lottie/avalanche.json"></div>
- <h3>Oh NO! Something Went Wrong</h3>
- </div>
- <v-touch id="no_files"
- v-show="no_files"
- class="no_files"
- @swiperight="goToPrevFolder()"
- @swipeleft="goToPrevFolder()"
- @hold="containerClick($event, 'no_files')"
- @dbltap="containerClick($event, 'no_files')">
- <div id="no_files_anim" data-json="https://trainanywhere.app/assets/vendor/MediaManager/lottie/zero.json"></div>
- <h3>No Files In This Folder</h3>
- </v-touch>
- </div>
- <div>
- <usage-intro-overlay></usage-intro-overlay>
- <usage-intro-btn v-show="!isLoading && !waitingForUpload"></usage-intro-btn>
- </div>
- <div v-if="allItemsCount && !isLoading && !waitingForUpload"
- class="movable-list extra-func-btns">
- <v-touch class="btn-plain"
- v-tippy="{arrow: true, hideOnClick: false}"
- :title="inMovableList() ? 'Added' : 'Add To List (c / x)'"
- @tap="addToMovableList()"
- @dbltap="showMovableList()"
- @hold="clearMovableList()">
- <span class="icon">
- <icon name="shopping-cart" scale="1.2"></icon>
- </span>
- <span class="counter">{{ movableItemsCount || null }}</span>
- </v-touch>
- </div>
- <v-touch class="__stack-files mm-animated"
- :class="{'__stack-sidebar-hidden' : !infoSidebar}"
- ref="__stack-files"
- @swiperight="goToPrevFolder()"
- @swipeleft="goToPrevFolder()"
- @hold="containerClick($event)"
- @dbltap="containerClick($event)"
- @pinchin="containerClick($event)">
- <section>
- <div id="no_search" v-show="no_search">
- <div id="no_search_anim" data-json="https://trainanywhere.app/assets/vendor/MediaManager/lottie/ice_cream.json"></div>
- <h3>{{ trans('nothing_found') }}</h3>
- </div>
- </section>
- <ul class="__files-boxs" ref="filesList">
- <li v-for="(file, index) in orderBy(filterBy(allFiles, searchFor, 'name'), sortName, sortDirection)"
- :key="file.name"
- :data-file-index="index"
- @click.stop="setSelected(file, index, $event)">
- <v-touch class="__file-box mm-animated"
- :class="{'bulk-selected': IsInBulkList(file), 'selected' : isSelected(file)}"
- @swipeup="swipGesture($event, file, index)"
- @swipedown="swipGesture($event, file, index)"
- @swiperight="swipGesture($event, file, index)"
- @swipeleft="swipGesture($event, file, index)"
- @hold="pressGesture($event, file, index)"
- @dbltap="pressGesture($event, file, index)">
- <button v-if="$refs.lock"
- class="__box-lock-icon icon"
- :disabled="isLoading"
- :class="IsLocked(file) ? 'is-danger' : 'is-success'"
- :title="IsLocked(file) ? 'UnLock Item' : 'Lock Item'"
- v-tippy="{arrow: true, hideOnClick: false}"
- @click.stop="lockFileForm(file)">
- </button>
- <div v-if="!fileTypeIs(file, 'folder')"
- class="__box-copy-link icon"
- @click.stop="copyLink(file.path)"
- :title="linkCopied ? trans('copied') : trans('to_cp')"
- v-tippy="{arrow: true, hideOnClick: false}"
- @hidden="linkCopied = false">
- <icon name="clone" scale="0.9"></icon>
- </div>
- <div class="__box-data">
- <div class="__box-preview">
- <template v-if="fileTypeIs(file, 'image')">
- <image-intersect
- :file="file"
- :check-for-dimensions="checkForDimensions"
- :browser-support="browserSupport"
- root-el=".__stack-files">
- </image-intersect>
- </template>
- <span v-else class="icon is-large">
- <icon v-if="fileTypeIs(file, 'folder')" name="folder" scale="2.6"></icon>
- <icon v-else-if="fileTypeIs(file, 'application')" name="cogs" scale="2.6"></icon>
- <icon v-else-if="fileTypeIs(file, 'compressed')" name="file-archive-o" scale="2.6"></icon>
- <icon v-else-if="fileTypeIs(file, 'video')" name="film" scale="2.6"></icon>
- <icon v-else-if="fileTypeIs(file, 'audio')" name="music" scale="2.6"></icon>
- <icon v-else-if="fileTypeIs(file, 'pdf')" name="file-pdf-o" scale="2.6"></icon>
- <icon v-else-if="fileTypeIs(file, 'text')" name="file-text-o" scale="2.6"></icon>
- </span>
- </div>
- <div class="__box-info">
- <template v-if="fileTypeIs(file, 'folder')">
- <h4>{{ file.name }}</h4>
- <small>
- <span>{{ file.count }} Item(s)</span>
- <span v-if="file.size > 0" class="__info-file-size">"{{ getFileSize(file.size) }}"</span>
- </small>
- </template>
- <template v-else>
- <h4>{{ getFileName(file.name) }}</h4>
- <small class="__info-file-size">{{ getFileSize(file.size) }}</small>
- </template>
- </div>
- </div>
- </v-touch>
- </li>
- </ul>
- <infinite-loading v-if="firstRun && files.next"
- spinner="waveDots"
- @infinite="loadPaginatedFiles">
- <span slot="no-more"></span>
- </infinite-loading>
- </v-touch>
- <v-touch v-if="infoSidebar"
- class="__stack-sidebar is-hidden-touch"
- @swiperight="toggleInfoSidebar(), saveUserPref()"
- @swipeleft="toggleInfoSidebar(), saveUserPref()">
- <div class="__sidebar-preview">
- <transition name="mm-slide" mode="out-in" appear>
- <div key="none-selected" class="__sidebar-none-selected" v-if="!selectedFile">
- <span @click.stop="reset()" class="link"><icon name="power-off" scale="3.2"></icon></span>
- <p>No File Or Folder Selected</p>
- </div>
- <image-preview v-else-if="selectedFileIs('image')"
- v-tippy="{arrow: true, placement: 'left'}"
- title="Space"
- :key="selectedFile.storage_path">
- <img :src="selectedFile.path"
- :alt="selectedFile.name"
- class="link image"
- @click.stop="isBulkSelecting() ? false : toggleModal('preview_modal')"/>
- </image-preview>
- <div v-else-if="selectedFileIs('video')"
- v-tippy="{arrow: true, placement: 'left'}"
- title="Space"
- :key="selectedFile.storage_path">
- <video controls
- playsinline
- @loadedmetadata="saveVideoDimensions"
- preload="metadata"
- data-player
- :src="selectedFile.path">
- Your Browser Does Not Support The Video Tag
- </video>
- </div>
- <div v-else-if="selectedFileIs('audio')"
- v-tippy="{arrow: true, placement: 'left'}"
- title="Space"
- :key="selectedFile.storage_path">
- <template>
- <img v-if="audioFileMeta && audioFileMeta.cover"
- :src="audioFileMeta.cover"
- :alt="selectedFile.name"
- class="image"/>
- <icon v-else class="svg-prev-icon" name="music" scale="8"></icon>
- </template>
- <audio controls
- class="is-hidden"
- preload="none"
- data-player
- :src="selectedFile.path">
- Your Browser Does Not Support The Audio Element
- </audio>
- </div>
- <div key="pdf" v-else-if="selectedFileIs('pdf')"
- class="link"
- v-tippy="{arrow: true, placement: 'left'}"
- title="Space"
- @click.stop="toggleModal('preview_modal')">
- <icon class="svg-prev-icon" name="file-pdf-o" scale="4"></icon>
- </div>
- <div key="text" v-else-if="selectedFileIs('text')"
- class="link"
- v-tippy="{arrow: true, placement: 'left'}"
- title="Space"
- @click.stop="toggleModal('preview_modal')">
- <icon class="svg-prev-icon" name="file-text-o" scale="4"></icon>
- </div>
- <icon-types v-else
- classes="svg-prev-icon"
- :file="selectedFile"
- :file-type-is="fileTypeIs"
- :scale="4"
- :except="['image', 'audio', 'video', 'pdf', 'text']"/>
- </transition>
- </div>
- <div v-if="allItemsCount"
- class="__sidebar-info"
- :style="{'background-color': selectedFile ? 'white' : ''}">
- <transition name="mm-list" mode="out-in" appear>
- <div :key="selectedFile.name" v-if="selectedFile">
- <template v-if="selectedFileIs('audio') && checkAudioData()">
- <table>
- <tbody>
- <tr v-if="audioFileMeta.artist">
- <td class="t-key">Artist:</td>
- <td class="t-val">{{ audioFileMeta.artist }}</td>
- </tr>
- <tr v-if="audioFileMeta.title">
- <td class="t-key">Title:</td>
- <td class="t-val">{{ audioFileMeta.title }}</td>
- </tr>
- <tr v-if="audioFileMeta.album">
- <td class="t-key">Album:</td>
- <td class="t-val">{{ audioFileMeta.album }}</td>
- </tr>
- <tr v-if="audioFileMeta.track">
- <td class="t-key">Track Nº:</td>
- <td class="t-val">{{ audioFileMeta.track }} <span v-if="audioFileMeta.track_total">/ {{ audioFileMeta.track_total }}</span></td>
- </tr>
- <tr v-if="audioFileMeta.year">
- <td class="t-key">Year:</td>
- <td class="t-val">{{ audioFileMeta.year }}</td>
- </tr>
- <tr v-if="audioFileMeta.genre">
- <td class="t-key">Genre:</td>
- <td class="t-val">{{ audioFileMeta.genre }}</td>
- </tr>
- </tbody>
- </table>
- <hr>
- </template>
- <table>
- <tbody>
- <tr>
- <td class="t-key">Name:</td>
- <td class="t-val">{{ selectedFile.name }}</td>
- </tr>
- </tbody>
- </table>
- <table>
- <tbody>
- <tr>
- <td class="t-key">Type:</td>
- <td class="t-val">{{ selectedFile.type }}</td>
- </tr>
- </tbody>
- </table>
- <table>
- <tbody>
- <tr>
- <td class="t-key">Size:</td>
- <td class="t-val">{{ getFileSize(selectedFile.size) }}</td>
- </tr>
- </tbody>
- </table>
- <template v-if="selectedFileIs('folder')">
- <table>
- <tbody>
- <tr>
- <td class="t-key">Item(s):</td>
- <td class="t-val">{{ selectedFile.count }}</td>
- </tr>
- </tbody>
- </table>
- <div class="__sidebar-zip" v-show="!isBulkSelecting()">
- <table>
- <tbody>
- <tr>
- <td class="t-key">Download Folder:</td>
- <td class="t-val">
- <form action="https://trainanywhere.app/media/folder-download"method="post" @submit.prevent="ZipDownload($event)">
- <input type="hidden" name="_token" value="7F6YWCJ1DunHcbDgmKBnQWihnXnDod8FxQ3gQBjR">
- <input type="hidden" name="folders" :value="files.path">
- <input type="hidden" name="name" :value="selectedFile.name">
- <button type="submit" class="btn-plain zip":disabled="config.gfi && selectedFile.count == 0">
- <span class="icon"><icon name="archive" scale="1.2"></icon></span>
- </button>
- </form>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </template>
- <template v-else>
- <table v-if="(selectedFileIs('image') || selectedFileIs('video')) && dimensions.length">
- <tbody>
- <tr>
- <td class="t-key">Dimensions:</td>
- <td class="t-val">{{ selectedFileDimensions }}</td>
- </tr>
- </tbody>
- </table>
- <table>
- <tbody>
- <tr>
- <td class="t-key">Visibility:</td>
- <td class="t-val">{{ selectedFile.visibility }}</td>
- </tr>
- </tbody>
- </table>
- <table>
- <tbody>
- <tr>
- <td class="t-key">Preview:</td>
- <td class="t-val"><a :href="selectedFile.path" target="_blank">Public URL</a></td>
- </tr>
- </tbody>
- </table>
- <div class="__sidebar-zip">
- <table>
- <tbody>
- <tr>
- <td class="t-key">Download File:</td>
- <td class="t-val">
- <button class="btn-plain" @click.prevent="saveFile(selectedFile)">
- <span class="icon"><icon name="download" scale="1.2"></icon></span>
- </button>
- </td>
- <td class="t-val">
- <form action="https://trainanywhere.app/media/files-download"
- method="post"
- @submit.prevent="ZipDownload($event)"
- v-show="isBulkSelecting()">
- <input type="hidden" name="_token" value="7F6YWCJ1DunHcbDgmKBnQWihnXnDod8FxQ3gQBjR">
- <input type="hidden" name="list" :value="JSON.stringify(bulkList)">
- <input type="hidden" name="name" :value="folders.length ? folders[folders.length - 1] : 'media_manager'">
- <button type="submit" class="btn-plain zip":disabled="hasFolder()">
- <span class="icon"><icon name="archive" scale="1.2"></icon></span>
- </button>
- </form>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </template>
- <table>
- <tbody>
- <tr>
- <td class="t-key">Last Modified:</td>
- <td class="t-val">{{ selectedFile.last_modified_formated }}</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div v-else></div>
- </transition>
- <div class="__sidebar-count">
- <div key="1" v-if="allItemsCount">
- <p class="title is-1">{{ allItemsCount }}</p>
- <p class="heading">Total</p>
- </div>
- <div key="2" v-if="searchItemsCount !== null && searchItemsCount >= 0">
- <p class="title is-1">{{ searchItemsCount }}</p>
- <p class="heading">{{ trans('found') }}</p>
- </div>
- <div key="3" v-if="bulkItemsCount" class="__sidebar-count-bulk">
- <p>
- <span class="title is-1">{{ bulkItemsCount }}</span>
- <template v-if="bulkItemsChild">
- <span class="icon is-medium"><icon name="plus"></icon></span>
- <span class="title is-5">{{ bulkItemsChild }}</span>
- </template>
- </p>
- <p v-show="bulkItemsSize" class="title is-6 has-text-weight-semibold">{{ bulkItemsSize }}</p>
- <p class="heading">Selected</p>
- </div>
- </div>
- </div>
- </v-touch>
- <v-touch v-else-if="!infoSidebar && !isASmallScreen"
- class="__sidebar-swipe-hidden"
- @swiperight="toggleInfoSidebar(), saveUserPref()"
- @swipeleft="toggleInfoSidebar(), saveUserPref()">
- </v-touch>
- </section>
- <section class="__stack-breadcrumb level is-mobile">
- <div class="level-left">
- <div class="level-item">
- <nav class="breadcrumb has-arrow-separator is-hidden-touch">
- <transition-group tag="ul" name="mm-list">
- <li key="library-bc">
- <a v-if="pathBarDirsList.length > 0 && !(isBulkSelecting() || isLoading)"
- class="p-l-0 level"
- v-tippy
- title="BackSpace"
- @click.stop="goToFolder(0)">
- <span class="icon level-item is-marginless"><icon name="map"></icon></span>
- <span class="level-item m-l-5 is-marginless">Home</span>
- </a>
- <p v-else class="p-l-0 level">
- <span class="icon level-item is-marginless"><icon name="map-o"></icon></span>
- <span class="level-item m-l-5 is-marginless">Home</span>
- </p>
- </li>
- <li v-for="(folder, index) in pathBarDirsList" :key="`${index}-${folder}`">
- <p v-if="isLastItemByIndex(index, pathBarDirsList) || isBulkSelecting() || isLoading"
- class="level">
- <span class="icon level-item is-marginless"><icon name="folder-open-o"></icon></span>
- <span class="level-item m-l-5 is-marginless">{{ folder }}</span>
- </p>
- <a v-else
- v-tippy
- title="BackSpace"
- class="level"
- @click.stop="pathBarDirsList.length > 1 ? goToFolder(index+1) : false">
- <span class="icon level-item is-marginless"><icon name="folder"></icon></span>
- <span class="level-item m-l-5 is-marginless">{{ folder }}</span>
- </a>
- </li>
- </transition-group>
- </nav>
- </div>
- </div>
- <div class="level-right">
- <div class="level-item" v-if="waitingForUpload">
- <nav class="breadcrumb">
- <ul>
- <li><p class="level has-text-weight-bold">{{ uploadPreviewList.length }} File's</p></li>
- <li><p class="level has-text-weight-bold">{{ uploadPreviewListSize }}</p></li>
- </ul>
- </nav>
- </div>
- <div class="level-item" v-show="!isLoading && !waitingForUpload">
- <div class="is-hidden-touch"
- @click.stop="toggleInfoSidebar(), saveUserPref()"
- v-tippy
- title="t"
- v-if="allItemsCount">
- <transition :name="infoSidebar ? 'mm-info-out' : 'mm-info-in'" mode="out-in">
- <div :key="infoSidebar ? 1 : 2" class="__stack-sidebar-toggle has-text-link">
- <template v-if="infoSidebar">
- <span>Close</span>
- <span class="icon"><icon name="angle-double-right"></icon></span>
- </template>
- <template v-else>
- <span>Open</span>
- <span class="icon"><icon name="angle-double-left"></icon></span>
- </template>
- </div>
- </transition>
- </div>
- <div class="is-hidden-desktop">
- <button class="button is-link __stack-left-toolbarToggle" @click.stop="toolBar = !toolBar">
- <span class="icon"><icon :name="toolBar ? 'times' : 'bars'"></icon></span>
- </button>
- </div>
- </div>
- </div>
- </section>
- </div>
- <section>
- <div v-if="isActiveModal('preview_modal')"
- class="modal mm-animated fadeIn is-active __modal-preview">
- <div class="modal-background link" @click.stop="toggleModal()"></div>
- <div class="mm-animated fadeInDown __modal-content-wrapper">
- <transition :name="`mm-img-${imageSlideDirection}`"
- mode="out-in"
- appear>
- <div class="modal-content" :key="selectedFile.path">
- <v-touch class="card"
- :class="{'pdf-prev': selectedFileIs('pdf') || selectedFileIs('text')}"
- @swiperight="cardSwipGesture"
- @swipeleft="cardSwipGesture"
- @swipeup="cardSwipGesture"
- @swipedown="cardSwipGesture">
- <div class="card-image">
- <object v-if="selectedFileIs('pdf') || selectedFileIs('text')"
- :data="selectedFile.path"
- :type="selectedFile.type">
- <p v-if="selectedFileIs('pdf')">Your Browser Does Not Support Pdfs, Please Download The Pdf To View It</p>
- </object>
- <div v-else-if="selectedFileIs('video')">
- <video controls
- playsinline
- preload="metadata"
- data-player
- :src="selectedFile.path">
- Your Browser Does Not Support The Video Tag
- </video>
- </div>
- <div v-else-if="selectedFileIs('audio')" class="audio-prev">
- <template>
- <img v-if="audioFileMeta && audioFileMeta.cover"
- :src="audioFileMeta.cover"
- :alt="selectedFile.name"
- class="image"/>
- <div v-else class="audio-icon">
- <icon class="svg-prev-icon" name="music" scale="8"></icon>
- </div>
- </template>
- <audio controls
- class="is-hidden"
- preload="metadata"
- data-player
- :src="selectedFile.path">
- Your Browser Does Not Support The Audio Element
- </audio>
- </div>
- <image-preview v-else
- :show-ops="true"
- :trans="trans"
- :ops_btn_disable="ops_btn_disable"
- :in-movable-list="inMovableList"
- :rename-item="renameItem"
- :delete-item="deleteItem"
- :image-editor-card="imageEditorCard"
- :add-to-movable-list="addToMovableList">
- <a :href="selectedFile.path"
- rel="noreferrer noopener"
- target="_blank"
- class="image">
- <img :src="selectedFile.path" :alt="selectedFile.name">
- </a>
- </image-preview>
- </div>
- <div class="card-content">
- <p class="card-details">
- <span class="tag" v-if="(selectedFileIs('image') || selectedFileIs('video')) && dimensions.length">
- {{ selectedFileDimensions }}
- </span>
- <span class="tag" v-if="selectedFile.size > 0">{{ getFileSize(selectedFile.size) }}</span>
- </p>
- <p class="title is-marginless">
- <span class="link"
- @click.stop="copyLink(selectedFile.path)"
- :title="linkCopied ? trans('copied') : trans('to_cp')"
- v-tippy="{arrow: true, hideOnClick: false, followCursor: true}"
- @hidden="linkCopied = false">
- {{ selectedFile.name }}
- </span>
- <a :href="selectedFile.path"
- v-if="selectedFileIs('pdf') || selectedFileIs('text')"
- rel="noreferrer noopener"
- target="_blank"
- title="Public URL"
- v-tippy>
- <icon name="search" scale="1.1"></icon>
- </a>
- </p>
- <p class="subtitle is-6 m-t-5">
- <span>{{ selectedFile.last_modified_formated }}</span>
- </p>
- <div class="level is-mobile">
- <div class="level-left">
- <div class="level-item">
- <span v-if="$refs.lock"
- class="icon is-large link"
- :class="IsLocked(selectedFile) ? 'is-danger' : 'is-success'"
- :title="IsLocked(selectedFile) ? 'UnLock Item' : 'Lock Item'"
- v-tippy="{arrow: true, hideOnClick: false}"
- @click.stop="$refs.lock.click()">
- <icon :name="IsLocked(selectedFile) ? 'lock' : 'unlock'" scale="1.1"></icon>
- </span>
- </div>
- <div class="level-item">
- <span v-if="$refs.visibility"
- class="icon is-large link"
- :class="IsVisible(selectedFile) ? 'is-success' : 'is-danger'"
- title="Change Visibility"
- v-tippy
- @click.stop="$refs.visibility.click()">
- <icon :name="IsVisible(selectedFile) ? 'eye' : 'eye-slash'" scale="1.1"></icon>
- </span>
- </div>
- </div>
- <div class="level-right">
- <div class="level-item">
- <span class="icon is-large link is-black"
- title="Download File"
- v-tippy
- @click.prevent="saveFile(selectedFile)">
- <icon name="download" scale="1.1"></icon>
- </span>
- </div>
- </div>
- </div>
- </div>
- </v-touch>
- </div>
- </transition>
- </div>
- <button class="modal-close is-large" @click.stop="toggleModal()"></button>
- </div>
- <div v-if="isActiveModal('imageEditor_modal')"
- class="modal mm-animated fadeIn is-active __modal-editor">
- <v-touch class="modal-background link" @dbltap="toggleModal()"></v-touch>
- <div class="mm-animated fadeInDown __modal-content-wrapper">
- <image-editor route="https://trainanywhere.app/media/upload-cropped"
- :no-scroll="noScroll"
- :file="selectedFile"
- :trans="trans">
- </image-editor>
- </div>
- <button class="modal-close is-large" @click.stop="toggleModal()"></button>
- </div>
- <div class="modal mm-animated fadeIn"
- :class="{'is-active': isActiveModal('save_link_modal')}">
- <div class="modal-background link" @click.stop="toggleModal()"></div>
- <div class="modal-card mm-animated fadeInDown">
- <header class="modal-card-head is-black">
- <p class="modal-card-title">
- <span>Upload Image From Url</span>
- </p>
- <button type="button" class="delete" @click.stop="toggleModal()"></button>
- </header>
- <form action="https://trainanywhere.app/media/upload-link" @submit.prevent="saveLinkForm($event)">
- <section class="modal-card-body">
- <input class="input" type="text"
- v-model="urlToUpload"
- placeholder="Url ..."
- ref="save_link_modal_input">
- </section>
- <footer class="modal-card-foot">
- <button type="reset" class="button" @click.stop="toggleModal()">
- Cancel
- </button>
- <button type="submit"
- class="button is-link"
- :disabled="isLoading"
- :class="{'is-loading': isLoading}">
- Upload
- </button>
- </footer>
- </form>
- </div>
- </div>
- <div class="modal mm-animated fadeIn"
- :class="{'is-active': isActiveModal('new_folder_modal')}">
- <div class="modal-background link" @click.stop="toggleModal()"></div>
- <div class="modal-card mm-animated fadeInDown">
- <header class="modal-card-head is-link">
- <p class="modal-card-title">
- <span>Add New Folder</span>
- </p>
- <button type="button" class="delete" @click.stop="toggleModal()"></button>
- </header>
- <form action="https://trainanywhere.app/media/create-new-folder" @submit.prevent="NewFolderForm($event)">
- <section class="modal-card-body">
- <input class="input" type="text"
- v-model="newFolderName"
- placeholder="New Folder Name"
- ref="new_folder_modal_input">
- </section>
- <footer class="modal-card-foot">
- <button type="reset" class="button" @click.stop="toggleModal()">
- Cancel
- </button>
- <button type="submit"
- class="button is-link"
- :disabled="isLoading"
- :class="{'is-loading': isLoading}">
- Create New Folder
- </button>
- </footer>
- </form>
- </div>
- </div>
- <div class="modal mm-animated fadeIn"
- :class="{'is-active': isActiveModal('rename_file_modal')}">
- <div class="modal-background link" @click.stop="toggleModal()"></div>
- <div class="modal-card mm-animated fadeInDown">
- <header class="modal-card-head is-warning">
- <p class="modal-card-title">
- <span>Rename File/Folder</span>
- </p>
- <button type="button" class="delete" @click.stop="toggleModal()"></button>
- </header>
- <form action="https://trainanywhere.app/media/rename-file" @submit.prevent="RenameFileForm($event)">
- <section class="modal-card-body">
- <h3 class="title">New File/Folder Name</h3>
- <input class="input" type="text"
- v-if="selectedFile"
- v-model="newFilename"
- ref="rename_file_modal_input"
- @focus="newFilename = selectedFileIs('folder') ? selectedFile.name : getFileName(selectedFile.name)">
- </section>
- <footer class="modal-card-foot">
- <button type="reset" class="button" @click.stop="toggleModal()">
- Cancel
- </button>
- <button type="submit"
- class="button is-warning"
- :disabled="isLoading"
- :class="{'is-loading': isLoading}">
- Rename
- </button>
- </footer>
- </form>
- </div>
- </div>
- <div class="modal mm-animated fadeIn"
- :class="{'is-active': isActiveModal('move_file_modal')}">
- <div class="modal-background link" @click.stop="toggleModal()"></div>
- <form class="modal-card mm-animated fadeInDown"
- action="https://trainanywhere.app/media/move-file"
- @submit.prevent="MoveFileForm($event)">
- <header class="modal-card-head is-warning">
- <p class="modal-card-title">
- <transition :name="copyFilesNotMove ? 'mm-info-in' : 'mm-info-out'" mode="out-in">
- <span class="icon" :key="copyFilesNotMove ? 1 : 2">
- <icon :name="copyFilesNotMove ? 'clone' : 'share'"></icon>
- </span>
- </transition>
- <transition name="mm-list" mode="out-in">
- <span key="1" v-if="copyFilesNotMove">Copy File/Folder</span>
- <span key="2" v-else>Move File/Folder</span>
- </transition>
- </p>
- <button type="button" class="delete" @click.stop="toggleModal()"></button>
- </header>
- <section class="modal-card-body">
- <h5 class="subtitle m-b-20">
- Destination Folder :
- <span class="tag is-black is-medium">{{ files.path || '/' }}</span>
- </h5>
- <template v-if="movableItemsFilter.length">
- <ul>
- <li class="media link"
- v-for="(one, i) in movableItemsFilter"
- :key="one.path"
- v-tippy="{arrow: true, placement: 'bottom'}"
- title="Remove"
- @click.stop="removeFromMovableList(i)">
- <figure class="media-left">
- <span class="icon has-text-link">
- <icon-types :file="one" :file-type-is="fileTypeIs"/>
- </span>
- </figure>
- <div class="media-content">
- <p class="title is-4">
- <strong class="has-text-link">{{ one.storage_path }}</strong>
- <small v-if="one.items" class="has-text-link">"{{ one.items }} Item(s)"</small>
- </p>
- <p class="subtitle is-5 has-text-danger">{{ getFileSize(one.size) }}</p>
- </div>
- <figure class="media-right">
- <span class="delete"></span>
- </figure>
- </li>
- </ul>
- <p v-if="movableItemsFilterSize" class="__modal-delete-total">
- <span class="title">{{ movableItemsFilterSize }}</span>
- <span class="heading">Total</span>
- </p>
- </template>
- </section>
- <footer class="modal-card-foot">
- <div class="level is-mobile full-width">
- <div class="level-left">
- <div class="level-item">
- <div class="form-switcher">
- <input type="checkbox" name="use_copy" id="use_copy" v-model="copyFilesNotMove">
- <label class="switcher" for="use_copy"></label>
- </div>
- </div>
- <div class="level-item">
- <label class="label" for="use_copy">Copy Files Instead ?</label>
- </div>
- </div>
- <div class="level-right">
- <div class="level-item">
- <button type="reset"
- class="button"
- @click.stop="toggleModal()">
- Cancel
- </button>
- </div>
- <div class="level-item">
- <button type="reset"
- class="button is-danger"
- @click.stop="clearMovableList()">
- Reset All
- </button>
- </div>
- <div class="level-item">
- <button type="submit"
- ref="move_file_modal_submit"
- class="button is-warning"
- :disabled="isLoading"
- :class="{'is-loading': isLoading}">
- <span>Paste Here</span>
- </button>
- </div>
- </div>
- </div>
- </footer>
- </form>
- </div>
- <div class="modal mm-animated fadeIn"
- :class="{'is-active': isActiveModal('confirm_delete_modal')}">
- <div class="modal-background link" @click.stop="toggleModal()"></div>
- <div class="modal-card mm-animated fadeInDown">
- <header class="modal-card-head is-danger">
- <p class="modal-card-title">
- <span>Are You Sure You Want To Delete ?!!</span>
- </p>
- <button type="button" class="delete" @click.stop="toggleModal()"></button>
- </header>
- <form action="https://trainanywhere.app/media/delete-file"
- @submit.prevent="DeleteFileForm($event)">
- <section class="modal-card-body">
- <template v-if="bulkItemsFilter.length">
- <template v-if="bulkItemsFilter.length <= 8">
- <div class="media" v-for="one in bulkItemsFilter" :key="one.path">
- <figure class="media-left">
- <span class="icon has-text-link">
- <icon-types :file="selectedFile" :file-type-is="fileTypeIs"/>
- </span>
- </figure>
- <div class="media-content">
- <p class="title is-4">
- <strong class="has-text-link">{{ one.name }}</strong>
- <small v-if="one.items" class="has-text-link">"{{ one.items }} Item(s)"</small>
- </p>
- <p class="subtitle is-5 has-text-danger">{{ getFileSize(one.size) }}</p>
- </div>
- </div>
- </template>
- <template v-else>
- <div class="media">
- <figure class="media-left">
- <span class="icon has-text-link"><icon name="archive" scale="1.5"></icon></span>
- </figure>
- <div class="media-content">
- <p class="title is-4">
- <strong>"{{ bulkItemsFilter.length }}"</strong>
- <small class="has-text-link">Items Will Be Deleted !</small>
- </p>
- </div>
- </div>
- </template>
- <p v-if="bulkItemsFilterSize" class="__modal-delete-total">
- <span class="title">{{ bulkItemsFilterSize }}</span>
- <span class="heading">Total</span>
- </p>
- </template>
- <template v-else>
- <template v-if="selectedFile">
- <div class="media">
- <figure class="media-left">
- <span class="icon has-text-link">
- <icon-types :file="selectedFile" :file-type-is="fileTypeIs" :scale="1.8"/>
- </span>
- </figure>
- <div class="media-content">
- <p class="title is-4">
- <strong class="has-text-link">{{ selectedFile.name }}</strong>
- <small v-if="selectedFile.items" class="has-text-link">
- "{{ selectedFile.items }} Item(s)"
- </small>
- </p>
- <p class="subtitle is-5 has-text-danger">{{ getFileSize(selectedFile.size) }}</p>
- </div>
- </div>
- </template>
- </template>
- <h5 v-show="folderDeleteWarning" class="__modal-folder-warning">
- <span class="icon is-medium"><icon name="warning" scale="1.2"></icon></span>
- <span>Deleting A Folder Will Also Remove All Of Its Content</span>
- </h5>
- </section>
- <footer class="modal-card-foot">
- <button type="reset" class="button" @click.stop="toggleModal()">
- Cancel
- </button>
- <button type="submit"
- ref="confirm_delete_modal_submit"
- class="button is-danger"
- :disabled="isLoading"
- :class="{'is-loading': isLoading}">
- Yes, Delete It !
- </button>
- </footer>
- </form>
- </div>
- </div>
- </section>
- </div>
- </media-manager>
- </div>
- </div>
- </div>
- </section>
- <link rel="stylesheet" href="https://trainanywhere.app/assets/vendor/MediaManager/style.css"/>
- <script src="//cdnjs.cloudflare.com/ajax/libs/camanjs/4.1.2/caman.full.min.js"></script>
- <script src="https://trainanywhere.app/js/app.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment