iam 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/app/views/iam/_account.html.erb +1 -1
- data/lib/iam/version.rb +1 -1
- data/vendor/assets/javascripts/{iam.coffee → iam.js.coffee} +1 -4
- data/vendor/assets/javascripts/iam.js.js +1 -0
- data/vendor/assets/javascripts/jquery.cookie.js +1 -1
- data/vendor/assets/stylesheets/iam.css +2 -0
- data/vendor/assets/stylesheets/iam.css.sass +3 -0
- metadata +4 -4
- data/vendor/assets/javascripts/iam.js +0 -2
data/README.md
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
<tr href='<%= log_in_as_path(account) %>'>
|
1
|
+
<tr id='<%='iam-current-account' if account == current_user%>' href='<%= log_in_as_path(account) %>'>
|
2
2
|
<%= render partial: 'iam/account_attribute', collection: Iam::Configuration.account_attributes.map { |key| [key, account.public_send(key)] } %>
|
3
3
|
</tr>
|
data/lib/iam/version.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
$ ->
|
2
|
-
$menu = $('#iam-menu')
|
3
2
|
templateLink = '/iam/log_in_as/:id'
|
4
3
|
menuLink = '/iam/menu'
|
5
4
|
inputMode = false # account id is anticipated to be typed
|
@@ -30,7 +29,6 @@ $ ->
|
|
30
29
|
|
31
30
|
logInByLink = (link) ->
|
32
31
|
$.post link, (data) ->
|
33
|
-
$menu.hide()
|
34
32
|
window.location.reload()
|
35
33
|
iamNotice data.notice
|
36
34
|
|
@@ -56,7 +54,6 @@ $ ->
|
|
56
54
|
logInByInput = ->
|
57
55
|
if inputMode
|
58
56
|
processInput input
|
59
|
-
$('#iam-menu').remove()
|
60
57
|
else
|
61
58
|
$.get menuLink, (menu) ->
|
62
59
|
$('body').append menu
|
@@ -69,6 +66,6 @@ $ ->
|
|
69
66
|
logInByInput()
|
70
67
|
|
71
68
|
inputMode = !inputMode
|
72
|
-
$menu.
|
69
|
+
$('#iam-menu').remove()
|
73
70
|
else
|
74
71
|
input += String.fromCharCode e.keyCode if 48 <= e.keyCode <= 57
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(){$(function(){var e,t,n,r,i,s,o,u,a,f,l,c,h;return h="/iam/log_in_as/:id",l="/iam/menu",s=!1,i="",e=["alt","ctrl","shift"],r=function(){return $(".iam-settings-header").on("click",function(){return $(".iam-settings").toggle()}),$("#iam-menu").on("click","td",function(){var e,t;e=$(this).parents("tr"),t=e.attr("href");if(t)return f(t)}),$.each(e,function(){var e,t;return e=$(".iam-"+this+"-settings input"),t="iam-"+this+"-checked",e[0].checked=$.cookie(t)==="true",e.on("click",function(){return $.cookie(t,this.checked)})})},n=function(e){var t;return t=$("<div class='iam-notice'>"+e+"</div>"),$("body").append(t),t.fadeIn(200).delay(1e3).fadeOut(600)},f=function(e){return $.post(e,function(e){return window.location.reload(),n(e.notice)})},u=function(e){return String.fromCharCode(e)==="À"},t=function(t){var n,r,i,s;for(i=0,s=e.length;i<s;i++){n=e[i],r=$.cookie("iam-"+n+"-checked")==="true";if(r!==t[""+n+"Key"])return!1}return!0},o=function(){return $(document.getSelection().focusNode).find("input, textarea").length>0},c=function(e){var t;if(e.match(/^\d+$/))return t=h.replace(/:id/,e),f(t);if(e)return n(""+e+" is invalid id.")},a=function(){return s?c(i):$.get(l,function(e){return $("body").append(e),r()}),i=""},$(document).on("keydown",function(e){var n;if(!o()&&u(e.keyCode)&&t(e))return a(),s=!s,$("#iam-menu").remove();if(48<=(n=e.keyCode)&&n<=57)return i+=String.fromCharCode(e.keyCode)})})}).call(this);
|
@@ -7,4 +7,4 @@
|
|
7
7
|
* http://www.opensource.org/licenses/mit-license.php
|
8
8
|
* http://www.opensource.org/licenses/GPL-2.0
|
9
9
|
*/
|
10
|
-
(function(e,t,n){function
|
10
|
+
(function(e,t,n){function r(e){return e}function i(e){return decodeURIComponent(e.replace(s," "))}var s=/\+/g,o=e.cookie=function(s,u,a){if(u!==n){a=e.extend({},o.defaults,a),u===null&&(a.expires=-1);if(typeof a.expires=="number"){var f=a.expires,l=a.expires=new Date;l.setDate(l.getDate()+f)}return u=o.json?JSON.stringify(u):String(u),t.cookie=[encodeURIComponent(s),"=",o.raw?u:encodeURIComponent(u),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}var c=o.raw?r:i,h=t.cookie.split("; ");for(var p=0,d=h.length;p<d;p++){var v=h[p].split("=");if(c(v.shift())===s){var m=c(v.join("="));return o.json?JSON.parse(m):m}}return null};o.defaults={},e.removeCookie=function(t,n){return e.cookie(t)!==null?(e.cookie(t,null,n),!0):!1}})(jQuery,document);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -265,8 +265,8 @@ files:
|
|
265
265
|
- spec/rails_app/script/rails
|
266
266
|
- spec/spec_helper.rb
|
267
267
|
- spec/support/database_cleaner.rb
|
268
|
-
- vendor/assets/javascripts/iam.coffee
|
269
|
-
- vendor/assets/javascripts/iam.js
|
268
|
+
- vendor/assets/javascripts/iam.js.coffee
|
269
|
+
- vendor/assets/javascripts/iam.js.js
|
270
270
|
- vendor/assets/javascripts/jquery.cookie.js
|
271
271
|
- vendor/assets/stylesheets/.sass-cache/99c7326b15538dc9b4651af91a5f076fe779d5ec/iam.css.sassc
|
272
272
|
- vendor/assets/stylesheets/iam.css
|
@@ -1,2 +0,0 @@
|
|
1
|
-
// Generated by CoffeeScript 1.3.3
|
2
|
-
(function(){$(function(){var e,t,n,r,i,s,o,u,a,f,l,c,h,p;return e=$("#iam-menu"),p="/iam/log_in_as/:id",c="/iam/menu",o=!1,s="",t=["alt","ctrl","shift"],i=function(){return $(".iam-settings-header").on("click",function(){return $(".iam-settings").toggle()}),$("#iam-menu").on("click","td",function(){var e,t;e=$(this).parents("tr"),t=e.attr("href");if(t)return l(t)}),$.each(t,function(){var e,t;return e=$(".iam-"+this+"-settings input"),t="iam-"+this+"-checked",e[0].checked=$.cookie(t)==="true",e.on("click",function(){return $.cookie(t,this.checked)})})},r=function(e){var t;return t=$("<div class='iam-notice'>"+e+"</div>"),$("body").append(t),t.fadeIn(200).delay(1e3).fadeOut(600)},l=function(t){return $.post(t,function(t){return e.hide(),window.location.reload(),r(t.notice)})},a=function(e){return String.fromCharCode(e)==="À"},n=function(e){var n,r,i,s;for(i=0,s=t.length;i<s;i++){n=t[i],r=$.cookie("iam-"+n+"-checked")==="true";if(r!==e[""+n+"Key"])return!1}return!0},u=function(){return $(document.getSelection().focusNode).find("input, textarea").length>0},h=function(e){var t;if(e.match(/^\d+$/))return t=p.replace(/:id/,e),l(t);if(e)return r(""+e+" is invalid id.")},f=function(){return o?(h(s),$("#iam-menu").remove()):$.get(c,function(e){return $("body").append(e),i()}),s=""},$(document).on("keydown",function(t){var r;if(!u()&&a(t.keyCode)&&n(t))return f(),o=!o,e.toggle();if(48<=(r=t.keyCode)&&r<=57)return s+=String.fromCharCode(t.keyCode)})})}).call(this);
|