Skip to content

Commit b4142b3

Browse files
author
Amir Tocker
committed
Remove redundant code.
1 parent 2277281 commit b4142b3

File tree

7 files changed

+6
-95
lines changed

7 files changed

+6
-95
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ Additional resources are available at:
9999
* [Website](http://cloudinary.com)
100100
* [Documentation](http://cloudinary.com/documentation)
101101
* [Knowledge Base](http://support.cloudinary.com/forums)
102-
* [Documentation for jQuery integration](http://cloudinary.com/documentation/jquery_integration)
103-
* [jQuery image upload documentation](http://cloudinary.com/documentation/jquery_image_upload)
104-
* [jQuery image manipulation documentation](http://cloudinary.com/documentation/jquery_image_manipulation)
105102
* [Image transformations documentation](http://cloudinary.com/documentation/image_transformations)
106103

107104
## Support
@@ -116,5 +113,3 @@ Stay tuned for updates, tips and tutorials: [Blog](http://cloudinary.com/blog),
116113
## License
117114

118115
Released under the MIT license.
119-
120-
The direct image upload feature of the plugin is based on https://github.com/blueimp/jQuery-File-Upload

src/Util/debounce.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* Delay execution of func until wait miliseconds have passed since the last invocation of the returned debounced function.
2+
* Delay execution of func until wait milliseconds have passed since the last invocation of the returned debounced function.
33
* @param {function} func the function to execute
4-
* @param {number} wait waiting time in miliseconds
4+
* @param {number} wait waiting time in milliseconds
55
* @param {boolean=false} immediate if true execute func at the beginning of the wait period
66
* @returns {function()} debounced function
77
*/

src/components/CloudinaryComponent/CloudinaryComponent.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,6 @@ export default class CloudinaryComponent extends Component {
1313
return {};
1414
}
1515

16-
componentWillReceiveProps(nextProps) {
17-
}
18-
19-
componentWillMount() {
20-
}
21-
22-
componentDidMount() {
23-
}
24-
25-
componentWillUnmount() {
26-
}
27-
28-
componentWillUpdate(nextProps, nextState) {
29-
}
30-
31-
componentDidUpdate(prevProps, prevState) {
32-
}
33-
34-
shouldComponentUpdate(nextProps, nextState) {
35-
return true;
36-
}
37-
3816
render() {
3917
return null;
4018
}

src/components/CloudinaryContext/CloudinaryContext.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,6 @@ export default class CloudinaryContext extends CloudinaryComponent {
2828
return context;
2929
}
3030

31-
componentWillReceiveProps(nextProps, nextContext) {
32-
}
33-
34-
componentWillMount() {
35-
}
36-
37-
componentDidMount() {
38-
}
39-
40-
componentWillUnmount() {
41-
}
42-
43-
componentWillUpdate(nextProps, nextState, nextContext) {
44-
}
45-
46-
componentDidUpdate(prevProps, prevState, prevContext) {
47-
}
48-
49-
shouldComponentUpdate(nextProps, nextState, nextContext) {
50-
return true;
51-
}
52-
5331
render() {
5432
return (
5533
<div>{this.props.children}</div>

src/components/Image/Image.js

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ export default class Image extends CloudinaryComponent {
1111
}
1212

1313
super(props, context);
14-
let options = CloudinaryComponent.normalizeOptions(context, props);
1514
this.handleResize = this.handleResize.bind(this);
1615

1716
let state = {responsive: false, url: "", breakpoints: defaultBreakpoints};
1817
this.state = Object.assign(state, this.prepareState(props, context));
19-
this.state = state;
2018
}
2119

2220
get window() {
@@ -47,12 +45,7 @@ export default class Image extends CloudinaryComponent {
4745
return state;
4846
}
4947

50-
componentWillMount() {
51-
super.componentWillMount();
52-
}
53-
5448
componentDidMount() {
55-
super.componentDidMount();
5649
// now that we have a this.element, we need to calculate the URL
5750
let state = this.prepareState();
5851
if (state.url !== undefined) {
@@ -80,13 +73,6 @@ export default class Image extends CloudinaryComponent {
8073
}
8174
}
8275

83-
componentDidUpdate(prevProps, prevState, prevContext) {
84-
}
85-
86-
shouldComponentUpdate(nextProps, nextState, nextContext) {
87-
return true;
88-
}
89-
9076
handleResize(e) {
9177
let options = CloudinaryComponent.normalizeOptions(this.context, this.props);
9278
let url = this.getUrl(options);
@@ -123,18 +109,18 @@ export default class Image extends CloudinaryComponent {
123109
return containerWidth;
124110
};
125111

126-
applyBreakpoints(tag, width, steps, options) {
112+
applyBreakpoints(width, steps, options) {
127113
var responsive_use_breakpoints;
128114
options = CloudinaryComponent.normalizeOptions(this.context, this.props, options);
129115
responsive_use_breakpoints = options.responsiveUseBreakpoints;
130116
if ((!responsive_use_breakpoints) || (responsive_use_breakpoints === 'resize' && !options.resizing)) {
131117
return width;
132118
} else {
133-
return this.calc_breakpoint(tag, width, steps);
119+
return this.calc_breakpoint(width, steps);
134120
}
135121
};
136122

137-
calc_breakpoint(element, width, steps) {
123+
calc_breakpoint(width, steps) {
138124
var breakpoints, point;
139125
breakpoints = this.state.breakpoints || defaultBreakpoints;
140126
if (Util.isFunction(breakpoints)) {
@@ -200,7 +186,7 @@ export default class Image extends CloudinaryComponent {
200186
resultUrl = resultUrl.replace(/w_auto:breakpoints([_0-9]*)(:[0-9]+)?/,
201187
"w_auto:breakpoints$1:" + requiredWidth);
202188
} else if (match = /w_auto(:(\d+))?/.exec(resultUrl)) {
203-
requiredWidth = this.applyBreakpoints(this.element, containerWidth, match[2], options);
189+
requiredWidth = this.applyBreakpoints(containerWidth, match[2], options);
204190
requiredWidth = this.maxWidth(requiredWidth, this.element);
205191
resultUrl = resultUrl.replace(/w_auto[^,\/]*/g, "w_" + requiredWidth);
206192
}

src/components/Transformation/Transformation.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ export default class Transformation extends CloudinaryComponent {
66
super(props);
77
}
88

9-
shouldComponentUpdate(nextProps, nextState) {
10-
return true;
11-
}
12-
139
render() {
1410
return null;
1511
}

src/components/Video/Video.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,6 @@ export default class Video extends CloudinaryComponent {
1313
this.state = {};
1414
}
1515

16-
componentWillReceiveProps(nextProps, nextContext) {
17-
}
18-
19-
componentWillMount() {
20-
}
21-
22-
componentDidMount() {
23-
}
24-
25-
componentWillUnmount() {
26-
}
27-
28-
componentWillUpdate(nextProps, nextState, nextContext) {
29-
}
30-
31-
componentDidUpdate(prevProps, prevState, prevContext) {
32-
}
33-
34-
shouldComponentUpdate(nextProps, nextState, nextContext) {
35-
return true;
36-
}
37-
3816
render() {
3917
let {publicId, poster, sourceTypes, fallback, sourceTransformation, ...options} = Object.assign({},
4018
this.context,

0 commit comments

Comments
 (0)