equal
deleted
inserted
replaced
136 var _st = $('#status'), |
136 var _st = $('#status'), |
137 _val = _st.val(); |
137 _val = _st.val(); |
138 _st.val( _val + ( _val[_val.length - 1] == " " ? "" : " " ) + value ).change(); |
138 _st.val( _val + ( _val[_val.length - 1] == " " ? "" : " " ) + value ).change(); |
139 } |
139 } |
140 |
140 |
141 function tweet_text(text) { |
|
142 var url = "https://twitter.com/intent/tweet?text=" + encodeURIComponent(text), |
|
143 popW = 550, |
|
144 popH = 350, |
|
145 scrW = screen.width, |
|
146 scrH = screen.height, |
|
147 posX = Math.round((scrW/2)-(popW/2)), |
|
148 posY = (scrH > popH ? Math.round((scrH/2)-(popH/2)) : 0); |
|
149 window.open( |
|
150 url, |
|
151 '', |
|
152 'left=' + posX + ',top=' + posY + ',width=' + popW + ',height=' + popH + ',personalbar=0,toolbar=0,scrollbars=1,resizable=1' |
|
153 ); |
|
154 } |
|
155 |
|
156 $(document).ready(function() { |
141 $(document).ready(function() { |
157 |
142 |
158 |
143 |
159 function updateCounter() { |
144 function updateCounter() { |
160 var _v = $("#status").val(); |
145 var _v = $("#status").val(); |
178 }); |
163 }); |
179 } |
164 } |
180 |
165 |
181 // BUTTONS |
166 // BUTTONS |
182 $(".tweetButton").click(function() { |
167 $(".tweetButton").click(function() { |
183 tweet_text("<?php echo($config['hashtag']); ?> " + $(this).find('span.twbSyntax').text()); |
|
184 return false; |
|
185 add_grammar($(this).find('span.twbSyntax').text()); |
168 add_grammar($(this).find('span.twbSyntax').text()); |
186 updateCounter(); |
169 updateCounter(); |
187 }) |
170 }) |
188 |
171 |
189 // SEND TWEETS |
172 // SEND TWEETS |
190 $("#sendTweet").click(function(){ |
173 $("#sendTweet").click(function(){ |
191 return false; |
|
192 var MyStatus = $('#status').val(); |
174 var MyStatus = $('#status').val(); |
193 $.post('tweet_ajax.php', {status:MyStatus} |
175 $.post('tweet_ajax.php', {status:MyStatus} |
194 ,function(data) { |
176 ,function(data) { |
195 |
177 |
196 if(data=="true"){ |
178 if(data=="true"){ |
205 } |
187 } |
206 |
188 |
207 }); |
189 }); |
208 |
190 |
209 }); |
191 }); |
210 |
|
211 $("#sendTweet,.loginlink").click(function() { |
|
212 tweet_text("<?php echo($config['hashtag']); ?> ++ -- == ??"); |
|
213 return false; |
|
214 }) |
|
215 |
192 |
216 |
193 |
217 $("#status").bind("change keyup paste blur focus",updateCounter); |
194 $("#status").bind("change keyup paste blur focus",updateCounter); |
218 |
195 |
219 |
196 |