talia_core 0.4.22 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. data/VERSION.yml +2 -2
  2. data/config/database.yml +9 -9
  3. data/config/rdfstore.yml +4 -4
  4. data/config/talia_core.yml +5 -2
  5. data/generators/generator_helpers.rb +66 -25
  6. data/generators/talia_admin/talia_admin_generator.rb +9 -9
  7. data/generators/talia_admin/templates/app/controllers/admin/admin_site_controller.rb +5 -0
  8. data/generators/talia_admin/templates/app/controllers/admin/custom_templates_controller.rb +7 -0
  9. data/generators/talia_admin/templates/app/controllers/admin/front_controller.rb +19 -0
  10. data/generators/talia_admin/templates/app/controllers/admin/talia_collections_controller.rb +7 -0
  11. data/generators/talia_admin/templates/app/controllers/admin/talia_sources_controller.rb +17 -0
  12. data/generators/talia_admin/templates/app/controllers/admin/users_controller.rb +7 -0
  13. data/generators/talia_admin/templates/app/controllers/users_controller.rb +7 -0
  14. data/generators/talia_admin/templates/app/helpers/admin/front_helper.rb +2 -0
  15. data/generators/talia_admin/templates/app/helpers/admin/talia_sources_helper.rb +7 -0
  16. data/generators/talia_admin/templates/app/helpers/users_helper.rb +2 -0
  17. data/generators/talia_admin/templates/app/models/guest.rb +7 -0
  18. data/generators/talia_admin/templates/app/models/talia_collection.rb +56 -0
  19. data/generators/talia_admin/templates/app/models/talia_source.rb +43 -0
  20. data/generators/talia_admin/templates/app/models/user.rb +59 -0
  21. data/generators/talia_admin/templates/app/models/user_mailer.rb +14 -0
  22. data/generators/talia_admin/templates/app/viewhints/talia_source_hints.rb +3 -0
  23. data/generators/talia_admin/templates/app/views/admin/custom_templates/index.dryml +7 -0
  24. data/generators/talia_admin/templates/app/views/admin/front/index.dryml +29 -0
  25. data/generators/talia_admin/templates/app/views/admin/front/summary.dryml +103 -0
  26. data/generators/talia_admin/templates/app/views/admin/talia_collections/index.dryml +7 -0
  27. data/generators/talia_admin/templates/app/views/admin/talia_sources/index.dryml +17 -0
  28. data/generators/talia_admin/templates/app/views/admin/talia_sources/show.dryml +8 -0
  29. data/generators/talia_admin/templates/app/views/admin/users/index.dryml +7 -0
  30. data/generators/talia_admin/templates/app/views/taglibs/admin_site.dryml +91 -0
  31. data/generators/talia_admin/templates/app/views/taglibs/application.dryml +9 -0
  32. data/generators/talia_admin/templates/app/views/taglibs/auto/admin/rapid/cards.dryml +34 -0
  33. data/generators/talia_admin/templates/app/views/taglibs/auto/admin/rapid/forms.dryml +71 -0
  34. data/generators/talia_admin/templates/app/views/taglibs/auto/admin/rapid/pages.dryml +543 -0
  35. data/generators/talia_admin/templates/app/views/taglibs/auto/rapid/cards.dryml +37 -0
  36. data/generators/talia_admin/templates/app/views/taglibs/auto/rapid/forms.dryml +35 -0
  37. data/generators/talia_admin/templates/app/views/taglibs/auto/rapid/pages.dryml +175 -0
  38. data/generators/talia_admin/templates/app/views/taglibs/front_site.dryml +1 -0
  39. data/generators/talia_admin/templates/app/views/taglibs/themes/clean/clean.dryml +10 -0
  40. data/generators/talia_admin/templates/app/views/user_mailer/forgot_password.erb +10 -0
  41. data/generators/talia_admin/templates/config/hobo_initializer.rb +1 -0
  42. data/generators/talia_admin/templates/migrations/create_users.rb +22 -0
  43. data/generators/talia_admin/templates/public/hobothemes/clean/images/101-3B5F87-ACD3E6.png +0 -0
  44. data/generators/talia_admin/templates/public/hobothemes/clean/images/30-3E547A-242E42.png +0 -0
  45. data/generators/talia_admin/templates/public/hobothemes/clean/images/30-DBE1E5-FCFEF5.png +0 -0
  46. data/generators/talia_admin/templates/public/hobothemes/clean/images/300-ACD3E6-fff.png +0 -0
  47. data/generators/talia_admin/templates/public/hobothemes/clean/images/50-ACD3E6-fff.png +0 -0
  48. data/generators/talia_admin/templates/public/hobothemes/clean/images/fieldbg.gif +0 -0
  49. data/generators/talia_admin/templates/public/hobothemes/clean/images/pencil.png +0 -0
  50. data/generators/talia_admin/templates/public/hobothemes/clean/images/small_close.png +0 -0
  51. data/generators/talia_admin/templates/public/hobothemes/clean/images/spinner.gif +0 -0
  52. data/generators/talia_admin/templates/public/hobothemes/clean/stylesheets/clean.css +326 -0
  53. data/generators/talia_admin/templates/public/hobothemes/clean/stylesheets/rapid-ui.css +100 -0
  54. data/generators/talia_admin/templates/public/javascripts/IE7.js +2 -0
  55. data/generators/talia_admin/templates/public/javascripts/blank.gif +0 -0
  56. data/generators/talia_admin/templates/public/javascripts/dryml-support.js +132 -0
  57. data/generators/talia_admin/templates/public/javascripts/hobo-rapid.js +937 -0
  58. data/generators/talia_admin/templates/public/javascripts/ie7-recalc.js +166 -0
  59. data/generators/talia_admin/templates/public/javascripts/lowpro.js +43 -25
  60. data/generators/talia_admin/templates/public/stylesheets/application.css +0 -0
  61. data/generators/talia_admin/templates/public/stylesheets/hobo-rapid.css +94 -0
  62. data/generators/talia_admin/templates/public/stylesheets/reset.css +95 -0
  63. data/generators/talia_admin/templates/test/fixtures/users.yml +7 -0
  64. data/generators/talia_admin/templates/test/functional/admin/{custom_templates_controller_test.rb → front_controller_test.rb} +1 -1
  65. data/generators/talia_admin/templates/test/functional/users_controller_test.rb +8 -0
  66. data/generators/talia_admin/templates/test/unit/user_test.rb +8 -0
  67. data/generators/talia_base/talia_base_generator.rb +24 -17
  68. data/generators/talia_oai/USAGE +0 -0
  69. data/generators/talia_oai/talia_oai_generator.rb +19 -0
  70. data/generators/talia_oai/templates/oai_controller.rb +9 -0
  71. data/generators/talia_oai/templates/oai_initializer.rb +16 -0
  72. data/lib/custom_template.rb +24 -0
  73. data/lib/talia_core/active_source_parts/class_methods.rb +1 -1
  74. data/lib/talia_core/active_source_parts/finders.rb +4 -0
  75. data/lib/talia_core/collection.rb +4 -0
  76. data/lib/talia_core/oai/active_source_model.rb +113 -0
  77. data/lib/talia_core/oai/active_source_oai_adapter/class_methods.rb +17 -0
  78. data/lib/talia_core/oai/active_source_oai_adapter.rb +106 -0
  79. data/lib/talia_core/semantic_property.rb +1 -0
  80. data/lib/talia_core/semantic_relation.rb +1 -0
  81. data/test/talia_core/active_source_test.rb +13 -0
  82. metadata +71 -59
  83. data/generators/talia_admin/templates/controllers/admin/background_controller.rb +0 -52
  84. data/generators/talia_admin/templates/controllers/admin/custom_templates_controller.rb +0 -25
  85. data/generators/talia_admin/templates/controllers/admin/locales_controller.rb +0 -15
  86. data/generators/talia_admin/templates/controllers/admin/roles_controller.rb +0 -8
  87. data/generators/talia_admin/templates/controllers/admin/sources_controller.rb +0 -9
  88. data/generators/talia_admin/templates/controllers/admin/translations_controller.rb +0 -61
  89. data/generators/talia_admin/templates/controllers/admin/users_controller.rb +0 -10
  90. data/generators/talia_admin/templates/controllers/admin_controller.rb +0 -7
  91. data/generators/talia_admin/templates/helpers/admin/background_helper.rb +0 -60
  92. data/generators/talia_admin/templates/helpers/admin/custom_templates_helper.rb +0 -5
  93. data/generators/talia_admin/templates/helpers/admin/locales_helper.rb +0 -2
  94. data/generators/talia_admin/templates/helpers/admin/roles_helper.rb +0 -2
  95. data/generators/talia_admin/templates/helpers/admin/sources_helper.rb +0 -65
  96. data/generators/talia_admin/templates/helpers/admin/translations_helper.rb +0 -51
  97. data/generators/talia_admin/templates/helpers/admin/users_helper.rb +0 -11
  98. data/generators/talia_admin/templates/helpers/admin_helper.rb +0 -30
  99. data/generators/talia_admin/templates/migrations/populate_users.rb +0 -14
  100. data/generators/talia_admin/templates/models/role.rb +0 -3
  101. data/generators/talia_admin/templates/public/javascripts/backend.js +0 -24
  102. data/generators/talia_admin/templates/public/stylesheets/talia_core/backend.css +0 -463
  103. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/body_bg.gif +0 -0
  104. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/footer_bg.gif +0 -0
  105. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/header.jpg +0 -0
  106. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/header_bg.gif +0 -0
  107. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/menu.jpg +0 -0
  108. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/menu_bg.gif +0 -0
  109. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/opednid.gif +0 -0
  110. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/page_bg.jpg +0 -0
  111. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/triangolino.gif +0 -0
  112. data/generators/talia_admin/templates/public/stylesheets/talia_core/images/backend/triangolino_full.gif +0 -0
  113. data/generators/talia_admin/templates/test/functional/admin/locales_controller_test.rb +0 -35
  114. data/generators/talia_admin/templates/test/functional/admin/sources_controller_test.rb +0 -109
  115. data/generators/talia_admin/templates/test/functional/admin/translations_controller_test.rb +0 -93
  116. data/generators/talia_admin/templates/test/functional/admin/users_controller_test.rb +0 -67
  117. data/generators/talia_admin/templates/test/functional/admin_controller_test.rb +0 -15
  118. data/generators/talia_admin/templates/views/admin/background/_finished.html.erb +0 -9
  119. data/generators/talia_admin/templates/views/admin/background/_pending.html.erb +0 -1
  120. data/generators/talia_admin/templates/views/admin/background/_progress.html.erb +0 -15
  121. data/generators/talia_admin/templates/views/admin/background/_running.html.erb +0 -11
  122. data/generators/talia_admin/templates/views/admin/background/environment.html.erb +0 -12
  123. data/generators/talia_admin/templates/views/admin/background/show.html.erb +0 -17
  124. data/generators/talia_admin/templates/views/admin/background/stderr.html.erb +0 -6
  125. data/generators/talia_admin/templates/views/admin/background/stdin.html.erb +0 -6
  126. data/generators/talia_admin/templates/views/admin/background/stdout.html.erb +0 -6
  127. data/generators/talia_admin/templates/views/admin/custom_templates/_content_form_column.rhtml +0 -2
  128. data/generators/talia_admin/templates/views/admin/custom_templates/_template_type_form_column.rhtml +0 -2
  129. data/generators/talia_admin/templates/views/admin/index.html.erb +0 -5
  130. data/generators/talia_admin/templates/views/admin/locales/new.html.erb +0 -9
  131. data/generators/talia_admin/templates/views/admin/sources/_show.html.erb +0 -13
  132. data/generators/talia_admin/templates/views/admin/translations/_new_translation.html.erb +0 -7
  133. data/generators/talia_admin/templates/views/admin/translations/_translation.html.erb +0 -10
  134. data/generators/talia_admin/templates/views/admin/translations/edit.html.erb +0 -16
  135. data/generators/talia_admin/templates/views/layouts/admin.html.erb +0 -56
  136. data/generators/talia_base/templates/script/setup_talia_backend +0 -43
@@ -1,61 +0,0 @@
1
- class Admin::TranslationsController < ApplicationController
2
- layout 'admin'
3
- require_role 'admin'
4
- PER_PAGE = 30
5
-
6
- after_filter :flush_locale, :only => [:update, :destroy]
7
-
8
- # GET /admin/translations
9
- def index
10
- redirect_to edit_admin_translation_path(Locale.active.code)
11
- end
12
-
13
- # GET /admin/translations/search?key1=hello%20world&key2=good_morning
14
- def search
15
- keys = params.map {|key, value| value if key.to_s =~ /key/}.compact
16
- translations = ViewTranslation.find_by_locale_and_tr_key(params[:locale], keys)
17
- session[:reference_locale] = params[:locale]
18
-
19
- respond_to do |format|
20
- format.js { render :layout => false, :inline => translations.to_json }
21
- end
22
- end
23
-
24
- # GET /admin/translations/en-US/edit
25
- def edit
26
- @translations = ViewTranslation.find_by_locale(params[:id], :order => "tr_key ASC")
27
- @locale_code = params[:id]
28
- @autoload = load_reference_translations?
29
- end
30
-
31
- # PUT /admin/translations/en-US
32
- def update
33
- if ViewTranslation.create_or_update(params[:translations], params[:id])
34
- flash[:notice] = 'Your translations has been saved'
35
- else
36
- flash[:error] = 'There was some problems'
37
- end
38
-
39
- redirect_to edit_admin_translation_path(params[:id])
40
- end
41
-
42
- # DELETE /admin/translations/1
43
- def destroy
44
- @translation = ViewTranslation.find(params[:id])
45
- @translation.destroy
46
-
47
- respond_to do |format|
48
- format.html do
49
- flash[:notice] = 'Your translation has been deleted'
50
- redirect_to edit_admin_translation_path(params[:locale])
51
- end
52
- format.js
53
- end
54
- end
55
-
56
- private
57
-
58
- def load_reference_translations?
59
- !!session[:reference_locale] && session[:reference_locale] != params[:locale]
60
- end
61
- end
@@ -1,10 +0,0 @@
1
- class Admin::UsersController < ApplicationController
2
- require_role 'admin'
3
- layout 'admin'
4
-
5
- active_scaffold :user do |config|
6
- config.columns = [:login, :name, :email, :password, :password_confirmation, :roles]
7
- list.columns.exclude :password, :password_confirmation
8
- end
9
-
10
- end
@@ -1,7 +0,0 @@
1
- class AdminController < ApplicationController
2
- require_role 'admin'
3
-
4
- def index
5
- end
6
-
7
- end
@@ -1,60 +0,0 @@
1
- module Admin::BackgroundHelper
2
-
3
- def render_job
4
- case(@job.state)
5
- when 'finished'
6
- render :partial => 'finished'
7
- when 'running'
8
- render :partial => 'running'
9
- when 'pending'
10
- render :partial => 'pending'
11
- else
12
- "Unknown state #{@job.state}"
13
- end
14
- end
15
-
16
- def progress_eta
17
- return 'Finishing...' unless(@progress_job.percentage < 100)
18
- ('ETA: ' + duration_s(@progress_job.eta)).gsub(' ', '&nbsp;')
19
- end
20
-
21
- def job_tag
22
- "- #{@job.tag}" if(@job.tag)
23
- end
24
-
25
- def job_duration
26
- finished = @job.finished_at || Time.now
27
- duration_s(finished - @job.started_at)
28
- end
29
-
30
- def job_link
31
- link_to('Back to job', :action => 'show', :id => @job.id)
32
- end
33
-
34
- def stdout_link
35
- link_to('View STDOUT', :action => 'stdout', :id => @job.id) unless(@job.stdout.blank?)
36
- end
37
-
38
- def stderr_link
39
- link_to('View STDERR', :action => 'stderr', :id => @job.id) unless(@job.stderr.blank?)
40
- end
41
-
42
- def stdin_link
43
- link_to('View STDIN', :action => 'stdin', :id => @job.id) unless(@job.stdin.blank?)
44
- end
45
-
46
- def environment_link
47
- link_to('Runtime Environment', :action => 'environment', :id => @job.id) unless(@job.env.blank?)
48
- end
49
-
50
- def duration_s(seconds)
51
- minutes, seconds = seconds.divmod(60)
52
- hours, minutes = (minutes == 0) ? [0, 0] : minutes.divmod(60)
53
- duration_s = ''
54
- (duration_s << "#{hours.to_i} hours ") if(hours != 0)
55
- (duration_s << "#{minutes.to_i} minutes ") if(minutes != 0)
56
- duration_s << "#{seconds.to_i} seconds"
57
- duration_s
58
- end
59
-
60
- end
@@ -1,5 +0,0 @@
1
- module Admin::CustomTemplatesHelper
2
- def content_column(record)
3
- h(record.content[0..20] + ' ...')
4
- end
5
- end
@@ -1,2 +0,0 @@
1
- module Admin::LocalesHelper
2
- end
@@ -1,2 +0,0 @@
1
- module Admin::RolesHelper
2
- end
@@ -1,65 +0,0 @@
1
- module Admin::SourcesHelper
2
- def add_another_predicate(namespace)
3
- link_to_function image_tag('add.png', :size => '12x12', :alt => 'Add another predicate for '+namespace, :class => 'add') do |page|
4
- page.insert_html :bottom, 'new_predicates_for_'+namespace.underscore, :partial => 'predicate', :object => TaliaCore::Source.new(''), :locals => {:namespace => namespace, :name => ''}
5
- page[namespace.underscore].select('.predicate').last.visual_effect :highlight
6
- page << "attachAjaxAutocompleterOnNewElement('"+h(namespace.underscore)+"');"
7
- page << "showPredicatesOfDiv('"+h(namespace.underscore)+"');"
8
- end
9
- end
10
-
11
- def show_upload_form
12
- link_to_function "upload", :id => 'upload_link' do |page|
13
- page.replace_html 'data_form', :partial => 'upload'
14
- page['upload_link'].visual_effect :fade, :duration => 0.001
15
- page['data_form'].visual_effect :appear, :duration => 0.4
16
- end
17
- end
18
-
19
- def hide_upload_form
20
- link_to_function "cancel" do |page|
21
- page['data_form'].visual_effect :fade, :duration => 0.001
22
- page['upload_link'].visual_effect :appear, :duration => 0.4
23
- page.replace_html 'data_form', ''
24
- end
25
- end
26
-
27
- def file_type(data_type)
28
- data_type = case data_type
29
- when Class
30
- data_type.name
31
- when nil
32
- 'Record'
33
- else
34
- data_type
35
- end.demodulize.gsub(/(Data|Simple|Media)/, '').gsub(/Record/, 'File').upcase
36
-
37
- %(<span class="data #{h data_type.downcase}">#{h data_type}</span>)
38
- end
39
-
40
- # Use this method in your view to generate a return for the AJAX autocomplete requests.
41
- #
42
- # Example action:
43
- #
44
- # def auto_complete_for_item_title
45
- # @items = Item.find(:all,
46
- # :conditions => [ 'LOWER(description) LIKE ?',
47
- # '%' + request.raw_post.downcase + '%' ])
48
- # render :inline => "<%= auto_complete_result(@items, 'description') %>"
49
- # end
50
- #
51
- # The auto_complete_result can of course also be called from a view belonging to the
52
- # auto_complete action if you need to decorate it further.
53
- def auto_complete_result(entries, field, phrase = nil)
54
- return unless entries
55
- items = entries.map { |entry| content_tag("li", phrase ? highlight(entry.send(field), phrase) : h(entry.send(field))) }
56
- content_tag("ul", items.uniq)
57
- end
58
-
59
- def escaped_source_identifiers(source)
60
- tokens = source.uri.to_s.split('/')
61
- name = unescape(tokens.pop)
62
- uri = tokens.join('/') + "/" + unescape_link(name)
63
- [ uri, name ]
64
- end
65
- end
@@ -1,51 +0,0 @@
1
- module Admin::TranslationsHelper
2
- # Always pick fresh locales, instead of rely on application.rb
3
- # This because application.rb is evaluated once in production mode.
4
- # TODO: Rely on globalize2 when migrate to Rails 2.2.2
5
- delegate :locales, :to => I18n
6
-
7
- def add_translation
8
- link_to_function "Add a translation" do |page|
9
- page.insert_html :bottom, "translations", :partial => 'new_translation', :object => ViewTranslation.new
10
- page['translations'].select('.translation').last.focus
11
- end
12
- end
13
-
14
- def add_locale
15
- link_to "Add locale", :controller => 'admin/locales', :action => 'new'
16
- end
17
-
18
- def languages_picker
19
- content_tag(:div, :id => 'languages_picker') do
20
- returning result = "Pick a language: " do
21
- result << select_tag("languages", languages_options_tags(params[:id]), :onchange => change_language_function)
22
- result << " | #{reference_translations_picker} | #{add_locale} | #{add_translation}"
23
- end
24
- end
25
- end
26
-
27
- def reference_translations_picker
28
- returning result = "Load translations: " do
29
- result << select_tag("reference_languages", languages_options_tags(session[:reference_locale] || params[:id], false))
30
- end
31
- end
32
-
33
- def languages_options_tags(locale_code, include_url = true)
34
- locales.map do |language, locale|
35
- language = language.to_s.titleize
36
- selected = "selected" if locale_code.match %r{#{locale}}
37
- value = include_url ? edit_admin_translation_url(locale) : locale
38
- content_tag(:option, language, :value => value, :selected => selected)
39
- end
40
- end
41
-
42
- def delete_admin_traslation_path(translation, params)
43
- admin_translation_path(translation) + "?locale=" + params[:id] + "&page=" + (params[:page] || "1")
44
- end
45
-
46
- def autoload_reference_translations
47
- content_for :javascript do
48
- javascript_tag "var autoloadReferenceTranslations = #{@autoload};"
49
- end
50
- end
51
- end
@@ -1,11 +0,0 @@
1
- module Admin::UsersHelper
2
-
3
- def password_form_column(record, field_name)
4
- password_field_tag field_name, record.password
5
- end
6
-
7
- def password_confirmation_form_column(record, field_name)
8
- password_field_tag field_name, record.password_confirmation
9
- end
10
-
11
- end
@@ -1,30 +0,0 @@
1
- module AdminHelper
2
- def admin_toolbar
3
- widget(:toolbar, :buttons => [
4
- ["Home", {:controller => 'source', :action => 'show', :id => 'Lucca'}],
5
- ["Admin", {:action => 'index'} ],
6
- ["Sources", {:controller => 'admin/sources' }],
7
- ["Users", { :controller => 'admin/users'} ],
8
- ["Print Page", "javascript:print();"]
9
- ] )
10
- end
11
-
12
- # Returns the title for the whole page. This returns the value
13
- # set in the controller, or a default value
14
- def page_title
15
- @page_title || TaliaCore::SITE_NAME
16
- end
17
-
18
- # Show each <tt>flash</tt> status (<tt>:notice</tt>, <tt>:error</tt>) only if it's present.
19
- def show_flash
20
- [:notice, :error].collect do |status|
21
- %(<div id="#{status}">#{flash[status]}</div>) unless flash[status].nil?
22
- end
23
- end
24
-
25
- # Defines the pages that are visible in the menu
26
- def active_pages
27
- %w(users background sources) # translations not working at the moment, templates not ready for generic use
28
- end
29
-
30
- end
@@ -1,14 +0,0 @@
1
- class PopulateUsers < ActiveRecord::Migration
2
- def self.up
3
- admins = Role.create :name => 'admin'
4
- users = Role.create :name => 'user'
5
- admin = User.create :login => 'admin', :email => 'admin@admins.com', :password => 'adminadmin', :password_confirmation => 'adminadmin'
6
- admin.roles << admins
7
- admins.save!
8
- users.save!
9
- admin.save!
10
- end
11
-
12
- def self.down
13
- end
14
- end
@@ -1,3 +0,0 @@
1
- class Role < ActiveRecord::Base
2
- has_and_belongs_to_many :users
3
- end
@@ -1,24 +0,0 @@
1
- //= require <prototype>
2
-
3
- // LOAD PAGE EVENT
4
- Event.observe(window, 'load', function() {
5
- setContentHeight();
6
- });
7
-
8
- // RESIZE PAGE EVENT
9
- window.onresize = function () {
10
- setContentHeight();
11
- }
12
-
13
- // Set the height of div content from back end
14
- function setContentHeight() {
15
- // SPROCKETIZED
16
- if(contents = $('contenuti')) {
17
- // Height of the whole window
18
- var windowHeight = document.viewport.getDimensions().height;
19
- // Top position of div content
20
- var contentPosY = $('contenuti').cumulativeOffset().top;
21
- contents.style.height = ( windowHeight - contentPosY ) + "px";
22
- }
23
- }
24
-