Skip to content

Commit

Permalink
Rebuild Github pages at cd5cf72
Browse files Browse the repository at this point in the history
  • Loading branch information
ufalbot committed Mar 19, 2024
0 parents commit 0655e90
Show file tree
Hide file tree
Showing 31 changed files with 3,645 additions and 0 deletions.
10 changes: 10 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# License

Copyright © 2015 Institute of Formal and Applied Linguistics (http://ufal.mff.cuni.cz)

## The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
134 changes: 134 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# LINDAT/CLARIN Common Theme

[![Build Status](https://travis-ci.org/ufal/lindat-common.svg?branch=master)](https://travis-ci.org/ufal/lindat-common)
[![Dependency Status](https://gemnasium.com/ufal/lindat-common.svg)](https://gemnasium.com/ufal/lindat-common)

Files common for all Lindat projects. The repository has been migrated from [UFAL Redmine](https://redmine.ms.mff.cuni.cz/projects/lindat-common). Here is short description on how to use Lindat Common Theme, for more detailed info see [Redmine wiki](https://redmine.ms.mff.cuni.cz/projects/lindat-common/wiki).

## What is in the repository

The project requires build so the repository contains branches with pre build versions of the Common Theme. The build happens automatically by [Travis CI](https://travis-ci.org/ufal/lindat-common).

- [Production build branch](https://github.com/ufal/lindat-common/tree/releases)

Every time the commit is tagged it is considered a production release and a new build is committed to `releases` branch.

- [Latest build branch](https://github.com/ufal/lindat-common/tree/edge)

Every push to `master` branch is build to `edge` branch.

## Installation

You can get common theme to your project in several ways:

### 1. Using this repository as a git submodule

You can always opt-in for latest build by using `edge` branch instead of `releases` branch.

```.bash
git submodule add -b releases https://github.com/ufal/lindat-common.git lindat-common
git submodule init
git submodule update
```

To update to the newest version run following:

```.bash
git submodule update --remote --merge
```

Please note:
> The original idea was to use common theme the same way as `svn:externals` but the git doesn't work the same way. The submodule is always fixed to the specific commit SHA so you have to always manually update the submodule and also commit the change.
### 2. Using releases here on Github

Go [here](https://github.com/ufal/lindat-common/releases) and download the latest release or use command line:

```.bash
mkdir lindat-common
cd lindat-common
REPO="https://github.com/ufal/lindat-common"
TAG=`git ls-remote --tags $REPO | grep -v '\^{}' | sed -e 's/.*refs\/tags\/\(.*\)/\1/p' | sort -Vk2 | tail -n1`
curl -L "$REPO/releases/download/$TAG/dist.tar.gz" | tar -xz
```

### 3. Using the [Bower](http://bower.io/)

Use:

bower install lindat-common#releases --save

for stable branch or use the latest build:

bower install lindat-common#edge --save

to install and

bower --force update

to force update to the newest version.

## How to Use Common Theme

All you have to do is include the header/footer html in your page layout together with css styles. You should also set `<body id="lindat-tools">`. If you can't set `id` on the `body`, any other common parent element should work.

NOTE: `lindat.css` will set body margin and padding to *zero* pixels. This should stay zero to ensure proper look, if you need padding or margin on your page please use other elements. The header and footer requires only these.

## Use in Angular projects

1. Include CSS and Javascript in your html
1. Add `lindat` to the modules

angular.module('yourApp', ['lindat', ... ])

1. Directives `lindat-header` and `lindat-footer` will be available

<header lindat-header></header>
... your content ...
<footer lindat-footer></footer>

Element style will also work:

<lindat-header></lindat-header>
... your content ...
<lindat-footer></lindat-footer>
1. Google Analytics and Piwik tracking are already included and should work out of the box. See [angular-piwik](https://github.com/mike-spainhower/angular-piwik) and [angular-google-analytics](https://github.com/revolunet/angular-google-analytics) for more info.

## Automatic updates

lindat-common is occasionally updated, you can follow these updated automatically using cron. If your checkout is in /opt/lindat-common and you are on releases branch with no local modifications, something like `35 0 * * * cd /opt/lindat-common/ && git pull --quiet` inside your crontab or other cron file should suffice

## Development

- Clone the repository

git clone https://github.com/ufal/lindat-common.git
cd lindat-common

- Install NodeJS environment (unless you already have one)

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
nvm install stable
nvm use stable

- Install dependencies for development

npm install

- Run development server

make run

## Making new release

| Task | Version |
|----------------------|----------------------------------------|
| make release | v0.0.1 -> v0.0.2 + commit + tag + push |
| make release-minor | v0.0.1 -> v0.1.0 + commit + tag + push |
| make release-major | v0.0.1 -> v1.0.1 + commit + tag + push |
91 changes: 91 additions & 0 deletions angular.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<!DOCTYPE html>
<html ng-app="lindat-common" ng-strict-di="true">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>LINDAT/CLARIAH-CZ Research Infrastructure</title>
<meta name="viewport" content="width=device-width">
<meta name="keywords" content="Language Resources, Infrastructure, Research,
Natural Language Processing, Multimedia, Czech language, Computational
Linguistics, Speech, Text, Corpus, Corpora" />
<meta name="description" content="LINDAT CLARIAH-CZ Research Infrastructure" />
<style>
body {
display: flex;
min-height: 100vh;
flex-direction: column;
}
section {
flex: 1;
max-width: 750px;
margin-left: auto;
margin-right: auto;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.8.2/angular.min.js" integrity="sha512-7oYXeK0OxTFxndh0erL8FsjGvrl2VMDor6fVqzlLGfwOQQqTbYsGPv4ZZ15QHfSk80doyaM0ZJdvkyDcVO7KFA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://ufal.github.io/lindat-common/public/js/angular-lindat.js"></script>
<script type="text/javascript">
function HomeController($scope){
var vm = this;

vm.handle = '11858/00-097C-0000-0023-1AAF-3';
vm.title = 'Prague Dependency Treebank 3.0';

vm.testingHandles = [
{ handle: 'non_existing', title: 'Non existing handle' },
{ handle: '11234/1-1508', title: 'HamleDT 3.0' },
{ handle: '11858/00-097C-0000-0023-1AAF-3', title: 'Prague Dependency Treebank 3.0' }
];

vm.changeHandle = function (handle, title) {
vm.handle = handle;
vm.title = title;
};

vm.destroy = function () {
$scope.$destroy();
};

}
HomeController.$inject = ["$scope"];

(function(angular) {
'use strict';
var myAppModule = angular.module('lindat-common', ['lindat']);

myAppModule.controller('HomeController', HomeController);

})(window.angular);

</script>
</head>
<body id="lindat-home">
<!-- HEADER -->
<lindat-header></lindat-header>
<section ng-controller="HomeController as vm">
<h1>LINDAT/CLARIAH-CZ Common Theme</h1>
<p>
Select the theme you want...
</p>
<p>
<label for="selector">Select active project:</label>
<select id="selector">
<option value="lindat-home">Home</option>
<option value="lindat-repository">Repository</option>
<option value="lindat-pmltq">PML-TQ</option>
<option value="lindat-tools">Any</option>
</select>
</p>
<h1>Refbox</h1>
<button ng-click="vm.destroy()">Test Destroy</button>
<p>
<label>Switch items:</label>
<button ng-repeat="item in vm.testingHandles" ng-click="vm.changeHandle(item.handle, item.title)" ng-bind="item.title"></button>
</p>
<lindat-refbox handle="vm.handle" title="vm.title"></lindat-refbox>
</section>
<lindat-footer></lindat-footer>
</body>
</html>
91 changes: 91 additions & 0 deletions angular_cs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<!DOCTYPE html>
<html ng-app="lindat-common" ng-strict-di="true">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>LINDAT/CLARIAH-CZ Research Infrastructure</title>
<meta name="viewport" content="width=device-width">
<meta name="keywords" content="Language Resources, Infrastructure, Research,
Natural Language Processing, Multimedia, Czech language, Computational
Linguistics, Speech, Text, Corpus, Corpora" />
<meta name="description" content="LINDAT CLARIAH-CZ Research Infrastructure" />
<style>
body {
display: flex;
min-height: 100vh;
flex-direction: column;
}
section {
flex: 1;
max-width: 750px;
margin-left: auto;
margin-right: auto;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.8.2/angular.min.js" integrity="sha512-7oYXeK0OxTFxndh0erL8FsjGvrl2VMDor6fVqzlLGfwOQQqTbYsGPv4ZZ15QHfSk80doyaM0ZJdvkyDcVO7KFA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://ufal.github.io/lindat-common/public/js/cs/angular-lindat.js"></script>
<script type="text/javascript">
function HomeController($scope){
var vm = this;

vm.handle = '11858/00-097C-0000-0023-1AAF-3';
vm.title = 'Prague Dependency Treebank 3.0';

vm.testingHandles = [
{ handle: 'non_existing', title: 'Non existing handle' },
{ handle: '11234/1-1508', title: 'HamleDT 3.0' },
{ handle: '11858/00-097C-0000-0023-1AAF-3', title: 'Prague Dependency Treebank 3.0' }
];

vm.changeHandle = function (handle, title) {
vm.handle = handle;
vm.title = title;
};

vm.destroy = function () {
$scope.$destroy();
};

}
HomeController.$inject = ["$scope"];

(function(angular) {
'use strict';
var myAppModule = angular.module('lindat-common', ['lindat']);

myAppModule.controller('HomeController', HomeController);

})(window.angular);

</script>
</head>
<body id="lindat-home">
<!-- HEADER -->
<lindat-header></lindat-header>
<section ng-controller="HomeController as vm">
<h1>LINDAT/CLARIAH-CZ Common Theme</h1>
<p>
Select the theme you want...
</p>
<p>
<label for="selector">Select active project:</label>
<select id="selector">
<option value="lindat-home">Home</option>
<option value="lindat-repository">Repository</option>
<option value="lindat-pmltq">PML-TQ</option>
<option value="lindat-tools">Any</option>
</select>
</p>
<h1>Refbox</h1>
<button ng-click="vm.destroy()">Test Destroy</button>
<p>
<label>Switch items:</label>
<button ng-repeat="item in vm.testingHandles" ng-click="vm.changeHandle(item.handle, item.title)" ng-bind="item.title"></button>
</p>
<lindat-refbox handle="vm.handle" title="vm.title"></lindat-refbox>
</section>
<lindat-footer></lindat-footer>
</body>
</html>
Loading

0 comments on commit 0655e90

Please sign in to comment.