Compare commits

..

1 Commits
pom ... fix-ofd

Author SHA1 Message Date
kl
660905ffe6 修复 ofd 预览功能影响 office 预览的问题 2021-06-17 18:10:37 +08:00
15054 changed files with 636255 additions and 2286494 deletions

View File

@@ -1,24 +0,0 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml

View File

@@ -1,53 +0,0 @@
version: '1.0'
name: branch-pipeline
displayName: BranchPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@maven
name: build_maven
displayName: Maven 构建
# 支持67891011六个版本
jdkVersion: 8
# 支持2.2.13.2.53.3.93.5.23.5.33.5.43.6.13.6.3八个版本
mavenVersion: 3.3.9
# 构建命令
commands:
- mvn -B clean package -Dmaven.test.skip=true
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径是指代码编译完毕之后构建物的所在路径如通常jar包在target目录下当前目录为代码库根目录
path:
- ./server/target
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_maven
- stage:
name: release
displayName: 发布
steps:
- step: publish@release_artifacts
name: publish_release_artifacts
displayName: '发布'
# 上游上传制品任务的产出
dependArtifact: output
# 发布制品版本号
version: '1.0.0.0'
# 是否开启版本号自增默认开启
autoIncrement: true
triggers:
push:
branches:
exclude:
- master
include:
- .*

View File

@@ -1,51 +0,0 @@
version: '1.0'
name: master-pipeline
displayName: MasterPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@maven
name: build_maven
displayName: Maven 构建
# 支持67891011六个版本
jdkVersion: 8
# 支持2.2.13.2.53.3.93.5.23.5.33.5.43.6.13.6.3八个版本
mavenVersion: 3.3.9
# 构建命令
commands:
- mvn -B clean package -Dmaven.test.skip=true
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径是指代码编译完毕之后构建物的所在路径如通常jar包在target目录下当前目录为代码库根目录
path:
- ./server/target
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_maven
- stage:
name: release
displayName: 发布
steps:
- step: publish@release_artifacts
name: publish_release_artifacts
displayName: '发布'
# 上游上传制品任务的产出
dependArtifact: output
# 发布制品版本号
version: '1.0.0.0'
# 是否开启版本号自增默认开启
autoIncrement: true
triggers:
push:
branches:
include:
- master

View File

@@ -1,40 +0,0 @@
version: '1.0'
name: pr-pipeline
displayName: PRPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@maven
name: build_maven
displayName: Maven 构建
# 支持67891011六个版本
jdkVersion: 8
# 支持2.2.13.2.53.3.93.5.23.5.33.5.43.6.13.6.3八个版本
mavenVersion: 3.3.9
# 构建命令
commands:
- mvn -B clean package -Dmaven.test.skip=true
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径是指代码编译完毕之后构建物的所在路径如通常jar包在target目录下当前目录为代码库根目录
path:
- ./server/target
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 构建产物制品库默认default系统默认创建
artifactRepository: default
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_maven
triggers:
pr:
branches:
include:
- master

View File

@@ -1,36 +0,0 @@
version: '1.0'
name: pipeline-20220716
displayName: pipeline-20220716
triggers:
trigger: manual
push:
branches:
prefix:
- ''
stages:
- name: stage-8b46aafe
displayName: 未命名
strategy: naturally
trigger: auto
executor: []
steps:
- step: build@maven
name: build_maven
displayName: Maven 构建
jdkVersion: '8'
mavenVersion: 3.3.9
commands:
- mvn -B clean package -Dmaven.test.skip=true
artifacts:
- name: BUILD_ARTIFACT
path:
- ./server/target
settings: []
caches:
- ~/.m2
notify: []
strategy:
retry: '0'
permissions:
- role: admin
members: []

View File

@@ -1,5 +1,41 @@
FROM keking/kkfileview-jdk:4.1.1
FROM ubuntu:20.04
MAINTAINER chenjh "842761733@qq.com"
ADD server/target/kkFileView-*.tar.gz /opt/
ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-4.1.0-SNAPSHOT/bin
ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dspring.config.location=/opt/kkFileView-4.1.0-SNAPSHOT/config/application.properties","-jar","/opt/kkFileView-4.1.0-SNAPSHOT/bin/kkFileView-4.1.0-SNAPSHOT.jar"]
COPY fonts/* /usr/share/fonts/chienes/
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" > /etc/apt/sources.list &&\
apt-get clean && apt-get update &&\
apt-get install -y locales && apt-get install -y language-pack-zh-hans &&\
localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8 && locale-gen zh_CN.UTF-8 &&\
apt-get install -y tzdata && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &&\
apt-get install -y libxrender1 && apt-get install -y libxt6 && apt-get install -y libxext-dev && apt-get install -y libfreetype6-dev &&\
apt-get install -y wget && apt-get install -y ttf-mscorefonts-installer && apt-get install -y fontconfig &&\
apt-get install ttf-wqy-microhei &&\
apt-get install ttf-wqy-zenhei &&\
apt-get install xfonts-wqy &&\
cd /tmp &&\
wget https://kkfileview.keking.cn/server-jre-8u251-linux-x64.tar.gz &&\
tar -zxf /tmp/server-jre-8u251-linux-x64.tar.gz && mv /tmp/jdk1.8.0_251 /usr/local/ &&\
# 安装 OpenOffice
wget https://kkfileview.keking.cn/Apache_OpenOffice_4.1.6_Linux_x86-64_install-deb_zh-CN.tar.gz -cO openoffice_deb.tar.gz &&\
tar -zxf /tmp/openoffice_deb.tar.gz && cd /tmp/zh-CN/DEBS &&\
dpkg -i *.deb && dpkg -i desktop-integration/openoffice4.1-debian-menus_4.1.6-9790_all.deb &&\
# 安装 libreoffice
# apt-get install -y libxinerama1 libcairo2 libcups2 libx11-xcb1 &&\
# wget https://mirrors.cloud.tencent.com/libreoffice/libreoffice/stable/7.1.3/deb/x86_64/LibreOffice_7.1.3_Linux_x86-64_deb.tar.gz -cO libreoffice_deb.tar.gz &&\
# tar -zxf /tmp/libreoffice_deb.tar.gz && cd /tmp/LibreOffice_7.1.3.2_Linux_x86-64_deb/DEBS &&\
# dpkg -i *.deb &&\
rm -rf /tmp/* && rm -rf /var/lib/apt/lists/* &&\
cd /usr/share/fonts/chienes &&\
mkfontscale &&\
mkfontdir &&\
fc-cache -fv
ENV JAVA_HOME /usr/local/jdk1.8.0_251
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV PATH $PATH:$JAVA_HOME/bin
ENV LANG zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8
ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-3.5.1/bin
ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider","-Dspring.config.location=/opt/kkFileView-3.5.1/config/application.properties","-jar","/opt/kkFileView-3.5.1/bin/kkFileView-3.5.1.jar"]

View File

@@ -1,4 +1,4 @@
# kkFileView
# file-online-preview
[![GitHub license](https://img.shields.io/github/license/kekingcn/kkFileView.svg?style=flat-square)](https://github.com/kekingcn/kkFileView/blob/master/LICENSE)

View File

@@ -1,4 +1,4 @@
# kkFileView
# file-online-preview
此项目为文件文档在线预览项目解决方案对标业内付费产品有[永中office](http://dcs.yozosoft.com/)】【[office365](http://www.officeweb365.com/)】【[idocv](https://www.idocv.com/)】等在取得公司高层同意后以Apache协议开源出来反哺社区在此特别感谢@唐老大的支持以及@端木详笑的贡献。该项目使用流行的spring boot搭建易上手和部署基本支持主流办公文档的在线预览如doc,docx,Excel,pdf,txt,zip,rar,图片等等
### 项目特性
@@ -110,25 +110,6 @@ pdf预览模式预览效果如下
### 历史更新记录
> 2021年7月6日v4.0.0 版本发布
1. 底层集成OpenOffice替换为LibreOfficeOffice文件兼容性增强预览效果提升
2. 修复压缩文件目录穿越漏洞
3. 修复PPT预览使用PDF模式无效
4. 修复PPT图片预览模式前端显示异常
5. 新增功能首页文件上传功能可通过配置实时开启或禁用
6. 优化增加Office进程关闭日志
7. 优化Windows环境下查找Office组件逻辑(内置的LibreOffice优先)
8. 优化启动Office进程改同步执行
> 2021年6月17日v3.6.0 版本发布
ofd 类型文件支持版本本次版本重要功能均由社区开发贡献感谢 @gaoxingzaq@zhangxiaoxiao9527 的代码贡献
1. 新增 ofd 类型文件预览支持ofd 是国产的类似 pdf 格式的文件
2. 新增了 ffmpeg 视频文件转码预览支持打开转码功能后理论上支持所有主流视频的预览 rmrmvbflv
3. 美化了 pptpptx 类型文件预览效果比之前版本好看太多
4. 更新了 pdfboxxstreamcommon-io 等依赖的版本
> 2021年1月28日
2020农历年最后一个版本发布主要包含了部分 UI 改进和解决了 QQ 群友 Issue 里反馈的 Bug 修复最最重要的是发个新版过个好年

View File

@@ -1,38 +0,0 @@
FROM ubuntu:20.04
MAINTAINER chenjh "842761733@qq.com"
# 内置一些常用的中文字体,避免普遍性乱码
COPY fonts/* /usr/share/fonts/chinese/
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" > /etc/apt/sources.list &&\
apt-get clean && apt-get update &&\
apt-get install -y locales && apt-get install -y language-pack-zh-hans &&\
localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8 && locale-gen zh_CN.UTF-8 &&\
export DEBIAN_FRONTEND=noninteractive &&\
apt-get install -y tzdata && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &&\
apt-get install -y libxrender1 && apt-get install -y libxt6 && apt-get install -y libxext-dev && apt-get install -y libfreetype6-dev &&\
apt-get install -y wget && apt-get install -y ttf-mscorefonts-installer && apt-get install -y fontconfig &&\
apt-get install ttf-wqy-microhei &&\
apt-get install ttf-wqy-zenhei &&\
apt-get install xfonts-wqy &&\
cd /tmp &&\
wget https://kkfileview.keking.cn/server-jre-8u251-linux-x64.tar.gz &&\
tar -zxf /tmp/server-jre-8u251-linux-x64.tar.gz && mv /tmp/jdk1.8.0_251 /usr/local/ &&\
# 安装 libreoffice
apt-get install -y libxinerama1 libcairo2 libcups2 libx11-xcb1 &&\
wget https://kkfileview.keking.cn/LibreOffice_7.1.4_Linux_x86-64_deb.tar.gz -cO libreoffice_deb.tar.gz &&\
tar -zxf /tmp/libreoffice_deb.tar.gz && cd /tmp/LibreOffice_7.1.4.2_Linux_x86-64_deb/DEBS &&\
dpkg -i *.deb &&\
# 清理临时文件
rm -rf /tmp/* && rm -rf /var/lib/apt/lists/* &&\
cd /usr/share/fonts/chinese &&\
mkfontscale &&\
mkfontdir &&\
fc-cache -fv
ENV JAVA_HOME /usr/local/jdk1.8.0_251
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV PATH $PATH:$JAVA_HOME/bin
ENV LANG zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8
ENTRYPOINT ["java","-version"]

View File

@@ -1,2 +0,0 @@
# 执行如下命令构建基础镜像加快kkfileview docker镜像构建与发布
docker build --tag keking/kkfileview-jdk:4.1.1 .

View File

@@ -3,10 +3,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>kkFileView-parent</artifactId>
<artifactId>filepreview</artifactId>
<groupId>cn.keking</groupId>
<version>4.1.0-SNAPSHOT</version>
<version>3.5.1</version>
</parent>
<artifactId>office-plugin</artifactId>
@@ -26,9 +27,19 @@
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.libreoffice</groupId>
<artifactId>libreoffice</artifactId>
<version>7.1.4</version>
<groupId>org.openoffice</groupId>
<artifactId>juh</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.openoffice</groupId>
<artifactId>ridl</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.openoffice</groupId>
<artifactId>unoil</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<!-- for the command line tool -->
@@ -75,6 +86,16 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>

View File

@@ -12,6 +12,18 @@
//
package org.artofsolving.jodconverter;
import static org.artofsolving.jodconverter.office.OfficeUtils.SERVICE_DESKTOP;
import static org.artofsolving.jodconverter.office.OfficeUtils.cast;
import static org.artofsolving.jodconverter.office.OfficeUtils.toUnoProperties;
import static org.artofsolving.jodconverter.office.OfficeUtils.toUrl;
import java.io.File;
import java.util.Map;
import org.artofsolving.jodconverter.office.OfficeContext;
import org.artofsolving.jodconverter.office.OfficeException;
import org.artofsolving.jodconverter.office.OfficeTask;
import com.sun.star.frame.XComponentLoader;
import com.sun.star.frame.XStorable;
import com.sun.star.io.IOException;
@@ -20,14 +32,6 @@ import com.sun.star.lang.XComponent;
import com.sun.star.task.ErrorCodeIOException;
import com.sun.star.util.CloseVetoException;
import com.sun.star.util.XCloseable;
import org.artofsolving.jodconverter.office.OfficeContext;
import org.artofsolving.jodconverter.office.OfficeException;
import org.artofsolving.jodconverter.office.OfficeTask;
import java.io.File;
import java.util.Map;
import static org.artofsolving.jodconverter.office.OfficeUtils.*;
public abstract class AbstractConversionTask implements OfficeTask {
@@ -43,7 +47,6 @@ public abstract class AbstractConversionTask implements OfficeTask {
protected abstract Map<String,?> getStoreProperties(File outputFile, XComponent document);
@Override
public void execute(OfficeContext context) throws OfficeException {
XComponent document = null;
try {
@@ -76,7 +79,6 @@ public abstract class AbstractConversionTask implements OfficeTask {
}
XComponentLoader loader = cast(XComponentLoader.class, context.getService(SERVICE_DESKTOP));
Map<String,?> loadProperties = getLoadProperties(inputFile);
XComponent document = null;
try {
document = loader.loadComponentFromURL(toUrl(inputFile), "_blank", 0, toUnoProperties(loadProperties));

View File

@@ -12,18 +12,18 @@
//
package org.artofsolving.jodconverter;
import com.sun.star.document.UpdateDocMode;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.io.FilenameUtils;
import org.artofsolving.jodconverter.document.DefaultDocumentFormatRegistry;
import org.artofsolving.jodconverter.document.DocumentFormat;
import org.artofsolving.jodconverter.document.DocumentFormatRegistry;
import org.artofsolving.jodconverter.model.FileProperties;
import org.artofsolving.jodconverter.office.OfficeException;
import org.artofsolving.jodconverter.office.OfficeManager;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import com.sun.star.document.UpdateDocMode;
public class OfficeDocumentConverter {
@@ -60,22 +60,14 @@ public class OfficeDocumentConverter {
public void convert(File inputFile, File outputFile) throws OfficeException {
String outputExtension = FilenameUtils.getExtension(outputFile.getName());
DocumentFormat outputFormat = formatRegistry.getFormatByExtension(outputExtension);
convert(inputFile, outputFile, outputFormat, null);
convert(inputFile, outputFile, outputFormat);
}
public void convert(File inputFile, File outputFile, FileProperties fileProperties) throws OfficeException {
String outputExtension = FilenameUtils.getExtension(outputFile.getName());
DocumentFormat outputFormat = formatRegistry.getFormatByExtension(outputExtension);
convert(inputFile, outputFile, outputFormat, fileProperties);
}
public void convert(File inputFile, File outputFile, DocumentFormat outputFormat, FileProperties fileProperties) throws OfficeException {
public void convert(File inputFile, File outputFile, DocumentFormat outputFormat) throws OfficeException {
String inputExtension = FilenameUtils.getExtension(inputFile.getName());
DocumentFormat inputFormat = formatRegistry.getFormatByExtension(inputExtension);
Map<String, Object> properties = fileProperties.toMap();
properties.putAll(defaultLoadProperties);
StandardConversionTask conversionTask = new StandardConversionTask(inputFile, outputFile, outputFormat);
conversionTask.setDefaultLoadProperties(properties);
conversionTask.setDefaultLoadProperties(defaultLoadProperties);
conversionTask.setInputFormat(inputFormat);
officeManager.execute(conversionTask);
}

View File

@@ -1,34 +0,0 @@
package org.artofsolving.jodconverter.model;
import java.util.HashMap;
import java.util.Map;
/**
* Created by kl on 2018/1/17.
* Content :
*/
public class FileProperties {
private String filePassword;
public FileProperties() {
}
public Map<String, Object> toMap() {
Map<String, Object> map = new HashMap();
if (filePassword != null) {
map.put("Password", filePassword);
}
return map;
}
public String getFilePassword() {
return filePassword;
}
public void setFilePassword(String filePassword) {
this.filePassword = filePassword;
}
}

View File

@@ -87,10 +87,9 @@ public class OfficeUtils {
programFiles = System.getenv("ProgramFiles");
}
return findOfficeHome(
officePluginPath + File.separator + "windows-office",
programFiles + File.separator + "LibreOffice",
programFiles + File.separator + "OpenOffice 4",
programFiles + File.separator + "LibreOffice 4"
programFiles + File.separator + "OpenOffice 4",
programFiles + File.separator + "LibreOffice 4",
officePluginPath + File.separator + "windows-office"
);
} else if (PlatformUtils.isMac()) {
return findOfficeHome(
@@ -104,14 +103,6 @@ public class OfficeUtils {
"/opt/openoffice.org3",
"/opt/openoffice",
"/opt/libreoffice",
"/opt/libreoffice6.0",
"/opt/libreoffice6.1",
"/opt/libreoffice6.2",
"/opt/libreoffice6.3",
"/opt/libreoffice6.4",
"/opt/libreoffice7.0",
"/opt/libreoffice7.1",
"/opt/libreoffice7.2",
"/opt/openoffice4",
"/usr/lib/openoffice",
"/usr/lib/libreoffice"

View File

@@ -29,44 +29,22 @@ public class ConfigUtils {
return userDir;
}
// 获取环境变量,如果找不到则返回默认值
@SuppressWarnings("SameParameterValue")
private static String getEnvOrDefault(String key, String def) {
String value = System.getenv(key);
return value == null ? def : value;
}
// 返回参数列表中第一个真实存在的路径,或者 null
private static String firstExists(File... paths) {
for (File path : paths) {
if (path.exists()) {
return path.getAbsolutePath();
}
}
return null;
}
public static String getOfficePluginPath() {
String userDir = System.getProperty("user.dir");
String binFolder = getEnvOrDefault("KKFILEVIEW_BIN_FOLDER", userDir);
File pluginPath = new File(binFolder);
// 如果指定了 bin 或其父目录,则返回父目录
// 否则在当前目录和父目录中寻找 office-plugin
if (new File(pluginPath, "bin").exists()) {
return pluginPath.getAbsolutePath();
} else if (pluginPath.exists() && pluginPath.getName().equals("bin")) {
return pluginPath.getParentFile().getAbsolutePath();
String userDir = System.getenv("KKFILEVIEW_BIN_FOLDER");
if (userDir == null) {
userDir = System.getProperty("user.dir");
}
if (userDir.endsWith("bin")) {
userDir = userDir.substring(0, userDir.length() - 4);
} else {
return firstExists(
new File(pluginPath, OFFICE_PLUGIN_NAME),
new File(pluginPath.getParentFile(), OFFICE_PLUGIN_NAME)
);
String separator = File.separator;
if (!userDir.contains(OFFICE_PLUGIN_NAME)) {
userDir = userDir + separator + OFFICE_PLUGIN_NAME;
}
}
return userDir;
}
public static String getCustomizedConfigPath() {
String homePath = getHomePath();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,100 +0,0 @@
/*
MIT License
Copyright (c) 2016 Edenspiekermann
*/
(function () {
'use strict';
var internalId = 0;
var togglesMap = {};
var targetsMap = {};
function $ (selector, context) {
return Array.prototype.slice.call(
(context || document).querySelectorAll(selector)
);
}
function getClosestToggle (element) {
if (element.closest) {
return element.closest('[data-a11y-toggle]');
}
while (element) {
if (element.nodeType === 1 && element.hasAttribute('data-a11y-toggle')) {
return element;
}
element = element.parentNode;
}
return null;
}
function handleToggle (toggle) {
var target = toggle && targetsMap[toggle.getAttribute('aria-controls')];
if (!target) {
return false;
}
var toggles = togglesMap['#' + target.id];
var isExpanded = target.getAttribute('aria-hidden') === 'false';
target.setAttribute('aria-hidden', isExpanded);
toggles.forEach(function (toggle) {
toggle.setAttribute('aria-expanded', !isExpanded);
});
}
var initA11yToggle = function (context) {
togglesMap = $('[data-a11y-toggle]', context).reduce(function (acc, toggle) {
var selector = '#' + toggle.getAttribute('data-a11y-toggle');
acc[selector] = acc[selector] || [];
acc[selector].push(toggle);
return acc;
}, togglesMap);
var targets = Object.keys(togglesMap);
targets.length && $(targets).forEach(function (target) {
var toggles = togglesMap['#' + target.id];
var isExpanded = target.hasAttribute('data-a11y-toggle-open');
var labelledby = [];
toggles.forEach(function (toggle) {
toggle.id || toggle.setAttribute('id', 'a11y-toggle-' + internalId++);
toggle.setAttribute('aria-controls', target.id);
toggle.setAttribute('aria-expanded', isExpanded);
labelledby.push(toggle.id);
});
target.setAttribute('aria-hidden', !isExpanded);
target.hasAttribute('aria-labelledby') || target.setAttribute('aria-labelledby', labelledby.join(' '));
targetsMap[target.id] = target;
});
};
document.addEventListener('DOMContentLoaded', function () {
initA11yToggle();
});
document.addEventListener('click', function (event) {
var toggle = getClosestToggle(event.target);
handleToggle(toggle);
});
document.addEventListener('keyup', function (event) {
if (event.which === 13 || event.which === 32) {
var toggle = getClosestToggle(event.target);
if (toggle && toggle.getAttribute('role') === 'button') {
handleToggle(toggle);
}
}
});
window && (window.a11yToggle = initA11yToggle);
})();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,46 +0,0 @@
<!DOCTYPE html>
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' piwik.documentfoundation.org"/>
</head>
<body>
<script type="text/javascript">
function getParameterByName(name, url) {
if (!url) {
url = window.location.href;
}
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)");
var results = regex.exec(url);
if (!results) {
return null;
}
if (!results[2]) {
return '';
}
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
var url = window.location.href;
var n = url.indexOf('?');
if (n != -1) {
// the URL came from LibreOffice help (F1)
var version = getParameterByName("Version", url);
var query = url.substr(n + 1, url.length);
var newURL = version + '/index.html?' + query;
window.location.replace(newURL);
} else {
window.location.replace('latest/index.html');
}
</script>
</body>
</html>

View File

@@ -1,188 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// Pagination and fuzzy search
var url = window.location.pathname;
var moduleRegex = new RegExp('text\\/(\\w+)\\/');
var regexArray = moduleRegex.exec(url);
var modules = ['CALC', 'WRITER', 'IMPRESS', 'DRAW', 'BASE', 'MATH', 'CHART', 'BASIC', 'SHARED'];
var indexEl = document.getElementsByClassName("index")[0];
var fullLinks = fullLinkify(indexEl, bookmarks, modules, currentModule());
var search = document.getElementById('search-bar');
search.addEventListener('keyup', debounce(filter, 100, indexEl));
// Preserve search input value during the session
search.value = sessionStorage.getItem('searchsave');
if (search.value !== undefined) {
filter(indexEl);
}
window.addEventListener('unload', function(event) {
sessionStorage.setItem('searchsave', search.value);
});
// render the unfiltered index list on page load
fillIndex(indexEl, fullLinks, modules);
function currentModule() {
var module = '';
// get the module name from the URL and remove the first character,
// but first deal with snowflake Base
if(url.indexOf('explorer/database/') !== -1) {
module = 'BASE';
} else {
if (null === regexArray){// comes from search or elsewhere, no defined module in URL
module = 'HARED'
} else {
module = regexArray[1].toUpperCase().substring(1);
}
}
return module;
};
function fullLinkify(indexEl, bookmarks, modules, currentModule) {
var fullLinkified = '';
// if user is not on a shared category page, limit the index to the current module + shared
if(currentModule !== 'HARED') {
bookmarks = bookmarks.filter(function(obj) {
return obj['app'] === currentModule || obj['app'] === 'SHARED';
});
}
bookmarks.forEach(function(obj) {
fullLinkified += '<a href="' + obj['url'] + '" class="' + obj['app'] + '">' + obj['text'] + '</a>';
});
return fullLinkified;
}
function fillIndex(indexEl, content, modules) {
indexEl.innerHTML = content;
var indexKids = indexEl.children;
for (var i = 0, len = indexKids.length; i < len; i++) {
indexKids[i].removeAttribute("id");
}
modules.forEach(function(module) {
var moduleHeader = indexEl.getElementsByClassName(module)[0];
if (typeof moduleHeader !== 'undefined') {
// let's wrap the header in a span, so the ::before element will not become a link
moduleHeader.outerHTML = '<span id="' + module + '" class="' + module + '">' + moduleHeader.outerHTML + '</span>';
}
});
Paginator(indexEl);
}
// filter the index list based on search field input
function filter(indexList) {
var results = null;
var target = search.value.trim();
var filtered = '';
if (target.length < 1) {
fillIndex(indexEl, fullLinks, modules);
return;
}
results = fuzzysort.go(target, bookmarks, {threshold: -15000, key:'text'});
results.forEach(function(result) {
filtered += '<a href="' + result.obj['url'] + '" class="' + result.obj['app'] + '">' + fuzzysort.highlight(result) + '</a>';
});
fillIndex(indexList, filtered, modules);
};
// delay the rendering of the filtered results while user is typing
function debounce(fn, wait, indexList) {
var timeout;
return function() {
clearTimeout(timeout);
timeout = setTimeout(function() {
fn.call(this, indexList);
}, (wait || 150));
};
}
// copy pycode and bascode to clipboard on mouse click
// Show border when copy is done
divcopyable(document.getElementsByClassName("bascode"));
divcopyable(document.getElementsByClassName("pycode"));
function divcopyable(itemcopyable){
for (var i = 0, len = itemcopyable.length; i < len; i++) {
(function() {
var item = itemcopyable[i];
function changeBorder(item, color) {
var saveBorder = item.style.border;
item.style.borderColor = color;
setTimeout(function() {
item.style.border = saveBorder;
}, 150);
}
item.onclick = function() {
document.execCommand("copy");
changeBorder(item, "#18A303");
};
item.addEventListener("copy", function(event) {
event.preventDefault();
if (event.clipboardData) {
event.clipboardData.setData("text/plain", item.textContent);
}
});
}());
}
}
// copy useful content to clipboard on mouse click
var copyable = document.getElementsByClassName("input");
for (var i = 0, len = copyable.length; i < len; i++) {
(function() {
var item = copyable[i];
function changeColor(item, color, colorToChangeBackTo) {
item.style.backgroundColor = color;
setTimeout(function() {
item.style.backgroundColor = colorToChangeBackTo;
}, 150);
}
item.onclick = function() {
document.execCommand("copy");
changeColor(item, "#18A303", "transparent");
};
item.addEventListener("copy", function(event) {
event.preventDefault();
if (event.clipboardData) {
event.clipboardData.setData("text/plain", item.textContent);
}
});
}());
}
// auto-expand contents per subitem
var pathname = window.location.pathname;
var pathRegex = /text\/.*\.html$/;
var linkIndex = 0;
var contentMatch = pathname.match(pathRegex);
function linksMatch(content) {
var linkMatch = new RegExp(content);
var links = document.getElementById("Contents").getElementsByTagName("a");
for (var i = 0, len = links.length; i < len; i++) {
if (links[i].href.match(linkMatch)) {
return i;
}
}
}
linkIndex = linksMatch(contentMatch);
if (typeof linkIndex !== "undefined") {
var current = document.getElementById("Contents").getElementsByTagName("a")[linkIndex];
var cItem = current.parentElement;
var parents = [];
while (cItem.parentElement && !cItem.parentElement.matches("#Contents") && parents.indexOf(cItem.parentElement) == -1) {
parents.push(cItem = cItem.parentElement);
}
var liParents = [].filter.call(parents, function(item) {
return item.matches("li");
});
for (var i = 0, len = liParents.length; i < len; i++) {
var input = liParents[i].querySelectorAll(':scope > input');
document.getElementById(input[0].id).checked = true;
}
current.classList.add('contents-current');
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */

View File

@@ -1,266 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// Used to set Application in caseinline=APP
function setApplSpan(spanZ) {
var module = getParameterByName("DbPAR");
if (module === null) {
module = "WRITER";
}
var y = spanZ.getElementsByTagName("SPAN");
var n = y.length;
var foundAppl = false;
for (i = 0; i < n; i++) {
if (y[i].getAttribute("id") === null){
continue;
}
else if( y[i].getAttribute("id").startsWith(module)){
y[i].removeAttribute("hidden");
foundAppl=true;
}
}
for (i = 0; i < n; i++) {
if (y[i].getAttribute("id") === null){
continue;
}
else if( y[i].getAttribute("id").startsWith("default")){
if(!foundAppl){
y[i].removeAttribute("hidden");
}
}
}
}
// Used to set system in case, caseinline=SYSTEM
function setSystemSpan(spanZ) {
// if no System in URL, get browser system
var system = getParameterByName("System");
if (system === null) {
system = getSystem();
}
var y = spanZ.getElementsByTagName("SPAN");
var n = y.length;
var foundSystem = false;
for (i = 0; i < n; i++) {
if (y[i].getAttribute("id") === null){
continue;
}
else if( y[i].getAttribute("id").startsWith(system)){
y[i].removeAttribute("hidden");
foundSystem=true;
}
}
for (i = 0; i < n; i++) {
if (y[i].getAttribute("id") === null){
continue;
}
else if( y[i].getAttribute("id").startsWith("default")){
if(!foundSystem){
y[i].removeAttribute("hidden");
}
}
}
}
// paint headers and headings with appl color
function moduleColor (module) {
switch (module){
case "WRITER" : {color="#0369A3"; break;}
case "CALC" : {color="#43C330"; break;}
case "CHART" : {color="darkcyan"; break;}
case "IMPRESS": {color="#A33E03"; break;}
case "DRAW" : {color="#C99C00"; break;}
case "BASE" : {color="#8E03A3"; break;}
case "BASIC" : {color="black"; break;}
case "MATH" : {color="darkslategray"; break;}
case "SHARED" : {color="gray"; break;}
default : {color="#18A303"; break;}
}
document.getElementById("TopLeftHeader").style.background = color;
document.getElementById("SearchFrame").style.background = color;
document.getElementById("DonationFrame").style.background = color;
var cols = document.getElementsByClassName('tableheadcell');
for(i = 0; i < cols.length; i++) {cols[i].style.backgroundColor = color;};
for (j of [1,2,3,4,5,6]) {
var hh = document.getElementsByTagName("H" + j);
for(i = 0; i < hh.length; i++) {
hh[i].style.color = color;
hh[i].style.borderBottomColor = color;
}
}
}
// Find spans that need the switch treatment and give it to them
var spans = document.querySelectorAll("[class^=switch]");
var n = spans.length;
for (z = 0; z < n; z++) {
var id = spans[z].getAttribute("id");
if (id === null) {
continue;
}
else if (id.startsWith("swlnsys")) {
setSystemSpan(spans[z]);
} else {
setApplSpan(spans[z]);
}
}
/* add &DbPAR= and &System= to the links in DisplayArea div */
/* skip for object files */
function fixURL(module, system) {
if ((DisplayArea = document.getElementById("DisplayArea")) === null) return;
var itemlink = DisplayArea.getElementsByTagName("a");
var pSystem = (system === null) ? getSystem() : system;
var pAppl = (module === null) ? "WRITER" : module;
var n = itemlink.length;
for (var i = 0; i < n; i++) {
if (itemlink[i].getAttribute("class") != "objectfiles") {
setURLParam(itemlink[i], pSystem, pAppl);
}
}
}
//Set the params inside URL
function setURLParam(itemlink, pSystem, pAppl) {
var href = itemlink.getAttribute("href");
if (href !== null) {
// skip external links
if (!href.startsWith("http")) {
// handle bookmark.
if (href.lastIndexOf('#') != -1) {
var postf = href.substring(href.lastIndexOf('#'), href.length);
var pref = href.substring(0, href.lastIndexOf('#'));
itemlink.setAttribute("href", pref + "?" + '&DbPAR=' + pAppl + '&System=' + pSystem + postf);
} else {
itemlink.setAttribute("href", href + "?" + '&DbPAR=' + pAppl + '&System=' + pSystem);
}
}
}
}
function getSystem() {
var system = "Unknown OS";
if (navigator.appVersion.indexOf("Win") != -1) system = "WIN";
if (navigator.appVersion.indexOf("Mac") != -1) system = "MAC";
if (navigator.appVersion.indexOf("X11") != -1) system = "UNIX";
if (navigator.appVersion.indexOf("Linux") != -1) system = "UNIX";
return system;
}
function getParameterByName(name, url) {
if (!url) {
url = window.location.href;
}
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)");
var results = regex.exec(url);
if (!results) {
return null;
}
if (!results[2]) {
return '';
}
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
function existingLang(lang) {
if (lang === undefined) {
return 'en-US';
}
if (languagesSet.has(lang)) {
return lang;
}
lang = lang.replace(/[-_].*/, '');
if (languagesSet.has(lang)) {
return lang;
}
return 'en-US';
}
function setupModules(lang) {
var modulesNav = document.getElementById('modules-nav');
if (!modulesNav.classList.contains('loaded')) {
var html =
'<a href="' + lang + '/text/swriter/main0000.html?DbPAR=WRITER"><div class="writer-icon"></div>Writer</a>' +
'<a href="' + lang + '/text/scalc/main0000.html?DbPAR=CALC"><div class="calc-icon"></div>Calc</a>' +
'<a href="' + lang + '/text/simpress/main0000.html?DbPAR=IMPRESS"><div class="impress-icon"></div>Impress</a>' +
'<a href="' + lang + '/text/sdraw/main0000.html?DbPAR=DRAW"><div class="draw-icon"></div>Draw</a>' +
'<a href="' + lang + '/text/sdatabase/main.html?DbPAR=BASE"><div class="base-icon"></div>Base</a>' +
'<a href="' + lang + '/text/smath/main0000.html?DbPAR=MATH"><div class="math-icon"></div>Math</a>' +
'<a href="' + lang + '/text/schart/main0000.html?DbPAR=CHART"><div class="chart-icon"></div>Chart</a>' +
'<a href="' + lang + '/text/sbasic/shared/main0601.html?DbPAR=BASIC"><div class="basic-icon"></div>Basic</a>';
modulesNav.innerHTML = html;
modulesNav.classList.add('loaded');
}
}
function setupLanguages(page) {
var langNav = document.getElementById('langs-nav');
if (!langNav.classList.contains('loaded')) {
var html = '';
languagesSet.forEach(function(lang) {
html += '<a href="' + lang + page + '">' + ((lang in languageNames)? languageNames[lang]: lang) + '</a>';
});
langNav.innerHTML = html;
langNav.classList.add('loaded');
}
}
// Test, if we are online
if (document.body.getElementsByTagName('meta')) {
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['disableCookies']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//piwik.documentfoundation.org/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '68']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
var system = getParameterByName("System");
} else {
var system = getSystem();
}
var module = getParameterByName("DbPAR");
fixURL(module,system);
moduleColor(module);
var helpID = getParameterByName("HID");
// only used in xhp pages with <help-id-missing/> tags
var missingElement = document.getElementById("bm_HID2");
if(missingElement != null){missingElement.innerHTML = helpID;}
function debugInfo(dbg) {
if (dbg == null) return;
document.getElementById("DEBUG").style.display = "block";
document.getElementById("bm_module").innerHTML = "Module is: "+module;
document.getElementById("bm_system").innerHTML = "System is: "+system;
document.getElementById("bm_HID").innerHTML = "HID is: "+helpID;
}
debugInfo(getParameterByName("Debug"));
// Mobile devices need the modules and langs on page load
if (Math.max(document.documentElement.clientWidth, window.innerWidth || 0) < 960) {
var e = new Event('click');
var modulesBtn = document.getElementById('modules');
var langsBtn = document.getElementById('langs');
var modules = document.getElementById('modules-nav');
var langs = document.getElementById('langs-nav');
modules.setAttribute('data-a11y-toggle-open', '');
modulesBtn.dispatchEvent(e);
if (langs) {
langs.setAttribute('data-a11y-toggle-open', '');
langsBtn.dispatchEvent(e);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */

File diff suppressed because it is too large Load Diff

View File

@@ -1,48 +1,51 @@
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<xsl:stylesheet version="1.0" encoding="UTF-8"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:office="http://openoffice.org/2000/office"
xmlns:style="http://openoffice.org/2000/style"
xmlns:table="http://openoffice.org/2000/table"
xmlns:draw="http://openoffice.org/2000/drawing"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:meta="http://openoffice.org/2000/meta"
xmlns:number="http://openoffice.org/2000/datastyle"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:chart="http://openoffice.org/2000/chart"
xmlns:help="http://openoffice.org/2000/help"
xmlns:index="http://sun.com/2000/XMLSearch"
xmlns:text="http://openoffice.org/2000/text">
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:office="http://openoffice.org/2000/office"
xmlns:style="http://openoffice.org/2000/style"
xmlns:table="http://openoffice.org/2000/table"
xmlns:draw="http://openoffice.org/2000/drawing"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:meta="http://openoffice.org/2000/meta"
xmlns:number="http://openoffice.org/2000/datastyle"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:chart="http://openoffice.org/2000/chart"
xmlns:help="http://openoffice.org/2000/help"
xmlns:index="http://sun.com/2000/XMLSearch"
xmlns:text="http://openoffice.org/2000/text">
<xsl:param name="Language" select="'en-US'"/>
<xsl:output method="text" encoding="UTF-8"/>
<xsl:template match="/">
<xsl:apply-templates select="//title" mode="include"/>
<xsl:apply-templates select="//paragraph[@role='heading']" mode="include"/>
<xsl:apply-templates select="//title" mode="include"/>
<xsl:apply-templates select="//paragraph[@role='heading']" mode="include"/>
</xsl:template>
<xsl:template match="*" mode="include">
<xsl:value-of select="."/>
<xsl:text>&#xA;</xsl:text>
<xsl:value-of select="."/>
<xsl:text>&#xA;</xsl:text>
</xsl:template>
<xsl:template match="*"/>

View File

@@ -1,36 +1,39 @@
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<xsl:stylesheet version="1.0" encoding="UTF-8"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:office="http://openoffice.org/2000/office"
xmlns:style="http://openoffice.org/2000/style"
xmlns:table="http://openoffice.org/2000/table"
xmlns:draw="http://openoffice.org/2000/drawing"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:meta="http://openoffice.org/2000/meta"
xmlns:number="http://openoffice.org/2000/datastyle"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:chart="http://openoffice.org/2000/chart"
xmlns:help="http://openoffice.org/2000/help"
xmlns:index="http://sun.com/2000/XMLSearch"
xmlns:text="http://openoffice.org/2000/text">
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:office="http://openoffice.org/2000/office"
xmlns:style="http://openoffice.org/2000/style"
xmlns:table="http://openoffice.org/2000/table"
xmlns:draw="http://openoffice.org/2000/drawing"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:meta="http://openoffice.org/2000/meta"
xmlns:number="http://openoffice.org/2000/datastyle"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:chart="http://openoffice.org/2000/chart"
xmlns:help="http://openoffice.org/2000/help"
xmlns:index="http://sun.com/2000/XMLSearch"
xmlns:text="http://openoffice.org/2000/text">
<xsl:param name="Language" select="'en-US'"/>
<xsl:output method="text" encoding="UTF-8"/>
@@ -84,16 +87,6 @@
<xsl:text>&#xA;</xsl:text>
</xsl:template>
<xsl:template match="sub">
<xsl:apply-templates/>
<xsl:text>&#xA;</xsl:text>
</xsl:template>
<xsl:template match="sup">
<xsl:apply-templates/>
<xsl:text>&#xA;</xsl:text>
</xsl:template>
<xsl:template match="paragraph">
<xsl:value-of select="."/>
<xsl:text>&#xA;</xsl:text>

View File

@@ -1,74 +0,0 @@
<!DOCTYPE html>
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' piwik.documentfoundation.org"/>
<script type="text/javascript" src="polyfills.js"></script>
<script type="text/javascript" src="hid2file.js"></script>
<script type="text/javascript" src="languages.js"></script>
<script type="text/javascript" src="help2.js" defer></script>
</head>
<body>
<script type="text/javascript">
// We have to wait until both the deferred help2.js and the document have loaded
window.addEventListener('DOMContentLoaded', function() {
var url = window.location.href;
var n = url.indexOf('index.html?');
if (n != -1) {
// the URL came from LibreOffice help (F1)
var target = getParameterByName("Target",url);
var lang = existingLang(getParameterByName("Language", url));
var system = getParameterByName("System", url);
var module;
var defaultFile;
var smodule = target.substr(0, target.indexOf('/'));
switch (smodule) {
case "swriter": {defaultFile='text/swriter/main0000.html';module="WRITER";break;}
case "scalc": {defaultFile='text/scalc/main0000.html';module="CALC";break;}
case "schart": {defaultFile='text/schart/main0000.html';module="CHART";break;}
case "simpress": {defaultFile='text/simpress/main0000.html';module="IMPRESS";break;}
case "sdraw": {defaultFile='text/sdraw/main0000.html';module="DRAW";break;}
case "smath": {defaultFile='text/smath/main0000.html';module="MATH";break;}
case "sdatabase": {defaultFile='text/sdatabase/main.html';module="BASE";break;}
case "sbasic": {defaultFile='text/sbasic/shared/main0601.html';module="BASIC";break;}
default: {defaultFile='text/shared/05/new_help.html';module="WRITER";break;}
}
//Special case of application F1 or menu Help -> LibreOffice Help
if (target.indexOf('.uno:HelpIndex') != -1) {
window.location.replace(lang + '/' + defaultFile + '?System=' + system + '&DbPAR=' + module);
}
var bookmark = target.slice(target.indexOf('/') + 1, target.length);
var file = hid2fileMap[bookmark];
// check first if a root bookmark @@nowidget@@ can be used
if (file === undefined) {
var b2 = bookmark.substring(0, bookmark.lastIndexOf("/")) + '/@@nowidget@@';
file = hid2fileMap[b2];
}
// rebuild URL
if (file === undefined) {
var newURL = lang + '/text/shared/05/err_html.html?System=' + system + '&DbPAR=' + module + '&HID=' + bookmark ;
} else {
var indx = file.indexOf('#');
var bm = file.substr(indx,file.length);
file = file.substr(0,indx);
var newURL = lang + '/' + file + '?System=' + system + '&DbPAR=' + module + '&HID=' + bookmark + bm;
}
window.location.replace(newURL);
} else {
// URL came from elsewhere, direct access to webroot, we redirect to main Help page
var system = 'WIN';
if (navigator.userAgent.indexOf("Mac") != -1) system = 'MAC';
if (navigator.userAgent.indexOf("Linux") != -1) system = 'UNIX';
window.location.replace(existingLang(navigator.language) + '/text/shared/05/new_help.html?&DbPAR=WRITER&System=' + system);
}
});
</script>
</body>
</html>

View File

@@ -1 +0,0 @@
var languagesSet = new Set(['en-US', 'am', 'ar', 'ast', 'bg', 'bn', 'bn-IN', 'bo', 'bs', 'ca', 'ca-valencia', 'cs', 'da', 'de', 'dz', 'el', 'en-GB', 'en-ZA', 'eo', 'es', 'et', 'eu', 'fi', 'fr', 'gl', 'gu', 'he', 'hi', 'hr', 'hu', 'id', 'is', 'it', 'ja', 'ka', 'km', 'ko', 'lo', 'lt', 'lv', 'mk', 'nb', 'ne', 'nl', 'nn', 'om', 'pl', 'pt', 'pt-BR', 'ro', 'ru', 'si', 'sid', 'sk', 'sl', 'sq', 'sv', 'ta', 'tg', 'tr', 'ug', 'uk', 'vi', 'zh-CN', 'zh-TW']);

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 937 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 742 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 941 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 983 B

Some files were not shown because too many files have changed in this diff Show More