diff --git a/ext/upload/bookmarklet.js b/ext/upload/bookmarklet.js new file mode 100644 index 00000000..05646134 --- /dev/null +++ b/ext/upload/bookmarklet.js @@ -0,0 +1,66 @@ +/* Imageboard to Shimmie */ +// This should work with "most" sites running Danbooru/Gelbooru/Shimmie + +var maxsze = (maxsze.match("(?:\.*[0-9])")) * 1024; //This assumes we are only working with MB. +var toobig = "The file you are trying to upload is too big to upload!"; +var notsup = "The file you are trying to upload is not supported!"; + +if (confirm("OK = Use Current tags.\nCancel = Use new tags.")==true){}else{var tag=prompt("Enter Tags","");var chk=1;}; + +// Danbooru +if(document.getElementById("post_tags") !== null){ + if (typeof tag !=="ftp://ftp." && chk !==1){var tag=document.getElementById("post_tags").value;} + var rtg=document.getElementById("stats").innerHTML.match("
Upload to '.$title.' (Drag & drop onto your bookmarks toolbar, then click when looking at an image)'; } { - /* Danbooru > Shimmie Bookmarklet. - This "should" work on any site running danbooru, unless for some odd reason they switched around the id's or aren't using post/list. - Most likely this will stop working when Danbooru updates to v2, all depends if they switch the ids or not >_>. - Clicking the link on a danbooru image page should give you something along the lines of: - 'http://www.website.com/shimmie/upload?url="http://sonohara.donmai.us/data/crazylongurl.jpg&tags="too many tags"&rating="s"&source="http://danbooru.donmai.us/post/show/012345/"' - TODO: Possibly make the entire/most of the script into a .js file, and just make the bookmarklet load it on click (Something like that?) + /* Imageboard > Shimmie Bookmarklet + This is more or less, an upgraded version of the "Danbooru>Shimmie" bookmarklet. + At the moment this works with Shimmie & Danbooru. + It would also work with Gelbooru but unless someone can figure out how to bypass their hotlinking..meh. + The bookmarklet is now also loaded via the .js file in this folder. */ - $title = "Danbooru to " . $config->get_string('title'); - $html .= '
' . - $title . ' (As above, Click on a Danbooru-run image page. (This also grabs the tags/rating/source!))'; - + //Bookmarklet checks if shimmie supports ext. If not, won't upload to site/shows alert saying not supported. + $supported_ext = "jpg jpeg gif png"; + if(file_exists("ext/handle_flash")){$supported_ext .= " swf";} + if(file_exists("ext/handle_ico")){$supported_ext .= " ico ani cur";} + if(file_exists("ext/handle_mp3")){$supported_ext .= " mp3";} + if(file_exists("ext/handle_svg")){$supported_ext .= " svg";} + $title = "Booru to " . $config->get_string('title'); + $html .= '
'. + $title . ' (Click when looking at an image page. Works on sites running Shimmie/Danbooru/Gelbooru. (This also grabs the tags/rating/source!))'; } } diff --git a/themes/lite/holidays/style_aprilfools.css b/themes/lite/holidays/style_aprilfools.css new file mode 100644 index 00000000..0f3f3080 --- /dev/null +++ b/themes/lite/holidays/style_aprilfools.css @@ -0,0 +1,21 @@ + /* + If you wish to play about with colors, the main two colors to replace are: + Main color: #CEDFF0 + Secondary color: #E3EFFA + */ + +BODY { + background: #F0F7FF; + font-family: sans-serif; + font-size: 14px; + margin: 0px; + /* It's a bit crazy but, april fools is supposed to be crazy. + This flips the entire page upside down. + TODO: Add a way for the user to disable this */ + + -webkit-transform: rotate(-180deg); /*Safari*/ + -moz-transform: rotate(-180deg); /*Firefox*/ + -o-transform: rotate(-180deg); /*Opera*/ + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); /*IE6*/ + ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)"; /*IE7+?*/ +} diff --git a/themes/lite/layout.class.php b/themes/lite/layout.class.php index 00fd54c9..363f466b 100644 --- a/themes/lite/layout.class.php +++ b/themes/lite/layout.class.php @@ -24,6 +24,33 @@ class Layout { $header_html .= "\t\t$line\n"; } + /* Holiday Stuff! + If the current day is one of the set holidays, it will use a seperate stylesheet. Aswell as a few extra things depending on the day. + This only adds April Fools for now. + TODO: Add setup block to make the whole holiday thing "optional". / Choose what holidays you wish to use. + */ + if(/*date('d/m') == '01/01' || date('d/m') == '14/02' || */date('d/m') == '01/04'/* || date('d/m') == '24/12' || date('d/m') == '25/12' || date('d/m') == '31/12'*/){ + + $csssheet = ""; + if(file_exists("ext/random_image")){ + $banner .= "