Sha256: 833e79fcd64a1a2806983968d5f1ead8e903dada4538414b93e14f511a1b0701
Contents?: true
Size: 1.55 KB
Versions: 11
Compression:
Stored size: 1.55 KB
Contents
'use strict'; (function () { // -- PATCH BEGINS HERE -- // remove old scrivito.binaryFieldElement var definitions = scrivito.cms_element.definitions; for (var i = 0; i < definitions.length; ++i) { if (definitions[i] === scrivito.binaryFieldElement) { definitions.splice(i, 1); break; } } // -- PATCH ENDS HERE -- scrivito.binaryFieldElement = { create_instance: function create_instance(cmsElement) { if (cmsElement.dom_element().attr('data-scrivito-field-type') === 'binary') { var that = scrivito.cms_field_element.create_instance(cmsElement); // -- PATCH BEGINS HERE -- /* const bufferedWriter = new scrivito.BufferedWriter((value) => { if (scrivito.BinaryUtils.isFile(value)) { return scrivito.Binary.upload(value).into(that.basic_obj()); } if (value instanceof scrivito.FutureBinary) { return value.into(that.basic_obj()); } return scrivito.Promise.resolve(value); }); _.extend(that, { preprocess(value) { return bufferedWriter.write(value).catch((error) => { scrivito.handleAjaxError(error); throw error; }); }, }); */ _.extend(that, { preprocess: function preprocess(value) { return scrivito.Promise.resolve(value); } }); // -- PATCH ENDS HERE -- return that; } } }; scrivito.cms_element.definitions.push(scrivito.binaryFieldElement); })();
Version data entries
11 entries across 11 versions & 1 rubygems