gdidc/webedit/js/service/hp_SE_ToolbarToggler.js
2021-10-26 18:19:06 +09:00

49 lines
1.7 KiB
JavaScript

/*
Copyright (C) NAVER corp.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
// Sample plugin. Use CTRL+T to toggle the toolbar
nhn.husky.SE_ToolbarToggler = $Class({
name : "SE_ToolbarToggler",
bUseToolbar : true,
$init : function(oAppContainer, bUseToolbar){
this._assignHTMLObjects(oAppContainer, bUseToolbar);
},
_assignHTMLObjects : function(oAppContainer, bUseToolbar){
oAppContainer = jindo.$(oAppContainer) || document;
this.toolbarArea = cssquery.getSingle(".se2_tool", oAppContainer);
//설정이 없거나, 사용하겠다고 표시한 경우 block 처리
if( typeof(bUseToolbar) == 'undefined' || bUseToolbar === true){
this.toolbarArea.style.display = "block";
}else{
this.toolbarArea.style.display = "none";
}
},
$ON_MSG_APP_READY : function(){
this.oApp.exec("REGISTER_HOTKEY", ["ctrl+t", "SE_TOGGLE_TOOLBAR", []]);
},
$ON_SE_TOGGLE_TOOLBAR : function(){
this.toolbarArea.style.display = (this.toolbarArea.style.display == "none")?"block":"none";
this.oApp.exec("MSG_EDITING_AREA_SIZE_CHANGED", []);
}
});