GitHub PullRequestReviewCommentEvent at 2014-03-13 17:06:53
Repository: avocet-ui
Actor: nicolaasmatthijs
Payload: {"comment":{"url":"https://api.github.com/repos/CUL-DigitalServices/avocet-ui/pulls/comments/10574454","id":10574454,"diff_hunk":"@@ -0,0 +1,192 @@\n+/*!\n+ * Copyright 2014 Digital Services, University of Cambridge Licensed\n+ * under the Educational Community License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance with the\n+ * License. You may obtain a copy of the License at\n+ *\n+ *     http://opensource.org/licenses/ECL-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an \"AS IS\"\n+ * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n+ * or implied. See the License for the specific language governing\n+ * permissions and limitations under the License.\n+ */\n+\n+define(['jquery', 'oae.core', 'jquery.fileupload', 'jquery.iframe-transport'], function($, oae) {\n+\n+    return function(uid) {\n+        var $rootel = $('#' + uid);\n+\n+        var $upload = $('#oa-submitpublication-upload', $rootel);\n+        var $form = $('#oa-submitpublication-form', $rootel);\n+        var $progress = $('#oa-submitpublication-upload-progress-container', $rootel);\n+\n+        // This variable will hold the file which the user selects to upload\n+        var selectedFile;\n+        // The configured default for the visibility of files\n+        var visibility = oae.api.config.getValue('oae-content', 'visibility', 'files');\n+        // Object to store all main parts of the submission process of which only one can be shown at a time\n+        var parts = {\n+            'form': $form,\n+            'progress': $progress,\n+            'upload': $upload\n+        };\n+\n+        /**\n+         * Shows the HTML responsible for a provided part of the submission process, hides all others.\n+         *\n+         * @param  {String}   toActivate     The part which should be activated\n+         */\n+        var activatePart = function(toShow) {\n+            _.invoke(parts, $.fn.hide);\n+            if (parts[toShow]) parts[toShow].show();","path":"node_modules/oae-avocet/submitpublication/js/submitpublication.js","position":43,"original_position":43,"commit_id":"a3fafbbe75a7f9b546ed17b0d13a05c59f371aca","original_commit_id":"a3fafbbe75a7f9b546ed17b0d13a05c59f371aca","user":{"login":"nicolaasmatthijs","id":109850,"avatar_url":"https://gravatar.com/avatar/8d128e44d86f7ea45534291c2c36599a?d=https%3A%2F%2Fidenticons.github.com%2Fae2c1ed2f46365c9f19f06fa3c038cc4.png&r=x","gravatar_id":"8d128e44d86f7ea45534291c2c36599a","url":"https://api.github.com/users/nicolaasmatthijs","html_url":"https://github.com/nicolaasmatthijs","followers_url":"https://api.github.com/users/nicolaasmatthijs/followers","following_url":"https://api.github.com/users/nicolaasmatthijs/following{/other_user}","gists_url":"https://api.github.com/users/nicolaasmatthijs/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolaasmatthijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolaasmatthijs/subscriptions","organizations_url":"https://api.github.com/users/nicolaasmatthijs/orgs","repos_url":"https://api.github.com/users/nicolaasmatthijs/repos","events_url":"https://api.github.com/users/nicolaasmatthijs/events{/privacy}","received_events_url":"https://api.github.com/users/nicolaasmatthijs/received_events","type":"User","site_admin":false},"body":"We should never do one line ifs","created_at":"2014-03-13T17:06:53Z","updated_at":"2014-03-13T17:06:53Z","html_url":"https://github.com/CUL-DigitalServices/avocet-ui/pull/6#discussion_r10574454","pull_request_url":"https://api.github.com/repos/CUL-DigitalServices/avocet-ui/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/CUL-DigitalServices/avocet-ui/pulls/comments/10574454"},"html":{"href":"https://github.com/CUL-DigitalServices/avocet-ui/pull/6#discussion_r10574454"},"pull_request":{"href":"https://api.github.com/repos/CUL-DigitalServices/avocet-ui/pulls/6"}}}}