infopark_cloud_connector 7.0.2 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +8 -8
  2. data/app/controllers/rails_connector/objs_controller.rb +29 -37
  3. data/app/helpers/rails_connector/cms_asset_helper.rb +1 -1
  4. data/app/helpers/rails_connector/cms_tag_helper.rb +1 -1
  5. data/app/helpers/rails_connector/default_cms_routing_helper.rb +1 -3
  6. data/app/helpers/rails_connector/display_helper.rb +5 -1
  7. data/app/views/rails_connector/_editing_javascript.html.erb +3 -2
  8. data/config/ca-bundle.crt +2 -2
  9. data/config/routes.rb +3 -0
  10. data/lib/assets/fonts/infopark_icons-webfont.eot +0 -0
  11. data/lib/assets/fonts/infopark_icons-webfont.ttf +0 -0
  12. data/lib/assets/fonts/infopark_icons-webfont.woff +0 -0
  13. data/lib/assets/images/apple-touch-icon.jpg +0 -0
  14. data/lib/assets/images/favicon.ico +0 -0
  15. data/lib/assets/images/ip_logo.svg +50 -0
  16. data/lib/assets/javascripts/infopark_editing.js +903 -164
  17. data/lib/assets/stylesheets/infopark_editing.css +222 -271
  18. data/lib/infopark_cloud_connector.rb +0 -1
  19. data/lib/rails_connector/attribute_content.rb +25 -74
  20. data/lib/rails_connector/backend_error.rb +4 -0
  21. data/lib/rails_connector/basic_obj.rb +173 -20
  22. data/lib/rails_connector/basic_widget.rb +42 -1
  23. data/lib/rails_connector/blob.rb +1 -1
  24. data/lib/rails_connector/cache_middleware.rb +2 -2
  25. data/lib/rails_connector/cms_backend.rb +51 -33
  26. data/lib/rails_connector/cms_rest_api.rb +13 -8
  27. data/lib/rails_connector/cms_rest_api/attribute_serializer.rb +62 -0
  28. data/lib/rails_connector/cms_rest_api/blob_uploader.rb +18 -0
  29. data/lib/rails_connector/communication_error.rb +17 -0
  30. data/lib/rails_connector/configuration.rb +28 -0
  31. data/lib/rails_connector/connection_manager.rb +2 -2
  32. data/lib/rails_connector/content_conversion.rb +16 -62
  33. data/lib/rails_connector/content_service.rb +2 -2
  34. data/lib/rails_connector/engine.rb +2 -1
  35. data/lib/rails_connector/html_string.rb +0 -1
  36. data/lib/rails_connector/link.rb +41 -33
  37. data/lib/rails_connector/link_parser.rb +72 -0
  38. data/lib/rails_connector/migrations/migration_dsl.rb +13 -0
  39. data/lib/rails_connector/{backend_not_available.rb → network_error.rb} +1 -6
  40. data/lib/rails_connector/obj_data.rb +4 -0
  41. data/lib/rails_connector/obj_data_from_hash.rb +6 -0
  42. data/lib/rails_connector/obj_data_from_service.rb +37 -3
  43. data/lib/rails_connector/obj_params_parser.rb +50 -0
  44. data/lib/rails_connector/obj_search_builder.rb +62 -0
  45. data/lib/rails_connector/obj_search_enumerator.rb +60 -5
  46. data/lib/rails_connector/rate_limit_exceeded.rb +5 -0
  47. data/lib/rails_connector/revision.rb +9 -0
  48. data/lib/rails_connector/string_tagging.rb +1 -12
  49. data/lib/rails_connector/text_link.rb +52 -0
  50. data/lib/rails_connector/text_link_conversion.rb +50 -0
  51. data/lib/rails_connector/workspace.rb +125 -3
  52. data/lib/rails_connector/workspace_data_from_service.rb +30 -31
  53. data/lib/rails_connector/workspace_selection_middleware.rb +62 -20
  54. data/lib/tasks/cache.rake +2 -0
  55. data/lib/tasks/rails_connector/cache_garbage_collector_task.rb +98 -0
  56. metadata +24 -17
  57. data/lib/assets/images/ip_logo_app.png +0 -0
  58. data/lib/assets/images/ip_logo_app2x.png +0 -0
  59. data/lib/assets/images/irongrip.png +0 -0
  60. data/lib/rails_connector/link_resolvable.rb +0 -9
  61. data/lib/rails_connector/rack_middlewares.rb +0 -6
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjJjMWIxMWM5ZDliZGZlZTNlNjg0OWNjOTVlNjkwMjg3NzZjNDgxZQ==
4
+ OWYzMmRjMTE3YWVjMTlmMTA0ODE4MzAzMjlhYWM1NGNlYzJjZGJjMA==
5
5
  data.tar.gz: !binary |-
6
- OGE3MDQ0YjUwNDJjMjEwNjYyNzIzY2VkNDBlYzAzMjcyOGZhZTk5NA==
6
+ ZWFmOWViMGQwMWU0ZjVmNTk5MDhhMThjNGVmZjFhYmM0NWI3MTk1NQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTI5NGNiMTJjMDZjMWQ5NzVlMzU4MWQzOTEwZjY1ZGFjMDE3YjgyMDIwZmQy
10
- MGY2YTNlZTI1MjFjYmNlZGYwMjc2N2NkODNkYzUwYWRiZWM5OWZiNDNhMzIy
11
- NjUxZjdmMjM3NDM2ZDBkMjYyYmEzNDk1MTZlODUwMjU1NjRkYTE=
9
+ NTEwNTBiNjRlZWZmNDJiNTYwNWNjODE2MjM2ZTI1NzhmNWE3ZDEyOGYwYThh
10
+ NDI0OTY0MDY2MTY0ZmI5MDgwMmU1YTQ2YTFkOWQxODQyNTYzNTAxNDVjYzg3
11
+ YzIyYzA1Zjk5YmNlOGVhYTgwZjczNjI0MzVjMmY0NmFmZmI2M2E=
12
12
  data.tar.gz: !binary |-
13
- ZmNmNDM5ZTAzYTY5OWMyZTJlMmE0MTNkNGMxODJlMTlkOWExOTJhMTIwYjQ3
14
- ZThhYmUxMWI4ZGZlMzk0YzI1NGI0MjNjOWMxNzg4ODJhOWU3ZDBlYjRiYjc1
15
- ZDExNzFiMTc4YTA5OTZlZjY0NGI4M2M5ODAxMmQxN2Q2NDRjMmE=
13
+ MGJlOWRkNmZhZDg0MmQ1ZDNjYjI4MTNmODVmMWVlMDY4ODgxYjM0MWU3NWJi
14
+ ZDFmZTE4YzdlY2E1NGE3YmE4Yjg1ODEyZDc2NTJkM2M1NzBlZDRhNWMyYTFl
15
+ ODkyNTc5M2RhMTU5ODJiYTRlZWM4YmRmY2I2ZTA1MWM2ZmU0YWI=
@@ -1,7 +1,7 @@
1
1
  module RailsConnector
2
2
 
3
3
  class ObjsController < WebserviceController
4
- before_filter :load_object, only: [:edit, :update, :destroy,
4
+ before_filter :load_object, only: [:edit, :update, :destroy, :revert,
5
5
  :show_widget, :widget_class_selection, :create_widget, :edit_widget]
6
6
 
7
7
  def create
@@ -29,6 +29,12 @@ module RailsConnector
29
29
  render json: {}
30
30
  end
31
31
 
32
+ def revert
33
+ @obj.revert
34
+
35
+ render json: {}
36
+ end
37
+
32
38
  def copy
33
39
  render json: copy_obj(get_obj_attributes(params[:id]), params[:parent_path])
34
40
  end
@@ -95,53 +101,39 @@ module RailsConnector
95
101
  render json: {markup: markup}
96
102
  end
97
103
 
98
- private
99
-
100
- def load_object
101
- @obj = Obj.find(params[:id])
102
- end
103
-
104
- def obj_params
105
- params[:obj].tap do |p|
106
- raise "Required parameter 'obj' is missing." unless p.present?
107
- raise "Parameter 'obj' is not a hash." unless p.is_a?(Hash)
104
+ def search
105
+ query = MultiJson.decode(params[:query]).with_indifferent_access
106
+ search_builder = ObjSearchBuilder.new(query)
107
+ enumerator = search_builder.build
108
108
 
109
- if @obj
110
- convert_html_keys = p.keys.select do |key|
111
- @obj.type_of_attribute(key.to_s) == 'html'
112
- end
109
+ if params[:query_action] == 'size'
110
+ result = { total: enumerator.size }
111
+ else
112
+ batch = enumerator.load_batch
113
113
 
114
- convert_html_keys.each { |key| p[key] = convert_html_links(p[key]) }
115
-
116
- if widget_pool_params = p['_widget_pool']
117
- convert_widget_pool_params(@obj, widget_pool_params)
118
- end
119
- end
114
+ result = {
115
+ total: enumerator.size,
116
+ hits: batch
117
+ }
120
118
  end
119
+
120
+ render json: result
121
+ rescue ObjSearchEnumerator::UnregisteredObjFormat => e
122
+ render json: { error: e.message }, status: :not_found
121
123
  end
122
124
 
123
- def convert_widget_pool_params(obj, widget_pool_params)
124
- widget_pool_params.each_pair do |widget_id, widget_params|
125
- widget = obj.widget_from_pool(widget_id)
125
+ private
126
126
 
127
- if widget_params.present?
128
- widget_params.each_pair do |param_name, param_value|
129
- if widget.type_of_attribute(param_name) == 'html'
130
- widget_params[param_name] = convert_html_links(param_value)
131
- end
132
- end
133
- end
134
- end
127
+ def load_object
128
+ @obj = Obj.find(params[:id])
135
129
  end
136
130
 
137
- def convert_html_links(html)
138
- ContentConversion.convert_html_links(html, request.host, request.port)
131
+ def obj_params
132
+ ObjParamsParser.new(request.host, request.port).parse(@obj, params[:obj])
139
133
  end
140
134
 
141
135
  def copy_obj(attributes, target_path=nil)
142
- copied_attributes = attributes.reject do |key, _|
143
- %w{id _last_changed _permalink}.include?(key)
144
- end
136
+ copied_attributes = attributes.except!('id', '_permalink')
145
137
  copied_attributes['_path'] = "#{target_path}/#{SecureRandom.hex(6)}"
146
138
 
147
139
  task_unaware_request(:post, "workspaces/#{Workspace.current.id}/objs", obj: copied_attributes)
@@ -22,7 +22,7 @@ module RailsConnector
22
22
  # cms_image_tag @target, alt: 'Interesting picture', class: 'my_image'
23
23
  #
24
24
  # @overload cms_image_tag obj, linklist, tag_options={}, editing_options={}
25
- # @note If you do not specify an HTML +alt+ attribute, the helper method will use +obj+'s +display_title+.
25
+ # @note If you do not specify an HTML +alt+ attribute, the helper method will use +display_title+ of the target object.
26
26
  # Calculates HTML image tag for inplace editing.
27
27
  #
28
28
  # @param [Obj] obj Obj with an attribute of type {LinkList}.
@@ -61,7 +61,7 @@ module RailsConnector
61
61
  end
62
62
 
63
63
  if field_type == 'widget'
64
- rendered_widgets = obj_or_widget.widgets(field_name).map do |widget|
64
+ rendered_widgets = obj_or_widget[field_name].map do |widget|
65
65
  render_widget(widget, obj_or_widget, field_name, obj_or_widget)
66
66
  end
67
67
  inner_html = safe_join(rendered_widgets)
@@ -22,7 +22,6 @@ module RailsConnector
22
22
  cms_path_or_url(target, "url", options)
23
23
  end
24
24
 
25
- LINK_TO_UNREACHABLE = "#__target_object_not_reachable"
26
25
  LINK_TO_EMPTY_LINKLIST = "#__empty_linklist"
27
26
  LINK_TO_EMPTY_BLOB = "#__empty_blob"
28
27
 
@@ -44,7 +43,6 @@ module RailsConnector
44
43
  end
45
44
 
46
45
  def cms_path_or_url_for_links(link, path_or_url, options = {})
47
- return LINK_TO_UNREACHABLE if link.internal? && link.obj.nil?
48
46
  url = basic_url_or_path_for_link(link, path_or_url, options)
49
47
  url = url + "?#{link.query}" if link.query.present? && options.empty?
50
48
  url = url + "##{link.fragment}" if link.fragment.present?
@@ -83,7 +81,7 @@ module RailsConnector
83
81
  if link.internal?
84
82
  __send__("cms_#{path_or_url}", link.obj, options)
85
83
  else
86
- url = link.external_url
84
+ url = link.url
87
85
  options.delete(:dont_resolve_blobs)
88
86
  url = merge_options(url, options) if options.any?
89
87
  url
@@ -58,7 +58,11 @@ module RailsConnector
58
58
  def convert_links(html, cms_path_options = {})
59
59
  if html
60
60
  html.gsub(%r{<?\bobjid:([a-f0-9]{16})\b>?}) do
61
- cms_path(Obj.find($1), cms_path_options)
61
+ if obj = Obj.find_by_id($1)
62
+ cms_path(obj, cms_path_options)
63
+ else
64
+ "#__target_object_not_reachable"
65
+ end
62
66
  end
63
67
  end
64
68
  end
@@ -2,7 +2,7 @@
2
2
  <%= javascript_tag do %>
3
3
  $(function() {
4
4
  infopark.i18n.set_locale("<%= I18n.locale %>");
5
- infopark.editing.set_workspace(
5
+ infopark.gui.set_workspace(
6
6
  infopark.workspace.from_data({
7
7
  id: "<%= escape_javascript(RailsConnector::Workspace.current.id).html_safe %>",
8
8
  title: "<%= escape_javascript(RailsConnector::Workspace.current.title).html_safe %>"
@@ -12,7 +12,8 @@
12
12
  infopark.obj.current_page_obj_class_name = "<%= @obj.try(:obj_class) %>";
13
13
  infopark.obj.current_page_has_edit_view = <%= current_page_has_edit_view? %>;
14
14
  infopark.obj.current_page_has_children = <%= current_page_has_children? %>;
15
+ infopark.obj.current_page_modification = "<%= @obj.try(:modification) %>";
15
16
  infopark.admin_gui_base_url = "<%= RailsConnector::CmsRestApi.configuration.url %>";
16
- infopark.editing.initialize();
17
+ infopark.gui.initialize();
17
18
  });
18
19
  <% end %>
@@ -1,7 +1,7 @@
1
1
  ##
2
- ## /Network/Servers/xs2.infopark/Users/develop/dcc/tmp/Rails_Connector__Kris__dev__93/repos/cloud_connector/config/ca-bundle.crt -- Bundle of CA Root Certificates
2
+ ## /mnt/dcc/Cloud_Connector_57/repos/cloud_connector/config/ca-bundle.crt -- Bundle of CA Root Certificates
3
3
  ##
4
- ## Converted at: Thu Nov 21 10:33:57 2013 UTC
4
+ ## Converted at: Thu Feb 6 11:12:41 2014 UTC
5
5
  ##
6
6
  ## This is a bundle of X.509 certificates of public Certificate Authorities
7
7
  ## (CA). These were automatically extracted from Mozilla's root certificates
@@ -2,8 +2,11 @@ Rails.application.routes.draw do
2
2
  resources :objs, controller: 'rails_connector/objs', path: '__ipcms/objs',
3
3
  only: [:edit, :create, :update, :destroy] do
4
4
  get :page_class_selection, on: :collection
5
+ get :search, on: :collection
5
6
 
6
7
  member do
8
+ put :revert
9
+
7
10
  get :show_widget
8
11
  get :widget_class_selection
9
12
  post :create_widget
@@ -0,0 +1,50 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
3
+ <svg version="1.2" baseProfile="tiny" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
4
+ x="0px" y="0px" width="562.486px" height="104.032px" viewBox="0 0 562.486 104.032" xml:space="preserve">
5
+ <g>
6
+ <path fill="#CB061D" d="M0,0v99.705h153.578c7.758,0,14.104-6.254,14.104-13.925V13.837C167.682,6.257,161.247,0,153.578,0H0z"/>
7
+ <path fill="#FFFFFF" d="M116.201,34.556c5.196,0,8.547,4.232,8.547,9.345c0,5.026-3.352,9.262-8.375,9.345H99.539V65.5h17.894
8
+ c13.225-0.088,20.101-10.136,20.101-21.509c0-11.461-7.235-21.689-20.898-21.689h-7.312c-2.299,0-4.233,1.852-4.319,4.054v8.2
9
+ H116.201z M94.596,28.653c0-4.323-2.732-7.494-10.048-7.494c-5.377,0-9.879,1.671-9.879,7.932c0,4.323,2.471,7.493,9.879,7.493
10
+ C90.101,36.585,94.596,34.915,94.596,28.653 M77.229,50.869c0-2.29,2.029-4.059,4.319-4.141h9.346v33.233H77.229V50.869z"/>
11
+ <path fill="#FFFFFF" d="M223.729,43.585v36.876c0,4.739-2.591,7.105-7.981,7.105c-6.79,0-7.982-2.964-7.982-8.678V42.005
12
+ c0-4.337,2.39-7.091,5.986-7.091h3.594C221.539,34.915,223.729,37.868,223.729,43.585 M215.549,29.189
13
+ c-5.792,0-7.783-2.565-7.783-5.917c0-4.931,3.59-6.315,7.783-6.315c5.788,0,7.979,2.566,7.979,5.924
14
+ C223.528,27.809,219.942,29.189,215.549,29.189"/>
15
+ <path fill="#FFFFFF" d="M278.111,51.18v30.767c0,3.743-2.799,5.522-6.185,5.522h-2.197c-3.192,0-5.591-1.779-5.591-5.522V60.645
16
+ c0-9.076-2.995-13.61-8.581-13.61c-5.989,0-8.783,4.736-8.783,14.208v20.704c0,3.743-2.799,5.522-6.185,5.522h-2.198
17
+ c-3.395,0-5.591-1.975-5.591-6.114V42.303c0-3.747,2.196-5.718,6.99-5.718c3.987,0,7.181,1.38,9.778,1.38
18
+ c4.792,0,6.19-2.565,13.372-2.565C272.127,35.4,278.111,39.741,278.111,51.18"/>
19
+ <path fill="#FFFFFF" d="M304.934,52.663v27.799c0,4.54-2.202,6.909-7.393,6.909c-5.382,0-7.783-1.779-7.783-6.909V53.644
20
+ c0-9.464-7.58-7.696-7.58-12.628c0-3.348,2.791-4.13,5.783-6.696c1.201-0.989,1.201-2.768,2.798-8.29
21
+ c0.798-2.961,3.997-8.874,12.771-8.874h3.79c3.992,0,6.982,2.367,6.982,5.131c0,2.163,0.403,4.537-2.99,6.309
22
+ c-3.188,1.779-4.186,2.765-4.186,4.145c0,1.58,0.596,2.363,3.592,3.739c2.195,0.989,3.189,2.769,3.189,4.348
23
+ c0,3.547-4.986,4.729-6.588,5.914C305.931,47.727,304.934,49.893,304.934,52.663"/>
24
+ <path fill="#FFFFFF" d="M343.506,77.899c7.58,0,13.175-6.899,13.175-16.363c0-8.881-4.79-15.784-13.175-15.784
25
+ c-7.387,0-13.371,5.526-13.371,15.784C330.135,71,335.527,77.899,343.506,77.899 M342.907,88.357
26
+ c-15.167,0-26.946-9.275-26.946-26.625c0-18.545,13.378-26.625,27.35-26.625c12.773,0,27.544,6.902,27.544,26.429
27
+ C370.854,76.718,361.677,88.357,342.907,88.357"/>
28
+ <path fill="#FFFFFF" d="M399.977,78.592c10.975,0,11.779-13.807,11.779-17.756c0-8.873-3.998-15.972-11.383-15.972
29
+ c-6.788,0-11.98,6.309-11.98,16.962C388.393,71.685,393.188,78.592,399.977,78.592 M424.526,60.836
30
+ c0,16.968-7.591,27.023-21.363,27.023c-4.179,0-8.176-1.377-9.179-1.377c-3.191,0-5.386,1.771-5.386,7.885
31
+ c0,7.493-0.999,9.664-6.587,9.664c-5.192,0-6.586-2.171-6.586-6.704V42.502c0-3.75,1.997-5.721,6.189-5.721
32
+ c3.596,0,5.789,1.185,8.579,1.185c3.994,0,5.387-2.37,12.572-2.37C415.936,35.595,424.526,45.458,424.526,60.836"/>
33
+ <path fill="#FFFFFF" d="M448.988,78.388c5.192,0,10.383-4.729,10.383-9.859c0-2.561-1.4-4.728-4.997-4.728
34
+ c-4.192,0-12.569,2.757-12.569,8.286C441.805,75.432,444.602,78.388,448.988,78.388 M467.745,87.075
35
+ c-4.192,0-6.179-1.779-8.774-1.779c-4.597,0-7.788,3.159-14.571,3.159c-11.182,0-17.167-6.312-17.167-14.99
36
+ c0-8.874,7.191-15.58,23.353-17.744c6.587-0.793,8.58-3.362,8.58-5.528c0-3.944-3.192-6.509-6.982-6.509
37
+ c-7.581,0-6.985,6.509-15.369,6.509c-2.797,0-5.79-0.591-5.79-3.944c0-3.551,4.192-11.044,20.159-11.044
38
+ c13.966,0,22.356,3.152,22.356,17.352v29.587C473.539,86.088,471.146,87.075,467.745,87.075"/>
39
+ <path fill="#FFFFFF" d="M507.273,35.893c3.396,0,4.994,1.971,4.994,5.725c0,4.729-1.193,6.704-6.589,8.279
40
+ c-5.186,1.584-7.781,5.128-7.781,9.665v20.312c0,4.924-2,7.496-6.19,7.496h-3.998c-3.785,0-5.778-2.768-5.778-7.891V42.604
41
+ c0-4.935,1.598-7.692,7.582-7.692c6.189,0,8.58,2.167,10.98,2.167C503.48,37.078,504.284,35.893,507.273,35.893"/>
42
+ <path fill="#FFFFFF" d="M560.688,79.678c1.2,1.972,1.798,3.548,1.798,4.537c0,2.16-1.994,3.155-5.993,3.155
43
+ c-4.386,0-7.779-1.579-9.772-4.734l-5.192-8.483c-2-3.155-3.992-4.732-5.983-4.732c-3,0-6.192,2.562-6.192,9.863
44
+ c0,5.319-0.997,8.087-6.582,8.087c-5.399,0-6.996-2.17-6.996-6.71V25.635c0-4.141,1.805-6.308,6.788-6.308
45
+ c4.595,0,6.79,1.975,6.79,6.308c0,21.107-0.199,23.864,3.594,23.864c1.196,0,2.599-0.391,6.182-3.942c0,0,0.998-1.182,3.194-3.551
46
+ c2.197-2.167,3.593-3.351,4.195-3.551c1.598-0.986,3.993-1.381,7.186-1.381h1.396c2.991,0,4.396,0.99,4.396,2.765
47
+ c0,0.989-0.6,2.167-2.001,3.747l-6.983,7.889c-1.797,2.17-2.194,4.345-2.194,5.123c0,1.779,0.397,3.163,1.001,4.146L560.688,79.678
48
+ z"/>
49
+ </g>
50
+ </svg>
@@ -6679,6 +6679,100 @@ if (typeof module !== 'undefined' && module.exports) {
6679
6679
  });
6680
6680
 
6681
6681
  }).call(this);
6682
+ (function() {
6683
+ this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
6684
+ this.InfoparkHandlebarsTemplates["changes_list_dialog"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
6685
+ this.compilerInfo = [3,'>= 1.0.0-rc.4'];
6686
+ helpers = helpers || Handlebars.helpers; data = data || {};
6687
+ var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
6688
+
6689
+
6690
+ buffer += "<div class=\"ip_changes_overview ip_modal_big ip_adjust_dialog\" >\n\n <div class=\"ip_modal_header\">\n <h3>\n <i class=\"ip_icon\">&#xF080;</i>\n ";
6691
+ options = {hash:{},data:data};
6692
+ buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_list.title", options) : helperMissing.call(depth0, "translate", "changes_list.title", options)))
6693
+ + "\n <span id=\"ip_obj_count\" style=\"display:none;\">\n (<span id=\"ip_loaded_obj_count\"></span> / <span id=\"ip_total_obj_count\"></span>)\n </span>\n </h3>\n </div>\n <div class=\"ip_modal_body ip_auto_height\">\n\n <table class=\"ip_changes_table\">\n <thead>\n <tr>\n <th><span class=\"ip_sortable\" data-ip-sort-by=\"modification\">";
6694
+ options = {hash:{},data:data};
6695
+ buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_list.row.change", options) : helperMissing.call(depth0, "translate", "changes_list.row.change", options)))
6696
+ + "</span></th>\n <th><span>";
6697
+ options = {hash:{},data:data};
6698
+ buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_list.row.title", options) : helperMissing.call(depth0, "translate", "changes_list.row.title", options)))
6699
+ + "</span></th>\n <th><span class=\"ip_sortable\" data-ip-sort-by=\"obj_class\">";
6700
+ options = {hash:{},data:data};
6701
+ buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_list.row.type", options) : helperMissing.call(depth0, "translate", "changes_list.row.type", options)))
6702
+ + "</span></th>\n <th><span class=\"ip_sortable sort_down\" data-ip-sort-by=\"last_changed\">";
6703
+ options = {hash:{},data:data};
6704
+ buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_list.row.last_changed", options) : helperMissing.call(depth0, "translate", "changes_list.row.last_changed", options)))
6705
+ + "</span></th>\n </tr>\n </thead>\n <tbody id=\"ip_changes_table_loaded\">\n </tbody>\n <tbody id=\"ip_changes_table_empty_result\" style=\"display:none;\">\n <tr>\n <td colspan=\"4\">\n ";
6706
+ options = {hash:{},data:data};
6707
+ buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_list.empty_result", options) : helperMissing.call(depth0, "translate", "changes_list.empty_result", options)))
6708
+ + "\n </td>\n </tr>\n </tbody>\n <tbody id=\"ip_changes_table_loading\">\n <tr>\n <td colspan=\"4\">\n <i class=\"ip_icon ip_spinning\">&#xf023;</i>\n </td>\n </tr>\n </tbody>\n\n </table>\n\n <span class=\"ip_load_more\" style=\"display: none;\">";
6709
+ options = {hash:{},data:data};
6710
+ buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_list.more", options) : helperMissing.call(depth0, "translate", "changes_list.more", options)))
6711
+ + "</span>\n\n </div>\n <div class=\"ip_modal_footer\">\n <a class=\"ip_button ip_cancel\" href=\"#\">";
6712
+ options = {hash:{},data:data};
6713
+ buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "cancel", options) : helperMissing.call(depth0, "translate", "cancel", options)))
6714
+ + "</a>\n </div>\n\n</div>\n";
6715
+ return buffer;
6716
+ });
6717
+ return this.InfoparkHandlebarsTemplates["changes_list_dialog"];
6718
+ }).call(this);
6719
+ (function() {
6720
+ this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
6721
+ this.InfoparkHandlebarsTemplates["changes_list_row"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
6722
+ this.compilerInfo = [3,'>= 1.0.0-rc.4'];
6723
+ helpers = helpers || Handlebars.helpers; data = data || {};
6724
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
6725
+
6726
+ function program1(depth0,data) {
6727
+
6728
+
6729
+ return "\n <tr>\n";
6730
+ }
6731
+
6732
+ function program3(depth0,data) {
6733
+
6734
+ var buffer = "", stack1;
6735
+ buffer += "\n <tr class=\"ip_link_to_obj\" data-obj-id=\"";
6736
+ if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
6737
+ else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
6738
+ buffer += escapeExpression(stack1)
6739
+ + "\">\n";
6740
+ return buffer;
6741
+ }
6742
+
6743
+ function program5(depth0,data) {
6744
+
6745
+ var buffer = "", stack1;
6746
+ buffer += "\n <span><time>";
6747
+ if (stack1 = helpers.last_changed) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
6748
+ else { stack1 = depth0.last_changed; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
6749
+ buffer += escapeExpression(stack1)
6750
+ + "</time></span>\n ";
6751
+ return buffer;
6752
+ }
6753
+
6754
+ stack1 = helpers['if'].call(depth0, depth0.deleted, {hash:{},inverse:self.program(3, program3, data),fn:self.program(1, program1, data),data:data});
6755
+ if(stack1 || stack1 === 0) { buffer += stack1; }
6756
+ buffer += "\n\n <td><span class=\"ip_changes_state ";
6757
+ if (stack1 = helpers.modification) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
6758
+ else { stack1 = depth0.modification; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
6759
+ buffer += escapeExpression(stack1)
6760
+ + "\"></span></td>\n <td><span class=\"ip_title\">";
6761
+ if (stack1 = helpers.title) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
6762
+ else { stack1 = depth0.title; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
6763
+ buffer += escapeExpression(stack1)
6764
+ + "</span>\n <td><span class=\"ip_obj_class\">";
6765
+ if (stack1 = helpers.obj_class) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
6766
+ else { stack1 = depth0.obj_class; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
6767
+ buffer += escapeExpression(stack1)
6768
+ + "</span></td>\n\n <td>\n ";
6769
+ stack1 = helpers.unless.call(depth0, depth0.deleted, {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data});
6770
+ if(stack1 || stack1 === 0) { buffer += stack1; }
6771
+ buffer += "\n </td>\n</tr>\n";
6772
+ return buffer;
6773
+ });
6774
+ return this.InfoparkHandlebarsTemplates["changes_list_row"];
6775
+ }).call(this);
6682
6776
  (function() {
6683
6777
  this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
6684
6778
  this.InfoparkHandlebarsTemplates["choose_obj_class_dialog"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
@@ -6927,67 +7021,108 @@ helpers = helpers || Handlebars.helpers; data = data || {};
6927
7021
 
6928
7022
 
6929
7023
 
6930
- return "<div class=\"ip_topbar\">\n <div class=\"ip_first_level\">\n <div class=\"ip_button_bar ip_app ip_no_hover\">\n <span class=\"ip_logo\"></span>\n <span class=\"ip_product_name\">CMS</span>\n </div>\n\n <div id=\"ip_select_workspace\" class=\"ip_button_bar\"></div>\n <div id=\"ip_menu_bar_dropdown\" class=\"ip_button_bar ip_right\"></div>\n <div id=\"ip_menu_bar_saving_indicator\"></div>\n </div>\n</div>\n";
7024
+ return "<div class=\"ip_topbar\">\n <div class=\"ip_first_level\">\n <div class=\"ip_button_bar ip_app ip_no_hover\">\n <span class=\"ip_logo\"></span>\n <span class=\"ip_product_name\">CMS</span>\n </div>\n\n <div id=\"ip_menu_bar_toggle\" class=\"ip_viewmodes_wrapper\"></div>\n <div id=\"ip_select_workspace\" class=\"ip_button_bar\"></div>\n <div id=\"ip_menu_bar_close\" class=\"ip_button_bar ip_right\"></div>\n <div id=\"ip_menu_bar_dropdown\" class=\"ip_button_bar ip_right\"></div>\n <div id=\"ip_menu_bar_saving_indicator\"></div>\n </div>\n</div>\n";
6931
7025
  });
6932
7026
  return this.InfoparkHandlebarsTemplates["menu_bar"];
6933
7027
  }).call(this);
7028
+ (function() {
7029
+ this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
7030
+ this.InfoparkHandlebarsTemplates["menu_bar_close"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
7031
+ this.compilerInfo = [3,'>= 1.0.0-rc.4'];
7032
+ helpers = helpers || Handlebars.helpers; data = data || {};
7033
+
7034
+
7035
+
7036
+ return "<i class=\"ip_icon\">&#xF01F;</i>\n";
7037
+ });
7038
+ return this.InfoparkHandlebarsTemplates["menu_bar_close"];
7039
+ }).call(this);
6934
7040
  (function() {
6935
7041
  this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
6936
7042
  this.InfoparkHandlebarsTemplates["menu_bar_dropdown"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
6937
7043
  this.compilerInfo = [3,'>= 1.0.0-rc.4'];
6938
7044
  helpers = helpers || Handlebars.helpers; data = data || {};
6939
- var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this, functionType="function";
7045
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this, helperMissing=helpers.helperMissing;
6940
7046
 
6941
7047
  function program1(depth0,data) {
6942
7048
 
6943
- var buffer = "", stack1, stack2, options;
7049
+
7050
+ return "ip_changed";
7051
+ }
7052
+
7053
+ function program3(depth0,data) {
7054
+
7055
+ var buffer = "", stack1;
6944
7056
  buffer += "\n ";
6945
- stack1 = helpers['if'].call(depth0, depth0.current_page_has_edit_view, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
7057
+ stack1 = helpers['if'].call(depth0, depth0.is_present, {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
6946
7058
  if(stack1 || stack1 === 0) { buffer += stack1; }
6947
- buffer += "\n\n <li id=\"ip_save_current_page_to_clipboard\" class=\"";
6948
- if (stack1 = helpers.disable_with_children) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
6949
- else { stack1 = depth0.disable_with_children; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
6950
- buffer += escapeExpression(stack1)
6951
- + "\">\n <span>\n <i class=\"ip_icon\">&#xf017;</i>\n ";
6952
- options = {hash:{},data:data};
6953
- buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "menu_bar_dropdown.save_current_page_to_clipboard", options) : helperMissing.call(depth0, "translate", "menu_bar_dropdown.save_current_page_to_clipboard", options)))
6954
- + "\n </span>\n </li>\n\n <li id=\"ip_duplicate_current_page\" class=\"";
6955
- if (stack2 = helpers.disable_with_children) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
6956
- else { stack2 = depth0.disable_with_children; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }
6957
- buffer += escapeExpression(stack2)
6958
- + "\">\n <span>\n <i class=\"ip_icon\">&#xf015;</i>\n ";
6959
- options = {hash:{},data:data};
6960
- buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "menu_bar_dropdown.duplicate_current_page", options) : helperMissing.call(depth0, "translate", "menu_bar_dropdown.duplicate_current_page", options)))
6961
- + "\n </span>\n </li>\n\n <li id=\"ip_delete_current_page\" class=\"ip_menu_item\">\n <span><i class=\"ip_icon\">&#xF018;</i>";
6962
- options = {hash:{},data:data};
6963
- buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "menu_bar_dropdown.delete_current_page", options) : helperMissing.call(depth0, "translate", "menu_bar_dropdown.delete_current_page", options)))
6964
- + "</span>\n </li>\n\n <li id=\"ip_open_current_page_in_admin_gui\" class=\"ip_menu_item\">\n <span><i class=\"ip_icon\">&#xF000;</i>";
6965
- options = {hash:{},data:data};
6966
- buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "menu_bar_dropdown.open_current_page_in_admin_gui", options) : helperMissing.call(depth0, "translate", "menu_bar_dropdown.open_current_page_in_admin_gui", options)))
6967
- + "</span>\n </li>\n ";
7059
+ buffer += "\n ";
6968
7060
  return buffer;
6969
7061
  }
6970
- function program2(depth0,data) {
7062
+ function program4(depth0,data) {
6971
7063
 
6972
7064
  var buffer = "", stack1, options;
6973
- buffer += "\n <li id=\"ip_edit_current_page\" class=\"ip_menu_item\">\n <span><i class=\"ip_icon\">&#xF03D;</i>";
7065
+ buffer += "\n <li id=\"ip_";
7066
+ if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
7067
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
7068
+ buffer += escapeExpression(stack1)
7069
+ + "\" class=\"ip_menu_item ";
7070
+ stack1 = helpers.unless.call(depth0, depth0.is_enabled, {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data});
7071
+ if(stack1 || stack1 === 0) { buffer += stack1; }
7072
+ buffer += "\" title=\"";
7073
+ if (stack1 = helpers.title) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
7074
+ else { stack1 = depth0.title; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
7075
+ buffer += escapeExpression(stack1)
7076
+ + "\">\n <span><i class=\"ip_icon\">";
7077
+ if (stack1 = helpers.icon) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
7078
+ else { stack1 = depth0.icon; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
7079
+ if(stack1 || stack1 === 0) { buffer += stack1; }
7080
+ buffer += "</i>";
6974
7081
  options = {hash:{},data:data};
6975
- buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "menu_bar_dropdown.edit_current_page", options) : helperMissing.call(depth0, "translate", "menu_bar_dropdown.edit_current_page", options)))
7082
+ buffer += escapeExpression(((stack1 = helpers.concat_translate),stack1 ? stack1.call(depth0, "menu_bar_dropdown.", depth0.name, options) : helperMissing.call(depth0, "concat_translate", "menu_bar_dropdown.", depth0.name, options)))
6976
7083
  + "</span>\n </li>\n ";
6977
7084
  return buffer;
6978
7085
  }
7086
+ function program5(depth0,data) {
7087
+
7088
+
7089
+ return "disabled";
7090
+ }
6979
7091
 
6980
- buffer += "<i class=\"ip_icon\">&#xF03B;</i>\n\n<ul class=\"ip_menu_box ip_right\" style=\"display: none;\">\n ";
6981
- stack1 = helpers['if'].call(depth0, depth0.has_current_page, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
7092
+ buffer += "<i class=\"ip_icon ";
7093
+ stack1 = helpers['if'].call(depth0, depth0.is_current_page_changed, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
6982
7094
  if(stack1 || stack1 === 0) { buffer += stack1; }
6983
- buffer += "\n\n <li id=\"ip_deactivate_editing\" class=\"ip_menu_item\">\n <span><i class=\"ip_icon\">&#xF06C;</i>";
6984
- options = {hash:{},data:data};
6985
- buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "menu_bar_dropdown.deactivate_editing", options) : helperMissing.call(depth0, "translate", "menu_bar_dropdown.deactivate_editing", options)))
6986
- + "</span>\n </li>\n</ul>\n";
7095
+ buffer += "\">&#xf087;</i>\n\n<ul class=\"ip_menu_box ip_right\" style=\"display: none;\">\n ";
7096
+ stack1 = helpers.each.call(depth0, depth0.dropdown_items, {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data});
7097
+ if(stack1 || stack1 === 0) { buffer += stack1; }
7098
+ buffer += "\n</ul>\n";
6987
7099
  return buffer;
6988
7100
  });
6989
7101
  return this.InfoparkHandlebarsTemplates["menu_bar_dropdown"];
6990
7102
  }).call(this);
7103
+ (function() {
7104
+ this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
7105
+ this.InfoparkHandlebarsTemplates["menu_bar_toggle"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
7106
+ this.compilerInfo = [3,'>= 1.0.0-rc.4'];
7107
+ helpers = helpers || Handlebars.helpers; data = data || {};
7108
+ var buffer = "", stack1, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing;
7109
+
7110
+
7111
+ buffer += "<div class=\"ip_viewmodes ip_viewmode_";
7112
+ if (stack1 = helpers.mode) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
7113
+ else { stack1 = depth0.mode; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
7114
+ buffer += escapeExpression(stack1)
7115
+ + "_active\">\n <span class=\"ip_viewmode_pill\"></span>\n\n <div class=\"ip_viewmode_view\">\n <span class=\"ip_viewmode_icon\"></span>\n <span class=\"ip_viewmode_label\">";
7116
+ options = {hash:{},data:data};
7117
+ buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "menu_bar_toggle.view", options) : helperMissing.call(depth0, "translate", "menu_bar_toggle.view", options)))
7118
+ + "</span>\n </div>\n\n <div class=\"ip_viewmode_editing\">\n <span class=\"ip_viewmode_icon\"></span>\n <span class=\"ip_viewmode_label\">";
7119
+ options = {hash:{},data:data};
7120
+ buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "menu_bar_toggle.editing", options) : helperMissing.call(depth0, "translate", "menu_bar_toggle.editing", options)))
7121
+ + "</span>\n </div>\n</div>\n";
7122
+ return buffer;
7123
+ });
7124
+ return this.InfoparkHandlebarsTemplates["menu_bar_toggle"];
7125
+ }).call(this);
6991
7126
  (function() {
6992
7127
  this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
6993
7128
  this.InfoparkHandlebarsTemplates["overlay"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
@@ -7210,7 +7345,13 @@ helpers = helpers || Handlebars.helpers; data = data || {};
7210
7345
  function program1(depth0,data) {
7211
7346
 
7212
7347
  var buffer = "", stack1, options;
7213
- buffer += "\n <li class=\"ip_menu_separator\"></li>\n <li class=\"ip_menu_item\">\n <span id='ip-publish-current-ws'>\n <i class=\"ip_icon\"\n title=\"";
7348
+ buffer += "\n <li id=\"ip_changes_list_toggle\" class=\"ip_menu_item\">\n <span>\n <i class=\"ip_icon\" title=\"";
7349
+ options = {hash:{},data:data};
7350
+ buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_list.menu_item", options) : helperMissing.call(depth0, "translate", "changes_list.menu_item", options)))
7351
+ + "\">&#xF080;</i>\n ";
7352
+ options = {hash:{},data:data};
7353
+ buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_list.menu_item", options) : helperMissing.call(depth0, "translate", "changes_list.menu_item", options)))
7354
+ + "\n </span>\n </li>\n <li class=\"ip_menu_separator\"></li>\n <li class=\"ip_menu_item\">\n <span id='ip-publish-current-ws'>\n <i class=\"ip_icon\"\n title=\"";
7214
7355
  options = {hash:{},data:data};
7215
7356
  buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "menu_bar.publish_working_copy", depth0.current_short_title, options) : helperMissing.call(depth0, "translate", "menu_bar.publish_working_copy", depth0.current_short_title, options)))
7216
7357
  + " \">\n &#xF064;\n </i>\n ";
@@ -7309,13 +7450,29 @@ $.i18n().load({
7309
7450
  'menu_bar.create_new_ws_confirmation': 'Arbeitskopie anlegen',
7310
7451
  'menu_bar.create_new_ws_confirmation_desc': 'Bitte geben Sie den Titel der neuen Arbeitskopie ein.',
7311
7452
  'menu_bar.create_new_ws_confirmation_placeholder': 'Neuer Titel',
7453
+ 'menu_bar.revert': 'Verwerfen',
7454
+
7455
+ 'menu_bar_toggle.editing': 'Bearbeiten',
7456
+ 'menu_bar_toggle.view': 'Vorschau',
7457
+ 'menu_bar_toggle.hide': 'Ausblenden',
7312
7458
 
7313
7459
  'menu_bar_dropdown.edit_current_page': 'Seiteneigenschaften',
7314
7460
  'menu_bar_dropdown.delete_current_page': 'Diese Seite löschen',
7461
+ 'menu_bar_dropdown.delete_current_page.workspace_is_published': 'Die veröffentlichten Inhalte können nicht direkt geändert werden.',
7462
+ 'menu_bar_dropdown.delete_current_page.has_children': 'Seiten mit Unterseiten können noch nicht gelöscht werden.',
7463
+ 'menu_bar_dropdown.revert_current_page': 'Änderungen an dieser Seite verwerfen',
7315
7464
  'menu_bar_dropdown.save_current_page_to_clipboard': 'Diese Seite im Clipboard ablegen',
7316
7465
  'menu_bar_dropdown.duplicate_current_page': 'Diese Seite duplizieren',
7317
7466
  'menu_bar_dropdown.open_current_page_in_admin_gui': 'Im Admin-GUI öffnen',
7318
7467
  'menu_bar_dropdown.deactivate_editing': 'Direktbearbeitung deaktivieren',
7468
+ 'menu_bar_dropdown.save_current_page_to_clipboard.has_children': 'Seiten mit Unterseiten können noch nicht verschoben oder kopiert werden.',
7469
+ 'menu_bar_dropdown.duplicate_current_page.has_children': 'Seiten mit Unterseiten können noch nicht dupliziert werden.',
7470
+ 'menu_bar_dropdown.duplicate_current_page.workspace_is_published': 'Die veröffentlichten Inhalte können nicht direkt geändert werden.',
7471
+ 'menu_bar_dropdown.revert_current_page.workspace_is_published': 'Die veröffentlichten Inhalte können nicht direkt geändert werden. Daher gibt es nichts zu verwerfen.',
7472
+ 'menu_bar_dropdown.revert_current_page.workspace_is_rtc': 'Diese Seite ist Teil der "rtc"-Arbeitskopie, bei der Änderungen nicht verworfen werden können.',
7473
+ 'menu_bar_dropdown.revert_current_page.obj_is_new': 'Dies ist eine neue Seite. Um die Erstellung dieser Seite rückgängig zu machen, löschen Sie sie bitte.',
7474
+ 'menu_bar_dropdown.revert_current_page.obj_is_deleted': 'Diese Seite wurde gelöscht. Derzeit können gelöschte Seite nicht wiederhergestellt werden.',
7475
+ 'menu_bar_dropdown.revert_current_page.obj_is_unchanged': 'Diese Seite wurde nicht geändert. Daher gibt es nichts zu verwerfen.',
7319
7476
 
7320
7477
  'saving_indicator_item.saving': 'Wird gespeichert...',
7321
7478
  'saving_indicator_item.saved': 'Änderungen gespeichert',
@@ -7328,6 +7485,15 @@ $.i18n().load({
7328
7485
  'widget_menus.edit_widget': 'Widget-Eigenschaften',
7329
7486
  'widget_menus.delete_widget': 'Widget löschen',
7330
7487
 
7488
+ 'changes_list.menu_item': 'Liste der Änderungen',
7489
+ 'changes_list.title': 'Änderungen',
7490
+ 'changes_list.empty_result': 'In dieser Arbeitskopie wurde nichts geändert.',
7491
+ 'changes_list.more': 'Mehr...',
7492
+ 'changes_list.row.change': 'Änderung',
7493
+ 'changes_list.row.title': 'Titel',
7494
+ 'changes_list.row.type': 'Typ',
7495
+ 'changes_list.row.last_changed': 'Letzte Änderung',
7496
+
7331
7497
  'commands.delete_obj.confirm_title': 'Wirklich diese Seite löschen?',
7332
7498
  'commands.delete_obj.confirm_description': 'Eine gelöschte Seite kann nicht wiederhergestellt werden.',
7333
7499
  'commands.move_obj_into.confirm_title': 'Seite im Clipboard hierher verschieben?',
@@ -7335,17 +7501,17 @@ $.i18n().load({
7335
7501
  'commands.copy_obj_into.confirm_title': 'Seite im Clipboard hierher kopieren?',
7336
7502
  'commands.copy_obj_into.confirm_description': 'Eine Kopie der Seite im Clipboard wird hier eingefügt.',
7337
7503
  'commands.paste.not_allowed': 'Aufgrund ihres Typs kann die Seite hier nicht eingefügt werden.\n\nNur Seiten der folgenden Typen können hierher verschoben oder kopiert werden:\n\n$2',
7338
- 'commands.save_obj.has_children': 'Seiten mit Unterseiten können noch nicht verschoben oder kopiert werden.',
7339
7504
  'commands.delete_widget.confirm_title': 'Wirklich dieses Widget löschen?',
7340
7505
  'commands.delete_widget.confirm_description': 'Ein gelöschtes Widget kann nicht wiederhergestellt werden.',
7341
7506
  'commands.duplicate_obj.button_text': 'Duplizieren',
7342
7507
  'commands.duplicate_obj.confirm_title': 'Diese Seite duplizieren?',
7343
7508
  'commands.duplicate_obj.confirm_description': 'Diese Seite wird sofort dupliziert.',
7344
- 'commands.duplicate_obj.has_children': 'Seiten mit Unterseiten können noch nicht dupliziert werden.',
7509
+ 'commands.revert_obj.confirm_title': 'Wirklich Änderungen an dieser Seite verwerfen?',
7510
+ 'commands.revert_obj.confirm_description': 'Verworfene Änderungen können nicht wiederhergestellt werden.',
7345
7511
 
7346
- 'image_upload.too_many_files': 'Nur eine Detei erlaubt.',
7512
+ 'image_upload.too_many_files': 'Nur eine Datei erlaubt.',
7347
7513
 
7348
- 'warn_before_unloading': 'Sie haben ungespeicherte Änderungen! Sind Sie sicher, dass sie schließen wollen?'
7514
+ 'warn_before_unloading': 'Sie haben nicht gespeicherte Änderungen! Sind Sie sicher, dass sie schließen wollen?'
7349
7515
  }, 'de');
7350
7516
  $.i18n().load({
7351
7517
  'confirm': 'Confirm',
@@ -7394,13 +7560,29 @@ $.i18n().load({
7394
7560
  'menu_bar.create_new_ws_confirmation': 'Create a working copy',
7395
7561
  'menu_bar.create_new_ws_confirmation_desc': 'Please enter the title of the new working copy.',
7396
7562
  'menu_bar.create_new_ws_confirmation_placeholder': 'new title',
7563
+ 'menu_bar.revert': 'Discard',
7564
+
7565
+ 'menu_bar_toggle.editing': 'Edit',
7566
+ 'menu_bar_toggle.view': 'Preview',
7567
+ 'menu_bar_toggle.hide': 'Hide',
7397
7568
 
7398
7569
  'menu_bar_dropdown.edit_current_page': 'Page properties',
7399
7570
  'menu_bar_dropdown.delete_current_page': 'Delete this page',
7571
+ 'menu_bar_dropdown.delete_current_page.workspace_is_published': 'Since this is the published content, nothing can be modified.',
7572
+ 'menu_bar_dropdown.delete_current_page.has_children': 'Pages with subpages cannot be deleted yet.',
7573
+ 'menu_bar_dropdown.revert_current_page': 'Discard changes to this page',
7400
7574
  'menu_bar_dropdown.save_current_page_to_clipboard': 'Place this page on the clipboard',
7401
7575
  'menu_bar_dropdown.duplicate_current_page': 'Duplicate this page',
7402
7576
  'menu_bar_dropdown.open_current_page_in_admin_gui': 'Open in admin GUI',
7403
7577
  'menu_bar_dropdown.deactivate_editing': 'Deactivate in-place editing',
7578
+ 'menu_bar_dropdown.save_current_page_to_clipboard.has_children': 'Pages with subpages cannot be copied or moved yet.',
7579
+ 'menu_bar_dropdown.duplicate_current_page.has_children': 'Pages with subpages cannot be duplicated yet.',
7580
+ 'menu_bar_dropdown.duplicate_current_page.workspace_is_published': 'Since this is the published content, nothing can be modified.',
7581
+ 'menu_bar_dropdown.revert_current_page.workspace_is_published': 'Since this is the published content, nothing has been modified. Therefore, nothing can be discarded.',
7582
+ 'menu_bar_dropdown.revert_current_page.workspace_is_rtc': 'This page is part of the "rtc" working copy, for which discarding changes is not supported.',
7583
+ 'menu_bar_dropdown.revert_current_page.obj_is_new': 'This is a new page. To discard the creation of this page, please delete it.',
7584
+ 'menu_bar_dropdown.revert_current_page.obj_is_deleted': 'This page has been deleted. Currently, deleted pages cannot be restored.',
7585
+ 'menu_bar_dropdown.revert_current_page.obj_is_unchanged': 'This page has not been modified. Therefore, nothing can be discarded.',
7404
7586
 
7405
7587
  'saving_indicator_item.saving': 'Saving...',
7406
7588
  'saving_indicator_item.saved': 'Changes saved',
@@ -7413,20 +7595,29 @@ $.i18n().load({
7413
7595
  'widget_menus.edit_widget': 'Widget properties',
7414
7596
  'widget_menus.delete_widget': 'Delete widget',
7415
7597
 
7598
+ 'changes_list.menu_item': 'Changes List',
7599
+ 'changes_list.title': 'Changes',
7600
+ 'changes_list.empty_result': 'Nothing was changed in this working copy.',
7601
+ 'changes_list.more': 'More...',
7602
+ 'changes_list.row.change': 'Change',
7603
+ 'changes_list.row.title': 'Title',
7604
+ 'changes_list.row.type': 'Type',
7605
+ 'changes_list.row.last_changed': 'Last change',
7606
+
7416
7607
  'commands.delete_obj.confirm_title': 'Really delete this page?',
7417
7608
  'commands.delete_obj.confirm_description': 'A deleted page cannot be restored.',
7418
7609
  'commands.move_obj_into.confirm_title': 'Move page on clipboard here?',
7419
7610
  'commands.move_obj_into.confirm_description': 'The page that has been placed on the clipboard will be moved here.',
7420
7611
  'commands.copy_obj_into.confirm_title': 'Copy page on clipboard here?',
7421
7612
  'commands.copy_obj_into.confirm_description': 'A copy of the page on the clipboard will be inserted here.',
7422
- 'commands.save_obj.has_children': 'Pages with subpages cannot be copied or moved yet.',
7423
7613
  'commands.paste.not_allowed': 'Due to its type, the page cannot be moved or copied here.\n\nOnly pages of the following types can be inserted here:\n\n$2',
7424
7614
  'commands.delete_widget.confirm_title': 'Really delete this widget?',
7425
7615
  'commands.delete_widget.confirm_description': 'A deleted widget cannot be restored.',
7426
7616
  'commands.duplicate_obj.button_text': 'Duplicate',
7427
7617
  'commands.duplicate_obj.confirm_title': 'Duplicate the current page?',
7428
7618
  'commands.duplicate_obj.confirm_description': 'The current page will be duplicated immediately.',
7429
- 'commands.duplicate_obj.has_children': 'Pages with subpages cannot be duplicated yet.',
7619
+ 'commands.revert_obj.confirm_title': 'Really discard changes to this page?',
7620
+ 'commands.revert_obj.confirm_description': 'Discarded changes cannot be restored.',
7430
7621
 
7431
7622
  'image_upload.too_many_files': 'Only one file allowed.',
7432
7623
 
@@ -7542,15 +7733,25 @@ var infopark = {
7542
7733
  return hex;
7543
7734
  },
7544
7735
 
7736
+ deprecation_warning: function(subject, alternative) {
7737
+ var message = 'DEPRECATION WARNING: "' + subject + '" is deprecated.';
7738
+
7739
+ if (alternative) {
7740
+ message += ' Please use "' + alternative + '" instead.';
7741
+ }
7742
+
7743
+ window.console.warn(message);
7744
+ },
7745
+
7545
7746
  on: function(event, callback) {
7546
7747
  if (event === 'editing') {
7547
- infopark.editing.on('activate', function() {
7548
- if (infopark.editing.workspace().is_editable()) {
7748
+ infopark.gui.on('editing', function() {
7749
+ if (infopark.gui.workspace().is_editable()) {
7549
7750
  callback();
7550
7751
  }
7551
7752
  });
7552
7753
  } else if (event === 'new_content') {
7553
- infopark.editing.on('new_content', function(dom_element) {
7754
+ infopark.gui.on('new_content', function(dom_element) {
7554
7755
  if (dom_element) {
7555
7756
  callback(dom_element);
7556
7757
  }
@@ -7581,7 +7782,7 @@ var infopark = {
7581
7782
  trigger: function(event_name, dom_element) {
7582
7783
  if (event_name === 'new_content') {
7583
7784
  _.each($(dom_element), function(e) {
7584
- infopark.editing.new_content(e);
7785
+ infopark.gui.new_content(e);
7585
7786
  });
7586
7787
  } else {
7587
7788
  $.error('Unknown event "' + event_name + '"');
@@ -7668,59 +7869,94 @@ var infopark = {
7668
7869
  };
7669
7870
  }());
7670
7871
  (function() {
7671
- var editing_active = false;
7872
+ var state;
7873
+ var state_storage_key = 'gui.state';
7874
+ var callbacks = {};
7875
+ var current_workspace;
7672
7876
 
7673
- var event_handlers = {};
7877
+ var update_state = function(options) {
7878
+ infopark.storage.set(state_storage_key, $.extend(state, options));
7879
+ };
7674
7880
 
7675
- var current_workspace;
7881
+ var load_state = function() {
7882
+ state = infopark.storage.get(state_storage_key) || {is_open: false, mode: 'editing'};
7883
+ };
7676
7884
 
7677
- var real_activate = function(options) {
7678
- if(!infopark.editing.is_active()) {
7679
- editing_active = true;
7680
- $.cookie('infopark_editing_active', 'true', { path: '/' });
7681
- _.each($(event_handlers.activate), function(handler) {
7682
- handler(options || {});
7885
+ var is_editing_mode = function() {
7886
+ return state.mode === 'editing';
7887
+ };
7888
+
7889
+ var run_open_callbacks = function(options) {
7890
+ if (callbacks.open) {
7891
+ _.each(callbacks.open, function(callback) {
7892
+ callback(options || {});
7893
+ });
7894
+ }
7895
+
7896
+ if (is_editing_mode() && callbacks.editing) {
7897
+ _.each(callbacks.editing, function(callback) {
7898
+ callback(options || {});
7899
+ });
7900
+ }
7901
+ };
7902
+
7903
+ var run_new_content_callbacks = function(dom_element) {
7904
+ if (is_editing_mode() && callbacks.new_content) {
7905
+ _.each(callbacks.new_content, function(callback) {
7906
+ if (dom_element) {
7907
+ callback(dom_element);
7908
+ }
7683
7909
  });
7684
7910
  }
7685
7911
  };
7686
7912
 
7687
7913
  $.extend(infopark, {
7688
- editing: {
7914
+ gui: {
7689
7915
  initialize: function() {
7690
- if($.cookie('infopark_editing_active') === 'true') {
7691
- real_activate({on_initialize: true});
7916
+ load_state();
7917
+
7918
+ if (state.is_open) {
7919
+ run_open_callbacks({on_initialize: true});
7692
7920
  }
7693
7921
 
7694
7922
  $('body').append('<div id="ip-editing"></div>');
7695
7923
  },
7696
7924
 
7697
- activate: function() {
7698
- return real_activate();
7925
+ open: function() {
7926
+ if (!state.is_open) {
7927
+ update_state({is_open: true});
7928
+ run_open_callbacks();
7929
+ }
7699
7930
  },
7700
7931
 
7701
- deactivate: function() {
7702
- editing_active = false;
7703
- $.removeCookie('infopark_editing_active', { path: '/' });
7932
+ close: function() {
7933
+ update_state({is_open: false});
7704
7934
  infopark.reload();
7705
7935
  },
7706
7936
 
7937
+ set_mode: function(mode) {
7938
+ update_state({mode: mode});
7939
+ infopark.reload();
7940
+ },
7941
+
7942
+ mode: function() {
7943
+ return state.mode;
7944
+ },
7945
+
7707
7946
  new_content: function(dom_element) {
7708
- _.each($(event_handlers.new_content), function(handler) {
7709
- if (dom_element) {
7710
- handler(dom_element);
7711
- }
7712
- });
7947
+ run_new_content_callbacks(dom_element);
7713
7948
  },
7714
7949
 
7715
- is_active: function() {
7716
- return editing_active;
7950
+ is_open: function() {
7951
+ return state.is_open;
7717
7952
  },
7718
7953
 
7719
- on: function(event_name, handler) {
7720
- if(event_handlers[event_name] === undefined) {
7721
- event_handlers[event_name] = [];
7954
+ on: function(event_name, callback) {
7955
+ if (callbacks[event_name] === undefined) {
7956
+ callbacks[event_name] = [];
7722
7957
  }
7723
- event_handlers[event_name].push(handler);
7958
+
7959
+ callbacks[event_name].push(callback);
7724
7960
  },
7725
7961
 
7726
7962
  set_workspace: function(workspace) {
@@ -7732,8 +7968,29 @@ var infopark = {
7732
7968
  },
7733
7969
 
7734
7970
  // for testing purposes only
7735
- reset_event_handlers: function() {
7736
- event_handlers = {};
7971
+ reset_callbacks: function() {
7972
+ callbacks = {};
7973
+ }
7974
+ }
7975
+ });
7976
+ }());
7977
+ // This module is only for backwards compatibility reasons.
7978
+ (function() {
7979
+ $.extend(infopark, {
7980
+ editing: {
7981
+ activate: function() {
7982
+ infopark.deprecation_warning('infopark.editing.activate', 'infopark.gui.open');
7983
+ infopark.gui.open();
7984
+ },
7985
+
7986
+ deactivate: function() {
7987
+ infopark.deprecation_warning('infopark.editing.deactivate', 'infopark.gui.close');
7988
+ infopark.gui.close();
7989
+ },
7990
+
7991
+ is_active: function() {
7992
+ infopark.deprecation_warning('infopark.editing.is_active', 'infopark.gui.is_open');
7993
+ return infopark.gui.is_open();
7737
7994
  }
7738
7995
  }
7739
7996
  });
@@ -7895,7 +8152,7 @@ var infopark = {
7895
8152
  },
7896
8153
 
7897
8154
  init: function() {
7898
- infopark.editing.on('activate', function(options) {
8155
+ infopark.gui.on('open', function(options) {
7899
8156
  add_menu_bar(options.on_initialize === true);
7900
8157
  });
7901
8158
  },
@@ -7929,64 +8186,211 @@ var infopark = {
7929
8186
  }());
7930
8187
  (function() {
7931
8188
  $.extend(infopark, {
7932
- menu_bar_dropdown: {
8189
+ menu_bar_toggle: {
7933
8190
  init: function() {
7934
8191
  infopark.menu_bar.register_item_renderer(function(menu_bar) {
7935
- var view = infopark.template.render('menu_bar_dropdown', {
7936
- has_current_page: infopark.obj.current_page_id,
7937
- current_page_has_edit_view: infopark.obj.current_page_has_edit_view,
7938
- disable_with_children: disable_with_children
8192
+ var menu_bar_toggle = menu_bar.find('#ip_menu_bar_toggle')
8193
+ .html(infopark.template.render('menu_bar_toggle', {mode: infopark.gui.mode()}));
8194
+
8195
+ define_mode(menu_bar_toggle, 'view', function() {
8196
+ infopark.gui.set_mode('view');
8197
+ });
8198
+
8199
+ define_mode(menu_bar_toggle, 'editing', function() {
8200
+ infopark.gui.set_mode('editing');
7939
8201
  });
7940
- menu_bar.find('#ip_menu_bar_dropdown').html(view);
7941
8202
  });
7942
8203
  }
7943
8204
  }
7944
8205
  });
7945
8206
 
7946
- var on_click = function(element_id, callback) {
7947
- $(document).on('click.' + element_id, '#' + element_id, function(event) {
7948
- event.preventDefault();
7949
- callback();
7950
- });
8207
+ var define_mode = function(menu_bar_toggle, mode, callback) {
8208
+ var new_class = 'ip_viewmode_' + mode + '_active';
8209
+ var view_modes = menu_bar_toggle.find('.ip_viewmodes');
8210
+
8211
+ if (!view_modes.hasClass(new_class)) {
8212
+ menu_bar_toggle.find('.ip_viewmode_' + mode).click(function() {
8213
+ view_modes
8214
+ .removeClass('ip_viewmode_editing_active ip_viewmode_view_active ip_viewmode_hide_active')
8215
+ .addClass(new_class);
8216
+ callback();
8217
+ });
8218
+ }
7951
8219
  };
8220
+ }());
8221
+ (function() {
8222
+ $.extend(infopark, {
8223
+ menu_bar_dropdown: {
8224
+ init: function() {
8225
+ infopark.menu_bar.register_item_renderer(function(menu_bar) {
8226
+ var view = infopark.template.render('menu_bar_dropdown', {
8227
+ dropdown_items: dropdown_items,
8228
+ is_current_page_changed: function() {
8229
+ var current_page_modification = infopark.obj.current_page_modification;
8230
+ return current_page_modification === 'new' || current_page_modification === 'edited';
8231
+ }
8232
+ });
7952
8233
 
7953
- on_click('ip_menu_bar_dropdown', function() {
7954
- var target = $('#ip_menu_bar_dropdown');
7955
- target.toggleClass('active');
7956
- target.find('.ip_menu_box').fadeToggle('50');
7957
- });
8234
+ var menu_bar_dropdown = menu_bar.find('#ip_menu_bar_dropdown').html(view);
7958
8235
 
7959
- on_click('ip_edit_current_page', function() {
7960
- infopark.commands.edit_obj(infopark.obj.current_page());
7961
- });
8236
+ menu_bar_dropdown.click(function() {
8237
+ menu_bar_dropdown.toggleClass('active');
8238
+ menu_bar_dropdown.find('.ip_menu_box').fadeToggle('50');
8239
+ return false;
8240
+ });
7962
8241
 
7963
- on_click('ip_delete_current_page', function() {
7964
- infopark.commands.delete_obj(infopark.obj.current_page());
8242
+ _.each(dropdown_items, function(dropdown_item) {
8243
+ menu_bar_dropdown.find('#ip_' + dropdown_item.name).click(function() {
8244
+ return dropdown_item.is_enabled() ? dropdown_item.execute() : false;
8245
+ });
8246
+ });
8247
+ });
8248
+ }
8249
+ }
7965
8250
  });
7966
8251
 
7967
- on_click('ip_save_current_page_to_clipboard', function() {
7968
- infopark.commands.save_obj_to_clipboard(infopark.obj.current_page());
7969
- });
8252
+ var dropdown_items = [
8253
+ {
8254
+ name: 'edit_current_page',
8255
+ icon: '&#xf03d;',
8256
+ is_present: function() {
8257
+ return infopark.obj.current_page_has_edit_view;
8258
+ },
8259
+ is_enabled: function() {
8260
+ return infopark.obj.current_page_has_edit_view;
8261
+ },
8262
+ execute: function() {
8263
+ infopark.commands.edit_obj(infopark.obj.current_page());
8264
+ }
8265
+ },
7970
8266
 
7971
- on_click('ip_duplicate_current_page', function() {
7972
- infopark.commands.duplicate_obj(infopark.obj.current_page());
7973
- });
8267
+ {
8268
+ name: 'save_current_page_to_clipboard',
8269
+ icon: '&#xf017;',
8270
+ title: function() {
8271
+ if (infopark.obj.current_page_has_children) {
8272
+ return infopark.i18n.translate(
8273
+ 'menu_bar_dropdown.save_current_page_to_clipboard.has_children');
8274
+ }
8275
+ },
8276
+ is_present: true,
8277
+ is_enabled: function() {
8278
+ return !infopark.obj.current_page_has_children;
8279
+ },
8280
+ execute: function() {
8281
+ infopark.commands.save_obj_to_clipboard(infopark.obj.current_page());
8282
+ }
8283
+ },
7974
8284
 
7975
- on_click('ip_open_current_page_in_admin_gui', function() {
7976
- infopark.commands.open_in_admin_gui(infopark.obj.current_page_id);
7977
- });
8285
+ {
8286
+ name: 'duplicate_current_page',
8287
+ icon: '&#xf015;',
8288
+ title: function() {
8289
+ if (!infopark.gui.workspace().is_editable()) {
8290
+ return infopark.i18n.translate(
8291
+ 'menu_bar_dropdown.duplicate_current_page.workspace_is_published');
8292
+ }
8293
+ if (infopark.obj.current_page_has_children) {
8294
+ return infopark.i18n.translate('menu_bar_dropdown.duplicate_current_page.has_children');
8295
+ }
8296
+ },
8297
+ is_present: function() {
8298
+ return infopark.obj.current_page_id;
8299
+ },
8300
+ is_enabled: function() {
8301
+ return infopark.gui.workspace().is_editable() && !infopark.obj.current_page_has_children;
8302
+ },
8303
+ execute: function() {
8304
+ infopark.commands.duplicate_obj(infopark.obj.current_page());
8305
+ }
8306
+ },
7978
8307
 
7979
- on_click('ip_deactivate_editing', function() {
7980
- infopark.editing.deactivate();
7981
- });
8308
+ {
8309
+ name: 'revert_current_page',
8310
+ icon: '&#xf032;',
8311
+ title: function() {
8312
+ if (!infopark.gui.workspace().is_editable()) {
8313
+ return infopark.i18n.translate(
8314
+ 'menu_bar_dropdown.revert_current_page.workspace_is_published');
8315
+ }
8316
+ if (infopark.gui.workspace().is_rtc()) {
8317
+ return infopark.i18n.translate('menu_bar_dropdown.revert_current_page.workspace_is_rtc');
8318
+ }
8319
+ if (!infopark.obj.current_page_modification) {
8320
+ return infopark.i18n.translate('menu_bar_dropdown.revert_current_page.obj_is_unchanged');
8321
+ }
8322
+ if (infopark.obj.current_page_modification === 'new') {
8323
+ return infopark.i18n.translate('menu_bar_dropdown.revert_current_page.obj_is_new');
8324
+ }
8325
+ if (infopark.obj.current_page_modification === 'deleted') {
8326
+ return infopark.i18n.translate('menu_bar_dropdown.revert_current_page.obj_is_deleted');
8327
+ }
8328
+ },
8329
+ is_present: function() {
8330
+ return infopark.obj.current_page_id;
8331
+ },
8332
+ is_enabled: function() {
8333
+ return infopark.gui.workspace().is_editable() && !infopark.gui.workspace().is_rtc() &&
8334
+ infopark.obj.current_page_modification === 'edited';
8335
+ },
8336
+ execute: function() {
8337
+ infopark.commands.revert_obj(infopark.obj.current_page());
8338
+ }
8339
+ },
7982
8340
 
7983
- var disable_with_children = function() {
7984
- if (infopark.obj.current_page_has_children) {
7985
- return 'ip_menu_item disabled';
7986
- } else {
7987
- return 'ip_menu_item';
8341
+ {
8342
+ name: 'delete_current_page',
8343
+ icon: '&#xf018;',
8344
+ title: function() {
8345
+ if (!infopark.gui.workspace().is_editable()) {
8346
+ return infopark.i18n.translate(
8347
+ 'menu_bar_dropdown.delete_current_page.workspace_is_published');
8348
+ }
8349
+ if (infopark.obj.current_page_has_children) {
8350
+ return infopark.i18n.translate('menu_bar_dropdown.delete_current_page.has_children');
8351
+ }
8352
+ },
8353
+ is_present: function() {
8354
+ return infopark.obj.current_page_id;
8355
+ },
8356
+ is_enabled: function() {
8357
+ return infopark.gui.workspace().is_editable() && !infopark.obj.current_page_has_children;
8358
+ },
8359
+ execute: function() {
8360
+ infopark.commands.delete_obj(infopark.obj.current_page());
8361
+ }
8362
+ },
8363
+
8364
+ {
8365
+ name: 'open_current_page_in_admin_gui',
8366
+ icon: '&#xf000;',
8367
+ is_present: function() {
8368
+ return infopark.obj.current_page_id;
8369
+ },
8370
+ is_enabled: function() {
8371
+ return infopark.obj.current_page_id;
8372
+ },
8373
+ execute: function() {
8374
+ infopark.commands.open_in_admin_gui(infopark.obj.current_page_id);
8375
+ }
7988
8376
  }
7989
- };
8377
+ ];
8378
+ }());
8379
+ (function() {
8380
+ $.extend(infopark, {
8381
+ menu_bar_close: {
8382
+ init: function() {
8383
+ infopark.menu_bar.register_item_renderer(function(menu_bar) {
8384
+ var menu_bar_close = menu_bar.find('#ip_menu_bar_close').html(
8385
+ infopark.template.render('menu_bar_close'));
8386
+
8387
+ menu_bar_close.on('click', function() {
8388
+ infopark.gui.close();
8389
+ });
8390
+ });
8391
+ }
8392
+ }
8393
+ });
7990
8394
  }());
7991
8395
  (function() {
7992
8396
  var t = infopark.i18n.translate;
@@ -8020,9 +8424,9 @@ var infopark = {
8020
8424
 
8021
8425
  var renderer = function(view) {
8022
8426
  var select_menu_view = $(infopark.template.render('workspace_select_menu_bar_item', {
8023
- current_workspace: infopark.editing.workspace(),
8024
- current_short_title: workspace_title_short(infopark.editing.workspace()),
8025
- current_long_title: workspace_title_long(infopark.editing.workspace())
8427
+ current_workspace: infopark.gui.workspace(),
8428
+ current_short_title: workspace_title_short(infopark.gui.workspace()),
8429
+ current_long_title: workspace_title_long(infopark.gui.workspace())
8026
8430
  }));
8027
8431
 
8028
8432
  view.find('#ip_select_workspace').append(select_menu_view);
@@ -8049,7 +8453,7 @@ var infopark = {
8049
8453
  is_editable: ws.is_editable,
8050
8454
  long_title: workspace_title_long(ws),
8051
8455
  select_title: workspace_title_select(ws),
8052
- is_current_workspace: (ws.id() === infopark.editing.workspace().id())
8456
+ is_current_workspace: (ws.id() === infopark.gui.workspace().id())
8053
8457
  };
8054
8458
  });
8055
8459
 
@@ -8095,11 +8499,11 @@ var infopark = {
8095
8499
  icon: '&#xF064;',
8096
8500
  confirm_button_text: t('menu_bar.publish'),
8097
8501
  title: t('menu_bar.publish_ws_confirmation', workspace_title_short(
8098
- infopark.editing.workspace())),
8502
+ infopark.gui.workspace())),
8099
8503
  description: t('menu_bar.publish_ws_confirmation_desc')
8100
8504
  }).done(function() {
8101
8505
  infopark.with_saving_overlay(
8102
- infopark.editing.workspace().publish().then(function() {
8506
+ infopark.gui.workspace().publish().then(function() {
8103
8507
  return infopark.redirect_to('?_rc-ws=published');
8104
8508
  })
8105
8509
  );
@@ -8110,13 +8514,13 @@ var infopark = {
8110
8514
  default_click_action(e);
8111
8515
  infopark.prompt_dialog({
8112
8516
  icon: '&#xF04F;',
8113
- title: t('menu_bar.rename_working_copy', infopark.editing.workspace().title()),
8517
+ title: t('menu_bar.rename_working_copy', infopark.gui.workspace().title()),
8114
8518
  description: t('menu_bar.rename_working_copy_desc'),
8115
- value: infopark.editing.workspace().title(),
8519
+ value: infopark.gui.workspace().title(),
8116
8520
  accept_button_text: t('menu_bar.rename')
8117
8521
  }).done(function(new_title) {
8118
8522
  infopark.with_saving_overlay(
8119
- infopark.editing.workspace().rename(new_title).then(function() {
8523
+ infopark.gui.workspace().rename(new_title).then(function() {
8120
8524
  return infopark.reload();
8121
8525
  })
8122
8526
  );
@@ -8126,7 +8530,7 @@ var infopark = {
8126
8530
  $(document).on("click.ip-rebase-ws", "#ip-rebase-current-ws", function(e) {
8127
8531
  default_click_action(e);
8128
8532
  infopark.with_saving_overlay(
8129
- infopark.editing.workspace().rebase().then(function() {
8533
+ infopark.gui.workspace().rebase().then(function() {
8130
8534
  return infopark.reload();
8131
8535
  })
8132
8536
  );
@@ -8139,17 +8543,22 @@ var infopark = {
8139
8543
  confirm_button_color: 'ip_red',
8140
8544
  confirm_button_text: t('menu_bar.delete'),
8141
8545
  title: t('menu_bar.delete_ws_confirmation', workspace_title_short(
8142
- infopark.editing.workspace())),
8546
+ infopark.gui.workspace())),
8143
8547
  description: t('menu_bar.delete_ws_confirmation_desc')
8144
8548
  }).done(function() {
8145
8549
  infopark.with_saving_overlay(
8146
- infopark.editing.workspace().destroy().then(function(new_workspace) {
8550
+ infopark.gui.workspace().destroy().then(function(new_workspace) {
8147
8551
  return infopark.redirect_to('?_rc-ws=published');
8148
8552
  })
8149
8553
  );
8150
8554
  });
8151
8555
  });
8152
8556
 
8557
+ $(document).on('click', '#ip_changes_list_toggle', function(e) {
8558
+ e.preventDefault();
8559
+ infopark.changes_dialog.open();
8560
+ });
8561
+
8153
8562
  $.extend(infopark, {
8154
8563
  workspace_select: {
8155
8564
  init: function() {
@@ -8158,6 +8567,176 @@ var infopark = {
8158
8567
  }
8159
8568
  });
8160
8569
  }());
8570
+ (function() {
8571
+ $.extend(infopark, {
8572
+ changes_dialog: {
8573
+ open: function() {
8574
+ loaded_objs = [];
8575
+ total_obj_count = 0;
8576
+ batch = basic_batch();
8577
+
8578
+ view = $(infopark.template.render('changes_list_dialog'));
8579
+
8580
+ $('#ip-editing').append(view);
8581
+ var next_loader = view.find('.ip_load_more');
8582
+
8583
+ target = view.find('#ip_changes_table_loaded');
8584
+ var spinner = view.find('#ip_changes_table_loading');
8585
+ var empty_result = view.find('#ip_changes_table_empty_result');
8586
+
8587
+ var obj_count = view.find('#ip_obj_count');
8588
+
8589
+ loaded_obj_count_ref = view.find('#ip_loaded_obj_count');
8590
+ total_obj_count_ref = view.find('#ip_total_obj_count');
8591
+
8592
+ load_markup = function() {
8593
+ loading_in_progress = true;
8594
+ spinner.show();
8595
+
8596
+ batch.load_batch().then(function(data, next) {
8597
+ loading_in_progress = false;
8598
+
8599
+ batch = next;
8600
+ if (!batch) {
8601
+ next_loader.hide();
8602
+ } else {
8603
+ next_loader.show();
8604
+ }
8605
+
8606
+ if (data.total > 0) {
8607
+ loaded_objs = loaded_objs.concat(data.hits);
8608
+ total_obj_count = data.total;
8609
+
8610
+ render_objs(loaded_objs);
8611
+ } else {
8612
+ empty_result.show();
8613
+ }
8614
+
8615
+ spinner.hide();
8616
+
8617
+ loaded_obj_count_ref.text(loaded_objs.length);
8618
+ total_obj_count_ref.text(total_obj_count);
8619
+ obj_count.show();
8620
+
8621
+ view.on('click.ip_link_to_obj', '.ip_link_to_obj', function(e) {
8622
+ var obj_id = $(e.currentTarget).attr('data-obj-id');
8623
+ infopark.change_location('/' + obj_id);
8624
+ return false;
8625
+ });
8626
+ });
8627
+ };
8628
+
8629
+ next_loader.on('click', load_markup);
8630
+ load_markup();
8631
+ activate_sorting();
8632
+
8633
+ var deferred = $.Deferred();
8634
+
8635
+ var cancel = function(e) {
8636
+ e.preventDefault();
8637
+ infopark.dialog.close(view);
8638
+ deferred.resolve();
8639
+ };
8640
+
8641
+ view.find('.ip_cancel').on('click', cancel);
8642
+
8643
+ infopark.transition(view, function() {
8644
+ view.addClass('ip_show');
8645
+ }).then(function() {
8646
+ infopark.dialog.adjust(view);
8647
+ });
8648
+
8649
+ return infopark.with_dialog_behaviour(deferred, {escape: cancel});
8650
+ }
8651
+ }
8652
+ });
8653
+
8654
+ var batch;
8655
+ var view;
8656
+ var loaded_obj_count_ref;
8657
+ var total_obj_count_ref;
8658
+ var loaded_objs;
8659
+ var total_obj_count;
8660
+ var target;
8661
+ var load_markup;
8662
+ var loading_in_progress;
8663
+
8664
+ var basic_batch = function() {
8665
+ return infopark.
8666
+ obj_where('_modification', 'equals', ['new', 'edited', 'deleted']).
8667
+ batch_size(100).
8668
+ order('_last_changed').
8669
+ reverse_order().
8670
+ format('_changes_list').
8671
+ include_deleted();
8672
+ };
8673
+
8674
+ var render_objs = function(objs) {
8675
+ var markup = _.map(objs, function(obj) {
8676
+ return infopark.template.render('changes_list_row', obj);
8677
+ });
8678
+ target.html(markup);
8679
+ };
8680
+
8681
+ var activate_sorting = function() {
8682
+ var sortables = view.find('.ip_sortable');
8683
+
8684
+ view.on('click.ip_sortable', '.ip_sortable', function() {
8685
+ if (loading_in_progress) {
8686
+ return;
8687
+ }
8688
+
8689
+ var sortable = $(this);
8690
+ var sorting_by = {};
8691
+ sorting_by.attribute = sortable.attr('data-ip-sort-by');
8692
+
8693
+ var order_was_asc = sortable.hasClass('sort_up');
8694
+ if (order_was_asc) {
8695
+ sorting_by.order = 'desc';
8696
+ } else {
8697
+ sorting_by.order = 'asc';
8698
+ }
8699
+ sortables.removeClass('sort_up').removeClass('sort_down');
8700
+
8701
+ var local_sort = function() {
8702
+ var objs = _.sortBy(loaded_objs, sorting_by.attribute);
8703
+
8704
+ if (sorting_by.order === 'desc') {
8705
+ objs = objs.reverse();
8706
+ }
8707
+
8708
+ render_objs(objs);
8709
+ };
8710
+
8711
+ var backend_sort = function() {
8712
+ batch = basic_batch();
8713
+ batch.order('_' + sorting_by.attribute);
8714
+
8715
+ if (sorting_by.order === 'asc') {
8716
+ batch.reverse_order();
8717
+ }
8718
+
8719
+ loaded_objs = [];
8720
+ render_objs(loaded_objs);
8721
+ load_markup();
8722
+ };
8723
+
8724
+ if (loaded_objs.length === total_obj_count) {
8725
+ local_sort();
8726
+ } else {
8727
+ backend_sort();
8728
+ }
8729
+
8730
+ if (sorting_by.order === 'asc') {
8731
+ sortable.addClass('sort_up');
8732
+ } else {
8733
+ sortable.addClass('sort_down');
8734
+ }
8735
+ });
8736
+
8737
+ };
8738
+
8739
+ }());
8161
8740
  (function() {
8162
8741
 
8163
8742
  $.extend(infopark, {
@@ -8476,6 +9055,10 @@ $(function() {
8476
9055
  return infopark.ajax('DELETE', 'objs/' + that.id());
8477
9056
  },
8478
9057
 
9058
+ revert: function() {
9059
+ return infopark.ajax('PUT', 'objs/' + that.id() + '/revert');
9060
+ },
9061
+
8479
9062
  fetch_edit_markup: function() {
8480
9063
  return infopark.ajax('GET', 'objs/' + that.id() + '/edit').then(function(data) {
8481
9064
  return data.markup;
@@ -8523,6 +9106,131 @@ $(function() {
8523
9106
  }
8524
9107
  });
8525
9108
  }());
9109
+ (function() {
9110
+ $.extend(infopark, {
9111
+ chainable_search: {
9112
+ create_instance: function(build_query) {
9113
+ // Private
9114
+ var query = build_query || { predicates: [] };
9115
+
9116
+ var add_predicate = function(field, operator, value, boost, negate) {
9117
+ var new_query = {
9118
+ field: field,
9119
+ operator: operator,
9120
+ value: value
9121
+ };
9122
+
9123
+ if (negate) {
9124
+ new_query.negate = true;
9125
+ }
9126
+
9127
+ if (boost) {
9128
+ new_query.boost = boost;
9129
+ }
9130
+
9131
+ query.predicates.push(new_query);
9132
+ return that;
9133
+ };
9134
+
9135
+ var execute_search = function(query, action) {
9136
+ return infopark.ajax('GET', 'objs/search?' +
9137
+ $.param({query: JSON.stringify(query), query_action: action}));
9138
+ };
9139
+
9140
+ // Public
9141
+ var that = {
9142
+ query: function() {
9143
+ return query;
9144
+ },
9145
+
9146
+ and: function(field, operator, value, boost) {
9147
+ add_predicate(field, operator, value, boost);
9148
+ return that;
9149
+ },
9150
+
9151
+ and_not: function(field, operator, value) {
9152
+ add_predicate(field, operator, value, undefined, true);
9153
+ return that;
9154
+ },
9155
+
9156
+ offset: function(offset) {
9157
+ query.offset = offset;
9158
+ return that;
9159
+ },
9160
+
9161
+ order: function(order) {
9162
+ query.order = order;
9163
+ return that;
9164
+ },
9165
+
9166
+ reverse_order: function() {
9167
+ if (query.reverse_order) {
9168
+ delete query.reverse_order;
9169
+ } else {
9170
+ query.reverse_order = true;
9171
+ }
9172
+ return that;
9173
+ },
9174
+
9175
+ batch_size: function(batch_size) {
9176
+ query.batch_size = batch_size;
9177
+ return that;
9178
+ },
9179
+
9180
+ format: function(name) {
9181
+ query.format = name;
9182
+ return that;
9183
+ },
9184
+
9185
+ include_deleted: function() {
9186
+ query.include_deleted = true;
9187
+ return that;
9188
+ },
9189
+
9190
+ load_batch: function() {
9191
+ var offset = query.offset || 0;
9192
+ var next;
9193
+
9194
+ return execute_search(query).then(function(result) {
9195
+ var batch_size = result.hits.length;
9196
+ var total_matches = result.total;
9197
+
9198
+ if (total_matches > (batch_size + offset)) {
9199
+ var next_offset = offset + batch_size;
9200
+ var next_query = $.extend({}, query, {offset: next_offset});
9201
+ next = infopark.chainable_search.create_instance(next_query);
9202
+ } else {
9203
+ next = undefined;
9204
+ }
9205
+
9206
+ return $.Deferred().resolve(result, next);
9207
+ });
9208
+ },
9209
+
9210
+ size: function() {
9211
+ return execute_search(query, 'size').then(function(result) {
9212
+ return $.Deferred().resolve(result.total);
9213
+ });
9214
+ }
9215
+
9216
+ };
9217
+
9218
+ return that;
9219
+ }
9220
+ }
9221
+
9222
+ });
9223
+
9224
+ }());
9225
+
9226
+ (function() {
9227
+ $.extend(infopark, {
9228
+ obj_where: function(field, operator, value, boost) {
9229
+ return infopark.chainable_search.create_instance().and(field, operator, value, boost);
9230
+ }
9231
+ });
9232
+ }());
9233
+
8526
9234
  (function() {
8527
9235
  var field_types = [
8528
9236
  'binary',
@@ -8530,7 +9238,8 @@ $(function() {
8530
9238
  'linklist',
8531
9239
  'multienum',
8532
9240
  'reference',
8533
- 'referencelist'
9241
+ 'referencelist',
9242
+ 'text'
8534
9243
  ];
8535
9244
 
8536
9245
  $.extend(infopark, {
@@ -8734,6 +9443,9 @@ $(function() {
8734
9443
  is_editable: function() {
8735
9444
  return that.id() !== 'published';
8736
9445
  },
9446
+ is_rtc: function() {
9447
+ return that.id() === 'rtc';
9448
+ },
8737
9449
  publish: function() {
8738
9450
  if (that.is_editable()) {
8739
9451
  return infopark.ajax('PUT', 'workspaces/' + that.id() + '/publish');
@@ -8956,6 +9668,13 @@ $(function() {
8956
9668
  (function() {
8957
9669
  Handlebars.registerHelper('translate', infopark.i18n.translate);
8958
9670
 
9671
+ Handlebars.registerHelper('concat_translate', function(key_prefix, key) {
9672
+ // Temporary workaround.
9673
+ // The `handlebars_assets` gem as of the version `0.15` bundles the version `1.2.2`
9674
+ // of the Handlebars. Subexpressions are supported from the Handlebars version `1.3.0` on.
9675
+ return infopark.i18n.translate(key_prefix + key);
9676
+ });
9677
+
8959
9678
  $.extend(infopark, {
8960
9679
  template: {
8961
9680
  load_templates_from_server: false,
@@ -9199,6 +9918,11 @@ $(function() {
9199
9918
  enter: confirm_action,
9200
9919
  escape: cancel_action
9201
9920
  });
9921
+ },
9922
+
9923
+ // Test purpose only.
9924
+ remove_all: function() {
9925
+ $('.ip_confirmation_dialog').remove();
9202
9926
  }
9203
9927
  });
9204
9928
  }());
@@ -9386,7 +10110,7 @@ $(function() {
9386
10110
  spinner.hide();
9387
10111
  target.show();
9388
10112
 
9389
- infopark.editing.new_content(target.get(0));
10113
+ infopark.gui.new_content(target.get(0));
9390
10114
  }, function() {
9391
10115
  close();
9392
10116
  });
@@ -9444,11 +10168,11 @@ $(function() {
9444
10168
  menu_define_callbacks = [];
9445
10169
  },
9446
10170
  init: function() {
9447
- infopark.editing.on('activate', function() {
10171
+ infopark.gui.on('editing', function() {
9448
10172
  infopark.inplace_menus.refresh();
9449
10173
  });
9450
10174
 
9451
- infopark.editing.on('new_content', function() {
10175
+ infopark.gui.on('new_content', function() {
9452
10176
  infopark.inplace_menus.refresh();
9453
10177
  });
9454
10178
  },
@@ -9609,13 +10333,23 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
9609
10333
  });
9610
10334
  },
9611
10335
 
10336
+ revert_obj: function(obj) {
10337
+ return infopark.confirmation_dialog({
10338
+ icon: '&#xF032;',
10339
+ confirm_button_color: 'ip_red',
10340
+ confirm_button_text: infopark.i18n.translate('menu_bar.revert'),
10341
+ title: infopark.i18n.translate('commands.revert_obj.confirm_title'),
10342
+ description: infopark.i18n.translate('commands.revert_obj.confirm_description')
10343
+ }).then(function() {
10344
+ return infopark.with_saving_overlay(obj.revert().then(function() {
10345
+ infopark.reload();
10346
+ }));
10347
+ });
10348
+ },
10349
+
9612
10350
  save_obj_to_clipboard: function(obj) {
9613
- if (!infopark.obj.current_page_has_children) {
9614
- infopark.clipboard.save_obj(obj);
9615
- infopark.inplace_menus.refresh();
9616
- } else {
9617
- infopark.alert(infopark.i18n.translate('commands.save_obj.has_children'));
9618
- }
10351
+ infopark.clipboard.save_obj(obj);
10352
+ infopark.inplace_menus.refresh();
9619
10353
  },
9620
10354
 
9621
10355
  move_obj_into: function(child_list_element) {
@@ -9630,7 +10364,6 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
9630
10364
  description: infopark.i18n.translate('commands.move_obj_into.confirm_description')
9631
10365
  }).then(function() {
9632
10366
  var obj = infopark.clipboard.obj();
9633
-
9634
10367
  return infopark.with_saving_overlay(child_list_element.add_child(obj).then(function() {
9635
10368
  infopark.clipboard.clear();
9636
10369
  return infopark.reload();
@@ -9640,21 +10373,17 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
9640
10373
  },
9641
10374
 
9642
10375
  duplicate_obj: function(obj) {
9643
- if (!infopark.obj.current_page_has_children) {
9644
- return infopark.confirmation_dialog({
9645
- icon: '&#xF015;',
9646
- confirm_button_color: 'ip_green',
9647
- confirm_button_text: infopark.i18n.translate('commands.duplicate_obj.button_text'),
9648
- title: infopark.i18n.translate('commands.duplicate_obj.confirm_title'),
9649
- description: infopark.i18n.translate('commands.duplicate_obj.confirm_description')
9650
- }).then(function(){
9651
- return infopark.with_saving_overlay(obj.duplicate().then(function(dup_page) {
9652
- return infopark.redirect_to('/'+dup_page.id());
9653
- }));
9654
- });
9655
- } else {
9656
- infopark.alert(infopark.i18n.translate('commands.duplicate_obj.has_children'));
9657
- }
10376
+ return infopark.confirmation_dialog({
10377
+ icon: '&#xF015;',
10378
+ confirm_button_color: 'ip_green',
10379
+ confirm_button_text: infopark.i18n.translate('commands.duplicate_obj.button_text'),
10380
+ title: infopark.i18n.translate('commands.duplicate_obj.confirm_title'),
10381
+ description: infopark.i18n.translate('commands.duplicate_obj.confirm_description')
10382
+ }).then(function(){
10383
+ return infopark.with_saving_overlay(obj.duplicate().then(function(new_obj) {
10384
+ return infopark.redirect_to('/' + new_obj.id());
10385
+ }));
10386
+ });
9658
10387
  },
9659
10388
 
9660
10389
  copy_obj_into: function(child_list_element) {
@@ -9692,7 +10421,7 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
9692
10421
  } else {
9693
10422
  widget_field_element.dom_element().append(dom_element);
9694
10423
  }
9695
- infopark.editing.new_content(dom_element.get(0));
10424
+ infopark.gui.new_content(dom_element.get(0));
9696
10425
  })
9697
10426
  ).then(function() {
9698
10427
  return widget_field_element.save().then(function() {
@@ -9736,6 +10465,10 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
9736
10465
  var widget = widget_element.widget();
9737
10466
  widget_element.dom_element().remove();
9738
10467
 
10468
+ if(widget_field_element.widget_elements().length === 0){
10469
+ infopark.inplace_menus.refresh();
10470
+ }
10471
+
9739
10472
  return widget_field_element.save().then(function() {
9740
10473
  return widget.destroy();
9741
10474
  });
@@ -9744,7 +10477,7 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
9744
10477
 
9745
10478
  open_in_admin_gui: function(obj_id) {
9746
10479
  window.open(
9747
- infopark.admin_gui_base_url + '#' + obj_id + ';dc;' + infopark.editing.workspace().id(),
10480
+ infopark.admin_gui_base_url + '#' + obj_id + ';dc;' + infopark.gui.workspace().id(),
9748
10481
  'admin-gui', // New window has a name, so it can be identified in integration tests.
9749
10482
  'status=1,toolbar=1,location=1,menubar=1,scrollbars=1,resizable=1'
9750
10483
  );
@@ -9772,7 +10505,7 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
9772
10505
  widget_menus: {
9773
10506
  init: function() {
9774
10507
  infopark.inplace_menus.define(function(menu) {
9775
- if (infopark.editing.workspace().is_editable()) {
10508
+ if (infopark.gui.workspace().is_editable()) {
9776
10509
  _.each(infopark.widget_field_element.all(), function(widget_field_element) {
9777
10510
  var widget_elements = widget_field_element.widget_elements();
9778
10511
 
@@ -9851,7 +10584,7 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
9851
10584
  widget_element.fetch_show_markup().then(function(show_markup) {
9852
10585
  var new_jquery_object = $(show_markup);
9853
10586
  jquery_object.replaceWith(new_jquery_object);
9854
- infopark.editing.new_content(new_jquery_object.get(0));
10587
+ infopark.gui.new_content(new_jquery_object.get(0));
9855
10588
  })
9856
10589
  );
9857
10590
 
@@ -9863,8 +10596,8 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
9863
10596
  $.extend(infopark, {
9864
10597
  widget_sorting: {
9865
10598
  init: function() {
9866
- infopark.editing.on('activate', create);
9867
- infopark.editing.on('new_content', create);
10599
+ infopark.gui.on('editing', create);
10600
+ infopark.gui.on('new_content', create);
9868
10601
  },
9869
10602
 
9870
10603
  // Called when actual dragging started.
@@ -9889,7 +10622,7 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
9889
10622
  });
9890
10623
 
9891
10624
  var create = function() {
9892
- if (infopark.editing.workspace().is_editable()) {
10625
+ if (infopark.gui.workspace().is_editable()) {
9893
10626
  _.each(infopark.widget_field_element.all(), function(widget_field_element) {
9894
10627
  var dom_element = widget_field_element.dom_element();
9895
10628
  if (!dom_element.data('ui-sortable')) {
@@ -9910,7 +10643,7 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
9910
10643
  child_list_menus: {
9911
10644
  init: function() {
9912
10645
  infopark.inplace_menus.define(function(menu) {
9913
- if (infopark.editing.workspace().is_editable()) {
10646
+ if (infopark.gui.workspace().is_editable()) {
9914
10647
  _.each(infopark.child_list_element.all(), function(child_list_element) {
9915
10648
  menu.add_item(child_list_element.dom_element(), {
9916
10649
  title: infopark.i18n.translate('child_list_menus.add_subpage'),
@@ -10077,7 +10810,7 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
10077
10810
  view.find(".ip_input_new_ws_name label, .ip_input_new_ws_name input").addClass("ip_disabled");
10078
10811
  });
10079
10812
 
10080
- view.on('focus click', '.ip_input_new_ws_name', function(e) {
10813
+ view.on('focus click drop', '.ip_input_new_ws_name', function(e) {
10081
10814
  create_new_ws = true;
10082
10815
  view.find(".ip_confirm").html(infopark.i18n.translate('menu_bar.create'));
10083
10816
  view.find(".ip_disabled").removeClass("ip_disabled");
@@ -10123,8 +10856,8 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
10123
10856
  },
10124
10857
 
10125
10858
  init: function() {
10126
- infopark.editing.on('activate', function(options) {
10127
- if((options.on_initialize !== true) && !infopark.editing.workspace().is_editable()) {
10859
+ infopark.gui.on('open', function(options) {
10860
+ if((options.on_initialize !== true) && !infopark.gui.workspace().is_editable()) {
10128
10861
  infopark.editable_workspace_dialog.open();
10129
10862
  }
10130
10863
  });
@@ -10231,6 +10964,10 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
10231
10964
 
10232
10965
 
10233
10966
 
10967
+
10968
+
10969
+
10970
+
10234
10971
 
10235
10972
 
10236
10973
 
@@ -10238,7 +10975,9 @@ $(window).on('load', function () { infopark.inplace_menus.refresh_positions(); }
10238
10975
 
10239
10976
  infopark.inplace_menus.init();
10240
10977
  infopark.menu_bar_saving_indicator.init();
10978
+ infopark.menu_bar_toggle.init();
10241
10979
  infopark.menu_bar_dropdown.init();
10980
+ infopark.menu_bar_close.init();
10242
10981
  infopark.workspace_select.init();
10243
10982
  infopark.menu_bar.init();
10244
10983
  infopark.widget_menus.init();