{"action":"created","comment":{"url":"https://api.github.com/repos/owncloud/core/pulls/comments/22590523","id":22590523,"diff_hunk":"@@ -731,6 +732,40 @@ OC.Notification={\n \t\t}\n \t},\n \n+\n+\t/**\n+\t * Shows a notification that disappears after x seconds, default is\n+\t * 5 seconds\n+\t * @param {string} text Message to show\n+\t * @param {array} [options] options array\n+\t * @param {int} [options.timeout=5] timeout in seconds\n+\t * @param {boolean} [options.isHTML=false] an indicator for HTML notifications (true) or text (false)\n+\t */\n+\tshowTemporary: function(text, options) {\n+\t\tvar defaults = {\n+\t\t\t\tisHTML: false,\n+\t\t\t\ttimeout: 5\n+\t\t\t},\n+\t\t\toptions = options || {};\n+\t\t// merge defaults with passed in options\n+\t\t_.defaults(options, defaults);\n+\n+\t\t// clear previous notifications\n+\t\tOC.Notification.hide();\n+\t\tif(OC.Notification.notificationTimer) {\n+\t\t\tclearTimeout(OC.Notification.notificationTimer);\n+\t\t}\n+\n+\t\tif(options.isHTML) {\n+\t\t\tOC.Notification.showHtml(text);\n+\t\t} else {\n+\t\t\tOC.Notification.show(text);\n+\t\t}\n+\n+\t\t// register timeout to vanish notification\n+\t\tOC.Notification.notificationTimer = setTimeout(OC.Notification.hide, (options.timeout * 1000));","path":"core/js/js.js","position":43,"original_position":43,"commit_id":"e1361b505b50010ff343d24800b29a44c4121bb6","original_commit_id":"e1361b505b50010ff343d24800b29a44c4121bb6","user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"body":"If options.timeout is not defined / null / false, do we want to show the notification permanently ?","created_at":"2015-01-07T15:10:06Z","updated_at":"2015-01-07T15:10:06Z","html_url":"https://github.com/owncloud/core/pull/13148#discussion_r22590523","pull_request_url":"https://api.github.com/repos/owncloud/core/pulls/13148","_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments/22590523"},"html":{"href":"https://github.com/owncloud/core/pull/13148#discussion_r22590523"},"pull_request":{"href":"https://api.github.com/repos/owncloud/core/pulls/13148"}}},"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/13148","id":26958246,"html_url":"https://github.com/owncloud/core/pull/13148","diff_url":"https://github.com/owncloud/core/pull/13148.diff","patch_url":"https://github.com/owncloud/core/pull/13148.patch","issue_url":"https://api.github.com/repos/owncloud/core/issues/13148","number":13148,"state":"open","locked":false,"title":"Add timeout for notifications","user":{"login":"MorrisJobke","id":245432,"avatar_url":"https://avatars.githubusercontent.com/u/245432?v=3","gravatar_id":"","url":"https://api.github.com/users/MorrisJobke","html_url":"https://github.com/MorrisJobke","followers_url":"https://api.github.com/users/MorrisJobke/followers","following_url":"https://api.github.com/users/MorrisJobke/following{/other_user}","gists_url":"https://api.github.com/users/MorrisJobke/gists{/gist_id}","starred_url":"https://api.github.com/users/MorrisJobke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorrisJobke/subscriptions","organizations_url":"https://api.github.com/users/MorrisJobke/orgs","repos_url":"https://api.github.com/users/MorrisJobke/repos","events_url":"https://api.github.com/users/MorrisJobke/events{/privacy}","received_events_url":"https://api.github.com/users/MorrisJobke/received_events","type":"User","site_admin":false},"body":"* options for timeout in seconds and if it contains HTML\r\n* removes the notification after a given (default: 5 seconds) timeframe\r\n* based on work by @brantje - replaces #9787\r\n\r\ntested in IE8, Firefox and Chrome\r\n\r\nI would like to migrate every notification to this later, because this method also removes previous notifications and handles the cleanup that needs to be done for app developers otherwise. cc @jancborchardt \r\n\r\n\r\ncc @brantje @PVince81 @DeepDiver1975 ","created_at":"2015-01-07T13:54:45Z","updated_at":"2015-01-07T15:10:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b4d04737da4c1e94f2801e12ac64623ebc6dbbd2","assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/29","labels_url":"https://api.github.com/repos/owncloud/core/milestones/29/labels","id":841322,"number":29,"title":"8.0-current","description":null,"creator":{"login":"craigpg","id":160667,"avatar_url":"https://avatars.githubusercontent.com/u/160667?v=3","gravatar_id":"","url":"https://api.github.com/users/craigpg","html_url":"https://github.com/craigpg","followers_url":"https://api.github.com/users/craigpg/followers","following_url":"https://api.github.com/users/craigpg/following{/other_user}","gists_url":"https://api.github.com/users/craigpg/gists{/gist_id}","starred_url":"https://api.github.com/users/craigpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigpg/subscriptions","organizations_url":"https://api.github.com/users/craigpg/orgs","repos_url":"https://api.github.com/users/craigpg/repos","events_url":"https://api.github.com/users/craigpg/events{/privacy}","received_events_url":"https://api.github.com/users/craigpg/received_events","type":"User","site_admin":false},"open_issues":49,"closed_issues":358,"state":"open","created_at":"2014-10-27T01:20:05Z","updated_at":"2015-01-07T14:49:39Z","due_on":"2015-01-02T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/owncloud/core/pulls/13148/commits","review_comments_url":"https://api.github.com/repos/owncloud/core/pulls/13148/comments","review_comment_url":"https://api.github.com/repos/owncloud/core/pulls/comments/{number}","comments_url":"https://api.github.com/repos/owncloud/core/issues/13148/comments","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/e1361b505b50010ff343d24800b29a44c4121bb6","head":{"label":"owncloud:self-destroying-notifications","ref":"self-destroying-notifications","sha":"e1361b505b50010ff343d24800b29a44c4121bb6","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550552,"name":"core","full_name":"owncloud/core","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/core","description":"The ownCloud core","fork":false,"url":"https://api.github.com/repos/owncloud/core","forks_url":"https://api.github.com/repos/owncloud/core/forks","keys_url":"https://api.github.com/repos/owncloud/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/core/teams","hooks_url":"https://api.github.com/repos/owncloud/core/hooks","issue_events_url":"https://api.github.com/repos/owncloud/core/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/core/events","assignees_url":"https://api.github.com/repos/owncloud/core/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/core/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/core/tags","blobs_url":"https://api.github.com/repos/owncloud/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/core/languages","stargazers_url":"https://api.github.com/repos/owncloud/core/stargazers","contributors_url":"https://api.github.com/repos/owncloud/core/contributors","subscribers_url":"https://api.github.com/repos/owncloud/core/subscribers","subscription_url":"https://api.github.com/repos/owncloud/core/subscription","commits_url":"https://api.github.com/repos/owncloud/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/core/issues/comments/{number}","contents_url":"https://api.github.com/repos/owncloud/core/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/core/merges","archive_url":"https://api.github.com/repos/owncloud/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/core/downloads","issues_url":"https://api.github.com/repos/owncloud/core/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/core/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/core/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/core/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/core/releases{/id}","created_at":"2012-08-25T10:32:48Z","updated_at":"2015-01-07T11:57:36Z","pushed_at":"2015-01-07T15:03:18Z","git_url":"git://github.com/owncloud/core.git","ssh_url":"git@github.com:owncloud/core.git","clone_url":"https://github.com/owncloud/core.git","svn_url":"https://github.com/owncloud/core","homepage":null,"size":816012,"stargazers_count":2893,"watchers_count":2893,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":941,"mirror_url":null,"open_issues_count":1515,"forks":941,"open_issues":1515,"watchers":2893,"default_branch":"master"}},"base":{"label":"owncloud:master","ref":"master","sha":"5ce295907fd9469905d561de71d83149a6c0f6c5","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550552,"name":"core","full_name":"owncloud/core","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/core","description":"The ownCloud core","fork":false,"url":"https://api.github.com/repos/owncloud/core","forks_url":"https://api.github.com/repos/owncloud/core/forks","keys_url":"https://api.github.com/repos/owncloud/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/core/teams","hooks_url":"https://api.github.com/repos/owncloud/core/hooks","issue_events_url":"https://api.github.com/repos/owncloud/core/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/core/events","assignees_url":"https://api.github.com/repos/owncloud/core/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/core/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/core/tags","blobs_url":"https://api.github.com/repos/owncloud/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/core/languages","stargazers_url":"https://api.github.com/repos/owncloud/core/stargazers","contributors_url":"https://api.github.com/repos/owncloud/core/contributors","subscribers_url":"https://api.github.com/repos/owncloud/core/subscribers","subscription_url":"https://api.github.com/repos/owncloud/core/subscription","commits_url":"https://api.github.com/repos/owncloud/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/core/issues/comments/{number}","contents_url":"https://api.github.com/repos/owncloud/core/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/core/merges","archive_url":"https://api.github.com/repos/owncloud/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/core/downloads","issues_url":"https://api.github.com/repos/owncloud/core/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/core/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/core/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/core/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/core/releases{/id}","created_at":"2012-08-25T10:32:48Z","updated_at":"2015-01-07T11:57:36Z","pushed_at":"2015-01-07T15:03:18Z","git_url":"git://github.com/owncloud/core.git","ssh_url":"git@github.com:owncloud/core.git","clone_url":"https://github.com/owncloud/core.git","svn_url":"https://github.com/owncloud/core","homepage":null,"size":816012,"stargazers_count":2893,"watchers_count":2893,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":941,"mirror_url":null,"open_issues_count":1515,"forks":941,"open_issues":1515,"watchers":2893,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/13148"},"html":{"href":"https://github.com/owncloud/core/pull/13148"},"issue":{"href":"https://api.github.com/repos/owncloud/core/issues/13148"},"comments":{"href":"https://api.github.com/repos/owncloud/core/issues/13148/comments"},"review_comments":{"href":"https://api.github.com/repos/owncloud/core/pulls/13148/comments"},"review_comment":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/owncloud/core/pulls/13148/commits"},"statuses":{"href":"https://api.github.com/repos/owncloud/core/statuses/e1361b505b50010ff343d24800b29a44c4121bb6"}}}}