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
fbd59015
Commit
fbd59015
authored
Jan 16, 2017
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SSE] Added dialog for custom number format.
parent
1caa8bd6
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
499 additions
and
15 deletions
+499
-15
apps/spreadsheeteditor/main/app/controller/Toolbar.js
apps/spreadsheeteditor/main/app/controller/Toolbar.js
+22
-13
apps/spreadsheeteditor/main/app/view/FileMenuPanels.js
apps/spreadsheeteditor/main/app/view/FileMenuPanels.js
+4
-0
apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js
apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js
+467
-0
apps/spreadsheeteditor/main/app/view/Toolbar.js
apps/spreadsheeteditor/main/app/view/Toolbar.js
+5
-2
apps/spreadsheeteditor/main/locale/en.json
apps/spreadsheeteditor/main/locale/en.json
+1
-0
No files found.
apps/spreadsheeteditor/main/app/controller/Toolbar.js
View file @
fbd59015
...
...
@@ -50,7 +50,8 @@ define([
'
spreadsheeteditor/main/app/view/TableOptionsDialog
'
,
'
spreadsheeteditor/main/app/view/NamedRangeEditDlg
'
,
'
spreadsheeteditor/main/app/view/NamedRangePasteDlg
'
,
'
spreadsheeteditor/main/app/view/NameManagerDlg
'
'
spreadsheeteditor/main/app/view/NameManagerDlg
'
,
'
spreadsheeteditor/main/app/view/FormatSettingsDialog
'
],
function
()
{
'
use strict
'
;
SSE
.
Controllers
.
Toolbar
=
Backbone
.
Controller
.
extend
(
_
.
extend
({
...
...
@@ -102,8 +103,7 @@ define([
fontsize
:
undefined
,
multiselect
:
false
,
sparklines_disabled
:
false
,
numformattype
:
undefined
,
langId
:
0x0409
numformattype
:
undefined
};
var
checkInsertAutoshape
=
function
(
e
,
action
)
{
...
...
@@ -256,6 +256,8 @@ define([
toolbar
.
listStyles
.
on
(
'
click
'
,
_
.
bind
(
this
.
onListStyleSelect
,
this
));
toolbar
.
cmbNumberFormat
.
on
(
'
selected
'
,
_
.
bind
(
this
.
onNumberFormatSelect
,
this
));
toolbar
.
cmbNumberFormat
.
on
(
'
show:before
'
,
_
.
bind
(
this
.
onNumberFormatOpenBefore
,
this
,
true
));
if
(
toolbar
.
cmbNumberFormat
.
cmpEl
)
toolbar
.
cmbNumberFormat
.
cmpEl
.
on
(
'
click
'
,
'
#id-toolbar-mnu-item-more-formats a
'
,
_
.
bind
(
this
.
onNumberFormatSelect
,
this
));
toolbar
.
btnCurrencyStyle
.
menu
.
on
(
'
item:click
'
,
_
.
bind
(
this
.
onNumberFormatMenu
,
this
));
if
(
toolbar
.
mnuitemCompactToolbar
)
toolbar
.
mnuitemCompactToolbar
.
on
(
'
toggle
'
,
_
.
bind
(
this
.
onChangeViewMode
,
this
));
$
(
'
#id-toolbar-menu-new-fontcolor
'
).
on
(
'
click
'
,
_
.
bind
(
this
.
onNewTextColor
,
this
));
...
...
@@ -883,9 +885,22 @@ define([
},
onNumberFormatSelect
:
function
(
combo
,
record
)
{
if
(
this
.
api
)
this
.
api
.
asc_setCellFormat
(
record
.
format
);
if
(
record
)
{
if
(
this
.
api
)
this
.
api
.
asc_setCellFormat
(
record
.
format
);
}
else
{
var
me
=
this
;
(
new
SSE
.
Views
.
FormatSettingsDialog
({
api
:
me
.
api
,
handler
:
function
(
result
,
settings
)
{
if
(
settings
)
{
me
.
api
.
asc_setCellFormat
(
settings
.
format
);
}
Common
.
NotificationCenter
.
trigger
(
'
edit:complete
'
,
me
.
toolbar
);
},
props
:
{}
})).
show
();
}
Common
.
NotificationCenter
.
trigger
(
'
edit:complete
'
,
this
.
toolbar
);
Common
.
component
.
Analytics
.
trackEvent
(
'
ToolBar
'
,
'
Number Format
'
);
},
...
...
@@ -895,7 +910,7 @@ define([
var
me
=
this
,
info
=
me
.
api
.
asc_getCellInfo
();
me
.
toolbar
.
numFormatData
.
forEach
(
function
(
item
,
index
)
{
item
.
exampleval
=
me
.
api
.
asc_getLocaleExample2
(
item
.
format
,
null
,
me
.
_state
.
langId
);
item
.
exampleval
=
me
.
api
.
asc_getLocaleExample2
(
item
.
format
);
});
me
.
toolbar
.
cmbNumberFormat
.
setData
(
me
.
toolbar
.
numFormatData
);
me
.
toolbar
.
cmbNumberFormat
.
setValue
(
me
.
_state
.
numformattype
,
me
.
toolbar
.
txtCustom
);
...
...
@@ -2560,12 +2575,6 @@ define([
for
(
var
i
=
0
;
i
<
Math
.
min
(
4
,
formulas
.
length
);
i
++
)
{
formulas
[
i
].
setCaption
(
this
.
api
.
asc_getFormulaLocaleName
(
formulas
[
i
].
value
));
}
var
value
=
Common
.
localStorage
.
getItem
(
"
sse-settings-reg-settings
"
);
if
(
value
!==
null
)
this
.
_state
.
langId
=
parseInt
(
value
);
else
this
.
_state
.
langId
=
((
this
.
toolbar
.
mode
.
lang
)
?
parseInt
(
Common
.
util
.
LanguageInfo
.
getLocalLanguageCode
(
this
.
toolbar
.
mode
.
lang
))
:
0x0409
);
},
textEmptyImgUrl
:
'
You need to specify image URL.
'
,
...
...
apps/spreadsheeteditor/main/app/view/FileMenuPanels.js
View file @
fbd59015
...
...
@@ -755,6 +755,10 @@ define([
updateRegionalExample
:
function
(
landId
)
{
if
(
this
.
api
)
{
var
text
=
(
landId
)
?
this
.
api
.
asc_getLocaleExample
(
landId
,
1000.01
,
new
Date
())
:
''
;
//var arr = this.api.asc_getFormatCells(null, landId); // all formats
// text = this.api.asc_getLocaleExample2(arr[0], 1000.01, landId);
// text = text + ' ' + this.api.asc_getLocaleExample2(arr[3], new Date(), landId);
// text = text + ' ' + this.api.asc_getLocaleExample2(arr[5], new Date(), landId);
$
(
'
#fms-lbl-reg-settings
'
).
text
(
_
.
isEmpty
(
text
)
?
''
:
this
.
strRegSettingsEx
+
text
);
}
},
...
...
apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js
0 → 100644
View file @
fbd59015
This diff is collapsed.
Click to expand it.
apps/spreadsheeteditor/main/app/view/Toolbar.js
View file @
fbd59015
...
...
@@ -657,7 +657,9 @@ define([
'
<div style="position: relative;"><div style="position: absolute; left: 0; width: 100px;"><%= scope.getDisplayValue(item) %></div>
'
,
'
<div style="display: inline-block; width: 100%; max-width: 300px; overflow: hidden; text-overflow: ellipsis; text-align: right; vertical-align: bottom; padding-left: 100px; color: silver;"><%= item.exampleval ? item.exampleval : "" %></div>
'
,
'
</div></a></li>
'
,
'
<% }); %>
'
'
<% }); %>
'
,
'
<li class="divider">
'
,
'
<li id="id-toolbar-mnu-item-more-formats" data-value="-1"><a tabindex="-1" type="menuitem">
'
+
me
.
textMoreFormats
+
'
</a></li>
'
].
join
(
''
));
me
.
cmbNumberFormat
=
new
Common
.
UI
.
ComboBox
({
...
...
@@ -2112,6 +2114,7 @@ define([
tipInsertEquation
:
'
Insert Equation
'
,
textCharts
:
'
Charts
'
,
textSparks
:
'
Sparklines
'
,
tipInsertChartSpark
:
'
Insert Chart or Sparkline
'
tipInsertChartSpark
:
'
Insert Chart or Sparkline
'
,
textMoreFormats
:
'
More formats
'
},
SSE
.
Views
.
Toolbar
||
{}));
});
\ No newline at end of file
apps/spreadsheeteditor/main/locale/en.json
View file @
fbd59015
...
...
@@ -1625,6 +1625,7 @@
"SSE.Views.Toolbar.textLineSpark"
:
"Line"
,
"SSE.Views.Toolbar.textColumnSpark"
:
"Column"
,
"SSE.Views.Toolbar.textWinLossSpark"
:
"Win/Loss"
,
"SSE.Views.Toolbar.textMoreFormats"
:
"More formats"
,
"SSE.Views.Top10FilterDialog.cancelButtonText"
:
"Cancel"
,
"SSE.Views.Top10FilterDialog.okButtonText"
:
"OK"
,
"SSE.Views.Top10FilterDialog.textType"
:
"Show"
,
...
...
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