Fixed Pleroma compatibility problems,text inputs now autoresizable,stopped undefined socket tries on profile pages

This commit is contained in:
nipos 2018-05-22 19:00:08 +02:00
parent 523c1fab2f
commit f951a224d8
9 changed files with 51 additions and 14 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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.

View File

@ -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<n.indexOf(e)},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);-1<t&&(n.splice(t,1),o.splice(t,1))}}),c=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){c=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function r(r){if(r&&r.nodeName&&"TEXTAREA"===r.nodeName&&!p.has(r)){var e,n=null,o=null,i=null,d=function(){r.clientWidth!==o&&a()},l=function(t){window.removeEventListener("resize",d,!1),r.removeEventListener("input",a,!1),r.removeEventListener("keyup",a,!1),r.removeEventListener("autosize:destroy",l,!1),r.removeEventListener("autosize:update",a,!1),Object.keys(t).forEach(function(e){r.style[e]=t[e]}),p.delete(r)}.bind(r,{height:r.style.height,resize:r.style.resize,overflowY:r.style.overflowY,overflowX:r.style.overflowX,wordWrap:r.style.wordWrap});r.addEventListener("autosize:destroy",l,!1),"onpropertychange"in r&&"oninput"in r&&r.addEventListener("keyup",a,!1),window.addEventListener("resize",d,!1),r.addEventListener("input",a,!1),r.addEventListener("autosize:update",a,!1),r.style.overflowX="hidden",r.style.wordWrap="break-word",p.set(r,{destroy:l,update:a}),"vertical"===(e=window.getComputedStyle(r,null)).resize?r.style.resize="none":"both"===e.resize&&(r.style.resize="horizontal"),n="content-box"===e.boxSizing?-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)):parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth),isNaN(n)&&(n=0),a()}function s(e){var t=r.style.width;r.style.width="0px",r.offsetWidth,r.style.width=t,r.style.overflowY=e}function u(){if(0!==r.scrollHeight){var e=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(r),t=document.documentElement&&document.documentElement.scrollTop;r.style.height="",r.style.height=r.scrollHeight+n+"px",o=r.clientWidth,e.forEach(function(e){e.node.scrollTop=e.scrollTop}),t&&(document.documentElement.scrollTop=t)}}function a(){u();var e=Math.round(parseFloat(r.style.height)),t=window.getComputedStyle(r,null),n="content-box"===t.boxSizing?Math.round(parseFloat(t.height)):r.offsetHeight;if(n<e?"hidden"===t.overflowY&&(s("scroll"),u(),n="content-box"===t.boxSizing?Math.round(parseFloat(window.getComputedStyle(r,null).height)):r.offsetHeight):"hidden"!==t.overflowY&&(s("hidden"),u(),n="content-box"===t.boxSizing?Math.round(parseFloat(window.getComputedStyle(r,null).height)):r.offsetHeight),i!==n){i=n;var o=c("autosize:resized");try{r.dispatchEvent(o)}catch(e){}}}}function i(e){var t=p.get(e);t&&t.destroy()}function d(e){var t=p.get(e);t&&t.update()}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return r(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],d),e}),t.default=l,e.exports=t.default});

View File

@ -1395,6 +1395,7 @@ scope = "federated";
}
let statuses = [];
const original_title = $('title').text();
if(streamscope) {
api.stream(streamscope, function(userstream) {
if (userstream.event === "update") {
const streaming_option = localStorage.getItem("setting_post_stream");
@ -1425,6 +1426,7 @@ replace_emoji();
}
}
});
}
$(document).on('click','#js-stream_update', function(e) {
$('#header .header_nav_list .'+scope+'_badge').addClass('invisible');
$('#js-stream_update').css({'display':'none','height':'0','padding':'0px'});
@ -1814,7 +1816,8 @@ $('#js-overlay_content_wrap').addClass('view');
$('#js-overlay_content_wrap').addClass('black_08');
$('#overlay_status_form .status_textarea textarea').addClass('focus');
$('.overlay_status .submit_status_label').addClass('active_submit_button');
$('#overlay_status_form .status_textarea textarea').focus()
$('#overlay_status_form .status_textarea textarea').focus();
autosize($('#overlay_status_form .status_textarea textarea'));
$('#overlay_status_form input[name="privacy_option"]').val([localStorage.getItem("setting_post_privacy")]);
$('#overlay_status_form .expand_privacy_menu_button > 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);

View File

@ -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() {

View File

@ -12,6 +12,7 @@
<script src="/assets/js/halcyon/halcyonFunctions.js"></script>
<script src="/assets/js/mastodon.js/mastodon.js"></script><!-- thx @kirschn -->
<script src="/assets/js/jquery-cookie/src/jquery.cookie.js"></script>
<script src="/assets/js/autosize/autosize.js"></script>
<script src="/assets/js/shortcut.js"></script>
<script src="/assets/js/replace_emoji.js"></script>
<script src="/assets/js/halcyon/halcyonUI.js"></script>
@ -122,4 +123,4 @@ resetApp();
</ul>
</nav>
</div>
</header>
</header>

View File

@ -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');
</script>
<?php include ('footer.php'); ?>
<?php include ('footer.php'); ?>

View File

@ -1 +1 @@
1.1.6
1.1.7