Guest User

Untitled

a guest
Apr 19th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. Index: settings.py
  2. ===================================================================
  3. --- settings.py (revision 117)
  4. +++ settings.py (working copy)
  5. @@ -372,8 +372,8 @@
  6.  
  7. # Things to measure to taste
  8. MAX_COMMENT_LENGTH = 2000
  9. +MAX_POST_LENGTH = 140
  10.  
  11. # Gdata Stuff
  12. GDATA_CONSUMER_KEY = ''
  13. GDATA_CONSUMER_SECRET = ''
  14. Index: js/core.js
  15. ===================================================================
  16. --- js/core.js (revision 117)
  17. +++ js/core.js (working copy)
  18. @@ -86,7 +86,7 @@
  19. count: function () {
  20. var value = counter.el.value;
  21. var count = value.length;
  22. - chars_left = 140 - count;
  23. + chars_left = maxpostlength - count;
  24. if (chars_left >= 0) {
  25. if ($(counter.target.parentNode).is('.overlimit')) {
  26. $(counter.target.parentNode).removeClass("overlimit");
  27. @@ -113,7 +113,7 @@
  28. str = "1 character over limit";
  29. }
  30. }
  31. - var ok = (count > 0 && count < 141) && (value.replace(counter.re,"") != counter.el._value);
  32. + var ok = (count > 0 && count <= maxpostlength) && (value.replace(counter.re,"") != counter.el._value);
  33. counter.button.disabled = !ok;
  34. counter.target.nodeValue = str;
  35. }
  36. Index: common/api.py
  37. ===================================================================
  38. --- common/api.py (revision 117)
  39. +++ common/api.py (working copy)
  40. @@ -70,7 +70,7 @@
  41. # Max length of a message. Conciseness is a virtue.
  42. # UIs should prevent posting longer messages. API will truncate
  43. # posts longer than this.
  44. -MAX_POST_LENGTH = 140
  45. +MAX_POST_LENGTH = settings.MAX_POST_LENGTH
  46.  
  47. # How many contacts we are willing to count to update an actor's
  48. # contact_count or follower_count properties
  49. Index: common/templates/message_form.html
  50. ===================================================================
  51. --- common/templates/message_form.html (revision 117)
  52. +++ common/templates/message_form.html (working copy)
  53. @@ -27,7 +27,10 @@
  54. {% endifequal %}
  55. </p>
  56. {% if not request.mobile %}
  57. - <p id="counter">140 characters left</p>
  58. + <script type="text/javascript">
  59. + var maxpostlength = {{ MAX_POST_LENGTH }};
  60. + </script>
  61. + <p id="counter">{{ MAX_POST_LENGTH }} characters left</p>
  62. <p id="icons">
  63. <label for="icon" id="icon-label">Icon</label>
  64. <select name="icon" id="icon">
Add Comment
Please, Sign In to add comment