Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ FILES = js/jquery.ui.widget.js \
js/jquery.mobile.event.js \
js/jquery.mobile.hashchange.js \
js/jquery.mobile.page.js \
js/jquery.mobile.clickable.js \
js/jquery.mobile.fixHeaderFooter.js \
js/jquery.mobile.forms.checkboxradio.js \
js/jquery.mobile.forms.textinput.js \
Expand Down
4 changes: 2 additions & 2 deletions docs/_assets/js/_viewsource.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ $.fn.addSourceLink = function(style){

var activePage = $(this).parents('.ui-page-active');
page.find('.ui-content').append(codeblock);
$.changePage(activePage, page, 'slideup',false);
$.changePage(page, 'slideup',false);
page.find('.ui-btn-left').click(function(){
$.changePage(page, activepage, 'slideup',true);
$.changePage(activepage, 'slideup',true);
return false;
});
})
Expand Down
107 changes: 59 additions & 48 deletions js/jquery.mobile.buttonMarkup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,91 +4,102 @@
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
* Note: Code is in draft form and is subject to change
*/
(function($){
(function( jQuery ) {

$.fn.buttonMarkup = function( options ){
jQuery.fn.buttonMarkup = function( options ){
return this.each( function() {
var el = $( this ),
o = $.extend( {}, {
theme: (function(){
//if data-theme attr is present
if(el.is('[data-theme]')){
return el.attr('data-theme');
}
//if not, try to find closest theme container
else if( el.parents('body').length ) {
var themedParent = el.closest('[class*=ui-bar-],[class*=ui-body-]');
return themedParent.length ? themedParent.attr('class').match(/ui-(bar|body)-([a-z])/)[2] : 'c';
}
else{
return 'c';
}
})(),
iconpos: el.data('iconpos'),
icon: el.data('icon'),
inline: el.data('inline')
}, $.fn.buttonMarkup.defaults, options),
var el = jQuery( this ),
o = jQuery.extend( {}, jQuery.fn.buttonMarkup.defaults, el.data(), options),

// Classes Defined
buttonClass = "ui-btn ui-btn-up-" + o.theme,
innerClass = "ui-btn-inner",
iconClass;

if ( attachEvents ) {
attachEvents();
}

// if not, try to find closest theme container
if ( !o.theme ) {
var themedParent = el.closest("[class*='ui-bar-'],[class*='ui-body-']");
return themedParent.length ?
/ui-(bar|body)-([a-z])/.exec( themedParent.attr("class") )[2] :
"c";
}

if( o.inline ){
if ( o.inline ) {
buttonClass += " ui-btn-inline";
}

if (o.icon) {
o.icon = 'ui-icon-' + o.icon;
if ( o.icon ) {
o.icon = "ui-icon-" + o.icon;
o.iconpos = o.iconpos || "left";

iconClass = "ui-icon " + o.icon;

if (o.shadow) { iconClass += " ui-icon-shadow" }
o.iconpos = o.iconpos || 'left';
if ( o.shadow ) {
iconClass += " ui-icon-shadow"
}
}

if (o.iconpos){
if ( o.iconpos ) {
buttonClass += " ui-btn-icon-" + o.iconpos;

if( o.iconpos == 'notext' && !el.attr('title') ){
el.attr('title', el.text() );
if ( o.iconpos == "notext" && !el.attr("title") ) {
el.attr( "title", el.text() );
}

}




if (o.corners) {
if ( o.corners ) {
buttonClass += " ui-btn-corner-all";
innerClass += " ui-btn-corner-all";
}

if (o.shadow) {
if ( o.shadow ) {
buttonClass += " ui-shadow";
}

el
.attr( 'data-theme', o.theme )
.addClass( buttonClass )
.wrapInner( $( '<' + o.wrapperEls + '>', { className: "ui-btn-text" } ) );

if (o.icon) {
el.prepend( $( '<span>', { className: iconClass } ) );
}
.attr( "data-theme", o.theme )
.addClass( buttonClass );

el.wrapInner( $('<' + o.wrapperEls + '>', { className: innerClass }) );
var wrap = ("<D class='" + innerClass + "'><D class='ui-btn-text'></D>" +
( o.icon ? "<span class='" + iconClass + "'></span>" : "" ) +
"</D>").replace(/D/g, o.wrapperEls);

el.clickable();
el.wrapInner( wrap );
});
};

$.fn.buttonMarkup.defaults = {
jQuery.fn.buttonMarkup.defaults = {
corners: true,
shadow: true,
iconshadow: true,
wrapperEls: 'span'
wrapperEls: "span"
};

})(jQuery);
var attachEvents = function() {
jQuery(".ui-btn").live({
mousedown: function() {
var theme = jQuery(this).attr( "data-theme" );
jQuery(this).removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
},
mouseup: function() {
var theme = jQuery(this).attr( "data-theme" );
jQuery(this).removeClass( "ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
},
"mouseover focus": function() {
var theme = jQuery(this).attr( "data-theme" );
jQuery(this).removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme );
},
"mouseout blur": function() {
var theme = jQuery(this).attr( "data-theme" );
jQuery(this).removeClass( "ui-btn-hover-" + theme ).addClass( "ui-btn-up-" + theme );
}
});

attachEvents = null;
}

})(jQuery);
28 changes: 0 additions & 28 deletions js/jquery.mobile.clickable.js

This file was deleted.

27 changes: 20 additions & 7 deletions js/jquery.mobile.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,32 @@
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
* Note: Code is in draft form and is subject to change
*/
(function($){
$.fn.dialog = function(options){
return $(this).each(function(){
$(this)
(function ( $ ) {
$.widget( "mobile.dialog", $.mobile.widget, {
options: {},
_create: function(){
var $el = this.element,
$closeBtn = $('<a href="#" data-icon="delete" data-iconpos="notext">Close</a>')
.click(function(){
$.changePage([$el, $.activePage], undefined, true );
return false;
});

this.element
.bind("pageshow",function(){
return false;
})
//add ARIA role
.attr("role","dialog")
.addClass('ui-page ui-dialog ui-body-a')
.find('[data-role=header]')
.addClass('ui-corner-top ui-overlay-shadow')
.prepend( $closeBtn )
.end()
.find('.ui-content,[data-role=footer]')
.last()
.addClass('ui-corner-bottom ui-overlay-shadow');
});
};
})(jQuery);

}
});
})( jQuery );
12 changes: 2 additions & 10 deletions js/jquery.mobile.forms.select.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ $.fn.customSelect = function(options){

//extendable options
o = $.extend({
closeText: "close",
chooseText: label.text(),
theme: select.data("theme")
}, options),
Expand All @@ -43,7 +42,6 @@ $.fn.customSelect = function(options){
}),
menuPage = $( "<div data-role='dialog' data-theme='a'>" +
"<div data-role='header' data-theme='b'>" +
"<a href='#' class='ui-btn-left' data-icon='delete' data-iconpos='notext'>"+ o.closeText +"</a>"+
"<div class='ui-title'>" + o.chooseText + "</div>"+
"</div>"+
"<div data-role='content'></div>"+
Expand Down Expand Up @@ -95,7 +93,7 @@ $.fn.customSelect = function(options){
if( menuHeight > window.innerHeight - 80 || !$.support.scrollTop ){
menuType = "page";
menuPageContent.append( list );
$.changePage(thisPage, menuPage, false, false);
$.changePage(menuPage, undefined);
}
else {
menuType = "overlay";
Expand All @@ -119,7 +117,7 @@ $.fn.customSelect = function(options){

function hidemenu(){
if(menuType == "page"){
$.changePage(menuPage, thisPage, false, true);
$.changePage([menuPage,thisPage], undefined, true);
}
else{
screen.addClass( "ui-screen-hidden" );
Expand Down Expand Up @@ -189,12 +187,6 @@ $.fn.customSelect = function(options){
hidemenu();
return false;
});

//menu page back button
menuPage.find( ".ui-btn-left" ).click(function(){
hidemenu();
return false;
});

//hide on outside click
screen.click(function(){
Expand Down
Loading