{"action":"created","comment":{"url":"https://api.github.com/repos/neos/neos-development-collection/pulls/comments/59505948","id":59505948,"diff_hunk":"@@ -2,38 +2,55 @@\n  * Context context bar\n  */\n define(\n-[\n-\t'emberjs',\n-\t'./ContextBar',\n-\t'./ContentDimensionSelector',\n-\t'../FullScreenController',\n-\t'../Application',\n-\t'Shared/Configuration',\n-\t'text!./ContentContextBar.html'\n-], function(\n-\tEmber,\n-\tContextBar,\n-\tContentDimensionSelector,\n-\tFullScreenController,\n-\tContentModule,\n-\tConfiguration,\n-\ttemplate\n-) {\n-\treturn ContextBar.extend({\n-\t\tclassNames: 'neos-content-context-bar',\n-\t\ttemplate: Ember.Handlebars.compile(template),\n-\t\tContentDimensionSelector: ContentDimensionSelector,\n-\t\tfullScreenController: FullScreenController,\n-\t\tConfiguration: Configuration,\n-\t\tinit: function() {\n-\t\t\tthis.updateCurrentUri();\n-\t\t\tvar that = this;\n-\t\t\tContentModule.on('pageLoaded', function() {\n-\t\t\t\tthat.updateCurrentUri();\n-\t\t\t});\n-\t\t},\n-\t\tupdateCurrentUri: function() {\n-\t\t\tthis.set('liveUri', location.href.replace(/@[A-Za-z0-9;&,\\-_=]+/g, ''));\n-\t\t}\n-\t});\n-});\n\\ No newline at end of file\n+  [\n+    'emberjs',\n+    './ContextBar',\n+    './ContentDimensionSelector',\n+    './ContentDimensionController',\n+    '../FullScreenController',\n+    '../Application',\n+    './TargetWorkspaceController',\n+    'Shared/Configuration',\n+    'text!./ContentContextBar.html'\n+  ], function (Ember,\n+               ContextBar,\n+               ContentDimensionSelector,\n+               ContentDimensionController,\n+               FullScreenController,\n+               ContentModule,\n+               TargetWorkspaceController,\n+               Configuration,\n+               template) {\n+    return ContextBar.extend({\n+      classNames: 'neos-content-context-bar',\n+      template: Ember.Handlebars.compile(template),\n+      ContentDimensionSelector: ContentDimensionSelector,\n+      contentDimensionController: ContentDimensionController,\n+      fullScreenController: FullScreenController,\n+      targetWorkspaceController: TargetWorkspaceController,\n+      Configuration: Configuration,\n+\n+      /**\n+       * Update the preview uri when the page is loaded (happens when navigating, switching\n+       * target workspace or changing content dimensions).\n+       */\n+      init: function () {\n+        var that = this;\n+        ContentModule.on('pageLoaded', function () {\n+          that.updatePreviewUri();\n+        });\n+      },\n+\n+      /**\n+       * Update the preview uri\n+       */\n+      updatePreviewUri: function () {\n+        var targetWorkspaceName = this.get('targetWorkspaceController.targetWorkspace.name');\n+        if (targetWorkspaceName === 'live') {\n+          this.set('previewUri', location.href.replace(/@[A-Za-z0-9;&,\\-_=]+/g, ''));\n+        } else {\n+          this.set('previewUri', location.href.replace(/@[A-Za-z0-9;&,\\-_=]+/g, '@' + targetWorkspaceName));\n+        }\n+      }.observes('targetWorkspaceController.targetWorkspace', 'contentDimensionController.selectedDimensions')","path":"TYPO3.Neos/Resources/Public/JavaScript/Content/Components/ContentContextBar.js","position":89,"original_position":89,"commit_id":"df7cd0735dd797504ca5acd05089bc9a2ff15afe","original_commit_id":"df7cd0735dd797504ca5acd05089bc9a2ff15afe","user":{"login":"kdambekalns","id":95873,"avatar_url":"https://avatars.githubusercontent.com/u/95873?v=3","gravatar_id":"","url":"https://api.github.com/users/kdambekalns","html_url":"https://github.com/kdambekalns","followers_url":"https://api.github.com/users/kdambekalns/followers","following_url":"https://api.github.com/users/kdambekalns/following{/other_user}","gists_url":"https://api.github.com/users/kdambekalns/gists{/gist_id}","starred_url":"https://api.github.com/users/kdambekalns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdambekalns/subscriptions","organizations_url":"https://api.github.com/users/kdambekalns/orgs","repos_url":"https://api.github.com/users/kdambekalns/repos","events_url":"https://api.github.com/users/kdambekalns/events{/privacy}","received_events_url":"https://api.github.com/users/kdambekalns/received_events","type":"User","site_admin":false},"body":" i tried listening to as little as possible, but this is all needed. Also, selectedDimensions has an influence, of course. Feel free to prove me wrong, but with less \"points to watch\" it breaks in some way or the other.","created_at":"2016-04-13T07:48:59Z","updated_at":"2016-04-13T07:48:59Z","html_url":"https://github.com/neos/neos-development-collection/pull/399#discussion_r59505948","pull_request_url":"https://api.github.com/repos/neos/neos-development-collection/pulls/399","_links":{"self":{"href":"https://api.github.com/repos/neos/neos-development-collection/pulls/comments/59505948"},"html":{"href":"https://github.com/neos/neos-development-collection/pull/399#discussion_r59505948"},"pull_request":{"href":"https://api.github.com/repos/neos/neos-development-collection/pulls/399"}}},"pull_request":{"url":"https://api.github.com/repos/neos/neos-development-collection/pulls/399","id":62887775,"html_url":"https://github.com/neos/neos-development-collection/pull/399","diff_url":"https://github.com/neos/neos-development-collection/pull/399.diff","patch_url":"https://github.com/neos/neos-development-collection/pull/399.patch","issue_url":"https://api.github.com/repos/neos/neos-development-collection/issues/399","number":399,"state":"open","locked":false,"title":"FEATURE: Preview in target workspace instead of live","user":{"login":"kdambekalns","id":95873,"avatar_url":"https://avatars.githubusercontent.com/u/95873?v=3","gravatar_id":"","url":"https://api.github.com/users/kdambekalns","html_url":"https://github.com/kdambekalns","followers_url":"https://api.github.com/users/kdambekalns/followers","following_url":"https://api.github.com/users/kdambekalns/following{/other_user}","gists_url":"https://api.github.com/users/kdambekalns/gists{/gist_id}","starred_url":"https://api.github.com/users/kdambekalns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdambekalns/subscriptions","organizations_url":"https://api.github.com/users/kdambekalns/orgs","repos_url":"https://api.github.com/users/kdambekalns/repos","events_url":"https://api.github.com/users/kdambekalns/events{/privacy}","received_events_url":"https://api.github.com/users/kdambekalns/received_events","type":"User","site_admin":false},"body":"The Neos UI has a button to preview the current page in the live\r\nworkspace. When using nested workspaces, this is not helpful, because\r\none usually wants to see the published state in the current target\r\nworkspace.\r\n\r\nSo this changes the preview to show the current target workspace\r\ninstead.","created_at":"2016-03-15T11:02:51Z","updated_at":"2016-04-13T07:48:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"40a3521c54454dadc5237fa93737d1c04eac985d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/neos/neos-development-collection/pulls/399/commits","review_comments_url":"https://api.github.com/repos/neos/neos-development-collection/pulls/399/comments","review_comment_url":"https://api.github.com/repos/neos/neos-development-collection/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neos/neos-development-collection/issues/399/comments","statuses_url":"https://api.github.com/repos/neos/neos-development-collection/statuses/df7cd0735dd797504ca5acd05089bc9a2ff15afe","head":{"label":"kdambekalns:preview-targetworkspace","ref":"preview-targetworkspace","sha":"df7cd0735dd797504ca5acd05089bc9a2ff15afe","user":{"login":"kdambekalns","id":95873,"avatar_url":"https://avatars.githubusercontent.com/u/95873?v=3","gravatar_id":"","url":"https://api.github.com/users/kdambekalns","html_url":"https://github.com/kdambekalns","followers_url":"https://api.github.com/users/kdambekalns/followers","following_url":"https://api.github.com/users/kdambekalns/following{/other_user}","gists_url":"https://api.github.com/users/kdambekalns/gists{/gist_id}","starred_url":"https://api.github.com/users/kdambekalns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdambekalns/subscriptions","organizations_url":"https://api.github.com/users/kdambekalns/orgs","repos_url":"https://api.github.com/users/kdambekalns/repos","events_url":"https://api.github.com/users/kdambekalns/events{/privacy}","received_events_url":"https://api.github.com/users/kdambekalns/received_events","type":"User","site_admin":false},"repo":{"id":41475597,"name":"neos-development-collection","full_name":"kdambekalns/neos-development-collection","owner":{"login":"kdambekalns","id":95873,"avatar_url":"https://avatars.githubusercontent.com/u/95873?v=3","gravatar_id":"","url":"https://api.github.com/users/kdambekalns","html_url":"https://github.com/kdambekalns","followers_url":"https://api.github.com/users/kdambekalns/followers","following_url":"https://api.github.com/users/kdambekalns/following{/other_user}","gists_url":"https://api.github.com/users/kdambekalns/gists{/gist_id}","starred_url":"https://api.github.com/users/kdambekalns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdambekalns/subscriptions","organizations_url":"https://api.github.com/users/kdambekalns/orgs","repos_url":"https://api.github.com/users/kdambekalns/repos","events_url":"https://api.github.com/users/kdambekalns/events{/privacy}","received_events_url":"https://api.github.com/users/kdambekalns/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kdambekalns/neos-development-collection","description":"The unified repository containing the Neos core packages, used for Neos development.","fork":true,"url":"https://api.github.com/repos/kdambekalns/neos-development-collection","forks_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/forks","keys_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/teams","hooks_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/hooks","issue_events_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/issues/events{/number}","events_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/events","assignees_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/assignees{/user}","branches_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/branches{/branch}","tags_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/tags","blobs_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/git/refs{/sha}","trees_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/statuses/{sha}","languages_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/languages","stargazers_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/stargazers","contributors_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/contributors","subscribers_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/subscribers","subscription_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/subscription","commits_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/commits{/sha}","git_commits_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/git/commits{/sha}","comments_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/comments{/number}","issue_comment_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/issues/comments{/number}","contents_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/contents/{+path}","compare_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/merges","archive_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/downloads","issues_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/issues{/number}","pulls_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/pulls{/number}","milestones_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/milestones{/number}","notifications_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/labels{/name}","releases_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/releases{/id}","deployments_url":"https://api.github.com/repos/kdambekalns/neos-development-collection/deployments","created_at":"2015-08-27T08:44:11Z","updated_at":"2016-01-12T18:01:19Z","pushed_at":"2016-04-12T10:33:20Z","git_url":"git://github.com/kdambekalns/neos-development-collection.git","ssh_url":"git@github.com:kdambekalns/neos-development-collection.git","clone_url":"https://github.com/kdambekalns/neos-development-collection.git","svn_url":"https://github.com/kdambekalns/neos-development-collection","homepage":null,"size":53135,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","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":"neos:master","ref":"master","sha":"13aa4538886d7a9bcb01c31fad34ad37e332f469","user":{"login":"neos","id":11575267,"avatar_url":"https://avatars.githubusercontent.com/u/11575267?v=3","gravatar_id":"","url":"https://api.github.com/users/neos","html_url":"https://github.com/neos","followers_url":"https://api.github.com/users/neos/followers","following_url":"https://api.github.com/users/neos/following{/other_user}","gists_url":"https://api.github.com/users/neos/gists{/gist_id}","starred_url":"https://api.github.com/users/neos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neos/subscriptions","organizations_url":"https://api.github.com/users/neos/orgs","repos_url":"https://api.github.com/users/neos/repos","events_url":"https://api.github.com/users/neos/events{/privacy}","received_events_url":"https://api.github.com/users/neos/received_events","type":"Organization","site_admin":false},"repo":{"id":40964014,"name":"neos-development-collection","full_name":"neos/neos-development-collection","owner":{"login":"neos","id":11575267,"avatar_url":"https://avatars.githubusercontent.com/u/11575267?v=3","gravatar_id":"","url":"https://api.github.com/users/neos","html_url":"https://github.com/neos","followers_url":"https://api.github.com/users/neos/followers","following_url":"https://api.github.com/users/neos/following{/other_user}","gists_url":"https://api.github.com/users/neos/gists{/gist_id}","starred_url":"https://api.github.com/users/neos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neos/subscriptions","organizations_url":"https://api.github.com/users/neos/orgs","repos_url":"https://api.github.com/users/neos/repos","events_url":"https://api.github.com/users/neos/events{/privacy}","received_events_url":"https://api.github.com/users/neos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neos/neos-development-collection","description":"The unified repository containing the Neos core packages, used for Neos development.","fork":false,"url":"https://api.github.com/repos/neos/neos-development-collection","forks_url":"https://api.github.com/repos/neos/neos-development-collection/forks","keys_url":"https://api.github.com/repos/neos/neos-development-collection/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neos/neos-development-collection/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neos/neos-development-collection/teams","hooks_url":"https://api.github.com/repos/neos/neos-development-collection/hooks","issue_events_url":"https://api.github.com/repos/neos/neos-development-collection/issues/events{/number}","events_url":"https://api.github.com/repos/neos/neos-development-collection/events","assignees_url":"https://api.github.com/repos/neos/neos-development-collection/assignees{/user}","branches_url":"https://api.github.com/repos/neos/neos-development-collection/branches{/branch}","tags_url":"https://api.github.com/repos/neos/neos-development-collection/tags","blobs_url":"https://api.github.com/repos/neos/neos-development-collection/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neos/neos-development-collection/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neos/neos-development-collection/git/refs{/sha}","trees_url":"https://api.github.com/repos/neos/neos-development-collection/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neos/neos-development-collection/statuses/{sha}","languages_url":"https://api.github.com/repos/neos/neos-development-collection/languages","stargazers_url":"https://api.github.com/repos/neos/neos-development-collection/stargazers","contributors_url":"https://api.github.com/repos/neos/neos-development-collection/contributors","subscribers_url":"https://api.github.com/repos/neos/neos-development-collection/subscribers","subscription_url":"https://api.github.com/repos/neos/neos-development-collection/subscription","commits_url":"https://api.github.com/repos/neos/neos-development-collection/commits{/sha}","git_commits_url":"https://api.github.com/repos/neos/neos-development-collection/git/commits{/sha}","comments_url":"https://api.github.com/repos/neos/neos-development-collection/comments{/number}","issue_comment_url":"https://api.github.com/repos/neos/neos-development-collection/issues/comments{/number}","contents_url":"https://api.github.com/repos/neos/neos-development-collection/contents/{+path}","compare_url":"https://api.github.com/repos/neos/neos-development-collection/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neos/neos-development-collection/merges","archive_url":"https://api.github.com/repos/neos/neos-development-collection/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neos/neos-development-collection/downloads","issues_url":"https://api.github.com/repos/neos/neos-development-collection/issues{/number}","pulls_url":"https://api.github.com/repos/neos/neos-development-collection/pulls{/number}","milestones_url":"https://api.github.com/repos/neos/neos-development-collection/milestones{/number}","notifications_url":"https://api.github.com/repos/neos/neos-development-collection/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neos/neos-development-collection/labels{/name}","releases_url":"https://api.github.com/repos/neos/neos-development-collection/releases{/id}","deployments_url":"https://api.github.com/repos/neos/neos-development-collection/deployments","created_at":"2015-08-18T09:48:35Z","updated_at":"2016-04-12T14:12:56Z","pushed_at":"2016-04-13T05:27:45Z","git_url":"git://github.com/neos/neos-development-collection.git","ssh_url":"git@github.com:neos/neos-development-collection.git","clone_url":"https://github.com/neos/neos-development-collection.git","svn_url":"https://github.com/neos/neos-development-collection","homepage":"https://www.neos.io/","size":67672,"stargazers_count":73,"watchers_count":73,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":59,"mirror_url":null,"open_issues_count":31,"forks":59,"open_issues":31,"watchers":73,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neos/neos-development-collection/pulls/399"},"html":{"href":"https://github.com/neos/neos-development-collection/pull/399"},"issue":{"href":"https://api.github.com/repos/neos/neos-development-collection/issues/399"},"comments":{"href":"https://api.github.com/repos/neos/neos-development-collection/issues/399/comments"},"review_comments":{"href":"https://api.github.com/repos/neos/neos-development-collection/pulls/399/comments"},"review_comment":{"href":"https://api.github.com/repos/neos/neos-development-collection/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neos/neos-development-collection/pulls/399/commits"},"statuses":{"href":"https://api.github.com/repos/neos/neos-development-collection/statuses/df7cd0735dd797504ca5acd05089bc9a2ff15afe"}}}}