{"action":"created","comment":{"url":"https://api.github.com/repos/Elgg/Elgg/pulls/comments/58544929","id":58544929,"diff_hunk":"@@ -30,88 +23,89 @@\n  * In a plugin, override this view and override the registration for the\n  * lightbox JavaScript and CSS (@see elgg_views_boot()).\n  */\n-\n ?>\n //<script>\n \n-elgg.provide('elgg.ui.lightbox');\n+\trequire(['elgg', 'jquery'], function (elgg, $) {\n \n-<?php echo elgg_view('lightbox/settings.js'); ?>\n+\t\tfunction init() {\n+\t\t\trequire(['elgg/lightbox'], function (lightbox) {\n \n-/**\n- * Lightbox initialization\n- */\n-elgg.ui.lightbox.init = function() {\n-\tfunction registerDeprecationError() {\n-\t\telgg.register_error(\"fancybox lightbox has been replaced by colorbox\", 9999999999999);\n-\t}\n+\t\t\t\tlightbox.bind(\".elgg-lightbox\");\n+\t\t\t\tlightbox.bind(\".elgg-lightbox-photo\", {photo: true});\n+\t\t\t\tlightbox.bind(\".elgg-lightbox-inline\", {inline: true});\n+\t\t\t\tlightbox.bind(\".elgg-lightbox-iframe\", {iframe: true});\n \n-\telgg.ui.lightbox.bind(\".elgg-lightbox\");\n-\telgg.ui.lightbox.bind(\".elgg-lightbox-photo\", {photo: true});\n+\t\t\t\tfunction registerDeprecationError() {\n+\t\t\t\t\telgg.register_error(\"fancybox lightbox has been replaced by colorbox\", 9999999999999);\n+\t\t\t\t}\n \n-\tif (typeof $.fancybox === 'undefined') {\n-\t\t$.fancybox = {\n-\t\t\t// error message for firefox users\n-\t\t\t__noSuchMethod__ : registerDeprecationError,\n-\t\t\tclose: function () {\n-\t\t\t\tregisterDeprecationError();\n-\t\t\t\t$.colorbox.close();\n-\t\t\t}\n-\t\t};\n-\t\t// support $().fancybox({type:'image'})\n-\t\t$.fn.fancybox = function (arg) {\n-\t\t\tregisterDeprecationError();\n-\t\t\tif (arg.type === 'image') {\n-\t\t\t\targ.photo = true;\n-\t\t\t}\n-\t\t\tthis.colorbox(arg);\n-\t\t\treturn this;\n+\t\t\t\tif (typeof $.fancybox === 'undefined') {\n+\t\t\t\t\t$.fancybox = {\n+\t\t\t\t\t\t// error message for firefox users\n+\t\t\t\t\t\t__noSuchMethod__: registerDeprecationError,\n+\t\t\t\t\t\tclose: function () {\n+\t\t\t\t\t\t\tregisterDeprecationError();\n+\t\t\t\t\t\t\t$.colorbox.close();\n+\t\t\t\t\t\t}\n+\t\t\t\t\t};\n+\t\t\t\t\t// support $().fancybox({type:'image'})\n+\t\t\t\t\t$.fn.fancybox = function (arg) {\n+\t\t\t\t\t\tregisterDeprecationError();\n+\t\t\t\t\t\tif (arg.type === 'image') {\n+\t\t\t\t\t\t\targ.photo = true;\n+\t\t\t\t\t\t}\n+\t\t\t\t\t\tthis.colorbox(arg);\n+\t\t\t\t\t\treturn this;\n+\t\t\t\t\t};\n+\t\t\t\t}\n+\t\t\t});\n \t\t};\n-\t}\n-};\n-\n-/**\n- * Bind colorbox lightbox click to HTML\n- *\n- * @param {Object} selector CSS selector matching colorbox openers\n- * @param {Object} opts     Colorbox options. These are overridden by data-colorbox-opts options\n- */\n-elgg.ui.lightbox.bind = function (selector, opts) {\n-\tif (!$.isPlainObject(opts)) {\n-\t\topts = {};\n-\t}\n-\n-\t// merge opts into defaults\n-\topts = $.extend({}, elgg.ui.lightbox.getSettings(), opts);\n \n-\t$(document).on('click', selector, function (e) {\n-\t\tvar $this = $(this),\n-\t\t\thref = $this.prop('href') || $this.prop('src'),\n-\t\t\tdataOpts = $this.data('colorboxOpts');\n-\t\t// Note: data-colorbox was reserved https://github.com/jackmoore/colorbox/issues/435\n+\t\telgg.provide('elgg.ui.lightbox');\n \n-\t\tif (!$.isPlainObject(dataOpts)) {\n-\t\t\tdataOpts = {};\n+\t\tif (typeof elgg.ui.lightbox.getSettings === 'function') {\n+\t\t\telgg.ui.lightbox.deprecated_settings = elgg.ui.lightbox.getSettings();\n \t\t}\n \n-\t\tif (!dataOpts.href && href) {\n-\t\t\tdataOpts.href = href;\n-\t\t}\n-\n-\t\t// merge data- options into opts\n-\t\t$.colorbox($.extend({}, opts, dataOpts));\n-\t\te.preventDefault();\n-\t});\n-};\n-\n-/**\n- * Close the colorbox\n- *\n- */\n-elgg.ui.lightbox.close = function() {\n-\t$.colorbox.close();\n-};\n+\t\t/**\n+\t\t * Lightbox settings\n+\t\t * @deprecated 2.2\n+\t\t */\n+\t\telgg.ui.lightbox.getSettings = function () {\n+\t\t\telgg.deprecated_notice('elgg.ui.lightbox.getSettings() has been deprecated and should not be called directly. Use elgg/lightbox AMD module intsead', '2.2');\n+\t\t\tvar lightbox = require('elgg/lightbox');","path":"views/default/lightbox.js.php","position":153,"original_position":153,"commit_id":"c3a290dc30d2aa697777932e6f0750bb5615044d","original_commit_id":"c3a290dc30d2aa697777932e6f0750bb5615044d","user":{"login":"mrclay","id":170687,"avatar_url":"https://avatars.githubusercontent.com/u/170687?v=3","gravatar_id":"","url":"https://api.github.com/users/mrclay","html_url":"https://github.com/mrclay","followers_url":"https://api.github.com/users/mrclay/followers","following_url":"https://api.github.com/users/mrclay/following{/other_user}","gists_url":"https://api.github.com/users/mrclay/gists{/gist_id}","starred_url":"https://api.github.com/users/mrclay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrclay/subscriptions","organizations_url":"https://api.github.com/users/mrclay/orgs","repos_url":"https://api.github.com/users/mrclay/repos","events_url":"https://api.github.com/users/mrclay/events{/privacy}","received_events_url":"https://api.github.com/users/mrclay/received_events","type":"User","site_admin":false},"body":"I'd be OK inlining it to get this done for 2.x.","created_at":"2016-04-05T14:14:33Z","updated_at":"2016-04-05T14:14:33Z","html_url":"https://github.com/Elgg/Elgg/pull/9611#discussion_r58544929","pull_request_url":"https://api.github.com/repos/Elgg/Elgg/pulls/9611","_links":{"self":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/comments/58544929"},"html":{"href":"https://github.com/Elgg/Elgg/pull/9611#discussion_r58544929"},"pull_request":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/9611"}}},"pull_request":{"url":"https://api.github.com/repos/Elgg/Elgg/pulls/9611","id":65065276,"html_url":"https://github.com/Elgg/Elgg/pull/9611","diff_url":"https://github.com/Elgg/Elgg/pull/9611.diff","patch_url":"https://github.com/Elgg/Elgg/pull/9611.patch","issue_url":"https://api.github.com/repos/Elgg/Elgg/issues/9611","number":9611,"state":"open","locked":false,"title":"feature(js): adds elgg/lightbox AMD module","user":{"login":"hypeJunction","id":1202761,"avatar_url":"https://avatars.githubusercontent.com/u/1202761?v=3","gravatar_id":"","url":"https://api.github.com/users/hypeJunction","html_url":"https://github.com/hypeJunction","followers_url":"https://api.github.com/users/hypeJunction/followers","following_url":"https://api.github.com/users/hypeJunction/following{/other_user}","gists_url":"https://api.github.com/users/hypeJunction/gists{/gist_id}","starred_url":"https://api.github.com/users/hypeJunction/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypeJunction/subscriptions","organizations_url":"https://api.github.com/users/hypeJunction/orgs","repos_url":"https://api.github.com/users/hypeJunction/repos","events_url":"https://api.github.com/users/hypeJunction/events{/privacy}","received_events_url":"https://api.github.com/users/hypeJunction/received_events","type":"User","site_admin":false},"body":"elgg/lightbox AMD module can now be used to open and close the lightbox\r\nprogrammatically.\r\n\r\nFixes #7895, #8309, #6991","created_at":"2016-04-03T10:56:56Z","updated_at":"2016-04-05T14:14:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"61e3d51eb7bd7a67254041a9f7609cab877680ac","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Elgg/Elgg/pulls/9611/commits","review_comments_url":"https://api.github.com/repos/Elgg/Elgg/pulls/9611/comments","review_comment_url":"https://api.github.com/repos/Elgg/Elgg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Elgg/Elgg/issues/9611/comments","statuses_url":"https://api.github.com/repos/Elgg/Elgg/statuses/c3a290dc30d2aa697777932e6f0750bb5615044d","head":{"label":"hypeJunction:lightbox-amd","ref":"lightbox-amd","sha":"c3a290dc30d2aa697777932e6f0750bb5615044d","user":{"login":"hypeJunction","id":1202761,"avatar_url":"https://avatars.githubusercontent.com/u/1202761?v=3","gravatar_id":"","url":"https://api.github.com/users/hypeJunction","html_url":"https://github.com/hypeJunction","followers_url":"https://api.github.com/users/hypeJunction/followers","following_url":"https://api.github.com/users/hypeJunction/following{/other_user}","gists_url":"https://api.github.com/users/hypeJunction/gists{/gist_id}","starred_url":"https://api.github.com/users/hypeJunction/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypeJunction/subscriptions","organizations_url":"https://api.github.com/users/hypeJunction/orgs","repos_url":"https://api.github.com/users/hypeJunction/repos","events_url":"https://api.github.com/users/hypeJunction/events{/privacy}","received_events_url":"https://api.github.com/users/hypeJunction/received_events","type":"User","site_admin":false},"repo":{"id":2797801,"name":"Elgg","full_name":"hypeJunction/Elgg","owner":{"login":"hypeJunction","id":1202761,"avatar_url":"https://avatars.githubusercontent.com/u/1202761?v=3","gravatar_id":"","url":"https://api.github.com/users/hypeJunction","html_url":"https://github.com/hypeJunction","followers_url":"https://api.github.com/users/hypeJunction/followers","following_url":"https://api.github.com/users/hypeJunction/following{/other_user}","gists_url":"https://api.github.com/users/hypeJunction/gists{/gist_id}","starred_url":"https://api.github.com/users/hypeJunction/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypeJunction/subscriptions","organizations_url":"https://api.github.com/users/hypeJunction/orgs","repos_url":"https://api.github.com/users/hypeJunction/repos","events_url":"https://api.github.com/users/hypeJunction/events{/privacy}","received_events_url":"https://api.github.com/users/hypeJunction/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hypeJunction/Elgg","description":"A social networking engine","fork":true,"url":"https://api.github.com/repos/hypeJunction/Elgg","forks_url":"https://api.github.com/repos/hypeJunction/Elgg/forks","keys_url":"https://api.github.com/repos/hypeJunction/Elgg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hypeJunction/Elgg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hypeJunction/Elgg/teams","hooks_url":"https://api.github.com/repos/hypeJunction/Elgg/hooks","issue_events_url":"https://api.github.com/repos/hypeJunction/Elgg/issues/events{/number}","events_url":"https://api.github.com/repos/hypeJunction/Elgg/events","assignees_url":"https://api.github.com/repos/hypeJunction/Elgg/assignees{/user}","branches_url":"https://api.github.com/repos/hypeJunction/Elgg/branches{/branch}","tags_url":"https://api.github.com/repos/hypeJunction/Elgg/tags","blobs_url":"https://api.github.com/repos/hypeJunction/Elgg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hypeJunction/Elgg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hypeJunction/Elgg/git/refs{/sha}","trees_url":"https://api.github.com/repos/hypeJunction/Elgg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hypeJunction/Elgg/statuses/{sha}","languages_url":"https://api.github.com/repos/hypeJunction/Elgg/languages","stargazers_url":"https://api.github.com/repos/hypeJunction/Elgg/stargazers","contributors_url":"https://api.github.com/repos/hypeJunction/Elgg/contributors","subscribers_url":"https://api.github.com/repos/hypeJunction/Elgg/subscribers","subscription_url":"https://api.github.com/repos/hypeJunction/Elgg/subscription","commits_url":"https://api.github.com/repos/hypeJunction/Elgg/commits{/sha}","git_commits_url":"https://api.github.com/repos/hypeJunction/Elgg/git/commits{/sha}","comments_url":"https://api.github.com/repos/hypeJunction/Elgg/comments{/number}","issue_comment_url":"https://api.github.com/repos/hypeJunction/Elgg/issues/comments{/number}","contents_url":"https://api.github.com/repos/hypeJunction/Elgg/contents/{+path}","compare_url":"https://api.github.com/repos/hypeJunction/Elgg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hypeJunction/Elgg/merges","archive_url":"https://api.github.com/repos/hypeJunction/Elgg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hypeJunction/Elgg/downloads","issues_url":"https://api.github.com/repos/hypeJunction/Elgg/issues{/number}","pulls_url":"https://api.github.com/repos/hypeJunction/Elgg/pulls{/number}","milestones_url":"https://api.github.com/repos/hypeJunction/Elgg/milestones{/number}","notifications_url":"https://api.github.com/repos/hypeJunction/Elgg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hypeJunction/Elgg/labels{/name}","releases_url":"https://api.github.com/repos/hypeJunction/Elgg/releases{/id}","deployments_url":"https://api.github.com/repos/hypeJunction/Elgg/deployments","created_at":"2011-11-17T18:59:58Z","updated_at":"2015-05-09T06:40:26Z","pushed_at":"2016-04-05T13:38:20Z","git_url":"git://github.com/hypeJunction/Elgg.git","ssh_url":"git@github.com:hypeJunction/Elgg.git","clone_url":"https://github.com/hypeJunction/Elgg.git","svn_url":"https://github.com/hypeJunction/Elgg","homepage":"http://elgg.org","size":43826,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"Elgg:2.x","ref":"2.x","sha":"710db9447d46ea68229956020b3b434813717eae","user":{"login":"Elgg","id":79167,"avatar_url":"https://avatars.githubusercontent.com/u/79167?v=3","gravatar_id":"","url":"https://api.github.com/users/Elgg","html_url":"https://github.com/Elgg","followers_url":"https://api.github.com/users/Elgg/followers","following_url":"https://api.github.com/users/Elgg/following{/other_user}","gists_url":"https://api.github.com/users/Elgg/gists{/gist_id}","starred_url":"https://api.github.com/users/Elgg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elgg/subscriptions","organizations_url":"https://api.github.com/users/Elgg/orgs","repos_url":"https://api.github.com/users/Elgg/repos","events_url":"https://api.github.com/users/Elgg/events{/privacy}","received_events_url":"https://api.github.com/users/Elgg/received_events","type":"Organization","site_admin":false},"repo":{"id":299271,"name":"Elgg","full_name":"Elgg/Elgg","owner":{"login":"Elgg","id":79167,"avatar_url":"https://avatars.githubusercontent.com/u/79167?v=3","gravatar_id":"","url":"https://api.github.com/users/Elgg","html_url":"https://github.com/Elgg","followers_url":"https://api.github.com/users/Elgg/followers","following_url":"https://api.github.com/users/Elgg/following{/other_user}","gists_url":"https://api.github.com/users/Elgg/gists{/gist_id}","starred_url":"https://api.github.com/users/Elgg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elgg/subscriptions","organizations_url":"https://api.github.com/users/Elgg/orgs","repos_url":"https://api.github.com/users/Elgg/repos","events_url":"https://api.github.com/users/Elgg/events{/privacy}","received_events_url":"https://api.github.com/users/Elgg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Elgg/Elgg","description":"A social networking engine in PHP/MySQL","fork":false,"url":"https://api.github.com/repos/Elgg/Elgg","forks_url":"https://api.github.com/repos/Elgg/Elgg/forks","keys_url":"https://api.github.com/repos/Elgg/Elgg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Elgg/Elgg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Elgg/Elgg/teams","hooks_url":"https://api.github.com/repos/Elgg/Elgg/hooks","issue_events_url":"https://api.github.com/repos/Elgg/Elgg/issues/events{/number}","events_url":"https://api.github.com/repos/Elgg/Elgg/events","assignees_url":"https://api.github.com/repos/Elgg/Elgg/assignees{/user}","branches_url":"https://api.github.com/repos/Elgg/Elgg/branches{/branch}","tags_url":"https://api.github.com/repos/Elgg/Elgg/tags","blobs_url":"https://api.github.com/repos/Elgg/Elgg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Elgg/Elgg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Elgg/Elgg/git/refs{/sha}","trees_url":"https://api.github.com/repos/Elgg/Elgg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Elgg/Elgg/statuses/{sha}","languages_url":"https://api.github.com/repos/Elgg/Elgg/languages","stargazers_url":"https://api.github.com/repos/Elgg/Elgg/stargazers","contributors_url":"https://api.github.com/repos/Elgg/Elgg/contributors","subscribers_url":"https://api.github.com/repos/Elgg/Elgg/subscribers","subscription_url":"https://api.github.com/repos/Elgg/Elgg/subscription","commits_url":"https://api.github.com/repos/Elgg/Elgg/commits{/sha}","git_commits_url":"https://api.github.com/repos/Elgg/Elgg/git/commits{/sha}","comments_url":"https://api.github.com/repos/Elgg/Elgg/comments{/number}","issue_comment_url":"https://api.github.com/repos/Elgg/Elgg/issues/comments{/number}","contents_url":"https://api.github.com/repos/Elgg/Elgg/contents/{+path}","compare_url":"https://api.github.com/repos/Elgg/Elgg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Elgg/Elgg/merges","archive_url":"https://api.github.com/repos/Elgg/Elgg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Elgg/Elgg/downloads","issues_url":"https://api.github.com/repos/Elgg/Elgg/issues{/number}","pulls_url":"https://api.github.com/repos/Elgg/Elgg/pulls{/number}","milestones_url":"https://api.github.com/repos/Elgg/Elgg/milestones{/number}","notifications_url":"https://api.github.com/repos/Elgg/Elgg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Elgg/Elgg/labels{/name}","releases_url":"https://api.github.com/repos/Elgg/Elgg/releases{/id}","deployments_url":"https://api.github.com/repos/Elgg/Elgg/deployments","created_at":"2009-09-06T17:10:11Z","updated_at":"2016-04-01T12:00:14Z","pushed_at":"2016-04-05T14:02:02Z","git_url":"git://github.com/Elgg/Elgg.git","ssh_url":"git@github.com:Elgg/Elgg.git","clone_url":"https://github.com/Elgg/Elgg.git","svn_url":"https://github.com/Elgg/Elgg","homepage":"http://elgg.org","size":83402,"stargazers_count":857,"watchers_count":857,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":502,"mirror_url":null,"open_issues_count":837,"forks":502,"open_issues":837,"watchers":857,"default_branch":"2.x"}},"_links":{"self":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/9611"},"html":{"href":"https://github.com/Elgg/Elgg/pull/9611"},"issue":{"href":"https://api.github.com/repos/Elgg/Elgg/issues/9611"},"comments":{"href":"https://api.github.com/repos/Elgg/Elgg/issues/9611/comments"},"review_comments":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/9611/comments"},"review_comment":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/9611/commits"},"statuses":{"href":"https://api.github.com/repos/Elgg/Elgg/statuses/c3a290dc30d2aa697777932e6f0750bb5615044d"}}}}