Commit 5a443a0c authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

добавил режим селекта для диалогов

asc_setSelectDialogRangeMode - Режим выбора диапазона (true|false)
asc_onSelectionRangeChanged - эвент с диапазоном

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47125 954022d7-b5bf-4e40-9824-e11837661b57
parent 174afea2
......@@ -1553,7 +1553,7 @@
</li>
</ul>
<ul class="noListStyle">
<li class="ToolbarIconOut selectableIcon" title="Insert chart(need icon!)">
<li class="ToolbarIconOut selectableIcon" title="Insert chart">
<div id="td_insert_chart" class="iconToolbar">
<img class="ToolbarIcon ToolbarIconAsc ToolbarInsertChart" src="menu/img/spacer.gif"/>
</div>
......
......@@ -805,8 +805,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
_asc_open: function (fCallback) { //fCallback({returnCode:"", val:obj, ...})
if ( this.chartEditor ) {
}
else if ( !this.documentId ) {
} else if (!this.documentId || !this.documentVKey) {
var data = getTestWorkbook();
var sData = data + "";
if( c_oSerFormat.Signature === sData.substring(0, c_oSerFormat.Signature.length))
......@@ -947,6 +946,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
* asc_onMouseMove (asc_CMouseMoveData) - эвент на наведение мышкой на гиперлинк или комментарий
* asc_onHyperlinkClick (sUrl) - эвент на нажатие гиперлинка
* asc_onСoAuthoringDisconnect () - эвент об отключении от сервера без попытки reconnect
* asc_onSelectionRangeChanged (selectRange) - эвент о выборе диапазона для диаграммы (после нажатия кнопки выбора)
*/
asc_StartAction: function (type, id) {
......@@ -956,10 +956,6 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
asc_EndAction: function (type, id) {
this.handlers.trigger("asc_onEndAction", type, id);
},
asc_SetAFDialog: function(val){
this.handlers.trigger("asc_onSetAFDialog", val);
},
asc_registerCallback: function (name, callback, replaceOldCallback) {
this.handlers.add(name, callback, replaceOldCallback);
......@@ -2248,16 +2244,24 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
}
},
asc_SendThemeColors : function(colors,standart_colors)
{
/**
* Режим выбора диапазона
* @param {Boolean} isSelectDialogRangeMode
*/
asc_setSelectDialogRangeMode: function (isSelectDialogRangeMode) {
this.controller.setSelectDialogRangeMode(isSelectDialogRangeMode);
if (this.wb)
this.wb.setSelectDialogRangeMode(isSelectDialogRangeMode);
},
asc_SendThemeColors : function (colors, standart_colors) {
this._gui_control_colors = { Colors : colors, StandartColors : standart_colors };
var ret = this.handlers.trigger("asc_onSendThemeColors", colors,standart_colors);
var ret = this.handlers.trigger("asc_onSendThemeColors", colors, standart_colors);
if (ret)
this._gui_control_colors = null;
},
asc_SendThemeColorSchemes : function(param)
{
asc_SendThemeColorSchemes : function (param) {
this._gui_color_schemes = param;
var ret = this.handlers.trigger("asc_onSendThemeColorSchemes", param);
if (ret)
......@@ -2824,6 +2828,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
prot["asc_insertFormula"] = prot.asc_insertFormula;
prot["asc_getFormulasInfo"] = prot.asc_getFormulasInfo;
prot["asc_setFontRenderingMode"] = prot.asc_setFontRenderingMode;
prot["asc_setSelectDialogRangeMode"] = prot.asc_setSelectDialogRangeMode;
prot["asc_ChangeColorScheme"] = prot.asc_ChangeColorScheme;
/////////////////////////////////////////////////////////////////////////
///////////////////CoAuthoring and Chat api//////////////////////////////
......
......@@ -390,6 +390,7 @@
var oTmpHyperlinkObj = null;
var aDialogNames = [];
var bIsUpdateChartProperties = false;
var bIsReopenDialog = false;
// Comment events
api.asc_registerCallback("asc_onMouseMove", eventMouseMoveComment);
......@@ -472,6 +473,10 @@
console.log("Cell Edit State - " + state);
});
api.asc_registerCallback("asc_onSelectionRangeChanged", function (val) {
$("#chartRange").val(val);
});
api.asc_Init("../Fonts/");
//api.asc_setViewerMode(true);
......@@ -486,7 +491,7 @@
var sUserNameAndId = "user_" + Math.floor ((Math.random() * 100) + 1);
api.asc_LoadDocument({
"Id" : getURLParameter("key") ? decodeURIComponent(getURLParameter("key")) : undefined,
"Id" : getURLParameter("key") ? decodeURIComponent(getURLParameter("key")) : "9876543210",
"Url" : getURLParameter("url") ? decodeURIComponent(getURLParameter("url")) : undefined,
"Title" : getURLParameter("title") ? decodeURIComponent(getURLParameter("title")).replace(new RegExp("\\+",'g')," ") : undefined,
"Format" : getURLParameter("filetype") ? decodeURIComponent(getURLParameter("filetype")) : undefined,
......@@ -1995,8 +2000,10 @@
chartForm.find("#legendField").show();
chartForm.find("#typeField").show();
api.asc_setSelectDialogRangeMode(true);
chartForm.css("visibility", "visible");
chartForm.dialog({ autoOpen: false, closeOnEscape: true, height: 'auto', width: 400,
chartForm.dialog({ autoOpen: false, closeOnEscape: false, height: 'auto', width: 400,
resizable: false, modal: true, title: "Chart properties", draggable: true,
open: function() {
if (!bIsUpdateChartProperties)
......@@ -2116,6 +2123,8 @@
}
],
close: function() {
if (!bIsReopenDialog)
api.asc_setSelectDialogRangeMode(false);
},
create: function() {
}
......@@ -2160,6 +2169,8 @@
}
$("#changeRange").click(function () {
bIsReopenDialog = true;
var selector = $(this);
var chartForm = $("#chartSelector");
if (selector.hasClass("ToolbarChangeRange")) {
......@@ -2185,6 +2196,8 @@
chartForm.dialog("option", "modal", true);
chartForm.dialog("close").dialog("open");
}
bIsReopenDialog = false;
});
$("#autoFilterCancel").click(function() { $('#MenuAutoFilter').hide(); });
......
......@@ -59,6 +59,8 @@
this.isMoveRangeMode = false;
this.isMoveResizeRange = false;
this.isMoveResizeChartsRange = false;
// Режим select-а для диалогов
this.isSelectDialogRangeMode = false;
// Режим формулы
this.isFormulaEditMode = false;
this.endWasPressed = false;
......@@ -197,6 +199,14 @@
this.isFocusDrawingObject = isFocusDrawingObject;
},
/**
*
* @param {Boolean} isSelectDialogRangeMode
*/
setSelectDialogRangeMode: function (isSelectDialogRangeMode) {
this.isSelectDialogRangeMode = isSelectDialogRangeMode;
},
/** @param whichSB {Number} Scroll bar to reinit (1=vertical, 2=horizontal) */
reinitializeScroll: function (whichSB) {
var self = this,
......@@ -244,7 +254,7 @@
var t = this;
// Для формулы не нужно выходить из редактирования ячейки
if (t.settings.isViewerMode || t.isFormulaEditMode) {return true;}
if (t.settings.isViewerMode || t.isFormulaEditMode || t.isSelectDialogRangeMode) {return true;}
if( this.targetInfo && ( this.targetInfo.target == "moveResizeRange" || this.targetInfo.target == "moveRange" || this.targetInfo.target == "fillhandle" ) ){
return true;
......@@ -636,7 +646,7 @@
switch (event.which) {
case 113: // F2
if (isViewerMode || t.isCellEditMode) {return true;}
if (isViewerMode || t.isCellEditMode || t.isSelectDialogRangeMode) {return true;}
if ($.browser.opera) {stop();}
// Выставляем блокировку на выход из редактора по клавишам-стрелкам
t.strictClose = true;
......@@ -645,7 +655,7 @@
return t.__retval;
case 8: // backspace
if (isViewerMode || t.isCellEditMode) {return true;}
if (isViewerMode || t.isCellEditMode || t.isSelectDialogRangeMode) {return true;}
if (t.isSelectDrawingObject) {
t.handlers.trigger("deleteDrawingObjectDone");
t.isSelectDrawingObject = false;
......@@ -660,7 +670,7 @@
return true;
case 46: // Del
if (isViewerMode || t.isCellEditMode) {return true;}
if (isViewerMode || t.isCellEditMode || t.isSelectDialogRangeMode) {return true;}
// Удаляем содержимое
if (t.isSelectDrawingObject) {
t.handlers.trigger("deleteDrawingObjectDone");
......@@ -803,7 +813,7 @@
case 88: // cut Ctrl + x
case 89: // redo Ctrl + y
case 90: // undo Ctrl + z
if (isViewerMode) {stop(); return false;}
if (isViewerMode || t.isSelectDialogRangeMode) {stop(); return false;}
case 65: // select all Ctrl + a
case 67: // copy Ctrl + c
......@@ -836,7 +846,7 @@
case 61: // Firefox, Opera (+/=)
case 187: // +/=
if (isViewerMode || t.isCellEditMode) {return true;}
if (isViewerMode || t.isCellEditMode || t.isSelectDialogRangeMode) {return true;}
if (event.altKey) {
t.handlers.trigger("addFunction", /*functionName*/"SUM", /*autoComplet*/true);
......@@ -901,7 +911,7 @@
// не вводим текст в режиме просмотра
// если в FF возвращать false, то отменяется дальнейшая обработка серии keydown -> keypress -> keyup
// и тогда у нас не будут обрабатываться ctrl+c и т.п. события
if (t.settings.isViewerMode) {return true;}
if (t.settings.isViewerMode || t.isSelectDialogRangeMode) {return true;}
if ($("#drawingObjectsMenu").length || t.isSelectDrawingObject)
return true;
......
......@@ -30,13 +30,15 @@
/**
* Widget for displaying and editing Workbook object
* -----------------------------------------------------------------------------
* @param {Workbook} model Workbook
* @param {EventsController} controller Events controller
* @param {HandlersList} handlers Events handlers for WorkbookView events
* @param {Element} elem Container element
* @param {Element} inputElem Input element for top line editor
* @param {Workbook} model Workbook
* @param {EventsController} controller Events controller
* @param {HandlersList} handlers Events handlers for WorkbookView events
* @param {Element} elem Container element
* @param {Element} inputElem Input element for top line editor
* @param {Object} Api
* @param {Object} settings Settings
* @param {asc_CCollaborativeEditing} collaborativeEditing
* @param {c_oAscFontRenderingModeType} fontRenderingMode
* @param {Object} settings Settings
*
* @constructor
* @memberOf Asc
......@@ -290,7 +292,8 @@
"onErrorEvent" : function (errorId, level) {self.handlers.trigger("asc_onError", errorId, level);},
"slowOperation" : function (isStart) {self.handlers.trigger((isStart ? "asc_onStartAction" : "asc_onEndAction"), c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.SlowOperation);},
"setFocusDrawingObject" : function (isFocusDrawingObject) { self.controller.setFocusDrawingObject(isFocusDrawingObject); },
"setAutoFiltersDialog" : function (arrVal) {self.handlers.trigger(("asc_onSetAFDialog"),arrVal);}
"setAutoFiltersDialog" : function (arrVal) {self.handlers.trigger("asc_onSetAFDialog", arrVal);},
"selectionRangeChanged" : function (val) {self.handlers.trigger("asc_onSelectionRangeChanged", val);}
});
return new asc_WSV(wsModel, this.canvas[0], this.canvasOverlay[0], this.collaborativeEditing, this.fontRenderingMode, opt);
},
......@@ -1204,6 +1207,10 @@
}
},
setSelectDialogRangeMode: function (isSelectDialogRangeMode) {
this.getWorksheet().setSelectDialogRangeMode(isSelectDialogRangeMode);
},
// Поиск текста в листе
findCellText: function (text, scanByRows, scanForward) {
var ws = this.getWorksheet();
......
This diff is collapsed.
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