1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-23 00:00:06 +01:00
libwebsockets/doc/latex/md_README.generic-table.tex
2016-07-14 08:57:28 +08:00

40 lines
No EOL
1.7 KiB
TeX

\subsection*{What is generic-\/table? }
Generic-\/table is a J\+S\+ON schema and client-\/side JS file that makes it easy to display live, table structured H\+T\+ML over a ws link.
An example plugin and index.\+html using it are provided.
\subsection*{Enabling for build }
Enable at C\+Make with -\/\+D\+L\+W\+S\+\_\+\+W\+I\+T\+H\+\_\+\+P\+L\+U\+G\+I\+NS=1
\subsection*{Generic-\/table J\+S\+ON }
\subsubsection*{Column layout}
When the ws connection is established, the protocol should send a J\+S\+ON message describing the table columns. For example
\begin{DoxyCode}
1 msg = "\{\(\backslash\)"cols\(\backslash\)":["
2 " \{\(\backslash\)"name\(\backslash\)": \(\backslash\)"Date\(\backslash\)"\},"
3 " \{\(\backslash\)"name\(\backslash\)": \(\backslash\)"Size\(\backslash\)", \(\backslash\)"align\(\backslash\)": \(\backslash\)"right\(\backslash\)"\},"
4 " \{\(\backslash\)"name\(\backslash\)": \(\backslash\)"Icon\(\backslash\)"\},"
5 " \{\(\backslash\)"name\(\backslash\)": \(\backslash\)"Name\(\backslash\)", \(\backslash\)"href\(\backslash\)": \(\backslash\)"uri\(\backslash\)"\},"
6 " \{\(\backslash\)"name\(\backslash\)": \(\backslash\)"uri\(\backslash\)", \(\backslash\)"hide\(\backslash\)": \(\backslash\)"1\(\backslash\)" \}"
7 " ]"
8 "\}";
\end{DoxyCode}
\begin{DoxyItemize}
\item This describes 5 columns
\item Only four columns (not \char`\"{}uri\char`\"{}) should be visible
\item \char`\"{}\+Name\char`\"{} should be presented as a clickable link using \char`\"{}uri\char`\"{} as the destination, when a \char`\"{}uri\char`\"{} field is presented.
\item \char`\"{}\+Size\char`\"{} field should be presented aligned to the right
\end{DoxyItemize}
\subsubsection*{Table data}
The