Просмотр исходного кода

Start work on proper CSS support.

develop
Ben Kurtovic 9 лет назад
Родитель
Сommit
c958375cac
3 измененных файлов: 34 добавлений и 0 удалений
  1. +7
    -0
      release.py
  2. +23
    -0
      src/main.css
  3. +4
    -0
      tfdclerk.js

+ 7
- 0
release.py Просмотреть файл

@@ -98,6 +98,13 @@ def _do_include(text, include):
if text[:text.index(tag)][-2:] == "\n\n" and source.startswith("\n"):
source = source[1:] # Remove extra newline

if include.endswith(".css"):
lines = ['"' + line.ljust(75) + '" +'
for line in source.strip().splitlines()]
if lines and lines[-1]:
lines[-1] = lines[-1][:-2] # Strip off last +
source = "\n".join(lines)

return text.replace(tag, source)

def _get_script():


+ 23
- 0
src/main.css Просмотреть файл

@@ -0,0 +1,23 @@
/* @TFDCLERK_HEADER_START@

Copyright (C) 2015 Ben Kurtovic <ben.kurtovic@gmail.com>

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.

@TFDCLERK_HEADER_END@ */

+ 4
- 0
tfdclerk.js Просмотреть файл

@@ -52,6 +52,10 @@ if (is_tfd_page()) {

/* Main script starts here */

mw.util.addCSS(
@TFDCLERK_INCLUDE:main.css@
);

@TFDCLERK_INCLUDE:main.js@
@TFDCLERK_INCLUDE:util.js@
@TFDCLERK_INCLUDE:tfd.js@


Загрузка…
Отмена
Сохранить