alchemy_cms 7.0.5 → 7.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of alchemy_cms might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +6 -1
- data/alchemy_cms.gemspec +2 -3
- data/app/assets/javascripts/alchemy/admin.js +0 -1
- data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +1 -1
- data/app/controllers/alchemy/admin/ingredients_controller.rb +2 -1
- data/app/models/alchemy/page/publisher.rb +14 -12
- data/app/models/alchemy/page_mutex.rb +31 -0
- data/app/models/alchemy/picture/url.rb +9 -1
- data/db/migrate/20231113104432_create_page_mutexes.rb +8 -0
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy_cms.rb +0 -1
- data/vendor/assets/javascripts/jquery-ui/data.js +45 -0
- data/vendor/assets/javascripts/jquery-ui/ie.js +20 -0
- data/vendor/assets/javascripts/jquery-ui/keycode.js +51 -0
- data/vendor/assets/javascripts/jquery-ui/plugin.js +49 -0
- data/vendor/assets/javascripts/jquery-ui/safe-active-element.js +46 -0
- data/vendor/assets/javascripts/jquery-ui/safe-blur.js +27 -0
- data/vendor/assets/javascripts/jquery-ui/scroll-parent.js +50 -0
- data/vendor/assets/javascripts/jquery-ui/unique-id.js +54 -0
- data/vendor/assets/javascripts/jquery-ui/version.js +20 -0
- data/vendor/assets/javascripts/jquery-ui/widget.js +754 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/draggable.js +1268 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/mouse.js +241 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/sortable.js +1623 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/tabs.js +931 -0
- metadata +36 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c585dd53e50006dabd57cbac098ba15c8acc5dc0ea9dd18a432df5feeca4dc89
|
4
|
+
data.tar.gz: 19518e22d715dfc11dbc46dfbd72245bd8a88156360bb8702e345bdc5d52ff7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d721b898bf3a4c76daf7ec9a925d76d9782252751355b797922fc5c0d2a3a95e97e1e05a5f9fe6b01f670d2453c7b63bcdc54d64f0c845c0145817fc517fd577
|
7
|
+
data.tar.gz: 4867e081525cc3ff481dcadb7d5625a3ddaade4e030ed46522ddd0d8d71c65c55a403d9599a7b4adbef3027e06947bcbfd6386aee4470669bc1e13650d671d74
|
data/.github/workflows/test.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 7.0.6 (2023-11-15)
|
4
|
+
|
5
|
+
- [7.0-stable] Merge pull request #2612 from sascha-karnatz/harden-page-publisher [#2613](https://github.com/AlchemyCMS/alchemy_cms/pull/2613) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
6
|
+
- [7.0] Allow Rails 7.1 [#2603](https://github.com/AlchemyCMS/alchemy_cms/pull/2603) ([tvdeyen](https://github.com/tvdeyen))
|
7
|
+
- [7.0-stable] Merge pull request #2601 from tvdeyen/remove-jquery-ui-rails [#2602](https://github.com/AlchemyCMS/alchemy_cms/pull/2602) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
8
|
+
|
3
9
|
## 7.0.5 (2023-10-06)
|
4
10
|
|
5
11
|
- [7.0-stable] Merge pull request #2593 from tvdeyen/fix-turbo-redirect [#2594](https://github.com/AlchemyCMS/alchemy_cms/pull/2594) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
data/Gemfile
CHANGED
@@ -4,7 +4,7 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
rails_version = ENV.fetch("RAILS_VERSION", 7.
|
7
|
+
rails_version = ENV.fetch("RAILS_VERSION", "7.1")
|
8
8
|
gem "rails", "~> #{rails_version}.0"
|
9
9
|
|
10
10
|
if ENV["DB"].nil? || ENV["DB"] == "sqlite"
|
@@ -27,6 +27,11 @@ group :development, :test do
|
|
27
27
|
# Necessary because GH Actions gem cache does not have this "Bundled with Ruby" gem installed
|
28
28
|
gem "rexml", "~> 3.2.4"
|
29
29
|
gem "sassc", "~> 2.4.0" # https://github.com/sass/sassc-ruby/issues/146
|
30
|
+
|
31
|
+
# https://github.com/hotwired/turbo-rails/issues/512
|
32
|
+
if rails_version == "7.1"
|
33
|
+
gem "actioncable", "~> #{rails_version}.0"
|
34
|
+
end
|
30
35
|
else
|
31
36
|
gem "launchy"
|
32
37
|
gem "annotate"
|
data/alchemy_cms.gemspec
CHANGED
@@ -29,10 +29,10 @@ Gem::Specification.new do |gem|
|
|
29
29
|
activesupport
|
30
30
|
railties
|
31
31
|
].each do |rails_gem|
|
32
|
-
gem.add_runtime_dependency rails_gem, [">= 6.1", "< 7.
|
32
|
+
gem.add_runtime_dependency rails_gem, [">= 6.1", "< 7.2"]
|
33
33
|
end
|
34
34
|
|
35
|
-
gem.add_runtime_dependency "active_model_serializers", ["~> 0.10.
|
35
|
+
gem.add_runtime_dependency "active_model_serializers", ["~> 0.10.14"]
|
36
36
|
gem.add_runtime_dependency "acts_as_list", [">= 0.3", "< 2"]
|
37
37
|
gem.add_runtime_dependency "awesome_nested_set", ["~> 3.1"]
|
38
38
|
gem.add_runtime_dependency "cancancan", [">= 2.1", "< 4.0"]
|
@@ -43,7 +43,6 @@ Gem::Specification.new do |gem|
|
|
43
43
|
gem.add_runtime_dependency "handlebars_assets", ["~> 0.23"]
|
44
44
|
gem.add_runtime_dependency "importmap-rails", ["~> 1.2", ">= 1.2.1"]
|
45
45
|
gem.add_runtime_dependency "jquery-rails", ["~> 4.0", ">= 4.0.4"]
|
46
|
-
gem.add_runtime_dependency "jquery-ui-rails", ["~> 6.0"]
|
47
46
|
gem.add_runtime_dependency "kaminari", ["~> 1.1"]
|
48
47
|
gem.add_runtime_dependency "originator", ["~> 3.1"]
|
49
48
|
gem.add_runtime_dependency "ransack", [">= 1.8", "< 5.0"]
|
@@ -19,7 +19,8 @@ module Alchemy
|
|
19
19
|
private
|
20
20
|
|
21
21
|
def ingredient_params
|
22
|
-
params[:ingredient]&.permit(@ingredient.class.stored_attributes[:data]) ||
|
22
|
+
params[:ingredient]&.permit(@ingredient.class.stored_attributes[:data]) ||
|
23
|
+
ActionController::Parameters.new
|
23
24
|
end
|
24
25
|
|
25
26
|
def load_croppable_resource
|
@@ -20,21 +20,23 @@ module Alchemy
|
|
20
20
|
#
|
21
21
|
def publish!(public_on:)
|
22
22
|
Page.transaction do
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
23
|
+
PageMutex.with_lock!(@page) do
|
24
|
+
version = public_version(public_on)
|
25
|
+
DeleteElements.new(version.elements).call
|
26
|
+
|
27
|
+
repository = page.draft_version.element_repository
|
28
|
+
ActiveRecord::Base.no_touching do
|
29
|
+
Element.acts_as_list_no_update do
|
30
|
+
repository.visible.not_nested.each.with_index(1) do |element, position|
|
31
|
+
Alchemy::DuplicateElement.new(element, repository: repository).call(
|
32
|
+
page_version_id: version.id,
|
33
|
+
position: position
|
34
|
+
)
|
35
|
+
end
|
34
36
|
end
|
35
37
|
end
|
38
|
+
page.update(published_at: public_on)
|
36
39
|
end
|
37
|
-
page.update(published_at: public_on)
|
38
40
|
end
|
39
41
|
|
40
42
|
Alchemy.publish_targets.each { |p| p.perform_later(page) }
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Alchemy
|
4
|
+
class PageMutex < BaseRecord
|
5
|
+
class LockFailed < StandardError; end
|
6
|
+
|
7
|
+
MAX_AGE = 300 # seconds
|
8
|
+
|
9
|
+
belongs_to :page, class_name: "Alchemy::Page", optional: true
|
10
|
+
|
11
|
+
scope :expired, -> { where(arel_table[:created_at].lteq(MAX_AGE.seconds.ago)) }
|
12
|
+
|
13
|
+
def self.with_lock!(page)
|
14
|
+
raise ArgumentError, "A page is necessary to lock it" if page.nil?
|
15
|
+
|
16
|
+
# remove old expired page if it wasn't deleted before
|
17
|
+
expired.where(page: page).delete_all
|
18
|
+
|
19
|
+
begin
|
20
|
+
page_mutex = create!(page: page)
|
21
|
+
rescue ActiveRecord::RecordNotUnique
|
22
|
+
error = LockFailed.new("Can't lock page #{page.id} twice!")
|
23
|
+
logger.error error.inspect
|
24
|
+
raise error
|
25
|
+
end
|
26
|
+
yield
|
27
|
+
ensure
|
28
|
+
page_mutex&.destroy
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -35,7 +35,7 @@ module Alchemy
|
|
35
35
|
thumb.uid
|
36
36
|
else
|
37
37
|
uid = PictureThumb::Uid.call(signature, variant)
|
38
|
-
ActiveRecord::Base.connected_to(role:
|
38
|
+
ActiveRecord::Base.connected_to(role: db_writing_role) do
|
39
39
|
PictureThumb::Create.call(variant, signature, uid)
|
40
40
|
end
|
41
41
|
uid
|
@@ -49,6 +49,14 @@ module Alchemy
|
|
49
49
|
variant.picture.thumbs.find_by(signature: signature)
|
50
50
|
end
|
51
51
|
end
|
52
|
+
|
53
|
+
def db_writing_role
|
54
|
+
if ActiveRecord::Base.respond_to?(:writing_role)
|
55
|
+
ActiveRecord::Base.writing_role
|
56
|
+
else
|
57
|
+
ActiveRecord.writing_role
|
58
|
+
end
|
59
|
+
end
|
52
60
|
end
|
53
61
|
end
|
54
62
|
end
|
data/lib/alchemy/version.rb
CHANGED
data/lib/alchemy_cms.rb
CHANGED
@@ -0,0 +1,45 @@
|
|
1
|
+
//= require jquery-ui/version
|
2
|
+
|
3
|
+
/*!
|
4
|
+
* jQuery UI :data 1.13.0
|
5
|
+
* http://jqueryui.com
|
6
|
+
*
|
7
|
+
* Copyright jQuery Foundation and other contributors
|
8
|
+
* Released under the MIT license.
|
9
|
+
* http://jquery.org/license
|
10
|
+
*/
|
11
|
+
|
12
|
+
//>>label: :data Selector
|
13
|
+
//>>group: Core
|
14
|
+
//>>description: Selects elements which have data stored under the specified key.
|
15
|
+
//>>docs: http://api.jqueryui.com/data-selector/
|
16
|
+
|
17
|
+
( function( factory ) {
|
18
|
+
"use strict";
|
19
|
+
|
20
|
+
if ( typeof define === "function" && define.amd ) {
|
21
|
+
|
22
|
+
// AMD. Register as an anonymous module.
|
23
|
+
define( [ "jquery", "./version" ], factory );
|
24
|
+
} else {
|
25
|
+
|
26
|
+
// Browser globals
|
27
|
+
factory( jQuery );
|
28
|
+
}
|
29
|
+
} )( function( $ ) {
|
30
|
+
"use strict";
|
31
|
+
|
32
|
+
return $.extend( $.expr.pseudos, {
|
33
|
+
data: $.expr.createPseudo ?
|
34
|
+
$.expr.createPseudo( function( dataName ) {
|
35
|
+
return function( elem ) {
|
36
|
+
return !!$.data( elem, dataName );
|
37
|
+
};
|
38
|
+
} ) :
|
39
|
+
|
40
|
+
// Support: jQuery <1.8
|
41
|
+
function( elem, i, match ) {
|
42
|
+
return !!$.data( elem, match[ 3 ] );
|
43
|
+
}
|
44
|
+
} );
|
45
|
+
} );
|
@@ -0,0 +1,20 @@
|
|
1
|
+
//= require jquery-ui/version
|
2
|
+
|
3
|
+
( function( factory ) {
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
if ( typeof define === "function" && define.amd ) {
|
7
|
+
|
8
|
+
// AMD. Register as an anonymous module.
|
9
|
+
define( [ "jquery", "./version" ], factory );
|
10
|
+
} else {
|
11
|
+
|
12
|
+
// Browser globals
|
13
|
+
factory( jQuery );
|
14
|
+
}
|
15
|
+
} )( function( $ ) {
|
16
|
+
"use strict";
|
17
|
+
|
18
|
+
// This file is deprecated
|
19
|
+
return $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
|
20
|
+
} );
|
@@ -0,0 +1,51 @@
|
|
1
|
+
//= require jquery-ui/version
|
2
|
+
|
3
|
+
/*!
|
4
|
+
* jQuery UI Keycode 1.13.0
|
5
|
+
* http://jqueryui.com
|
6
|
+
*
|
7
|
+
* Copyright jQuery Foundation and other contributors
|
8
|
+
* Released under the MIT license.
|
9
|
+
* http://jquery.org/license
|
10
|
+
*/
|
11
|
+
|
12
|
+
//>>label: Keycode
|
13
|
+
//>>group: Core
|
14
|
+
//>>description: Provide keycodes as keynames
|
15
|
+
//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/
|
16
|
+
|
17
|
+
( function( factory ) {
|
18
|
+
"use strict";
|
19
|
+
|
20
|
+
if ( typeof define === "function" && define.amd ) {
|
21
|
+
|
22
|
+
// AMD. Register as an anonymous module.
|
23
|
+
define( [ "jquery", "./version" ], factory );
|
24
|
+
} else {
|
25
|
+
|
26
|
+
// Browser globals
|
27
|
+
factory( jQuery );
|
28
|
+
}
|
29
|
+
} )( function( $ ) {
|
30
|
+
"use strict";
|
31
|
+
|
32
|
+
return $.ui.keyCode = {
|
33
|
+
BACKSPACE: 8,
|
34
|
+
COMMA: 188,
|
35
|
+
DELETE: 46,
|
36
|
+
DOWN: 40,
|
37
|
+
END: 35,
|
38
|
+
ENTER: 13,
|
39
|
+
ESCAPE: 27,
|
40
|
+
HOME: 36,
|
41
|
+
LEFT: 37,
|
42
|
+
PAGE_DOWN: 34,
|
43
|
+
PAGE_UP: 33,
|
44
|
+
PERIOD: 190,
|
45
|
+
RIGHT: 39,
|
46
|
+
SPACE: 32,
|
47
|
+
TAB: 9,
|
48
|
+
UP: 38
|
49
|
+
};
|
50
|
+
|
51
|
+
} );
|
@@ -0,0 +1,49 @@
|
|
1
|
+
//= require jquery-ui/version
|
2
|
+
|
3
|
+
( function( factory ) {
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
if ( typeof define === "function" && define.amd ) {
|
7
|
+
|
8
|
+
// AMD. Register as an anonymous module.
|
9
|
+
define( [ "jquery", "./version" ], factory );
|
10
|
+
} else {
|
11
|
+
|
12
|
+
// Browser globals
|
13
|
+
factory( jQuery );
|
14
|
+
}
|
15
|
+
} )( function( $ ) {
|
16
|
+
"use strict";
|
17
|
+
|
18
|
+
// $.ui.plugin is deprecated. Use $.widget() extensions instead.
|
19
|
+
return $.ui.plugin = {
|
20
|
+
add: function( module, option, set ) {
|
21
|
+
var i,
|
22
|
+
proto = $.ui[ module ].prototype;
|
23
|
+
for ( i in set ) {
|
24
|
+
proto.plugins[ i ] = proto.plugins[ i ] || [];
|
25
|
+
proto.plugins[ i ].push( [ option, set[ i ] ] );
|
26
|
+
}
|
27
|
+
},
|
28
|
+
call: function( instance, name, args, allowDisconnected ) {
|
29
|
+
var i,
|
30
|
+
set = instance.plugins[ name ];
|
31
|
+
|
32
|
+
if ( !set ) {
|
33
|
+
return;
|
34
|
+
}
|
35
|
+
|
36
|
+
if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode ||
|
37
|
+
instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
|
41
|
+
for ( i = 0; i < set.length; i++ ) {
|
42
|
+
if ( instance.options[ set[ i ][ 0 ] ] ) {
|
43
|
+
set[ i ][ 1 ].apply( instance.element, args );
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
};
|
48
|
+
|
49
|
+
} );
|
@@ -0,0 +1,46 @@
|
|
1
|
+
//= require jquery-ui/version
|
2
|
+
|
3
|
+
( function( factory ) {
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
if ( typeof define === "function" && define.amd ) {
|
7
|
+
|
8
|
+
// AMD. Register as an anonymous module.
|
9
|
+
define( [ "jquery", "./version" ], factory );
|
10
|
+
} else {
|
11
|
+
|
12
|
+
// Browser globals
|
13
|
+
factory( jQuery );
|
14
|
+
}
|
15
|
+
} )( function( $ ) {
|
16
|
+
"use strict";
|
17
|
+
|
18
|
+
return $.ui.safeActiveElement = function( document ) {
|
19
|
+
var activeElement;
|
20
|
+
|
21
|
+
// Support: IE 9 only
|
22
|
+
// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
|
23
|
+
try {
|
24
|
+
activeElement = document.activeElement;
|
25
|
+
} catch ( error ) {
|
26
|
+
activeElement = document.body;
|
27
|
+
}
|
28
|
+
|
29
|
+
// Support: IE 9 - 11 only
|
30
|
+
// IE may return null instead of an element
|
31
|
+
// Interestingly, this only seems to occur when NOT in an iframe
|
32
|
+
if ( !activeElement ) {
|
33
|
+
activeElement = document.body;
|
34
|
+
}
|
35
|
+
|
36
|
+
// Support: IE 11 only
|
37
|
+
// IE11 returns a seemingly empty object in some cases when accessing
|
38
|
+
// document.activeElement from an <iframe>
|
39
|
+
if ( !activeElement.nodeName ) {
|
40
|
+
activeElement = document.body;
|
41
|
+
}
|
42
|
+
|
43
|
+
return activeElement;
|
44
|
+
};
|
45
|
+
|
46
|
+
} );
|
@@ -0,0 +1,27 @@
|
|
1
|
+
//= require jquery-ui/version
|
2
|
+
|
3
|
+
( function( factory ) {
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
if ( typeof define === "function" && define.amd ) {
|
7
|
+
|
8
|
+
// AMD. Register as an anonymous module.
|
9
|
+
define( [ "jquery", "./version" ], factory );
|
10
|
+
} else {
|
11
|
+
|
12
|
+
// Browser globals
|
13
|
+
factory( jQuery );
|
14
|
+
}
|
15
|
+
} )( function( $ ) {
|
16
|
+
"use strict";
|
17
|
+
|
18
|
+
return $.ui.safeBlur = function( element ) {
|
19
|
+
|
20
|
+
// Support: IE9 - 10 only
|
21
|
+
// If the <body> is blurred, IE will switch windows, see #9420
|
22
|
+
if ( element && element.nodeName.toLowerCase() !== "body" ) {
|
23
|
+
$( element ).trigger( "blur" );
|
24
|
+
}
|
25
|
+
};
|
26
|
+
|
27
|
+
} );
|
@@ -0,0 +1,50 @@
|
|
1
|
+
//= require jquery-ui/version
|
2
|
+
|
3
|
+
/*!
|
4
|
+
* jQuery UI Scroll Parent 1.13.0
|
5
|
+
* http://jqueryui.com
|
6
|
+
*
|
7
|
+
* Copyright jQuery Foundation and other contributors
|
8
|
+
* Released under the MIT license.
|
9
|
+
* http://jquery.org/license
|
10
|
+
*/
|
11
|
+
|
12
|
+
//>>label: scrollParent
|
13
|
+
//>>group: Core
|
14
|
+
//>>description: Get the closest ancestor element that is scrollable.
|
15
|
+
//>>docs: http://api.jqueryui.com/scrollParent/
|
16
|
+
|
17
|
+
( function( factory ) {
|
18
|
+
"use strict";
|
19
|
+
|
20
|
+
if ( typeof define === "function" && define.amd ) {
|
21
|
+
|
22
|
+
// AMD. Register as an anonymous module.
|
23
|
+
define( [ "jquery", "./version" ], factory );
|
24
|
+
} else {
|
25
|
+
|
26
|
+
// Browser globals
|
27
|
+
factory( jQuery );
|
28
|
+
}
|
29
|
+
} )( function( $ ) {
|
30
|
+
"use strict";
|
31
|
+
|
32
|
+
return $.fn.scrollParent = function( includeHidden ) {
|
33
|
+
var position = this.css( "position" ),
|
34
|
+
excludeStaticParent = position === "absolute",
|
35
|
+
overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
|
36
|
+
scrollParent = this.parents().filter( function() {
|
37
|
+
var parent = $( this );
|
38
|
+
if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
|
39
|
+
return false;
|
40
|
+
}
|
41
|
+
return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) +
|
42
|
+
parent.css( "overflow-x" ) );
|
43
|
+
} ).eq( 0 );
|
44
|
+
|
45
|
+
return position === "fixed" || !scrollParent.length ?
|
46
|
+
$( this[ 0 ].ownerDocument || document ) :
|
47
|
+
scrollParent;
|
48
|
+
};
|
49
|
+
|
50
|
+
} );
|
@@ -0,0 +1,54 @@
|
|
1
|
+
//= require jquery-ui/version
|
2
|
+
|
3
|
+
/*!
|
4
|
+
* jQuery UI Unique ID 1.13.0
|
5
|
+
* http://jqueryui.com
|
6
|
+
*
|
7
|
+
* Copyright jQuery Foundation and other contributors
|
8
|
+
* Released under the MIT license.
|
9
|
+
* http://jquery.org/license
|
10
|
+
*/
|
11
|
+
|
12
|
+
//>>label: uniqueId
|
13
|
+
//>>group: Core
|
14
|
+
//>>description: Functions to generate and remove uniqueId's
|
15
|
+
//>>docs: http://api.jqueryui.com/uniqueId/
|
16
|
+
|
17
|
+
( function( factory ) {
|
18
|
+
"use strict";
|
19
|
+
|
20
|
+
if ( typeof define === "function" && define.amd ) {
|
21
|
+
|
22
|
+
// AMD. Register as an anonymous module.
|
23
|
+
define( [ "jquery", "./version" ], factory );
|
24
|
+
} else {
|
25
|
+
|
26
|
+
// Browser globals
|
27
|
+
factory( jQuery );
|
28
|
+
}
|
29
|
+
} )( function( $ ) {
|
30
|
+
"use strict";
|
31
|
+
|
32
|
+
return $.fn.extend( {
|
33
|
+
uniqueId: ( function() {
|
34
|
+
var uuid = 0;
|
35
|
+
|
36
|
+
return function() {
|
37
|
+
return this.each( function() {
|
38
|
+
if ( !this.id ) {
|
39
|
+
this.id = "ui-id-" + ( ++uuid );
|
40
|
+
}
|
41
|
+
} );
|
42
|
+
};
|
43
|
+
} )(),
|
44
|
+
|
45
|
+
removeUniqueId: function() {
|
46
|
+
return this.each( function() {
|
47
|
+
if ( /^ui-id-\d+$/.test( this.id ) ) {
|
48
|
+
$( this ).removeAttr( "id" );
|
49
|
+
}
|
50
|
+
} );
|
51
|
+
}
|
52
|
+
} );
|
53
|
+
|
54
|
+
} );
|
@@ -0,0 +1,20 @@
|
|
1
|
+
( function( factory ) {
|
2
|
+
"use strict";
|
3
|
+
|
4
|
+
if ( typeof define === "function" && define.amd ) {
|
5
|
+
|
6
|
+
// AMD. Register as an anonymous module.
|
7
|
+
define( [ "jquery" ], factory );
|
8
|
+
} else {
|
9
|
+
|
10
|
+
// Browser globals
|
11
|
+
factory( jQuery );
|
12
|
+
}
|
13
|
+
} )( function( $ ) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
$.ui = $.ui || {};
|
17
|
+
|
18
|
+
return $.ui.version = "1.13.0";
|
19
|
+
|
20
|
+
} );
|