infopark_cloud_connector 7.0.1 → 7.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/controllers/rails_connector/default_cms_controller.rb +3 -11
- data/app/controllers/rails_connector/objs_controller.rb +9 -7
- data/app/helpers/rails_connector/default_cms_helper.rb +1 -2
- data/app/helpers/rails_connector/default_cms_routing_helper.rb +18 -11
- data/app/helpers/rails_connector/display_helper.rb +3 -15
- data/app/helpers/rails_connector/layout_helper.rb +0 -2
- data/app/helpers/rails_connector/table_of_contents_helper.rb +1 -16
- data/config/ca-bundle.crt +1 -1
- data/config/cms_routes.rb +0 -3
- data/lib/assets/javascripts/infopark_editing.js +252 -182
- data/lib/infopark_cloud_connector.rb +0 -20
- data/lib/rails_connector/basic_obj.rb +5 -35
- data/lib/rails_connector/cms_accessible.rb +4 -71
- data/lib/rails_connector/configuration.rb +0 -9
- data/lib/rails_connector/engine.rb +0 -1
- data/lib/rails_connector/obj_data_from_service.rb +4 -2
- metadata +2 -7
- data/app/helpers/rails_connector/marker_helper.rb +0 -46
- data/app/views/errors/403_forbidden.html.erb +0 -3
- data/config/locales/de.rails_connector.views.yml +0 -6
- data/config/locales/en.rails_connector.views.yml +0 -6
- data/lib/rails_connector/authenticable.rb +0 -30
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjJjMWIxMWM5ZDliZGZlZTNlNjg0OWNjOTVlNjkwMjg3NzZjNDgxZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGE3MDQ0YjUwNDJjMjEwNjYyNzIzY2VkNDBlYzAzMjcyOGZhZTk5NA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTI5NGNiMTJjMDZjMWQ5NzVlMzU4MWQzOTEwZjY1ZGFjMDE3YjgyMDIwZmQy
|
10
|
+
MGY2YTNlZTI1MjFjYmNlZGYwMjc2N2NkODNkYzUwYWRiZWM5OWZiNDNhMzIy
|
11
|
+
NjUxZjdmMjM3NDM2ZDBkMjYyYmEzNDk1MTZlODUwMjU1NjRkYTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZmNmNDM5ZTAzYTY5OWMyZTJlMmE0MTNkNGMxODJlMTlkOWExOTJhMTIwYjQ3
|
14
|
+
ZThhYmUxMWI4ZGZlMzk0YzI1NGI0MjNjOWMxNzg4ODJhOWU3ZDBlYjRiYjc1
|
15
|
+
ZDExNzFiMTc4YTA5OTZlZjY0NGI4M2M5ODAxMmQxN2Q2NDRjMmE=
|
@@ -8,20 +8,12 @@ module RailsConnector
|
|
8
8
|
class DefaultCmsController < ApplicationController
|
9
9
|
include CmsAccessible
|
10
10
|
before_filter :load_object
|
11
|
-
before_filter :ensure_object_is_permitted
|
12
|
-
before_filter :set_google_expire_header
|
13
11
|
|
14
|
-
# Default Action. Delivers files directly if
|
12
|
+
# Default Action. Delivers files directly if {BasicObj#binary?}.
|
13
|
+
# Otherwise the view is rendered.
|
15
14
|
# @api public
|
16
15
|
def index
|
17
|
-
deliver_file if @obj.
|
18
|
-
end
|
19
|
-
|
20
|
-
# Toggles edit markers. The current status is stored in the session.
|
21
|
-
# @api public
|
22
|
-
def toggle_editmarkers
|
23
|
-
session[:hide_editmarkers] = !session[:hide_editmarkers]
|
24
|
-
redirect_to cms_id_url(@obj)
|
16
|
+
deliver_file if @obj.binary?
|
25
17
|
end
|
26
18
|
|
27
19
|
# This method indicates if this controller should be used automatically when an Obj is
|
@@ -124,9 +124,11 @@ module RailsConnector
|
|
124
124
|
widget_pool_params.each_pair do |widget_id, widget_params|
|
125
125
|
widget = obj.widget_from_pool(widget_id)
|
126
126
|
|
127
|
-
widget_params.
|
128
|
-
|
129
|
-
|
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
|
130
132
|
end
|
131
133
|
end
|
132
134
|
end
|
@@ -136,10 +138,10 @@ module RailsConnector
|
|
136
138
|
ContentConversion.convert_html_links(html, request.host, request.port)
|
137
139
|
end
|
138
140
|
|
139
|
-
def copy_obj(
|
140
|
-
copied_attributes.
|
141
|
-
|
142
|
-
|
141
|
+
def copy_obj(attributes, target_path=nil)
|
142
|
+
copied_attributes = attributes.reject do |key, _|
|
143
|
+
%w{id _last_changed _permalink}.include?(key)
|
144
|
+
end
|
143
145
|
copied_attributes['_path'] = "#{target_path}/#{SecureRandom.hex(6)}"
|
144
146
|
|
145
147
|
task_unaware_request(:post, "workspaces/#{Workspace.current.id}/objs", obj: copied_attributes)
|
@@ -11,11 +11,10 @@ module RailsConnector
|
|
11
11
|
# @api public
|
12
12
|
module DefaultCmsHelper
|
13
13
|
include DisplayHelper
|
14
|
-
include MarkerHelper
|
15
14
|
include CmsAssetHelper
|
16
15
|
include RailsConnector::CmsAssetHelper
|
17
|
-
include RailsConnector::TableOfContentsHelper
|
18
16
|
include RailsConnector::EditingHelper
|
17
|
+
include RailsConnector::TableOfContentsHelper
|
19
18
|
include RailsConnector::LayoutHelper
|
20
19
|
include RailsConnector::CmsTagHelper
|
21
20
|
end
|
@@ -24,6 +24,7 @@ module RailsConnector
|
|
24
24
|
|
25
25
|
LINK_TO_UNREACHABLE = "#__target_object_not_reachable"
|
26
26
|
LINK_TO_EMPTY_LINKLIST = "#__empty_linklist"
|
27
|
+
LINK_TO_EMPTY_BLOB = "#__empty_blob"
|
27
28
|
|
28
29
|
def cms_path_or_url(target, path_or_url, options = {})
|
29
30
|
if target.is_a?(Link)
|
@@ -52,20 +53,26 @@ module RailsConnector
|
|
52
53
|
|
53
54
|
def cms_path_or_url_for_objs(obj, path_or_url, options = {})
|
54
55
|
permalink = obj.permalink
|
55
|
-
|
56
|
-
if permalink
|
56
|
+
dont_resolve_blobs = options.delete(:dont_resolve_blobs)
|
57
|
+
if permalink
|
57
58
|
__send__("cms_permalink_#{path_or_url}", options.merge(:permalink => permalink))
|
58
|
-
elsif obj.homepage?
|
59
|
+
elsif obj.homepage?
|
59
60
|
__send__("root_#{path_or_url}", options)
|
60
61
|
else
|
61
|
-
if obj.
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
62
|
+
if obj.binary? && !dont_resolve_blobs
|
63
|
+
if obj.body_data_url
|
64
|
+
enforce_protocol_from_request(obj.body_data_url)
|
65
|
+
else
|
66
|
+
LINK_TO_EMPTY_BLOB
|
67
|
+
end
|
66
68
|
else
|
67
|
-
|
68
|
-
|
69
|
+
__send__(
|
70
|
+
"cms_id_#{path_or_url}",
|
71
|
+
options.merge(
|
72
|
+
id: obj.id,
|
73
|
+
slug: obj.slug.presence
|
74
|
+
)
|
75
|
+
)
|
69
76
|
end
|
70
77
|
end
|
71
78
|
end
|
@@ -77,7 +84,7 @@ module RailsConnector
|
|
77
84
|
__send__("cms_#{path_or_url}", link.obj, options)
|
78
85
|
else
|
79
86
|
url = link.external_url
|
80
|
-
options.delete(:
|
87
|
+
options.delete(:dont_resolve_blobs)
|
81
88
|
url = merge_options(url, options) if options.any?
|
82
89
|
url
|
83
90
|
end
|
@@ -26,30 +26,18 @@ module RailsConnector
|
|
26
26
|
|
27
27
|
def display_original_value(value)
|
28
28
|
case value
|
29
|
-
when HtmlString then convert_links(value, :
|
29
|
+
when HtmlString then convert_links(value, :dont_resolve_blobs => true).html_safe
|
30
30
|
else display_value(value)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
# Renders a field from the CMS
|
35
|
-
# If the option :marker is +false+, no edit marker will be rendered.
|
34
|
+
# Renders a field from the CMS.
|
36
35
|
#
|
37
36
|
# <%= display_field @obj, :title %>
|
38
37
|
#
|
39
|
-
# When creating an edit marker, all options except :marker are passed to {MarkerHelper#edit_marker}.
|
40
|
-
#
|
41
38
|
# @api public
|
42
39
|
def display_field(obj, attr, options = {})
|
43
|
-
|
44
|
-
:marker => ![:id, :path, :created, :last_changed, :version].include?(attr.to_sym)
|
45
|
-
})
|
46
|
-
if options.delete :marker
|
47
|
-
edit_marker(obj, attr, options) do |obj, attr|
|
48
|
-
display_value obj[attr]
|
49
|
-
end
|
50
|
-
else
|
51
|
-
display_value obj[attr]
|
52
|
-
end
|
40
|
+
display_value obj[attr]
|
53
41
|
end
|
54
42
|
|
55
43
|
# Legacy method - deprecated
|
@@ -11,7 +11,6 @@ module RailsConnector
|
|
11
11
|
html = "".html_safe
|
12
12
|
html += tag('meta', :name => 'generator',
|
13
13
|
:content => "Rails Connector for Infopark CMS Fiona by Infopark AG (www.infopark.de)")
|
14
|
-
html += include_edit_marker_support
|
15
14
|
html += include_editing_stylesheet
|
16
15
|
html
|
17
16
|
end
|
@@ -20,7 +19,6 @@ module RailsConnector
|
|
20
19
|
# @api public
|
21
20
|
def rails_connector_after_content_tags
|
22
21
|
html = "".html_safe
|
23
|
-
html += render_marker_code
|
24
22
|
html += include_editing_javascript
|
25
23
|
html
|
26
24
|
end
|
@@ -1,22 +1,7 @@
|
|
1
1
|
module RailsConnector
|
2
|
-
|
3
|
-
#
|
4
|
-
# This module contains a helper that can be used to build a table of contents of an object.
|
5
|
-
#
|
6
|
-
# @api public
|
7
2
|
module TableOfContentsHelper
|
8
|
-
|
9
|
-
#
|
10
|
-
# The <tt>table_of_contents</tt> helper method gets an object as argument and returns an array,
|
11
|
-
# which can be used as the table of contents of the given object.
|
12
|
-
#
|
13
|
-
# The returned array consists of the child objects of the given object.
|
14
|
-
# The array is sorted according to the configured sort order and the sort keys.
|
15
|
-
# It also contains only objects which the current user is permitted to view.
|
16
|
-
#
|
17
|
-
# @api public
|
18
3
|
def table_of_contents(obj)
|
19
|
-
obj.sorted_toclist
|
4
|
+
obj.sorted_toclist
|
20
5
|
end
|
21
6
|
end
|
22
7
|
end
|
data/config/ca-bundle.crt
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
##
|
2
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
|
3
3
|
##
|
4
|
-
## Converted at:
|
4
|
+
## Converted at: Thu Nov 21 10:33:57 2013 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
|
data/config/cms_routes.rb
CHANGED
@@ -4,9 +4,6 @@ Rails.application.routes.draw do
|
|
4
4
|
:to => 'rails_connector/cms_dispatch#index',
|
5
5
|
:constraints => { :id => /\d+|[0-9a-f]{16}/ },
|
6
6
|
:as => "cms_id"
|
7
|
-
match 'toggle_markers/:id',
|
8
|
-
:to => 'rails_connector/cms_dispatch#toggle_editmarkers',
|
9
|
-
:as => "toggle_markers"
|
10
7
|
match '/*permalink',
|
11
8
|
:to => 'rails_connector/cms_dispatch#index',
|
12
9
|
:as => 'cms_permalink',
|
@@ -2318,32 +2318,45 @@ THE SOFTWARE.
|
|
2318
2318
|
|
2319
2319
|
*/
|
2320
2320
|
|
2321
|
-
// lib/handlebars/
|
2322
|
-
|
2323
|
-
/*jshint eqnull:true*/
|
2324
|
-
|
2325
|
-
this.Handlebars = {};
|
2321
|
+
// lib/handlebars/browser-prefix.js
|
2322
|
+
var Handlebars = {};
|
2326
2323
|
|
2327
|
-
(function(Handlebars) {
|
2324
|
+
(function(Handlebars, undefined) {
|
2325
|
+
;
|
2326
|
+
// lib/handlebars/base.js
|
2328
2327
|
|
2329
|
-
Handlebars.VERSION = "1.0.0-rc.
|
2330
|
-
Handlebars.COMPILER_REVISION =
|
2328
|
+
Handlebars.VERSION = "1.0.0-rc.4";
|
2329
|
+
Handlebars.COMPILER_REVISION = 3;
|
2331
2330
|
|
2332
2331
|
Handlebars.REVISION_CHANGES = {
|
2333
2332
|
1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
|
2334
|
-
2: '
|
2333
|
+
2: '== 1.0.0-rc.3',
|
2334
|
+
3: '>= 1.0.0-rc.4'
|
2335
2335
|
};
|
2336
2336
|
|
2337
2337
|
Handlebars.helpers = {};
|
2338
2338
|
Handlebars.partials = {};
|
2339
2339
|
|
2340
|
+
var toString = Object.prototype.toString,
|
2341
|
+
functionType = '[object Function]',
|
2342
|
+
objectType = '[object Object]';
|
2343
|
+
|
2340
2344
|
Handlebars.registerHelper = function(name, fn, inverse) {
|
2341
|
-
if(
|
2342
|
-
|
2345
|
+
if (toString.call(name) === objectType) {
|
2346
|
+
if (inverse || fn) { throw new Handlebars.Exception('Arg not supported with multiple helpers'); }
|
2347
|
+
Handlebars.Utils.extend(this.helpers, name);
|
2348
|
+
} else {
|
2349
|
+
if (inverse) { fn.not = inverse; }
|
2350
|
+
this.helpers[name] = fn;
|
2351
|
+
}
|
2343
2352
|
};
|
2344
2353
|
|
2345
2354
|
Handlebars.registerPartial = function(name, str) {
|
2346
|
-
|
2355
|
+
if (toString.call(name) === objectType) {
|
2356
|
+
Handlebars.Utils.extend(this.partials, name);
|
2357
|
+
} else {
|
2358
|
+
this.partials[name] = str;
|
2359
|
+
}
|
2347
2360
|
};
|
2348
2361
|
|
2349
2362
|
Handlebars.registerHelper('helperMissing', function(arg) {
|
@@ -2354,13 +2367,9 @@ Handlebars.registerHelper('helperMissing', function(arg) {
|
|
2354
2367
|
}
|
2355
2368
|
});
|
2356
2369
|
|
2357
|
-
var toString = Object.prototype.toString, functionType = "[object Function]";
|
2358
|
-
|
2359
2370
|
Handlebars.registerHelper('blockHelperMissing', function(context, options) {
|
2360
2371
|
var inverse = options.inverse || function() {}, fn = options.fn;
|
2361
2372
|
|
2362
|
-
|
2363
|
-
var ret = "";
|
2364
2373
|
var type = toString.call(context);
|
2365
2374
|
|
2366
2375
|
if(type === functionType) { context = context.call(this); }
|
@@ -2451,23 +2460,17 @@ Handlebars.registerHelper('if', function(context, options) {
|
|
2451
2460
|
});
|
2452
2461
|
|
2453
2462
|
Handlebars.registerHelper('unless', function(context, options) {
|
2454
|
-
|
2455
|
-
options.fn = inverse;
|
2456
|
-
options.inverse = fn;
|
2457
|
-
|
2458
|
-
return Handlebars.helpers['if'].call(this, context, options);
|
2463
|
+
return Handlebars.helpers['if'].call(this, context, {fn: options.inverse, inverse: options.fn});
|
2459
2464
|
});
|
2460
2465
|
|
2461
2466
|
Handlebars.registerHelper('with', function(context, options) {
|
2462
|
-
return options.fn(context);
|
2467
|
+
if (!Handlebars.Utils.isEmpty(context)) return options.fn(context);
|
2463
2468
|
});
|
2464
2469
|
|
2465
2470
|
Handlebars.registerHelper('log', function(context, options) {
|
2466
2471
|
var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
|
2467
2472
|
Handlebars.log(level, context);
|
2468
2473
|
});
|
2469
|
-
|
2470
|
-
}(this.Handlebars));
|
2471
2474
|
;
|
2472
2475
|
// lib/handlebars/utils.js
|
2473
2476
|
|
@@ -2491,48 +2494,61 @@ Handlebars.SafeString.prototype.toString = function() {
|
|
2491
2494
|
return this.string.toString();
|
2492
2495
|
};
|
2493
2496
|
|
2494
|
-
|
2495
|
-
|
2496
|
-
|
2497
|
-
|
2498
|
-
|
2499
|
-
|
2500
|
-
|
2501
|
-
|
2502
|
-
};
|
2497
|
+
var escape = {
|
2498
|
+
"&": "&",
|
2499
|
+
"<": "<",
|
2500
|
+
">": ">",
|
2501
|
+
'"': """,
|
2502
|
+
"'": "'",
|
2503
|
+
"`": "`"
|
2504
|
+
};
|
2503
2505
|
|
2504
|
-
|
2505
|
-
|
2506
|
+
var badChars = /[&<>"'`]/g;
|
2507
|
+
var possible = /[&<>"'`]/;
|
2506
2508
|
|
2507
|
-
|
2508
|
-
|
2509
|
-
|
2509
|
+
var escapeChar = function(chr) {
|
2510
|
+
return escape[chr] || "&";
|
2511
|
+
};
|
2510
2512
|
|
2511
|
-
|
2512
|
-
|
2513
|
-
|
2514
|
-
if
|
2515
|
-
|
2516
|
-
} else if (string == null || string === false) {
|
2517
|
-
return "";
|
2513
|
+
Handlebars.Utils = {
|
2514
|
+
extend: function(obj, value) {
|
2515
|
+
for(var key in value) {
|
2516
|
+
if(value.hasOwnProperty(key)) {
|
2517
|
+
obj[key] = value[key];
|
2518
2518
|
}
|
2519
|
+
}
|
2520
|
+
},
|
2519
2521
|
|
2520
|
-
|
2521
|
-
|
2522
|
-
|
2522
|
+
escapeExpression: function(string) {
|
2523
|
+
// don't escape SafeStrings, since they're already safe
|
2524
|
+
if (string instanceof Handlebars.SafeString) {
|
2525
|
+
return string.toString();
|
2526
|
+
} else if (string == null || string === false) {
|
2527
|
+
return "";
|
2528
|
+
}
|
2523
2529
|
|
2524
|
-
|
2525
|
-
|
2526
|
-
|
2527
|
-
|
2528
|
-
|
2529
|
-
|
2530
|
-
|
2531
|
-
|
2530
|
+
// Force a string conversion as this will be done by the append regardless and
|
2531
|
+
// the regex test will do this transparently behind the scenes, causing issues if
|
2532
|
+
// an object's to string has escaped characters in it.
|
2533
|
+
string = string.toString();
|
2534
|
+
|
2535
|
+
if(!possible.test(string)) { return string; }
|
2536
|
+
return string.replace(badChars, escapeChar);
|
2537
|
+
},
|
2538
|
+
|
2539
|
+
isEmpty: function(value) {
|
2540
|
+
if (!value && value !== 0) {
|
2541
|
+
return true;
|
2542
|
+
} else if(toString.call(value) === "[object Array]" && value.length === 0) {
|
2543
|
+
return true;
|
2544
|
+
} else {
|
2545
|
+
return false;
|
2532
2546
|
}
|
2533
|
-
}
|
2534
|
-
}
|
2547
|
+
}
|
2548
|
+
};
|
2549
|
+
;
|
2535
2550
|
// lib/handlebars/runtime.js
|
2551
|
+
|
2536
2552
|
Handlebars.VM = {
|
2537
2553
|
template: function(templateSpec) {
|
2538
2554
|
// Just add water
|
@@ -2543,13 +2559,11 @@ Handlebars.VM = {
|
|
2543
2559
|
program: function(i, fn, data) {
|
2544
2560
|
var programWrapper = this.programs[i];
|
2545
2561
|
if(data) {
|
2546
|
-
|
2547
|
-
} else if(programWrapper) {
|
2548
|
-
|
2549
|
-
} else {
|
2550
|
-
programWrapper = this.programs[i] = Handlebars.VM.program(fn);
|
2551
|
-
return programWrapper;
|
2562
|
+
programWrapper = Handlebars.VM.program(i, fn, data);
|
2563
|
+
} else if (!programWrapper) {
|
2564
|
+
programWrapper = this.programs[i] = Handlebars.VM.program(i, fn);
|
2552
2565
|
}
|
2566
|
+
return programWrapper;
|
2553
2567
|
},
|
2554
2568
|
programWithDepth: Handlebars.VM.programWithDepth,
|
2555
2569
|
noop: Handlebars.VM.noop,
|
@@ -2581,21 +2595,27 @@ Handlebars.VM = {
|
|
2581
2595
|
};
|
2582
2596
|
},
|
2583
2597
|
|
2584
|
-
programWithDepth: function(fn, data
|
2585
|
-
var args = Array.prototype.slice.call(arguments,
|
2598
|
+
programWithDepth: function(i, fn, data /*, $depth */) {
|
2599
|
+
var args = Array.prototype.slice.call(arguments, 3);
|
2586
2600
|
|
2587
|
-
|
2601
|
+
var program = function(context, options) {
|
2588
2602
|
options = options || {};
|
2589
2603
|
|
2590
2604
|
return fn.apply(this, [context, options.data || data].concat(args));
|
2591
2605
|
};
|
2606
|
+
program.program = i;
|
2607
|
+
program.depth = args.length;
|
2608
|
+
return program;
|
2592
2609
|
},
|
2593
|
-
program: function(fn, data) {
|
2594
|
-
|
2610
|
+
program: function(i, fn, data) {
|
2611
|
+
var program = function(context, options) {
|
2595
2612
|
options = options || {};
|
2596
2613
|
|
2597
2614
|
return fn(context, options.data || data);
|
2598
2615
|
};
|
2616
|
+
program.program = i;
|
2617
|
+
program.depth = 0;
|
2618
|
+
return program;
|
2599
2619
|
},
|
2600
2620
|
noop: function() { return ""; },
|
2601
2621
|
invokePartial: function(partial, name, context, helpers, partials, data) {
|
@@ -2616,6 +2636,9 @@ Handlebars.VM = {
|
|
2616
2636
|
|
2617
2637
|
Handlebars.template = Handlebars.VM.template;
|
2618
2638
|
;
|
2639
|
+
// lib/handlebars/browser-suffix.js
|
2640
|
+
})(Handlebars);
|
2641
|
+
;
|
2619
2642
|
/*!
|
2620
2643
|
* jQuery Cookie Plugin v1.3.1
|
2621
2644
|
* https://github.com/carhartl/jquery-cookie
|
@@ -5380,9 +5403,9 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5380
5403
|
}
|
5381
5404
|
|
5382
5405
|
;
|
5383
|
-
// Underscore.js 1.
|
5406
|
+
// Underscore.js 1.5.2
|
5384
5407
|
// http://underscorejs.org
|
5385
|
-
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud
|
5408
|
+
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
5386
5409
|
// Underscore may be freely distributed under the MIT license.
|
5387
5410
|
|
5388
5411
|
(function() {
|
@@ -5390,7 +5413,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5390
5413
|
// Baseline setup
|
5391
5414
|
// --------------
|
5392
5415
|
|
5393
|
-
// Establish the root object, `window` in the browser, or `
|
5416
|
+
// Establish the root object, `window` in the browser, or `exports` on the server.
|
5394
5417
|
var root = this;
|
5395
5418
|
|
5396
5419
|
// Save the previous value of the `_` variable.
|
@@ -5403,11 +5426,12 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5403
5426
|
var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
|
5404
5427
|
|
5405
5428
|
// Create quick reference variables for speed access to core prototypes.
|
5406
|
-
var
|
5407
|
-
|
5408
|
-
|
5409
|
-
|
5410
|
-
|
5429
|
+
var
|
5430
|
+
push = ArrayProto.push,
|
5431
|
+
slice = ArrayProto.slice,
|
5432
|
+
concat = ArrayProto.concat,
|
5433
|
+
toString = ObjProto.toString,
|
5434
|
+
hasOwnProperty = ObjProto.hasOwnProperty;
|
5411
5435
|
|
5412
5436
|
// All **ECMAScript 5** native function implementations that we hope to use
|
5413
5437
|
// are declared here.
|
@@ -5446,7 +5470,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5446
5470
|
}
|
5447
5471
|
|
5448
5472
|
// Current version.
|
5449
|
-
_.VERSION = '1.
|
5473
|
+
_.VERSION = '1.5.2';
|
5450
5474
|
|
5451
5475
|
// Collection Functions
|
5452
5476
|
// --------------------
|
@@ -5459,14 +5483,13 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5459
5483
|
if (nativeForEach && obj.forEach === nativeForEach) {
|
5460
5484
|
obj.forEach(iterator, context);
|
5461
5485
|
} else if (obj.length === +obj.length) {
|
5462
|
-
for (var i = 0,
|
5486
|
+
for (var i = 0, length = obj.length; i < length; i++) {
|
5463
5487
|
if (iterator.call(context, obj[i], i, obj) === breaker) return;
|
5464
5488
|
}
|
5465
5489
|
} else {
|
5466
|
-
|
5467
|
-
|
5468
|
-
|
5469
|
-
}
|
5490
|
+
var keys = _.keys(obj);
|
5491
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
5492
|
+
if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return;
|
5470
5493
|
}
|
5471
5494
|
}
|
5472
5495
|
};
|
@@ -5478,7 +5501,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5478
5501
|
if (obj == null) return results;
|
5479
5502
|
if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
|
5480
5503
|
each(obj, function(value, index, list) {
|
5481
|
-
results
|
5504
|
+
results.push(iterator.call(context, value, index, list));
|
5482
5505
|
});
|
5483
5506
|
return results;
|
5484
5507
|
};
|
@@ -5553,7 +5576,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5553
5576
|
if (obj == null) return results;
|
5554
5577
|
if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
|
5555
5578
|
each(obj, function(value, index, list) {
|
5556
|
-
if (iterator.call(context, value, index, list)) results
|
5579
|
+
if (iterator.call(context, value, index, list)) results.push(value);
|
5557
5580
|
});
|
5558
5581
|
return results;
|
5559
5582
|
};
|
@@ -5637,7 +5660,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5637
5660
|
|
5638
5661
|
// Return the maximum element or (element-based computation).
|
5639
5662
|
// Can't optimize arrays of integers longer than 65,535 elements.
|
5640
|
-
// See
|
5663
|
+
// See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797)
|
5641
5664
|
_.max = function(obj, iterator, context) {
|
5642
5665
|
if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
|
5643
5666
|
return Math.max.apply(Math, obj);
|
@@ -5646,7 +5669,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5646
5669
|
var result = {computed : -Infinity, value: -Infinity};
|
5647
5670
|
each(obj, function(value, index, list) {
|
5648
5671
|
var computed = iterator ? iterator.call(context, value, index, list) : value;
|
5649
|
-
computed
|
5672
|
+
computed > result.computed && (result = {value : value, computed : computed});
|
5650
5673
|
});
|
5651
5674
|
return result.value;
|
5652
5675
|
};
|
@@ -5665,7 +5688,8 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5665
5688
|
return result.value;
|
5666
5689
|
};
|
5667
5690
|
|
5668
|
-
// Shuffle an array
|
5691
|
+
// Shuffle an array, using the modern version of the
|
5692
|
+
// [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
|
5669
5693
|
_.shuffle = function(obj) {
|
5670
5694
|
var rand;
|
5671
5695
|
var index = 0;
|
@@ -5678,6 +5702,16 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5678
5702
|
return shuffled;
|
5679
5703
|
};
|
5680
5704
|
|
5705
|
+
// Sample **n** random values from an array.
|
5706
|
+
// If **n** is not specified, returns a single random element from the array.
|
5707
|
+
// The internal `guard` argument allows it to work with `map`.
|
5708
|
+
_.sample = function(obj, n, guard) {
|
5709
|
+
if (arguments.length < 2 || guard) {
|
5710
|
+
return obj[_.random(obj.length - 1)];
|
5711
|
+
}
|
5712
|
+
return _.shuffle(obj).slice(0, Math.max(0, n));
|
5713
|
+
};
|
5714
|
+
|
5681
5715
|
// An internal function to generate lookup iterators.
|
5682
5716
|
var lookupIterator = function(value) {
|
5683
5717
|
return _.isFunction(value) ? value : function(obj){ return obj[value]; };
|
@@ -5688,9 +5722,9 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5688
5722
|
var iterator = lookupIterator(value);
|
5689
5723
|
return _.pluck(_.map(obj, function(value, index, list) {
|
5690
5724
|
return {
|
5691
|
-
value
|
5692
|
-
index
|
5693
|
-
criteria
|
5725
|
+
value: value,
|
5726
|
+
index: index,
|
5727
|
+
criteria: iterator.call(context, value, index, list)
|
5694
5728
|
};
|
5695
5729
|
}).sort(function(left, right) {
|
5696
5730
|
var a = left.criteria;
|
@@ -5699,38 +5733,41 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5699
5733
|
if (a > b || a === void 0) return 1;
|
5700
5734
|
if (a < b || b === void 0) return -1;
|
5701
5735
|
}
|
5702
|
-
return left.index
|
5736
|
+
return left.index - right.index;
|
5703
5737
|
}), 'value');
|
5704
5738
|
};
|
5705
5739
|
|
5706
5740
|
// An internal function used for aggregate "group by" operations.
|
5707
|
-
var group = function(
|
5708
|
-
|
5709
|
-
|
5710
|
-
|
5711
|
-
|
5712
|
-
|
5713
|
-
|
5714
|
-
|
5741
|
+
var group = function(behavior) {
|
5742
|
+
return function(obj, value, context) {
|
5743
|
+
var result = {};
|
5744
|
+
var iterator = value == null ? _.identity : lookupIterator(value);
|
5745
|
+
each(obj, function(value, index) {
|
5746
|
+
var key = iterator.call(context, value, index, obj);
|
5747
|
+
behavior(result, key, value);
|
5748
|
+
});
|
5749
|
+
return result;
|
5750
|
+
};
|
5715
5751
|
};
|
5716
5752
|
|
5717
5753
|
// Groups the object's values by a criterion. Pass either a string attribute
|
5718
5754
|
// to group by, or a function that returns the criterion.
|
5719
|
-
_.groupBy = function(
|
5720
|
-
|
5721
|
-
|
5722
|
-
|
5723
|
-
|
5755
|
+
_.groupBy = group(function(result, key, value) {
|
5756
|
+
(_.has(result, key) ? result[key] : (result[key] = [])).push(value);
|
5757
|
+
});
|
5758
|
+
|
5759
|
+
// Indexes the object's values by a criterion, similar to `groupBy`, but for
|
5760
|
+
// when you know that your index values will be unique.
|
5761
|
+
_.indexBy = group(function(result, key, value) {
|
5762
|
+
result[key] = value;
|
5763
|
+
});
|
5724
5764
|
|
5725
5765
|
// Counts instances of an object that group by a certain criterion. Pass
|
5726
5766
|
// either a string attribute to count by, or a function that returns the
|
5727
5767
|
// criterion.
|
5728
|
-
_.countBy = function(
|
5729
|
-
|
5730
|
-
|
5731
|
-
result[key]++;
|
5732
|
-
});
|
5733
|
-
};
|
5768
|
+
_.countBy = group(function(result, key) {
|
5769
|
+
_.has(result, key) ? result[key]++ : result[key] = 1;
|
5770
|
+
});
|
5734
5771
|
|
5735
5772
|
// Use a comparator function to figure out the smallest index at which
|
5736
5773
|
// an object should be inserted so as to maintain order. Uses binary search.
|
@@ -5745,7 +5782,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5745
5782
|
return low;
|
5746
5783
|
};
|
5747
5784
|
|
5748
|
-
// Safely
|
5785
|
+
// Safely create a real, live array from anything iterable.
|
5749
5786
|
_.toArray = function(obj) {
|
5750
5787
|
if (!obj) return [];
|
5751
5788
|
if (_.isArray(obj)) return slice.call(obj);
|
@@ -5767,7 +5804,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5767
5804
|
// allows it to work with `_.map`.
|
5768
5805
|
_.first = _.head = _.take = function(array, n, guard) {
|
5769
5806
|
if (array == null) return void 0;
|
5770
|
-
return (n
|
5807
|
+
return (n == null) || guard ? array[0] : slice.call(array, 0, n);
|
5771
5808
|
};
|
5772
5809
|
|
5773
5810
|
// Returns everything but the last entry of the array. Especially useful on
|
@@ -5782,10 +5819,10 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5782
5819
|
// values in the array. The **guard** check allows it to work with `_.map`.
|
5783
5820
|
_.last = function(array, n, guard) {
|
5784
5821
|
if (array == null) return void 0;
|
5785
|
-
if ((n
|
5786
|
-
return slice.call(array, Math.max(array.length - n, 0));
|
5787
|
-
} else {
|
5822
|
+
if ((n == null) || guard) {
|
5788
5823
|
return array[array.length - 1];
|
5824
|
+
} else {
|
5825
|
+
return slice.call(array, Math.max(array.length - n, 0));
|
5789
5826
|
}
|
5790
5827
|
};
|
5791
5828
|
|
@@ -5804,8 +5841,11 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5804
5841
|
|
5805
5842
|
// Internal implementation of a recursive `flatten` function.
|
5806
5843
|
var flatten = function(input, shallow, output) {
|
5844
|
+
if (shallow && _.every(input, _.isArray)) {
|
5845
|
+
return concat.apply(output, input);
|
5846
|
+
}
|
5807
5847
|
each(input, function(value) {
|
5808
|
-
if (_.isArray(value)) {
|
5848
|
+
if (_.isArray(value) || _.isArguments(value)) {
|
5809
5849
|
shallow ? push.apply(output, value) : flatten(value, shallow, output);
|
5810
5850
|
} else {
|
5811
5851
|
output.push(value);
|
@@ -5814,7 +5854,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5814
5854
|
return output;
|
5815
5855
|
};
|
5816
5856
|
|
5817
|
-
//
|
5857
|
+
// Flatten out an array, either recursively (by default), or just one level.
|
5818
5858
|
_.flatten = function(array, shallow) {
|
5819
5859
|
return flatten(array, shallow, []);
|
5820
5860
|
};
|
@@ -5848,7 +5888,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5848
5888
|
// Produce an array that contains the union: each distinct element from all of
|
5849
5889
|
// the passed-in arrays.
|
5850
5890
|
_.union = function() {
|
5851
|
-
return _.uniq(
|
5891
|
+
return _.uniq(_.flatten(arguments, true));
|
5852
5892
|
};
|
5853
5893
|
|
5854
5894
|
// Produce an array that contains every item shared between all the
|
@@ -5872,11 +5912,10 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5872
5912
|
// Zip together multiple lists into a single array -- elements that share
|
5873
5913
|
// an index go together.
|
5874
5914
|
_.zip = function() {
|
5875
|
-
var
|
5876
|
-
var length = _.max(_.pluck(args, 'length'));
|
5915
|
+
var length = _.max(_.pluck(arguments, "length").concat(0));
|
5877
5916
|
var results = new Array(length);
|
5878
5917
|
for (var i = 0; i < length; i++) {
|
5879
|
-
results[i] = _.pluck(
|
5918
|
+
results[i] = _.pluck(arguments, '' + i);
|
5880
5919
|
}
|
5881
5920
|
return results;
|
5882
5921
|
};
|
@@ -5887,7 +5926,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5887
5926
|
_.object = function(list, values) {
|
5888
5927
|
if (list == null) return {};
|
5889
5928
|
var result = {};
|
5890
|
-
for (var i = 0,
|
5929
|
+
for (var i = 0, length = list.length; i < length; i++) {
|
5891
5930
|
if (values) {
|
5892
5931
|
result[list[i]] = values[i];
|
5893
5932
|
} else {
|
@@ -5905,17 +5944,17 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5905
5944
|
// for **isSorted** to use binary search.
|
5906
5945
|
_.indexOf = function(array, item, isSorted) {
|
5907
5946
|
if (array == null) return -1;
|
5908
|
-
var i = 0,
|
5947
|
+
var i = 0, length = array.length;
|
5909
5948
|
if (isSorted) {
|
5910
5949
|
if (typeof isSorted == 'number') {
|
5911
|
-
i = (isSorted < 0 ? Math.max(0,
|
5950
|
+
i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted);
|
5912
5951
|
} else {
|
5913
5952
|
i = _.sortedIndex(array, item);
|
5914
5953
|
return array[i] === item ? i : -1;
|
5915
5954
|
}
|
5916
5955
|
}
|
5917
5956
|
if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
|
5918
|
-
for (; i <
|
5957
|
+
for (; i < length; i++) if (array[i] === item) return i;
|
5919
5958
|
return -1;
|
5920
5959
|
};
|
5921
5960
|
|
@@ -5941,11 +5980,11 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5941
5980
|
}
|
5942
5981
|
step = arguments[2] || 1;
|
5943
5982
|
|
5944
|
-
var
|
5983
|
+
var length = Math.max(Math.ceil((stop - start) / step), 0);
|
5945
5984
|
var idx = 0;
|
5946
|
-
var range = new Array(
|
5985
|
+
var range = new Array(length);
|
5947
5986
|
|
5948
|
-
while(idx <
|
5987
|
+
while(idx < length) {
|
5949
5988
|
range[idx++] = start;
|
5950
5989
|
start += step;
|
5951
5990
|
}
|
@@ -5964,7 +6003,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
5964
6003
|
// available.
|
5965
6004
|
_.bind = function(func, context) {
|
5966
6005
|
var args, bound;
|
5967
|
-
if (func.bind === nativeBind
|
6006
|
+
if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
|
5968
6007
|
if (!_.isFunction(func)) throw new TypeError;
|
5969
6008
|
args = slice.call(arguments, 2);
|
5970
6009
|
return bound = function() {
|
@@ -6020,17 +6059,23 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
6020
6059
|
};
|
6021
6060
|
|
6022
6061
|
// Returns a function, that, when invoked, will only be triggered at most once
|
6023
|
-
// during a given window of time.
|
6024
|
-
|
6025
|
-
|
6062
|
+
// during a given window of time. Normally, the throttled function will run
|
6063
|
+
// as much as it can, without ever going more than once per `wait` duration;
|
6064
|
+
// but if you'd like to disable the execution on the leading edge, pass
|
6065
|
+
// `{leading: false}`. To disable execution on the trailing edge, ditto.
|
6066
|
+
_.throttle = function(func, wait, options) {
|
6067
|
+
var context, args, result;
|
6068
|
+
var timeout = null;
|
6026
6069
|
var previous = 0;
|
6070
|
+
options || (options = {});
|
6027
6071
|
var later = function() {
|
6028
|
-
previous = new Date;
|
6072
|
+
previous = options.leading === false ? 0 : new Date;
|
6029
6073
|
timeout = null;
|
6030
6074
|
result = func.apply(context, args);
|
6031
6075
|
};
|
6032
6076
|
return function() {
|
6033
6077
|
var now = new Date;
|
6078
|
+
if (!previous && options.leading === false) previous = now;
|
6034
6079
|
var remaining = wait - (now - previous);
|
6035
6080
|
context = this;
|
6036
6081
|
args = arguments;
|
@@ -6039,7 +6084,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
6039
6084
|
timeout = null;
|
6040
6085
|
previous = now;
|
6041
6086
|
result = func.apply(context, args);
|
6042
|
-
} else if (!timeout) {
|
6087
|
+
} else if (!timeout && options.trailing !== false) {
|
6043
6088
|
timeout = setTimeout(later, remaining);
|
6044
6089
|
}
|
6045
6090
|
return result;
|
@@ -6051,16 +6096,24 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
6051
6096
|
// N milliseconds. If `immediate` is passed, trigger the function on the
|
6052
6097
|
// leading edge, instead of the trailing.
|
6053
6098
|
_.debounce = function(func, wait, immediate) {
|
6054
|
-
var timeout, result;
|
6099
|
+
var timeout, args, context, timestamp, result;
|
6055
6100
|
return function() {
|
6056
|
-
|
6101
|
+
context = this;
|
6102
|
+
args = arguments;
|
6103
|
+
timestamp = new Date();
|
6057
6104
|
var later = function() {
|
6058
|
-
|
6059
|
-
if (
|
6105
|
+
var last = (new Date()) - timestamp;
|
6106
|
+
if (last < wait) {
|
6107
|
+
timeout = setTimeout(later, wait - last);
|
6108
|
+
} else {
|
6109
|
+
timeout = null;
|
6110
|
+
if (!immediate) result = func.apply(context, args);
|
6111
|
+
}
|
6060
6112
|
};
|
6061
6113
|
var callNow = immediate && !timeout;
|
6062
|
-
|
6063
|
-
|
6114
|
+
if (!timeout) {
|
6115
|
+
timeout = setTimeout(later, wait);
|
6116
|
+
}
|
6064
6117
|
if (callNow) result = func.apply(context, args);
|
6065
6118
|
return result;
|
6066
6119
|
};
|
@@ -6105,7 +6158,6 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
6105
6158
|
|
6106
6159
|
// Returns a function that will only be executed after being called N times.
|
6107
6160
|
_.after = function(times, func) {
|
6108
|
-
if (times <= 0) return func();
|
6109
6161
|
return function() {
|
6110
6162
|
if (--times < 1) {
|
6111
6163
|
return func.apply(this, arguments);
|
@@ -6121,28 +6173,39 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
6121
6173
|
_.keys = nativeKeys || function(obj) {
|
6122
6174
|
if (obj !== Object(obj)) throw new TypeError('Invalid object');
|
6123
6175
|
var keys = [];
|
6124
|
-
for (var key in obj) if (_.has(obj, key)) keys
|
6176
|
+
for (var key in obj) if (_.has(obj, key)) keys.push(key);
|
6125
6177
|
return keys;
|
6126
6178
|
};
|
6127
6179
|
|
6128
6180
|
// Retrieve the values of an object's properties.
|
6129
6181
|
_.values = function(obj) {
|
6130
|
-
var
|
6131
|
-
|
6182
|
+
var keys = _.keys(obj);
|
6183
|
+
var length = keys.length;
|
6184
|
+
var values = new Array(length);
|
6185
|
+
for (var i = 0; i < length; i++) {
|
6186
|
+
values[i] = obj[keys[i]];
|
6187
|
+
}
|
6132
6188
|
return values;
|
6133
6189
|
};
|
6134
6190
|
|
6135
6191
|
// Convert an object into a list of `[key, value]` pairs.
|
6136
6192
|
_.pairs = function(obj) {
|
6137
|
-
var
|
6138
|
-
|
6193
|
+
var keys = _.keys(obj);
|
6194
|
+
var length = keys.length;
|
6195
|
+
var pairs = new Array(length);
|
6196
|
+
for (var i = 0; i < length; i++) {
|
6197
|
+
pairs[i] = [keys[i], obj[keys[i]]];
|
6198
|
+
}
|
6139
6199
|
return pairs;
|
6140
6200
|
};
|
6141
6201
|
|
6142
6202
|
// Invert the keys and values of an object. The values must be serializable.
|
6143
6203
|
_.invert = function(obj) {
|
6144
6204
|
var result = {};
|
6145
|
-
|
6205
|
+
var keys = _.keys(obj);
|
6206
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
6207
|
+
result[obj[keys[i]]] = keys[i];
|
6208
|
+
}
|
6146
6209
|
return result;
|
6147
6210
|
};
|
6148
6211
|
|
@@ -6217,7 +6280,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
6217
6280
|
// Internal recursive comparison function for `isEqual`.
|
6218
6281
|
var eq = function(a, b, aStack, bStack) {
|
6219
6282
|
// Identical objects are equal. `0 === -0`, but they aren't identical.
|
6220
|
-
// See the Harmony `egal` proposal
|
6283
|
+
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
|
6221
6284
|
if (a === b) return a !== 0 || 1 / a == 1 / b;
|
6222
6285
|
// A strict comparison is necessary because `null == undefined`.
|
6223
6286
|
if (a == null || b == null) return a === b;
|
@@ -6259,6 +6322,13 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
6259
6322
|
// unique nested structures.
|
6260
6323
|
if (aStack[length] == a) return bStack[length] == b;
|
6261
6324
|
}
|
6325
|
+
// Objects with different constructors are not equivalent, but `Object`s
|
6326
|
+
// from different frames are.
|
6327
|
+
var aCtor = a.constructor, bCtor = b.constructor;
|
6328
|
+
if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
|
6329
|
+
_.isFunction(bCtor) && (bCtor instanceof bCtor))) {
|
6330
|
+
return false;
|
6331
|
+
}
|
6262
6332
|
// Add the first object to the stack of traversed objects.
|
6263
6333
|
aStack.push(a);
|
6264
6334
|
bStack.push(b);
|
@@ -6275,13 +6345,6 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
6275
6345
|
}
|
6276
6346
|
}
|
6277
6347
|
} else {
|
6278
|
-
// Objects with different constructors are not equivalent, but `Object`s
|
6279
|
-
// from different frames are.
|
6280
|
-
var aCtor = a.constructor, bCtor = b.constructor;
|
6281
|
-
if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
|
6282
|
-
_.isFunction(bCtor) && (bCtor instanceof bCtor))) {
|
6283
|
-
return false;
|
6284
|
-
}
|
6285
6348
|
// Deep compare objects.
|
6286
6349
|
for (var key in a) {
|
6287
6350
|
if (_.has(a, key)) {
|
@@ -6405,7 +6468,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
6405
6468
|
|
6406
6469
|
// Run a function **n** times.
|
6407
6470
|
_.times = function(n, iterator, context) {
|
6408
|
-
var accum = Array(n);
|
6471
|
+
var accum = Array(Math.max(0, n));
|
6409
6472
|
for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
|
6410
6473
|
return accum;
|
6411
6474
|
};
|
@@ -6426,8 +6489,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
6426
6489
|
'<': '<',
|
6427
6490
|
'>': '>',
|
6428
6491
|
'"': '"',
|
6429
|
-
"'": '''
|
6430
|
-
'/': '/'
|
6492
|
+
"'": '''
|
6431
6493
|
}
|
6432
6494
|
};
|
6433
6495
|
entityMap.unescape = _.invert(entityMap.escape);
|
@@ -6448,8 +6510,8 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
6448
6510
|
};
|
6449
6511
|
});
|
6450
6512
|
|
6451
|
-
// If the value of the named property is a function then invoke it
|
6452
|
-
// otherwise, return it.
|
6513
|
+
// If the value of the named `property` is a function then invoke it with the
|
6514
|
+
// `object` as context; otherwise, return it.
|
6453
6515
|
_.result = function(object, property) {
|
6454
6516
|
if (object == null) return void 0;
|
6455
6517
|
var value = object[property];
|
@@ -6458,7 +6520,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
6458
6520
|
|
6459
6521
|
// Add your own custom functions to the Underscore object.
|
6460
6522
|
_.mixin = function(obj) {
|
6461
|
-
each(_.functions(obj), function(name){
|
6523
|
+
each(_.functions(obj), function(name) {
|
6462
6524
|
var func = _[name] = obj[name];
|
6463
6525
|
_.prototype[name] = function() {
|
6464
6526
|
var args = [this._wrapped];
|
@@ -6620,7 +6682,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
6620
6682
|
(function() {
|
6621
6683
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
6622
6684
|
this.InfoparkHandlebarsTemplates["choose_obj_class_dialog"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
6623
|
-
this.compilerInfo = [
|
6685
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
6624
6686
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
6625
6687
|
var buffer = "", stack1, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing;
|
6626
6688
|
|
@@ -6646,7 +6708,7 @@ helpers = helpers || Handlebars.helpers; data = data || {};
|
|
6646
6708
|
(function() {
|
6647
6709
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
6648
6710
|
this.InfoparkHandlebarsTemplates["choose_obj_class_list"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
6649
|
-
this.compilerInfo = [
|
6711
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
6650
6712
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
6651
6713
|
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
|
6652
6714
|
|
@@ -6684,7 +6746,7 @@ function program2(depth0,data) {
|
|
6684
6746
|
(function() {
|
6685
6747
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
6686
6748
|
this.InfoparkHandlebarsTemplates["confirmation_dialog"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
6687
|
-
this.compilerInfo = [
|
6749
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
6688
6750
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
6689
6751
|
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
|
6690
6752
|
|
@@ -6734,7 +6796,7 @@ function program1(depth0,data) {
|
|
6734
6796
|
(function() {
|
6735
6797
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
6736
6798
|
this.InfoparkHandlebarsTemplates["edit_dialog"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
6737
|
-
this.compilerInfo = [
|
6799
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
6738
6800
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
6739
6801
|
var buffer = "", stack1, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
6740
6802
|
|
@@ -6757,7 +6819,7 @@ helpers = helpers || Handlebars.helpers; data = data || {};
|
|
6757
6819
|
(function() {
|
6758
6820
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
6759
6821
|
this.InfoparkHandlebarsTemplates["editable_workspace_dialog"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
6760
|
-
this.compilerInfo = [
|
6822
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
6761
6823
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
6762
6824
|
var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
6763
6825
|
|
@@ -6797,7 +6859,7 @@ helpers = helpers || Handlebars.helpers; data = data || {};
|
|
6797
6859
|
(function() {
|
6798
6860
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
6799
6861
|
this.InfoparkHandlebarsTemplates["element_overlay"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
6800
|
-
this.compilerInfo = [
|
6862
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
6801
6863
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
6802
6864
|
|
6803
6865
|
|
@@ -6809,7 +6871,7 @@ helpers = helpers || Handlebars.helpers; data = data || {};
|
|
6809
6871
|
(function() {
|
6810
6872
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
6811
6873
|
this.InfoparkHandlebarsTemplates["inplace_menu"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
6812
|
-
this.compilerInfo = [
|
6874
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
6813
6875
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
6814
6876
|
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
|
6815
6877
|
|
@@ -6843,7 +6905,7 @@ function program1(depth0,data) {
|
|
6843
6905
|
(function() {
|
6844
6906
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
6845
6907
|
this.InfoparkHandlebarsTemplates["inplace_menu_icon"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
6846
|
-
this.compilerInfo = [
|
6908
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
6847
6909
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
6848
6910
|
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
|
6849
6911
|
|
@@ -6860,7 +6922,7 @@ helpers = helpers || Handlebars.helpers; data = data || {};
|
|
6860
6922
|
(function() {
|
6861
6923
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
6862
6924
|
this.InfoparkHandlebarsTemplates["menu_bar"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
6863
|
-
this.compilerInfo = [
|
6925
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
6864
6926
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
6865
6927
|
|
6866
6928
|
|
@@ -6872,7 +6934,7 @@ helpers = helpers || Handlebars.helpers; data = data || {};
|
|
6872
6934
|
(function() {
|
6873
6935
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
6874
6936
|
this.InfoparkHandlebarsTemplates["menu_bar_dropdown"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
6875
|
-
this.compilerInfo = [
|
6937
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
6876
6938
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
6877
6939
|
var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this, functionType="function";
|
6878
6940
|
|
@@ -6929,7 +6991,7 @@ function program2(depth0,data) {
|
|
6929
6991
|
(function() {
|
6930
6992
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
6931
6993
|
this.InfoparkHandlebarsTemplates["overlay"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
6932
|
-
this.compilerInfo = [
|
6994
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
6933
6995
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
6934
6996
|
|
6935
6997
|
|
@@ -6941,7 +7003,7 @@ helpers = helpers || Handlebars.helpers; data = data || {};
|
|
6941
7003
|
(function() {
|
6942
7004
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
6943
7005
|
this.InfoparkHandlebarsTemplates["prompt_dialog"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
6944
|
-
this.compilerInfo = [
|
7006
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
6945
7007
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
6946
7008
|
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
|
6947
7009
|
|
@@ -6991,7 +7053,7 @@ function program1(depth0,data) {
|
|
6991
7053
|
(function() {
|
6992
7054
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
6993
7055
|
this.InfoparkHandlebarsTemplates["saving_indicator"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
6994
|
-
this.compilerInfo = [
|
7056
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
6995
7057
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
6996
7058
|
var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
6997
7059
|
|
@@ -7010,7 +7072,7 @@ helpers = helpers || Handlebars.helpers; data = data || {};
|
|
7010
7072
|
(function() {
|
7011
7073
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
7012
7074
|
this.InfoparkHandlebarsTemplates["saving_overlay"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
7013
|
-
this.compilerInfo = [
|
7075
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
7014
7076
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
7015
7077
|
|
7016
7078
|
|
@@ -7022,7 +7084,7 @@ helpers = helpers || Handlebars.helpers; data = data || {};
|
|
7022
7084
|
(function() {
|
7023
7085
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
7024
7086
|
this.InfoparkHandlebarsTemplates["title"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
7025
|
-
this.compilerInfo = [
|
7087
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
7026
7088
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
7027
7089
|
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
|
7028
7090
|
|
@@ -7039,7 +7101,7 @@ helpers = helpers || Handlebars.helpers; data = data || {};
|
|
7039
7101
|
(function() {
|
7040
7102
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
7041
7103
|
this.InfoparkHandlebarsTemplates["workspace_form_select_list"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
7042
|
-
this.compilerInfo = [
|
7104
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
7043
7105
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
7044
7106
|
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this;
|
7045
7107
|
|
@@ -7084,7 +7146,7 @@ function program4(depth0,data) {
|
|
7084
7146
|
(function() {
|
7085
7147
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
7086
7148
|
this.InfoparkHandlebarsTemplates["workspace_select_list"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
7087
|
-
this.compilerInfo = [
|
7149
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
7088
7150
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
7089
7151
|
var buffer = "", stack1, self=this, functionType="function", escapeExpression=this.escapeExpression;
|
7090
7152
|
|
@@ -7100,7 +7162,7 @@ function program1(depth0,data) {
|
|
7100
7162
|
stack2 = helpers['if'].call(depth0, depth0.is_editable, {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
|
7101
7163
|
if(stack2 || stack2 === 0) { buffer += stack2; }
|
7102
7164
|
buffer += "\n </i>\n "
|
7103
|
-
+ escapeExpression(((stack1 = depth0.
|
7165
|
+
+ escapeExpression(((stack1 = depth0.select_title),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
|
7104
7166
|
+ "\n ";
|
7105
7167
|
stack2 = helpers['if'].call(depth0, depth0.is_current_workspace, {hash:{},inverse:self.noop,fn:self.program(8, program8, data),data:data});
|
7106
7168
|
if(stack2 || stack2 === 0) { buffer += stack2; }
|
@@ -7141,7 +7203,7 @@ function program8(depth0,data) {
|
|
7141
7203
|
(function() {
|
7142
7204
|
this.InfoparkHandlebarsTemplates || (this.InfoparkHandlebarsTemplates = {});
|
7143
7205
|
this.InfoparkHandlebarsTemplates["workspace_select_menu_bar_item"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
7144
|
-
this.compilerInfo = [
|
7206
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
7145
7207
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
7146
7208
|
var buffer = "", stack1, stack2, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, functionType="function", self=this;
|
7147
7209
|
|
@@ -7227,6 +7289,7 @@ $.i18n().load({
|
|
7227
7289
|
'menu_bar.empty_workspace_title': '<leerer Titel>',
|
7228
7290
|
'menu_bar.published_workspace_title': 'Veröffentlichte Inhalte',
|
7229
7291
|
'menu_bar.loading_workspaces': 'Lade Arbeitskopien',
|
7292
|
+
'menu_bar.select_working_copy': '"$1" auswählen',
|
7230
7293
|
'menu_bar.publish_working_copy': '"$1" veröffentlichen',
|
7231
7294
|
'menu_bar.publish_ws_confirmation': '"$1" veröffentlichen?',
|
7232
7295
|
'menu_bar.publish_ws_confirmation_desc': 'Eine Arbeitskopie zu veröffentlichen ist endgültig. Dieser Vorgang kann nicht rückgängig gemacht werden.',
|
@@ -7311,6 +7374,7 @@ $.i18n().load({
|
|
7311
7374
|
'menu_bar.empty_workspace_title': '<empty title>',
|
7312
7375
|
'menu_bar.published_workspace_title': 'Published content',
|
7313
7376
|
'menu_bar.loading_workspaces': 'Loading working copies',
|
7377
|
+
'menu_bar.select_working_copy': 'Select "$1"',
|
7314
7378
|
'menu_bar.publish_working_copy': 'Publish "$1"',
|
7315
7379
|
'menu_bar.publish_ws_confirmation': 'Publish "$1"?',
|
7316
7380
|
'menu_bar.publish_ws_confirmation_desc': 'Publishing a working copy is final. This action cannot be undone.',
|
@@ -7948,6 +8012,12 @@ var infopark = {
|
|
7948
8012
|
}
|
7949
8013
|
};
|
7950
8014
|
|
8015
|
+
var workspace_title_select = function(workspace) {
|
8016
|
+
var title = workspace_title_short(workspace);
|
8017
|
+
|
8018
|
+
return t('menu_bar.select_working_copy', title);
|
8019
|
+
};
|
8020
|
+
|
7951
8021
|
var renderer = function(view) {
|
7952
8022
|
var select_menu_view = $(infopark.template.render('workspace_select_menu_bar_item', {
|
7953
8023
|
current_workspace: infopark.editing.workspace(),
|
@@ -7978,7 +8048,7 @@ var infopark = {
|
|
7978
8048
|
return {
|
7979
8049
|
is_editable: ws.is_editable,
|
7980
8050
|
long_title: workspace_title_long(ws),
|
7981
|
-
|
8051
|
+
select_title: workspace_title_select(ws),
|
7982
8052
|
is_current_workspace: (ws.id() === infopark.editing.workspace().id())
|
7983
8053
|
};
|
7984
8054
|
});
|