Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/dist/bundle.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/bundle.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/dist/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/tinymce.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/tinymce.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/userform.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/dist/userform.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 15 additions & 6 deletions client/src/js/TinyMCE_ssmedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,21 @@ import { transformationStringFromObject, Cloudinary } from "@cloudinary/url-gen"
throw `Resource type of [${asset.resource_type}] is not supported`;
}

const image = this.cloudinaryInstance().image(asset.public_id);
const defaultTransformations = this.editor.getParam('default_transformations');
let url = null;

if (defaultTransformations) {
const transformationString = transformationStringFromObject(defaultTransformations);
image.addTransformation(transformationString);
if (asset.derived && asset.derived.length > 0) {
url = asset.derived[0].secure_url;
} else {
const image = this.cloudinaryInstance().image(asset.public_id);

const defaultTransformations = this.editor.getParam('default_transformations');

if (defaultTransformations) {
const transformationString = transformationStringFromObject(defaultTransformations);
image.addTransformation(transformationString);
}

url = image.toURL();
}

// Copied same logic from `API::extractDescription()`
Expand All @@ -119,7 +128,7 @@ import { transformationStringFromObject, Cloudinary } from "@cloudinary/url-gen"
const altText = prompt('Description', defaultAltText);
const titleText = prompt('Title', defaultTitle);
const img = document.createElement('img');
img.src = image.toURL();
img.src = url;

if (altText) {
img.alt = altText;
Expand Down
2 changes: 1 addition & 1 deletion client/src/js/bundle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import jQuery from 'jquery';
import React from 'react';
import { unmountComponentAtNode, render } from 'react-dom';
import { unmountComponentAtNode, render } from 'react-dom'; // eslint-disable-line react/no-deprecated
import Field from './components/field';

jQuery.noConflict();
Expand Down
12 changes: 6 additions & 6 deletions client/src/js/components/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export default class Resource extends Component {
{this.fields().map(field => {
if (field === 'title') {
return (
<div className="cloudinary-field__field">
<div className="cloudinary-field__field" key={ `${public_id}_title` }>
<label htmlFor={ `${public_id}_title` } className="cloudinary-field__label">
{ this.titleFieldLabel() }
</label>
Expand All @@ -259,7 +259,7 @@ export default class Resource extends Component {

if (field === 'description') {
return (
<div className="cloudinary-field__field">
<div className="cloudinary-field__field" key={ `${public_id}_description` }>
<label htmlFor={ `${public_id}_description` } className="cloudinary-field__label">
{ this.descriptionFieldLabel() }
</label>
Expand All @@ -273,7 +273,7 @@ export default class Resource extends Component {

if (field === 'credit') {
return (
<div className="cloudinary-field__field">
<div className="cloudinary-field__field" key={ `${public_id}_credit` }>
<label htmlFor={ `${public_id}_credit` } className="cloudinary-field__label">
{ this.creditFieldLabel() }
</label>
Expand All @@ -287,7 +287,7 @@ export default class Resource extends Component {

if (field === 'gravity') {
return (
<div className="cloudinary-field__field">
<div className="cloudinary-field__field" key={ `${public_id}_gravity` }>
<label htmlFor={ `${public_id}_gravity` } className="cloudinary-field__label">
{ this.gravityFieldLabel() }
</label>
Expand All @@ -305,7 +305,7 @@ export default class Resource extends Component {

if (field === 'fg-colour' && resource_type === 'image' && top_colours && top_colours.length) {
return (
<div className="cloudinary-field__field">
<div className="cloudinary-field__field" key={ `${public_id}_fg_colour` }>
<label className="cloudinary-field__label">
{ this.fgColourFieldLabel() }
</label>
Expand Down Expand Up @@ -333,7 +333,7 @@ export default class Resource extends Component {

if (field === 'bg-colour' && resource_type === 'image' && top_colours && top_colours.length) {
return (
<div className="cloudinary-field__field">
<div className="cloudinary-field__field" key={ `${public_id}_bg_colour` }>
<label className="cloudinary-field__label">
{ this.bgColourFieldLabel() }
</label>
Expand Down