Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
web-apps
Commits
a55e031b
Commit
a55e031b
authored
Dec 28, 2016
by
Alexander Yuzhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DE mobile] Fixed co-authtoring view
parent
74080fa0
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
158 additions
and
6 deletions
+158
-6
apps/documenteditor/mobile/app/controller/DocumentHolder.js
apps/documenteditor/mobile/app/controller/DocumentHolder.js
+113
-4
apps/documenteditor/mobile/app/controller/Main.js
apps/documenteditor/mobile/app/controller/Main.js
+4
-0
apps/documenteditor/mobile/locale/en.json
apps/documenteditor/mobile/locale/en.json
+1
-0
apps/documenteditor/mobile/resources/css/app-ios.css
apps/documenteditor/mobile/resources/css/app-ios.css
+9
-1
apps/documenteditor/mobile/resources/css/app-material.css
apps/documenteditor/mobile/resources/css/app-material.css
+9
-1
apps/documenteditor/mobile/resources/less/app-ios.less
apps/documenteditor/mobile/resources/less/app-ios.less
+11
-0
apps/documenteditor/mobile/resources/less/app-material.less
apps/documenteditor/mobile/resources/less/app-material.less
+11
-0
No files found.
apps/documenteditor/mobile/app/controller/DocumentHolder.js
View file @
a55e031b
...
...
@@ -46,7 +46,8 @@ define([
'
jquery
'
,
'
underscore
'
,
'
backbone
'
,
'
documenteditor/mobile/app/view/DocumentHolder
'
'
documenteditor/mobile/app/view/DocumentHolder
'
,
'
common/main/lib/collection/Users
'
],
function
(
core
,
$
,
_
,
Backbone
)
{
'
use strict
'
;
...
...
@@ -54,11 +55,14 @@ define([
// private
var
_stack
,
_view
,
_fastCoAuthTips
=
[],
_isEdit
=
false
;
return
{
models
:
[],
collections
:
[],
collections
:
[
'
Common.Collections.Users
'
],
views
:
[
'
DocumentHolder
'
],
...
...
@@ -76,8 +80,13 @@ define([
me
.
api
=
api
;
me
.
api
.
asc_registerCallback
(
'
asc_onShowPopMenu
'
,
_
.
bind
(
me
.
onApiShowPopMenu
,
me
));
me
.
api
.
asc_registerCallback
(
'
asc_onHidePopMenu
'
,
_
.
bind
(
me
.
onApiHidePopMenu
,
me
));
me
.
api
.
asc_registerCallback
(
'
asc_onShowPopMenu
'
,
_
.
bind
(
me
.
onApiShowPopMenu
,
me
));
me
.
api
.
asc_registerCallback
(
'
asc_onHidePopMenu
'
,
_
.
bind
(
me
.
onApiHidePopMenu
,
me
));
me
.
api
.
asc_registerCallback
(
'
asc_onShowForeignCursorLabel
'
,
_
.
bind
(
me
.
onApiShowForeignCursorLabel
,
me
));
me
.
api
.
asc_registerCallback
(
'
asc_onHideForeignCursorLabel
'
,
_
.
bind
(
me
.
onApiHideForeignCursorLabel
,
me
));
me
.
api
.
asc_registerCallback
(
'
asc_onAuthParticipantsChanged
'
,
_
.
bind
(
me
.
onApiUsersChanged
,
me
));
me
.
api
.
asc_registerCallback
(
'
asc_onConnectionStateChanged
'
,
_
.
bind
(
me
.
onApiUserConnection
,
me
));
me
.
api
.
asc_coAuthoringGetUsers
();
},
setMode
:
function
(
mode
)
{
...
...
@@ -151,6 +160,105 @@ define([
_view
&&
_view
.
hideMenu
();
},
onApiShowForeignCursorLabel
:
function
(
userId
,
X
,
Y
,
color
)
{
var
me
=
this
,
tipHeight
=
20
;
var
getUserName
=
function
(
id
)
{
var
usersStore
=
DE
.
getCollection
(
'
Common.Collections.Users
'
);
if
(
usersStore
){
var
rec
=
usersStore
.
findUser
(
id
);
if
(
rec
)
return
rec
.
get
(
'
username
'
);
}
return
me
.
textGuest
;
};
/** coauthoring begin **/
var
src
=
_
.
find
(
_fastCoAuthTips
,
function
(
tip
){
return
tip
.
attr
(
'
userid
'
)
==
userId
;
});
if
(
!
src
)
{
src
=
$
(
document
.
createElement
(
'
div
'
));
src
.
addClass
(
'
username-tip
'
);
src
.
attr
(
'
userid
'
,
userId
);
src
.
css
({
height
:
tipHeight
+
'
px
'
,
position
:
'
absolute
'
,
zIndex
:
'
900
'
,
display
:
'
none
'
,
'
pointer-events
'
:
'
none
'
,
'
background-color
'
:
'
#
'
+
Common
.
Utils
.
ThemeColor
.
getHexColor
(
color
.
get_r
(),
color
.
get_g
(),
color
.
get_b
())});
src
.
text
(
getUserName
(
userId
));
$
(
'
#id_main_view
'
).
append
(
src
);
_fastCoAuthTips
.
push
(
src
);
src
.
fadeIn
(
150
);
}
src
.
css
({
top
:
(
Y
-
tipHeight
)
+
'
px
'
,
left
:
X
+
'
px
'
});
/** coauthoring end **/
},
onApiHideForeignCursorLabel
:
function
(
userId
)
{
/** coauthoring begin **/
for
(
var
i
=
0
;
i
<
_fastCoAuthTips
.
length
;
i
++
)
{
if
(
_fastCoAuthTips
[
i
].
attr
(
'
userid
'
)
==
userId
)
{
var
src
=
_fastCoAuthTips
[
i
];
_fastCoAuthTips
[
i
].
fadeOut
(
150
,
function
(){
src
.
remove
()});
_fastCoAuthTips
.
splice
(
i
,
1
);
break
;
}
}
/** coauthoring end **/
},
onApiUsersChanged
:
function
(
users
){
var
usersStore
=
this
.
getApplication
().
getCollection
(
'
Common.Collections.Users
'
);
if
(
usersStore
)
{
var
arrUsers
=
[],
name
,
user
;
for
(
name
in
users
)
{
if
(
undefined
!==
name
)
{
user
=
users
[
name
];
if
(
user
)
{
arrUsers
.
push
(
new
Common
.
Models
.
User
({
id
:
user
.
asc_getId
(),
username
:
user
.
asc_getUserName
(),
online
:
true
,
color
:
user
.
asc_getColor
(),
view
:
user
.
asc_getView
()
}));
}
}
}
usersStore
[
usersStore
.
size
()
>
0
?
'
add
'
:
'
reset
'
](
arrUsers
);
}
},
onApiUserConnection
:
function
(
change
){
var
usersStore
=
this
.
getApplication
().
getCollection
(
'
Common.Collections.Users
'
);
if
(
usersStore
){
var
user
=
usersStore
.
findUser
(
change
.
asc_getId
());
if
(
!
user
)
{
usersStore
.
add
(
new
Common
.
Models
.
User
({
id
:
change
.
asc_getId
(),
username
:
change
.
asc_getUserName
(),
online
:
change
.
asc_getState
(),
color
:
change
.
asc_getColor
(),
view
:
change
.
asc_getView
()
}));
}
else
{
user
.
set
({
online
:
change
.
asc_getState
()});
}
}
},
// Internal
_openLink
:
function
(
url
)
{
...
...
@@ -261,6 +369,7 @@ define([
return
menuItems
;
},
textGuest
:
'
Guest
'
,
menuCut
:
'
Cut
'
,
menuCopy
:
'
Copy
'
,
menuPaste
:
'
Paste
'
,
...
...
apps/documenteditor/mobile/app/controller/Main.js
View file @
a55e031b
...
...
@@ -418,6 +418,10 @@ define([
}
if
(
action
.
type
==
Asc
.
c_oAscAsyncActionType
[
'
BlockInteraction
'
])
{
if
(
action
.
id
==
Asc
.
c_oAscAsyncAction
[
'
ApplyChanges
'
])
{
return
;
}
if
(
me
.
loadMask
&&
$
(
me
.
loadMask
).
hasClass
(
'
modal-in
'
))
{
$$
(
me
.
loadMask
).
find
(
'
.modal-title
'
).
text
(
title
);
}
else
{
...
...
apps/documenteditor/mobile/locale/en.json
View file @
a55e031b
...
...
@@ -87,6 +87,7 @@
"DE.Controllers.Main.advDRMEnterPassword"
:
"You password please:"
,
"DE.Controllers.Main.advDRMPassword"
:
"Password"
,
"DE.Controllers.DocumentHolder.textGuest"
:
"Guest"
,
"DE.Controllers.DocumentHolder.menuCut"
:
"Cut"
,
"DE.Controllers.DocumentHolder.menuCopy"
:
"Copy"
,
"DE.Controllers.DocumentHolder.menuPaste"
:
"Paste"
,
...
...
apps/documenteditor/mobile/resources/css/app-ios.css
View file @
a55e031b
This diff is collapsed.
Click to expand it.
apps/documenteditor/mobile/resources/css/app-material.css
View file @
a55e031b
This diff is collapsed.
Click to expand it.
apps/documenteditor/mobile/resources/less/app-ios.less
View file @
a55e031b
...
...
@@ -204,4 +204,15 @@ input, textarea {
}
}
}
}
// Co-Authtoring
.username-tip {
background-color: #ee3525;
border: none;
border-radius: 0;
padding: 3px 10px;
color: #ffffff;
white-space: nowrap;
}
\ No newline at end of file
apps/documenteditor/mobile/resources/less/app-material.less
View file @
a55e031b
...
...
@@ -198,3 +198,14 @@ input, textarea {
}
}
}
// Co-Authtoring
.username-tip {
background-color: #ee3525;
border: none;
border-radius: 0;
padding: 3px 10px;
color: #ffffff;
white-space: nowrap;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment