PHP Classes

File: WITheme/WICMS/admin/js/plugins/textEditor/tinymce_4.2.6_dev/tinymce/js/tinymce/classes/ui/FilePicker.js

Recommend this page to a friend!
  Classes of Jules Warner   WICMS   WITheme/WICMS/admin/js/plugins/textEditor/tinymce_4.2.6_dev/tinymce/js/tinymce/classes/ui/FilePicker.js   Download  
File: WITheme/WICMS/admin/js/plugins/textEditor/tinymce_4.2.6_dev/tinymce/js/tinymce/classes/ui/FilePicker.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: WICMS
Database driven content management system with PDO
Author: By
Last change:
Date: 7 years ago
Size: 2,399 bytes
 

Contents

Class file image Download
/** * FilePicker.js * * Released under LGPL License. * Copyright (c) 1999-2015 Ephox Corp. All rights reserved * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ /*global tinymce:true */ /** * This class creates a file picker control. * * @class tinymce.ui.FilePicker * @extends tinymce.ui.ComboBox */ define("tinymce/ui/FilePicker", [ "tinymce/ui/ComboBox", "tinymce/util/Tools" ], function(ComboBox, Tools) { "use strict"; return ComboBox.extend({ /** * Constructs a new control instance with the specified settings. * * @constructor * @param {Object} settings Name/value object with settings. */ init: function(settings) { var self = this, editor = tinymce.activeEditor, editorSettings = editor.settings; var actionCallback, fileBrowserCallback, fileBrowserCallbackTypes; settings.spellcheck = false; fileBrowserCallbackTypes = editorSettings.file_picker_types || editorSettings.file_browser_callback_types; if (fileBrowserCallbackTypes) { fileBrowserCallbackTypes = Tools.makeMap(fileBrowserCallbackTypes, /[, ]/); } if (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[settings.filetype]) { fileBrowserCallback = editorSettings.file_picker_callback; if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[settings.filetype])) { actionCallback = function() { var meta = self.fire('beforecall').meta; meta = Tools.extend({filetype: settings.filetype}, meta); // file_picker_callback(callback, currentValue, metaData) fileBrowserCallback.call( editor, function(value, meta) { self.value(value).fire('change', {meta: meta}); }, self.value(), meta ); }; } else { // Legacy callback: file_picker_callback(id, currentValue, filetype, window) fileBrowserCallback = editorSettings.file_browser_callback; if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[settings.filetype])) { actionCallback = function() { fileBrowserCallback( self.getEl('inp').id, self.value(), settings.filetype, window ); }; } } } if (actionCallback) { settings.icon = 'browse'; settings.onaction = actionCallback; } self._super(settings); } }); });