Compare commits
79 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e86de1e8e | ||
|
|
106036d989 | ||
|
|
026656711d | ||
|
|
35a8c4a5a6 | ||
|
|
86960e3813 | ||
|
|
b099d52520 | ||
|
|
6efe15788c | ||
|
|
3e43c2f9d0 | ||
|
|
f1b949865f | ||
|
|
ab439a17a3 | ||
|
|
dd65564af6 | ||
|
|
acffcbfe98 | ||
|
|
04703aa03c | ||
|
|
584e6b2c77 | ||
|
|
82f6d3565f | ||
|
|
8c68834e17 | ||
|
|
ba7b6eed4a | ||
|
|
051ad0f4ea | ||
|
|
05935c29e1 | ||
|
|
6a2735ec3d | ||
|
|
8bc53f76eb | ||
|
|
48f6a507dc | ||
|
|
20f328906c | ||
|
|
4d1e2eb9c6 | ||
|
|
97542b06fa | ||
|
|
0c93c7e4b6 | ||
|
|
56d9906c74 | ||
|
|
5cfe37433f | ||
|
|
45ebef3b74 | ||
|
|
2ed294bd65 | ||
|
|
91f3348a2f | ||
|
|
d424de5e9a | ||
|
|
6387ac21c9 | ||
|
|
6dce47e47f | ||
|
|
b7760ab42a | ||
|
|
e0405bc5f6 | ||
|
|
14151a6c46 | ||
|
|
00555d3544 | ||
|
|
7b2adc3979 | ||
|
|
0a5fc1e4a8 | ||
|
|
304d974b38 | ||
|
|
6792a7afa7 | ||
|
|
ded297de59 | ||
|
|
f616678d83 | ||
|
|
e10273dcdd | ||
|
|
343269670c | ||
|
|
8af157b848 | ||
|
|
9d65c999e5 | ||
|
|
4fe0d0edc9 | ||
|
|
b1aab27338 | ||
|
|
727e9ae9ed | ||
|
|
dc9df5d760 | ||
|
|
b7de791658 | ||
|
|
82c7b59650 | ||
|
|
e0b9d8f476 | ||
|
|
db2ed3a555 | ||
|
|
6efc375066 | ||
|
|
9a4c864490 | ||
|
|
a3081ef4a9 | ||
|
|
43374e02bd | ||
|
|
fb8a19469b | ||
|
|
f2d5f4a86c | ||
|
|
2177aed64f | ||
|
|
d20ac8fafc | ||
|
|
2395a489a3 | ||
|
|
0b8eedf935 | ||
|
|
807ada0bf9 | ||
|
|
216c35c0b8 | ||
|
|
d98cd5d9a9 | ||
|
|
fb6adf316f | ||
|
|
0854317cc8 | ||
|
|
fcdefa450c | ||
|
|
dc50a460e5 | ||
|
|
31187ccb69 | ||
|
|
d4b72b06e9 | ||
|
|
922e1e6ac4 | ||
|
|
79341b2c8e | ||
|
|
8a1eebb9b0 | ||
|
|
85e26c6d93 |
24
.github/workflows/maven.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# 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
|
||||
53
.workflow/BranchPipeline.yml
Normal file
@@ -0,0 +1,53 @@
|
||||
version: '1.0'
|
||||
name: branch-pipeline
|
||||
displayName: BranchPipeline
|
||||
stages:
|
||||
- stage:
|
||||
name: compile
|
||||
displayName: 编译
|
||||
steps:
|
||||
- step: build@maven
|
||||
name: build_maven
|
||||
displayName: Maven 构建
|
||||
# 支持6、7、8、9、10、11六个版本
|
||||
jdkVersion: 8
|
||||
# 支持2.2.1、3.2.5、3.3.9、3.5.2、3.5.3、3.5.4、3.6.1、3.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:
|
||||
- .*
|
||||
51
.workflow/MasterPipeline.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
version: '1.0'
|
||||
name: master-pipeline
|
||||
displayName: MasterPipeline
|
||||
stages:
|
||||
- stage:
|
||||
name: compile
|
||||
displayName: 编译
|
||||
steps:
|
||||
- step: build@maven
|
||||
name: build_maven
|
||||
displayName: Maven 构建
|
||||
# 支持6、7、8、9、10、11六个版本
|
||||
jdkVersion: 8
|
||||
# 支持2.2.1、3.2.5、3.3.9、3.5.2、3.5.3、3.5.4、3.6.1、3.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
|
||||
40
.workflow/PRPipeline.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
version: '1.0'
|
||||
name: pr-pipeline
|
||||
displayName: PRPipeline
|
||||
stages:
|
||||
- stage:
|
||||
name: compile
|
||||
displayName: 编译
|
||||
steps:
|
||||
- step: build@maven
|
||||
name: build_maven
|
||||
displayName: Maven 构建
|
||||
# 支持6、7、8、9、10、11六个版本
|
||||
jdkVersion: 8
|
||||
# 支持2.2.1、3.2.5、3.3.9、3.5.2、3.5.3、3.5.4、3.6.1、3.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
|
||||
36
.workflow/pipeline-20220716.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
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: []
|
||||
42
Dockerfile
@@ -1,41 +1,5 @@
|
||||
FROM ubuntu:20.04
|
||||
FROM keking/kkfileview-jdk:4.1.1
|
||||
MAINTAINER chenjh "842761733@qq.com"
|
||||
ADD server/target/kkFileView-*.tar.gz /opt/
|
||||
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"]
|
||||
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"]
|
||||
@@ -1,4 +1,4 @@
|
||||
# file-online-preview
|
||||
# kkFileView
|
||||
|
||||
[](https://github.com/kekingcn/kkFileView/blob/master/LICENSE)
|
||||
|
||||
|
||||
21
README.md
@@ -1,4 +1,4 @@
|
||||
# file-online-preview
|
||||
# kkFileView
|
||||
此项目为文件文档在线预览项目解决方案,对标业内付费产品有【[永中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,6 +110,25 @@ pdf预览模式预览效果如下
|
||||
|
||||
### 历史更新记录
|
||||
|
||||
> 2021年7月6日,v4.0.0 版本发布 :
|
||||
|
||||
1. 底层集成OpenOffice替换为LibreOffice,Office文件兼容性增强,预览效果提升
|
||||
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 视频文件转码预览支持,打开转码功能后,理论上支持所有主流视频的预览,如 rm、rmvb、flv 等
|
||||
3. 美化了 ppt、pptx 类型文件预览效果,比之前版本好看太多
|
||||
4. 更新了 pdfbox、xstream、common-io 等依赖的版本
|
||||
|
||||
> 2021年1月28日 :
|
||||
|
||||
2020农历年最后一个版本发布,主要包含了部分 UI 改进,和解决了 QQ 群友、 Issue 里反馈的 Bug 修复,最最重要的是发个新版,过个好年
|
||||
|
||||
38
docker/kkfileview-jdk/Dockerfile
Normal file
@@ -0,0 +1,38 @@
|
||||
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"]
|
||||
2
docker/kkfileview-jdk/docker build.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
# 执行如下命令构建基础镜像,加快kkfileview docker镜像构建与发布
|
||||
docker build --tag keking/kkfileview-jdk:4.1.1 .
|
||||
@@ -3,11 +3,10 @@
|
||||
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>filepreview</artifactId>
|
||||
<artifactId>kkFileView-parent</artifactId>
|
||||
<groupId>cn.keking</groupId>
|
||||
<version>3.5.1</version>
|
||||
<version>4.1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>office-plugin</artifactId>
|
||||
@@ -27,19 +26,9 @@
|
||||
<version>2.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<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>
|
||||
<groupId>org.libreoffice</groupId>
|
||||
<artifactId>libreoffice</artifactId>
|
||||
<version>7.1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- for the command line tool -->
|
||||
@@ -86,16 +75,6 @@
|
||||
</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>
|
||||
|
||||
@@ -12,18 +12,6 @@
|
||||
//
|
||||
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;
|
||||
@@ -32,6 +20,14 @@ 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 {
|
||||
|
||||
@@ -47,6 +43,7 @@ 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 {
|
||||
@@ -79,6 +76,7 @@ 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));
|
||||
|
||||
@@ -12,18 +12,18 @@
|
||||
//
|
||||
package org.artofsolving.jodconverter;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.sun.star.document.UpdateDocMode;
|
||||
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 com.sun.star.document.UpdateDocMode;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class OfficeDocumentConverter {
|
||||
|
||||
@@ -60,14 +60,22 @@ 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);
|
||||
convert(inputFile, outputFile, outputFormat, null);
|
||||
}
|
||||
|
||||
public void convert(File inputFile, File outputFile, DocumentFormat outputFormat) throws OfficeException {
|
||||
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 {
|
||||
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(defaultLoadProperties);
|
||||
conversionTask.setDefaultLoadProperties(properties);
|
||||
conversionTask.setInputFormat(inputFormat);
|
||||
officeManager.execute(conversionTask);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -87,9 +87,10 @@ public class OfficeUtils {
|
||||
programFiles = System.getenv("ProgramFiles");
|
||||
}
|
||||
return findOfficeHome(
|
||||
programFiles + File.separator + "OpenOffice 4",
|
||||
programFiles + File.separator + "LibreOffice 4",
|
||||
officePluginPath + File.separator + "windows-office"
|
||||
officePluginPath + File.separator + "windows-office",
|
||||
programFiles + File.separator + "LibreOffice",
|
||||
programFiles + File.separator + "OpenOffice 4",
|
||||
programFiles + File.separator + "LibreOffice 4"
|
||||
);
|
||||
} else if (PlatformUtils.isMac()) {
|
||||
return findOfficeHome(
|
||||
@@ -103,6 +104,14 @@ 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"
|
||||
|
||||
@@ -29,23 +29,45 @@ 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;
|
||||
}
|
||||
|
||||
public static String getOfficePluginPath() {
|
||||
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 {
|
||||
String separator = File.separator;
|
||||
if (!userDir.contains(OFFICE_PLUGIN_NAME)) {
|
||||
userDir = userDir + separator + OFFICE_PLUGIN_NAME;
|
||||
// 返回参数列表中第一个真实存在的路径,或者 null
|
||||
private static String firstExists(File... paths) {
|
||||
for (File path : paths) {
|
||||
if (path.exists()) {
|
||||
return path.getAbsolutePath();
|
||||
}
|
||||
}
|
||||
return userDir;
|
||||
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();
|
||||
|
||||
} else {
|
||||
return firstExists(
|
||||
new File(pluginPath, OFFICE_PLUGIN_NAME),
|
||||
new File(pluginPath.getParentFile(), OFFICE_PLUGIN_NAME)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getCustomizedConfigPath() {
|
||||
String homePath = getHomePath();
|
||||
String separator = java.io.File.separator;
|
||||
|
||||
16481
office-plugin/windows-office/CREDITS.fodt
Normal file
6787
office-plugin/windows-office/LICENSE.html
Normal file
@@ -1,5 +1,12 @@
|
||||
Portions of LibreOffice may include work under the Apache License v2.0
|
||||
requiring this NOTICE file to be provided.
|
||||
|
||||
For a more complete license statement please see the associated
|
||||
documentation
|
||||
____
|
||||
|
||||
Apache OpenOffice (http://www.openoffice.org)
|
||||
Copyright 2011, 2018 The Apache Software Foundation
|
||||
Copyright 2011, 2014 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
@@ -16,11 +23,11 @@ ____
|
||||
As part of the base system this product also includes code from the following
|
||||
Apache projects:
|
||||
- Apache Lucene
|
||||
- Apache Portable Runtime
|
||||
- Apache Portable Runtime
|
||||
- Apache Portable Runtime Utility Library
|
||||
- Apache Commons - used by MediaWiki Publisher extension
|
||||
- Apache Jakarta HttpClient - used by MediaWiki Publisher extension
|
||||
- Apache Tomcat - used by MediaWiki Piblisher extension
|
||||
- Apache Tomcat - used by MediaWiki Publisher extension
|
||||
|
||||
The notices from these projects are following:
|
||||
|
||||
@@ -117,12 +124,6 @@ the MX4J package, which is open source software. The
|
||||
original software and related information is available
|
||||
at http://mx4j.sourceforge.net/.
|
||||
|
||||
The Windows Installer is built with the Nullsoft
|
||||
Scriptable Install System (NSIS), which is
|
||||
open source software. The original software and
|
||||
related information is available at
|
||||
http://nsis.sourceforge.net/.
|
||||
|
||||
Java compilation software for JSP pages is provided by Eclipse,
|
||||
which is open source software. The original software and
|
||||
related information is available at
|
||||
@@ -130,11 +131,11 @@ http://www.eclipse.org/.
|
||||
|
||||
____
|
||||
|
||||
As part of the base system this product also includes code from the following
|
||||
As part of the base system this product may also includes code from the following
|
||||
projects which are licensed under the Apache license:
|
||||
- serf
|
||||
- redland
|
||||
- StAX
|
||||
- Apache BeanShell Scripting for Java
|
||||
|
||||
The notices from these projects are following:
|
||||
|
||||
@@ -142,45 +143,17 @@ serf
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
||||
|
||||
redland
|
||||
This product includes Redland software (http://librdf.org/)
|
||||
developed at the Institute for Learning and Research Technology,
|
||||
University of Bristol, UK (http://www.bristol.ac.uk/).
|
||||
|
||||
|
||||
StAX
|
||||
[no notices]
|
||||
|
||||
Apache BeanShell Scripting for Java
|
||||
Copyright 1997-2012 Patrick Niemeyer
|
||||
Granted to the Apache Software Foundation 2012
|
||||
Licensed under the Apache License, Version 2.0.
|
||||
____
|
||||
|
||||
This product includes software developed by the OpenSSL Project
|
||||
for use in the OpenSSL Toolkit. (http://www.openssl.org/)
|
||||
|
||||
___
|
||||
|
||||
Apache OpenOffice has some optional parts that only get included
|
||||
when the configure option --enable-category-b has been requested.
|
||||
When you used this option make sure to comply with the
|
||||
distribution requirements of these parts by extending
|
||||
this file with the notices recommended by them:
|
||||
|
||||
___
|
||||
|
||||
Notices for CoinMP libary:
|
||||
The Computational Infrastructure for Operations Research COIN_OR
|
||||
project developed the CoinMP library (a lightweight API and DLL
|
||||
for CLP, CBC, and CGL).
|
||||
It includes and depends on
|
||||
- CoinUtils: COIN-OR utilities, utilities, data structures, and
|
||||
linear algebra methods for COIN-OR projects
|
||||
- CLP: COIN-OR Graph Classes, a collection of network representations
|
||||
and algorithms
|
||||
- CBC: COIN-OR Branch and Cut, an LP-based branch-and-cut library
|
||||
- CGL: Cut Generator Library, a library of cutting-plane generators
|
||||
The source code of these dependencies which are available under
|
||||
license EPL can found at
|
||||
http://www.coin-or.org/download/source/CoinMP/
|
||||
|
||||
___
|
||||
|
||||
100
office-plugin/windows-office/help/a11y-toggle.js
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
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);
|
||||
})();
|
||||
907
office-plugin/windows-office/help/default.css
Normal file
608
office-plugin/windows-office/help/fuzzysort.js
Normal file
46
office-plugin/windows-office/help/help.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<!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>
|
||||
|
||||
188
office-plugin/windows-office/help/help.js
Normal file
@@ -0,0 +1,188 @@
|
||||
/* -*- 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: */
|
||||
266
office-plugin/windows-office/help/help2.js
Normal file
@@ -0,0 +1,266 @@
|
||||
/* -*- 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: */
|
||||
8433
office-plugin/windows-office/help/hid2file.js
Normal file
@@ -1,51 +1,48 @@
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************-->
|
||||
<!--
|
||||
* 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 .
|
||||
-->
|
||||
<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>
</xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="*"/>
|
||||
|
||||
@@ -1,39 +1,36 @@
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************-->
|
||||
<!--
|
||||
* 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 .
|
||||
-->
|
||||
<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"/>
|
||||
@@ -87,6 +84,16 @@
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sub">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sup">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="paragraph">
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>
</xsl:text>
|
||||
|
||||
74
office-plugin/windows-office/help/index.html
Normal file
@@ -0,0 +1,74 @@
|
||||
<!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>
|
||||
1
office-plugin/windows-office/help/languages.js
Normal file
@@ -0,0 +1 @@
|
||||
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']);
|
||||
BIN
office-plugin/windows-office/help/media/files/scalc/imtrigon.ods
Normal file
BIN
office-plugin/windows-office/help/media/files/scalc/pivot.ods
Normal file
BIN
office-plugin/windows-office/help/media/files/scalc/trigon.ods
Normal file
BIN
office-plugin/windows-office/help/media/helpimg/area1.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
office-plugin/windows-office/help/media/helpimg/area2.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_1.png
Normal file
|
After Width: | Height: | Size: 937 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_2.png
Normal file
|
After Width: | Height: | Size: 858 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_3.png
Normal file
|
After Width: | Height: | Size: 894 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_4.png
Normal file
|
After Width: | Height: | Size: 787 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_5.png
Normal file
|
After Width: | Height: | Size: 386 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_6.png
Normal file
|
After Width: | Height: | Size: 727 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_7.png
Normal file
|
After Width: | Height: | Size: 733 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_8.png
Normal file
|
After Width: | Height: | Size: 776 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_ca_9.png
Normal file
|
After Width: | Height: | Size: 956 B |
|
After Width: | Height: | Size: 748 B |
|
After Width: | Height: | Size: 742 B |
BIN
office-plugin/windows-office/help/media/helpimg/border_wr_1.png
Normal file
|
After Width: | Height: | Size: 941 B |