{"action":"created","comment":{"url":"https://api.github.com/repos/bitzesty/qae/pulls/comments/28974609","id":28974609,"diff_hunk":"@@ -73,37 +73,39 @@ $.fn.charcount = function() {\n         textInput.attr(\"maxlength\", char_limit);\n       }\n     } else {\n-\n       textInput.removeAttr(\"maxlength\");\n     }\n   }\n \n   // Maxlength for pasting text\n   this.bind(\"paste\", function(e){\n-    e.preventDefault();\n-    var pasteThis = ((e.originalEvent || e).clipboardData.getData(\"text/plain\"));\n-\n-    for (var c = 0; c<pasteThis.length; c++) {\n-      if (((typeof($(this).attr(\"maxlength\")) !== typeof(undefined)) && $(this).attr(\"maxlength\") !== false) == false || $(this).val().length <= $(this).attr(\"maxlength\")) {\n-        $(this).val($(this).val() + pasteThis[c]);\n-        Countable.once(this, counting);\n+    var original_text = $(this).val() + ((e.originalEvent || e).clipboardData.getData(\"text/plain\"));\n+\n+    if (original_text.length > 0) {\n+      e.preventDefault();\n+      var char_test = $(this).after(\"<p class='char-count-test'></p>\");\n+      char_test.attr(\"data-word-max\", $(this).attr(\"data-word-max\"));\n+      char_test.attr(\"data-word-max-limit\", $(this).attr(\"data-word-max-limit\"));\n+      var last_char = 0;\n+      $(this).val(\"\");\n+      for (c = 0; c<original_text.length; c++) {\n+        if (((typeof(char_test.attr(\"maxlength\")) !== typeof(undefined)) && char_test.attr(\"maxlength\") !== false) == false || c <= char_test.attr(\"maxlength\")) {\n+          char_test.text(original_text.substr(0, c + 1));\n+          Countable.once(char_test[0], counting);\n+        }\n+        if (((typeof(char_test.attr(\"maxlength\")) !== typeof(undefined)) && char_test.attr(\"maxlength\") !== false) == false || c <= char_test.attr(\"maxlength\")) {","path":"app/assets/javascripts/frontend/text-character-count.js","position":84,"original_position":84,"commit_id":"19cfeeff2a4c560c9208ec6fb8f0ab07d3866d69","original_commit_id":"19cfeeff2a4c560c9208ec6fb8f0ab07d3866d69","user":{"login":"matthewford","id":215,"avatar_url":"https://avatars.githubusercontent.com/u/215?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewford","html_url":"https://github.com/matthewford","followers_url":"https://api.github.com/users/matthewford/followers","following_url":"https://api.github.com/users/matthewford/following{/other_user}","gists_url":"https://api.github.com/users/matthewford/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewford/subscriptions","organizations_url":"https://api.github.com/users/matthewford/orgs","repos_url":"https://api.github.com/users/matthewford/repos","events_url":"https://api.github.com/users/matthewford/events{/privacy}","received_events_url":"https://api.github.com/users/matthewford/received_events","type":"User","site_admin":false},"body":"Line is too long.<br>Identifier 'char_test' is not in camel case.<br>Use '===' to compare with 'false'.<br>'c' is not defined.","created_at":"2015-04-23T15:40:59Z","updated_at":"2015-04-23T15:40:59Z","html_url":"https://github.com/bitzesty/qae/pull/423#discussion_r28974609","pull_request_url":"https://api.github.com/repos/bitzesty/qae/pulls/423","_links":{"self":{"href":"https://api.github.com/repos/bitzesty/qae/pulls/comments/28974609"},"html":{"href":"https://github.com/bitzesty/qae/pull/423#discussion_r28974609"},"pull_request":{"href":"https://api.github.com/repos/bitzesty/qae/pulls/423"}}},"pull_request":{"url":"https://api.github.com/repos/bitzesty/qae/pulls/423","id":33968141,"html_url":"https://github.com/bitzesty/qae/pull/423","diff_url":"https://github.com/bitzesty/qae/pull/423.diff","patch_url":"https://github.com/bitzesty/qae/pull/423.patch","issue_url":"https://api.github.com/repos/bitzesty/qae/issues/423","number":423,"state":"open","locked":false,"title":"IE7 Fix word count on load and paste","user":{"login":"hammerfunk","id":856739,"avatar_url":"https://avatars.githubusercontent.com/u/856739?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerfunk","html_url":"https://github.com/hammerfunk","followers_url":"https://api.github.com/users/hammerfunk/followers","following_url":"https://api.github.com/users/hammerfunk/following{/other_user}","gists_url":"https://api.github.com/users/hammerfunk/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerfunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerfunk/subscriptions","organizations_url":"https://api.github.com/users/hammerfunk/orgs","repos_url":"https://api.github.com/users/hammerfunk/repos","events_url":"https://api.github.com/users/hammerfunk/events{/privacy}","received_events_url":"https://api.github.com/users/hammerfunk/received_events","type":"User","site_admin":false},"body":"Removed the on load word count which wasn’t needed\r\nFixed the paste word count","created_at":"2015-04-23T15:40:46Z","updated_at":"2015-04-23T15:40:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c30d6e5ffeec2bf1e8dbaec5743ee22ac518917","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bitzesty/qae/pulls/423/commits","review_comments_url":"https://api.github.com/repos/bitzesty/qae/pulls/423/comments","review_comment_url":"https://api.github.com/repos/bitzesty/qae/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitzesty/qae/issues/423/comments","statuses_url":"https://api.github.com/repos/bitzesty/qae/statuses/19cfeeff2a4c560c9208ec6fb8f0ab07d3866d69","head":{"label":"bitzesty:ie-wordcount","ref":"ie-wordcount","sha":"19cfeeff2a4c560c9208ec6fb8f0ab07d3866d69","user":{"login":"bitzesty","id":70534,"avatar_url":"https://avatars.githubusercontent.com/u/70534?v=3","gravatar_id":"","url":"https://api.github.com/users/bitzesty","html_url":"https://github.com/bitzesty","followers_url":"https://api.github.com/users/bitzesty/followers","following_url":"https://api.github.com/users/bitzesty/following{/other_user}","gists_url":"https://api.github.com/users/bitzesty/gists{/gist_id}","starred_url":"https://api.github.com/users/bitzesty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitzesty/subscriptions","organizations_url":"https://api.github.com/users/bitzesty/orgs","repos_url":"https://api.github.com/users/bitzesty/repos","events_url":"https://api.github.com/users/bitzesty/events{/privacy}","received_events_url":"https://api.github.com/users/bitzesty/received_events","type":"Organization","site_admin":false},"repo":{"id":26758825,"name":"qae","full_name":"bitzesty/qae","owner":{"login":"bitzesty","id":70534,"avatar_url":"https://avatars.githubusercontent.com/u/70534?v=3","gravatar_id":"","url":"https://api.github.com/users/bitzesty","html_url":"https://github.com/bitzesty","followers_url":"https://api.github.com/users/bitzesty/followers","following_url":"https://api.github.com/users/bitzesty/following{/other_user}","gists_url":"https://api.github.com/users/bitzesty/gists{/gist_id}","starred_url":"https://api.github.com/users/bitzesty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitzesty/subscriptions","organizations_url":"https://api.github.com/users/bitzesty/orgs","repos_url":"https://api.github.com/users/bitzesty/repos","events_url":"https://api.github.com/users/bitzesty/events{/privacy}","received_events_url":"https://api.github.com/users/bitzesty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitzesty/qae","description":"[Beta] Queens Award for Enterprise","fork":false,"url":"https://api.github.com/repos/bitzesty/qae","forks_url":"https://api.github.com/repos/bitzesty/qae/forks","keys_url":"https://api.github.com/repos/bitzesty/qae/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitzesty/qae/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitzesty/qae/teams","hooks_url":"https://api.github.com/repos/bitzesty/qae/hooks","issue_events_url":"https://api.github.com/repos/bitzesty/qae/issues/events{/number}","events_url":"https://api.github.com/repos/bitzesty/qae/events","assignees_url":"https://api.github.com/repos/bitzesty/qae/assignees{/user}","branches_url":"https://api.github.com/repos/bitzesty/qae/branches{/branch}","tags_url":"https://api.github.com/repos/bitzesty/qae/tags","blobs_url":"https://api.github.com/repos/bitzesty/qae/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitzesty/qae/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitzesty/qae/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitzesty/qae/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitzesty/qae/statuses/{sha}","languages_url":"https://api.github.com/repos/bitzesty/qae/languages","stargazers_url":"https://api.github.com/repos/bitzesty/qae/stargazers","contributors_url":"https://api.github.com/repos/bitzesty/qae/contributors","subscribers_url":"https://api.github.com/repos/bitzesty/qae/subscribers","subscription_url":"https://api.github.com/repos/bitzesty/qae/subscription","commits_url":"https://api.github.com/repos/bitzesty/qae/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitzesty/qae/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitzesty/qae/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitzesty/qae/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitzesty/qae/contents/{+path}","compare_url":"https://api.github.com/repos/bitzesty/qae/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitzesty/qae/merges","archive_url":"https://api.github.com/repos/bitzesty/qae/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitzesty/qae/downloads","issues_url":"https://api.github.com/repos/bitzesty/qae/issues{/number}","pulls_url":"https://api.github.com/repos/bitzesty/qae/pulls{/number}","milestones_url":"https://api.github.com/repos/bitzesty/qae/milestones{/number}","notifications_url":"https://api.github.com/repos/bitzesty/qae/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitzesty/qae/labels{/name}","releases_url":"https://api.github.com/repos/bitzesty/qae/releases{/id}","created_at":"2014-11-17T13:56:00Z","updated_at":"2015-04-23T13:44:40Z","pushed_at":"2015-04-23T15:40:46Z","git_url":"git://github.com/bitzesty/qae.git","ssh_url":"git@github.com:bitzesty/qae.git","clone_url":"https://github.com/bitzesty/qae.git","svn_url":"https://github.com/bitzesty/qae","homepage":"","size":23549,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":11,"forks":2,"open_issues":11,"watchers":2,"default_branch":"master"}},"base":{"label":"bitzesty:master","ref":"master","sha":"8c4b919bcf8625ab0607fdf433563ca1783b9bc5","user":{"login":"bitzesty","id":70534,"avatar_url":"https://avatars.githubusercontent.com/u/70534?v=3","gravatar_id":"","url":"https://api.github.com/users/bitzesty","html_url":"https://github.com/bitzesty","followers_url":"https://api.github.com/users/bitzesty/followers","following_url":"https://api.github.com/users/bitzesty/following{/other_user}","gists_url":"https://api.github.com/users/bitzesty/gists{/gist_id}","starred_url":"https://api.github.com/users/bitzesty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitzesty/subscriptions","organizations_url":"https://api.github.com/users/bitzesty/orgs","repos_url":"https://api.github.com/users/bitzesty/repos","events_url":"https://api.github.com/users/bitzesty/events{/privacy}","received_events_url":"https://api.github.com/users/bitzesty/received_events","type":"Organization","site_admin":false},"repo":{"id":26758825,"name":"qae","full_name":"bitzesty/qae","owner":{"login":"bitzesty","id":70534,"avatar_url":"https://avatars.githubusercontent.com/u/70534?v=3","gravatar_id":"","url":"https://api.github.com/users/bitzesty","html_url":"https://github.com/bitzesty","followers_url":"https://api.github.com/users/bitzesty/followers","following_url":"https://api.github.com/users/bitzesty/following{/other_user}","gists_url":"https://api.github.com/users/bitzesty/gists{/gist_id}","starred_url":"https://api.github.com/users/bitzesty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitzesty/subscriptions","organizations_url":"https://api.github.com/users/bitzesty/orgs","repos_url":"https://api.github.com/users/bitzesty/repos","events_url":"https://api.github.com/users/bitzesty/events{/privacy}","received_events_url":"https://api.github.com/users/bitzesty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitzesty/qae","description":"[Beta] Queens Award for Enterprise","fork":false,"url":"https://api.github.com/repos/bitzesty/qae","forks_url":"https://api.github.com/repos/bitzesty/qae/forks","keys_url":"https://api.github.com/repos/bitzesty/qae/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitzesty/qae/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitzesty/qae/teams","hooks_url":"https://api.github.com/repos/bitzesty/qae/hooks","issue_events_url":"https://api.github.com/repos/bitzesty/qae/issues/events{/number}","events_url":"https://api.github.com/repos/bitzesty/qae/events","assignees_url":"https://api.github.com/repos/bitzesty/qae/assignees{/user}","branches_url":"https://api.github.com/repos/bitzesty/qae/branches{/branch}","tags_url":"https://api.github.com/repos/bitzesty/qae/tags","blobs_url":"https://api.github.com/repos/bitzesty/qae/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitzesty/qae/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitzesty/qae/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitzesty/qae/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitzesty/qae/statuses/{sha}","languages_url":"https://api.github.com/repos/bitzesty/qae/languages","stargazers_url":"https://api.github.com/repos/bitzesty/qae/stargazers","contributors_url":"https://api.github.com/repos/bitzesty/qae/contributors","subscribers_url":"https://api.github.com/repos/bitzesty/qae/subscribers","subscription_url":"https://api.github.com/repos/bitzesty/qae/subscription","commits_url":"https://api.github.com/repos/bitzesty/qae/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitzesty/qae/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitzesty/qae/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitzesty/qae/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitzesty/qae/contents/{+path}","compare_url":"https://api.github.com/repos/bitzesty/qae/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitzesty/qae/merges","archive_url":"https://api.github.com/repos/bitzesty/qae/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitzesty/qae/downloads","issues_url":"https://api.github.com/repos/bitzesty/qae/issues{/number}","pulls_url":"https://api.github.com/repos/bitzesty/qae/pulls{/number}","milestones_url":"https://api.github.com/repos/bitzesty/qae/milestones{/number}","notifications_url":"https://api.github.com/repos/bitzesty/qae/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitzesty/qae/labels{/name}","releases_url":"https://api.github.com/repos/bitzesty/qae/releases{/id}","created_at":"2014-11-17T13:56:00Z","updated_at":"2015-04-23T13:44:40Z","pushed_at":"2015-04-23T15:40:46Z","git_url":"git://github.com/bitzesty/qae.git","ssh_url":"git@github.com:bitzesty/qae.git","clone_url":"https://github.com/bitzesty/qae.git","svn_url":"https://github.com/bitzesty/qae","homepage":"","size":23549,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":11,"forks":2,"open_issues":11,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitzesty/qae/pulls/423"},"html":{"href":"https://github.com/bitzesty/qae/pull/423"},"issue":{"href":"https://api.github.com/repos/bitzesty/qae/issues/423"},"comments":{"href":"https://api.github.com/repos/bitzesty/qae/issues/423/comments"},"review_comments":{"href":"https://api.github.com/repos/bitzesty/qae/pulls/423/comments"},"review_comment":{"href":"https://api.github.com/repos/bitzesty/qae/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitzesty/qae/pulls/423/commits"},"statuses":{"href":"https://api.github.com/repos/bitzesty/qae/statuses/19cfeeff2a4c560c9208ec6fb8f0ab07d3866d69"}}}}