redmine_extensions 0.4.4 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +51 -0
- data/app/assets/javascripts/redmine_extensions/redmine_extensions.js +1 -0
- data/app/helpers/redmine_extensions/application_helper.rb +27 -36
- data/app/views/common/_collapsible_module_layout.html.erb +20 -2
- data/app/views/easy_front_end/_easy_front_end.html.erb +1 -19
- data/db/migrate/20150705172511_create_easy_settings.rb +1 -1
- data/db/migrate/20160519161300_create_entity_assignments.rb +1 -1
- data/db/migrate/20190206121100_remove_foreign_key_from_easy_settings.rb +1 -1
- data/lib/generators/redmine_extensions/entity/templates/_sidebar.html.erb.erb +1 -1
- data/lib/generators/redmine_extensions/entity/templates/show.html.erb.erb +1 -1
- data/lib/redmine_extensions/engine.rb +9 -23
- data/lib/redmine_extensions/hooks.rb +1 -9
- data/lib/redmine_extensions/migration.rb +1 -1
- data/lib/redmine_extensions/patch_manager.rb +43 -43
- data/lib/redmine_extensions/version.rb +3 -1
- metadata +11 -35
- data/app/assets/javascripts/redmine_extensions/jasmine_lib/boot.js +0 -153
- data/app/assets/javascripts/redmine_extensions/jasmine_lib/jasmine_helper.js +0 -292
- data/app/assets/javascripts/redmine_extensions/jasmine_lib/jasmine_lib.js +0 -3
- data/app/assets/javascripts/redmine_extensions/jasmine_tests/extend.js +0 -32
- data/app/assets/javascripts/redmine_extensions/jasmine_tests/jasmine_tests.js +0 -1
- data/app/assets/javascripts/redmine_extensions/jasmine_tests/modules.js +0 -164
- data/app/assets/stylesheets/redmine_extensions/jasmine.css +0 -35
- data/app/views/redmine_extensions/_development_mode.html.erb +0 -33
- data/app/views/redmine_extensions/_jasmine.html.erb +0 -7
- data/lib/redmine_extensions/html_formatting/formatter.rb +0 -86
- data/lib/redmine_extensions/html_formatting/helper.rb +0 -73
- data/lib/redmine_extensions/html_formatting/internals.rb +0 -23
- data/lib/redmine_extensions/html_formatting.rb +0 -3
- data/spec/features/autocomplete_spec.rb +0 -17
- data/spec/features/jasmine_spec.rb +0 -9
- data/spec/support/plugin_generator.rb +0 -111
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Easy Software Ltd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,20 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '6.2'
|
19
|
+
version: '6.1'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '6.2'
|
26
|
+
version: '6.1'
|
33
27
|
description: Redmine Extensions provide many extended functionalities for Redmine
|
34
28
|
project.
|
35
29
|
email:
|
@@ -39,6 +33,7 @@ extensions: []
|
|
39
33
|
extra_rdoc_files: []
|
40
34
|
files:
|
41
35
|
- LICENSE
|
36
|
+
- README.md
|
42
37
|
- Rakefile
|
43
38
|
- app/assets/javascripts/redmine_extensions/application.js
|
44
39
|
- app/assets/javascripts/redmine_extensions/blocking.js
|
@@ -51,17 +46,10 @@ files:
|
|
51
46
|
- app/assets/javascripts/redmine_extensions/blocking_utils.js
|
52
47
|
- app/assets/javascripts/redmine_extensions/easy_togglers.js
|
53
48
|
- app/assets/javascripts/redmine_extensions/event_bus.js
|
54
|
-
- app/assets/javascripts/redmine_extensions/jasmine_lib/boot.js
|
55
|
-
- app/assets/javascripts/redmine_extensions/jasmine_lib/jasmine_helper.js
|
56
|
-
- app/assets/javascripts/redmine_extensions/jasmine_lib/jasmine_lib.js
|
57
|
-
- app/assets/javascripts/redmine_extensions/jasmine_tests/extend.js
|
58
|
-
- app/assets/javascripts/redmine_extensions/jasmine_tests/jasmine_tests.js
|
59
|
-
- app/assets/javascripts/redmine_extensions/jasmine_tests/modules.js
|
60
49
|
- app/assets/javascripts/redmine_extensions/jquery.entityarray.js
|
61
50
|
- app/assets/javascripts/redmine_extensions/redmine_extensions.js
|
62
51
|
- app/assets/javascripts/redmine_extensions/render_polyfill.js
|
63
52
|
- app/assets/stylesheets/redmine_extensions/application.css
|
64
|
-
- app/assets/stylesheets/redmine_extensions/jasmine.css
|
65
53
|
- app/controllers/easy_settings_controller.rb
|
66
54
|
- app/helpers/redmine_extensions/application_helper.rb
|
67
55
|
- app/helpers/redmine_extensions/rendering_helper.rb
|
@@ -85,8 +73,6 @@ files:
|
|
85
73
|
- app/views/easy_queries/_settings.html.erb
|
86
74
|
- app/views/easy_settings/edit.html.erb
|
87
75
|
- app/views/redmine_extensions/_custom_field_rows.html.erb
|
88
|
-
- app/views/redmine_extensions/_development_mode.html.erb
|
89
|
-
- app/views/redmine_extensions/_jasmine.html.erb
|
90
76
|
- config/locales/cs.yml
|
91
77
|
- config/locales/en.yml
|
92
78
|
- config/routes.rb
|
@@ -166,10 +152,6 @@ files:
|
|
166
152
|
- lib/redmine_extensions/engine.rb
|
167
153
|
- lib/redmine_extensions/export/easy_other_formats_builder.rb
|
168
154
|
- lib/redmine_extensions/hooks.rb
|
169
|
-
- lib/redmine_extensions/html_formatting.rb
|
170
|
-
- lib/redmine_extensions/html_formatting/formatter.rb
|
171
|
-
- lib/redmine_extensions/html_formatting/helper.rb
|
172
|
-
- lib/redmine_extensions/html_formatting/internals.rb
|
173
155
|
- lib/redmine_extensions/migration.rb
|
174
156
|
- lib/redmine_extensions/patch_manager.rb
|
175
157
|
- lib/redmine_extensions/query_output.rb
|
@@ -185,13 +167,10 @@ files:
|
|
185
167
|
- lib/redmine_extensions/version.rb
|
186
168
|
- lib/tasks/redmine_extensions_tasks.rake
|
187
169
|
- spec/factories/easy_settings.rb
|
188
|
-
- spec/features/autocomplete_spec.rb
|
189
|
-
- spec/features/jasmine_spec.rb
|
190
170
|
- spec/init_rails.rb
|
191
171
|
- spec/models/easy_setting_spec.rb
|
192
172
|
- spec/presenters/easy_settings/params_wrapper_spec.rb
|
193
173
|
- spec/spec_helper.rb
|
194
|
-
- spec/support/plugin_generator.rb
|
195
174
|
homepage: https://www.easyredmine.com
|
196
175
|
licenses:
|
197
176
|
- GPL-2.0
|
@@ -204,24 +183,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
204
183
|
requirements:
|
205
184
|
- - ">="
|
206
185
|
- !ruby/object:Gem::Version
|
207
|
-
version: '2.
|
186
|
+
version: '2.7'
|
208
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
209
188
|
requirements:
|
210
189
|
- - ">="
|
211
190
|
- !ruby/object:Gem::Version
|
212
191
|
version: '0'
|
213
192
|
requirements: []
|
214
|
-
rubygems_version: 3.3.
|
193
|
+
rubygems_version: 3.3.9
|
215
194
|
signing_key:
|
216
195
|
specification_version: 4
|
217
|
-
summary: Redmine Extensions is set of
|
218
|
-
|
196
|
+
summary: Redmine Extensions is set of useful features for Redmine. Main focus is on
|
197
|
+
development helpers, but many users can find it helpfull
|
219
198
|
test_files:
|
220
|
-
- spec/
|
221
|
-
- spec/features/autocomplete_spec.rb
|
222
|
-
- spec/features/jasmine_spec.rb
|
199
|
+
- spec/spec_helper.rb
|
223
200
|
- spec/init_rails.rb
|
224
201
|
- spec/models/easy_setting_spec.rb
|
225
202
|
- spec/presenters/easy_settings/params_wrapper_spec.rb
|
226
|
-
- spec/
|
227
|
-
- spec/support/plugin_generator.rb
|
203
|
+
- spec/factories/easy_settings.rb
|
@@ -1,153 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Copyright (c) 2008-2018 Pivotal Labs
|
3
|
-
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
5
|
-
a copy of this software and associated documentation files (the
|
6
|
-
"Software"), to deal in the Software without restriction, including
|
7
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
8
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
-
permit persons to whom the Software is furnished to do so, subject to
|
10
|
-
the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be
|
13
|
-
included in all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
-
*/
|
23
|
-
/**
|
24
|
-
Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
|
25
|
-
|
26
|
-
If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
|
27
|
-
|
28
|
-
The location of `boot.js` can be specified and/or overridden in `jasmine.yml`.
|
29
|
-
|
30
|
-
[jasmine-gem]: http://github.com/pivotal/jasmine-gem
|
31
|
-
*/
|
32
|
-
|
33
|
-
(function() {
|
34
|
-
|
35
|
-
/**
|
36
|
-
* ## Require & Instantiate
|
37
|
-
*
|
38
|
-
* Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
|
39
|
-
*/
|
40
|
-
window.jasmine = jasmineRequire.core(jasmineRequire);
|
41
|
-
|
42
|
-
/**
|
43
|
-
* Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
|
44
|
-
*/
|
45
|
-
jasmineRequire.html(jasmine);
|
46
|
-
|
47
|
-
/**
|
48
|
-
* Create the Jasmine environment. This is used to run all specs in a project.
|
49
|
-
*/
|
50
|
-
var env = jasmine.getEnv();
|
51
|
-
|
52
|
-
/**
|
53
|
-
* ## The Global Interface
|
54
|
-
*
|
55
|
-
* Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
|
56
|
-
*/
|
57
|
-
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
58
|
-
|
59
|
-
/**
|
60
|
-
* Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
|
61
|
-
*/
|
62
|
-
extend(window, jasmineInterface);
|
63
|
-
|
64
|
-
/**
|
65
|
-
* ## Runner Parameters
|
66
|
-
*
|
67
|
-
* More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
|
68
|
-
*/
|
69
|
-
|
70
|
-
var queryString = new jasmine.QueryString({
|
71
|
-
getWindowLocation: function() { return window.location; }
|
72
|
-
});
|
73
|
-
|
74
|
-
var filterSpecs = !!queryString.getParam("spec");
|
75
|
-
|
76
|
-
var stoppingOnSpecFailure = queryString.getParam("failFast");
|
77
|
-
env.stopOnSpecFailure(stoppingOnSpecFailure);
|
78
|
-
|
79
|
-
var throwingExpectationFailures = queryString.getParam("throwFailures");
|
80
|
-
env.throwOnExpectationFailure(throwingExpectationFailures);
|
81
|
-
|
82
|
-
var random = queryString.getParam("random");
|
83
|
-
env.randomizeTests(false);
|
84
|
-
if (random !== undefined && random !== "") {
|
85
|
-
env.randomizeTests(random);
|
86
|
-
}
|
87
|
-
|
88
|
-
var seed = queryString.getParam("seed");
|
89
|
-
if (seed) {
|
90
|
-
env.seed(seed);
|
91
|
-
}
|
92
|
-
|
93
|
-
/**
|
94
|
-
* ## Reporters
|
95
|
-
* The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
|
96
|
-
*/
|
97
|
-
var htmlReporter = new jasmine.HtmlReporter({
|
98
|
-
env: env,
|
99
|
-
navigateWithNewParam: function(key, value) { return queryString.navigateWithNewParam(key, value); },
|
100
|
-
addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); },
|
101
|
-
getContainer: function() { return document.body; },
|
102
|
-
createElement: function() { return document.createElement.apply(document, arguments); },
|
103
|
-
createTextNode: function() { return document.createTextNode.apply(document, arguments); },
|
104
|
-
timer: new jasmine.Timer(),
|
105
|
-
filterSpecs: filterSpecs
|
106
|
-
});
|
107
|
-
|
108
|
-
/**
|
109
|
-
* The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
|
110
|
-
*/
|
111
|
-
env.addReporter(jasmineInterface.jsApiReporter);
|
112
|
-
env.addReporter(htmlReporter);
|
113
|
-
|
114
|
-
/**
|
115
|
-
* Filter which specs will be run by matching the start of the full name against the `spec` query param.
|
116
|
-
*/
|
117
|
-
var specFilter = new jasmine.HtmlSpecFilter({
|
118
|
-
filterString: function() { return queryString.getParam("spec"); }
|
119
|
-
});
|
120
|
-
|
121
|
-
env.specFilter = function(spec) {
|
122
|
-
return specFilter.matches(spec.getFullName());
|
123
|
-
};
|
124
|
-
|
125
|
-
/**
|
126
|
-
* Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
|
127
|
-
*/
|
128
|
-
window.setTimeout = window.setTimeout;
|
129
|
-
window.setInterval = window.setInterval;
|
130
|
-
window.clearTimeout = window.clearTimeout;
|
131
|
-
window.clearInterval = window.clearInterval;
|
132
|
-
|
133
|
-
/**
|
134
|
-
* ## Execution
|
135
|
-
*
|
136
|
-
* Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
|
137
|
-
*/
|
138
|
-
var currentWindowOnload = window.onload;
|
139
|
-
|
140
|
-
jasmine.jasmineStart = function() {
|
141
|
-
htmlReporter.initialize();
|
142
|
-
env.execute();
|
143
|
-
};
|
144
|
-
|
145
|
-
/**
|
146
|
-
* Helper function for readability above.
|
147
|
-
*/
|
148
|
-
function extend(destination, source) {
|
149
|
-
for (var property in source) destination[property] = source[property];
|
150
|
-
return destination;
|
151
|
-
}
|
152
|
-
|
153
|
-
}());
|
@@ -1,292 +0,0 @@
|
|
1
|
-
(function () {
|
2
|
-
var getQueryString = function () {
|
3
|
-
var query_string = {};
|
4
|
-
var query = window.location.search.substring(1);
|
5
|
-
var vars = query.split("&");
|
6
|
-
for (var i = 0; i < vars.length; i++) {
|
7
|
-
var pair = vars[i].split("=");
|
8
|
-
// If first entry with this name
|
9
|
-
if (typeof query_string[pair[0]] === "undefined") {
|
10
|
-
query_string[pair[0]] = decodeURIComponent(pair[1]);
|
11
|
-
// If second entry with this name
|
12
|
-
} else if (typeof query_string[pair[0]] === "string") {
|
13
|
-
query_string[pair[0]] = [query_string[pair[0]], decodeURIComponent(pair[1])];
|
14
|
-
// If third or later entry with this name
|
15
|
-
} else {
|
16
|
-
query_string[pair[0]].push(decodeURIComponent(pair[1]));
|
17
|
-
}
|
18
|
-
}
|
19
|
-
return query_string;
|
20
|
-
};
|
21
|
-
var setQueryTestNames = function () {
|
22
|
-
var params = getQueryString();
|
23
|
-
var requestedTests = params["jasmine"] || params["jasmine[]"] || params["jasmine%5B%5D"];
|
24
|
-
if (requestedTests === "true") return;
|
25
|
-
var names = data.tags;
|
26
|
-
if (typeof requestedTests === "string") {
|
27
|
-
names[requestedTests] = true;
|
28
|
-
} else if (requestedTests instanceof Array) {
|
29
|
-
for (var i = 0; i < requestedTests.length; i++) {
|
30
|
-
var name = requestedTests[i];
|
31
|
-
names[name] = true;
|
32
|
-
}
|
33
|
-
} else {
|
34
|
-
throw "Wrong type of jasmine value - \"" + requestedTests + "\" is not true|string|Array.<String>";
|
35
|
-
}
|
36
|
-
};
|
37
|
-
|
38
|
-
function isDescendantOrSame(parent, child) {
|
39
|
-
while (child != null) {
|
40
|
-
if (child === parent) {
|
41
|
-
return true;
|
42
|
-
}
|
43
|
-
child = child.parentNode;
|
44
|
-
}
|
45
|
-
return false;
|
46
|
-
}
|
47
|
-
|
48
|
-
function notifyOfResult() {
|
49
|
-
EasyGem.schedule.require(function () {
|
50
|
-
var fail = window.jsApiReporter.specs().some(function (spec) {
|
51
|
-
return spec.failedExpectations.length;
|
52
|
-
});
|
53
|
-
var logo = document.getElementById("logo") || document.getElementsByTagName("h1")[0];
|
54
|
-
logo.classList.add("logo-jasmine");
|
55
|
-
logo.classList.add("logo-jasmine--" + (fail ? "fail" : "pass"));
|
56
|
-
var link = document.createElement('link');
|
57
|
-
link.rel = 'shortcut icon';
|
58
|
-
if (fail) {
|
59
|
-
link.href = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACqVBMVEUAAAAAgOUAgOUAgOUAgOUAgOUAgOUAgOUAgOUAgOUAgOUAgOUAgOUAfuUAf+UAgOUAgOUAgOUAgOUAf+UAf+UAgOUAf+UAf+UAgOUAgOUAfuUAfuUAgOUAgOUAf+UAgOWRbLkAf+XQSVokf+OPbboAgO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G92IVNaVR9B7c23AI0AeoI1ADsPR50Aq84zOuH66gwAfjoCeb9LFFsyJhl7NtZOTtzOatULwNFEmBf6PsDV68OVW8jVjtrJKbU5oj5bv5J2H5CiRoNyCjllfme8hze+eoVvEhKxmjXU2HK4zvcuFcf95OUVsq50FZUia5K+TKHIELfJNNzdC3QiWIjgWNeJRKl/MMEMVXDwtxhLS+w4rRKVBScJhH6ixruQHGH7U9FsSeXYLCsi6OfQ8V/o0bqx9QUoyCtkXdnUxgGekQ77O7t+DqddA/ZoppEK7WTKvAuF+5RayhcuIzY2SjDYSV5eIWvLVnE+WafV1xhuH0Gny8Kpe/tjAKNx/QKATY3hfIATUaNF3LYgC48ti4DcC8ye5MTT6mKeq5c50tbK2tLr/tK4Tw+P0HJgLrLYkXYNCAR17gtpbPmM7gXz8ZJajC4U7mQJI+U1OFH+Utc98e+OIQk7FunD8bfi5OFeDYDOEwCyIB/g3JkKmjJCYu7LeC+6nE/dS9L1PUVa6B+obtowREJ7lS8evn9a/wIpplIZW4a/+SPujR6atvGgPjJW7dvaCfRidTw5PmqmYOJSEzeajNSZ6GLefshuYXn1St7OXoAljY7eQv9AtW9rJ909LhSxgrqXWuFMb8VttRCq473md1AOv8mLwwGiemLKpT49PLIi1nS0umnDEMFgAkWs4POHWidGe0pOMZGU5A0mmfR6E4spDMxk1r75KCEnqhotraqPVNoc0UyhyF2W8EBjuN2odknE0PTXsDqepG7b4HjlZ3cr/rW4j96iEPlduXh+sfn2H8j32foViNsQY6CLEILXUKRd7H7wV2PTthQVfwBOj/OTmN6yuQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOC0wNi0yMVQwODozMTo0NS0wNzowMJVtVyEAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTgtMDYtMjFUMDg6MzE6NDUtMDc6MDDkMO+dAAAAAElFTkSuQmCC";
|
62
|
-
}
|
63
|
-
Array.prototype.slice.call(document.querySelectorAll("[type='image/x-icon']")).forEach(function (link) {
|
64
|
-
link.parentElement.removeChild(link);
|
65
|
-
});
|
66
|
-
document.head.appendChild(link);
|
67
|
-
}, function () {
|
68
|
-
return window.jsApiReporter.finished
|
69
|
-
});
|
70
|
-
}
|
71
|
-
|
72
|
-
/**
|
73
|
-
*
|
74
|
-
* @param {Element} element
|
75
|
-
* @return {string}
|
76
|
-
*/
|
77
|
-
function identifyElement(element) {
|
78
|
-
var result = "null";
|
79
|
-
var first = true;
|
80
|
-
var itemString;
|
81
|
-
while (element) {
|
82
|
-
if (element.id) {
|
83
|
-
return "#" + element.id + (first ? "" : " > " + result);
|
84
|
-
}
|
85
|
-
var elClasses = element.className.trim().replace(/\s+/g, ".");
|
86
|
-
if (elClasses) elClasses = "." + elClasses;
|
87
|
-
itemString = element.tagName.toLowerCase() + elClasses;
|
88
|
-
if (first) {
|
89
|
-
first = false;
|
90
|
-
result = itemString;
|
91
|
-
} else {
|
92
|
-
result = itemString + " > " + result;
|
93
|
-
}
|
94
|
-
element = element.parentElement;
|
95
|
-
}
|
96
|
-
return result;
|
97
|
-
}
|
98
|
-
|
99
|
-
var data = {
|
100
|
-
_locks: [],
|
101
|
-
_timeout: null,
|
102
|
-
tags: {}
|
103
|
-
};
|
104
|
-
var start = function () {
|
105
|
-
if (new Date() - data._timeout > 5000) {
|
106
|
-
throw "JasmineHelper timeout";
|
107
|
-
}
|
108
|
-
if (data._locks.length) {
|
109
|
-
setTimeout(start, 400);
|
110
|
-
return;
|
111
|
-
}
|
112
|
-
notifyOfResult();
|
113
|
-
jasmine.jasmineStart();
|
114
|
-
};
|
115
|
-
window.jasmineHelper = {
|
116
|
-
data: data,
|
117
|
-
/**
|
118
|
-
* prevent execution of Jasmine until [name] lock have been unlocked
|
119
|
-
* @param {String} name
|
120
|
-
*/
|
121
|
-
lock: function (name) {
|
122
|
-
if (data._locks.indexOf(name) === -1) {
|
123
|
-
data._locks.push(name);
|
124
|
-
}
|
125
|
-
},
|
126
|
-
/**
|
127
|
-
* unlock [name] lock, so execution of Jasmine can proceed
|
128
|
-
* @param {String} name
|
129
|
-
*/
|
130
|
-
unlock: function (name) {
|
131
|
-
var index = data._locks.indexOf(name);
|
132
|
-
if (index !== -1) {
|
133
|
-
data._locks.splice(index, 1);
|
134
|
-
}
|
135
|
-
},
|
136
|
-
/**
|
137
|
-
* unlock [name] lock if [prerequisite] is fulfilled
|
138
|
-
* @param {String} name
|
139
|
-
* @param {Function} prerequisite
|
140
|
-
*/
|
141
|
-
unlockOnPass: function (name, prerequisite) {
|
142
|
-
EasyGem.schedule.require(function () {
|
143
|
-
jasmineHelper.unlock(name);
|
144
|
-
}, prerequisite);
|
145
|
-
},
|
146
|
-
parseResult: function () {
|
147
|
-
var specs = window.jsApiReporter.specs();
|
148
|
-
var shortReport = "";
|
149
|
-
var report = "";
|
150
|
-
var allPassed = true;
|
151
|
-
var result = "";
|
152
|
-
for (var i = 0; i < specs.length; i++) {
|
153
|
-
var spec = specs[i];
|
154
|
-
if (spec.status === "passed") {
|
155
|
-
shortReport += ".";
|
156
|
-
} else if (spec.status === "pending") {
|
157
|
-
shortReport += "O";
|
158
|
-
} else {
|
159
|
-
allPassed = false;
|
160
|
-
shortReport += "X";
|
161
|
-
report += "__TEST " + spec.fullName + "______\n";
|
162
|
-
for (var j = 0; j < spec.failedExpectations.length; j++) {
|
163
|
-
var fail = spec.failedExpectations[j];
|
164
|
-
var split = fail.stack.split("\n");
|
165
|
-
result += window.location + "\n";
|
166
|
-
report += " " + fail.message + "\n";
|
167
|
-
for (var k = 1; k < split.length; k++) {
|
168
|
-
if (split[k].indexOf("/jasmine_lib/") > -1) continue;
|
169
|
-
report += split[k] + "\n";
|
170
|
-
}
|
171
|
-
}
|
172
|
-
}
|
173
|
-
}
|
174
|
-
if (allPassed) {
|
175
|
-
return "success";
|
176
|
-
}
|
177
|
-
result += " RESULTS: " + shortReport + "\n" + report;
|
178
|
-
//$("#content").text(result.replace("\n", "<br>"));
|
179
|
-
return result;
|
180
|
-
},
|
181
|
-
/**
|
182
|
-
* Create mouseEvent of [type] at client position, so it can be triggered by method dispatchEvent(element)
|
183
|
-
* @param {String} type
|
184
|
-
* @param {int} pageX
|
185
|
-
* @param {int} pageY
|
186
|
-
* @param {{ctrlKey?:boolean,metaKey?:boolean,altKey?:boolean,shiftKey?:boolean,button?:int,bubble?:boolean,detail?:int,screenX?:int,screenY?:int}} [options]
|
187
|
-
* @return {{dispatchEvent:Function}}
|
188
|
-
*/
|
189
|
-
mouseEvent: function (type, pageX, pageY, options) {
|
190
|
-
var evt;
|
191
|
-
options = options || {};
|
192
|
-
EasyGem.extend(options, {
|
193
|
-
bubbles: true,
|
194
|
-
cancelable: (type !== "mousemove"),
|
195
|
-
view: window,
|
196
|
-
clientX: pageX - document.body.scrollLeft - document.documentElement.scrollLeft,
|
197
|
-
clientY: pageY - document.body.scrollTop - document.documentElement.scrollTop
|
198
|
-
});
|
199
|
-
if (window.MouseEvent) {
|
200
|
-
evt = new MouseEvent(type, options);
|
201
|
-
} else if (typeof(document.createEvent) === "function") {
|
202
|
-
evt = document.createEvent("MouseEvents");
|
203
|
-
evt.initMouseEvent(type,
|
204
|
-
options.bubbles, options.cancelable, options.view, options.detail,
|
205
|
-
options.screenX, options.screenY, options.clientX, options.clientY,
|
206
|
-
options.ctrlKey, options.altKey, options.shiftKey, options.metaKey,
|
207
|
-
options.button, document.body.parentNode);
|
208
|
-
}
|
209
|
-
evt.dispatchEvent = function (el) {
|
210
|
-
if (el.dispatchEvent) {
|
211
|
-
el.dispatchEvent(this);
|
212
|
-
} else if (el.fireEvent) {
|
213
|
-
el.fireEvent('on' + type, this);
|
214
|
-
}
|
215
|
-
return this;
|
216
|
-
};
|
217
|
-
return evt;
|
218
|
-
},
|
219
|
-
/**
|
220
|
-
* Triggers mouseEvent of [type] at the center of [element]
|
221
|
-
* @param {string|Element|jQuery} element - can be HTMLElement, selector or jQuery element
|
222
|
-
* @param {string} type
|
223
|
-
* @param {{ctrlKey?:boolean,metaKey?:boolean,altKey?:boolean,shiftKey?:boolean,button?:int,bubble?:boolean,detail?:int,screenX?:int,screenY?:int}} [options]
|
224
|
-
*/
|
225
|
-
mouseEventOn: function (element, type, options) {
|
226
|
-
if (typeof element === "string") {
|
227
|
-
element = document.querySelector(element);
|
228
|
-
} else if (element instanceof window.jQuery) {
|
229
|
-
element = element[0];
|
230
|
-
}
|
231
|
-
if (!element) throw new Error("missing element");
|
232
|
-
element.scrollIntoView({block: "center", behavior: "instant"});
|
233
|
-
var box = element.getBoundingClientRect();
|
234
|
-
var pointX = (box.left + box.right) / 2;
|
235
|
-
var pointY = (box.top + box.bottom) / 2;
|
236
|
-
var target = document.elementFromPoint(pointX, pointY);
|
237
|
-
if (!isDescendantOrSame(element, target)) {
|
238
|
-
throw new Error(identifyElement(element) + " is covered by " + identifyElement(target) + ", can't be clicked");
|
239
|
-
}
|
240
|
-
return this.mouseEvent(type, pointX, pointY, options).dispatchEvent(element);
|
241
|
-
},
|
242
|
-
/**
|
243
|
-
* Trigger click mouseEvent on [element]
|
244
|
-
* @param {string|Element|jQuery} element - can be HTMLElement, selector or jQuery element
|
245
|
-
* @param {{ctrlKey?:boolean,metaKey?:boolean,altKey?:boolean,shiftKey?:boolean,button?:int,bubble?:boolean,detail?:int,screenX?:int,screenY?:int}} [options]
|
246
|
-
*/
|
247
|
-
clickOn: function (element, options) {
|
248
|
-
return this.mouseEventOn(element, "click", options);
|
249
|
-
},
|
250
|
-
hasTag: function (tag) {
|
251
|
-
return data.tags[tag];
|
252
|
-
},
|
253
|
-
initPageMatchers: function () {
|
254
|
-
jasmine.addMatchers(pageMatchers);
|
255
|
-
}
|
256
|
-
};
|
257
|
-
setQueryTestNames();
|
258
|
-
|
259
|
-
var pageMatchers = {
|
260
|
-
toExistsOnPage: function (/*utils, customEqualityTesters*/) {
|
261
|
-
return {
|
262
|
-
compare: function (selector) {
|
263
|
-
var pass = $(selector).length;
|
264
|
-
if (pass) {
|
265
|
-
return {pass: true, message: "Expected " + selector + " not to be present on page"};
|
266
|
-
}
|
267
|
-
return {pass: false, message: "Expected " + selector + " to be present on page"};
|
268
|
-
}
|
269
|
-
};
|
270
|
-
},
|
271
|
-
toExistsTimes: function (/*utils, customEqualityTesters*/) {
|
272
|
-
return {
|
273
|
-
compare: function (selector, expected) {
|
274
|
-
var count = $(selector).length;
|
275
|
-
var pass = count === expected;
|
276
|
-
if (pass) {
|
277
|
-
return {pass: true, message: "Expected " + selector + " not to be present on page " + expected + "-times"};
|
278
|
-
}
|
279
|
-
return {
|
280
|
-
pass: false,
|
281
|
-
message: "Expected " + selector + " to be present on page " + expected + "-times, not " + count + "-times"
|
282
|
-
};
|
283
|
-
}
|
284
|
-
};
|
285
|
-
}
|
286
|
-
};
|
287
|
-
|
288
|
-
EasyGem.schedule.late(function () {
|
289
|
-
data._timeout = new Date();
|
290
|
-
start();
|
291
|
-
}, -100);
|
292
|
-
})();
|
@@ -1,32 +0,0 @@
|
|
1
|
-
describe("EasyGem.extend",function () {
|
2
|
-
var target = {
|
3
|
-
array: ["a", "b"],
|
4
|
-
c: {f: 5, t: 8, arr: [{a: 7, b: 3}]},
|
5
|
-
f: [5, 6, 7]
|
6
|
-
};
|
7
|
-
var source = {
|
8
|
-
array: ["c"],
|
9
|
-
c: {f: 6, g: 5, arr: [{v: 1, b: 2}, {ff: 1}]},
|
10
|
-
k: {a: "g"}
|
11
|
-
};
|
12
|
-
it("shallow",function () {
|
13
|
-
var e1 = {
|
14
|
-
array: ["c"],
|
15
|
-
c: {f: 6, g: 5, arr: [{v: 1, b: 2}, {ff: 1}]},
|
16
|
-
f: [5, 6, 7],
|
17
|
-
k: {a: "g"}
|
18
|
-
};
|
19
|
-
var r1 = EasyGem.extend(JSON.parse(JSON.stringify(target)), JSON.parse(JSON.stringify(source)));
|
20
|
-
expect(r1).toEqual(e1);
|
21
|
-
});
|
22
|
-
it("deep",function () {
|
23
|
-
var e2 = {
|
24
|
-
array: ["c", "b"],
|
25
|
-
c: {f: 6, g: 5, t: 8, arr: [{a: 7, v: 1, b: 2}, {ff: 1}]},
|
26
|
-
f: [5, 6, 7],
|
27
|
-
k: {a: "g"}
|
28
|
-
};
|
29
|
-
var r2 = EasyGem.extend(true,JSON.parse(JSON.stringify(target)), JSON.parse(JSON.stringify(source)));
|
30
|
-
expect(r2).toEqual(e2);
|
31
|
-
});
|
32
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
//= require_directory
|