Skip to content

Commit

Permalink
Item12511: more html5 data initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Jul 25, 2016
1 parent a1512bf commit 36712e5
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 14 deletions.
Expand Up @@ -15,7 +15,8 @@
*
*/

;(function($, window, document) {
"use strict";
(function($, window, document) {

// Create the defaults once
var pluginName = "Empty",
Expand Down Expand Up @@ -50,7 +51,7 @@
$.data(this, pluginName, new Plugin(this, options));
}
});
}
};

// Enable declarative widget instanziation
$(".jq"+pluginName).livequery(function() {
Expand Down
Expand Up @@ -28,12 +28,12 @@ jQuery(function($) {
$(".jqSlimbox:not(.jqInitedSlimbox)").livequery(function() {
var $this = $(this);
$this.addClass("jqInitedSlimbox");
var opts = $.extend({}, defaults, $this.metadata());
var opts = $.extend({}, defaults, $this.data(), $this.metadata());
var groupRel = "lightbox-"+Math.floor(Math.random() * 100);
$this.find(opts.itemSelector).attr('rel', groupRel).slimbox(opts,
function(el) {
var $el = $(el);
var imgOpts = $.extend({}, $el.metadata());
var imgOpts = $.extend({}, $el.data(), $el.metadata());
var href = imgOpts.origUrl || el.href;
var imgTitle = imgOpts.title || $el.attr(opts.titleAttr) || '';
imgTitle = imgTitle.replace(/\..*?$/, '').replace(/[\-_]/g, ' ');
Expand Down
@@ -1,7 +1,7 @@
// initializer for the ui-accordion plugin
jQuery(function($) {
$(".jqUIAccordion").livequery(function() {
var $this = $(this), opts = $.extend({}, $this.metadata());
var $this = $(this), opts = $.extend({}, $this.data(), $this.metadata());
$this.removeClass("jqUIAccordion").accordion(opts);
});
});
Expand Up @@ -10,7 +10,7 @@ jQuery(function($) {
var $this = $(this),
cache = {}, lastXhr,
src = $this.attr('autocomplete'),
opts = $.extend({ source: src }, defaults, $this.metadata());
opts = $.extend({ source: src }, defaults, $this.data(), $this.metadata());

if (opts.cache && typeof(opts.source) === 'string') {
// wrap source url into a cache
Expand Down
Expand Up @@ -3,7 +3,7 @@ jQuery(function($) {
'use strict';

var datepickerDefaults = {
dateFormat:'yy-mm-dd',
dateFormat:'yy/mm/dd',
firstDay: 1,
showOn: 'button',
buttonText: "<i class='fa fa-calendar'></i>"
Expand All @@ -12,7 +12,7 @@ jQuery(function($) {
$(".jqUIDatepicker").livequery(function() {
var $this = $(this),
opts = $.extend({}, datepickerDefaults, $this.data(), $this.metadata()),
maxZIndex = 1, val = $this.val();
maxZIndex = 100, val = $this.val();

$this.parents().each(function() {
var zIndex = parseInt($(this).css("z-index"), 10);
Expand Down
Expand Up @@ -3,7 +3,7 @@ jQuery(function($) {

$(".jqUIDraggable").livequery(function() {
var $this = $(this),
opts = $.extend({}, $this.metadata());
opts = $.extend({}, $this.data(), $this.metadata());

$this.removeClass("jqUIDraggable").draggable(opts);
});
Expand Down
Expand Up @@ -2,12 +2,12 @@
jQuery(function($) {

// progressbar
$(".jqUIProgressBar").livequery(function() {
$(".jqUIProgressBar:not(.jqUIProgressBarInited)").livequery(function() {
var $this = $(this),
value = parseInt($this.text(), 10),
opts = $.extend({ value: value }, $this.metadata());
opts = $.extend({ value: value }, $this.data(), $this.metadata());

$this.empty().removeClass("jqUIProgressbar").progressbar(opts);
$this.addClass("jqUIProgressBarInited").progressbar(opts);
});

});
Expand Up @@ -23,7 +23,7 @@ jQuery(function($) {
}
}

opts = $.extend({}, sliderDefaults, opts, $this.metadata());
opts = $.extend({}, sliderDefaults, opts, $this.data(), $this.metadata());
$this.empty().removeClass("jqUISlider").slider(opts);
});
});
Expand Up @@ -3,7 +3,7 @@ jQuery(function($) {
$(".jqUISpinner").livequery(function() {
var $this = $(this),
value = $this.val();
opts = $.extend({}, $this.data());
opts = $.extend({}, $this.data(), $this.metadata());
$this.spinner(opts);
});

Expand Down

0 comments on commit 36712e5

Please sign in to comment.