papermill 0.16.3 → 1.0.0
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.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
1.0.0
|
@@ -11,7 +11,7 @@ en:
|
|
11
11
|
delete-confirmation: "Delete '{{resource}}'?"
|
12
12
|
SWFUPLOAD_PENDING: "Pending..."
|
13
13
|
SWFUPLOAD_LOADING: "Loading..."
|
14
|
-
SWFUPLOAD_ERROR: "
|
14
|
+
SWFUPLOAD_ERROR: "File is too big, of unauthorized type, or an error occured on the server."
|
15
15
|
file_type: "{{type.capitalize}} file"
|
16
16
|
name: "Name"
|
17
17
|
content_type: "Content-type"
|
@@ -44,7 +44,7 @@ fr:
|
|
44
44
|
delete-confirmation: "Êtes-vous sûr de vouloir supprimer '{{resource}}' ?"
|
45
45
|
SWFUPLOAD_PENDING: "En attente..."
|
46
46
|
SWFUPLOAD_LOADING: "Chargement..."
|
47
|
-
SWFUPLOAD_ERROR: "
|
47
|
+
SWFUPLOAD_ERROR: "Fichier trop gros, type de fichier non autorisé ou erreur serveur."
|
48
48
|
file_type: "Fichier {{type}}"
|
49
49
|
name: "Nom"
|
50
50
|
content_type: "Content-type"
|
@@ -19,8 +19,8 @@ class PapermillAsset < ActiveRecord::Base
|
|
19
19
|
default_scope :order => 'position'
|
20
20
|
|
21
21
|
def Filedata=(data)
|
22
|
+
data.content_type = data.get_content_type # SWFUpload content-type fix
|
22
23
|
self.file = data
|
23
|
-
self.file_content_type = data.get_content_type
|
24
24
|
end
|
25
25
|
|
26
26
|
def Filename=(name)
|
@@ -90,7 +90,7 @@ class PapermillAsset < ActiveRecord::Base
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def self.cleanup
|
93
|
-
|
93
|
+
self.all(:conditions => ["id < 0 AND created_at < ?", DateTime.now.yesterday]).each &:destroy
|
94
94
|
end
|
95
95
|
|
96
96
|
private
|
@@ -1,5 +1,5 @@
|
|
1
1
|
popup = function(url) {
|
2
|
-
window.open (url
|
2
|
+
window.open (url, "Papermill", config='height=580, width=870, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no')
|
3
3
|
}
|
4
4
|
|
5
5
|
close_popup = function(source) {
|
@@ -8,10 +8,7 @@ close_popup = function(source) {
|
|
8
8
|
|
9
9
|
|
10
10
|
/*
|
11
|
-
If you have a popup library,
|
12
|
-
You'll need jQuery loaded, so specify with_jquery=true if you load edit in an iframe or a true popup.
|
13
|
-
You can specify a layout as well, with layout=application in your URL.
|
14
|
-
|
11
|
+
If you have a popup library, override popup and close_popup in your application.js
|
15
12
|
|
16
13
|
* e.g. facebox :
|
17
14
|
|
@@ -31,7 +28,7 @@ close_popup = function(source) {
|
|
31
28
|
|
32
29
|
popup = function(url) {
|
33
30
|
Shadowbox.open({
|
34
|
-
content: url
|
31
|
+
content: url-,
|
35
32
|
player: "iframe",
|
36
33
|
width: 870,
|
37
34
|
height: 580
|
data/test/papermill_test.rb
CHANGED
@@ -52,11 +52,11 @@ class PapermillTest < Test::Unit::TestCase
|
|
52
52
|
@article = Article.create!
|
53
53
|
@decoy_article = Article.create!
|
54
54
|
@file = File.new(File.join(File.dirname(__FILE__), "fixtures", "5k.png"), 'rb')
|
55
|
-
PapermillAsset.create!(:
|
56
|
-
PapermillAsset.create!(:
|
57
|
-
MyAsset.create!(:
|
58
|
-
MyAsset.create!(:
|
59
|
-
MyAsset.create!(:
|
55
|
+
PapermillAsset.create!(:file => @file, :assetable => @article, :assetable_key => "asset1", :position => 2)
|
56
|
+
PapermillAsset.create!(:file => @file, :assetable => @article, :assetable_key => "asset1", :position => 1)
|
57
|
+
MyAsset.create!(:file => @file, :assetable => @article, :assetable_key => "my_assets")
|
58
|
+
MyAsset.create!(:file => @file, :assetable => @article, :assetable_key => "my_assets")
|
59
|
+
MyAsset.create!(:file => @file, :assetable => @decoy_article, :assetable_key => "my_assets")
|
60
60
|
|
61
61
|
def initialize(*args)
|
62
62
|
super
|