From: Marius Gavrilescu Date: Sun, 8 Mar 2015 10:17:15 +0000 (+0200) Subject: Merge branch 'master' into newmc X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=e892a76a1aed693d33fba7f0015f42824ecf4dbb;hp=2ca77f50fce7c0cc299359a766058240255941f5;p=gruntmaster-page.git Merge branch 'master' into newmc Conflicts: Makefile.PL make_static.PL --- diff --git a/MANIFEST b/MANIFEST index 3ab2474..8c47140 100644 --- a/MANIFEST +++ b/MANIFEST @@ -13,7 +13,6 @@ css/themes/cyborg.css css/themes/readable.css css/themes/slate.css js/00-zepto.js -js/01-zepto-jquery.js js/10-bootstrap-modal.js js/20-sprintf.js js/80-sidebar.js diff --git a/Makefile.PL b/Makefile.PL index c6d91a7..2b025b1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -10,7 +10,7 @@ WriteMakefile( LICENSE => 'AGPL_3', SIGN => 1, clean => { - FILES => 'static/css/ static/js.js css/logos.css static/logos.png' + FILES => 'static/css/ static/js.js css/logos.css static/logos.png static/js.map static/js/' }, BUILD_REQUIRES => { qw/CSS::Minifier::XS 0 diff --git a/css/themes/cyborg.css b/css/themes/cyborg.css index dc80cd2..5d80614 100644 --- a/css/themes/cyborg.css +++ b/css/themes/cyborg.css @@ -1896,6 +1896,31 @@ tbody.collapse.in { padding: 9px; border-radius: 3px; } +.close { + float: right; + font-size: 21px; + font-weight: bold; + line-height: 1; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} +.close:hover, +.close:focus { + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.5; + filter: alpha(opacity=50); +} +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} .modal-open { overflow: hidden; } diff --git a/css/themes/readable.css b/css/themes/readable.css index 2de3950..14c47d6 100644 --- a/css/themes/readable.css +++ b/css/themes/readable.css @@ -1896,6 +1896,31 @@ tbody.collapse.in { padding: 9px; border-radius: 3px; } +.close { + float: right; + font-size: 24px; + font-weight: bold; + line-height: 1; + color: #ffffff; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} +.close:hover, +.close:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; + opacity: 0.5; + filter: alpha(opacity=50); +} +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} .modal-open { overflow: hidden; } diff --git a/css/themes/slate.css b/css/themes/slate.css index ddd8dc9..7e9ac71 100644 --- a/css/themes/slate.css +++ b/css/themes/slate.css @@ -1896,6 +1896,31 @@ tbody.collapse.in { padding: 9px; border-radius: 3px; } +.close { + float: right; + font-size: 21px; + font-weight: bold; + line-height: 1; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} +.close:hover, +.close:focus { + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.5; + filter: alpha(opacity=50); +} +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} .modal-open { overflow: hidden; } diff --git a/js/00-zepto.js b/js/00-zepto.js index aa969f9..76726cd 100644 --- a/js/00-zepto.js +++ b/js/00-zepto.js @@ -1,4 +1,4 @@ -/* Zepto v1.1.4-13-geba5344 - zepto event data ie - zeptojs.com/license */ +/* Zepto v1.1.4-80-ga9184b2 - zepto event data ie - zeptojs.com/license */ var Zepto = (function() { var undefined, key, $, classList, emptyArray = [], concat = emptyArray.concat, filter = emptyArray.filter, slice = emptyArray.slice, @@ -254,11 +254,11 @@ var Zepto = (function() { maybeClass = !maybeID && selector[0] == '.', nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked isSimple = simpleSelectorRE.test(nameOnly) - return (isDocument(element) && isSimple && maybeID) ? + return (element.getElementById && isSimple && maybeID) ? // Safari DocumentFragment doesn't have getElementById ( (found = element.getElementById(nameOnly)) ? [found] : [] ) : - (element.nodeType !== 1 && element.nodeType !== 9) ? [] : + (element.nodeType !== 1 && element.nodeType !== 9 && element.nodeType !== 11) ? [] : slice.call( - isSimple && !maybeID ? + isSimple && !maybeID && element.getElementsByClassName ? // DocumentFragment doesn't have getElementsByClassName/TagName maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class element.getElementsByTagName(selector) : // Or a tag element.querySelectorAll(selector) // Or it's not simple, and we need to query all @@ -305,13 +305,12 @@ var Zepto = (function() { // JSON => parse if valid // String => self function deserializeValue(value) { - var num try { return value ? value == "true" || ( value == "false" ? false : value == "null" ? null : - !/^0/.test(value) && !isNaN(num = Number(value)) ? num : + +value + "" == value ? +value : /^[\[\{]/.test(value) ? $.parseJSON(value) : value ) : value @@ -345,6 +344,7 @@ var Zepto = (function() { $.uuid = 0 $.support = { } $.expr = { } + $.noop = function() {} $.map = function(elements, callback){ var value, values = [], i, key @@ -490,7 +490,7 @@ var Zepto = (function() { }, find: function(selector){ var result, $this = this - if (!selector) result = [] + if (!selector) result = $() else if (typeof selector == 'object') result = $(selector).filter(function(){ var node = this @@ -527,7 +527,7 @@ var Zepto = (function() { return filtered(this.map(function(){ return children(this) }), selector) }, contents: function() { - return this.map(function() { return slice.call(this.childNodes) }) + return this.map(function() { return this.contentDocument || slice.call(this.childNodes) }) }, siblings: function(selector){ return filtered(this.map(function(i, el){ @@ -676,6 +676,8 @@ var Zepto = (function() { $this.css(props) }) if (!this.length) return null + if (!$.contains(document.documentElement, this[0])) + return {top: 0, left: 0} var obj = this[0].getBoundingClientRect() return { left: obj.left + window.pageXOffset, @@ -686,8 +688,9 @@ var Zepto = (function() { }, css: function(property, value){ if (arguments.length < 2) { - var element = this[0], computedStyle = getComputedStyle(element, '') + var computedStyle, element = this[0] if(!element) return + computedStyle = getComputedStyle(element, '') if (typeof property == 'string') return element.style[camelize(property)] || computedStyle.getPropertyValue(property) else if (isArray(property)) { @@ -1078,7 +1081,7 @@ window.$ === undefined && (window.$ = Zepto) if (!isString(selector) && !isFunction(callback) && callback !== false) callback = data, data = selector, selector = undefined - if (isFunction(data) || data === false) + if (callback === undefined || data === false) callback = data, data = undefined if (callback === false) callback = returnFalse @@ -1123,8 +1126,10 @@ window.$ === undefined && (window.$ = Zepto) event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event) event._args = args return this.each(function(){ + // handle focus(), blur() by calling them directly + if (event.type in focus && typeof this[event.type] == "function") this[event.type]() // items in the collection might not be DOM elements - if('dispatchEvent' in this) this.dispatchEvent(event) + else if ('dispatchEvent' in this) this.dispatchEvent(event) else $(this).triggerHandler(event, args) }) } @@ -1146,27 +1151,16 @@ window.$ === undefined && (window.$ = Zepto) } // shortcut methods for `.bind(event, fn)` for each event type - ;('focusin focusout load resize scroll unload click dblclick '+ + ;('focusin focusout focus blur load resize scroll unload click dblclick '+ 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+ 'change select keydown keypress keyup error').split(' ').forEach(function(event) { $.fn[event] = function(callback) { - return callback ? + return (0 in arguments) ? this.bind(event, callback) : this.trigger(event) } }) - ;['focus', 'blur'].forEach(function(name) { - $.fn[name] = function(callback) { - if (callback) this.bind(name, callback) - else this.each(function(){ - try { this[name]() } - catch(e) {} - }) - return this - } - }) - $.Event = function(type, props) { if (!isString(type)) props = type, type = props.type var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true diff --git a/js/01-zepto-jquery.js b/js/01-zepto-jquery.js deleted file mode 100644 index 1fe7da3..0000000 --- a/js/01-zepto-jquery.js +++ /dev/null @@ -1 +0,0 @@ -jQuery = Zepto; diff --git a/js/10-bootstrap-modal.js b/js/10-bootstrap-modal.js index 93891aa..7381296 100644 --- a/js/10-bootstrap-modal.js +++ b/js/10-bootstrap-modal.js @@ -1,8 +1,8 @@ /* ======================================================================== - * Bootstrap: modal.js v3.3.1 + * Bootstrap: modal.js v3.3.2 * http://getbootstrap.com/javascript/#modals * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -30,7 +30,7 @@ } } - Modal.VERSION = '3.3.1' + Modal.VERSION = '3.3.2' Modal.TRANSITION_DURATION = 300 Modal.BACKDROP_TRANSITION_DURATION = 150 @@ -321,4 +321,4 @@ Plugin.call($target, option, this) }) -}(jQuery); +}(Zepto); diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index 00f9b0f..f32c606 100644 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@ -153,7 +153,7 @@ sub dispatch_request{ }, sub (/pb/ + ?:owner~&:contest~&:private~) { forbid $_{private}; - forbid contest->is_pending; + forbid contest && contest->is_pending; response pb => 'Problems', db->problem_list(%_) }, diff --git a/make_static.PL b/make_static.PL index 5594f75..01c6125 100644 --- a/make_static.PL +++ b/make_static.PL @@ -39,9 +39,16 @@ for () { write_file "static/css/$theme.css", CSS::Minifier::XS::minify $css; } -my $js; -$js .= read_file $_ for ; -write_file 'static/js.js', JavaScript::Minifier::XS::minify $js; +if (-f 'compiler.jar') { + system java => -jar => 'compiler.jar', qw,-O SIMPLE --create_source_map static/js.map --js_output_file static/js.js --language_in ECMASCRIPT5_STRICT --source_map_location_mapping js/|/static/js/,, ; + my $js = read_file 'static/js.js'; + write_file 'static/js.js', '//# sourceMappingURL=/static/js.map', "\n", $js; + system 'cp', '-rp', 'js', 'static/'; +} else { + my $js; + $js .= read_file $_ for ; + write_file 'static/js.js', JavaScript::Minifier::XS::minify $js; +} package Local::CSS::SpriteMaker;