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
984fb163
Commit
984fb163
authored
Jun 24, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DE] Панель плагинов изменена в соответствии с макетами.
parent
e2efe3ba
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
92 additions
and
12 deletions
+92
-12
apps/common/main/lib/controller/Plugins.js
apps/common/main/lib/controller/Plugins.js
+6
-2
apps/common/main/lib/view/Plugins.js
apps/common/main/lib/view/Plugins.js
+40
-3
apps/common/main/resources/img/plugin/icon_add_on_default.png
.../common/main/resources/img/plugin/icon_add_on_default.png
+0
-0
apps/common/main/resources/img/plugin/icon_add_on_default@2x.png
...mmon/main/resources/img/plugin/icon_add_on_default@2x.png
+0
-0
apps/common/main/resources/less/plugins.less
apps/common/main/resources/less/plugins.less
+43
-3
apps/documenteditor/main/app/controller/LeftMenu.js
apps/documenteditor/main/app/controller/LeftMenu.js
+0
-2
apps/documenteditor/main/app/view/LeftMenu.js
apps/documenteditor/main/app/view/LeftMenu.js
+2
-2
apps/documenteditor/main/locale/en.json
apps/documenteditor/main/locale/en.json
+1
-0
No files found.
apps/common/main/lib/controller/Plugins.js
View file @
984fb163
...
...
@@ -119,8 +119,12 @@ define([
this
.
api
.
asc_pluginsRegister
(
this
.
panelPlugins
.
pluginsPath
,
arr
);
},
onSelectPlugin
:
function
(
picker
,
item
,
record
){
this
.
api
.
asc_pluginRun
(
record
.
get
(
'
guid
'
),
record
.
get
(
'
currentVariation
'
),
''
);
onSelectPlugin
:
function
(
picker
,
item
,
record
,
e
){
var
btn
=
$
(
e
.
target
);
if
(
btn
&&
btn
.
hasClass
(
'
plugin-caret
'
))
{
// show plugin menu
}
else
this
.
api
.
asc_pluginRun
(
record
.
get
(
'
guid
'
),
record
.
get
(
'
currentVariation
'
),
''
);
},
onPluginShow
:
function
(
plugin
)
{
...
...
apps/common/main/lib/view/Plugins.js
View file @
984fb163
...
...
@@ -50,7 +50,7 @@ define([
'
use strict
'
;
Common
.
Views
.
Plugins
=
Common
.
UI
.
BaseView
.
extend
(
_
.
extend
({
el
:
'
#
left-panel-plugin
s
'
,
el
:
'
#
id-plugins-setting
s
'
,
storePlugins
:
undefined
,
template
:
_
.
template
([
...
...
@@ -58,31 +58,68 @@ define([
'
<label id="plugins-header"><%= scope.strPlugins %></label>
'
,
'
<div id="plugins-list" class="">
'
,
'
</div>
'
,
'
</div>
'
,
'
<div id="current-plugin-box" class="layout-ct vbox hidden">
'
,
'
<label id="current-plugin-header"><%= scope.strPlugins %></label>
'
,
'
<div id="current-plugin-frame" class="">
'
,
'
</div>
'
,
'
</div>
'
].
join
(
''
)),
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
options
);
this
.
pluginsPath
=
'
../../../../sdkjs-plugins/
'
;
this
.
_locked
=
false
;
this
.
_state
=
{
DisabledControls
:
true
};
this
.
lockedControls
=
[];
Common
.
UI
.
BaseView
.
prototype
.
initialize
.
call
(
this
,
arguments
);
},
render
:
function
(
el
)
{
el
=
el
||
this
.
el
;
$
(
el
).
html
(
this
.
template
({
scope
:
this
}));
this
.
$el
=
$
(
el
);
this
.
viewPluginsList
=
new
Common
.
UI
.
DataView
({
el
:
$
(
'
#plugins-list
'
),
store
:
this
.
storePlugins
,
enableKeyEvents
:
false
,
itemTemplate
:
_
.
template
(
'
<div id="<%= id %>" class="item-plugins" style="background-image: url(
'
+
'
<% if (baseUrl !=="") { %>
'
+
'
<%= baseUrl %>
'
+
'
<% } else { %>
'
+
this
.
pluginsPath
+
'
<% } %>
'
+
'
<%= variations[currentVariation].get("icons")[(window.devicePixelRatio > 1) ? 1 : 0] %>); background-position: 0 0;"></div>
'
)
itemTemplate
:
_
.
template
([
'
<div id="<%= id %>" class="item-plugins" style="display: block;">
'
,
'
<div class="plugin-icon" style="background-image: url(
'
+
'
<% if (baseUrl !=="") { %>
'
+
'
<%= baseUrl %>
'
+
'
<% } else { %>
'
+
this
.
pluginsPath
+
'
<% } %>
'
+
'
<%= variations[currentVariation].get("icons")[(window.devicePixelRatio > 1) ? 1 : 0] %>);"></div>
'
,
'
<% if (variations.length>1) { %>
'
,
'
<div class="plugin-caret img-commonctrl"></div>
'
,
'
<% } %>
'
,
'
<%= name %>
'
,
'
</div>
'
].
join
(
''
))
});
this
.
lockedControls
.
push
(
this
.
viewPluginsList
);
this
.
trigger
(
'
render:after
'
,
this
);
return
this
;
},
strPlugins
:
'
Plugins
'
setLocked
:
function
(
locked
)
{
this
.
_locked
=
locked
;
},
ChangeSettings
:
function
(
props
)
{
this
.
disableControls
(
this
.
_locked
);
},
disableControls
:
function
(
disable
)
{
if
(
this
.
_state
.
DisabledControls
!==
disable
)
{
this
.
_state
.
DisabledControls
=
disable
;
_
.
each
(
this
.
lockedControls
,
function
(
item
)
{
item
.
setDisabled
(
disable
);
});
}
},
strPlugins
:
'
Add-ons
'
},
Common
.
Views
.
Plugins
||
{}));
...
...
apps/common/main/resources/img/plugin/icon_add_on_default.png
0 → 100644
View file @
984fb163
441 Bytes
apps/common/main/resources/img/plugin/icon_add_on_default@2x.png
0 → 100644
View file @
984fb163
1.19 KB
apps/common/main/resources/less/plugins.less
View file @
984fb163
...
...
@@ -16,11 +16,51 @@
#plugins-list {
height: 100%;
overflow: hidden;
padding: 30px 0 10px 10px;
padding: 30px 0 10px 0;
.item {
display: block;
width: 100%;
.box-shadow(none);
margin: 0;
&:hover,
&.over {
background-color: @secondary;
.plugin-icon {
.box-shadow(0 0 0 2px @primary);
}
}
}
.item-plugins {
width: 40px;
height: 40px;
width: 100%;
padding: 7px 1px 7px 12px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.plugin-icon {
width: 31px;
height: 31px;
display: inline-block;
.box-shadow(0 0 0 1px @gray);
vertical-align: middle;
background-position: 0 0;
background-size: cover;
margin-right: 10px;
.background-ximage('@{common-image-path}/plugin/icon_add_on_default.png', '@{common-image-path}/plugin/icon_add_on_default@2x.png', 31px);
}
.plugin-caret {
float: right;
width: 16px;
height: 16px;
background-position: -42px -195px;
margin: 7px;
}
}
}
...
...
apps/documenteditor/main/app/controller/LeftMenu.js
View file @
984fb163
...
...
@@ -174,8 +174,6 @@ define([
if
(
this
.
mode
.
canUseHistory
)
this
.
leftMenu
.
setOptionsPanel
(
'
history
'
,
this
.
getApplication
().
getController
(
'
Common.Controllers.History
'
).
getView
(
'
Common.Views.History
'
));
this
.
enablePlugins
();
Common
.
util
.
Shortcuts
.
resumeEvents
();
return
this
;
},
...
...
apps/documenteditor/main/app/view/LeftMenu.js
View file @
984fb163
...
...
@@ -227,7 +227,7 @@ define([
}
}
/** coauthoring end **/
if
(
this
.
mode
.
canPlugins
)
{
if
(
this
.
mode
.
canPlugins
&&
this
.
panelPlugins
)
{
if
(
this
.
btnPlugins
.
pressed
)
{
this
.
panelPlugins
.
show
();
}
else
...
...
@@ -279,7 +279,7 @@ define([
this
.
panelChat
[
'
hide
'
]();
this
.
btnChat
.
toggle
(
false
,
true
);
}
if
(
this
.
mode
.
canPlugins
)
{
if
(
this
.
mode
.
canPlugins
&&
this
.
panelPlugins
)
{
this
.
panelPlugins
[
'
hide
'
]();
this
.
btnPlugins
.
toggle
(
false
,
true
);
}
...
...
apps/documenteditor/main/locale/en.json
View file @
984fb163
...
...
@@ -157,6 +157,7 @@
"Common.Views.OpenDialog.okButtonText"
:
"OK"
,
"Common.Views.OpenDialog.txtEncoding"
:
"Encoding "
,
"Common.Views.OpenDialog.txtTitle"
:
"Choose %1 options"
,
"Common.Views.Plugins.strPlugins"
:
"Add-ons"
,
"Common.Views.ReviewChanges.txtAccept"
:
"Accept"
,
"Common.Views.ReviewChanges.txtAcceptAll"
:
"Accept All Changes"
,
"Common.Views.ReviewChanges.txtAcceptCurrent"
:
"Accept Current Change"
,
...
...
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