Changeset 708509
- Timestamp:
- 05/06/2013 06:46:35 AM (13 years ago)
- Location:
- uploadcare/trunk
- Files:
-
- 4 edited
-
README.md (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
uploadcare.php (modified) (2 diffs)
-
uploadcare_settings.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uploadcare/trunk/README.md
r702263 r708509 39 39 40 40 ## Releases 41 42 **2.0.5** 43 * New setting "Insert image with url to the original image". 41 44 42 45 **2.0** -
uploadcare/trunk/readme.txt
r705392 r708509 4 4 Requires at least: 3.5+ 5 5 Tested up to: 3.5 6 Stable tag: 2.0. 46 Stable tag: 2.0.5 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 74 74 75 75 == Changelog == 76 = 2.0.5 = 77 * New setting "Insert image with url to the original image". 76 78 77 79 = 2.0.4 = -
uploadcare/trunk/uploadcare.php
r705392 r708509 18 18 $public_key = get_option('uploadcare_public'); 19 19 $secret_key = get_option('uploadcare_secret'); 20 $original = get_option('uploadcare_original'); 20 21 $api = new Uploadcare_Api($public_key, $secret_key); 21 22 … … 45 46 'file_id': _file_id 46 47 }; 47 jQuery.post(ajaxurl, data, function(response) { 48 if (fileInfo.isImage) { 49 window.send_to_editor('<a href=\"https://ucarecdn.com/'+fileInfo.uuid+'/\"><img src=\"'+url+'\" /></a>'); 50 } else { 51 window.send_to_editor('<a href=\"'+url+'\">'+fileInfo.name+'</a>'); 52 } 53 }); 48 jQuery.post(ajaxurl, data, function(response) {"; 49 if ($original) { 50 $script .= "if (fileInfo.isImage) { 51 window.send_to_editor('<a href=\"https://ucarecdn.com/'+fileInfo.uuid+'/\"><img src=\"'+url+'\" /></a>'); 52 } else { 53 window.send_to_editor('<a href=\"'+url+'\">'+fileInfo.name+'</a>'); 54 }"; 55 } else { 56 $script .= "if (fileInfo.isImage) { 57 window.send_to_editor('<img src=\"'+url+'\" />'); 58 } else { 59 window.send_to_editor('<a href=\"'+url+'\">'+fileInfo.name+'</a>'); 60 }"; 61 } 62 $script .=" }); 54 63 }); 55 64 }; -
uploadcare/trunk/uploadcare_settings.php
r644398 r708509 6 6 $uploadcare_secret = $_POST['uploadcare_secret']; 7 7 update_option('uploadcare_secret', $uploadcare_secret); 8 $uploadcare_original = $_POST['uploadcare_original']; 9 update_option('uploadcare_original', $uploadcare_original); 8 10 $saved = true; 9 11 } else { … … 22 24 <p><?php _e("Public key: " ); ?><input type="text" name="uploadcare_public" value="<?php echo $uploadcare_public; ?>" size="20"><?php _e(" ex: demopublickey" ); ?></p> 23 25 <p><?php _e("Secret key: " ); ?><input type="text" name="uploadcare_secret" value="<?php echo $uploadcare_secret; ?>" size="20"><?php _e(" ex: demoprivatekey" ); ?></p> 26 <p><input type="checkbox" name="uploadcare_original" <?php if ($uploadcare_original): ?>checked="checked"<?php endif; ?> /> <?php _e("Insert image with url to the original image" ); ?></p> 24 27 <p class="submit"> 25 28 <?php submit_button(); ?>
Note: See TracChangeset
for help on using the changeset viewer.