{"action":"created","comment":{"url":"https://api.github.com/repos/ox-it/wl-reference/pulls/comments/26505513","id":26505513,"diff_hunk":"@@ -91,28 +106,41 @@ $.fn.itemSearch = function(options) {\n     var pagesContainer = $('<div/>').addClass('pages');\n \n     // build page numbers and containers\n-    for (i = 1; i <= pages; i++) {\n-      nav.append($('<a/>').html(i).attr({'class': 'pageNum', 'href': '#', 'data-page': i}));\n-      pagesContainer.append($('<div/>').attr({'class': 'page', 'data-page': i}));\n-    };\n \n+    var currentPage = $.fn.itemSearch.currentPage;\n+    var iFrameId = settings.resultsContainer[0].id.replace('Results', 'Iframe');\n+    if (currentPage >= 1 && currentPage  <=4){\n+      if (currentPage  > 1){\n+          appendBackButton(nav, currentPage, iFrameId );\n+      }\n+      for (i = 1; i <= 7; i++) {\n+          appendPageButtons(i, currentPage , pagesContainer, nav, iFrameId);\n+      }\n+    }\n+    else {\n+        appendBackButton(nav, currentPage );","path":"library/src/webapp/editor/ckextraplugins/common/js/itemsearch.js","position":44,"original_position":44,"commit_id":"33173cb596754fc43c31ab1e64fafb5a590673bf","original_commit_id":"33173cb596754fc43c31ab1e64fafb5a590673bf","user":{"login":"buckett","id":5921,"avatar_url":"https://avatars.githubusercontent.com/u/5921?v=3","gravatar_id":"","url":"https://api.github.com/users/buckett","html_url":"https://github.com/buckett","followers_url":"https://api.github.com/users/buckett/followers","following_url":"https://api.github.com/users/buckett/following{/other_user}","gists_url":"https://api.github.com/users/buckett/gists{/gist_id}","starred_url":"https://api.github.com/users/buckett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buckett/subscriptions","organizations_url":"https://api.github.com/users/buckett/orgs","repos_url":"https://api.github.com/users/buckett/repos","events_url":"https://api.github.com/users/buckett/events{/privacy}","received_events_url":"https://api.github.com/users/buckett/received_events","type":"User","site_admin":false},"body":"Shouldn't you be passing `iFrameId` in here?","created_at":"2015-03-16T17:09:40Z","updated_at":"2015-03-16T17:09:40Z","html_url":"https://github.com/ox-it/wl-reference/pull/72#discussion_r26505513","pull_request_url":"https://api.github.com/repos/ox-it/wl-reference/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/ox-it/wl-reference/pulls/comments/26505513"},"html":{"href":"https://github.com/ox-it/wl-reference/pull/72#discussion_r26505513"},"pull_request":{"href":"https://api.github.com/repos/ox-it/wl-reference/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/ox-it/wl-reference/pulls/72","id":31124779,"html_url":"https://github.com/ox-it/wl-reference/pull/72","diff_url":"https://github.com/ox-it/wl-reference/pull/72.diff","patch_url":"https://github.com/ox-it/wl-reference/pull/72.patch","issue_url":"https://api.github.com/repos/ox-it/wl-reference/issues/72","number":72,"state":"open","locked":false,"title":"WL-3502: Changes to how the Youtube widget works","user":{"login":"nicholaswilson100","id":7457681,"avatar_url":"https://avatars.githubusercontent.com/u/7457681?v=3","gravatar_id":"","url":"https://api.github.com/users/nicholaswilson100","html_url":"https://github.com/nicholaswilson100","followers_url":"https://api.github.com/users/nicholaswilson100/followers","following_url":"https://api.github.com/users/nicholaswilson100/following{/other_user}","gists_url":"https://api.github.com/users/nicholaswilson100/gists{/gist_id}","starred_url":"https://api.github.com/users/nicholaswilson100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicholaswilson100/subscriptions","organizations_url":"https://api.github.com/users/nicholaswilson100/orgs","repos_url":"https://api.github.com/users/nicholaswilson100/repos","events_url":"https://api.github.com/users/nicholaswilson100/events{/privacy}","received_events_url":"https://api.github.com/users/nicholaswilson100/received_events","type":"User","site_admin":false},"body":"The Jira goes on a bit so a summary of the basic changes to how the widget currently works are:\r\n\r\n1.   Just have one page of results showing, not 5.\r\n2.   Make the Back, Next and page links look and work like Youtube's\r\n3.   Disable the OK Button\r\n\r\nThe way the paging works below is that when a search is made, the results for page 1 are retrieved and with them also the pageTokens for the other pages (2-7).   When a page link is clicked, a click on the search button is then triggered using  the relevant pageToken.  \r\n\r\nThe currentPage is always stored so that when the Next button is clicked, we get the results for the pageToken after the one for currentPage.     ","created_at":"2015-03-13T13:20:42Z","updated_at":"2015-03-16T17:09:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a78d856733bc6fab02d8e7897ecb458220f6c775","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ox-it/wl-reference/pulls/72/commits","review_comments_url":"https://api.github.com/repos/ox-it/wl-reference/pulls/72/comments","review_comment_url":"https://api.github.com/repos/ox-it/wl-reference/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ox-it/wl-reference/issues/72/comments","statuses_url":"https://api.github.com/repos/ox-it/wl-reference/statuses/33173cb596754fc43c31ab1e64fafb5a590673bf","head":{"label":"ox-it:WL-3502","ref":"WL-3502","sha":"33173cb596754fc43c31ab1e64fafb5a590673bf","user":{"login":"ox-it","id":351950,"avatar_url":"https://avatars.githubusercontent.com/u/351950?v=3","gravatar_id":"","url":"https://api.github.com/users/ox-it","html_url":"https://github.com/ox-it","followers_url":"https://api.github.com/users/ox-it/followers","following_url":"https://api.github.com/users/ox-it/following{/other_user}","gists_url":"https://api.github.com/users/ox-it/gists{/gist_id}","starred_url":"https://api.github.com/users/ox-it/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ox-it/subscriptions","organizations_url":"https://api.github.com/users/ox-it/orgs","repos_url":"https://api.github.com/users/ox-it/repos","events_url":"https://api.github.com/users/ox-it/events{/privacy}","received_events_url":"https://api.github.com/users/ox-it/received_events","type":"Organization","site_admin":false},"repo":{"id":6059091,"name":"wl-reference","full_name":"ox-it/wl-reference","owner":{"login":"ox-it","id":351950,"avatar_url":"https://avatars.githubusercontent.com/u/351950?v=3","gravatar_id":"","url":"https://api.github.com/users/ox-it","html_url":"https://github.com/ox-it","followers_url":"https://api.github.com/users/ox-it/followers","following_url":"https://api.github.com/users/ox-it/following{/other_user}","gists_url":"https://api.github.com/users/ox-it/gists{/gist_id}","starred_url":"https://api.github.com/users/ox-it/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ox-it/subscriptions","organizations_url":"https://api.github.com/users/ox-it/orgs","repos_url":"https://api.github.com/users/ox-it/repos","events_url":"https://api.github.com/users/ox-it/events{/privacy}","received_events_url":"https://api.github.com/users/ox-it/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ox-it/wl-reference","description":null,"fork":false,"url":"https://api.github.com/repos/ox-it/wl-reference","forks_url":"https://api.github.com/repos/ox-it/wl-reference/forks","keys_url":"https://api.github.com/repos/ox-it/wl-reference/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ox-it/wl-reference/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ox-it/wl-reference/teams","hooks_url":"https://api.github.com/repos/ox-it/wl-reference/hooks","issue_events_url":"https://api.github.com/repos/ox-it/wl-reference/issues/events{/number}","events_url":"https://api.github.com/repos/ox-it/wl-reference/events","assignees_url":"https://api.github.com/repos/ox-it/wl-reference/assignees{/user}","branches_url":"https://api.github.com/repos/ox-it/wl-reference/branches{/branch}","tags_url":"https://api.github.com/repos/ox-it/wl-reference/tags","blobs_url":"https://api.github.com/repos/ox-it/wl-reference/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ox-it/wl-reference/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ox-it/wl-reference/git/refs{/sha}","trees_url":"https://api.github.com/repos/ox-it/wl-reference/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ox-it/wl-reference/statuses/{sha}","languages_url":"https://api.github.com/repos/ox-it/wl-reference/languages","stargazers_url":"https://api.github.com/repos/ox-it/wl-reference/stargazers","contributors_url":"https://api.github.com/repos/ox-it/wl-reference/contributors","subscribers_url":"https://api.github.com/repos/ox-it/wl-reference/subscribers","subscription_url":"https://api.github.com/repos/ox-it/wl-reference/subscription","commits_url":"https://api.github.com/repos/ox-it/wl-reference/commits{/sha}","git_commits_url":"https://api.github.com/repos/ox-it/wl-reference/git/commits{/sha}","comments_url":"https://api.github.com/repos/ox-it/wl-reference/comments{/number}","issue_comment_url":"https://api.github.com/repos/ox-it/wl-reference/issues/comments{/number}","contents_url":"https://api.github.com/repos/ox-it/wl-reference/contents/{+path}","compare_url":"https://api.github.com/repos/ox-it/wl-reference/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ox-it/wl-reference/merges","archive_url":"https://api.github.com/repos/ox-it/wl-reference/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ox-it/wl-reference/downloads","issues_url":"https://api.github.com/repos/ox-it/wl-reference/issues{/number}","pulls_url":"https://api.github.com/repos/ox-it/wl-reference/pulls{/number}","milestones_url":"https://api.github.com/repos/ox-it/wl-reference/milestones{/number}","notifications_url":"https://api.github.com/repos/ox-it/wl-reference/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ox-it/wl-reference/labels{/name}","releases_url":"https://api.github.com/repos/ox-it/wl-reference/releases{/id}","created_at":"2012-10-03T11:32:05Z","updated_at":"2015-03-05T16:51:08Z","pushed_at":"2015-03-16T13:48:26Z","git_url":"git://github.com/ox-it/wl-reference.git","ssh_url":"git@github.com:ox-it/wl-reference.git","clone_url":"https://github.com/ox-it/wl-reference.git","svn_url":"https://github.com/ox-it/wl-reference","homepage":null,"size":77024,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"sakai-10.x"}},"base":{"label":"ox-it:sakai-10.x","ref":"sakai-10.x","sha":"09e793a10cb0161e9516b00b14f7f0d475862aad","user":{"login":"ox-it","id":351950,"avatar_url":"https://avatars.githubusercontent.com/u/351950?v=3","gravatar_id":"","url":"https://api.github.com/users/ox-it","html_url":"https://github.com/ox-it","followers_url":"https://api.github.com/users/ox-it/followers","following_url":"https://api.github.com/users/ox-it/following{/other_user}","gists_url":"https://api.github.com/users/ox-it/gists{/gist_id}","starred_url":"https://api.github.com/users/ox-it/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ox-it/subscriptions","organizations_url":"https://api.github.com/users/ox-it/orgs","repos_url":"https://api.github.com/users/ox-it/repos","events_url":"https://api.github.com/users/ox-it/events{/privacy}","received_events_url":"https://api.github.com/users/ox-it/received_events","type":"Organization","site_admin":false},"repo":{"id":6059091,"name":"wl-reference","full_name":"ox-it/wl-reference","owner":{"login":"ox-it","id":351950,"avatar_url":"https://avatars.githubusercontent.com/u/351950?v=3","gravatar_id":"","url":"https://api.github.com/users/ox-it","html_url":"https://github.com/ox-it","followers_url":"https://api.github.com/users/ox-it/followers","following_url":"https://api.github.com/users/ox-it/following{/other_user}","gists_url":"https://api.github.com/users/ox-it/gists{/gist_id}","starred_url":"https://api.github.com/users/ox-it/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ox-it/subscriptions","organizations_url":"https://api.github.com/users/ox-it/orgs","repos_url":"https://api.github.com/users/ox-it/repos","events_url":"https://api.github.com/users/ox-it/events{/privacy}","received_events_url":"https://api.github.com/users/ox-it/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ox-it/wl-reference","description":null,"fork":false,"url":"https://api.github.com/repos/ox-it/wl-reference","forks_url":"https://api.github.com/repos/ox-it/wl-reference/forks","keys_url":"https://api.github.com/repos/ox-it/wl-reference/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ox-it/wl-reference/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ox-it/wl-reference/teams","hooks_url":"https://api.github.com/repos/ox-it/wl-reference/hooks","issue_events_url":"https://api.github.com/repos/ox-it/wl-reference/issues/events{/number}","events_url":"https://api.github.com/repos/ox-it/wl-reference/events","assignees_url":"https://api.github.com/repos/ox-it/wl-reference/assignees{/user}","branches_url":"https://api.github.com/repos/ox-it/wl-reference/branches{/branch}","tags_url":"https://api.github.com/repos/ox-it/wl-reference/tags","blobs_url":"https://api.github.com/repos/ox-it/wl-reference/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ox-it/wl-reference/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ox-it/wl-reference/git/refs{/sha}","trees_url":"https://api.github.com/repos/ox-it/wl-reference/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ox-it/wl-reference/statuses/{sha}","languages_url":"https://api.github.com/repos/ox-it/wl-reference/languages","stargazers_url":"https://api.github.com/repos/ox-it/wl-reference/stargazers","contributors_url":"https://api.github.com/repos/ox-it/wl-reference/contributors","subscribers_url":"https://api.github.com/repos/ox-it/wl-reference/subscribers","subscription_url":"https://api.github.com/repos/ox-it/wl-reference/subscription","commits_url":"https://api.github.com/repos/ox-it/wl-reference/commits{/sha}","git_commits_url":"https://api.github.com/repos/ox-it/wl-reference/git/commits{/sha}","comments_url":"https://api.github.com/repos/ox-it/wl-reference/comments{/number}","issue_comment_url":"https://api.github.com/repos/ox-it/wl-reference/issues/comments{/number}","contents_url":"https://api.github.com/repos/ox-it/wl-reference/contents/{+path}","compare_url":"https://api.github.com/repos/ox-it/wl-reference/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ox-it/wl-reference/merges","archive_url":"https://api.github.com/repos/ox-it/wl-reference/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ox-it/wl-reference/downloads","issues_url":"https://api.github.com/repos/ox-it/wl-reference/issues{/number}","pulls_url":"https://api.github.com/repos/ox-it/wl-reference/pulls{/number}","milestones_url":"https://api.github.com/repos/ox-it/wl-reference/milestones{/number}","notifications_url":"https://api.github.com/repos/ox-it/wl-reference/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ox-it/wl-reference/labels{/name}","releases_url":"https://api.github.com/repos/ox-it/wl-reference/releases{/id}","created_at":"2012-10-03T11:32:05Z","updated_at":"2015-03-05T16:51:08Z","pushed_at":"2015-03-16T13:48:26Z","git_url":"git://github.com/ox-it/wl-reference.git","ssh_url":"git@github.com:ox-it/wl-reference.git","clone_url":"https://github.com/ox-it/wl-reference.git","svn_url":"https://github.com/ox-it/wl-reference","homepage":null,"size":77024,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"sakai-10.x"}},"_links":{"self":{"href":"https://api.github.com/repos/ox-it/wl-reference/pulls/72"},"html":{"href":"https://github.com/ox-it/wl-reference/pull/72"},"issue":{"href":"https://api.github.com/repos/ox-it/wl-reference/issues/72"},"comments":{"href":"https://api.github.com/repos/ox-it/wl-reference/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/ox-it/wl-reference/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/ox-it/wl-reference/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ox-it/wl-reference/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/ox-it/wl-reference/statuses/33173cb596754fc43c31ab1e64fafb5a590673bf"}}}}