beef-admin_area 0.1.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/.document +5 -0
- data/.gitignore +5 -0
- data/LICENSE +20 -0
- data/README.rdoc +7 -0
- data/Rakefile +59 -0
- data/VERSION +1 -0
- data/admin_area.gemspec +168 -0
- data/app/controllers/admin/base_controller.rb +8 -0
- data/app/controllers/admin/settings_controller.rb +43 -0
- data/app/controllers/admin/users_controller.rb +74 -0
- data/app/helpers/admin/base_helper.rb +59 -0
- data/app/helpers/admin/settings_helper.rb +8 -0
- data/app/helpers/admin/users_helper.rb +2 -0
- data/app/models/settings.rb +92 -0
- data/app/views/admin/base/index.html.erb +2 -0
- data/app/views/admin/settings/_form.html.erb +31 -0
- data/app/views/admin/settings/update.js.rjs +1 -0
- data/app/views/admin/users/index.html.erb +39 -0
- data/app/views/admin/users/show.html.erb +37 -0
- data/app/views/layouts/admin.html.erb +68 -0
- data/config/routes.rb +8 -0
- data/generators/admin_area_files/USAGE +8 -0
- data/generators/admin_area_files/admin_area_files_generator.rb +114 -0
- data/generators/admin_area_files/lib/insert_commands.rb +47 -0
- data/generators/admin_area_files/templates/app/models/content_sweeper.rb +43 -0
- data/generators/admin_area_files/templates/app/views/admin/settings/show.html.erb +52 -0
- data/generators/admin_area_files/templates/config/initializers/admin_area.rb +2 -0
- data/generators/admin_area_files/templates/config/initializers/settings.rb +8 -0
- data/generators/admin_area_files/templates/lib/tasks/admin_area.rake +10 -0
- data/generators/admin_area_files/templates/migration.rb +21 -0
- data/generators/admin_area_files/templates/public/images/admin/accept_button.gif +0 -0
- data/generators/admin_area_files/templates/public/images/admin/add.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/application_cascade.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/arrow_left.gif +0 -0
- data/generators/admin_area_files/templates/public/images/admin/arrow_right.gif +0 -0
- data/generators/admin_area_files/templates/public/images/admin/button_bg.gif +0 -0
- data/generators/admin_area_files/templates/public/images/admin/cancel_button.gif +0 -0
- data/generators/admin_area_files/templates/public/images/admin/cursor_arrow.gif +0 -0
- data/generators/admin_area_files/templates/public/images/admin/delete_button.gif +0 -0
- data/generators/admin_area_files/templates/public/images/admin/down_icon.gif +0 -0
- data/generators/admin_area_files/templates/public/images/admin/edit_button.gif +0 -0
- data/generators/admin_area_files/templates/public/images/admin/file-uploads.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/folder.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/folder_image.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/head_bg.gif +0 -0
- data/generators/admin_area_files/templates/public/images/admin/image_add.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/images-pointer.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/info_bg.gif +0 -0
- data/generators/admin_area_files/templates/public/images/admin/nav_bg.gif +0 -0
- data/generators/admin_area_files/templates/public/images/admin/over_button_bg.gif +0 -0
- data/generators/admin_area_files/templates/public/images/admin/page_bg.gif +0 -0
- data/generators/admin_area_files/templates/public/images/admin/page_white.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/page_white_get.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/page_white_link.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/page_white_stack.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/picture.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/picture_medium.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/picture_square.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/picture_thumb.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/pictures.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/unapproved.png +0 -0
- data/generators/admin_area_files/templates/public/images/admin/up_icon.gif +0 -0
- data/generators/admin_area_files/templates/public/images/lightwindow/Thumbs.db +0 -0
- data/generators/admin_area_files/templates/public/images/lightwindow/ajax-loading.gif +0 -0
- data/generators/admin_area_files/templates/public/images/lightwindow/arrow-down.gif +0 -0
- data/generators/admin_area_files/templates/public/images/lightwindow/arrow-up.gif +0 -0
- data/generators/admin_area_files/templates/public/images/lightwindow/black-70.png +0 -0
- data/generators/admin_area_files/templates/public/images/lightwindow/black.png +0 -0
- data/generators/admin_area_files/templates/public/images/lightwindow/nextlabel.gif +0 -0
- data/generators/admin_area_files/templates/public/images/lightwindow/pattern_148-70.png +0 -0
- data/generators/admin_area_files/templates/public/images/lightwindow/pattern_148.gif +0 -0
- data/generators/admin_area_files/templates/public/images/lightwindow/prevlabel.gif +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/background.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/blockquote.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/bold.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/center.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/h1.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/h2.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/h3.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/h4.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/h5.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/h6.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/indent.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/italic.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/justify.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/left.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/link.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/list_bullets.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/list_numbers.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/omega.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/outdent.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/paragraph.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/preview.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/right.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/strikethrough.png +0 -0
- data/generators/admin_area_files/templates/public/images/textile-editor/underline.png +0 -0
- data/generators/admin_area_files/templates/public/javascripts/admin/application.js +185 -0
- data/generators/admin_area_files/templates/public/javascripts/lightwindow.js +1921 -0
- data/generators/admin_area_files/templates/public/javascripts/textile-editor-config.js +107 -0
- data/generators/admin_area_files/templates/public/javascripts/textile-editor.js +788 -0
- data/generators/admin_area_files/templates/public/stylesheets/admin/handheld.css +6 -0
- data/generators/admin_area_files/templates/public/stylesheets/admin/ie.css +21 -0
- data/generators/admin_area_files/templates/public/stylesheets/admin/print.css +27 -0
- data/generators/admin_area_files/templates/public/stylesheets/admin/screen.css +996 -0
- data/generators/admin_area_files/templates/public/stylesheets/admin/theme-1.0.css +131 -0
- data/generators/admin_area_files/templates/public/stylesheets/lightwindow.css +376 -0
- data/generators/admin_area_files/templates/public/stylesheets/textile-editor.css +60 -0
- data/generators/admin_scaffold/USAGE +8 -0
- data/generators/admin_scaffold/admin_scaffold_generator.rb +53 -0
- data/generators/admin_scaffold/lib/insert_commands.rb +61 -0
- data/generators/admin_scaffold/templates/admin_controller.rb +83 -0
- data/generators/admin_scaffold/templates/admin_index.html.erb +38 -0
- data/generators/admin_scaffold/templates/admin_show.html.erb +16 -0
- data/generators/admin_scaffold/templates/helper.rb +2 -0
- data/generators/admin_scaffold/templates/helper_test.rb +4 -0
- data/generators/admin_scaffold/templates/layout.html.erb +17 -0
- data/generators/admin_scaffold/templates/style.css +54 -0
- data/generators/admin_scaffold/templates/view_controller.rb +14 -0
- data/generators/admin_scaffold/templates/view_index.html.erb +17 -0
- data/lib/admin_area.rb +82 -0
- data/rails/init.rb +4 -0
- data/test/admin_area_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- metadata +206 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
class ContentSweeper < ActionController::Caching::Sweeper
|
|
2
|
+
# observe Article, Comment, Settings
|
|
3
|
+
|
|
4
|
+
def after_save(record)
|
|
5
|
+
case record
|
|
6
|
+
when ::Article, ::Settings
|
|
7
|
+
remove_articles_cache
|
|
8
|
+
when ::Comment
|
|
9
|
+
case record.commentable
|
|
10
|
+
when ::Article
|
|
11
|
+
expire_article(record.commentable)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
remove_archive_cache
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def after_destroy(record)
|
|
19
|
+
after_save(record)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def expire_article(article)
|
|
23
|
+
expire_page(article_permalink_path(article.published_at.year,article.published_at.month,article.published_at.day,article.permalink)) unless article.published_at.nil?
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# removes all the articles pages
|
|
27
|
+
def remove_articles_cache
|
|
28
|
+
Article.find(:all).each do |article|
|
|
29
|
+
expire_article(article)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# removes the entirety of the articles folder which all the articles archive and
|
|
34
|
+
# pagination stuff is cached in
|
|
35
|
+
def remove_archive_cache
|
|
36
|
+
expire_action(:controller => '/articles', :action => 'index')
|
|
37
|
+
expire_fragment(%r{/articles/page/*})
|
|
38
|
+
expire_fragment(%r{/categories/*})
|
|
39
|
+
articles_folder = ActionController::Base.page_cache_directory + '/articles/'
|
|
40
|
+
FileUtils.rmtree articles_folder if File.exists? articles_folder
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
|
|
2
|
+
<h1>Settings</h1>
|
|
3
|
+
<fieldset id="general"><legend>General</legend>
|
|
4
|
+
<%= setting_form [['home_page_title','text'],
|
|
5
|
+
['default_description','text_area'],
|
|
6
|
+
['default_keywords', 'text_area']] %>
|
|
7
|
+
</fieldset>
|
|
8
|
+
|
|
9
|
+
<fieldset id="contactdetails"><legend>Contact Details</legend>
|
|
10
|
+
<%= setting_form([['site_name','text'],
|
|
11
|
+
['address_line_1','text'],
|
|
12
|
+
['address_line_2','text'],
|
|
13
|
+
['district','text'],
|
|
14
|
+
['town','text'],
|
|
15
|
+
['county','text'],
|
|
16
|
+
['region','text'],
|
|
17
|
+
['postcode','text'],
|
|
18
|
+
[],
|
|
19
|
+
['telephone', 'text'],
|
|
20
|
+
['fax', 'text'],
|
|
21
|
+
['default_email','text']]) %>
|
|
22
|
+
|
|
23
|
+
</fieldset>
|
|
24
|
+
|
|
25
|
+
<fieldset id="flickrsettings"><legend>Flickr Settings</legend>
|
|
26
|
+
<% if @unauthorised %>
|
|
27
|
+
<p>You are currently unauthorised because <%= @unauthorised %>, please <%= link_to 'login to flickr', @login_url %>
|
|
28
|
+
<% end -%>
|
|
29
|
+
<%= setting_form [['flickr_user_id','text'],
|
|
30
|
+
['flickr_api_key','text'],
|
|
31
|
+
['flickr_api_secret','text']] %>
|
|
32
|
+
</fieldset>
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
<fieldset id="defensio"><legend>Defensio Settings</legend>
|
|
36
|
+
<%= setting_form 'defensio_api_key' %>
|
|
37
|
+
</fieldset>
|
|
38
|
+
|
|
39
|
+
<fieldset id="defensio"><legend>Google Analytics Settings</legend>
|
|
40
|
+
<%= setting_form 'google_analytics_web_property_id' %>
|
|
41
|
+
</fieldset>
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
<% content_for :sub_content do %>
|
|
45
|
+
<h2>Helpful Tips</h2>
|
|
46
|
+
<h3>Default Description</h3>
|
|
47
|
+
<p>The default description describes a page to a search engine. If you do not fill in the description field for a piece of content (e.g. a news item) this will be used instead.</p>
|
|
48
|
+
<h3>Default Keywords</h3>
|
|
49
|
+
<p>The default keywords help promote a page to a search engine. If you do not fill in the keywords field for a piece of content (e.g. a news item) these will be used instead.</p>
|
|
50
|
+
<h3>Default Email</h3>
|
|
51
|
+
<p>This is the email used by the contact and showreel form. All enquiries to the site will be delivered to this email address.</p>
|
|
52
|
+
<% end %>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Settings.defaults[:some_setting] = 'footastic'
|
|
2
|
+
|
|
3
|
+
Settings.defaults[:site_name] = 'Beef Core'
|
|
4
|
+
Settings.defaults[:home_page_title] = 'Welcome'
|
|
5
|
+
|
|
6
|
+
Settings.defaults[:default_email] = 'hello@wearebeef.co.uk'
|
|
7
|
+
Settings.defaults[:default_description] = 'Please change me'
|
|
8
|
+
Settings.defaults[:default_keywords] = 'Please, change, me'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
namespace :admin_area do
|
|
2
|
+
|
|
3
|
+
desc "Create an administrator User"
|
|
4
|
+
task :create_admin_user => :environment do
|
|
5
|
+
user = User.new :name => 'Administrator', :email => 'hello@wearebeef.co.uk', :password => 'passw0rd', :password_confirmation => 'passw0rd'
|
|
6
|
+
user.role = 'admin'
|
|
7
|
+
user.save
|
|
8
|
+
user.confirm_email! if user.valid?
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
class CreateSettingsAndUsers < ActiveRecord::Migration
|
|
2
|
+
def self.up
|
|
3
|
+
create_table :settings, :force => true do |t|
|
|
4
|
+
t.string :var, :null => false
|
|
5
|
+
t.text :value, :null => true
|
|
6
|
+
t.timestamps
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
change_table(:users) do |t|
|
|
10
|
+
t.string :name, :limit => 128
|
|
11
|
+
t.string :role, :limit => 10
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def self.down
|
|
16
|
+
change_table(:users) do |t|
|
|
17
|
+
t.remove :name, :role
|
|
18
|
+
end
|
|
19
|
+
drop_table :settings
|
|
20
|
+
end
|
|
21
|
+
end
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// Place your application-specific JavaScript functions and classes here
|
|
2
|
+
// This file is automatically included by javascript_include_tag :defaults
|
|
3
|
+
var generatePassword = function() {
|
|
4
|
+
new Ajax.Request('/admin/users/generate_password', { method: 'get',
|
|
5
|
+
asynchronous:true,
|
|
6
|
+
evalScripts:true});
|
|
7
|
+
};
|
|
8
|
+
var updateStrength = function(pw) {
|
|
9
|
+
var strength = getStrength(pw);
|
|
10
|
+
var width = (100/32)*strength;
|
|
11
|
+
new Effect.Morph('psStrength', {style:'width:'+width+'px', duration:'0.4'});
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
var getStrength = function(passwd) {
|
|
15
|
+
intScore = 0;
|
|
16
|
+
if (passwd.match(/[a-z]/)) // [verified] at least one lower case letter
|
|
17
|
+
{
|
|
18
|
+
intScore = (intScore+1);
|
|
19
|
+
} if (passwd.match(/[A-Z]/)) // [verified] at least one upper case letter
|
|
20
|
+
{
|
|
21
|
+
intScore = (intScore+5);
|
|
22
|
+
} // NUMBERS
|
|
23
|
+
if (passwd.match(/\d+/)) // [verified] at least one number
|
|
24
|
+
{
|
|
25
|
+
intScore = (intScore+5);
|
|
26
|
+
} if (passwd.match(/(\d.*\d.*\d)/)) // [verified] at least three numbers
|
|
27
|
+
{
|
|
28
|
+
intScore = (intScore+5);
|
|
29
|
+
} // SPECIAL CHAR
|
|
30
|
+
if (passwd.match(/[!,@#$%^&*?_~]/)) // [verified] at least one special character
|
|
31
|
+
{
|
|
32
|
+
intScore = (intScore+5);
|
|
33
|
+
} if (passwd.match(/([!,@#$%^&*?_~].*[!,@#$%^&*?_~])/)) // [verified] at least two special characters
|
|
34
|
+
{
|
|
35
|
+
intScore = (intScore+5);
|
|
36
|
+
} // COMBOS
|
|
37
|
+
if (passwd.match(/[a-z]/) && passwd.match(/[A-Z]/)) // [verified] both upper and lower case
|
|
38
|
+
{
|
|
39
|
+
intScore = (intScore+2);
|
|
40
|
+
} if (passwd.match(/\d/) && passwd.match(/\D/)) // [verified] both letters and numbers
|
|
41
|
+
{
|
|
42
|
+
intScore = (intScore+2);
|
|
43
|
+
} // [Verified] Upper Letters, Lower Letters, numbers and special characters
|
|
44
|
+
if (passwd.match(/[a-z]/) && passwd.match(/[A-Z]/) && passwd.match(/\d/) && passwd.match(/[!,@#$%^&*?_~]/))
|
|
45
|
+
{
|
|
46
|
+
intScore = (intScore+2);
|
|
47
|
+
}
|
|
48
|
+
return intScore;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
toggle_published_at = function(state) {
|
|
53
|
+
$$("#published_at select").each(function(item) {
|
|
54
|
+
if (state) {
|
|
55
|
+
item.enable();
|
|
56
|
+
} else {
|
|
57
|
+
item.disable();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
toggle_published_to = function(state) {
|
|
63
|
+
$$("#published_to select").each(function(item) {
|
|
64
|
+
if (state) {
|
|
65
|
+
item.enable();
|
|
66
|
+
} else {
|
|
67
|
+
item.disable();
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
insertAtCursor = function(myField, myValue) {
|
|
73
|
+
//IE support
|
|
74
|
+
if (document.selection) {
|
|
75
|
+
myField.focus();
|
|
76
|
+
sel = document.selection.createRange();
|
|
77
|
+
sel.text = myValue;
|
|
78
|
+
}
|
|
79
|
+
//MOZILLA/NETSCAPE support
|
|
80
|
+
else if (myField.selectionStart || myField.selectionStart == '0') {
|
|
81
|
+
var startPos = myField.selectionStart;
|
|
82
|
+
var endPos = myField.selectionEnd;
|
|
83
|
+
myField.value = myField.value.substring(0, startPos)
|
|
84
|
+
+ myValue
|
|
85
|
+
+ myField.value.substring(endPos, myField.value.length);
|
|
86
|
+
} else {
|
|
87
|
+
myField.value += myValue;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// get and encode the form authenticity token new in Rails 2.0
|
|
92
|
+
// http://www.saynotomilk.com/archives/33
|
|
93
|
+
var AJ = {
|
|
94
|
+
encode_authenticity_token:function(token) {
|
|
95
|
+
return encodeURIComponent($(token).value);
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
authenticity_token:function() {
|
|
99
|
+
return AJ.encode_authenticity_token($$('input[name="authenticity_token"]')[0]);
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
authenticity_token_query_parameter_for_page:function() {
|
|
103
|
+
return 'authenticity_token=' + authenticity_token;
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
ajax_request:function(url) {
|
|
107
|
+
new Ajax.Request(url, {asynchronous:true, evalScripts:true, parameters:AJ.authenticity_token_query_parameter_for_page()});
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
init_featuring = function() {
|
|
112
|
+
$$('a.feature').each(function(link) {
|
|
113
|
+
link.onclick = function() {
|
|
114
|
+
new Ajax.Request(this.href, {
|
|
115
|
+
method: 'get',
|
|
116
|
+
onSuccess : function(response) {
|
|
117
|
+
// If no rjs response
|
|
118
|
+
if (response.responseText.blank()) {
|
|
119
|
+
link.toggleClassName('featured');
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
return false;
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
document.observe('dom:loaded', init_featuring);
|
|
128
|
+
|
|
129
|
+
init_tabs = function() {
|
|
130
|
+
sub_headings = $$("#sub-content h2");
|
|
131
|
+
if (sub_headings.length > 1) {
|
|
132
|
+
sub_headings.each(function(item) {
|
|
133
|
+
item.addClassName('drop-down');
|
|
134
|
+
if(!item.next().hasClassName("default")) {
|
|
135
|
+
item.next().hide();
|
|
136
|
+
} else {
|
|
137
|
+
item.addClassName('open');
|
|
138
|
+
}
|
|
139
|
+
item.onclick = function() {
|
|
140
|
+
this.toggleClassName('open');
|
|
141
|
+
this.next().toggle();
|
|
142
|
+
return false;
|
|
143
|
+
};
|
|
144
|
+
item.onmouseover = function() { this.addClassName('sfhover'); };
|
|
145
|
+
item.onmouseout = function() { this.removeClassName('sfhover'); };
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
document.observe("dom:loaded", init_tabs);
|
|
150
|
+
|
|
151
|
+
init_flash_messages = function() {
|
|
152
|
+
|
|
153
|
+
$$('div.flash').each(function(flash){
|
|
154
|
+
if (!flash.init) {
|
|
155
|
+
flash.blindUp({
|
|
156
|
+
delay: 5,
|
|
157
|
+
afterFinish:function(effect) { effect.element.remove(); }
|
|
158
|
+
});
|
|
159
|
+
flash.onclick = function() {
|
|
160
|
+
this.remove();
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
document.observe("dom:loaded", init_flash_messages);
|
|
166
|
+
|
|
167
|
+
function getAssetIDs()
|
|
168
|
+
{
|
|
169
|
+
if ($('asset-list') != undefined)
|
|
170
|
+
{
|
|
171
|
+
var assets = new Array();
|
|
172
|
+
var count = 0;
|
|
173
|
+
|
|
174
|
+
$$('#asset-list li').each(function(li)
|
|
175
|
+
{
|
|
176
|
+
asset_id = li.id.split('-').last();
|
|
177
|
+
assets[count] = asset_id;
|
|
178
|
+
count++;
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
return assets;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return [];
|
|
185
|
+
}
|