From 8924f94d05fcbe6a34bb46d7bb4b2ba63ac78da2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 16 Jun 2016 12:21:59 +0200 Subject: show month view in full height in fullscreen view --- view/js/mod_cal.js | 22 ++++++++++++++++++++++ view/js/mod_events.js | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 view/js/mod_cal.js (limited to 'view/js') diff --git a/view/js/mod_cal.js b/view/js/mod_cal.js new file mode 100644 index 000000000..0bf97fcf7 --- /dev/null +++ b/view/js/mod_cal.js @@ -0,0 +1,22 @@ +/** + * JavaScript for mod/cal + */ + +$(document).ready( function() { + $(document).on('click','#fullscreen-btn', on_fullscreen); + $(document).on('click','#inline-btn', on_inline); +}); + +function on_fullscreen() { + var view = $('#events-calendar').fullCalendar('getView'); + if(view.type === 'month') { + $('#events-calendar').fullCalendar('option', 'height', $(window).height() - $('.section-title-wrapper').outerHeight(true) - 2); // -2 is for border width (top and bottom) of .generic-content-wrapper + } +} + +function on_inline() { + var view = $('#events-calendar').fullCalendar('getView'); + if(view.type === 'month') { + $('#events-calendar').fullCalendar('option', 'height', 'auto'); + } +} diff --git a/view/js/mod_events.js b/view/js/mod_events.js index 74b811dd6..e67890b47 100644 --- a/view/js/mod_events.js +++ b/view/js/mod_events.js @@ -5,11 +5,29 @@ $(document).ready( function() { enableDisableFinishDate(); $('#comment-edit-text-desc, #comment-edit-text-loc').bbco_autocomplete('bbcode'); + + $(document).on('click','#fullscreen-btn', on_fullscreen); + $(document).on('click','#inline-btn', on_inline); }); + function enableDisableFinishDate() { if( $('#id_nofinish').is(':checked')) $('#id_finish_text').prop("disabled", true); else $('#id_finish_text').prop("disabled", false); } + +function on_fullscreen() { + var view = $('#events-calendar').fullCalendar('getView'); + if(view.type === 'month') { + $('#events-calendar').fullCalendar('option', 'height', $(window).height() - $('.section-title-wrapper').outerHeight(true) - 2); // -2 is for border width (top and bottom) of .generic-content-wrapper + } +} + +function on_inline() { + var view = $('#events-calendar').fullCalendar('getView'); + if(view.type === 'month') { + $('#events-calendar').fullCalendar('option', 'height', 'auto'); + } +} -- cgit v1.2.3 From aa5ac9dc3fb81bdc8aa17567eed42e845c408d00 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 17 Jun 2016 11:57:36 +0200 Subject: only use height: auto for week and day view --- view/js/mod_cal.js | 2 +- view/js/mod_events.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'view/js') diff --git a/view/js/mod_cal.js b/view/js/mod_cal.js index 0bf97fcf7..5867f676e 100644 --- a/view/js/mod_cal.js +++ b/view/js/mod_cal.js @@ -17,6 +17,6 @@ function on_fullscreen() { function on_inline() { var view = $('#events-calendar').fullCalendar('getView'); if(view.type === 'month') { - $('#events-calendar').fullCalendar('option', 'height', 'auto'); + $('#events-calendar').fullCalendar('option', 'height', ''); } } diff --git a/view/js/mod_events.js b/view/js/mod_events.js index e67890b47..66cf81ddd 100644 --- a/view/js/mod_events.js +++ b/view/js/mod_events.js @@ -28,6 +28,6 @@ function on_fullscreen() { function on_inline() { var view = $('#events-calendar').fullCalendar('getView'); if(view.type === 'month') { - $('#events-calendar').fullCalendar('option', 'height', 'auto'); + $('#events-calendar').fullCalendar('option', 'height', ''); } } -- cgit v1.2.3 From 7a4efcf67f57d6437af5596ad99920c1793cf450 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 19 Jun 2016 20:34:38 +0200 Subject: return something so we can make a conclusion --- view/js/main.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index f279417d9..2caf5a1dd 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -941,6 +941,11 @@ function dropItem(url, object) { $('body').css('cursor', 'auto'); }); }); + return true; + + } + else { + return false; } } -- cgit v1.2.3 From 7371e0862543922b65eac920e128ca4ef1348b13 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 1 Jul 2016 12:21:19 +0200 Subject: ditch the change_view widget and make header fixed in fullscreen mode --- view/js/mod_events.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'view/js') diff --git a/view/js/mod_events.js b/view/js/mod_events.js index 66cf81ddd..a507a84d7 100644 --- a/view/js/mod_events.js +++ b/view/js/mod_events.js @@ -19,15 +19,10 @@ function enableDisableFinishDate() { } function on_fullscreen() { - var view = $('#events-calendar').fullCalendar('getView'); - if(view.type === 'month') { - $('#events-calendar').fullCalendar('option', 'height', $(window).height() - $('.section-title-wrapper').outerHeight(true) - 2); // -2 is for border width (top and bottom) of .generic-content-wrapper - } + $('#events-calendar').fullCalendar('option', 'height', $(window).height() - $('.section-title-wrapper').outerHeight(true) - 2); // -2 is for border width (.generic-content-wrapper top and bottom) of .generic-content-wrapper } function on_inline() { var view = $('#events-calendar').fullCalendar('getView'); - if(view.type === 'month') { - $('#events-calendar').fullCalendar('option', 'height', ''); - } + ((view.type === 'month') ? $('#events-calendar').fullCalendar('option', 'height', '') : $('#events-calendar').fullCalendar('option', 'height', 'auto')); } -- cgit v1.2.3 From f60a0c5ce050febb0b200938eb51d88cf563b88f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 13 Jul 2016 17:51:19 -0700 Subject: document mod_acl a bit better and try to remove some redundancies and consolidate the various options --- view/js/autocomplete.js | 2 +- view/js/mod_mail.js | 2 +- view/js/mod_photos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'view/js') diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index 59a9ed355..63f1e9a13 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -1,5 +1,5 @@ /** - * Red people autocomplete + * general autocomplete support * * require jQuery, jquery.textcomplete */ diff --git a/view/js/mod_mail.js b/view/js/mod_mail.js index 3e55c8aeb..46574a63d 100644 --- a/view/js/mod_mail.js +++ b/view/js/mod_mail.js @@ -1,5 +1,5 @@ $(document).ready(function() { - $("#recip").name_autocomplete(baseurl + '/acl', '', false, function(data) { + $("#recip").name_autocomplete(baseurl + '/acl', 'm', false, function(data) { $("#recip-complete").val(data.xid); }); $(".autotime").timeago() diff --git a/view/js/mod_photos.js b/view/js/mod_photos.js index 006be5f23..e3df3ca68 100644 --- a/view/js/mod_photos.js +++ b/view/js/mod_photos.js @@ -3,7 +3,7 @@ */ $(document).ready(function() { - $("#photo-edit-newtag").contact_autocomplete(baseurl + '/acl', 'p', false, function(data) { + $("#photo-edit-newtag").contact_autocomplete(baseurl + '/acl', 'a', false, function(data) { $("#photo-edit-newtag").val('@' + data.name); }); -- cgit v1.2.3 From 2e32b5f467e9bb66e339c56308ad8a82163566e6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 15 Jul 2016 13:20:00 +0200 Subject: upgrade to jquery-3.1 and minor fixes --- view/js/jquery-migrate-1.1.1.js | 511 ---------------------------------------- view/js/jquery.js | 8 +- view/js/main.js | 9 +- 3 files changed, 9 insertions(+), 519 deletions(-) delete mode 100644 view/js/jquery-migrate-1.1.1.js (limited to 'view/js') diff --git a/view/js/jquery-migrate-1.1.1.js b/view/js/jquery-migrate-1.1.1.js deleted file mode 100644 index e99f954e6..000000000 --- a/view/js/jquery-migrate-1.1.1.js +++ /dev/null @@ -1,511 +0,0 @@ -/*! - * jQuery Migrate - v1.1.1 - 2013-02-16 - * https://github.com/jquery/jquery-migrate - * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT - */ -(function( jQuery, window, undefined ) { -// See http://bugs.jquery.com/ticket/13335 -// "use strict"; - - -var warnedAbout = {}; - -// List of warnings already given; public read only -jQuery.migrateWarnings = []; - -// Set to true to prevent console output; migrateWarnings still maintained -// jQuery.migrateMute = false; - -// Show a message on the console so devs know we're active -if ( !jQuery.migrateMute && window.console && console.log ) { - console.log("JQMIGRATE: Logging is active"); -} - -// Set to false to disable traces that appear with warnings -if ( jQuery.migrateTrace === undefined ) { - jQuery.migrateTrace = true; -} - -// Forget any warnings we've already given; public -jQuery.migrateReset = function() { - warnedAbout = {}; - jQuery.migrateWarnings.length = 0; -}; - -function migrateWarn( msg) { - if ( !warnedAbout[ msg ] ) { - warnedAbout[ msg ] = true; - jQuery.migrateWarnings.push( msg ); - if ( window.console && console.warn && !jQuery.migrateMute ) { - console.warn( "JQMIGRATE: " + msg ); - if ( jQuery.migrateTrace && console.trace ) { - console.trace(); - } - } - } -} - -function migrateWarnProp( obj, prop, value, msg ) { - if ( Object.defineProperty ) { - // On ES5 browsers (non-oldIE), warn if the code tries to get prop; - // allow property to be overwritten in case some other plugin wants it - try { - Object.defineProperty( obj, prop, { - configurable: true, - enumerable: true, - get: function() { - migrateWarn( msg ); - return value; - }, - set: function( newValue ) { - migrateWarn( msg ); - value = newValue; - } - }); - return; - } catch( err ) { - // IE8 is a dope about Object.defineProperty, can't warn there - } - } - - // Non-ES5 (or broken) browser; just set the property - jQuery._definePropertyBroken = true; - obj[ prop ] = value; -} - -if ( document.compatMode === "BackCompat" ) { - // jQuery has never supported or tested Quirks Mode - migrateWarn( "jQuery is not compatible with Quirks Mode" ); -} - - -var attrFn = jQuery( "", { size: 1 } ).attr("size") && jQuery.attrFn, - oldAttr = jQuery.attr, - valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get || - function() { return null; }, - valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set || - function() { return undefined; }, - rnoType = /^(?:input|button)$/i, - rnoAttrNodeType = /^[238]$/, - rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - ruseDefault = /^(?:checked|selected)$/i; - -// jQuery.attrFn -migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" ); - -jQuery.attr = function( elem, name, value, pass ) { - var lowerName = name.toLowerCase(), - nType = elem && elem.nodeType; - - if ( pass ) { - // Since pass is used internally, we only warn for new jQuery - // versions where there isn't a pass arg in the formal params - if ( oldAttr.length < 4 ) { - migrateWarn("jQuery.fn.attr( props, pass ) is deprecated"); - } - if ( elem && !rnoAttrNodeType.test( nType ) && - (attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) { - return jQuery( elem )[ name ]( value ); - } - } - - // Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking - // for disconnected elements we don't warn on $( "