Commit 0bc6d455 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

частично реализован новый скин

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58679 954022d7-b5bf-4e40-9824-e11837661b57
parent c70bfa54
......@@ -3787,7 +3787,7 @@ function CThumbnailsManager()
if (nHeightPix < heightThumbs)
{
// все убралось. скролл не нужен
if (this.m_bIsScrollVisible)
if (this.m_bIsScrollVisible && GlobalSkin.ThumbnailScrollWidthNullIfNoScrolling)
{
word_control.m_oThumbnails.Bounds.R = 0;
word_control.m_oThumbnailsBack.Bounds.R = 0;
......@@ -3795,6 +3795,10 @@ function CThumbnailsManager()
word_control.m_oThumbnailsContainer.Resize(__w, __h);
}
else
{
word_control.m_oThumbnails_scroll.HtmlElement.style.display = "none";
}
this.m_bIsScrollVisible = false;
this.m_dScrollY = 0;
}
......@@ -3803,9 +3807,18 @@ function CThumbnailsManager()
// нужен скролл
if (!this.m_bIsScrollVisible)
{
word_control.m_oThumbnailsBack.Bounds.R = word_control.ScrollWidthPxThmbnl * g_dKoef_pix_to_mm;
word_control.m_oThumbnails.Bounds.R = word_control.ScrollWidthPxThmbnl * g_dKoef_pix_to_mm;
word_control.m_oThumbnails_scroll.Bounds.AbsW = word_control.ScrollWidthPxThmbnl * g_dKoef_pix_to_mm;
if (GlobalSkin.ThumbnailScrollWidthNullIfNoScrolling)
{
word_control.m_oThumbnailsBack.Bounds.R = word_control.ScrollWidthPx * g_dKoef_pix_to_mm;
word_control.m_oThumbnails.Bounds.R = word_control.ScrollWidthPx * g_dKoef_pix_to_mm;
var _width_mm_scroll = (GlobalSkin.Name == "flat") ? 10 : word_control.ScrollWidthPx;
word_control.m_oThumbnails_scroll.Bounds.AbsW = _width_mm_scroll * g_dKoef_pix_to_mm;
}
else
{
word_control.m_oThumbnails_scroll.HtmlElement.style.display = "block";
}
word_control.m_oThumbnailsContainer.Resize(__w, __h);
}
......@@ -3829,7 +3842,10 @@ function CThumbnailsManager()
screenW: word_control.m_oThumbnails.HtmlElement.width,
screenH: word_control.m_oThumbnails.HtmlElement.height,
cornerRadius: 1,
slimScroll: true
slimScroll: true,
scrollBackgroundColor : GlobalSkin.BackgroundColorThumbnails,
scrollBackgroundColorHover : GlobalSkin.BackgroundColorThumbnails,
scrollBackgroundColorActive : GlobalSkin.BackgroundColorThumbnails
};
document.getElementById('panel_right_scroll_thmbnl').style.height = parseInt(nHeightPix) + "px";
......
......@@ -32,6 +32,7 @@ var GlobalSkinTeamlab = {
RulersButton : true,
NavigationButtons : true,
BackgroundColor : "#B0B0B0",
BackgroundColorThumbnails : "#EBEBEB",
RulerDark : "#B0B0B0",
RulerLight : "EDEDED",
RulerOutline : "#929292",
......@@ -39,13 +40,17 @@ var GlobalSkinTeamlab = {
PageOutline : "#81878F",
STYLE_THUMBNAIL_WIDTH : 80,
STYLE_THUMBNAIL_HEIGHT : 40,
BorderSplitterColor : "#787878"
BorderSplitterColor : "#787878",
SupportNotes : true,
SplitterWidthMM : 1.5,
ThumbnailScrollWidthNullIfNoScrolling : true
};
var GlobalSkinFlat = {
Name : "flat",
RulersButton : false,
NavigationButtons : false,
BackgroundColor : "#F4F4F4",
BackgroundColorThumbnails : "#EBEBEB",
RulerDark : "#CFCFCF",
RulerLight : "#FFFFFF",
RulerOutline : "#BBBEC2",
......@@ -53,7 +58,10 @@ var GlobalSkinFlat = {
PageOutline : "#BBBEC2",
STYLE_THUMBNAIL_WIDTH : 109,
STYLE_THUMBNAIL_HEIGHT : 45,
BorderSplitterColor : "#CBCBCB"
BorderSplitterColor : "#CBCBCB",
SupportNotes : false,
SplitterWidthMM : 1,
ThumbnailScrollWidthNullIfNoScrolling : false
};
var GlobalSkin = GlobalSkinTeamlab;
......@@ -106,7 +114,6 @@ function CEditorPage(api)
this.m_oTopRuler_horRuler = null;
this.ScrollWidthPx = 14;
this.ScrollWidthPxThmbnl= 10;
// main view
this.m_oMainView = null;
......@@ -342,14 +349,19 @@ function CEditorPage(api)
this.m_oThumbnailsContainer.AddControl(this.m_oThumbnails);
this.m_oThumbnails_scroll = CreateControl("id_vertical_scroll_thmbnl");
this.m_oThumbnails_scroll.Bounds.SetParams(0,0,4 * g_dKoef_pix_to_mm,1000,false,false,true,false,ScrollWidthMm9,-1);
this.m_oThumbnails_scroll.Bounds.SetParams(0,0,1000,1000,false,false,false,false,ScrollWidthMm9,-1);
this.m_oThumbnails_scroll.Anchor = (g_anchor_top | g_anchor_right |g_anchor_bottom);
this.m_oThumbnailsContainer.AddControl(this.m_oThumbnails_scroll);
// ----------------
// main content -------------------------------------------------------------
this.m_oMainContent = CreateControlContainer("id_main");
this.m_oMainContent.Bounds.SetParams(this.Splitter1Pos + 1.5,0,g_dKoef_pix_to_mm,this.Splitter2Pos + 1.5,true,false,true,true,-1,-1);
if (GlobalSkin.SupportNotes)
this.m_oMainContent.Bounds.SetParams(this.Splitter1Pos + GlobalSkin.SplitterWidthMM,0,g_dKoef_pix_to_mm,this.Splitter2Pos + GlobalSkin.SplitterWidthMM,true,false,true,true,-1,-1);
else
this.m_oMainContent.Bounds.SetParams(this.Splitter1Pos + GlobalSkin.SplitterWidthMM,0,g_dKoef_pix_to_mm,1000,true,false,true,false,-1,-1);
this.m_oMainContent.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oBody.AddControl(this.m_oMainContent);
......@@ -434,7 +446,7 @@ function CEditorPage(api)
// notes ----
this.m_oNotesContainer = CreateControlContainer("id_panel_notes");
this.m_oNotesContainer.Bounds.SetParams(this.Splitter1Pos + 1.5, 0, g_dKoef_pix_to_mm, 1000, true, true, true, false, -1, this.Splitter2Pos);
this.m_oNotesContainer.Bounds.SetParams(this.Splitter1Pos + GlobalSkin.SplitterWidthMM, 0, g_dKoef_pix_to_mm, 1000, true, true, true, false, -1, this.Splitter2Pos);
this.m_oNotesContainer.Anchor = (g_anchor_left | g_anchor_right | g_anchor_bottom);
this.m_oBody.AddControl(this.m_oNotesContainer);
......@@ -447,6 +459,12 @@ function CEditorPage(api)
this.m_oNotes_scroll.Bounds.SetParams(0,0,1000,1000,false,false,false,false,ScrollWidthMm,-1);
this.m_oNotes_scroll.Anchor = (g_anchor_top | g_anchor_right |g_anchor_bottom);
this.m_oNotesContainer.AddControl(this.m_oNotes_scroll);
if (!GlobalSkin.SupportNotes)
{
this.m_oNotesContainer.HtmlElement.style.display = "none";
}
// ----------
this.m_oMainView = CreateControlContainer("id_main_view");
......@@ -1179,7 +1197,7 @@ function CEditorPage(api)
{
Splitter.style.left = parseInt(this.Splitter1Pos * g_dKoef_mm_to_pix) + "px";
Splitter.style.top = "0px";
Splitter.style.width = parseInt(1.5 * g_dKoef_mm_to_pix) + "px";
Splitter.style.width = parseInt(GlobalSkin.SplitterWidthMM * g_dKoef_mm_to_pix) + "px";
Splitter.style.height = this.Height + "px";
this.SplitterType = 1;
......@@ -1187,10 +1205,10 @@ function CEditorPage(api)
}
else
{
Splitter.style.left = parseInt((this.Splitter1Pos + 1.5) * g_dKoef_mm_to_pix) + "px";
Splitter.style.top = this.Height - parseInt((this.Splitter2Pos + 1.5) * g_dKoef_mm_to_pix) + "px";
Splitter.style.width = this.Width - parseInt((this.Splitter1Pos + 1.5) * g_dKoef_mm_to_pix) + "px";
Splitter.style.height = parseInt(1.5 * g_dKoef_mm_to_pix) + "px";
Splitter.style.left = parseInt((this.Splitter1Pos + GlobalSkin.SplitterWidthMM) * g_dKoef_mm_to_pix) + "px";
Splitter.style.top = this.Height - parseInt((this.Splitter2Pos + GlobalSkin.SplitterWidthMM) * g_dKoef_mm_to_pix) + "px";
Splitter.style.width = this.Width - parseInt((this.Splitter1Pos + GlobalSkin.SplitterWidthMM) * g_dKoef_mm_to_pix) + "px";
Splitter.style.height = parseInt(GlobalSkin.SplitterWidthMM * g_dKoef_mm_to_pix) + "px";
this.SplitterType = 2;
Splitter.style.backgroundRepeat = "repeat-x";
......@@ -1222,8 +1240,8 @@ function CEditorPage(api)
var oWordControl = oThis;
var x1 = oWordControl.Splitter1Pos * g_dKoef_mm_to_pix;
var x2 = (oWordControl.Splitter1Pos + 1.5) * g_dKoef_mm_to_pix;
var y1 = oWordControl.Height - ((oWordControl.Splitter2Pos + 1.5) * g_dKoef_mm_to_pix);
var x2 = (oWordControl.Splitter1Pos + GlobalSkin.SplitterWidthMM) * g_dKoef_mm_to_pix;
var y1 = oWordControl.Height - ((oWordControl.Splitter2Pos + GlobalSkin.SplitterWidthMM) * g_dKoef_mm_to_pix);
var y2 = oWordControl.Height - (oWordControl.Splitter2Pos * g_dKoef_mm_to_pix);
var _x = global_mouseEvent.X - oWordControl.X;
......@@ -1262,8 +1280,8 @@ function CEditorPage(api)
if (null == oWordControl.SplitterDiv)
{
var x1 = oWordControl.Splitter1Pos * g_dKoef_mm_to_pix;
var x2 = (oWordControl.Splitter1Pos + 1.5) * g_dKoef_mm_to_pix;
var y1 = oWordControl.Height - ((oWordControl.Splitter2Pos + 1.5) * g_dKoef_mm_to_pix);
var x2 = (oWordControl.Splitter1Pos + GlobalSkin.SplitterWidthMM) * g_dKoef_mm_to_pix;
var y1 = oWordControl.Height - ((oWordControl.Splitter2Pos + GlobalSkin.SplitterWidthMM) * g_dKoef_mm_to_pix);
var y2 = oWordControl.Height - (oWordControl.Splitter2Pos * g_dKoef_mm_to_pix);
var _x = global_mouseEvent.X - oWordControl.X;
......@@ -1311,7 +1329,7 @@ function CEditorPage(api)
_y = _max;
oWordControl.m_oBody.HtmlElement.style.cursor = "s-resize";
oWordControl.SplitterDiv.style.top = (_y - parseInt(1.5 * g_dKoef_mm_to_pix)) + "px";
oWordControl.SplitterDiv.style.top = (_y - parseInt(GlobalSkin.SplitterWidthMM * g_dKoef_mm_to_pix)) + "px";
}
}
}
......@@ -1328,10 +1346,10 @@ function CEditorPage(api)
if (this.IsUseNullThumbnailsSplitter || (0 != this.Splitter1Pos))
{
this.m_oMainContent.Bounds.L = this.Splitter1Pos + 1.5;
this.m_oMainContent.Bounds.B = this.Splitter2Pos + 1.5;
this.m_oMainContent.Bounds.L = this.Splitter1Pos + GlobalSkin.SplitterWidthMM;
this.m_oMainContent.Bounds.B = GlobalSkin.SupportNotes ? this.Splitter2Pos + GlobalSkin.SplitterWidthMM : 1000;
this.m_oNotesContainer.Bounds.L = this.Splitter1Pos + 1.5;
this.m_oNotesContainer.Bounds.L = this.Splitter1Pos + GlobalSkin.SplitterWidthMM;
this.m_oNotesContainer.Bounds.AbsH = this.Splitter2Pos;
this.m_oThumbnailsContainer.HtmlElement.style.display = "block";
......@@ -1339,7 +1357,7 @@ function CEditorPage(api)
else
{
this.m_oMainContent.Bounds.L = 0;
this.m_oMainContent.Bounds.B = this.Splitter2Pos + 1.5;
this.m_oMainContent.Bounds.B = GlobalSkin.SupportNotes ? this.Splitter2Pos + GlobalSkin.SplitterWidthMM : 1000;
this.m_oNotesContainer.Bounds.L = 0;
this.m_oNotesContainer.Bounds.AbsH = this.Splitter2Pos;
......@@ -1382,7 +1400,7 @@ function CEditorPage(api)
}
else
{
var _posY = (oWordControl.Height - _y) * g_dKoef_pix_to_mm - 1.5;
var _posY = (oWordControl.Height - _y) * g_dKoef_pix_to_mm - GlobalSkin.SplitterWidthMM;
if (Math.abs(oWordControl.Splitter2Pos - _posY) > 1)
{
oWordControl.Splitter2Pos = _posY;
......
......@@ -918,16 +918,22 @@ asc_docs_api.prototype.CreateComponents = function()
{
this.CreateCSS();
var element = document.getElementById(this.HtmlElementName);
if (element != null)
element.innerHTML = "<div id=\"id_panel_thumbnails\" class=\"block_elem\" style=\"background-color:" + GlobalSkin.BackgroundColor + ";border-right-width: 1px;border-right-color:" + GlobalSkin.BorderSplitterColor + "; border-right-style: solid;\">\
var _main_border_style = "border-bottom-width: 1px;border-bottom-color:" + GlobalSkin.BorderSplitterColor + "; border-bottom-style: solid;";
var _thumbnail_style_right = "border-right-width: 1px;border-right-color:" + GlobalSkin.BorderSplitterColor + "; border-right-style: solid;";
if (!GlobalSkin.SupportNotes)
{
_main_border_style = "";
_thumbnail_style_right = "";
}
var _innerHTML = "<div id=\"id_panel_thumbnails\" class=\"block_elem\" style=\"background-color:" + GlobalSkin.BackgroundColorThumbnails + ";" + _thumbnail_style_right + "\">\
<canvas id=\"id_thumbnails_background\" class=\"block_elem\" style=\"background-color:#EBEBEB;z-index:1\"></canvas>\
<canvas id=\"id_thumbnails\" class=\"block_elem\" style=\"z-index:2\"></canvas>\
<div id=\"id_vertical_scroll_thmbnl\" style=\"left:0;top:0;width:1px;overflow:hidden;position:absolute;\">\
<div id=\"panel_right_scroll_thmbnl\" class=\"block_elem\" style=\"left:0;top:0;width:1px;height:6000px;\"></div>\
</div>\
</div>\
<div id=\"id_main\" class=\"block_elem\" style=\"-moz-user-select:none;-khtml-user-select:none;user-select:none;background-color:" + GlobalSkin.BackgroundColor + ";overflow:hidden;border-left-width: 1px;border-left-color:" + GlobalSkin.BorderSplitterColor + "; border-left-style: solid;border-bottom-width: 1px;border-bottom-color:" + GlobalSkin.BorderSplitterColor + "; border-bottom-style: solid;\" UNSELECTABLE=\"on\">\
<div id=\"id_main\" class=\"block_elem\" style=\"-moz-user-select:none;-khtml-user-select:none;user-select:none;background-color:" + GlobalSkin.BackgroundColor + ";overflow:hidden;border-left-width: 1px;border-left-color:" + GlobalSkin.BorderSplitterColor + "; border-left-style: solid;" + _main_border_style + "\" UNSELECTABLE=\"on\">\
<div id=\"id_panel_left\" class=\"block_elem\">\
<div id=\"id_buttonTabs\" class=\"block_elem buttonTabs\"></div>\
<canvas id=\"id_vert_ruler\" class=\"block_elem\"></canvas>\
......@@ -953,13 +959,26 @@ asc_docs_api.prototype.CreateComponents = function()
<div id=\"panel_hor_scroll\" class=\"block_elem\" style=\"left:0;top:0;width:6000px;height:1px;\"></div>\
</div>\
</div>\
</div>\
<div id=\"id_panel_notes\" class=\"block_elem\" style=\"background-color:#FFFFFF;border-left-width: 1px;border-left-color:" + GlobalSkin.BorderSplitterColor + "; border-left-style: solid;border-top-width: 1px;border-top-color:" + GlobalSkin.BorderSplitterColor + "; border-top-style: solid;\">\
</div>";
if (true)
{
_innerHTML += "<div id=\"id_panel_notes\" class=\"block_elem\" style=\"background-color:#FFFFFF;border-left-width: 1px;border-left-color:" + GlobalSkin.BorderSplitterColor + "; border-left-style: solid;border-top-width: 1px;border-top-color:" + GlobalSkin.BorderSplitterColor + "; border-top-style: solid;\">\
<canvas id=\"id_notes\" class=\"block_elem\" style=\"background-color:#FFFFFF;z-index:1\"></canvas>\
<div id=\"id_vertical_scroll_notes\" style=\"left:0;top:0;width:16px;overflow:hidden;position:absolute;\">\
<div id=\"panel_right_scroll_notes\" class=\"block_elem\" style=\"left:0;top:0;width:16px;height:6000px;\"></div>\
</div>\
</div>";
}
var element = document.getElementById(this.HtmlElementName);
if (element != null)
{
if (GlobalSkin.Name == "flat")
element.style.backgroundColor = GlobalSkin.BackgroundColorThumbnails;
element.innerHTML = _innerHTML;
}
}
asc_docs_api.prototype.InitEditor = function()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment