revert changes to index.html

let's maintain a separate branch for now
This commit is contained in:
Lorenz Hübschle-Schneider 2017-04-19 14:43:18 +02:00
parent b24a9e5137
commit 307a6a5344
3 changed files with 30 additions and 38 deletions

View file

@ -47,7 +47,6 @@
<script type="text/javascript" src="js/plugins.js"></script>
<script type="text/javascript" src="js/imgur.js"></script>
<script type="text/javascript" src="3rdparty/favico-0.3.10.min.js"></script>
<script type="text/javascript" src="cordova.js"></script>
</head>
<body ng-controller="WeechatCtrl" ng-keydown="handleKeyPress($event)" ng-keyup="handleKeyRelease($event)" ng-keypress="handleKeyPress($event)" ng-class="{'no-overflow': connected}" ng-init="init()" lang="en-US">
<div class="alert alert-danger upload-error" ng-show="uploadError">
@ -64,7 +63,7 @@
<strong>Connection error</strong> The client was unable to connect to the WeeChat relay
</div>
<div class="alert alert-danger" ng-show="sslError">
<strong>Secure connection error</strong> A secure connection with the WeeChat relay could not be initiated. This is most likely because your <span ng-hide="utils.isCordova()">browser</span><span ng-hide="!utils.isCordova()">device</a> does not trust your relay's certificate. <span ng-hide="utils.isCordova()">Please read the encryption instructions below!</span><span ng-hide="!utils.isCordova()">It's easiest to use a trusted certificate, and remember to include all intermediate CAs. For more info, please read the encryption instructions below!</span>
<strong>Secure connection error</strong> A secure connection with the WeeChat relay could not be initiated. This is most likely because your browser does not trust your relay's certificate. Please read the encryption instructions below!
</div>
<div class="alert alert-danger" ng-show="securityError">
<strong>Secure connection error</strong> Unable to connect to unencrypted relay when you are connecting to Glowing Bear over HTTPS. Please use an encrypted relay or load the page without using HTTPS.
@ -102,7 +101,7 @@
<div class="checkbox">
<label class="control-label" for="savepassword">
<input type="checkbox" id="savepassword" ng-model="settings.savepassword">
Save password <span ng-hide="utils.isCordova()">in your browser</span>
Save password in your browser
</label>
</div>
<div class="checkbox" ng-show="settings.savepassword">
@ -134,9 +133,9 @@
<div id="collapseTwo" class="panel-collapse collapse">
<div class="panel-body">
<p><span class="label label-danger">WeeChat version 0.4.2 or higher is required—we recommend at least 1.0.</p>
<p>To start using Glowing Bear, follow the instructions below to set up an encrypted relay. All communication goes directly between <span ng-hide="utils.isCordova()">your browser</span><span ng-hide="!utils.isCordova()">the app</span> and your WeeChat relay! This means that your server must be accessible. We never see any of your data or your password, and you don't need to trust a "cloud". All settings, including your password, are saved locally <span ng-hide="utils.isCordova()">in your own browser</span><span ng-hide="!utils.isCordova()">on your device</span> between sessions.</p>
<p>To start using Glowing Bear, follow the instructions below to set up an encrypted relay. All communication goes directly between your browser and your WeeChat relay! This means that your server must be accessible. We never see any of your data or your password, and you don't need to trust a "cloud". All settings, including your password, are saved locally in your own browser between sessions.</p>
<div class="alert alert-warning" ng-show="show_tls_warning"><strong>You're using Glowing Bear over an unencrypted connection (http://). This is not recommended!</strong> We recommend using our secure hosted version at <a href="https://www.glowing-bear.org/">https://www.glowing-bear.org/</a>, or <a href="https://latest.glowing-bear.org/">https://latest.glowing-bear.org</a> for the latest and greatest development version. You can still follow the instructions below to set up an encrypted relay, though.</div>
<p>When using encryption, all communication between <span ng-hide="utils.isCordova()">your browser</span><span ng-hide="!utils.isCordova()">the app</span> and WeeChat will be securely encrypted with TLS. This means that you have to set up a certificate. While it's possible to use a self-signed cert, we recommend against it, because it's handled poorly in browsers, and may not work at all on mobile devices. If you don't already have a certificate for your domain (or you don't have a domain), we strongly encourage you to get a certificate from <a href="https://letsencrypt.org/">Let's Encrypt</a>—it's free and easy. We'll walk you through it.</p>
<p>When using encryption, all communication between your browser and WeeChat will be securely encrypted with TLS. This means that you have to set up a certificate. While it's possible to use a self-signed cert, we recommend against it, because it's handled poorly in browsers, and may not work at all on mobile devices. If you don't already have a certificate for your domain (or you don't have a domain), we strongly encourage you to get a certificate from <a href="https://letsencrypt.org/">Let's Encrypt</a>—it's free and easy. We'll walk you through it.</p>
<p><strong>If you don't have a domain</strong> you can get a free subdomain from providers such as <a href="https://freedns.afraid.org/">afraid</a>. You'll want to set up an 'A' record to your server's IP address, and quite possibly an AAAA record to its IPv6 address. These might take a few hours to propagate, if the steps below don't work right away, try again in a few hours.</p>
<p><strong>Getting a certificate</strong> is easy. You'll need certbot—just follow the encryptions at <a href="https://certbot.eff.org/">https://certbot.eff.org</a>. If you're not serving webpages on the same server or are unsure, select "none of the above" (if you are, you can probably use that webserver to proxy your relay, and skip this—check out the <a href="https://github.com/glowing-bear/glowing-bear/wiki/Proxying-WeeChat-relay-with-a-web-server">instructions in our Wiki</a>). Next, get the certificate with <code>certbot certonly --standalone -d {{ settings.host || your.domain.com }}</code> and follow the instructions.</p>
<p>Nearly done! Now you just need to copy the files into place. To do that, use the following commands, replacing the <strong>username</strong> placeholder with your actual username:</p>
@ -163,7 +162,6 @@ chown -R <strong>username</strong>:<strong>username</strong> ~<strong>username</
</div>
<div id="collapseThree" class="panel-collapse collapse">
<div class="panel-body">
<div ng-hide="utils.isCordova()">
<h3 style="margin-top: 0px">Shortcuts</h3>
Glowing Bear has a few shortcuts:
<ul>
@ -180,7 +178,6 @@ chown -R <strong>username</strong>:<strong>username</strong> ~<strong>username</
<li><kbd>Tab</kbd>: Complete nick</li>
<li>The following readline/emacs style keybindings can be enabled with a setting: <span title="Move cursor to beginning of line"><kbd>Ctrl-a</kbd></span>, <span title="Move cursor to te end of the line"><kbd>Ctrl-e</kbd></span>, <span title="Delete from cursor to beginning of the line"><kbd>Ctrl-u</kbd></span>, <span title="Delete from cursor to the end of the line"><kbd>Ctrl-k</kbd></span>, <span title="Delete from cursor to previous space"><kbd>Ctrl-w</kbd></span></li>
</ul>
</div>
<h3>Pinning buffers</h3>
<p>
The option "Only show buffers with unread messages" is useful when you have a lot of buffers and can't meaningfully look at all of them at the same time. However, often you have a select few buffers that you use more frequently and would like to have displayed permanently.
@ -194,7 +191,7 @@ chown -R <strong>username</strong>:<strong>username</strong> ~<strong>username</
</div>
</div>
</div>
<div class="panel" data-state="collapsed" ng-hide="utils.isCordova()">
<div class="panel" data-state="collapsed">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle" ng-click="toggleAccordion($event)">
@ -231,7 +228,7 @@ npm run build-electron-{windows, darwin, linux}</pre>
</div>
<div id="collapseFive" class="panel-collapse collapse">
<div class="panel-body">
<p>Glowing bear is built by a small group of developers in their free time. As we're always trying to improve it, we would love getting your feedback and help. If that sounds like something you might enjoy, check out our <a href="https://github.com/glowing-bear/glowing-bear">main project page</a> <span ng-hide="!utils.isCordova()">and its <a href="https://github.com/glowing-bear/glowing-bear-cordova">mobile app spin-off</a></span> on GitHub!</p>
<p>Glowing bear is built by a small group of developers in their free time. As we're always trying to improve it, we would love getting your feedback and help. If that sounds like something you might enjoy, check out our <a href="https://github.com/glowing-bear/glowing-bear">project page</a> on GitHub!</p>
<p>If you're interested in contributing or simply want to say hello, head over to <strong>#glowing-bear</strong> on <strong>freenode!</strong> We won't bite, promise :)</p>
</div>
</div>
@ -251,7 +248,7 @@ npm run build-electron-{windows, darwin, linux}</pre>
</div>
<div class="title" title="{{activeBuffer().rtitle}}">
<span class="desktop" ng-repeat="part in activeBuffer().title" ng-class="::part.classes" ng-bind-html="::(part.text | linky:(utils.isCordova() ? '_system' : '_blank'):{rel:'noopener noreferrer'} | linksForCordova | DOMfilter:'irclinky')"></span>
<span class="desktop" ng-repeat="part in activeBuffer().title" ng-class="::part.classes" ng-bind-html="::(part.text | linky:'_blank':{rel:'noopener noreferrer'} | DOMfilter:'irclinky')"></span>
<span class="mobile" ng-click="showModal('topicModal')" ng-class="{'active': activeBuffer().active, 'channel': activeBuffer().type === 'channel', 'channel_hash': activeBuffer().prefix === '#', 'channel_plus': activeBuffer().prefix === '+', 'channel_ampersand': activeBuffer().prefix === '&'}">{{ activeBuffer().trimmedName || activeBuffer().fullName }}</span>
</div>
@ -317,7 +314,7 @@ npm run build-electron-{windows, darwin, linux}</pre>
<td class="prefix"><span ng-class="::{'repeated-prefix': bufferline.prefixtext==bufferlines[$index-1].prefixtext}"><a ng-click="addMention(bufferline.prefix)"><span class="hidden-bracket">&lt;</span><span ng-repeat="part in ::bufferline.prefix" ng-class="::part.classes" ng-bind="::part.text|prefixlimit:25"></span><span class="hidden-bracket">&gt;</span></a></span></td><!--
--><td class="message"><!--
--><div ng-repeat="metadata in ::bufferline.metadata" plugin data="::metadata"></div><!--
--><span ng-repeat="part in ::bufferline.content" class="text" ng-class="::part.classes.concat(['line-' + part.$$hashKey.replace(':','_')])" ng-bind-html="::part.text | linky:(utils.isCordova() ? '_system' : '_blank'):{rel:'noopener noreferrer'} | linksForCordova | DOMfilter:'irclinky' | DOMfilter:'emojify':settings.enableJSEmoji | DOMfilter:'inlinecolour' | DOMfilter:'latexmath':('.line-' + part.$$hashKey.replace(':','_')):settings.enableMathjax"></span>
--><span ng-repeat="part in ::bufferline.content" class="text" ng-class="::part.classes.concat(['line-' + part.$$hashKey.replace(':','_')])" ng-bind-html="::part.text | linky:'_blank':{rel:'noopener noreferrer'} | DOMfilter:'irclinky' | DOMfilter:'emojify':settings.enableJSEmoji | DOMfilter:'inlinecolour' | DOMfilter:'latexmath':('.line-' + part.$$hashKey.replace(':','_')):settings.enableMathjax"></span>
</td>
</tr>
<tr class="readmarker" ng-if="activeBuffer().lastSeen==$index">
@ -346,8 +343,7 @@ npm run build-electron-{windows, darwin, linux}</pre>
<button type="button" class="close" ng-click="closeModal($event)" aria-hidden="true">&times;</button>
<span class="pull-right version">Glowing Bear version 0.7.0</span>
<h4 class="modal-title">Settings</h4>
<p ng-hide="!utils.isCordova()">Settings will be stored in your browser.</p>
<p ng-hide="utils.isCordova()">Settings will be stored on your device.</p>
<p>Settings will be stored in your browser.</p>
</div>
<div class="modal-body">
<ul class="">
@ -448,7 +444,7 @@ npm run build-electron-{windows, darwin, linux}</pre>
</div>
</form>
</li>
<li ng-hide="utils.isCordova()">
<li>
<form class="form-inline" role="form">
<div class="checkbox">
<label>
@ -468,7 +464,7 @@ npm run build-electron-{windows, darwin, linux}</pre>
</div>
</form>
</li>
<li ng-hide="utils.isCordova()">
<li>
<form class="form-inline" role="form">
<div class="checkbox">
<label>
@ -478,7 +474,7 @@ npm run build-electron-{windows, darwin, linux}</pre>
</div>
</form>
</li>
<li ng-hide="utils.isCordova()">
<li>
<form class="form-inline" role="form">
<div class="checkbox">
<label>
@ -513,7 +509,7 @@ npm run build-electron-{windows, darwin, linux}</pre>
<div class="modal-header">
<button type="button" class="close" ng-click="closeModal($event)" aria-hidden="true">&times;</button>
<h4 class="modal-title">Channel topic</h4>
<p ng-repeat="part in activeBuffer().title" ng-class="::part.classes" ng-bind-html="::(part.text | linky:(utils.isCordova() ? '_system' : '_blank'):{rel:'noopener noreferrer'} | linksForCordova | DOMfilter:'irclinky')"></p>
<p ng-repeat="part in activeBuffer().title" ng-class="::part.classes" ng-bind-html="::(part.text | linky:'_blank':{rel:'noopener noreferrer'} | DOMfilter:'irclinky')"></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" ng-click="closeModal($event)">Close</button>

View file

@ -1,6 +1,7 @@
(function() {
'use strict';
// cordova splash screen
document.addEventListener("deviceready", function () {
if (navigator.splashscreen !== undefined) {
navigator.splashscreen.hide();

View file

@ -14,10 +14,6 @@ weechat.factory('utils', function() {
});
};
var isCordova = function() {
return window.cordova !== undefined;
};
var isMobileUi = function() {
// TODO don't base detection solely on screen width
// You are right. In the meantime I am renaming isMobileDevice to isMobileUi
@ -50,7 +46,6 @@ weechat.factory('utils', function() {
changeClassStyle: changeClassStyle,
getClassStyle: getClassStyle,
isMobileUi: isMobileUi,
isCordova: isCordova,
inject_script: inject_script,
inject_css: inject_css,
};