phrasing 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,13 +34,13 @@ var phrasing_setup = function(){
|
|
34
34
|
|
35
35
|
// Hash size function
|
36
36
|
|
37
|
-
Object.size = function(obj) {
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
};
|
37
|
+
Object.size = function(obj) {
|
38
|
+
var size = 0, key;
|
39
|
+
for (key in obj) {
|
40
|
+
if (obj.hasOwnProperty(key)) size++;
|
41
|
+
}
|
42
|
+
return size;
|
43
|
+
};
|
44
44
|
|
45
45
|
|
46
46
|
|
@@ -92,7 +92,7 @@ Object.size = function(obj) {
|
|
92
92
|
success: function(e){
|
93
93
|
spinner.stop();
|
94
94
|
|
95
|
-
console.log("I've sent a ajax request: " + content);
|
95
|
+
// console.log("I've sent a ajax request: " + content);
|
96
96
|
|
97
97
|
trigger_binded_events_for_phrasable_class = 0;
|
98
98
|
if(content == "Empty"){
|
@@ -105,7 +105,18 @@ Object.size = function(obj) {
|
|
105
105
|
if (Object.size(timer_status) == 0){
|
106
106
|
$('#phrasing-edit-mode-bubble #phrasing-spinner p').css("color", "green").text("Everything saved.")
|
107
107
|
}
|
108
|
-
}
|
108
|
+
},
|
109
|
+
error: function(e){
|
110
|
+
spinner.stop();
|
111
|
+
var warningMessages = [e.responseText, "Unable to save!"];
|
112
|
+
var intervalIndex = 0;
|
113
|
+
$('#phrasing-edit-mode-bubble #phrasing-spinner p').css("color", "red").text(warningMessages[1])
|
114
|
+
setInterval(function(){
|
115
|
+
var text = warningMessages[intervalIndex++ % warningMessages.length]
|
116
|
+
$('#phrasing-edit-mode-bubble #phrasing-spinner p').css("color", "red").text(text)
|
117
|
+
},2000);
|
118
|
+
}
|
119
|
+
})
|
109
120
|
}
|
110
121
|
|
111
122
|
// EDIT MODE SWITCH MODE BUTTON
|
@@ -96,7 +96,7 @@ class PhrasingPhrasesController < ActionController::Base
|
|
96
96
|
@object.save!
|
97
97
|
render :json => @object
|
98
98
|
else
|
99
|
-
render status: 403, text: "
|
99
|
+
render status: 403, text: "Attribute not whitelisted!"
|
100
100
|
end
|
101
101
|
|
102
102
|
rescue ActiveRecord::RecordInvalid => e
|
data/lib/phrasing.rb
CHANGED
@@ -19,11 +19,9 @@ module Phrasing
|
|
19
19
|
|
20
20
|
mattr_accessor :allow_update_on_all_models_and_attributes
|
21
21
|
mattr_accessor :route
|
22
|
-
mattr_accessor :everything_is_html_safe
|
23
22
|
mattr_accessor :staging_server_endpoint
|
24
23
|
|
25
24
|
@@route = 'phrasing'
|
26
|
-
@@everything_is_html_safe = false
|
27
25
|
|
28
26
|
def self.setup
|
29
27
|
yield self
|
@@ -47,20 +45,4 @@ module Phrasing
|
|
47
45
|
allow_update_on_all_models_and_attributes == true or whitelist.include? "#{klass}.#{attribute}"
|
48
46
|
end
|
49
47
|
|
50
|
-
end
|
51
|
-
|
52
|
-
module ActionView
|
53
|
-
module Helpers
|
54
|
-
module TranslationHelper
|
55
|
-
private
|
56
|
-
|
57
|
-
def new_html_safe_translation_key?(key)
|
58
|
-
Phrasing.everything_is_html_safe || old_html_safe_translation_key?(key)
|
59
|
-
end
|
60
|
-
|
61
|
-
alias_method :old_html_safe_translation_key?, :html_safe_translation_key?
|
62
|
-
alias_method :html_safe_translation_key?, :new_html_safe_translation_key?
|
63
|
-
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
48
|
+
end
|
data/lib/phrasing/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phrasing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-10-
|
13
|
+
date: 2013-10-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|