Continued translating files

This commit is contained in:
SamTV12345 2024-07-22 20:39:44 +02:00
parent 1d977679dd
commit 99c834651c
15 changed files with 78 additions and 58 deletions

View file

@ -25,7 +25,7 @@ import fs from 'fs';
import {callAll} from '../../static/js/pluginfw/hooks.js'; import {callAll} from '../../static/js/pluginfw/hooks.js';
import path from 'path'; import path from 'path';
import resolve from 'resolve'; import resolve from 'resolve';
const settings = require('../utils/Settings'); import settings from '../utils/Settings';
import {pluginInstallPath} from '../../static/js/pluginfw/installer' import {pluginInstallPath} from '../../static/js/pluginfw/installer'
const templateCache = new Map(); const templateCache = new Map();
@ -100,7 +100,14 @@ export const requireP = (name:string, args:{
const ejspath = resolve.sync(name, {paths, basedir, extensions: ['.html', '.ejs']}); const ejspath = resolve.sync(name, {paths, basedir, extensions: ['.html', '.ejs']});
args.e = exports; args.e = {
// @ts-ignore
_init,
_exit,
begin_block,
end_block,
// Include other methods as necessary
};
// @ts-ignore // @ts-ignore
args.require = requireP; args.require = requireP;

View file

@ -257,7 +257,7 @@ export const restartServer = async () => {
}); });
}); });
// @ts-ignore // @ts-ignore
await util.promisify(server!.listen).bind(server)(port, ip); await util.promisify(server!.listen).bind(server)(settings.port, settings.ip);
startTime.setValue(Date.now()); startTime.setValue(Date.now());
logger.info('HTTP server listening for connections'); logger.info('HTTP server listening for connections');
}; };

View file

@ -234,7 +234,7 @@ exports.expressCreateServer = async (hookName: string, args: any, cb: Function)
}); });
const padString = requireP('ep_etherpad-lite/templates/padBootstrap.js', { const padString = requireP('ep_etherpad-lite/templates/padBootstrap.ts', {
pluginModules: (() => { pluginModules: (() => {
const pluginModules = new Set(); const pluginModules = new Set();
for (const part of pluginDefs.getParts()) { for (const part of pluginDefs.getParts()) {
@ -248,7 +248,7 @@ exports.expressCreateServer = async (hookName: string, args: any, cb: Function)
settings, settings,
}) })
const timeSliderString = requireP('ep_etherpad-lite/templates/timeSliderBootstrap.js', { const timeSliderString = requireP('ep_etherpad-lite/templates/timeSliderBootstrap.ts', {
pluginModules: (() => { pluginModules: (() => {
const pluginModules = new Set(); const pluginModules = new Set();
for (const part of pluginDefs.getParts()) { for (const part of pluginDefs.getParts()) {

View file

@ -3,7 +3,7 @@ import Provider, {Account, Configuration} from 'oidc-provider';
import {generateKeyPair, exportJWK, KeyLike} from 'jose' import {generateKeyPair, exportJWK, KeyLike} from 'jose'
import MemoryAdapter from "./OIDCAdapter"; import MemoryAdapter from "./OIDCAdapter";
import path from "path"; import path from "path";
const settings = require('../utils/Settings'); import settings from '../utils/Settings';
import {IncomingForm} from 'formidable' import {IncomingForm} from 'formidable'
import express, {Request, Response} from 'express'; import express, {Request, Response} from 'express';
import {format} from 'url' import {format} from 'url'

View file

@ -1,13 +1,14 @@
'use strict'; 'use strict';
import AttributeMap from './AttributeMap' import AttributeMap from './AttributeMap'
const Changeset = require('./Changeset'); import {compose, deserializeOps, isIdentity} from './Changeset';
const ChangesetUtils = require('./ChangesetUtils'); import {buildKeepRange, buildKeepToStartOfRange, buildRemoveRange} from './ChangesetUtils';
const attributes = require('./attributes'); import {attribsFromString} from './attributes';
import underscore from "underscore"; import underscore from "underscore";
import {RepModel} from "./types/RepModel"; import {RepModel} from "./types/RepModel";
import {RangePos} from "./types/RangePos"; import {RangePos} from "./types/RangePos";
import {Attribute} from "./types/Attribute"; import {Attribute} from "./types/Attribute";
import {Builder} from "./Builder";
const lineMarkerAttribute = 'lmkr'; const lineMarkerAttribute = 'lmkr';
@ -49,11 +50,11 @@ export class AttributeManager {
this.author = ''; this.author = '';
} }
applyChangeset(changeset: string) { applyChangeset(changeset: Builder|undefined) {
if (!this.applyChangesetCallback) return changeset; if (!this.applyChangesetCallback) return changeset;
const cs = changeset.toString(); const cs = changeset!.toString();
if (!Changeset.isIdentity(cs)) { if (!isIdentity(cs)) {
this.applyChangesetCallback(cs); this.applyChangesetCallback(cs);
} }
@ -86,14 +87,14 @@ export class AttributeManager {
// as the range might not be continuous // as the range might not be continuous
// due to the presence of line markers on the rows // due to the presence of line markers on the rows
if (allChangesets) { if (allChangesets) {
allChangesets = Changeset.compose( allChangesets = compose(
allChangesets.toString(), rowChangeset.toString(), this.rep.apool); allChangesets.toString(), rowChangeset.toString(), this.rep.apool);
} else { } else {
allChangesets = rowChangeset; allChangesets = rowChangeset;
} }
} }
return this.applyChangeset(allChangesets); return this.applyChangeset(allChangesets as Builder);
} }
@ -127,9 +128,9 @@ export class AttributeManager {
* @param attribs an array of attributes * @param attribs an array of attributes
*/ */
setAttributesOnRangeByLine(row: number, startCol: number, endCol: number, attribs: Attribute[]) { setAttributesOnRangeByLine(row: number, startCol: number, endCol: number, attribs: Attribute[]) {
const builder = Changeset.builder(this.rep.lines.totalWidth); const builder = new Builder(this.rep.lines.totalWidth());
ChangesetUtils.buildKeepToStartOfRange(this.rep, builder, [row, startCol]); buildKeepToStartOfRange(this.rep, builder, [row, startCol]);
ChangesetUtils.buildKeepRange( buildKeepRange(
this.rep, builder, [row, startCol], [row, endCol], attribs, this.rep.apool); this.rep, builder, [row, startCol], [row, endCol], attribs, this.rep.apool);
return builder; return builder;
} }
@ -155,7 +156,7 @@ export class AttributeManager {
// get `attributeName` attribute of first char of line // get `attributeName` attribute of first char of line
const aline = this.rep.alines[lineNum]; const aline = this.rep.alines[lineNum];
if (!aline) return ''; if (!aline) return '';
const [op] = Changeset.deserializeOps(aline); const [op] = deserializeOps(aline);
if (op == null) return ''; if (op == null) return '';
return AttributeMap.fromString(op.attribs, this.rep.apool).get(attributeName) || ''; return AttributeMap.fromString(op.attribs, this.rep.apool).get(attributeName) || '';
} }
@ -168,9 +169,9 @@ export class AttributeManager {
// get attributes of first char of line // get attributes of first char of line
const aline = this.rep.alines[lineNum]; const aline = this.rep.alines[lineNum];
if (!aline) return []; if (!aline) return [];
const [op] = Changeset.deserializeOps(aline); const [op] = deserializeOps(aline);
if (op == null) return []; if (op == null) return [];
return [...attributes.attribsFromString(op.attribs, this.rep.apool)]; return [...attribsFromString(op.attribs, this.rep.apool)];
} }
/* /*
@ -226,7 +227,7 @@ export class AttributeManager {
let hasAttrib = true; let hasAttrib = true;
let indexIntoLine = 0; let indexIntoLine = 0;
for (const op of Changeset.deserializeOps(rep.alines[lineNum])) { for (const op of deserializeOps(rep.alines[lineNum])) {
const opStartInLine = indexIntoLine; const opStartInLine = indexIntoLine;
const opEndInLine = opStartInLine + op.chars; const opEndInLine = opStartInLine + op.chars;
if (!hasIt(op.attribs)) { if (!hasIt(op.attribs)) {
@ -264,10 +265,10 @@ export class AttributeManager {
// we need to sum up how much characters each operations take until the wanted position // we need to sum up how much characters each operations take until the wanted position
let currentPointer = 0; let currentPointer = 0;
for (const currentOperation of Changeset.deserializeOps(aline)) { for (const currentOperation of deserializeOps(aline)) {
currentPointer += currentOperation.chars; currentPointer += currentOperation.chars;
if (currentPointer <= column) continue; if (currentPointer <= column) continue;
return [...attributes.attribsFromString(currentOperation.attribs, this.rep.apool)]; return [...attribsFromString(currentOperation.attribs, this.rep.apool)];
} }
return []; return [];
} }
@ -290,14 +291,14 @@ export class AttributeManager {
*/ */
setAttributeOnLine(lineNum: number, attributeName: string, attributeValue: string) { setAttributeOnLine(lineNum: number, attributeName: string, attributeValue: string) {
let loc = [0, 0]; let loc: [number,number] = [0, 0];
const builder = Changeset.builder(this.rep.lines.totalWidth); const builder = new Builder(this.rep.lines.totalWidth());
const hasMarker = this.lineHasMarker(lineNum); const hasMarker = this.lineHasMarker(lineNum);
ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 0])); buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 0]));
if (hasMarker) { if (hasMarker) {
ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 1]), [ buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 1]), [
[attributeName, attributeValue], [attributeName, attributeValue],
], this.rep.apool); ], this.rep.apool);
} else { } else {
@ -320,11 +321,11 @@ export class AttributeManager {
* @param attributeValue if given only attributes with equal value will be removed * @param attributeValue if given only attributes with equal value will be removed
*/ */
removeAttributeOnLine(lineNum: number, attributeName: string, attributeValue?: string) { removeAttributeOnLine(lineNum: number, attributeName: string, attributeValue?: string) {
const builder = Changeset.builder(this.rep.lines.totalWidth); const builder = new Builder(this.rep.lines.totalWidth());
const hasMarker = this.lineHasMarker(lineNum); const hasMarker = this.lineHasMarker(lineNum);
let found = false; let found = false;
const attribs = this.getAttributesOnLine(lineNum).map((attrib) => { const attribs: Attribute[] = this.getAttributesOnLine(lineNum).map((attrib) => {
if (attrib[0] === attributeName && (!attributeValue || attrib[0] === attributeValue)) { if (attrib[0] === attributeName && (!attributeValue || attrib[0] === attributeValue)) {
found = true; found = true;
return [attrib[0], '']; return [attrib[0], ''];
@ -339,16 +340,16 @@ export class AttributeManager {
return; return;
} }
ChangesetUtils.buildKeepToStartOfRange(this.rep, builder, [lineNum, 0]); buildKeepToStartOfRange(this.rep, builder, [lineNum, 0]);
const countAttribsWithMarker = underscore.chain(attribs).filter((a) => !!a[1]) const countAttribsWithMarker = underscore.chain(attribs).filter((a) => !!a[1])
.map((a) => a[0]).difference(DEFAULT_LINE_ATTRIBUTES).size().value(); .map((a) => a[0]).difference(DEFAULT_LINE_ATTRIBUTES).size().value();
// if we have marker and any of attributes don't need to have marker. we need delete it // if we have marker and any of attributes don't need to have marker. we need delete it
if (hasMarker && !countAttribsWithMarker) { if (hasMarker && !countAttribsWithMarker) {
ChangesetUtils.buildRemoveRange(this.rep, builder, [lineNum, 0], [lineNum, 1]); buildRemoveRange(this.rep, builder, [lineNum, 0], [lineNum, 1]);
} else { } else {
ChangesetUtils.buildKeepRange( buildKeepRange(
this.rep, builder, [lineNum, 0], [lineNum, 1], attribs, this.rep.apool); this.rep, builder, [lineNum, 0], [lineNum, 1], attribs, this.rep.apool);
} }
@ -379,7 +380,8 @@ export class AttributeManager {
hasAttrib = this.getAttributeOnSelection(attributeName); hasAttrib = this.getAttributeOnSelection(attributeName);
} else { } else {
const attributesOnCaretPosition = this.getAttributesOnCaret(); const attributesOnCaretPosition = this.getAttributesOnCaret();
const allAttribs = [].concat(...attributesOnCaretPosition) as string[]; // flatten const allAttribs = new Array<Attribute>(...attributesOnCaretPosition); // flatten
// @ts-ignore
hasAttrib = allAttribs.includes(attributeName); hasAttrib = allAttribs.includes(attributeName);
} }
return hasAttrib; return hasAttrib;

View file

@ -43,7 +43,7 @@ export class Builder {
* attribute key, value pairs. * attribute key, value pairs.
* @returns {Builder} this * @returns {Builder} this
*/ */
keep = (N: number, L: number, attribs?: string|Attribute[], pool?: AttributePool): Builder => { keep = (N: number, L?: number, attribs?: string|Attribute[], pool?: AttributePool): Builder => {
this.o.opcode = '='; this.o.opcode = '=';
this.o.attribs = typeof attribs === 'string' this.o.attribs = typeof attribs === 'string'
? attribs : new AttributeMap(pool).update(attribs || []).toString(); ? attribs : new AttributeMap(pool).update(attribs || []).toString();

View file

@ -9,6 +9,7 @@ import {RepModel} from "./types/RepModel";
import {ChangeSetBuilder} from "./types/ChangeSetBuilder"; import {ChangeSetBuilder} from "./types/ChangeSetBuilder";
import {Attribute} from "./types/Attribute"; import {Attribute} from "./types/Attribute";
import AttributePool from "./AttributePool"; import AttributePool from "./AttributePool";
import {Builder} from "./Builder";
/** /**
* Copyright 2009 Google Inc. * Copyright 2009 Google Inc.
@ -49,7 +50,7 @@ export const buildKeepRange = (rep: RepModel, builder: ChangeSetBuilder, start:
} }
}; };
export const buildKeepToStartOfRange = (rep: RepModel, builder: ChangeSetBuilder, start: [number, number]) => { export const buildKeepToStartOfRange = (rep: RepModel, builder: Builder, start: [number, number]) => {
const startLineOffset = rep.lines.offsetOfIndex(start[0]); const startLineOffset = rep.lines.offsetOfIndex(start[0]);
builder.keep(startLineOffset, start[0]); builder.keep(startLineOffset, start[0]);
@ -62,7 +63,7 @@ export const buildKeepToStartOfRange = (rep: RepModel, builder: ChangeSetBuilder
* @param {string} str - string of the number in base 36 * @param {string} str - string of the number in base 36
* @returns {number} number * @returns {number} number
*/ */
export const parseNum = (str: string) => parseInt(str, 36); export const parseNum = (str: string): number => parseInt(str, 36);
/** /**
* Writes a number in base 36 and puts it in a string. * Writes a number in base 36 and puts it in a string.

View file

@ -38,21 +38,20 @@ import html10n from './vendors/html10n'
const Cookies = require('./pad_utils').Cookies; const Cookies = require('./pad_utils').Cookies;
const chat = require('./chat').chat; const chat = require('./chat').chat;
import Collab_client, {CollabClient} from './collab_client' import Collab_client, {CollabClient} from './collab_client'
const padconnectionstatus = require('./pad_connectionstatus').padconnectionstatus; import {padconnectionstatus} from "./pad_connectionstatus";
import padcookie from "./pad_cookie"; import padcookie from "./pad_cookie";
import {padeditbar} from "./pad_editbar";
const padeditbar = require('./pad_editbar').padeditbar;
import {padEditor as padeditor} from './pad_editor' import {padEditor as padeditor} from './pad_editor'
const padimpexp = require('./pad_impexp').padimpexp; const padimpexp = require('./pad_impexp').padimpexp;
const padmodals = require('./pad_modals').padmodals; const padmodals = require('./pad_modals').padmodals;
const padsavedrevs = require('./pad_savedrevs'); import {} from './pad_savedrevs';
const paduserlist = require('./pad_userlist').paduserlist; const paduserlist = require('./pad_userlist').paduserlist;
import {padUtils as padutils} from "./pad_utils"; import {padUtils as padutils} from "./pad_utils";
const colorutils = require('./colorutils').colorutils; const colorutils = require('./colorutils').colorutils;
const randomString = require('./pad_utils').randomString; const randomString = require('./pad_utils').randomString;
import connect from './socketio' import connect from './socketio'
import {ClientSendMessages, ClientVarData, ClientVarMessage, HistoricalAuthorData, PadOption, SocketClientReadyMessage, SocketIOMessage, UserInfo} from "./types/SocketIOMessage"; import {ClientDisconnectedMessage, ClientSendMessages, ClientVarData, ClientVarMessage, HistoricalAuthorData, PadOption, SocketClientReadyMessage, SocketIOMessage, UserInfo} from "./types/SocketIOMessage";
import {MapArrayType} from "../../node/types/MapType"; import {MapArrayType} from "../../node/types/MapType";
import {ChangeSetLoader} from "./timeslider"; import {ChangeSetLoader} from "./timeslider";
@ -341,7 +340,7 @@ const handshake = async () => {
} }
} else if ("disconnect" in obj && obj.disconnect) { } else if ("disconnect" in obj && obj.disconnect) {
padconnectionstatus.disconnected(obj.disconnect); padconnectionstatus.disconnected(obj.disconnect as ClientDisconnectedMessage);
socket.disconnect(); socket.disconnect();
// block user from making any change to the pad // block user from making any change to the pad
@ -477,7 +476,7 @@ export class Pad {
this.myUserInfo = { this.myUserInfo = {
userId: window.clientVars.userId, userId: window.clientVars.userId,
name: window.clientVars.userName, name: window.clientVars.userName!,
ip: this.getClientIp(), ip: this.getClientIp(),
colorId: window.clientVars.userColor, colorId: window.clientVars.userColor,
}; };

View file

@ -23,6 +23,7 @@
*/ */
import {padModals} from "./pad_modals"; import {padModals} from "./pad_modals";
import {ClientDisconnectedMessage} from "./types/SocketIOMessage";
class PadConnectionStatus { class PadConnectionStatus {
private status: { private status: {
@ -55,12 +56,13 @@ class PadConnectionStatus {
} }
disconnected disconnected
= =
(msg: string) => { (msg: ClientDisconnectedMessage) => {
if (this.status.what === 'disconnected') return; if (this.status.what === 'disconnected') return;
this.status = this.status =
{ {
what: 'disconnected', what: 'disconnected',
// @ts-ignore
why: msg, why: msg,
} }

View file

@ -501,6 +501,6 @@ class Padeditbar {
} }
}); });
} }
}; }
export const padeditbar = new PadEditor() export const padeditbar = new PadEditor()

View file

@ -5,8 +5,6 @@
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */
import {PadType} from "../../node/types/PadType";
/** /**
* Copyright 2009 Google Inc. * Copyright 2009 Google Inc.
* *
@ -48,9 +46,9 @@ export class PadEditor {
this.viewZoom = 100 this.viewZoom = 100
} }
init = async (initialViewOptions: MapArrayType<boolean>, _pad: Pad) => { init = async (initialViewOptions?: MapArrayType<boolean>, _pad?: Pad) => {
this.pad = _pad; this.pad = _pad;
this.settings = this.pad.settings; this.settings = this.pad!.settings;
this.ace = new Ace2Editor(); this.ace = new Ace2Editor();
await this.ace.init('editorcontainer', ''); await this.ace.init('editorcontainer', '');
$('#editorloadingbox').hide(); $('#editorloadingbox').hide();
@ -175,7 +173,9 @@ export class PadEditor {
} }
} }
restoreRevisionText= (dataFromServer: ClientVarPayload) => { restoreRevisionText= (dataFromServer: ClientVarPayload) => {
// @ts-ignore
this.pad!.addHistoricalAuthors(dataFromServer.historicalAuthorData); this.pad!.addHistoricalAuthors(dataFromServer.historicalAuthorData);
// @ts-ignore
this.ace!.importAText(dataFromServer.atext, dataFromServer.apool, true); this.ace!.importAText(dataFromServer.atext, dataFromServer.apool, true);
} }

View file

@ -2,7 +2,7 @@
import {Part} from "./plugin_defs"; import {Part} from "./plugin_defs";
const fs = require('fs').promises; import {promises as fs} from 'fs'
import {aCallAll} from './hooks'; import {aCallAll} from './hooks';
import log4js from 'log4js'; import log4js from 'log4js';
import path from 'path'; import path from 'path';
@ -158,7 +158,7 @@ const loadPlugin = async (packages: MapArrayType<IPluginInfoExtended>, pluginNa
try { try {
const data = await fs.readFile(pluginPath); const data = await fs.readFile(pluginPath);
try { try {
const plugin = JSON.parse(data); const plugin = JSON.parse(data.toString());
plugin.package = packages[pluginName]; plugin.package = packages[pluginName];
plugins[pluginName] = plugin; plugins[pluginName] = plugin;
for (const part of plugin.parts) { for (const part of plugin.parts) {

View file

@ -214,3 +214,6 @@ export class BrowserDetector {
return false; return false;
} }
} }
const browser = new BrowserDetector()
export default browser

View file

@ -1,3 +1,6 @@
import browser from '../static/js/vendors/browser'
import {padeditbar} from '../static/js/pad_editbar'
import {padImpExp} from '../static/js/pad_impexp'
(async () => { (async () => {
@ -6,6 +9,7 @@
window.clientVars = { window.clientVars = {
// This is needed to fetch /pluginfw/plugin-definitions.json, which happens before the server // This is needed to fetch /pluginfw/plugin-definitions.json, which happens before the server
// sends the CLIENT_VARS message. // sends the CLIENT_VARS message.
// @ts-ignore
randomVersionString: <%-JSON.stringify(settings.randomVersionString)%>, randomVersionString: <%-JSON.stringify(settings.randomVersionString)%>,
} }
@ -14,7 +18,7 @@
const basePath = new URL('..', window.location.href).pathname; const basePath = new URL('..', window.location.href).pathname;
window.$ = window.jQuery = require('../../src/static/js/vendors/jquery'); window.$ = window.jQuery = require('../../src/static/js/vendors/jquery');
window.browser = require('../static/js/vendors/browser'); window.browser = browser;
const pad = require('../../src/static/js/pad'); const pad = require('../../src/static/js/pad');
pad.baseURL = basePath; pad.baseURL = basePath;
window.plugins = require('../../src/static/js/pluginfw/client_plugins'); window.plugins = require('../../src/static/js/pluginfw/client_plugins');
@ -23,8 +27,8 @@
// TODO: These globals shouldn't exist. // TODO: These globals shouldn't exist.
window.pad = pad.pad; window.pad = pad.pad;
window.chat = require('../../src/static/js/chat').chat; window.chat = require('../../src/static/js/chat').chat;
window.padeditbar = require('../static/js/pad_editbar').padeditbar; window.padeditbar = padeditbar;
window.padimpexp = require('../static/js/pad_impexp').padimpexp; window.padimpexp = padimpexp;
await import('../../src/static/js/skin_variants') await import('../../src/static/js/skin_variants')
await import('../../src/static/js/basic_error_handler') await import('../../src/static/js/basic_error_handler')

View file

@ -1,6 +1,8 @@
// @license magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7&dn=apache-2.0.txt // @license magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7&dn=apache-2.0.txt
import {setBaseURl} from "ep_etherpad-lite/static/js/timeslider"; import {setBaseURl} from "ep_etherpad-lite/static/js/timeslider";
import {padeditbar as padbar} from '../static/js/pad_editbar'
import {padImpExp as padExp} from '../static/js/pad_impexp'
window.clientVars = { window.clientVars = {
// This is needed to fetch /pluginfw/plugin-definitions.json, which happens before the // This is needed to fetch /pluginfw/plugin-definitions.json, which happens before the
@ -31,8 +33,8 @@ import * as timeSlider from 'ep_etherpad-lite/static/js/timeslider'
/* TODO: These globals shouldn't exist. */ /* TODO: These globals shouldn't exist. */
}); });
const padeditbar = require('src/static/js/pad_editbar').padeditbar; const padeditbar = padbar;
const padimpexp = require('src/static/js/pad_impexp').padimpexp; const padimpexp = padExp;
setBaseURl(baseURL) setBaseURl(baseURL)
timeSlider.init(); timeSlider.init();
padeditbar.init() padeditbar.init()