Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
  • Loading branch information
sahat committed Feb 15, 2016
2 parents ca806a7 + 5d389c5 commit 26df2c8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2015 Sahat Yalkabov
Copyright (c) 2016 Sahat Yalkabov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# [Satellizer](https://github.com/sahat/satellizer/)

[![Join the chat at https://gitter.im/sahat/satellizer](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sahat/satellizer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Donate](https://img.shields.io/badge/paypal-donate-blue.svg)](https://paypal.me/sahat) [![Join the chat at https://gitter.im/sahat/satellizer](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sahat/satellizer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](http://img.shields.io/travis/sahat/satellizer.svg?style=flat)](https://travis-ci.org/sahat/satellizer)
[![Test Coverage](http://img.shields.io/codeclimate/coverage/github/sahat/satellizer.svg?style=flat)](https://codeclimate.com/github/sahat/satellizer)
[![Version](https://img.shields.io/badge/version-0.13.4-brightgreen.svg)](https://www.npmjs.org/package/satellizer)
Expand Down Expand Up @@ -43,8 +43,7 @@ in the app *config* block.

## Installation

The easiest way to get **Satellizer** is by running one of the following
commands:
The easiest way to get **Satellizer** is by running one of the following commands:

```bash
# Bower
Expand All @@ -63,6 +62,13 @@ Alternatively, you may [**download**](https://github.com/sahat/satellizer/releas
<script src="//cdn.jsdelivr.net/satellizer/0.13.4/satellizer.min.js"></script>
```

If installed via [Bower](http://bower.io/), include one of the following script tags:
```html
<script src="bower_components/satellizer/satellizer.js"></script>
<!-- or -->
<script src="bower_components/satellizer/satellizer.min.js"></script>
```

**Note:** Sattelizer depends on [`window.atob()`](https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/atob) for decoding JSON Web Tokens. If you need to support *IE9* then use Base64 polyfill above.


Expand Down
2 changes: 1 addition & 1 deletion examples/ionic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Ionic is the beautiful, open source front-end SDK for developing hybrid mobile a
5. <img src="http://cnet2.cbsistatic.com/hub/i/r/2011/10/05/74df5391-fdc1-11e2-8c7c-d4ae52e62bcc/resize/370xauto/26609a1fcbb66cad8783b098ebf0ed80/apple-logo-2.jpg" height="16"> **iOS**
- `ionic build ios`
- `ionic emulate ios`
6. <img src="http://findicons.com/files/icons/820/simply_google/256/google_android.png" height="17"> **Android**
6. <img src="http://icons.iconarchive.com/icons/carlosjj/google-jfk/128/android-icon.png" height="17"> **Android**
- `ionic platform add android`
- `ionic build android`
- `ionic emulate android`
16 changes: 8 additions & 8 deletions satellizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.ex
if (config.cordova) {
openPopup = popup.open(url, defaults.name, defaults.popupOptions, defaults.redirectUri).eventListener(defaults.redirectUri);
} else {
openPopup = popup.open(url, defaults.name, defaults.popupOptions, defaults.redirectUri).pollPopup();
openPopup = popup.open(url, defaults.name, defaults.popupOptions, defaults.redirectUri).pollPopup(defaults.redirectUri);
}

return openPopup
Expand Down Expand Up @@ -555,7 +555,7 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.ex
data[value] = defaults.redirectUri;
break;
default:
data[value] = oauthData[key]
data[value] = oauthData[key];
}
});

Expand Down Expand Up @@ -630,7 +630,7 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.ex
var serverUrl = config.baseUrl ? utils.joinUrl(config.baseUrl, defaults.url) : defaults.url;

if (!config.cordova) {
popupWindow = popup.open('', defaults.name, defaults.popupOptions, defaults.redirectUri);
popupWindow = popup.open('', defaults.name, defaults.popupOptions, defaults.redirectUri);
}

return $http.post(serverUrl, defaults)
Expand All @@ -648,7 +648,7 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.ex
if (config.cordova) {
popupListener = popupWindow.eventListener(defaults.redirectUri);
} else {
popupListener = popupWindow.pollPopup();
popupListener = popupWindow.pollPopup(defaults.redirectUri);
}

return popupListener
Expand Down Expand Up @@ -742,15 +742,14 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.ex
return deferred.promise;
};

Popup.pollPopup = function() {
Popup.pollPopup = function(redirectUri) {
var deferred = $q.defer();

var polling = $interval(function() {
try {
var documentOrigin = document.location.host;
var popupWindowOrigin = Popup.popupWindow.location.host;
var popupWindowOrigin = Popup.popupWindow.location.origin;

if (popupWindowOrigin === documentOrigin && (Popup.popupWindow.location.search || Popup.popupWindow.location.hash)) {
if (popupWindowOrigin === redirectUri && (Popup.popupWindow.location.search || Popup.popupWindow.location.hash)) {
var queryParams = Popup.popupWindow.location.search.substring(1).replace(/\/$/, '');
var hashParams = Popup.popupWindow.location.hash.substring(1).replace(/[\/$]/, '');
var hash = utils.parseQueryString(hashParams);
Expand All @@ -770,6 +769,7 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.ex
}
} catch (error) {
// Ignore DOMException: Blocked a frame with origin from accessing a cross-origin frame.
// A hack to get around same-origin security policy errors in IE.
}

if (!Popup.popupWindow || Popup.popupWindow.closed || Popup.popupWindow.closed === undefined) {
Expand Down
Loading

0 comments on commit 26df2c8

Please sign in to comment.