Skip to content

Commit debf6ff

Browse files
whitespace
1 parent a478e74 commit debf6ff

File tree

1 file changed

+25
-25
lines changed
  • cloudinary-image-management-and-manipulation-in-the-cloud-cdn/js

1 file changed

+25
-25
lines changed

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/js/cloudinary.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
jQuery(function() {
1+
jQuery(function() {
22
var xdmConfig = jQuery('#cloudinary-library-config');
33
if (xdmConfig.length == 0) return;
44

55
function close_media_library() {
66
jQuery('#cloudinary-library').hide();
77
jQuery('#wpcontent').css('margin-left', '165px');
88
jQuery('#wpbody').css('height', 'auto').css('overflow', 'visible');
9-
}
10-
9+
}
10+
1111
function add_to_gallery(json) {
1212
var ajaxurl = xdmConfig.data("ajaxurl");
1313
var data = {
@@ -23,24 +23,24 @@ jQuery(function() {
2323
} else {
2424
jQuery('.cloudinary_message').html('Image successfully added to gallery');
2525
}
26-
});
26+
});
2727
}
28-
28+
2929
function insert_into_post(json) {
30-
var src = json.src;
31-
var href = json.href;
30+
var src = json.src;
31+
var href = json.href;
3232
delete json.message;
3333
delete json.src;
3434
delete json.href;
35-
var image = jQuery('<img/>').attr('src', src);
35+
var image = jQuery('<img/>').attr('src', src);
3636
if (json.align && json.align != '') {
3737
image.addClass('align' + json.align);
3838
delete json.align;
3939
}
4040
jQuery.each(json, function(key, value) {
4141
if (value != null && value != "") {
4242
image.attr(key, value);
43-
}
43+
}
4444
});
4545
var ajaxurl = xdmConfig.data("ajaxurl");
4646
var data = {
@@ -53,9 +53,9 @@ jQuery(function() {
5353
if (typeof tinyMCE !== 'undefined' && tinyMCE.activeEditor && tinyMCE.activeEditor.selection) {
5454
var html = tinyMCE.activeEditor.selection.getContent({format : 'html'});
5555
var match = html.match(/wp-image-(\d+)/);
56-
if (match) data.attachment_id = match[1];
56+
if (match) data.attachment_id = match[1];
5757
}
58-
58+
5959
jQuery.post(ajaxurl, data, function(json) {
6060
if (json.error) {
6161
alert(json.message);
@@ -69,12 +69,12 @@ jQuery(function() {
6969
image = jQuery('<a/>').attr('href', href).append(image);
7070
}
7171
if (typeof tinyMCE !== 'undefined' && tinyMCE.activeEditor && tinyMCE.activeEditor.selection) {
72-
tinyMCE.activeEditor.selection.setContent(jQuery('<div/>').append(image).html());
72+
tinyMCE.activeEditor.selection.setContent(jQuery('<div/>').append(image).html());
7373
} else {
74-
send_to_editor(jQuery('<div/>').append(image).html());
75-
}
74+
send_to_editor(jQuery('<div/>').append(image).html());
75+
}
7676
});
77-
}
77+
}
7878

7979
function update_window_dimensions() {
8080
if (jQuery('#cloudinary-library').is(':visible')) {
@@ -85,12 +85,12 @@ jQuery(function() {
8585
jQuery('#cloudinary-library, #cloudinary-library iframe').css('height', body_height);
8686
}
8787
}
88-
88+
8989
var controller = {
9090
socket: new easyXDM.Socket({
9191
name: xdmConfig.data("base") + "/easyXDM.name.html",
9292
swf: xdmConfig.data("base") + "/easyxdm.swf",
93-
remote: xdmConfig.data("remote"),
93+
remote: xdmConfig.data("remote"),
9494
remoteHelper: xdmConfig.data("remotehelper"),
9595
container: "cloudinary-library",
9696
props: {style: {width: "100%", height: "80%"}},
@@ -105,22 +105,22 @@ jQuery(function() {
105105
case "add_to_gallery":
106106
close_media_library();
107107
add_to_gallery(json);
108-
break;
109-
case "done":
108+
break;
109+
case "done":
110110
close_media_library();
111111
break;
112-
}
112+
}
113113
},
114114
onReady: function() {
115115
controller.resizeWatcher();
116116
}
117117
}),
118118
currentWidth: 0,
119119
currentHeight: 0,
120-
resizeWatcher: function() {
120+
resizeWatcher: function() {
121121
jQuery(window).resize(update_window_dimensions);
122122
}
123-
};
123+
};
124124

125125
function register_edit_image() {
126126
var buttons = jQuery('.mce-toolbar-grp.mce-inline-toolbar-grp.mce-container.mce-panel');
@@ -142,17 +142,17 @@ jQuery(function() {
142142
}
143143
if (typeof(tinyMCE) != 'undefined')
144144
register_edit_image();
145-
145+
146146
jQuery(document).on('click', '.cloudinary_add_media', function() {
147147
jQuery('.cloudinary_message').html('');
148148
jQuery('#cloudinary-library').show();
149149
update_window_dimensions();
150150
return false;
151151
});
152-
152+
153153
var div = jQuery('<div id="cloudinary-library"></div>').hide().appendTo(jQuery('#wpbody-content'));
154154
if (xdmConfig.data("autoshow")) {
155155
div.show();
156156
setTimeout(function() { update_window_dimensions()}, 1);
157-
}
157+
}
158158
});

0 commit comments

Comments
 (0)