Changeset 1332391
- Timestamp:
- 01/20/2016 11:03:23 PM (10 years ago)
- Location:
- click-tweet/trunk
- Files:
-
- 4 edited
-
assets/css/click-and-tweet.css (modified) (12 diffs)
-
assets/js/click-and-tweet-tinymce-plugin.js (modified) (7 diffs)
-
click-and-tweet.php (modified) (6 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
click-tweet/trunk/assets/css/click-and-tweet.css
r1331546 r1332391 83 83 width:100%; 84 84 max-width: 640px; 85 padding: 3rem 3rem 4rem;86 margin: 3remauto;85 padding: 4% 4% 8%; 86 margin: 4% auto; 87 87 background-color: #FFFFFF; 88 88 border: solid 1px #EEE; 89 -webkit-border-radius: 0.4rem;90 border-radius: 0.4rem;89 -webkit-border-radius: 6px; 90 border-radius: 6px; 91 91 -webkit-box-shadow: 0 0 3px 0 rgba(0,0,0,0.025); 92 92 box-shadow: 0 0 3px 0 rgba(0,0,0,0.025); … … 106 106 background-image: url('../img/twitter-logo.png'); 107 107 background-position: center; 108 background-size: contain;108 background-size: 75%; 109 109 background-repeat: no-repeat; 110 110 display: block; 111 height: 2.4em; 112 width: 2.4em; 111 width: 10%; 113 112 position: relative; 114 113 } … … 116 115 @media (max-width: 34em) { 117 116 .click-and-tweet-card .click-and-tweet-twitter-logo{ 118 height: 2em; 119 width: 2em; 117 width: 14%; 120 118 } 121 119 } … … 145 143 position: absolute; 146 144 top: 50%; 147 left: 2 rem;145 left: 2.5%; 148 146 -webkit-transform: translateY(-50%); 149 147 transform: translateY(-50%); … … 151 149 152 150 .click-and-tweet-card.left-center .click-and-tweet-card-link{ 153 padding-left: 4.6rem;151 padding-left: 10%; 154 152 } 155 153 156 154 @media (max-width: 34em) { 157 155 .click-and-tweet-card.left-center .click-and-tweet-card-link{ 158 padding-left: 3rem;156 padding-left: 14%; 159 157 } 160 158 } … … 163 161 position: absolute; 164 162 top: 12.5%; 165 left: 2 rem;163 left: 2.5%; 166 164 } 167 165 168 166 .click-and-tweet-card.left-top .click-and-tweet-card-link{ 169 padding-left: 4.6rem;167 padding-left: 10%; 170 168 } 171 169 172 170 @media (max-width: 34em) { 173 171 .click-and-tweet-card.left-top .click-and-tweet-card-link{ 174 padding-left: 3rem;172 padding-left: 14%; 175 173 } 176 174 } … … 179 177 position: absolute; 180 178 bottom: 12.5%; 181 left: 2 rem;179 left: 2.5%; 182 180 } 183 181 184 182 .click-and-tweet-card.left-bottom .click-and-tweet-card-link{ 185 padding-left: 4.6rem;183 padding-left: 10%; 186 184 } 187 185 188 186 @media (max-width: 34em) { 189 187 .click-and-tweet-card.left-bottom .click-and-tweet-card-link{ 190 padding-left: 3rem;188 padding-left: 14%; 191 189 } 192 190 } … … 195 193 position: absolute; 196 194 top: 50%; 197 right: 2 rem;195 right: 2.5%; 198 196 -webkit-transform: translateY(-50%); 199 197 transform: translateY(-50%); … … 201 199 202 200 .click-and-tweet-card.right-center .click-and-tweet-card-link{ 203 padding-right: 4.6rem;201 padding-right: 10%; 204 202 } 205 203 … … 207 205 position: absolute; 208 206 top: 12.5%; 209 right: 2 rem;207 right: 2.5%; 210 208 } 211 209 212 210 .click-and-tweet-card.right-top .click-and-tweet-card-link{ 213 padding-right: 4.6rem;211 padding-right: 10%; 214 212 } 215 213 216 214 @media (max-width: 34em) { 217 215 .click-and-tweet-card.right-top .click-and-tweet-card-link{ 218 padding-right: 3rem;216 padding-right: 14%; 219 217 } 220 218 } … … 223 221 position: absolute; 224 222 bottom: 12.5%; 225 right: 2 rem;223 right: 2.5%; 226 224 } 227 225 228 226 .click-and-tweet-card.right-bottom .click-and-tweet-card-link{ 229 padding-right: 4.6rem;227 padding-right: 10%; 230 228 } 231 229 232 230 @media (max-width: 34em) { 233 231 .click-and-tweet-card.right-bottom .click-and-tweet-card-link{ 234 padding-right: 3rem;232 padding-right: 14%; 235 233 } 236 234 } 237 235 238 236 .click-and-tweet-card.center-top { 239 padding-top: 4.6rem;237 padding-top: 10%; 240 238 } 241 239 … … 249 247 250 248 .click-and-tweet-card.center-bottom { 251 padding-bottom: 6rem;249 padding-bottom: 12%; 252 250 } 253 251 -
click-tweet/trunk/assets/js/click-and-tweet-tinymce-plugin.js
r1325871 r1332391 36 36 onclick: function() { 37 37 //Toggle click to tweet shorcode when selected 38 var body = ed.getBody(); 38 39 var text = ed.selection.getContent(); 39 40 var newText = ''; … … 57 58 if (!text.length) return; 58 59 60 //Replace the selected text, replace all conent and set caret. 59 61 ed.selection.setContent(newText); 62 var bookmark = ed.selection.getBookmark(); 63 ed.setContent($(body).html()); 64 ed.selection.moveToBookmark(bookmark); 60 65 } 61 66 }); … … 71 76 72 77 if ($(e.target).is('input[type="text"]')) { 73 $(e.target).click().focus().click().select(); 78 79 if($(e.target).val() === ''){ 80 var tooltip = $(ed.getBody()).find('.click-and-tweet-tooltip'); 81 $(e.target).focus().trigger('click'); 82 } 74 83 } 75 84 }); … … 204 213 var positionedTooltip = toolTipPosition(e); 205 214 toolTipHover(positionedTooltip); 206 ed.selection.select($(e.target)[0]);207 215 } else if(tooltip.length){ 208 216 tooltip.remove(); … … 254 262 targetYOffset = e.target.offsetTop, 255 263 minXOffset = 200, 256 minYOffset = 200,264 minYOffset = 100, 257 265 maxXOffset = parentWidth - minXOffset, 258 266 maxYOffset = parentHeight - minYOffset, … … 277 285 yClassName = 'top'; 278 286 break; 287 case parentHeight - targetYOffset <= maxYOffset && targetYOffset <= tooltip.outerHeight(): 288 yClassName = 'top'; 289 break; 279 290 default: 280 291 yClassName = 'bottom'; … … 289 300 switch (yClassName) { 290 301 case 'top' : 291 yOffset = targetYOffset - tooltip.outerHeight();302 yOffset = (targetYOffset >= tooltip.outerHeight()) ? targetYOffset - tooltip.outerHeight() : tooltip.outerHeight() - targetYOffset; 292 303 break; 293 304 default: 294 yOffset = targetYOffset + targetHeight;305 yOffset = (targetYOffset + targetHeight) - 25; 295 306 } 296 307 -
click-tweet/trunk/click-and-tweet.php
r1331546 r1332391 4 4 * Plugin URI: http://spacestud.io 5 5 * Description: Quote text in your WordPress posts for easy sharing on twitter. 6 * Version: 0.4 6 * Version: 0.4.1 7 7 * Author: Space Studio 8 8 * Author URI: http://spacestud.io … … 57 57 * @var string 58 58 */ 59 protected $version = '0.4 ';59 protected $version = '0.4.1'; 60 60 61 61 /** … … 204 204 $src = plugins_url('/assets/css/click-and-tweet.css', __FILE__), 205 205 $deps = false, 206 $ver = '0.1.0',206 $ver = $this->version, 207 207 $media = '' 208 208 ); … … 213 213 $src = plugins_url('/assets/js/click-and-tweet.js', __FILE__), 214 214 $deps = ['jquery'], 215 $ver = '0.1.0',215 $ver = $this->version, 216 216 $in_footer = true 217 217 ); … … 533 533 public function tinyMcePlugin($plugin_array) 534 534 { 535 $plugin_array['noneditable'] = plugins_url('/assets/js/tinymce/noneditable.js', __FILE__); 535 536 $plugin_array['click_and_tweet'] = plugins_url('/assets/js/click-and-tweet-tinymce-plugin.js', __FILE__); 536 $plugin_array['noneditable'] = plugins_url('/assets/js/tinymce/noneditable.js', __FILE__);537 537 538 538 return $plugin_array; … … 792 792 return apply_filters('click_and_tweet_cta', $this->callToActionText); 793 793 } 794 794 795 } 795 796 -
click-tweet/trunk/readme.txt
r1331546 r1332391 47 47 48 48 == Changelog == 49 = 0.4.1 = 50 * Made some styling changes updates. 51 * Bug fixes. 52 49 53 = 0.4 = 50 54 * Added a color option for tweet text.
Note: See TracChangeset
for help on using the changeset viewer.