From 810a08c8e7ddd394b0d050d899a5af465db40a24 Mon Sep 17 00:00:00 2001 From: cutls Date: Fri, 1 Feb 2019 01:30:25 +0900 Subject: [PATCH] TheDesk Miria (17.0.1)-beta3 --- .travis.yml | 47 +++++++++++++++++++++++-------- README.md | 8 ++++++ app/js/platform/nano.js | 6 ---- app/js/post/status.js | 8 ++++-- app/js/tl/date.js | 36 ++++++++++++++++++++---- app/js/tl/filter.js | 3 ++ app/js/tl/parse.js | 4 +++ app/js/ui/layout.js | 2 +- app/js/userdata/his-data.js | 2 +- app/main.js | 4 +-- app/nano.html | 55 +++++++++++++++++++++++++++++++++---- old.travis.yml | 30 ++++++++++++++++++++ 12 files changed, 169 insertions(+), 36 deletions(-) create mode 100644 old.travis.yml diff --git a/.travis.yml b/.travis.yml index c4a466f7..c8afd434 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,28 @@ -os: windows -language: node_js -node_js: -- '9.9.0' -script: node -v -before_deploy: +language: objective-c +cache: + directories: + - node_modules +env: + - NODE_VERSION="9.9.0" +before_install: + # nvm をインストールする。Travis の OS X 環境には nvm はデフォルトで入っていない + - git clone https://github.com/creationix/nvm.git /tmp/.nvm + - source /tmp/.nvm/nvm.sh + # 指定バージョンの Node をインストールする + - nvm install $NODE_VERSION + # 指定バージョンの Node を有効にする + - nvm use --delete-prefix $NODE_VERSION + - node --version +install: - cd app + - npm install +script: + - npm test +before_deploy: + - brew update + - brew install wine + - wine --version + - brew install makensis - npm install electron-builder -g - npm install - electron-builder --win --ia32 @@ -13,18 +31,23 @@ before_deploy: - electron-builder --win --x64 - mv ../build/TheDesk-setup.exe ../TheDesk-setup.exe - mv ../build/TheDesk*.exe ../TheDesk.exe - - cd ../ - - ls -after_deploy: ls + - electron-builder --linux --x64 + - mv ../build/TheDesk*.snap ../TheDesk.snap + - electron-builder --mac --x64 + - mv ../build/TheDesk*.dmg ../TheDesk.dmg deploy: - skip_cleanup: true provider: releases + # GitHub にリリースするための API KEY を暗号化した値 api_key: secure: jndR02p5KRTtcJk18b3YsXL2cC+yzEf1AOqXdpWciF8f3lO5oY01jlxd17xdHIcK7VywSsLVZpLToSdqAoIEhJ5OxEQ/FmA3FlmbwwD6ou13gLa4VGIvsBHveCmKGjVu0Z++atIy76tZYU1SOWFWv4B0ZhnVz2ca2VZynvLgw3YNsPJH7rHO966GXgRkGYJAJ4UvLg3sj/iztVh2FSfbUj5IGO1e/JHJO63wAo1MSQtRjkutVgl/djnBLC6vbL4YHkM3Ynpkx/YQEcxwrmeY0Ra8D5yYDq4MNIDMmZahWC+k4u2eA2Cj2ifBFNxbZvTN75vLwRBp6DsTNHsiqkXrSPDBdNeet31RbwTQ6LtsK8jqmL4S/59dmLcj7uCU2WxyBLPbJdbdZWlqW2ZQvfQY8QVAYy7S3MiHQWQN0oP5wqXk89jcgR42ig/zsqFNPpXHM4mExR7l/gDLPg0j9c3XEF6sWtk3FmJN1i4+B+9kn09b6UKlV7EFPKp8XcFNrz4ZcE9/I8lKwsqLVG2jAXIk7Z9LwDRcAmK5eG348X5zwFtOY6raKIvRw2cn92bPnEI+55v8A4WANS2647GFTgxHj30D0d/sOZmJ5BS34zpdWTgE0AlKg7sOqkncjqoW5J5zCh5Ow7b3KXvEvlAts44mAag8tZTectxMP4iguXvTnv4= - file: + # Releases ページにアップロードするファイル + file: - TheDesk.exe - TheDesk-setup.exe - TheDesk-ia32.exe - TheDesk-setup-ia32.exe + - TheDesk.snap + - TheDesk.dmg + skip_cleanup: true on: - repo: cutls/TheDesk + repo: cutls/TheDesk \ No newline at end of file diff --git a/README.md b/README.md index f0edb664..e2905cb4 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,14 @@ macOS Config is all on package.json ビルド設定はすべてpackage.jsonに記載しています。 +## Pleroma support + +Did you find a bug with Pleroma accounts? +Pleroma **does not** follow Mastodon API rules completely although Pleroma developers say so. +Please write issues to improve TheDesk affinity with Pleroma. +Pleromaは、Mastodon APIとの互換性を謳っていますが、実際には様々な差異があり、TheDeskで不具合が発生することがあります。 +Issuesに書いてある問題についてはなるべく対処しますので、ぜひお知らせください。 + ## See also/詳しく [TheDesk - マストドン日本語ウィキ](https://ja.mstdn.wiki/TheDesk) diff --git a/app/js/platform/nano.js b/app/js/platform/nano.js index 83385bfd..e960e293 100644 --- a/app/js/platform/nano.js +++ b/app/js/platform/nano.js @@ -29,16 +29,10 @@ function tl(data) { var templete = parse([json[0]], '', acct_id, tlid); $("#timeline_nano").html(templete); jQuery("time.timeago").timeago(); - reload(type, '', acct_id, data); }); -} - //Streaming接続 var websocket=[]; -function reload(type, cc, acct_id, data) { var tlid=0; - var domain = localStorage.getItem("domain_" + acct_id); - var at = localStorage.getItem("acct_"+ acct_id + "_at"); if (type == "home") { var start = "wss://" + domain + "/api/v1/streaming/?stream=user&access_token=" + at; diff --git a/app/js/post/status.js b/app/js/post/status.js index c98c4c90..13860500 100644 --- a/app/js/post/status.js +++ b/app/js/post/status.js @@ -279,9 +279,11 @@ function redraft(id, acct_id){ show(); $("#textarea").val(html); var cwtxt=$("[toot-id="+id+"] .cw_text").html(); - cwtxt=$.strip_tags(cwtxt); - cw(); - $("#cw-text").val(cwtxt); + if(cwtxt!=""){ + cwtxt=$.strip_tags(cwtxt); + cw(); + $("#cw-text").val(cwtxt); + } } } //ピン留め diff --git a/app/js/tl/date.js b/app/js/tl/date.js index 7eed1337..3ab4d752 100644 --- a/app/js/tl/date.js +++ b/app/js/tl/date.js @@ -56,14 +56,38 @@ function date(str, datetype) { //特殊フォーマット(インスタンス情報で利用) function crat(str) { var date = new Date(str); - + if(date.getMonth()<9){ + var mnt="0"+(date.getMonth()+1); + }else{ + var mnt=date.getMonth()+1; + } + if(date.getDate()<10){ + var dat="0"+date.getDate(); + }else{ + var dat=date.getDate(); + } + if(date.getHours()<10){ + var hrs="0"+date.getHours(); + }else{ + var hrs=date.getHours(); + } + if(date.getMinutes()<10){ + var mns="0"+date.getMinutes(); + }else{ + var mns=date.getMinutes(); + } + if(date.getSeconds()<10){ + var sec="0"+date.getSeconds(); + }else{ + var sec=date.getSeconds(); + } format_str = 'YYYY-MM-DD hh:mm:ss'; format_str = format_str.replace(/YYYY/g, date.getFullYear()); - format_str = format_str.replace(/MM/g, date.getMonth()+1); - format_str = format_str.replace(/DD/g, date.getDate()); - format_str = format_str.replace(/hh/g, date.getHours()); - format_str = format_str.replace(/mm/g, date.getMinutes()); - format_str = format_str.replace(/ss/g, date.getSeconds()); + format_str = format_str.replace(/MM/g, mnt); + format_str = format_str.replace(/DD/g, dat); + format_str = format_str.replace(/hh/g, hrs); + format_str = format_str.replace(/mm/g, mns); + format_str = format_str.replace(/ss/g, sec); return format_str; } diff --git a/app/js/tl/filter.js b/app/js/tl/filter.js index dd9de540..63ddfe32 100644 --- a/app/js/tl/filter.js +++ b/app/js/tl/filter.js @@ -391,6 +391,9 @@ function exclude(key){ } function excludeCk(key,target){ var exc=localStorage.getItem("exclude-"+key); + if(!exc){ + return ""; + } if(~exc.indexOf(target)){ return "checked" }else{ diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index ccdf3929..eb6226e7 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -357,6 +357,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter) { } if (!toot.application) { var via = ''; + viashow="hide"; } else { var via = toot.application.name; //強調チェック @@ -374,6 +375,9 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter) { } }); } + if(mix=="pinned"){ + boostback = "emphasized"; + } if (toot.spoiler_text && cw) { var content = toot.content; var spoil = escapeHTML(toot.spoiler_text); diff --git a/app/js/ui/layout.js b/app/js/ui/layout.js index 1a632aaf..eb5eb0cc 100644 --- a/app/js/ui/layout.js +++ b/app/js/ui/layout.js @@ -149,7 +149,7 @@ function parseColumn() { key + '">On'+lang.lang_layout_linkana +'
hearingOn'+lang.lang_layout_tts +'TL
low_priority'+lang.lang_layout_reconnect[lang]+'
'+lang.lang_layout_headercolor +'
low_priority'+lang.lang_layout_reconnect+'
'+lang.lang_layout_headercolor +'
'+lang.lang_layout_nodata +'
'; $("#timeline-container").append(html); localStorage.removeItem("pool_" + key); diff --git a/app/js/userdata/his-data.js b/app/js/userdata/his-data.js index 67ddfe04..8ab213b0 100644 --- a/app/js/userdata/his-data.js +++ b/app/js/userdata/his-data.js @@ -92,7 +92,7 @@ function pinutl(before,user, acct_id) { todo(error); console.error(error); }).then(function(json) { - var templete = parse(json, '', acct_id,'user'); + var templete = parse(json, 'pinned', acct_id,'user'); if(!json[0]){ templete=""; } diff --git a/app/main.js b/app/main.js index e67f8141..56497074 100644 --- a/app/main.js +++ b/app/main.js @@ -13,7 +13,7 @@ const Menu=electron.Menu var updatewin=null; const join = require('path').join; // linuxの時は定義しない -if (process.platform!='linux') { +if (process.platform=='win32') { const {NowPlaying,PlayerName} = require("nowplaying-node"); } // アプリケーションをコントロールするモジュール @@ -580,7 +580,7 @@ ipc.on('nano', function (e, x, y) { } catch (e) { window_pos = [0,0]; // デフォルトバリュー } - var nanowindow = new BrowserWindow({width: 300, height: 200, + var nanowindow = new BrowserWindow({width: 350, height: 200, "transparent": false, // ウィンドウの背景を透過 "frame": false, // 枠の無いウィンドウ "resizable": false }); diff --git a/app/nano.html b/app/nano.html index 4b003ad1..9173c5d5 100644 --- a/app/nano.html +++ b/app/nano.html @@ -13,6 +13,7 @@ html{ width:100vw; height:100vh; overflow:hidden; + font-family:sans-serif; } body { background-color: rgba(0, 0, 0, 0.1); @@ -45,6 +46,7 @@ textarea { } .area-actions{display:none !important;} .area-date_via{display:none !important;} + .area-side{display:none !important;} /* Handle */ ::-webkit-scrollbar-thumb { -webkit-border-radius: 5px; @@ -108,8 +110,6 @@ $.strip_tags = function(str, allowed) {
- - - - - @@ -166,4 +163,52 @@ function mov(){ function resetmv(){ return false; } +function post(){ + var acct_id=$("#post-acct-sel").val(); + var domain = localStorage.getItem("domain_" + acct_id); + var at = localStorage.getItem("acct_"+ acct_id + "_at"); + var start = "https://" + domain + "/api/v1/statuses"; + var str=$("#textarea").val(); + var toot={ + status: str + } + var vis = loadVis(acct_id) + toot.visibility=vis; + var httpreq = new XMLHttpRequest(); + httpreq.open('POST', start, true); + httpreq.setRequestHeader('Content-Type', 'application/json'); + httpreq.setRequestHeader('Authorization', 'Bearer ' + at); + httpreq.responseType = 'json'; + httpreq.send(JSON.stringify(toot)); + httpreq.onreadystatechange = function() { + if (httpreq.readyState == 4) { + $("#textarea").val(""); + } + } +} +function loadVis(acct_id){ + var vist = localStorage.getItem("vis"); + console.log(vist); + if (!vist) { + return "public"; + } else { + if (vist == "memory") { + var memory = localStorage.getItem("vis-memory-"+acct_id); + if (!memory) { + memory = "public"; + } + return memory; + } else if(vist == "server") { + var multi = localStorage.getItem("multi"); + var obj = JSON.parse(multi); + var memory = obj[acct_id]["vis"]; + if (!memory) { + memory = "public"; + } + return memory; + } else { + return vist; + } + } +} \ No newline at end of file diff --git a/old.travis.yml b/old.travis.yml new file mode 100644 index 00000000..c4a466f7 --- /dev/null +++ b/old.travis.yml @@ -0,0 +1,30 @@ +os: windows +language: node_js +node_js: +- '9.9.0' +script: node -v +before_deploy: + - cd app + - npm install electron-builder -g + - npm install + - electron-builder --win --ia32 + - mv ../build/TheDesk-setup.exe ../TheDesk-setup-ia32.exe + - mv ../build/TheDesk*.exe ../TheDesk-ia32.exe + - electron-builder --win --x64 + - mv ../build/TheDesk-setup.exe ../TheDesk-setup.exe + - mv ../build/TheDesk*.exe ../TheDesk.exe + - cd ../ + - ls +after_deploy: ls +deploy: + skip_cleanup: true + provider: releases + api_key: + secure: jndR02p5KRTtcJk18b3YsXL2cC+yzEf1AOqXdpWciF8f3lO5oY01jlxd17xdHIcK7VywSsLVZpLToSdqAoIEhJ5OxEQ/FmA3FlmbwwD6ou13gLa4VGIvsBHveCmKGjVu0Z++atIy76tZYU1SOWFWv4B0ZhnVz2ca2VZynvLgw3YNsPJH7rHO966GXgRkGYJAJ4UvLg3sj/iztVh2FSfbUj5IGO1e/JHJO63wAo1MSQtRjkutVgl/djnBLC6vbL4YHkM3Ynpkx/YQEcxwrmeY0Ra8D5yYDq4MNIDMmZahWC+k4u2eA2Cj2ifBFNxbZvTN75vLwRBp6DsTNHsiqkXrSPDBdNeet31RbwTQ6LtsK8jqmL4S/59dmLcj7uCU2WxyBLPbJdbdZWlqW2ZQvfQY8QVAYy7S3MiHQWQN0oP5wqXk89jcgR42ig/zsqFNPpXHM4mExR7l/gDLPg0j9c3XEF6sWtk3FmJN1i4+B+9kn09b6UKlV7EFPKp8XcFNrz4ZcE9/I8lKwsqLVG2jAXIk7Z9LwDRcAmK5eG348X5zwFtOY6raKIvRw2cn92bPnEI+55v8A4WANS2647GFTgxHj30D0d/sOZmJ5BS34zpdWTgE0AlKg7sOqkncjqoW5J5zCh5Ow7b3KXvEvlAts44mAag8tZTectxMP4iguXvTnv4= + file: + - TheDesk.exe + - TheDesk-setup.exe + - TheDesk-ia32.exe + - TheDesk-setup-ia32.exe + on: + repo: cutls/TheDesk