{"action":"created","comment":{"url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/comments/42623065","id":42623065,"diff_hunk":"@@ -446,6 +460,56 @@ require(['use!Geosite',\n             model.set('$uiContainer', $uiContainer);\n         }\n \n+        function setupPrintableMap(pluginObject, $printSandbox, previewDeferred) {\n+            var mapMarkup = N.app.templates['template-map-preview']({ pluginName: pluginObject.toolbarName }),\n+                $mapPrint = $($.trim(mapMarkup)),\n+                $printPreview = $('#print-preview-sandbox'),\n+                mapReadyDeferred = $.Deferred(),\n+                mapHeight = pluginObject.previewMapSize[1],\n+                mapWidth = pluginObject.previewMapSize[0];\n+\n+            // If the plugin is not set up for map print preview, don't set up a map\n+            // and resolve any pending print-preview map operations\n+            if (!pluginObject.usePrintPreviewMap) {\n+                previewDeferred.resolve();\n+                mapReadyDeferred.resolve();\n+                return mapReadyDeferred;\n+            }\n+\n+            // Setup a print-preview window for the user to select an extent and zoom level\n+            // that will be persisted at print due to its fixed size.\n+            TINY.box.show({\n+                animate: false,\n+                html: $mapPrint[0].outerHTML,\n+                boxid: 'print-preview-container',\n+                width: _.max([mapWidth, 500]),\n+                fixed: true,\n+                maskopacity: 40,\n+                openjs: function () {\n+                    // Remove any calculated size so that it contains the full map\n+                    $('#print-preview-container').css({ height: 'initial', width: 'initial' });\n+\n+                    // Set the supplied height & width on the map\n+                    $('#plugin-print-preview-map').css({ height: mapHeight, width: mapWidth });\n+\n+                    var map = new esri.Map('plugin-print-preview-map', { basemap: 'topo' });","path":"src/GeositeFramework/js/Plugin.js","position":83,"original_position":83,"commit_id":"79342c381f78295b5460e28915a3a34a1112b5fb","original_commit_id":"79342c381f78295b5460e28915a3a34a1112b5fb","user":{"login":"caseypt","id":1042475,"avatar_url":"https://avatars.githubusercontent.com/u/1042475?v=3","gravatar_id":"","url":"https://api.github.com/users/caseypt","html_url":"https://github.com/caseypt","followers_url":"https://api.github.com/users/caseypt/followers","following_url":"https://api.github.com/users/caseypt/following{/other_user}","gists_url":"https://api.github.com/users/caseypt/gists{/gist_id}","starred_url":"https://api.github.com/users/caseypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseypt/subscriptions","organizations_url":"https://api.github.com/users/caseypt/orgs","repos_url":"https://api.github.com/users/caseypt/repos","events_url":"https://api.github.com/users/caseypt/events{/privacy}","received_events_url":"https://api.github.com/users/caseypt/received_events","type":"User","site_admin":false},"body":"Consider using the active basemap and extent/center of the current map as defaults for the print map. ","created_at":"2015-10-21T13:35:23Z","updated_at":"2015-10-21T13:35:23Z","html_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework/pull/432#discussion_r42623065","pull_request_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/432","_links":{"self":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/comments/42623065"},"html":{"href":"https://github.com/CoastalResilienceNetwork/GeositeFramework/pull/432#discussion_r42623065"},"pull_request":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/432"}}},"pull_request":{"url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/432","id":48220590,"html_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework/pull/432","diff_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework/pull/432.diff","patch_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework/pull/432.patch","issue_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/432","number":432,"state":"open","locked":false,"title":"Print map preview","user":{"login":"mmcfarland","id":1014341,"avatar_url":"https://avatars.githubusercontent.com/u/1014341?v=3","gravatar_id":"","url":"https://api.github.com/users/mmcfarland","html_url":"https://github.com/mmcfarland","followers_url":"https://api.github.com/users/mmcfarland/followers","following_url":"https://api.github.com/users/mmcfarland/following{/other_user}","gists_url":"https://api.github.com/users/mmcfarland/gists{/gist_id}","starred_url":"https://api.github.com/users/mmcfarland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmcfarland/subscriptions","organizations_url":"https://api.github.com/users/mmcfarland/orgs","repos_url":"https://api.github.com/users/mmcfarland/repos","events_url":"https://api.github.com/users/mmcfarland/events{/privacy}","received_events_url":"https://api.github.com/users/mmcfarland/received_events","type":"User","site_admin":false},"body":"Add a print preview map to plugins which request one.  The plugin is responsible for setting the layers of  the map, but lets the user select a zoom and extent that will likely results in a printable map.  The preview map is added to a sandbox element which is only available in `@media print`.  The plugin is also passed a reference to this sandbox so they can place additional elements and construct their own print.css to manage that layout.\r\n\r\nConnects #427 \r\nTo Test:\r\n\r\nThe Sample Identify Plugin has been kitted out to support all the new features.\r\n* Launch the Identify Plugin\r\n* Click new Print button (fig 1)\r\n* Navigate the preview map (fig 2)\r\n* Click print to see your map & also a custom style graphic (fig 3)\r\n\r\n*fig 1:*\r\n![print button](https://cloud.githubusercontent.com/assets/1014341/10612959/19705ed4-7721-11e5-9a4e-b41c6f478065.PNG)\r\n\r\n*fig 2:*\r\n![preview](https://cloud.githubusercontent.com/assets/1014341/10612960/1973f044-7721-11e5-8bf2-0a70b63ef5cb.PNG)\r\n\r\n*fig 3:*\r\n![output print](https://cloud.githubusercontent.com/assets/1014341/10612961/1974016a-7721-11e5-8916-1f23c983e830.PNG)\r\n","created_at":"2015-10-20T15:55:12Z","updated_at":"2015-10-21T13:35:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"42b6167b31734e8b9201cec311989e1981fe8852","assignee":{"login":"kdeloach","id":43062,"avatar_url":"https://avatars.githubusercontent.com/u/43062?v=3","gravatar_id":"","url":"https://api.github.com/users/kdeloach","html_url":"https://github.com/kdeloach","followers_url":"https://api.github.com/users/kdeloach/followers","following_url":"https://api.github.com/users/kdeloach/following{/other_user}","gists_url":"https://api.github.com/users/kdeloach/gists{/gist_id}","starred_url":"https://api.github.com/users/kdeloach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdeloach/subscriptions","organizations_url":"https://api.github.com/users/kdeloach/orgs","repos_url":"https://api.github.com/users/kdeloach/repos","events_url":"https://api.github.com/users/kdeloach/events{/privacy}","received_events_url":"https://api.github.com/users/kdeloach/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/432/commits","review_comments_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/432/comments","review_comment_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/432/comments","statuses_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/statuses/79342c381f78295b5460e28915a3a34a1112b5fb","head":{"label":"mmcfarland:feature/print-map-preview","ref":"feature/print-map-preview","sha":"79342c381f78295b5460e28915a3a34a1112b5fb","user":{"login":"mmcfarland","id":1014341,"avatar_url":"https://avatars.githubusercontent.com/u/1014341?v=3","gravatar_id":"","url":"https://api.github.com/users/mmcfarland","html_url":"https://github.com/mmcfarland","followers_url":"https://api.github.com/users/mmcfarland/followers","following_url":"https://api.github.com/users/mmcfarland/following{/other_user}","gists_url":"https://api.github.com/users/mmcfarland/gists{/gist_id}","starred_url":"https://api.github.com/users/mmcfarland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmcfarland/subscriptions","organizations_url":"https://api.github.com/users/mmcfarland/orgs","repos_url":"https://api.github.com/users/mmcfarland/repos","events_url":"https://api.github.com/users/mmcfarland/events{/privacy}","received_events_url":"https://api.github.com/users/mmcfarland/received_events","type":"User","site_admin":false},"repo":{"id":15612539,"name":"GeositeFramework","full_name":"mmcfarland/GeositeFramework","owner":{"login":"mmcfarland","id":1014341,"avatar_url":"https://avatars.githubusercontent.com/u/1014341?v=3","gravatar_id":"","url":"https://api.github.com/users/mmcfarland","html_url":"https://github.com/mmcfarland","followers_url":"https://api.github.com/users/mmcfarland/followers","following_url":"https://api.github.com/users/mmcfarland/following{/other_user}","gists_url":"https://api.github.com/users/mmcfarland/gists{/gist_id}","starred_url":"https://api.github.com/users/mmcfarland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmcfarland/subscriptions","organizations_url":"https://api.github.com/users/mmcfarland/orgs","repos_url":"https://api.github.com/users/mmcfarland/repos","events_url":"https://api.github.com/users/mmcfarland/events{/privacy}","received_events_url":"https://api.github.com/users/mmcfarland/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mmcfarland/GeositeFramework","description":"Mapping Framework powering TNC Coastal Resilience programs","fork":true,"url":"https://api.github.com/repos/mmcfarland/GeositeFramework","forks_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/forks","keys_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/teams","hooks_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/hooks","issue_events_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/issues/events{/number}","events_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/events","assignees_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/assignees{/user}","branches_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/branches{/branch}","tags_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/tags","blobs_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/git/refs{/sha}","trees_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/statuses/{sha}","languages_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/languages","stargazers_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/stargazers","contributors_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/contributors","subscribers_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/subscribers","subscription_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/subscription","commits_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/commits{/sha}","git_commits_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/git/commits{/sha}","comments_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/comments{/number}","issue_comment_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/issues/comments{/number}","contents_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/contents/{+path}","compare_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/merges","archive_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/downloads","issues_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/issues{/number}","pulls_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/pulls{/number}","milestones_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/milestones{/number}","notifications_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/labels{/name}","releases_url":"https://api.github.com/repos/mmcfarland/GeositeFramework/releases{/id}","created_at":"2014-01-03T15:28:17Z","updated_at":"2015-03-24T18:14:40Z","pushed_at":"2015-10-20T22:20:39Z","git_url":"git://github.com/mmcfarland/GeositeFramework.git","ssh_url":"git@github.com:mmcfarland/GeositeFramework.git","clone_url":"https://github.com/mmcfarland/GeositeFramework.git","svn_url":"https://github.com/mmcfarland/GeositeFramework","homepage":"http://maps.coastalresilience.org/network/","size":8510,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"CoastalResilienceNetwork:develop","ref":"develop","sha":"29ce80be8648e522c9e5f9d8a95feded0ec78345","user":{"login":"CoastalResilienceNetwork","id":5659174,"avatar_url":"https://avatars.githubusercontent.com/u/5659174?v=3","gravatar_id":"","url":"https://api.github.com/users/CoastalResilienceNetwork","html_url":"https://github.com/CoastalResilienceNetwork","followers_url":"https://api.github.com/users/CoastalResilienceNetwork/followers","following_url":"https://api.github.com/users/CoastalResilienceNetwork/following{/other_user}","gists_url":"https://api.github.com/users/CoastalResilienceNetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/CoastalResilienceNetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CoastalResilienceNetwork/subscriptions","organizations_url":"https://api.github.com/users/CoastalResilienceNetwork/orgs","repos_url":"https://api.github.com/users/CoastalResilienceNetwork/repos","events_url":"https://api.github.com/users/CoastalResilienceNetwork/events{/privacy}","received_events_url":"https://api.github.com/users/CoastalResilienceNetwork/received_events","type":"Organization","site_admin":false},"repo":{"id":7753400,"name":"GeositeFramework","full_name":"CoastalResilienceNetwork/GeositeFramework","owner":{"login":"CoastalResilienceNetwork","id":5659174,"avatar_url":"https://avatars.githubusercontent.com/u/5659174?v=3","gravatar_id":"","url":"https://api.github.com/users/CoastalResilienceNetwork","html_url":"https://github.com/CoastalResilienceNetwork","followers_url":"https://api.github.com/users/CoastalResilienceNetwork/followers","following_url":"https://api.github.com/users/CoastalResilienceNetwork/following{/other_user}","gists_url":"https://api.github.com/users/CoastalResilienceNetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/CoastalResilienceNetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CoastalResilienceNetwork/subscriptions","organizations_url":"https://api.github.com/users/CoastalResilienceNetwork/orgs","repos_url":"https://api.github.com/users/CoastalResilienceNetwork/repos","events_url":"https://api.github.com/users/CoastalResilienceNetwork/events{/privacy}","received_events_url":"https://api.github.com/users/CoastalResilienceNetwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework","description":"Mapping Framework powering TNC Coastal Resilience programs","fork":false,"url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework","forks_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/forks","keys_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/teams","hooks_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/hooks","issue_events_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/events{/number}","events_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/events","assignees_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/assignees{/user}","branches_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/branches{/branch}","tags_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/tags","blobs_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/refs{/sha}","trees_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/statuses/{sha}","languages_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/languages","stargazers_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/stargazers","contributors_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/contributors","subscribers_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/subscribers","subscription_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/subscription","commits_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/commits{/sha}","git_commits_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/commits{/sha}","comments_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/comments{/number}","issue_comment_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/comments{/number}","contents_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/contents/{+path}","compare_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/merges","archive_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/downloads","issues_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues{/number}","pulls_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls{/number}","milestones_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/milestones{/number}","notifications_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/labels{/name}","releases_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/releases{/id}","created_at":"2013-01-22T14:07:50Z","updated_at":"2015-05-07T14:31:24Z","pushed_at":"2015-10-20T15:55:12Z","git_url":"git://github.com/CoastalResilienceNetwork/GeositeFramework.git","ssh_url":"git@github.com:CoastalResilienceNetwork/GeositeFramework.git","clone_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework.git","svn_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework","homepage":"http://maps.coastalresilience.org/network/","size":9771,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":32,"forks":7,"open_issues":32,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/432"},"html":{"href":"https://github.com/CoastalResilienceNetwork/GeositeFramework/pull/432"},"issue":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/432"},"comments":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/432/comments"},"review_comments":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/432/comments"},"review_comment":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/432/commits"},"statuses":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/statuses/79342c381f78295b5460e28915a3a34a1112b5fb"}}}}