GitHub PullRequestReviewCommentEvent at 2014-02-05 08:06:51
Repository: WebODF
Actor: peitschie
Payload: {"comment":{"url":"https://api.github.com/repos/kogmbh/WebODF/pulls/comments/9453104","id":9453104,"diff_hunk":"@@ -368,6 +384,57 @@ runtime.loadClass(\"odf.OdfNodeFilter\");\n \n         // private functions\n         /**\n+         * Iterates through the subtree of rootElement and adds annotation-end\n+         * elements as direct properties of the corresponding annotation elements.\n+         * Expects properly used annotation elements, does not try\n+         * to do heuristic fixes or drop broken elements.\n+         * @param {!Element} rootElement\n+         * @return {undefined}\n+         */\n+        function linkAnnotationStartAndEndElements(rootElement) {\n+            var document = rootElement.ownerDocument,\n+                /** @type {!Object.<!string,!Element>} */\n+                annotationStarts = {},\n+                n, name, annotationStart,\n+                // TODO: optimize by using a filter rejecting subtrees without annotations possible\n+                nodeIterator = document.createNodeIterator(rootElement, NodeFilter.SHOW_ELEMENT, null, false);\n+\n+            n = /**@type{?Element}*/(nodeIterator.nextNode());\n+            while (n) {\n+                if (n.namespaceURI === officens) {\n+                    if (n.localName === \"annotation\") {\n+                        name = n.getAttributeNS(officens, 'name');\n+                        if (name) {\n+                            if (annotationStarts.hasOwnProperty(name)) {\n+                                runtime.log(\"Warning: annotation name used more than once with <office:annotation/>: '\" + name + \"'\");","path":"webodf/lib/odf/OdfContainer.js","position":49,"original_position":49,"commit_id":"fd3ce6aa52bd413c2a711ebd8dd39d13998f4747","original_commit_id":"fd3ce6aa52bd413c2a711ebd8dd39d13998f4747","user":{"login":"peitschie","id":1052079,"avatar_url":"https://gravatar.com/avatar/70426f4264cf967a2b2215b73a625717?d=https%3A%2F%2Fidenticons.github.com%2F0b93fa4e7e5d9274897b0b7617129147.png&r=x","gravatar_id":"70426f4264cf967a2b2215b73a625717","url":"https://api.github.com/users/peitschie","html_url":"https://github.com/peitschie","followers_url":"https://api.github.com/users/peitschie/followers","following_url":"https://api.github.com/users/peitschie/following{/other_user}","gists_url":"https://api.github.com/users/peitschie/gists{/gist_id}","starred_url":"https://api.github.com/users/peitschie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peitschie/subscriptions","organizations_url":"https://api.github.com/users/peitschie/orgs","repos_url":"https://api.github.com/users/peitschie/repos","events_url":"https://api.github.com/users/peitschie/events{/privacy}","received_events_url":"https://api.github.com/users/peitschie/received_events","type":"User","site_admin":false},"body":"Technically, runtime.log(..) can take a category as a first argument. No-one else uses it, but perhaps you could be the first?","created_at":"2014-02-05T08:06:51Z","updated_at":"2014-02-05T08:06:51Z","html_url":"https://github.com/kogmbh/WebODF/pull/359#discussion_r9453104","pull_request_url":"https://api.github.com/repos/kogmbh/WebODF/pulls/359","_links":{"self":{"href":"https://api.github.com/repos/kogmbh/WebODF/pulls/comments/9453104"},"html":{"href":"https://github.com/kogmbh/WebODF/pull/359#discussion_r9453104"},"pull_request":{"href":"https://api.github.com/repos/kogmbh/WebODF/pulls/359"}}}}