Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Commit

Permalink
added ga event for language changes (#294)
Browse files Browse the repository at this point in the history
* added ga event for language changes.
* remove instagram link, made cordova links all https because they were broken
* fixed a few more http links to be https
  • Loading branch information
purplecabbage committed Aug 10, 2018
1 parent 6e36caa commit 45a0f77
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 40 deletions.
55 changes: 28 additions & 27 deletions assets/scripts/main.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
function getBaseUrl(urlString) {
return urlString.replace(/https?:\/\//i, '').split('/')[0];
return urlString.replace(/https?:\/\//i, '').split('/')[0];
}


document.addEventListener('DOMContentLoaded', function(event) {
var toggleButton = Sizzle('.mobile-docs-toggle')[0];
var sidebar = Sizzle ('aside.sidebar')[0];
var body = Sizzle ('body')[0];
document.addEventListener('DOMContentLoaded', function (event) {
var toggleButton = Sizzle('.mobile-docs-toggle')[0];
var sidebar = Sizzle('aside.sidebar')[0];
var body = Sizzle('body')[0];

toggleButton.addEventListener("click", function(e){
sidebar.classList.toggle('open');
body.classList.toggle('menu-open');
});
toggleButton.addEventListener("click", function (e) {
sidebar.classList.toggle('open');
body.classList.toggle('menu-open');
});

var languageSelect = Sizzle('#language-select')[0];
var currentUrl = window.location.href;
var urlArray = currentUrl.replace(/https?:\/\//i, '').split('/');
for (i = 0; i < languageSelect.children.length; i++) {
var option = languageSelect.children[i];
if (getBaseUrl(currentUrl) === getBaseUrl(option.value)) {
languageSelect.selectedIndex = i;
var languageSelect = Sizzle('#language-select')[0];
var currentUrl = window.location.href;
var urlArray = currentUrl.replace(/https?:\/\//i, '').split('/');
for (i = 0; i < languageSelect.children.length; i++) {
var option = languageSelect.children[i];
if (getBaseUrl(currentUrl) === getBaseUrl(option.value)) {
languageSelect.selectedIndex = i;
}
}
}

languageSelect.addEventListener("change", function(e){
urlArray.shift();
var newUrl = e.target.value + urlArray.join('/');
window.location = newUrl;
});
/*function resize() {
if (window.innerWidth>=820 && sidebar.classList.contains('open'))
sidebar.classList.toggle('open');
}
window.addEventListener("resize", resize);*/
languageSelect.addEventListener("change", function (e) {
ga('send','event','languageChange',e.target.value,languageSelect.options[languageSelect.selectedIndex].text);
urlArray.shift();
var newUrl = e.target.value + urlArray.join('/');
window.location = newUrl;
});
/*function resize() {
if (window.innerWidth>=820 && sidebar.classList.contains('open'))
sidebar.classList.toggle('open');
}
window.addEventListener("resize", resize);*/
});
2 changes: 1 addition & 1 deletion docs/1-getting-started/1-install-phonegap/2-cli.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The PhoneGap CLI provides a command line interface for creating PhoneGap apps as

There are a few simple requirements you'll need prior to installing the PhoneGap CLI:

- [node.js](http://nodejs.org/) - a JavaScript runtime to build your JavaScript code
- [node.js](https://nodejs.org/) - a JavaScript runtime to build your JavaScript code
- [git](http://git-scm.com) - used in the background by the CLI to download assets. It comes pre-installed on some operating systems.

To see if you already have it installed, type `git` from the command line.
Expand Down
2 changes: 1 addition & 1 deletion docs/2-tutorials/2-develop/1-embed-webview/1-ios.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ When an error results, you will likely want to pass a message or object back ind
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Arg was null"];
```

For a list of the different result types, see [this doc](http://cordova.apache.org/docs/en/edge/guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide).
For a list of the different result types, see [this doc](https://cordova.apache.org/docs/en/edge/guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide).

### Create a Cordova Plugin

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ This tutorial will show you how to add PhoneGap/Cordova support to an existing A

### Set up PhoneGap/Cordova in your project

* Make sure you have [NodeJS](https://nodejs.org) installed. If you already have [NodeJS](https://nodejs.org) installed make sure you `npm install -g plugman`
* Make sure you have [NodeJS](https://nodejs.org) installed. If you already have NodeJS installed make sure you `npm install -g plugman`
* Go to **Android Studio** > `Preferences` > `Plugins` and click on _Browse Repositories_ button.
* Search for `PhoneGap` and install it. Make sure you don't install the **PhoneGap/Cordova Plugin**
* Restart **Android Studio**
Expand Down
2 changes: 1 addition & 1 deletion docs/3-references/0-index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ layout: subpage
<li>[Plugin APIs](plugin-apis)</li>
</ul>

If you're looking for information on the Cordova CLI or specific Cordova configuration, you should refer to the [Official Apache Cordova Documentation](http://cordova.apache.org/docs/en/latest/).
If you're looking for information on the Cordova CLI or specific Cordova configuration, you should refer to the [Official Apache Cordova Documentation](https://cordova.apache.org/docs/en/latest/).
2 changes: 1 addition & 1 deletion docs/3-references/developer-app/5-debugging.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ more complete control over your debugging environment you should plan to use the

You can run weinre on your local machine and use it to debug your application being served from either the PhoneGap Desktop App or the PhoneGap CLI.

1. Install weinre using npm (requires [Node.js](http://nodejs.org))
1. Install weinre using npm (requires [Node.js](https://nodejs.org))

```sh
$ sudo npm install -g weinre
Expand Down
2 changes: 1 addition & 1 deletion docs/3-references/phonegap-cli/0-index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ The sections covered in this reference include:
- [Sending Push Notifications](/references/phonegap-cli/push)

<div class="alert--info">**NOTE:** The PhoneGap CLI is built as a layer on top of the Apache Cordova CLI, so any command that can be used in Cordova
is also supported by the PhoneGap CLI. This guide will detail the *additional* features that distinguish the PhoneGap CLI from the Cordova CLI and should be used along with the [Cordova CLI Reference](http://cordova.apache.org/docs/en/edge/index.html). For more details on the difference between PhoneGap and Apache Cordova, check out [this page](/getting-started/5-going-further).</div>
is also supported by the PhoneGap CLI. This guide will detail the *additional* features that distinguish the PhoneGap CLI from the Cordova CLI and should be used along with the [Cordova CLI Reference](https://cordova.apache.org/docs/en/edge/index.html). For more details on the difference between PhoneGap and Apache Cordova, check out [this page](/getting-started/5-going-further).</div>
4 changes: 2 additions & 2 deletions docs/3-references/phonegap-cli/1-install.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ layout: subpage

There are a few basic requirements you'll need prior to installing the PhoneGap CLI:

- [Node.js](http://nodejs.org/) - a JavaScript runtime to build your JavaScript code
- [Node.js](https://nodejs.org/) - a JavaScript runtime to build your JavaScript code
- [git](http://git-scm.com) - used in the background by the CLI to download assets. It comes pre-installed on some operating systems. You can check if it's already installed by typing `git` from the command line.

## Install via npm
Expand Down Expand Up @@ -47,6 +47,6 @@ Use the PhoneGap CLI to create and configure your apps locally, then build and p

### 3 - Standalone

The PhoneGap CLI can be used to do everything from creating your apps to packaging them for distribution. To build, run and package apps for multiple platforms you'll need to install some additional SDK's and/or tools for the platforms you wish to target. Refer to the [Cordova Platform Guides](http://cordova.apache.org/docs/en/edge/index.html) for details on how to proceed for each platform.
The PhoneGap CLI can be used to do everything from creating your apps to packaging them for distribution. To build, run and package apps for multiple platforms you'll need to install some additional SDK's and/or tools for the platforms you wish to target. Refer to the [Cordova Platform Guides](https://cordova.apache.org/docs/en/edge/index.html) for details on how to proceed for each platform.

<div class="alert--tip">**TIP:** If you're developing for iOS on a Mac, you may want to install the [ios-sim](https://github.com/phonegap/ios-sim#installation) iOS simulator to emulate easily from the command line rather than going into Xcode.</div>
2 changes: 1 addition & 1 deletion docs/3-references/plugin-apis.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ The most current version of the Cordova Core Plugin APIs are found in their resp

## General Plugin Discovery

You can also find a full directory of Cordova Plugins on the [Cordova Plugin page](http://cordova.apache.org/plugins/)
You can also find a full directory of Cordova Plugins on the [Cordova Plugin page](https://cordova.apache.org/plugins/)
4 changes: 2 additions & 2 deletions docs/4-phonegap-build/2-configuring/0-index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PhoneGap applications are configured using a `config.xml` file. This should be a

The `config.xml` file follows the [W3C widget specification](http://www.w3.org/TR/widgets/). It allows developers to easily specify metadata about their applications. You can see a sample `config.xml` with our [PhoneGap Start](https://github.com/phonegap/phonegap-start/blob/master/www/config.xml) application.

We're continually adding features to our `config.xml` support to give PhoneGap Build developers more power to customize their apps. If there are any specific features you'd like to see support for, [please let us know](http://forums.adobe.com/community/phonegap/build).
We're continually adding features to our `config.xml` support to give PhoneGap Build developers more power to customize their apps. If there are any specific features you'd like to see support for, [please let us know](https://forums.adobe.com/community/phonegap/build).

1. [Essential Properties](#props)
1. [Example config.xml](#example)
Expand Down Expand Up @@ -60,7 +60,7 @@ You can have zero or more of these elements present in your <code>config.xml</co
<platform name="winphone" />
```

All of the above fields are standard Cordova config.xml tags. For more detailed info about the above elements, and all the others available, see [the Cordova config.xml documentation](http://cordova.apache.org/docs/en/latest/config_ref/index.html). Most of these will work on PhoneGap Build, but if you face issues with any specific tags, [let us know](https://forums.adobe.com/community/phonegap/build).
All of the above fields are standard Cordova config.xml tags. For more detailed info about the above elements, and all the others available, see [the Cordova config.xml documentation](https://cordova.apache.org/docs/en/latest/config_ref/index.html). Most of these will work on PhoneGap Build, but if you face issues with any specific tags, [let us know](https://forums.adobe.com/community/phonegap/build).

<a class="anchor" id="example"></a>

Expand Down
2 changes: 1 addition & 1 deletion docs/4-phonegap-build/2-configuring/plugins.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Plugins can be from <a href="https://build.phonegap.com/plugins" target="_blank"

Plugins need to be implemented differently for each platform, and may not be supported across all PhoneGap platforms. If you're deploying across multiple platforms, ensure that the experience degrades gracefully for users who do not have the plugin available.

If you would like to develop and publish your a plugin to be used by the community, [please see the Plugin Development Guide at Apache Cordova](http://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html). To submit a plugin to <a href="https://www.npmjs.com/">npm</a> please view their <a href="https://docs.npmjs.com/getting-started/publishing-npm-packages">documentation</a>.
If you would like to develop and publish your a plugin to be used by the community, [please see the Plugin Development Guide at Apache Cordova](https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html). To submit a plugin to <a href="https://www.npmjs.com/">npm</a> please view their <a href="https://docs.npmjs.com/getting-started/publishing-npm-packages">documentation</a>.

## Including a plugin in your project

Expand Down
1 change: 0 additions & 1 deletion layouts/includes/site-footer.jade
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ footer.site-footer
li: a(href='http://www.facebook.com/PhoneGap') Facebook
li: a(href='https://plus.google.com/communities/111220599704908202107') Google+
li: a(href='https://www.youtube.com/user/phonegap') YouTube
li: a(href='https://instagram.com/phonegap/') Instagram
.subscribe
.subscribe__description
h4.site-footer__title Stay Connected to PhoneGap
Expand Down

0 comments on commit 45a0f77

Please sign in to comment.