Skip to content

Commit

Permalink
Updating Metro-UI-CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliusLuneckas committed Aug 29, 2013
1 parent 362a76d commit 7997924
Show file tree
Hide file tree
Showing 21 changed files with 611 additions and 82 deletions.
2 changes: 1 addition & 1 deletion Metro-UI-CSS
Submodule Metro-UI-CSS updated 69 files
+46 −25 CHANGELOG.md
+1 −0 README.md
+11 −3 css/modern-responsive.css
+157 −106 css/modern.css
+11 −0 javascript/contextmenu.js
+122 −22 javascript/dialog.js
+25 −15 javascript/dropdown.js
+7 −0 javascript/pagecontrol.js
+243 −0 javascript/pagelist.js
+2 −2 javascript/slider.js
+22 −10 javascript/tile-drag.js
+21 −5 less/buttons.less
+29 −0 less/contextmenu.less
+20 −2 less/dialog.less
+5 −0 less/forms.less
+1 −1 less/icons.less
+2 −10 less/layout.less
+7 −0 less/modern-responsive-max480.less
+7 −2 less/modern-responsive-max767.less
+3 −1 less/modern.less
+53 −0 less/pagelist.less
+20 −3 less/tiles.less
+762 −0 public/Search.html
+2 −2 public/accordion.php
+47 −0 public/ajax.php
+2 −2 public/buttons-set.php
+2 −2 public/buttons.php
+3 −3 public/cards.php
+2 −2 public/carousel.php
+11 −3 public/css/modern-responsive.css
+159 −106 public/css/modern.css
+50 −9 public/dialog.php
+3 −3 public/forms.php
+6 −3 public/global.php
+3 −3 public/grid.php
+1 −1 public/header.php
+1 −1 public/icons.php
+2 −2 public/images.php
+ public/images/WIN8.png
+ public/images/spface.jpg
+ public/images/vbface.jpg
+5 −5 public/index.php
+2 −2 public/javascript.php
+122 −22 public/js/modern/dialog.js
+25 −15 public/js/modern/dropdown.js
+7 −0 public/js/modern/pagecontrol.js
+243 −0 public/js/modern/pagelist.js
+2 −2 public/js/modern/slider.js
+500 −488 public/js/modern/tile-drag.js
+2 −2 public/layout.php
+2 −2 public/listview.php
+67 −0 public/logon.html
+2 −2 public/menus.php
+2 −0 public/navigation.php
+2 −2 public/notices.php
+2 −2 public/page-secondary.php
+2 −2 public/page.php
+2 −2 public/pagecontrol.php
+44 −0 public/pagelist.php
+1 −0 public/pagelistresult.php
+2 −2 public/progress.php
+2 −2 public/rating.php
+2 −2 public/responsive.php
+48 −3 public/sidebar.php
+2 −2 public/slider.php
+2 −2 public/sponsoring.php
+3 −3 public/tables.php
+57 −4 public/tiles.php
+1 −1 public/typography.php
2 changes: 1 addition & 1 deletion lib/metro/ui/rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Metro
module Ui
module Rails
VERSION = "0.15.8.14"
VERSION = "0.15.8.15
end
end
end
16 changes: 9 additions & 7 deletions vendor/assets/javascripts/metro-ui.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
//= require jquery.mousewheel.min.js
//= require metro-ui/pagecontrol
//= require metro-ui/accordion
//= require metro-ui/buttonset
//= require metro-ui/calendar
//= require metro-ui/tile-drag
//= require metro-ui/dropdown
//= require metro-ui/start-menu
//= require metro-ui/dialog
//= require metro-ui/tile-slider
//= require metro-ui/carousel
//= require metro-ui/buttonset
//= require metro-ui/contextmenu
//= require metro-ui/dialog
//= require metro-ui/dropdown
//= require metro-ui/input-control
//= require metro-ui/pagecontrol
//= require metro-ui/pagelist
//= require metro-ui/rating
//= require metro-ui/slider
//= require metro-ui/start-menu
//= require metro-ui/tile-drag
//= require metro-ui/tile-slider
11 changes: 11 additions & 0 deletions vendor/assets/javascripts/metro-ui/contextmenu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$(function(){
$(".contextmenu").hide();
$(document).on("contextmenu", function(event) {
event.preventDefault();
$(".contextmenu")
.show()
.css({top: event.pageY + "px", left: event.pageX + "px"});
}).on("click", function(event) {
$(".contextmenu").hide();
});
});
144 changes: 122 additions & 22 deletions vendor/assets/javascripts/metro-ui/dialog.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Author: Valerio Battaglia (vabatta)
* Description: Function to create dialog box. You can have a dialog box open at once.
* Version: 1.0a
* Version: 1.1b
*
* Params:
* title - Title of the dialog box (HTML format)
Expand All @@ -9,6 +9,7 @@
* overlay - Set the overlay of the page, available: true, false (default: true)
* closeButton - Enable or disable the close button, available: true, false (default: false)
* buttonsAlign - Align of the buttons, available: left, center, right (default: center)
* keepOpened - Keep the window opened after buttons click, available: true, false (default: false)
* buttons - Set buttons in the action bar (JSON format)
* name - Text of the button (JSON format)
* action - Function to bind to the button
Expand All @@ -17,20 +18,29 @@
* offsetY - Top offset pixels
* offsetX - Left offset pixels
*
* API:
* $.Dialog.content() - Getter or setter for the content of opened dialog (HTML format)
* $.Dialog.title() - Getter or setter for the title of opened dialog (HTML format)
* $.Dialog.buttons() - Setter for the buttons of opened dialog (JSON Format)
* $.Dialog.close() - Close, if any, current dialog box
*
* Goal for next versions:
* Add style param to set custom css to the dialog box controls
* Add possibility to resize window
* Create setup with steps
*/

(function($) {
$.Dialog = function(params) {
if(!$.DialogOpened) {
$.DialogOpened = true;
if(!$.Dialog.opened) {
$.Dialog.opened = true;
} else {
return false;
}

params = $.extend({'position':{'zone':'center'},'overlay':true}, params);
$.Dialog.settings = params;

params = $.extend({ 'position': {'zone': 'center'}, 'overlay': true }, params);

var buttonsHTML = '<div';

Expand All @@ -42,7 +52,7 @@
buttonsHTML += '>';
}

$.each(params.buttons, function(name,obj) {
$.each(params.buttons, function(name, obj) {
// Generating the markup for the buttons

buttonsHTML += '<button>' + name + '</button>';
Expand All @@ -60,9 +70,9 @@

'<div id="dialogOverlay">',
'<div id="dialogBox" class="dialog">',
'<div class="header">',
params.title,
(params.closeButton)?('<div><button class="tool-button"><i class="icon-cancel-2"></i></button></div>'):(''),
'<div class="header"><span>',
params.title,'</span>',
(params.closeButton)?('<div><button><i class="icon-cancel-2"></i></button></div>'):(''),
'</div>',
'<div class="content">', params.content, '</div>',
'<div class="action" id="dialogButtons">',
Expand Down Expand Up @@ -109,44 +119,134 @@
drg_w = $drag.outerWidth(),
pos_y = $drag.offset().top + drg_h - e.pageY,
pos_x = $drag.offset().left + drg_w - e.pageX;

$drag.css('z-index', 99999).parents().on("mousemove", function(e) {
$('.draggable').offset({
top:e.pageY + pos_y - drg_h,
left:e.pageX + pos_x - drg_w
}).on("mouseup", function() {
var t = (e.pageY > 0)?(e.pageY + pos_y - drg_h):(0);
var l = (e.pageX > 0)?(e.pageX + pos_x - drg_w):(0);

if(t >= 0 && t <= window.innerHeight) {
$('.draggable').offset({top: t});
}
if(l >= 0 && l <= window.innerWidth) {
$('.draggable').offset({left: l});
}

$('.draggable').on("mouseup", function() {
$(this).removeClass('draggable').css('z-index', z_idx);
});
});
e.preventDefault(); // disable selection
// disable selection

e.preventDefault();
}).on("mouseup", function() {
$(this).removeClass('active-handle').parent().removeClass('draggable');
});
}

$('#dialogBox .header button').click(function() {
// Bind close button to hide dialog
// Bind close button to close dialog

$.Dialog.hide();
$.Dialog.close();
return false;
});

var buttons = $('#dialogBox .action button'),
i = 0;

$.each(params.buttons,function(name,obj){
buttons.eq(i++).click(function(){
// Calling function and hide the dialog
$.each(params.buttons, function(name, obj) {
buttons.eq(i++).click(function() {
// Calling function and close the dialog

var result = obj.action();
if(!params.keepOpened || result != false) {
$.Dialog.close();
return false;
}
});
});
}

$.Dialog.content = function(newContent) {
// Prevent using function without dialog opened
if(!$.Dialog.opened) {
return false;
}

if(newContent) {
$('#dialogBox .content').html(newContent);
} else {
return $('#dialogBox .content').html();
}
}

$.Dialog.title = function(newTitle) {
// Prevent using function without dialog opened
if(!$.Dialog.opened) {
return false;
}

if(newTitle) {
$('#dialogBox .header span').html(newTitle);
} else {
return $('#dialogBox .header span').html();
}
}

$.Dialog.buttons = function(newButtons) {
// Prevent using function without dialog opened or no params
if(!$.Dialog.opened || !newButtons) {
return false;
}

var buttonsHTML = '<div';

// Buttons position
if($.Dialog.settings.buttonsAlign)
{
buttonsHTML += ' style=" float: ' + $.Dialog.settings.buttonsAlign + ';">';
} else {
buttonsHTML += '>';
}

$.each(newButtons, function(name, obj) {
// Generating the markup for the buttons

buttonsHTML += '<button>' + name + '</button>';

if(!obj.action)
{
obj.action = function() {};
}
});

buttonsHTML += '</div>';

$('#dialogButtons').html(buttonsHTML);

var buttons = $('#dialogBox .action button'),
i = 0;

$.each(newButtons, function(name, obj) {
buttons.eq(i++).click(function() {
// Calling function and close the dialog

obj.action();
$.Dialog.hide();
if(!$.Dialog.settings.keepOpened) {
$.Dialog.close();
}
return false;
});
});
}

$.Dialog.hide = function(){
$('#dialogOverlay').fadeOut(function(){
$.DialogOpened = false;
$.Dialog.close = function() {
// Prevent using function without dialog opened
if(!$.Dialog.opened) {
return false;
}

$('#dialogOverlay').fadeOut(function() {
$.Dialog.opened = false;
$(this).remove();
});
}
Expand Down
40 changes: 25 additions & 15 deletions vendor/assets/javascripts/metro-ui/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,26 @@
$(this).slideUp('fast', function(){});
$(this).parent().removeClass("active");
});
}
};

var initSelectors = function(selectors){
selectors.on('click', function(e){
e.stopPropagation();
selectors.off("click.dropdown");
selectors.on('click.dropdown', function(e){
//e.stopPropagation();
//$("[data-role=dropdown]").removeClass("active");
if($(e.originalEvent.target).parent().is("[data-role]")) e.stopPropagation();

clearDropdown();
$(this).parents("ul").css("overflow", "visible");

var $m = $(this).children(".dropdown-menu, .sidebar-dropdown-menu");
$(this).parents("ul").children(".dropdown").children(".dropdown-menu, .sidebar-dropdown-menu").each(function(){
if(!$(this).hasClass("keep-opened") && !$m.hasClass("keep-opened")) {
$(this).slideUp('fast');
$(this).parents("li").removeClass("active");
}
});

if ($m.css('display') == "block") {
$m.slideUp('fast');
$(this).removeClass("active");
Expand All @@ -34,24 +43,25 @@
//$(this).children(".dropdown-menu").hide();
});
$('html').on("click", function(e){
clearDropdown();
if(e.originalEvent && $(e.originalEvent.target).parents('[data-role="dropdown"]').length == 0)
clearDropdown();
});
}
};

return this.each(function(){
if ( options ) {
$.extend(defaults, options)
$.extend(defaults, options);
}

initSelectors($this);
});
}
};

$(function () {
$('[data-role="dropdown"]').each(function () {
$(this).Dropdown();
})
})
});
});
})(window.jQuery);


Expand All @@ -76,20 +86,20 @@
}
//$(this).toggleClass("active");
});
}
};

return this.each(function(){
if ( options ) {
$.extend(defaults, options)
$.extend(defaults, options);
}

initSelectors($this);
});
}
};

$(function () {
$('.pull-menu, .menu-pull').each(function () {
$(this).PullDown();
})
})
})(window.jQuery);
});
});
})(window.jQuery);
7 changes: 7 additions & 0 deletions vendor/assets/javascripts/metro-ui/pagecontrol.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
;

var initSelectors = function(selectors){
$.each(selectors, function(i, s){
if ($(s).parent("li").hasClass("active")) {
var target = $(s).attr("href");
$(target).show();
}
})

selectors.on('click', function(e){
e.preventDefault();
var $a = $(this);
Expand Down
Loading

0 comments on commit 7997924

Please sign in to comment.