
META-INF.resources.document_library.edit_file_entry_picker.jspf Maven / Gradle / Ivy
The newest version!
<%--
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%
DLFilePicker dlFilePicker = dlEditFileEntryDisplayContext.getDLFilePicker("onFilePick");
%>
'<%= StringUtil.merge(PrefsPropsUtil.getStringArray(PropsKeys.DL_FILE_EXTENSIONS, StringPool.COMMA)) %>'
var onFilePick = function(fields) {
var documentIconURL = fields['<%= dlFilePicker.getIconFieldName() %>'];
$('# pickButtonIcon').attr('src', documentIconURL);
var documentTitle = fields['<%= dlFilePicker.getTitleFieldName() %>'];
$('# pickButtonTitle').html(documentTitle);
$('# title').val(documentTitle);
var documentDescription = fields['<%= dlFilePicker.getDescriptionFieldName() %>'];
$('# description').val(documentDescription);
$('# fm .lfr-ddm-container .field-wrapper').each(
function(index, item) {
item = $(item);
var fieldName = item.data('fieldname');
var input = item.find('input');
input.val(fields[fieldName]);
}
);
};
<%= dlFilePicker.getJavaScript() %>
var filePicker = new <%= dlFilePicker.getJavaScriptModuleName() %>(
function() {
Liferay.Util.toggleDisabled($('.customized-file-button'), false);
}
);
$('.customized-file-button').on('click', _.bind(filePicker['<%= dlFilePicker.getOnClickCallback() %>'], filePicker));
© 2015 - 2025 Weber Informatics LLC | Privacy Policy