From f951a224d89634461a115c48cc43ae170461e5d5 Mon Sep 17 00:00:00 2001 From: nipos Date: Tue, 22 May 2018 19:00:08 +0200 Subject: [PATCH] Fixed Pleroma compatibility problems,text inputs now autoresizable,stopped undefined socket tries on profile pages --- README.md | 7 ++++--- assets/css/style.css | 7 +++---- assets/js/autosize/LICENSE | 21 +++++++++++++++++++++ assets/js/autosize/autosize.js | 6 ++++++ assets/js/halcyon/halcyonUI.js | 11 +++++++++-- assets/js/mastodon.js/mastodon.js | 2 ++ header.php | 3 ++- local.php | 6 +++--- version.txt | 2 +- 9 files changed, 51 insertions(+), 14 deletions(-) create mode 100644 assets/js/autosize/LICENSE create mode 100644 assets/js/autosize/autosize.js diff --git a/README.md b/README.md index e278821..9a8fadd 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,17 @@ Follow or Mastodon account and never miss an important update: [@halcyon@social. ## Instances These instances are publicly accessible and usable by everyone, no matter which Mastodon instance you use. -- https://halcyon.toromino.de - 1.1.6 -- https://social.dev-wiki.de - 1.1.6 +- https://social.dev-wiki.de - 1.1.7 +- https://halcyon.toromino.de - 1.1.7 +- https://itter.photog.social - 1.1.6 - https://halcyon.bka.li - 1.1.5 -- https://itter.photog.social - 1.1.5 - https://halcyon.tilde.team - 1.1.3 - https://halcyon.cybre.space - Outdated You have your own Halcyon instance and want it to be listed here? Create an issue with the link and we will add it to the list. ## Blog +- Release of Version 1.1.7 - Fixed some bugs in compatibility with Pleroma,text fields now autoresizable,stopped undefined socket tries on profile pages - Release of Version 1.1.6 - Complete rewrite of the "who to follow" function using an API - Change of config.ini needed! - Release of Version 1.1.5 - Introduced the new Idempotency-Key Header and fixed an bug allowing XSS with the display name - Release of Version 1.1.4 - Automatically reconnect on bad connection,now supports desktop notifications,added ... at the end of shortened links diff --git a/assets/css/style.css b/assets/css/style.css index 13bd023..5d7f333 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -177,10 +177,9 @@ border-radius: 3px; box-sizing: border-box; border: 1px solid #C7E7FB; background-color: #fff; -overflow: hidden; } .status_form .status_main .status_textarea textarea { -color: #189EFC; +color: #000; resize: none; height: 18px; border: none; @@ -188,10 +187,10 @@ max-width: 100%; font-size: 14px; font-family : "Helvetica Neue",Helvetica,Arial,sans-serif; line-height: normal; +outline: 0; +overflow: hidden; } .status_form .status_textarea textarea.focus { -outline: 0; -color: #000; height: 68px; } .status_form .status_textarea .media_attachments_preview_area { diff --git a/assets/js/autosize/LICENSE b/assets/js/autosize/LICENSE new file mode 100644 index 0000000..e3395f7 --- /dev/null +++ b/assets/js/autosize/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jack Moore + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/assets/js/autosize/autosize.js b/assets/js/autosize/autosize.js new file mode 100644 index 0000000..efb5bd8 --- /dev/null +++ b/assets/js/autosize/autosize.js @@ -0,0 +1,6 @@ +/*! +autosize 4.0.2 +license: MIT +http://www.jacklmoore.com/autosize +*/ +!function(e,t){if("function"==typeof define&&define.amd)define(["module","exports"],t);else if("undefined"!=typeof exports)t(module,exports);else{var n={exports:{}};t(n,n.exports),e.autosize=n.exports}}(this,function(e,t){"use strict";var n,o,p="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return-1 i').attr('class', "fa fa-" + picon); $('#overlay_status_form .character_count').html(current_instance_charlimit); @@ -1947,6 +1950,7 @@ $('#header_status_form .submit_status_label').removeClass('active_submit_button' $('#header_status_form .expand_privacy_menu').addClass('invisible'); $('#header_status_form .status_textarea textarea').removeClass('focus'); $('#header_status_form .status_bottom').addClass('invisible'); +autosize.destroy($('#header_status_form .status_textarea textarea')); } }); $(document).on('change keyup','#header_status_form textarea, #header_status_form .status_spoiler', function(e) { @@ -1992,6 +1996,7 @@ if(!$('#header_status_form .status_textarea textarea').hasClass('focus')) { $('#header_status_form input[name="privacy_option"]').val([localStorage.getItem("setting_post_privacy")]); $('#header_status_form .expand_privacy_menu_button > i').attr('class', "fa fa-" + picon); $('#header_status_form .status_textarea textarea').addClass('focus'); +autosize($('#header_status_form .status_textarea textarea')); $('#header_status_form .status_bottom').removeClass('invisible'); $('#header_status_form .submit_status_label').addClass('active_submit_button'); $('#header_status_form .character_count').html(current_instance_charlimit); @@ -2089,6 +2094,7 @@ $('#reply_status_form .submit_status_label').removeClass('active_submit_button') $(document).on('click','#reply_status_form', function(e) { if(!$('#reply_status_form .status_textarea textarea').hasClass('focus')) { $('#reply_status_form .status_textarea textarea').addClass('focus'); +autosize($('#reply_status_form .status_textarea textarea')); $('#reply_status_form .status_bottom').removeClass('invisible'); $('#reply_status_form .submit_status_label').addClass('active_submit_button'); $('#reply_status_form textarea').val("@"+$('#reply_status_form').attr('username')+" "); @@ -2239,7 +2245,8 @@ $('#js-overlay_content_wrap').addClass('view'); $('#js-overlay_content_wrap').addClass('black_08'); $('.single_reply_status .submit_status_label').addClass('active_submit_button'); $('#single_reply_status_form .status_textarea textarea').addClass('focus'); -$('#single_reply_status_form .status_textarea textarea').focus() +$('#single_reply_status_form .status_textarea textarea').focus(); +autosize($('#single_reply_status_form .status_textarea textarea')); $('#single_reply_status_form input[name="privacy_option"]').val([privacy_mode]); $('#single_reply_status_form .expand_privacy_menu_button > i').attr('class', "fa fa-" + picon); $('#single_reply_status_form').attr('tid',sid); diff --git a/assets/js/mastodon.js/mastodon.js b/assets/js/mastodon.js/mastodon.js index 8a34e78..974dab6 100644 --- a/assets/js/mastodon.js/mastodon.js +++ b/assets/js/mastodon.js/mastodon.js @@ -253,9 +253,11 @@ stream: function (streamType, onData) { var es = new WebSocket("wss://" + apiBase.substr(8) + "streaming?access_token=" + config.api_user_token + "&stream=" + streamType); var listener = function (event) { console.log("Got Data from Stream " + streamType); +if(event.data.length != 0) { event = JSON.parse(event.data); event.payload = JSON.parse(event.payload); onData(event); +} }; es.onmessage = listener; es.onclose = function() { diff --git a/header.php b/header.php index f6d20c3..09e3202 100644 --- a/header.php +++ b/header.php @@ -12,6 +12,7 @@ + @@ -122,4 +123,4 @@ resetApp(); - \ No newline at end of file + diff --git a/local.php b/local.php index ddb5013..7400664 100644 --- a/local.php +++ b/local.php @@ -34,11 +34,11 @@ if ( localStorage.getItem("setting_local_instance") === "default" | localStorage.getItem("setting_local_instance") === current_instance ) { -setTimeline("timelines/public", [{name:"local",data:"ture"}]); +setTimeline("timelines/public", [{name:"local",data:"true"}]); } else { -setOtherTimeline(localStorage.getItem("setting_local_instance")+"/api/v1/", [{name:"local",data:"ture"}]); +setOtherTimeline(localStorage.getItem("setting_local_instance")+"/api/v1/", [{name:"local",data:"true"}]); } $("#local_nav").addClass('view'); $('title').text('Halcyon / Local'); - \ No newline at end of file + diff --git a/version.txt b/version.txt index 0664a8f..2bf1ca5 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.1.6 +1.1.7