This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes jQuery and CoffeeScript dependencies
jQuery Rails is now at v3, so forcing a lower version means that some users will run into dependency conflicts when installing CASino (especially Rails 4 users) Additionally, not only do some users not use (or want) jQuery or CoffeeScript in their application, CASino isn't using that much CoffeeScript to necessitate pulling in all of jQuery or requiring CoffeeScript. This updates the javascript in two ways: * Replaces the auto-focusing of CASino elements with the `autofocus` HTML5 attribute * Replaces the jQuery-specific javascript that automatically logs a user in when a TGT is already present with native DOM calls inlined directly in the login form so that it is always present, regardless of how the parent application has configured its layouts. * Rewrites the CoffeeScript source into JavaScript
- Loading branch information
Derek Lindahl
committed
Oct 26, 2013
1 parent
61c97fa
commit d6cbe59
Showing
9 changed files
with
31 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// Place all the behaviors and hooks related to the matching controller here. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(function(win, doc) { | ||
var url = '/login', | ||
cookie_regex = /(^|;)\s*tgt=/; | ||
|
||
function checkCookieExists() { | ||
var serviceEl = doc.getElementById('service'), | ||
svcValue = serviceEl ? serviceEl.getAttribute('value') : null; | ||
|
||
if(svcValue) { | ||
if(cookie_regex.test(doc.cookie)) { | ||
win.location = url + '?service=' + encodeURIComponent(svcValue); | ||
} | ||
} else { | ||
setTimeout(checkCookieExists, 1000); | ||
} | ||
} | ||
|
||
// Auto-login when logged-in in other browser window (9887c4e) | ||
if(doc.getElementById('login-form')) { | ||
checkCookieExists(); | ||
} | ||
|
||
})(this, document); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters