Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit ed56853

Browse files
committed
Fix unexpected desktop mode on mobile devices + small fixes (#1514)
1 parent 677a5f2 commit ed56853

File tree

10 files changed

+115
-88
lines changed

10 files changed

+115
-88
lines changed

dev/Common/Links.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const
1010
SUB_QUERY_PREFIX = '&q[]=',
1111

1212
VERSION = Settings.appSettingsGet('version'),
13-
IS_MOBILE = Settings.appSettingsGet('mobile'),
1413

1514
WEB_PREFIX = Settings.appSettingsGet('webPath') || '',
1615
VERSION_PREFIX = Settings.appSettingsGet('webVersionPath') || 'rainloop/v/' + VERSION + '/',
@@ -59,7 +58,7 @@ export function rootAdmin()
5958
*/
6059
export function rootUser()
6160
{
62-
return IS_MOBILE ? SERVER_PREFIX + '/Mobile/' : ROOT;
61+
return ROOT;
6362
}
6463

6564
/**
@@ -171,7 +170,7 @@ export function append()
171170
*/
172171
export function change(email)
173172
{
174-
return serverRequest('Change' + (IS_MOBILE ? 'Mobile' : '')) + encodeURIComponent(email) + '/';
173+
return serverRequest('Change') + encodeURIComponent(email) + '/';
175174
}
176175

177176
/**

dev/Model/Message.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ class MessageModel extends AbstractModel
761761
.addClass('lazy-inited')
762762
.attr('src', element.dataset.original)
763763
.removeAttr('data-loaded')
764+
.removeAttr('data-original')
764765
.css({opacity: 0.3})
765766
.animate({opacity: 1}, 500);
766767
}
@@ -781,13 +782,12 @@ class MessageModel extends AbstractModel
781782
$this
782783
.addClass('lazy')
783784
.attr('data-original', $this.attr(attr))
784-
.removeAttr('data-loaded')
785-
.removeAttr(attr);
785+
.removeAttr('data-loaded');
786786
}
787787
else
788788
{
789789
$this.attr('src', $this.attr(attr))
790-
.removeAttr('data-loaded').removeAttr(attr);
790+
.removeAttr('data-loaded');
791791
}
792792
});
793793

@@ -796,7 +796,7 @@ class MessageModel extends AbstractModel
796796
const $this = $(this); // eslint-disable-line no-invalid-this
797797
let style = trim($this.attr('style'));
798798
style = '' === style ? '' : (';' === style.substr(-1) ? style + ' ' : style + '; ');
799-
$this.attr('style', style + $this.attr(attr)).removeAttr(attr);
799+
$this.attr('style', style + $this.attr(attr));
800800
});
801801

802802
if (lazy)

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"title": "RainLoop Webmail",
44
"description": "Simple, modern & fast web-based email client",
55
"private": true,
6-
"version": "1.11.2",
7-
"ownCloudVersion": "5.0.1",
6+
"version": "1.11.3",
7+
"ownCloudVersion": "5.0.5",
88
"homepage": "http://rainloop.net",
99
"main": "gulpfile.js",
1010
"author": {
@@ -33,14 +33,14 @@
3333
"keywords": [
3434
"webmail",
3535
"php",
36+
"javascript",
3637
"simple",
3738
"modern",
3839
"mail",
3940
"web-based",
4041
"email",
4142
"client",
42-
"openpgp",
43-
"plugins"
43+
"openpgp"
4444
],
4545
"readmeFilename": "README.md",
4646
"engines": {
@@ -66,13 +66,13 @@
6666
"copy-webpack-plugin": "4.0.1",
6767
"element-dataset": "2.2.6",
6868
"es6-promise-polyfill": "1.2.0",
69-
"eslint": "4.6.1",
69+
"eslint": "4.7.2",
7070
"eslint-plugin-compat": "1.0.4",
7171
"gulp": "3.9.1",
7272
"gulp-autoprefixer": "4.0.0",
7373
"gulp-cached": "1.1.1",
7474
"gulp-chmod": "2.0.0",
75-
"gulp-clean-css": "3.8.0",
75+
"gulp-clean-css": "3.9.0",
7676
"gulp-concat-util": "0.5.5",
7777
"gulp-eol": "0.1.2",
7878
"gulp-eslint": "4.0.0",
@@ -107,18 +107,18 @@
107107
"knockout-projections": "github:stevesanderson/knockout-projections#v1.1.0",
108108
"knockout-sortable": "0.14.1",
109109
"lightgallery": "1.2.21",
110-
"lozad": "1.0.2",
110+
"lozad": "1.0.4",
111111
"matchmedia-polyfill": "0.3.0",
112112
"moment": "2.18.1",
113113
"node-fs": "0.1.7",
114114
"node-notifier": "5.1.2",
115115
"normalize.css": "7.0.0",
116-
"openpgp": "2.5.10",
116+
"openpgp": "2.5.11",
117117
"opentip": "2.4.3",
118118
"pikaday": "1.6.1",
119119
"raw-loader": "0.5.1",
120120
"rimraf": "2.6.2",
121-
"run-sequence": "2.1.0",
121+
"run-sequence": "2.2.0",
122122
"simplestatemanager": "3.4.0",
123123
"style-loader": "0.18.2",
124124
"underscore": "1.8.3",

rainloop/v/0.0.0/app/libraries/MailSo/Base/StreamWrappers/SubStreams.php

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ public static function CreateStream($aSubStreams)
6767

6868
$sHashName = \MailSo\Base\Utils::Md5Rand();
6969

70-
self::$aStreams[$sHashName] = $aSubStreams;
70+
self::$aStreams[$sHashName] = array_map(function($mItem) {
71+
return \is_resource($mItem) ? $mItem :
72+
\MailSo\Base\ResourceRegistry::CreateMemoryResourceFromString($mItem);
73+
}, $aSubStreams);
7174

7275
\MailSo\Base\Loader::IncStatistic('CreateStream/SubStreams');
7376

@@ -181,26 +184,6 @@ public function stream_read($iCount)
181184
$this->iIndex++;
182185
}
183186
}
184-
else if (\is_string($mCurrentPart))
185-
{
186-
$sReadResult = \substr($mCurrentPart, 0, $iCount);
187-
188-
$sReturn .= $sReadResult;
189-
190-
$iLen = \strlen($sReadResult);
191-
if ($iCount < $iLen)
192-
{
193-
$this->sBuffer = \substr($sReturn, $iCount);
194-
$sReturn = \substr($sReturn, 0, $iCount);
195-
$iCount = 0;
196-
}
197-
else
198-
{
199-
$iCount -= $iLen;
200-
}
201-
202-
$this->iIndex++;
203-
}
204187
}
205188
}
206189

rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Actions
1414
const AUTH_SPEC_LOGOUT_TOKEN_KEY = 'rlspeclogout';
1515
const AUTH_SPEC_LOGOUT_CUSTOM_MSG_KEY = 'rlspeclogoutcmk';
1616
const AUTH_ADMIN_TOKEN_KEY = 'rlaauth';
17-
const RL_SKIP_MOBILE_KEY = 'rlmobile';
17+
const RL_MOBILE_TYPE = 'rlmobiletype';
1818

1919
/**
2020
* @var \MailSo\Base\Http

rainloop/v/0.0.0/app/libraries/RainLoop/Service.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,20 @@ private function localHandle()
162162
$bMobileDevice = $oMobileDetect->isMobile() &&
163163
($bUseMobileVersionForTablets ? true : !$oMobileDetect->isTablet());
164164

165-
$bMobile = (0 < \count($aPaths) && !empty($aPaths[0]) && 'mobile' === \strtolower($aPaths[0]));
166-
}
167-
168-
if ($bIndex && !$bMobile)
169-
{
170-
$iMobileKey = (int) \RainLoop\Utils::GetCookie(\RainLoop\Actions::RL_SKIP_MOBILE_KEY, 0);
171-
if (1 !== $iMobileKey)
165+
if ($bIndex)
172166
{
173-
if ($bMobileDevice)
174-
{
175-
$this->oActions->Location('./?/Mobile/');
176-
return $this;
167+
$sMobileType = (string) \RainLoop\Utils::GetCookie(\RainLoop\Actions::RL_MOBILE_TYPE, '');
168+
switch ($sMobileType) {
169+
default:
170+
$sMobileType = '';
171+
$bMobile = $bMobileDevice;
172+
break;
173+
case 'mobile':
174+
$bMobile = true;
175+
break;
176+
case 'desktop':
177+
$bMobile = false;
178+
break;
177179
}
178180
}
179181
}

rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -829,19 +829,19 @@ public function ServiceAdminAppData($sAdd = '')
829829
/**
830830
* @return string
831831
*/
832-
public function ServiceSkipMobile()
832+
public function ServiceMobileVersion()
833833
{
834-
\RainLoop\Utils::SetCookie(\RainLoop\Actions::RL_SKIP_MOBILE_KEY, 1);
834+
\RainLoop\Utils::SetCookie(\RainLoop\Actions::RL_MOBILE_TYPE, 'mobile');
835835
$this->oActions->Location('./');
836836
return '';
837837
}
838838

839839
/**
840840
* @return string
841841
*/
842-
public function ServiceClearSkipMobile()
842+
public function ServiceDesktopVersion()
843843
{
844-
\RainLoop\Utils::ClearCookie(\RainLoop\Actions::RL_SKIP_MOBILE_KEY);
844+
\RainLoop\Utils::SetCookie(\RainLoop\Actions::RL_MOBILE_TYPE, 'desktop');
845845
$this->oActions->Location('./');
846846
return '';
847847
}
@@ -1183,16 +1183,6 @@ private function changeAction()
11831183
}
11841184
}
11851185

1186-
/**
1187-
* @return string
1188-
*/
1189-
public function ServiceChangeMobile()
1190-
{
1191-
$this->changeAction();
1192-
$this->oActions->Location('./?/Mobile/');
1193-
return '';
1194-
}
1195-
11961186
/**
11971187
* @return string
11981188
*/

rainloop/v/0.0.0/app/templates/Views/User/Login.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,17 @@
119119
</div>
120120
<div class="e-powered thm-powered" data-bind="visible: loginPowered">Powered by <a href="http://www.rainloop.net" target="_blank">RainLoop</a></div>
121121
<div class="e-mobile-switcher thm-mobile-switcher">
122-
<span data-bind="visible: !mobile && mobileDevice">
122+
<span data-bind="visible: !mobile">
123123
<i class="icon-mobile"></i>
124124
&nbsp;
125-
<a href="./?/Mobile/" tabindex="-1">
125+
<a href="./?/MobileVersion/" tabindex="-1">
126126
<span class="i18n" data-i18n="MOBILE/BUTTON_MOBILE_VERSION"></span>
127127
</a>
128128
</span>
129129
<span data-bind="visible: mobile">
130130
<i class="icon-laptop"></i>
131131
&nbsp;
132-
<a href="./?/SkipMobile/" tabindex="-1">
132+
<a href="./?/DesktopVersion/" tabindex="-1">
133133
<span class="i18n" data-i18n="MOBILE/BUTTON_DESKTOP_VERSION"></span>
134134
</a>
135135
</span>

rainloop/v/0.0.0/app/templates/Views/User/SystemDropDown.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@
5858
</li>
5959
<li class="divider" role="presentation" data-bind="visible: allowSettings || allowHelp"></li>
6060
<li class="e-item" role="presentation" data-bind="visible: mobile">
61-
<a class="e-link menuitem" href="./?/SkipMobile/" tabindex="-1">
61+
<a class="e-link menuitem" href="./?/DesktopVersion/" tabindex="-1">
6262
<i class="icon-laptop"></i>
6363
&nbsp;&nbsp;
6464
<span class="i18n" data-i18n="MOBILE/BUTTON_DESKTOP_VERSION"></span>
6565
</a>
6666
</li>
67-
<li class="e-item" role="presentation" data-bind="visible: !mobile && mobileDevice">
68-
<a class="e-link menuitem" href="./?/Mobile/" tabindex="-1">
67+
<li class="e-item" role="presentation" data-bind="visible: !mobile">
68+
<a class="e-link menuitem" href="./?/MobileVersion/" tabindex="-1">
6969
<i class="icon-mobile"></i>
7070
&nbsp;&nbsp;
7171
<span class="i18n" data-i18n="MOBILE/BUTTON_MOBILE_VERSION"></span>

0 commit comments

Comments
 (0)