Changeset 960616
- Timestamp:
- 08/05/2014 04:34:13 PM (12 years ago)
- Location:
- home-page-slideshow
- Files:
-
- 2 deleted
- 8 edited
- 1 copied
-
tags/1.1 (copied) (copied from home-page-slideshow/trunk)
-
tags/1.1/hss-admin.css (modified) (1 diff)
-
tags/1.1/hss-admin.js (modified) (5 diffs)
-
tags/1.1/hss.php (modified) (3 diffs)
-
tags/1.1/jquery-ui.min.css (deleted)
-
tags/1.1/readme.txt (modified) (3 diffs)
-
trunk/hss-admin.css (modified) (1 diff)
-
trunk/hss-admin.js (modified) (5 diffs)
-
trunk/hss.php (modified) (3 diffs)
-
trunk/jquery-ui.min.css (deleted)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
home-page-slideshow/tags/1.1/hss-admin.css
r960030 r960616 39 39 } 40 40 41 .attachment-display-settings label.setting {41 .attachment-display-settings label.setting:nth-child(2){ 42 42 display:none !important; 43 43 } -
home-page-slideshow/tags/1.1/hss-admin.js
r960030 r960616 4 4 var result; 5 5 var slide_count = $('.form-table').length; 6 var save_notices = 0; 6 7 7 8 $('.hss-image-preview').each(function(){ … … 66 67 target.find('input').not('.hss-index, .button').val(''); 67 68 target.find('.hss-image-preview').attr('src', ''); 68 alert('Save changes to commit edit.'); 69 if( save_notices == 0 ){ 70 alert('Save changes to commit edit(s).'); 71 save_notices++; 72 } 69 73 } 70 74 }); … … 77 81 $(this).remove(); 78 82 reorder(); 79 alert('Save changes to commit edit.'); 83 if( save_notices == 0 ){ 84 alert('Save changes to commit edit(s).'); 85 save_notices++; 86 } 80 87 }); 81 88 return false; … … 86 93 $('.hss-select-image').click(function(e) { 87 94 e.preventDefault(); 95 88 96 current_id = 'slide-' + $(this).closest('tr').prev().find('.hss-index').val(); 89 90 97 var current_slide = $(this).closest('.form-table'); 91 console.log(current_slide);92 98 93 99 var insertImage = wp.media.controller.Library.extend({ … … 114 120 var state = frame.state('insert-image'); 115 121 var selection = state.get('selection'); 116 var imageArray = [];117 122 118 123 if ( !selection ) return; 119 120 //to get right side attachment UI info, such as: size and alignments 121 //org code from /wp-includes/js/media-editor.js, arround `line 603 -- send: { ... attachment: function( props, attachment ) { ... ` 124 122 125 selection.each(function( attachment ) { 123 var display = state.display( attachment ).toJSON(); 124 var obj_attachment = attachment.toJSON() 125 var caption = obj_attachment.caption, options, html; 126 127 // If captions are disabled, clear the caption. 128 if ( !wp.media.view.settings.captions ) 129 delete obj_attachment.caption; 130 131 display = wp.media.string.props( display, obj_attachment ); 132 133 options = { 134 id: obj_attachment.id, 135 post_content: obj_attachment.description, 136 post_excerpt: caption 137 }; 138 139 if ( display.linkUrl ) 140 options.url = display.linkUrl; 141 142 //attach info to attachment.attributes object 143 attachment.attributes['nonce'] = wp.media.view.settings.nonce.sendToEditor; 144 attachment.attributes['attachment'] = options; 145 // attachment.attributes['html'] = html; 146 attachment.attributes['post_id'] = wp.media.view.settings.post.id; 147 148 // returned image attributes 149 // console.log(attachment.attributes['attachment']['url']); 150 // console.log(attachment.attributes); 126 var display = state.display(attachment).toJSON(); 127 var img_info = attachment.toJSON(); 128 var selected_img = wp.media.string.props(display, img_info); 129 var img_src = selected_img['src']; 130 var link_url = selected_img['linkUrl']; 151 131 152 current_slide.find('.hss-image').val( attachment.attributes['url']);153 current_slide.find('.hss-image-preview').attr('src', attachment.attributes['url']);132 current_slide.find('.hss-image').val(img_src); 133 current_slide.find('.hss-image-preview').attr('src', img_src); 154 134 current_slide.find('.hss-image-preview').css('display', 'block'); 135 current_slide.find('.hss-link').val(link_url); 136 current_slide.find('.hss-link-preview').attr('href', link_url); 155 137 156 if( typeof attachment.attributes['attachment']['url'] !== 'undefined' ){ 157 current_slide.find('.hss-link').val(attachment.attributes['attachment']['url']); 158 current_slide.find('.hss-link-preview').attr('href', attachment.attributes['attachment']['url']); 159 current_slide.find('.hss-link-preview').css('display', 'inline'); 160 is_valid_url( attachment.attributes['attachment']['url'], current_slide.find('.hss-link-error') ); 138 if( link_url != '' ){ 139 current_slide.find('.hss-link-preview').css('visibility', 'visible'); 140 is_valid_url( link_url, current_slide.find('.hss-link-error') ); 141 } 142 else{ 143 current_slide.find('.hss-link-preview').css('visibility', 'hidden'); 161 144 } 162 145 -
home-page-slideshow/tags/1.1/hss.php
r960030 r960616 3 3 * Plugin Name: Home Page Slideshow 4 4 * Description: Create a responsive slideshow with titles, subtitles and links for your site's home page. 5 * Version: 1. 05 * Version: 1.1 6 6 * Author: Jethin 7 7 * License: GPL2 … … 216 216 function hss_scripts(){ 217 217 wp_register_script( 'cycle2', plugins_url( 'jquery.cycle2.min.js' , __FILE__ ), array('jquery'), '2.1.5' ); 218 wp_register_script( 'hss_js', plugins_url( 'hss.js', __FILE__ ) );218 wp_register_script( 'hss_js', plugins_url( 'hss.js', __FILE__ ), array('cycle2') ); 219 219 wp_register_style( 'hss_css', plugins_url( 'hss.css', __FILE__ ) ); 220 220 } … … 297 297 function hss_admin_scripts(){ 298 298 if ( isset($_GET['page']) && $_GET['page'] == 'hss-settings-admin' ) { 299 // wp_enqueue_media() includes jquery-ui-core, jquery-ui-sortable -- no need to enqueue separately 299 300 wp_enqueue_media(); 300 wp_register_script('hss-jquery-ui', WP_PLUGIN_URL . '/home-page-slideshow/jquery-ui.min.js', array('jquery'));301 wp_enqueue_script('hss-jquery-ui');302 301 wp_register_script('hss-admin-js', WP_PLUGIN_URL . '/home-page-slideshow/hss-admin.js', array('jquery')); 303 302 wp_enqueue_script('hss-admin-js'); -
home-page-slideshow/tags/1.1/readme.txt
r960030 r960616 2 2 Contributors: jethin 3 3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BUH36ZU4GVA78 4 Tags: slideshow, gallery, home, front 4 Tags: slideshow, gallery, home, front, slider 5 5 Requires at least: 3.0 6 6 Tested up to: 3.9.1 7 Stable tag: 1 7 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 25 25 Slides include image (required) and optional title, subtitle and link. 26 26 27 Links can be set when selecting image.27 Links and image size can be set when selecting image. (Full size images recommended.) 28 28 29 29 Slideshows and slides are 100% the width of their container. Upload images that are at least as wide as the slideshow you want them to appear in. … … 52 52 == Changelog == 53 53 54 = 1.1 = 55 * v. 1.0 housecleaning 56 54 57 = 1.0 = 55 58 * Initial release. 59 60 == Upgrade Notice == 61 62 = 1.1 = 63 Added ability to choose image size when selecting images; v 1.0 housecleaning -
home-page-slideshow/trunk/hss-admin.css
r960030 r960616 39 39 } 40 40 41 .attachment-display-settings label.setting {41 .attachment-display-settings label.setting:nth-child(2){ 42 42 display:none !important; 43 43 } -
home-page-slideshow/trunk/hss-admin.js
r960030 r960616 4 4 var result; 5 5 var slide_count = $('.form-table').length; 6 var save_notices = 0; 6 7 7 8 $('.hss-image-preview').each(function(){ … … 66 67 target.find('input').not('.hss-index, .button').val(''); 67 68 target.find('.hss-image-preview').attr('src', ''); 68 alert('Save changes to commit edit.'); 69 if( save_notices == 0 ){ 70 alert('Save changes to commit edit(s).'); 71 save_notices++; 72 } 69 73 } 70 74 }); … … 77 81 $(this).remove(); 78 82 reorder(); 79 alert('Save changes to commit edit.'); 83 if( save_notices == 0 ){ 84 alert('Save changes to commit edit(s).'); 85 save_notices++; 86 } 80 87 }); 81 88 return false; … … 86 93 $('.hss-select-image').click(function(e) { 87 94 e.preventDefault(); 95 88 96 current_id = 'slide-' + $(this).closest('tr').prev().find('.hss-index').val(); 89 90 97 var current_slide = $(this).closest('.form-table'); 91 console.log(current_slide);92 98 93 99 var insertImage = wp.media.controller.Library.extend({ … … 114 120 var state = frame.state('insert-image'); 115 121 var selection = state.get('selection'); 116 var imageArray = [];117 122 118 123 if ( !selection ) return; 119 120 //to get right side attachment UI info, such as: size and alignments 121 //org code from /wp-includes/js/media-editor.js, arround `line 603 -- send: { ... attachment: function( props, attachment ) { ... ` 124 122 125 selection.each(function( attachment ) { 123 var display = state.display( attachment ).toJSON(); 124 var obj_attachment = attachment.toJSON() 125 var caption = obj_attachment.caption, options, html; 126 127 // If captions are disabled, clear the caption. 128 if ( !wp.media.view.settings.captions ) 129 delete obj_attachment.caption; 130 131 display = wp.media.string.props( display, obj_attachment ); 132 133 options = { 134 id: obj_attachment.id, 135 post_content: obj_attachment.description, 136 post_excerpt: caption 137 }; 138 139 if ( display.linkUrl ) 140 options.url = display.linkUrl; 141 142 //attach info to attachment.attributes object 143 attachment.attributes['nonce'] = wp.media.view.settings.nonce.sendToEditor; 144 attachment.attributes['attachment'] = options; 145 // attachment.attributes['html'] = html; 146 attachment.attributes['post_id'] = wp.media.view.settings.post.id; 147 148 // returned image attributes 149 // console.log(attachment.attributes['attachment']['url']); 150 // console.log(attachment.attributes); 126 var display = state.display(attachment).toJSON(); 127 var img_info = attachment.toJSON(); 128 var selected_img = wp.media.string.props(display, img_info); 129 var img_src = selected_img['src']; 130 var link_url = selected_img['linkUrl']; 151 131 152 current_slide.find('.hss-image').val( attachment.attributes['url']);153 current_slide.find('.hss-image-preview').attr('src', attachment.attributes['url']);132 current_slide.find('.hss-image').val(img_src); 133 current_slide.find('.hss-image-preview').attr('src', img_src); 154 134 current_slide.find('.hss-image-preview').css('display', 'block'); 135 current_slide.find('.hss-link').val(link_url); 136 current_slide.find('.hss-link-preview').attr('href', link_url); 155 137 156 if( typeof attachment.attributes['attachment']['url'] !== 'undefined' ){ 157 current_slide.find('.hss-link').val(attachment.attributes['attachment']['url']); 158 current_slide.find('.hss-link-preview').attr('href', attachment.attributes['attachment']['url']); 159 current_slide.find('.hss-link-preview').css('display', 'inline'); 160 is_valid_url( attachment.attributes['attachment']['url'], current_slide.find('.hss-link-error') ); 138 if( link_url != '' ){ 139 current_slide.find('.hss-link-preview').css('visibility', 'visible'); 140 is_valid_url( link_url, current_slide.find('.hss-link-error') ); 141 } 142 else{ 143 current_slide.find('.hss-link-preview').css('visibility', 'hidden'); 161 144 } 162 145 -
home-page-slideshow/trunk/hss.php
r960030 r960616 3 3 * Plugin Name: Home Page Slideshow 4 4 * Description: Create a responsive slideshow with titles, subtitles and links for your site's home page. 5 * Version: 1. 05 * Version: 1.1 6 6 * Author: Jethin 7 7 * License: GPL2 … … 216 216 function hss_scripts(){ 217 217 wp_register_script( 'cycle2', plugins_url( 'jquery.cycle2.min.js' , __FILE__ ), array('jquery'), '2.1.5' ); 218 wp_register_script( 'hss_js', plugins_url( 'hss.js', __FILE__ ) );218 wp_register_script( 'hss_js', plugins_url( 'hss.js', __FILE__ ), array('cycle2') ); 219 219 wp_register_style( 'hss_css', plugins_url( 'hss.css', __FILE__ ) ); 220 220 } … … 297 297 function hss_admin_scripts(){ 298 298 if ( isset($_GET['page']) && $_GET['page'] == 'hss-settings-admin' ) { 299 // wp_enqueue_media() includes jquery-ui-core, jquery-ui-sortable -- no need to enqueue separately 299 300 wp_enqueue_media(); 300 wp_register_script('hss-jquery-ui', WP_PLUGIN_URL . '/home-page-slideshow/jquery-ui.min.js', array('jquery'));301 wp_enqueue_script('hss-jquery-ui');302 301 wp_register_script('hss-admin-js', WP_PLUGIN_URL . '/home-page-slideshow/hss-admin.js', array('jquery')); 303 302 wp_enqueue_script('hss-admin-js'); -
home-page-slideshow/trunk/readme.txt
r960030 r960616 2 2 Contributors: jethin 3 3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BUH36ZU4GVA78 4 Tags: slideshow, gallery, home, front 4 Tags: slideshow, gallery, home, front, slider 5 5 Requires at least: 3.0 6 6 Tested up to: 3.9.1 7 Stable tag: 1 7 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 25 25 Slides include image (required) and optional title, subtitle and link. 26 26 27 Links can be set when selecting image.27 Links and image size can be set when selecting image. (Full size images recommended.) 28 28 29 29 Slideshows and slides are 100% the width of their container. Upload images that are at least as wide as the slideshow you want them to appear in. … … 52 52 == Changelog == 53 53 54 = 1.1 = 55 * v. 1.0 housecleaning 56 54 57 = 1.0 = 55 58 * Initial release. 59 60 == Upgrade Notice == 61 62 = 1.1 = 63 Added ability to choose image size when selecting images; v 1.0 housecleaning
Note: See TracChangeset
for help on using the changeset viewer.