Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/ui.js

Issue 9251039: Get rid of nested functions declarations that are not on top level (causes strict mode warnings) (Closed)
Patch Set: Created Jan. 23, 2013, 12:52 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/typoAppIntegration.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of the Adblock Plus, 2 * This file is part of the Adblock Plus,
3 * Copyright (C) 2006-2012 Eyeo GmbH 3 * Copyright (C) 2006-2012 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1709 if (wnd.frameElement) 1709 if (wnd.frameElement)
1710 { 1710 {
1711 let data = RequestNotifier.getDataForNode(wnd.frameElement, true); 1711 let data = RequestNotifier.getDataForNode(wnd.frameElement, true);
1712 if (data && !data[1].filter) 1712 if (data && !data[1].filter)
1713 addMenuItem(data); 1713 addMenuItem(data);
1714 } 1714 }
1715 1715
1716 // Look for a background image 1716 // Look for a background image
1717 if (!hadImage) 1717 if (!hadImage)
1718 { 1718 {
1719 function extractImageURL(computedStyle, property) 1719 let extractImageURL = function(computedStyle, property)
1720 { 1720 {
1721 let value = computedStyle.getPropertyCSSValue(property); 1721 let value = computedStyle.getPropertyCSSValue(property);
1722 // CSSValueList 1722 // CSSValueList
1723 if ("length" in value && value.length >= 1) 1723 if ("length" in value && value.length >= 1)
1724 value = value[0]; 1724 value = value[0];
1725 // CSSValuePrimitiveType 1725 // CSSValuePrimitiveType
1726 if ("primitiveType" in value && value.primitiveType == value.CSS_URI) 1726 if ("primitiveType" in value && value.primitiveType == value.CSS_URI)
1727 return Utils.unwrapURL(value.getStringValue()).spec; 1727 return Utils.unwrapURL(value.getStringValue()).spec;
1728 1728
1729 return null; 1729 return null;
1730 } 1730 };
1731 1731
1732 let node = target; 1732 let node = target;
1733 while (node) 1733 while (node)
1734 { 1734 {
1735 if (node.nodeType == Ci.nsIDOMNode.ELEMENT_NODE) 1735 if (node.nodeType == Ci.nsIDOMNode.ELEMENT_NODE)
1736 { 1736 {
1737 let style = wnd.getComputedStyle(node, ""); 1737 let style = wnd.getComputedStyle(node, "");
1738 let bgImage = extractImageURL(style, "background-image") || extractIma geURL(style, "list-style-image"); 1738 let bgImage = extractImageURL(style, "background-image") || extractIma geURL(style, "list-style-image");
1739 if (bgImage) 1739 if (bgImage)
1740 { 1740 {
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], 1930 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)],
1931 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] 1931 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)]
1932 ]; 1932 ];
1933 1933
1934 onShutdown.add(function() 1934 onShutdown.add(function()
1935 { 1935 {
1936 for (let window in UI.applicationWindows) 1936 for (let window in UI.applicationWindows)
1937 if (UI.isBottombarOpen(window)) 1937 if (UI.isBottombarOpen(window))
1938 UI.toggleBottombar(window); 1938 UI.toggleBottombar(window);
1939 }); 1939 });
OLDNEW
« no previous file with comments | « lib/typoAppIntegration.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld