Commit e7aefbad by Matt Mascarenhas

cinera.css: Marker and categories style

cinera_player_pre.js: Episode keyboard navigation. Also swap out A for K, and D for J cinera_player_pre.js: Handle the case in onRefChanged() in which the filter_container or filterState is not present cinera.c: Refetch quotes when processing a set of annotations >60 mins after the last fetch Flags: -w Force quote cache rebuild
parent 2cac3ed0
......@@ -45,22 +45,16 @@ directory. Typical operation will involve setting these flags:
-d Project Input Directory, the directory where the .hmml files reside
-r Root Directory, path shallower than or equal to the CSS, Images and JS
directories
-u Root URL, corresponding to the Root Directory (optional if the Output
-R Root URL, corresponding to the Root Directory (optional if the Output
Base Directory resides in the Root Directory)
-c CSS Directory, relative to Root
-i Images Directory, relative to Root
-j JS Directory, relative to Root
-b Output Base Directory, location of the table of contents / search page
-t Player Template Location
-x Index Template Location
#### Integration
CINERA_MODE=INTEGRATE cinera test.hmml
This will integrate into `template_player.html` (configurable with -t) the
player and related elements generated from `test.hmml` and output to
`out_integrated.html`
Feel free to play with `template_player.html` to your heart's content. If you do
anything invalid, `cinera` will tell you what's wrong
-B Output Base URL, corresponding to the Output Base Directory
-t Template Directory
-x Index Template Location, relative to Template Directory
-y Player Template Location, relative to Template Directory
#### Templates
......@@ -76,60 +70,128 @@ Valid tags:
- `<!-- __CINERA_INDEX__ -->` _the table of contents, and search functionality_
*Player Template*
- `<!-- __CINERA_INCLUDES__ -->` _the necessary `.css` and `.js` files, and charset setting_
- `<!-- __CINERA_MENUS__ -->` _ _the menu bar that typically appears above the player in my samples_
- `<!-- __CINERA_INCLUDES__ -->` _the necessary `.css` and `.js` files, and
charset setting_
- `<!-- __CINERA_MENUS__ -->` _ _the menu bar that typically appears above the
player in my samples_
- `<!-- __CINERA_PLAYER__ -->` _the player_
- `<!-- __CINERA_SCRIPT__ -->` _the filter state objects and `.js` file, which must come after both the MENUS and PLAYER tags_
- `<!-- __CINERA_SCRIPT__ -->` _the filter state objects and `.js` file, which
must come after both the MENUS and PLAYER tags_
*Optional tags available for use in your Player Template*
- `<!-- __CINERA_TITLE__ -->` _the title of the video, excluding numbering_
- `<!-- __CINERA_VIDEO_ID__ -->` _the unique identifer of the video as provided
by the VoD platform_
*Other available tags*
- `<!-- __CINERA_PROJECT__ -->` _the full name of the project_
- `<!-- __CINERA_URL__ -->` _the URL where we have derived the page will be
publically accessibly, only really usable if BaseURL is set (-B)_
- `<!-- __CINERA_CUSTOM0__ -->`
- `<!-- __CINERA_CUSTOM1__ -->`
- `<!-- __CINERA_CUSTOM2__ -->`
- `<!-- __CINERA_CUSTOM15__ -->`
_Freeform buffers for small snippets of localised information, e.g. a single
<a> element or perhaps a <!-- comment --> They correspond to the custom0 to
custom15 attributes in the [video] node in your .hmml files 0 to 11 may hold
up to 255 characters 12 to 15 may hold up to 1023 characters_
Feel free to play with templates to your heart's content. If you do anything
invalid, `cinera` will tell you what's wrong.
#### Arguments
Usage: ./cinera [option(s)] filename(s)
Options:
Paths:
Paths: (advisedly universal, but may be set per-(sub)project as required)
-r <root directory>
Override default root directory (".")
-u <root URL>
-R <root URL>
Override default root URL ("")
-b <base output directory>
Override project's default base output directory (".")
IMPORTANT: -r and -R must correspond to the same location
UNSUPPORTED: If you move files from RootDir, the RootURL should
correspond to the resulting location
-c <CSS directory path>
Override default CSS directory (""), relative to root
-i <images directory path>
Override default images directory (""), relative to root
-j <JS directory path>
Override default JS directory (""), relative to root
-t <player template location>
Override default player template location ("template_player.html"), relative to root
and automatically enable integration
Project Settings:
-p <project ID>
Set the project ID, equal to the "project" field in the HMML files
NOTE: Setting the project ID triggers PROJECT EDITION
-m <default medium>
Override default default medium ("programming")
Known project defaults:
book: research
pcalc: programming
riscy: programming
chat: speech
code: programming
intro-to-c: programming
misc: admin
ray: programming
hmdshow: speech
lecture: speech
stream: programming
special: programming
obbg: programming
sysadmin: admin
-s <style>
Set the style / theme, corresponding to a cinera__*.css file
This is equal to the "project" field in the HMML files by default
-q
Quit after syncing with annotation files in project input directory
UNSUPPORTED: This is likely to be removed in the future
Project Input Paths
-d <annotations directory>
Override default annotations directory (".")
-t <templates directory>
Override default templates directory (".")
-x <index template location>
Override default index template location ("template_index.html"), relative to root
and automatically enable integration
Set index template file path, either absolute or relative to
template directory, and enable integration
-y <player template location>
Set player template file path, either absolute or relative
to template directory, and enable integration
Project Output Paths
-b <base output directory>
Override project's default base output directory (".")
-B <base URL>
Override default base URL ("")
NOTE: This must be set, if -n or -a are to be used
-n <index location>
Override default index location (""), relative to base
-a <player location>
Override default player location (""), relative to base
NOTE: The PlayerURLPrefix is currently hardcoded in cinera.c but
will be configurable in the full configuration system
Single Edition Output Path
-o <output location>
Override default output player location for SINGLE_EDITION ("out.html")
-d <project directory>
Override default project directory (".")
Override default output player location ("out.html")
-e
Display (examine) index file and exit
-f
Force integration with an incomplete template
-p <project ID>
Set the project ID, corresponding to the "project" field in the HMML files
-s <style>
Set the style / theme, corresponding to a cinera__*.css file
This is equal to the "project" field in the HMML files by default
-w
Force quote cache rebuild (memory aid: "wget")
-l <n>
Override default log level (0), where n is from 0 (terse) to 7 (verbose)
-m <default medium>
Override default default medium ("programming")
-U <seconds>
Override default update interval ("4")
-u <seconds>
Override default update interval (4)
-v
display version and exit
Display version and exit
-h
display this help
#### Environment Variables
CINERA_MODE=INTEGRATE
Enable integration
Display this help
......@@ -528,7 +528,7 @@
}
.cineraPlayerContainer .markers_container > .markers .marker .cineraContent {
display: block;
display: inline-block;
font-size: 14px;
}
......@@ -575,7 +575,8 @@
}
.cineraPlayerContainer .markers_container > .markers .marker .cineraContent .cineraCategories {
margin: 4px;
float: right;
min-height: 1em;
}
.cineraMenus > .menu > .filter_container .filter_content {
......
......@@ -220,6 +220,8 @@ for(var i = 0; i < sourceMenus.length; ++i)
})
};
var prevEpisode = playerContainer.querySelector(".episodeMarker.prev");
var nextEpisode = playerContainer.querySelector(".episodeMarker.next");
var testMarkers = playerContainer.querySelectorAll(".marker");
window.addEventListener("blur", function(){
......
......@@ -56,8 +56,6 @@ function Player(htmlContainer, refsCallback) {
Player.initializeYoutube(this.onYoutubeReady.bind(this));
this.updateSize();
this.resume();
}
// Start playing the video from the current position.
......@@ -68,6 +66,7 @@ Player.prototype.play = function() {
this.youtubePlayer.playVideo();
}
this.pauseAfterBuffer = false;
this.resume();
} else {
this.shouldPlay = true;
}
......@@ -119,6 +118,7 @@ Player.prototype.updateSize = function() {
this.markersContainer.style.height = height;
if (this.youtubePlayerReady) {
this.youtubePlayer.setSize(Math.floor(width), Math.floor(height));
this.resume();
}
}
......@@ -929,16 +929,30 @@ function handleKey(key) {
} break;
case 'N':
case 'D':
case 'J':
case 'S': {
player.jumpToNextMarker();
} break;
case 'P':
case 'A':
case 'K':
case 'W': {
player.jumpToPrevMarker();
} break;
case '[':
case '<': {
if(prevEpisode)
{
location = prevEpisode.href;
}
} break;
case ']':
case '>': {
if(nextEpisode)
{
location = nextEpisode.href;
}
} break;
default: {
gotKey = false;
} break;
......@@ -1165,6 +1179,22 @@ function resetFade() {
function onRefChanged(ref, element) {
if(element.classList.contains("skip"))
{
var filterState;
var ErrorCount = 0;
if(!filter) { console.log("Missing filter_container div"); ErrorCount++; }
if(!filterState) { console.log("Missing filterState object"); ErrorCount++; }
if(ErrorCount > 0)
{
switch(ErrorCount)
{
case 1:
{ console.log("This should have been generated by Cinera along with the following element containing the \"skip\" class:"); } break;
default:
{ console.log("These should have been generated by Cinera along with the following element containing the \"skip\" class:"); } break;
}
console.log(element); return;
}
if(!filter.classList.contains("responsible"))
{
filter.classList.add("responsible");
......
#ifndef HMML_H_
#define HMML_H_
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdio.h>
// Data structures
typedef struct {
char* member;
char* stream_platform;
char* stream_username;
char* project;
char* title;
char* vod_platform;
char* id;
char** co_hosts;
size_t co_host_count;
char** guests;
size_t guest_count;
char** annotators;
size_t annotator_count;
char* template;
char* medium;
} HMML_VideoMetaData;
typedef struct {
char* site;
char* page;
char* url;
char* title;
char* article;
char* author;
char* editor;
char* publisher;
char* isbn;
int offset;
} HMML_Reference;
typedef enum {
HMML_CATEGORY,
HMML_MEMBER,
HMML_PROJECT,
HMML_MARKER_COUNT,
} HMML_MarkerType;
typedef struct {
HMML_MarkerType type;
char* marker;
char* parameter;
char* episode;
int offset;
} HMML_Marker;
typedef struct {
int id;
char* author;
} HMML_Quote;
typedef struct {
int line;
char* time;
char* text;
char* author;
HMML_Reference* references;
size_t reference_count;
HMML_Marker* markers;
size_t marker_count;
HMML_Quote quote;
bool is_quote;
} HMML_Annotation;
typedef struct {
int line;
char* message;
} HMML_Error;
typedef struct {
bool well_formed;
HMML_VideoMetaData metadata;
HMML_Annotation* annotations;
size_t annotation_count;
HMML_Error error;
} HMML_Output;
// Functions
HMML_Output hmml_parse_file (FILE* file);
void hmml_dump (HMML_Output* output);
void hmml_free (HMML_Output* output);
// Version
extern const struct HMML_Version {
int Major, Minor, Patch;
} hmml_version;
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment