{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/pulls/comments/50680308","id":50680308,"diff_hunk":"@@ -0,0 +1,197 @@\n+/*\n+ * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n+ *\n+ * WSO2 Inc. licenses this file to you under the Apache License,\n+ * Version 2.0 (the \"License\"); you may not use this file except\n+ * in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\n+ * either express or implied. See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+\n+(function () {\n+    var deviceId = $(\".device-id\");\n+    var deviceIdentifier = deviceId.data(\"deviceid\");\n+    var deviceType = deviceId.data(\"type\");\n+    var payload = [deviceIdentifier];\n+    var operationTable;\n+    if (deviceType == \"ios\") {\n+        var serviceUrl = \"/ios/operation/deviceinfo\";\n+    } else if (deviceType == \"android\") {\n+        var serviceUrl = \"/mdm-android-agent/operation/device-info\";\n+    }\n+    if(serviceUrl){\n+        invokerUtil.post(serviceUrl, payload,\n+            function(message){\n+                console.log(message);\n+            }, function (message) {\n+                console.log(message);\n+            });\n+    }\n+    $(document).ready(function(){\n+        $(\".panel-body\").removeClass(\"hidden\");\n+        $(\"#loading-content\").remove();\n+        loadOperationBar(deviceType);\n+        loadOperationsLog();\n+        loadApplicationsList();\n+        loadPolicyCompliance();\n+\n+        $(\"#refresh-policy\").click(function () {\n+            $('#policy-spinner').removeClass('hidden');\n+            loadPolicyCompliance();\n+        });\n+\n+        $(\"#refresh-apps\").click(function () {\n+            $('#apps-spinner').removeClass('hidden');\n+            loadApplicationsList();\n+        });\n+\n+        $(\"#refresh-operations\").click(function () {\n+            $('#operations-spinner').removeClass('hidden');\n+            loadOperationsLog(true);\n+        });\n+\n+    });\n+\n+    function loadOperationsLog(update) {\n+        var operationsLog = $(\"#operations-log\");\n+        var deviceListingSrc = operationsLog.attr(\"src\");\n+        var deviceId = operationsLog.data(\"device-id\");\n+        var deviceType = operationsLog.data(\"device-type\");\n+\n+        $.template(\"operations-log\", deviceListingSrc, function (template) {\n+            var serviceURL = \"/devicemgt_admin/operations/\"+deviceType+\"/\"+deviceId;\n+\n+            var successCallback = function (data) {\n+                data = JSON.parse(data);\n+                $('#operations-spinner').addClass('hidden');\n+                var viewModel = {};\n+                viewModel.operations = data;\n+                if(data.length > 0){","path":"features/device-mgt-iot-virtualfirealarm-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view/public/js/device-detail.js","position":77,"original_position":77,"commit_id":"c1a64238889aa52b87683ee3edf54b70eaeee39e","original_commit_id":"c1a64238889aa52b87683ee3edf54b70eaeee39e","user":{"login":"harshanL","id":6368301,"avatar_url":"https://avatars.githubusercontent.com/u/6368301?v=3","gravatar_id":"","url":"https://api.github.com/users/harshanL","html_url":"https://github.com/harshanL","followers_url":"https://api.github.com/users/harshanL/followers","following_url":"https://api.github.com/users/harshanL/following{/other_user}","gists_url":"https://api.github.com/users/harshanL/gists{/gist_id}","starred_url":"https://api.github.com/users/harshanL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harshanL/subscriptions","organizations_url":"https://api.github.com/users/harshanL/orgs","repos_url":"https://api.github.com/users/harshanL/repos","events_url":"https://api.github.com/users/harshanL/events{/privacy}","received_events_url":"https://api.github.com/users/harshanL/received_events","type":"User","site_admin":false},"body":"Check the formatting in this if block.","created_at":"2016-01-25T11:05:00Z","updated_at":"2016-01-25T11:05:00Z","html_url":"https://github.com/wso2/carbon-device-mgt-plugins/pull/29#discussion_r50680308","pull_request_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/pulls/comments/50680308"},"html":{"href":"https://github.com/wso2/carbon-device-mgt-plugins/pull/29#discussion_r50680308"},"pull_request":{"href":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/pulls/29","id":53254742,"html_url":"https://github.com/wso2/carbon-device-mgt-plugins/pull/29","diff_url":"https://github.com/wso2/carbon-device-mgt-plugins/pull/29.diff","patch_url":"https://github.com/wso2/carbon-device-mgt-plugins/pull/29.patch","issue_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/issues/29","number":29,"state":"closed","locked":false,"title":"adding device type specific units","user":{"login":"rasika90","id":1448489,"avatar_url":"https://avatars.githubusercontent.com/u/1448489?v=3","gravatar_id":"","url":"https://api.github.com/users/rasika90","html_url":"https://github.com/rasika90","followers_url":"https://api.github.com/users/rasika90/followers","following_url":"https://api.github.com/users/rasika90/following{/other_user}","gists_url":"https://api.github.com/users/rasika90/gists{/gist_id}","starred_url":"https://api.github.com/users/rasika90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasika90/subscriptions","organizations_url":"https://api.github.com/users/rasika90/orgs","repos_url":"https://api.github.com/users/rasika90/repos","events_url":"https://api.github.com/users/rasika90/events{/privacy}","received_events_url":"https://api.github.com/users/rasika90/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-10T12:55:14Z","updated_at":"2016-01-25T11:05:00Z","closed_at":"2015-12-10T12:57:00Z","merged_at":"2015-12-10T12:57:00Z","merge_commit_sha":"2bf24c4363dbc4dad41de4706694e19b1e0750ed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/pulls/29/commits","review_comments_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/pulls/29/comments","review_comment_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/issues/29/comments","statuses_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/statuses/c1a64238889aa52b87683ee3edf54b70eaeee39e","head":{"label":"rasika90:IoTS-1.0.0-M1","ref":"IoTS-1.0.0-M1","sha":"c1a64238889aa52b87683ee3edf54b70eaeee39e","user":{"login":"rasika90","id":1448489,"avatar_url":"https://avatars.githubusercontent.com/u/1448489?v=3","gravatar_id":"","url":"https://api.github.com/users/rasika90","html_url":"https://github.com/rasika90","followers_url":"https://api.github.com/users/rasika90/followers","following_url":"https://api.github.com/users/rasika90/following{/other_user}","gists_url":"https://api.github.com/users/rasika90/gists{/gist_id}","starred_url":"https://api.github.com/users/rasika90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasika90/subscriptions","organizations_url":"https://api.github.com/users/rasika90/orgs","repos_url":"https://api.github.com/users/rasika90/repos","events_url":"https://api.github.com/users/rasika90/events{/privacy}","received_events_url":"https://api.github.com/users/rasika90/received_events","type":"User","site_admin":false},"repo":{"id":47752213,"name":"carbon-device-mgt-plugins","full_name":"rasika90/carbon-device-mgt-plugins","owner":{"login":"rasika90","id":1448489,"avatar_url":"https://avatars.githubusercontent.com/u/1448489?v=3","gravatar_id":"","url":"https://api.github.com/users/rasika90","html_url":"https://github.com/rasika90","followers_url":"https://api.github.com/users/rasika90/followers","following_url":"https://api.github.com/users/rasika90/following{/other_user}","gists_url":"https://api.github.com/users/rasika90/gists{/gist_id}","starred_url":"https://api.github.com/users/rasika90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasika90/subscriptions","organizations_url":"https://api.github.com/users/rasika90/orgs","repos_url":"https://api.github.com/users/rasika90/repos","events_url":"https://api.github.com/users/rasika90/events{/privacy}","received_events_url":"https://api.github.com/users/rasika90/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rasika90/carbon-device-mgt-plugins","description":"","fork":true,"url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins","forks_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/forks","keys_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/teams","hooks_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/hooks","issue_events_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/events","assignees_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/tags","blobs_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/languages","stargazers_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/stargazers","contributors_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/contributors","subscribers_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/subscribers","subscription_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/subscription","commits_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/merges","archive_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/downloads","issues_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/labels{/name}","releases_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/rasika90/carbon-device-mgt-plugins/deployments","created_at":"2015-12-10T09:40:40Z","updated_at":"2015-12-10T09:40:41Z","pushed_at":"2016-01-20T17:05:50Z","git_url":"git://github.com/rasika90/carbon-device-mgt-plugins.git","ssh_url":"git@github.com:rasika90/carbon-device-mgt-plugins.git","clone_url":"https://github.com/rasika90/carbon-device-mgt-plugins.git","svn_url":"https://github.com/rasika90/carbon-device-mgt-plugins","homepage":null,"size":66362,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"wso2:IoTS-1.0.0-M1","ref":"IoTS-1.0.0-M1","sha":"e4296b301be6decfeb0553a44267ae236818d3d1","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":30521516,"name":"carbon-device-mgt-plugins","full_name":"wso2/carbon-device-mgt-plugins","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/carbon-device-mgt-plugins","description":"","fork":false,"url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins","forks_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/forks","keys_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/teams","hooks_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/hooks","issue_events_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/events","assignees_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/tags","blobs_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/languages","stargazers_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/stargazers","contributors_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/contributors","subscribers_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/subscribers","subscription_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/subscription","commits_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/merges","archive_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/downloads","issues_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/labels{/name}","releases_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/deployments","created_at":"2015-02-09T06:12:40Z","updated_at":"2015-10-29T05:24:20Z","pushed_at":"2016-01-25T09:17:07Z","git_url":"git://github.com/wso2/carbon-device-mgt-plugins.git","ssh_url":"git@github.com:wso2/carbon-device-mgt-plugins.git","clone_url":"https://github.com/wso2/carbon-device-mgt-plugins.git","svn_url":"https://github.com/wso2/carbon-device-mgt-plugins","homepage":null,"size":66991,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":2,"forks":21,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/pulls/29"},"html":{"href":"https://github.com/wso2/carbon-device-mgt-plugins/pull/29"},"issue":{"href":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/issues/29"},"comments":{"href":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/carbon-device-mgt-plugins/statuses/c1a64238889aa52b87683ee3edf54b70eaeee39e"}}}}