Merge branch 'master' of github.com:shish/shimmie2
This commit is contained in:
commit
19ca8b7b9f
@ -72,7 +72,7 @@ class Home extends Extension {
|
|||||||
$main_links = '[url=site://post/list]Posts[/url] [url=site://comment/list]Comments[/url] [url=site://tags]Tags[/url]';
|
$main_links = '[url=site://post/list]Posts[/url] [url=site://comment/list]Comments[/url] [url=site://tags]Tags[/url]';
|
||||||
if(class_exists("Pools")) {$main_links .= ' [url=site://pools]Pools[/url]';}
|
if(class_exists("Pools")) {$main_links .= ' [url=site://pools]Pools[/url]';}
|
||||||
if(class_exists("Wiki")) {$main_links .= ' [url=site://wiki]Wiki[/url]';}
|
if(class_exists("Wiki")) {$main_links .= ' [url=site://wiki]Wiki[/url]';}
|
||||||
$main_links .= ' [url=site://ext_doc]>>[/url]';
|
$main_links .= ' [url=site://ext_doc]Documentation[/url]';
|
||||||
}
|
}
|
||||||
$main_links = format_text($main_links);
|
$main_links = format_text($main_links);
|
||||||
$main_text = $config->get_string('home_text');
|
$main_text = $config->get_string('home_text');
|
||||||
|
Binary file not shown.
@ -10,12 +10,40 @@ class Oekaki extends Extension {
|
|||||||
global $user, $page;
|
global $user, $page;
|
||||||
|
|
||||||
if($event->page_matches("oekaki")) {
|
if($event->page_matches("oekaki")) {
|
||||||
if(!$user->can("create_image")) {
|
if($user->can("create_image")) {
|
||||||
$this->theme->display_permission_denied();
|
if($event->get_arg(0) == "create") {
|
||||||
}
|
$this->theme->display_page();
|
||||||
|
$this->theme->display_block();
|
||||||
|
}
|
||||||
|
if($event->get_arg(0) == "claim") {
|
||||||
|
// FIXME: move .chi to data/oekaki/$ha/$hash mirroring images and thumbs
|
||||||
|
// FIXME: .chi viewer?
|
||||||
|
// FIXME: clean out old unclaimed images?
|
||||||
|
$pattern = data_path('oekaki_unclaimed/' . $_SERVER['REMOTE_ADDR'] . ".*.png");
|
||||||
|
foreach(glob($pattern) as $tmpname) {
|
||||||
|
assert(file_exists($tmpname));
|
||||||
|
|
||||||
if($event->get_arg(0) == "create") {
|
$pathinfo = pathinfo($tmpname);
|
||||||
$this->theme->display_page();
|
if(!array_key_exists('extension', $pathinfo)) {
|
||||||
|
throw new UploadException("File has no extension");
|
||||||
|
}
|
||||||
|
log_info("oekaki", "Processing file [{$pathinfo['filename']}]");
|
||||||
|
$metadata['filename'] = 'oekaki.png';
|
||||||
|
$metadata['extension'] = $pathinfo['extension'];
|
||||||
|
$metadata['tags'] = 'oekaki tagme';
|
||||||
|
$metadata['source'] = null;
|
||||||
|
$event = new DataUploadEvent($user, $tmpname, $metadata);
|
||||||
|
send_event($event);
|
||||||
|
if($event->image_id == -1) {
|
||||||
|
throw new UploadException("File type not recognised");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
unlink($tmpname);
|
||||||
|
$page->set_mode("redirect");
|
||||||
|
$page->set_redirect(make_link("post/view/".$event->image_id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if($event->get_arg(0) == "upload") {
|
if($event->get_arg(0) == "upload") {
|
||||||
// FIXME: this allows anyone to upload anything to /data ...
|
// FIXME: this allows anyone to upload anything to /data ...
|
||||||
@ -47,43 +75,14 @@ class Oekaki extends Extension {
|
|||||||
echo "CHIBIERROR No Data\n";
|
echo "CHIBIERROR No Data\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($event->get_arg(0) == "claim") {
|
|
||||||
// FIXME: move .chi to data/oekaki/$ha/$hash mirroring images and thumbs
|
|
||||||
// FIXME: .chi viewer?
|
|
||||||
// FIXME: clean out old unclaimed images?
|
|
||||||
$pattern = data_path('oekaki_unclaimed/' . $_SERVER['REMOTE_ADDR'] . ".*.png");
|
|
||||||
foreach(glob($pattern) as $tmpname) {
|
|
||||||
assert(file_exists($tmpname));
|
|
||||||
|
|
||||||
$pathinfo = pathinfo($tmpname);
|
|
||||||
if(!array_key_exists('extension', $pathinfo)) {
|
|
||||||
throw new UploadException("File has no extension");
|
|
||||||
}
|
|
||||||
log_info("oekaki", "Processing file [{$pathinfo['filename']}]");
|
|
||||||
$metadata['filename'] = 'oekaki.png';
|
|
||||||
$metadata['extension'] = $pathinfo['extension'];
|
|
||||||
$metadata['tags'] = 'oekaki tagme';
|
|
||||||
$metadata['source'] = null;
|
|
||||||
$event = new DataUploadEvent($user, $tmpname, $metadata);
|
|
||||||
send_event($event);
|
|
||||||
if($event->image_id == -1) {
|
|
||||||
throw new UploadException("File type not recognised");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
unlink($tmpname);
|
|
||||||
$page->set_mode("redirect");
|
|
||||||
$page->set_redirect(make_link("post/view/".$event->image_id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: "edit this image" button on existing images?
|
// FIXME: "edit this image" button on existing images?
|
||||||
function onPostListBuilding(PostListBuildingEvent $event) {
|
function onPostListBuilding(PostListBuildingEvent $event) {
|
||||||
global $user, $page;
|
global $user;
|
||||||
if($user->can("create_image")) {
|
if($user->can("create_image")) {
|
||||||
$this->theme->display_block($page);
|
$this->theme->display_block();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,24 @@
|
|||||||
ChibiPaint
|
ChibiPaint
|
||||||
|
|
||||||
|
Original version of ChibiPaint:
|
||||||
Copyright (c) 2006-2008 Marc Schefer
|
Copyright (c) 2006-2008 Marc Schefer
|
||||||
|
http://www.chibipaint.com/
|
||||||
|
|
||||||
|
Some icons taken from the GNU Image Manipulation Program.
|
||||||
|
Art contributors: http://git.gnome.org/browse/gimp/tree/AUTHORS
|
||||||
|
Lapo Calamandrei
|
||||||
|
Paul Davey
|
||||||
|
Alexia Death
|
||||||
|
Aurore Derriennic
|
||||||
|
Tuomas Kuosmanen
|
||||||
|
Karl La Rocca
|
||||||
|
Andreas Nilsson
|
||||||
|
Ville Pätsi
|
||||||
|
Mike Schaeffer
|
||||||
|
Carol Spears
|
||||||
|
Jakub Steiner
|
||||||
|
William Szilveszter
|
||||||
|
|
||||||
|
|
||||||
This file is part of ChibiPaint.
|
This file is part of ChibiPaint.
|
||||||
|
|
||||||
@ -66,7 +84,7 @@
|
|||||||
|
|
||||||
The form data name for the png file is 'picture' and 'chibifile' for the multilayer file. The recommended extension
|
The form data name for the png file is 'picture' and 'chibifile' for the multilayer file. The recommended extension
|
||||||
for chibifiles is '.chi'
|
for chibifiles is '.chi'
|
||||||
|
|
||||||
The applet expects the server to answer with the single line reply "CHIBIOK" followed by a newline character.
|
The applet expects the server to answer with the single line reply "CHIBIOK" followed by a newline character.
|
||||||
|
|
||||||
"CHIBIERROR" followed by an error message on the same list is the planned way to report an error but currently the
|
"CHIBIERROR" followed by an error message on the same list is the planned way to report an error but currently the
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// FIXME: Move all the stuff that handles size input to main.php
|
||||||
|
// FIXME: Move default canvas size to config file; changeable in board config
|
||||||
|
// While we're here, add maximum and minimum image sizes in config
|
||||||
|
// Maybe allow the resolution limiter extension to have a say in this
|
||||||
|
|
||||||
class OekakiTheme extends Themelet {
|
class OekakiTheme extends Themelet {
|
||||||
public function display_page() {
|
public function display_page() {
|
||||||
@ -7,29 +11,55 @@ class OekakiTheme extends Themelet {
|
|||||||
$base_href = get_base_href();
|
$base_href = get_base_href();
|
||||||
$http_base = make_http($base_href);
|
$http_base = make_http($base_href);
|
||||||
|
|
||||||
|
$oekW = $config->get_int("oekaki_width", 400);
|
||||||
|
$oekH = $config->get_int("oekaki_height", 400);
|
||||||
|
if(isset($_POST['oekW']) && isset($_POST['oekH'])) {
|
||||||
|
$oekW = int_escape($_POST['oekW']);
|
||||||
|
$oekH = int_escape($_POST['oekH']);
|
||||||
|
}
|
||||||
|
|
||||||
$html = "
|
$html = "
|
||||||
<applet archive='$base_href/ext/oekaki/chibipaint.jar' code='chibipaint.ChibiPaint.class' width='800' height='600'>
|
<applet archive='$base_href/ext/oekaki/chibipaint.jar' code='chibipaint.ChibiPaint.class' width='800' height='600'>
|
||||||
<param name='canvasWidth' value='400' />
|
<param name='canvasWidth' value='".$oekW."' />
|
||||||
<param name='canvasHeight' value='300' />
|
<param name='canvasHeight' value='".$oekH."' />
|
||||||
<param name='postUrl' value='".make_http(make_link("oekaki/upload"))."' />
|
<param name='postUrl' value='".make_http(make_link("oekaki/upload"))."' />
|
||||||
<param name='exitUrl' value='".make_http(make_link("oekaki/claim"))."' />
|
<param name='exitUrl' value='".make_http(make_link("oekaki/claim"))."' />
|
||||||
<param name='exitUrlTarget' value='_self' />
|
<param name='exitUrlTarget' value='_self' />
|
||||||
JAVA NOT SUPPORTED! <!-- alternative content for users who don't have Java installed -->
|
JAVA NOT INSTALLED :(<!-- alternative content for users who don't have Java installed -->
|
||||||
</applet>
|
</applet>
|
||||||
";
|
";
|
||||||
|
|
||||||
# <param name='loadImage' value='http://yourserver/oekaki/pictures/168.png' />
|
# <param name='loadImage' value='http://yourserver/oekaki/pictures/168.png' />
|
||||||
# <param name='loadChibiFile' value='http://yourserver/oekaki/pictures/168.chi' />
|
# <param name='loadChibiFile' value='http://yourserver/oekaki/pictures/168.chi' />
|
||||||
|
// FIXME: prevent oekaki block from collapsing on click in cerctain themes. This causes canvas reset
|
||||||
$page->set_title("Oekaki");
|
$page->set_title("Oekaki");
|
||||||
$page->set_heading("Oekiaki");
|
$page->set_heading("Oekaki");
|
||||||
$page->add_block(new NavBlock());
|
$page->add_block(new NavBlock());
|
||||||
$page->add_block(new Block("Oekaki", $html, "main", 20));
|
$page->add_block(new Block("Oekaki", $html, "main", 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_block() {
|
public function display_block() {
|
||||||
global $page;
|
global $config, $page;
|
||||||
$page->add_block(new Block(null, "<a href='".make_link("oekaki/create")."'>Open Oekaki</a>", "left", 21)); // upload is 20
|
//FIXME: input field alignment could be done more elegantly, without inline styling
|
||||||
|
//FIXME: autocomplete='off' seems to be an invalid HTML tag
|
||||||
|
|
||||||
|
$oekW = $config->get_int("oekaki_width", 400);
|
||||||
|
$oekH = $config->get_int("oekaki_height", 400);
|
||||||
|
if(isset($_POST['oekW']) && isset($_POST['oekH'])) {
|
||||||
|
$oekW = int_escape($_POST['oekW']);
|
||||||
|
$oekH = int_escape($_POST['oekH']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$page->add_block(new Block("Oekaki",
|
||||||
|
"
|
||||||
|
<form form enctype='multipart/form-data' action='".make_link("oekaki/create")."' method='POST'>
|
||||||
|
<input autocomplete='off' style='width: auto;' name='oekW' type='text' size='3' value='".$oekW."'/>".
|
||||||
|
"x".
|
||||||
|
"<input autocomplete='off' style='width: auto;' name='oekH' type='text' size='3' value='".$oekH."'/>".
|
||||||
|
"<input autocomplete='off' type='submit' value='Create!' />
|
||||||
|
</form>
|
||||||
|
"
|
||||||
|
, "left", 21)); // upload is 20
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
-moz-column-break-inside: avoid;
|
-moz-column-break-inside: avoid;
|
||||||
-webkit-column-break-inside: avoid;
|
-webkit-column-break-inside: avoid;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 100%;
|
width: 90%;
|
||||||
}
|
}
|
||||||
.setupblock TEXTAREA {
|
.setupblock TEXTAREA {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -313,7 +313,7 @@ class UploadTheme extends Themelet {
|
|||||||
for($i=0; $i<$upload_count; $i++) {
|
for($i=0; $i<$upload_count; $i++) {
|
||||||
if($i == 0) $style = ""; // "style='display:visible'";
|
if($i == 0) $style = ""; // "style='display:visible'";
|
||||||
else $style = "style='display:none'";
|
else $style = "style='display:none'";
|
||||||
$upload_list .= "<input id='data$i' name='data$i' $style onchange=\"$('#data".($i+1)."').show()\" type='file'>\n";
|
$upload_list .= "<input id='data$i' name='data$i' $style onchange=\"$('#data".($i+1)."').show()\" size='16' type='file'>\n";
|
||||||
}
|
}
|
||||||
$max_size = $config->get_int('upload_size');
|
$max_size = $config->get_int('upload_size');
|
||||||
$max_kb = to_shorthand_int($max_size);
|
$max_kb = to_shorthand_int($max_size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user