Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android browser develop #97

Merged
merged 6 commits into from Aug 6, 2018
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Add the license header to all the new files
  • Loading branch information
mai-cliqz committed Jul 20, 2018
commit 74dbcae99cd197cb0c4dc10c5a34c6e63fab675b
@@ -1,4 +1,17 @@
import { sendMessageInPromise } from '../utils/msg';
/**
* Cliqz Action creators
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import { sendMessageInPromise } from '../../panel/utils/msg';

export function getCliqzModuleData(tabId) {
return sendMessageInPromise('getCliqzModuleData', {
@@ -1,3 +1,16 @@
/**
* All Action handlers
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import { handleTrustButtonClick, handleRestrictButtonClick, handlePauseButtonClick, cliqzFeatureToggle } from './summaryActions';
import { trustRestrictBlockSiteTracker, blockUnblockGlobalTracker, blockUnBlockAllTrackers, resetSettings } from './trackerActions';

@@ -1,4 +1,17 @@
import { sendMessageInPromise } from '../utils/msg';
/**
* Panel Action creators
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import { sendMessageInPromise } from '../../panel/utils/msg';

export function getPanelData(tabId) {
return sendMessageInPromise('getPanelData', {
@@ -1,5 +1,18 @@
import { sendMessage } from '../utils/msg';
import { addToArray, removeFromArray } from '../utils/utils';
/**
* Summary Action creators
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import { sendMessage } from '../../panel/utils/msg';
import { addToArray, removeFromArray } from '../../panel/utils/utils';

function getPageHostFromSummary(summary) {
return summary.pageHost.toLowerCase().replace(/^(http[s]?:\/\/)?(www\.)?/, '');
@@ -1,5 +1,18 @@
import { sendMessage } from '../utils/msg';
import { updateObject } from '../utils/utils';
/**
* Tracker Action creators
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import { sendMessage } from '../../panel/utils/msg';
import { updateObject } from '../../panel/utils/utils';
import { resetTrustRestrictPause } from './summaryActions';

function trustRestrictTracker({
@@ -1,3 +1,16 @@
/**
* Global Trackers Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';
import Accordions from './content/Accordions';
@@ -1,3 +1,16 @@
/**
* Overview Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';
import TrackersChart from './content/TrackersChart';
@@ -1,3 +1,16 @@
/**
* Panel Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';
import URLSearchParams from 'url-search-params';
@@ -1,3 +1,16 @@
/**
* Site Trackers Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';
import Accordions from './content/Accordions';
@@ -1,3 +1,16 @@
/**
* Accordion Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';

@@ -1,3 +1,16 @@
/**
* Accordions Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';

@@ -1,3 +1,16 @@
/**
* ChartSVG Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';
import Path from './Path';
@@ -1,3 +1,16 @@
/**
* DotsMenu Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';

@@ -1,3 +1,16 @@
/**
* FixedMenu Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';
import MenuItem from './MenuItem';
@@ -1,3 +1,16 @@
/**
* MenuItem Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';

@@ -1,3 +1,16 @@
/**
* Path Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';

@@ -1,3 +1,16 @@
/**
* Tab Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';

@@ -1,3 +1,16 @@
/**
* Tabs Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';
import Tab from './Tab';
@@ -21,17 +34,13 @@ export default class Tabs extends React.Component {
});
}

// Encapsulate <Tabs/> component API as props for <Tab/> children
renderChildrenWithTabsApiAsProps() {
return React.Children.map(this.props.children, (child, index) => React.cloneElement(child, {
onClick: this.handleTabClick,
tabIndex: index,
isActive: index === this.state.activeTabIndex
}));
}
renderTabsNav = () => React.Children.map(this.props.children, (child, index) => React.cloneElement(child, {
onClick: this.handleTabClick,
tabIndex: index,
isActive: index === this.state.activeTabIndex
}));

// Render current active tab content
renderActiveTabContent() {
renderActiveTabContent = () => {
const { children } = this.props;
const { activeTabIndex } = this.state;
if (children[activeTabIndex]) {
@@ -44,7 +53,7 @@ export default class Tabs extends React.Component {
return (
<div className="tabs-wrapper">
<ul className="tabs-nav">
{this.renderChildrenWithTabsApiAsProps()}
{this.renderTabsNav()}
</ul>
<div className="tabs-active-content">
{this.renderActiveTabContent()}
@@ -1,3 +1,16 @@
/**
* TrackerItem Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';
import getUrlFromTrackerId from '../../utils/tracker-info';
@@ -1,3 +1,16 @@
/**
* TrackersChart Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2018 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';
import ChartSVG from './ChartSVG';
@@ -11,7 +11,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/
/**
* @namespace PanelAndroidUIClasses
* @namespace PanelAndroidClasses
*/
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
ProTip! Use n and p to navigate between commits in a pull request.