initial commit

This commit is contained in:
John Bintz 2009-06-13 08:10:16 -04:00
commit d44bd6f775
159 changed files with 25462 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*~

25
README Normal file
View File

@ -0,0 +1,25 @@
The ComicPress Manager plugin works in conjunction with an installation of ComicPress,
the Webcomic theme for WordPress. ComicPress Manager is intended to reduce the amount
of work required to administer a site running ComicPress.
This is the 1.5 line. All new development and cleanup work should go here.
PHPUnit and MockPress (http://github.com/johnbintz/mockpress/tree/master) are
required to build and run the unit tests.
Copyright 2008-2009 John Bintz
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

View File

@ -0,0 +1,282 @@
<?php
//harmonious @zip @hash
function cpm_action_batch_processing() {
global $comicpress_manager, $comicpress_manager_admin;
$files_to_delete = array();
$posts_to_delete = array();
$thumbnails_to_regenerate = array();
$files_to_redate = array();
$posts_to_redate = array();
$posts_to_generate = array();
$posts_that_exist = array();
$posts_to_recategorize = array();
extract($comicpress_manager->normalize_storyline_structure());
$comic_categories = array();
foreach ($category_tree as $node) { $comic_categories[] = end(explode("/", $node)); }
$comicpress_manager->is_cpm_managing_posts = true;
foreach ($_POST as $field => $value) {
if (($_POST['bulk-action'] != "-1") && ($_POST['bulk-action'] != "individual")) {
$bulk_posts_updated = array();
if (preg_match("#^(file|post),([^\,]*),(.*)$#", $field, $matches) > 0) {
list ($all, $type, $date, $id) = $matches;
if (isset($_POST["batch-${date}"])) {
switch ($_POST['bulk-action']) {
case "delete":
switch ($type) {
case "file":
if (($result = cpm_match_id_to_file($id)) !== false) {
$files_to_delete[] = $result;
}
break;
case "post": $posts_to_delete[] = $id; break;
}
break;
case "regen-thumbs":
if ($type == "file") {
if (($result = cpm_match_id_to_file($id)) !== false) {
$thumbnails_to_regenerate[] = $result;
}
}
break;
case "edit":
if ($type == "post") {
foreach (array('hovertext' => 'bulk-hovertext',
'transcript' => 'bulk-transcript') as $meta_name => $post_name) {
if (isset($_POST[$post_name])) {
update_post_meta($id, $meta_name, $_POST[$post_name]);
}
}
$post_categories = wp_get_post_categories($id);
$did_change = false;
if (isset($_POST['bulk-storyline-in-comic-category'])) {
foreach ($comic_categories as $category_id) {
if (in_array($category_id, $_POST['bulk-storyline-in-comic-category'])) {
if (!in_array($category_id, $post_categories)) {
$did_change = true;
$post_categories[] = $category_id;
}
} else {
if (($index = array_search($category_id, $post_categories)) !== false) {
$did_change = true;
array_splice($post_categories, $index, 1);
}
}
}
}
if ($did_change) {
wp_set_post_categories($id, $post_categories);
}
$bulk_posts_updates[] = $id;
}
break;
case "import":
switch ($type) {
case "file":
if (($result = cpm_match_id_to_file($id)) !== false) {
$posts_to_generate[] = $result;
}
break;
case "post":
$posts_that_exist[] = $date;
break;
}
break;
}
}
}
} else {
if (preg_match('#^([0-9]+)-in-comic-category#', $field, $matches) > 0) {
if (get_post($matches[1])) {
$posts_to_recategorize[$matches[1]] = $value;
}
}
if (preg_match("#^delete-file-(.*)$#", $field, $matches) > 0) {
if (($result = cpm_match_id_to_file($matches[1])) !== false) {
$files_to_delete[] = $result;
}
}
if (preg_match("#^delete-post-(.*)$#", $field, $matches) > 0) {
if (get_post($matches[1])) {
$posts_to_delete[] = $matches[1];
}
}
if (preg_match('#^regen-(.*)$#', $field, $matches) > 0) {
if (($result = cpm_match_id_to_file($matches[1])) !== false) {
$thumbnails_to_regenerate[] = $result;
}
}
if (preg_match("#^do-redate-file-(.*)$#", $field, $matches) > 0) {
if (($result = cpm_match_id_to_file($matches[1])) !== false) {
$files_to_redate[$result] = $value;
}
}
if (preg_match("#^generate-post-(.*)$#", $field, $matches) > 0) {
if (($result = cpm_match_id_to_file($matches[1])) !== false) {
$posts_to_generate[] = $result;
}
}
if (preg_match("#^delete-post-(.*)$#", $field, $matches) > 0) {
if (get_post($matches[1])) {
$posts_to_redate[$matches[1]] = $value;
}
}
}
}
$did_generate_thumbs = array();
$ok_to_keep_uploading = true;
$files_created_in_operation = array();
if (count($thumbnails_to_regenerate) > 0) {
$thumbnails_written = array();
$thumbnails_not_written = array();
foreach ($thumbnails_to_regenerate as $file) {
$comic_file = pathinfo($file, PATHINFO_BASENAME);
$wrote_thumbnail = $comicpress_manager_admin->write_thumbnail($file, $comic_file, true);
if (!is_null($wrote_thumbnail)) {
if (is_array($wrote_thumbnail)) {
$files_created_in_operation = array_merge($files_created_in_operation, $wrote_thumbnail);
$thumbnails_written[] = $comic_file;
} else {
$thumbnails_not_written[] = $comic_file;
}
}
if (function_exists('cpm_wpmu_is_over_storage_limit')) {
if (cpm_wpmu_is_over_storage_limit()) { $ok_to_keep_uploading = false; break; }
}
}
if (count($thumbnails_written) > 0) {
$comicpress_manager->messages[] = sprintf(__("<strong>The following thumbnails were written:</strong> %s", 'comicpress-manager'), implode(", ", $thumbnails_written));
}
if (count($thumbnails_not_written) > 0) {
$comicpress_manager->warnings[] = sprintf(__("<strong>The following thumbnails were not written:</strong> %s", 'comicpress-manager'), implode(", ", $thumbnails_not_written));
}
}
if (count($bulk_posts_updates) > 0) {
$comicpress_manager->messages[] = sprintf(__("<strong>The following posts were updated:</strong> %s", 'comicpress-manager'), implode(", ", $bulk_posts_updates));
}
if (count($files_to_delete) > 0) {
$comic_files_deleted = array();
foreach ($files_to_delete as $file) {
$comic_file = pathinfo($file, PATHINFO_BASENAME);
$delete_targets = array($file);
foreach ($comicpress_manager->thumbs_folder_writable as $type => $value) {
$path = CPM_DOCUMENT_ROOT . '/' . $comicpress_manager->properties[$type . "_comic_folder"];
if (($subdir = $comicpress_manager->get_subcomic_directory()) !== false) {
$path .= '/' . $subdir;
}
$path .= '/' . $comic_file;
$delete_targets[] = $path;;
}
foreach ($delete_targets as $target) {
if (file_exists($target)) {
@unlink($target);
}
}
$comic_files_deleted[] = $comic_file;
}
$comicpress_manager->messages[] = sprintf(__("<strong>The following comic files and their associated thumbnails were deleted:</strong> %s", 'comicpress-manager'), implode(", ", $comic_files_deleted));
}
if (count($posts_to_delete) > 0) {
foreach ($posts_to_delete as $post) {
wp_delete_post($post);
}
$comicpress_manager->messages[] = sprintf(__("<strong>The following posts were deleted:</strong> %s", 'comicpress-manager'), implode(", ", $posts_to_delete));
}
$master_category = end(explode("/", reset($category_tree)));
foreach ($posts_to_generate as $file) {
$ok = false;
$comic_file = pathinfo($file, PATHINFO_BASENAME);
if (($result = $comicpress_manager->breakdown_comic_filename($comic_file)) !== false) {
if (!in_array(date("Y-m-d", strtotime($result['date'])), $posts_that_exist)) {
if (($post_hash = $comicpress_manager->generate_post_hash($result['date'], $result['converted_title'])) !== false) {
$post_hash['post_category'] = array($master_category);
$ok = !is_null($post_id = wp_insert_post($post_hash));
}
}
}
if ($ok) {
$comicpress_manager->messages[] = sprintf(__('<strong>Created post %1$s for %2$s.</strong>', 'comicpress-manager'), $post_id, $comic_file);
} else {
$comicpress_manager->warnings[] = sprintf(__("<strong>Could not create post for %s.</strong>", 'comicpress-manager'), $comic_file);
}
}
foreach ($posts_to_recategorize as $id => $requested_comic_categories) {
if (!in_array($id, $posts_to_delete)) {
$post_categories = wp_get_post_categories($id);
$did_change = false;
foreach ($comic_categories as $category_id) {
if (in_array($category_id, $requested_comic_categories)) {
if (!in_array($category_id, $post_categories)) {
$did_change = true;
$post_categories[] = $category_id;
}
} else {
if (($index = array_search($category_id, $post_categories)) !== false) {
$did_change = true;
array_splice($post_categories, $index, 1);
}
}
}
if ($did_change) {
wp_set_post_categories($id, $post_categories);
$comicpress_manager->messages[] = sprintf(__("<strong>Storyline for post %s updated.</strong>", 'comicpress-manager'), $id);
}
}
}
if (!$ok_to_keep_uploading) {
$comicpress_manager->warnings = array($comicpress_manager->wpmu_disk_space_message);
foreach ($files_created_in_operation as $file) { @unlink($file); }
}
$comicpress_manager->comic_files = $comicpress_manager->read_comics_folder();
}
function cpm_match_id_to_file($id) {
global $comicpress_manager;
foreach ($comicpress_manager->comic_files as $file) {
$filename = str_replace(".", "_", pathinfo($file, PATHINFO_BASENAME));
if ($filename == $id) { return $file; }
}
return false;
}
?>

View File

@ -0,0 +1,191 @@
<?php
//harmonious @zip @hash
function cpm_action_build_storyline_schema() {
global $comicpress_manager;
update_option('comicpress-enable-storyline-support', isset($_POST['enable-storyline-support']) ? 1 : 0);
update_option('comicpress-storyline-show-top-category', isset($_POST['show-top-category']) ? 1 : 0);
if (isset($_POST['enable-storyline-support'])) {
$comicpress_manager->is_cpm_modifying_categories = true;
$categories_to_create = array();
$categories_to_rename = array();
$category_ids_to_clean = array();
extract($comicpress_manager->get_all_comic_categories());
$comic_posts = $comicpress_manager->query_posts();
$comic_posts_by_category_id = array();
foreach ($comic_posts as $post) {
foreach (wp_get_post_categories($post->ID) as $category) {
if (!isset($comic_posts_by_category_id[$category])) { $comic_posts_by_category_id[$category] = array(); }
$comic_posts_by_category_id[$category][] = $post->ID;
}
}
foreach ($_POST as $field => $value) {
$parts = explode("/", $field);
if (($parts[0] == "0") && (count($parts) > 1)) {
$category_id = end($parts);
$category = get_category($category_id, ARRAY_A);
if (!empty($category)) {
if ($category['cat_name'] != $value) {
$comicpress_manager->messages[] = sprintf(__('Category <strong>%1$s</strong> renamed to <strong>%2$s</strong>.', 'comicpress-manager'), $category['cat_name'], $value);
$category['cat_name'] = $value;
wp_update_category($category);
$category_ids_to_clean[] = $category_id;
}
} else {
$categories_to_create[$field] = $value;
}
if (($index = array_search($field, $category_tree)) !== false) {
array_splice($category_tree, $index, 1);
}
}
}
if (isset($_POST['original-categories'])) {
foreach (explode(",", $_POST['original-categories']) as $node) {
if (!isset($_POST[$node])) {
$category_id = end(explode("/", $node));
$category = get_category($category_id);
$original_cat_name = $category->cat_name;
// ensure that we're not deleting a ComicPress category
$ok = true;
foreach (array('comiccat', 'blogcat') as $type) {
if ($category_id == $comicpress_manager->properties[$type]) { $ok = false; }
}
// ensure that the category truly is a child of the comic category
if ($ok) {
$category = get_category($category_id);
$ok = false;
if (!is_wp_error($category)) {
while (($category->parent != 0) && ($category->parent != $comicpress_manager->properties['comiccat'])) {
$category = get_category($category->parent);
}
if ($category->parent == $comicpress_manager->properties['comiccat']) { $ok = true; }
}
}
if ($ok) {
wp_delete_category($category_id);
$category_ids_to_clean[] = $category_id;
$comicpress_manager->messages[] = sprintf(__('Category <strong>%s</strong> deleted.', 'comicpress-manager'), $original_cat_name);
}
}
}
}
uksort($categories_to_create, 'cpm_sort_category_keys_by_length');
$changed_field_ids = array();
$removed_field_ids = array();
$target_category_ids = array();
foreach ($categories_to_create as $field => $value) {
$original_field = $field;
foreach ($changed_field_ids as $changed_field => $new_field) {
if ((strpos($field, $changed_field) === 0) && (strlen($field) > strlen($changed_field))) {
$field = str_replace($changed_field, $new_field, $field);
break;
}
}
$parts = explode("/", $field);
$target_id = array_pop($parts);
$parent_id = array_pop($parts);
if (!category_exists($value)) {
$category_id = wp_create_category($value, $parent_id);
$category_ids_to_clean[] = $category_id;
array_push($parts, $parent_id);
array_push($parts, $category_id);
$changed_field_ids[$original_field] = implode("/", $parts);
$comicpress_manager->messages[] = sprintf(__('Category <strong>%s</strong> created.', 'comicpress-manager'), $value);
} else {
$comicpress_manager->warnings[] = sprintf(__("The category %s already exists. Please enter a new name.", 'comicpress-manager'), $value);
$removed_field_ids[] = $field;
}
}
$order = array_diff(explode(",", $_POST['order']), $removed_field_ids);
for ($i = 0; $i < count($order); ++$i) {
if (isset($changed_field_ids[$order[$i]])) {
$order[$i] = $changed_field_ids[$order[$i]];
}
}
// ensure we're writing sane data
$new_order = array();
$valid_comic_categories = array();
foreach ($order as $node) {
$parts = explode("/", $node);
if (($parts[0] == "0") && (count($parts) > 1)) {
$new_order[] = $node;
$valid_comic_categories[] = end($parts);
}
}
$comic_categories_preserved = array();
foreach ($comic_posts as $post) {
$categories = wp_get_post_categories($post->ID);
if (count(array_intersect($valid_comic_categories, $categories)) == 0) {
$all_parent_categories = array();
foreach ($comic_posts_by_category_id as $category => $post_ids) {
if (in_array($post->ID, $post_ids)) {
foreach ($new_order as $node) {
$parts = explode("/", $node);
if ($category == end($parts)) {
$parts = explode("/", $node);
array_pop($parts);
if (count($parts) > 1) { $all_parent_categories[] = implode("/", $parts); }
}
}
}
}
if (count($all_parent_categories) > 0) {
foreach ($all_parent_categories as $category_node) {
if (in_array($category_node, $new_order)) {
$categories[] = end(explode("/", $category_node));
}
}
} else {
$categories[] = $comicpress_manager->properties['comiccat'];
}
wp_set_post_categories($post->ID, $categories);
$comic_categories_preserved[] = $post->ID;
}
}
if (count($comic_categories_preserved) > 0) {
$comicpress_manager->messages[] = sprintf(__("The following orphaned comic posts were placed into their original category's parent: <strong>%s</strong>"), implode(", ", $comic_categories_preserved));
}
$comicpress_manager->messages[] = __('Storyline structure saved.', 'comicpress-manager');
update_option("comicpress-storyline-category-order", implode(",", $new_order));
clean_term_cache($category_ids_to_clean, 'category');
wp_cache_flush();
}
}
function cpm_sort_category_keys_by_length($a, $b) {
return strlen($a) - strlen($b);
}
?>

View File

@ -0,0 +1,180 @@
<?php
//harmonious @zip @hash
function cpm_action_change_dates() {
global $comicpress_manager;
$comic_posts_to_date_shift = array();
$comic_files_to_date_shift = array();
$comic_post_target_date_counts = array();
$wp_date_string_length = strlen(date("Y-m-d"));
$cpm_date_string_length = strlen(date(CPM_DATE_FORMAT));
$comicpress_manager->is_cpm_managing_posts = true;
// find all comic files that will be shifted
foreach ($comicpress_manager->comic_files as $comic_file) {
$comic_filename = pathinfo($comic_file, PATHINFO_BASENAME);
$filename_info = $comicpress_manager->breakdown_comic_filename($comic_filename);
$key = md5($comic_file);
if (isset($_POST['dates'][$key])) {
if ($_POST['dates'][$key] != $filename_info['date']) {
$timestamp = strtotime($_POST['dates'][$key]);
if (($timestamp !== false) && ($timestamp !== -1)) {
$target_date = date(CPM_DATE_FORMAT, $timestamp);
$new_comic_filename = $target_date . substr($comic_filename, $cpm_date_string_length);
$comic_posts_to_date_shift[strtotime($filename_info['date'])] = $timestamp;
if (!isset($comic_post_target_date_counts[$timestamp])) {
$comic_post_target_date_counts[$timestamp] = 0;
}
$comic_post_target_date_counts[$timestamp]++;
if (!isset($comic_files_to_date_shift[$timestamp])) {
$comic_files_to_date_shift[$timestamp] = array($comic_filename, $new_comic_filename);
}
}
}
}
}
$comic_posts_to_change = array();
$all_posts = $comicpress_manager->query_posts();
// get the target dates for all files to move
if (count($comic_posts_to_date_shift) > 0) {
foreach ($all_posts as $comic_post) {
$post_date_day = substr($comic_post->post_date, 0, $wp_date_string_length);
$post_date_day_timestamp = strtotime($post_date_day);
if (isset($comic_posts_to_date_shift[$post_date_day_timestamp])) {
if ($comic_post_target_date_counts[$comic_posts_to_date_shift[$post_date_day_timestamp]] == 1) {
$new_post_date = date("Y-m-d", $comic_posts_to_date_shift[$post_date_day_timestamp]) . substr($comic_post->post_date, $wp_date_string_length);
$comic_posts_to_change[$comic_post->ID] = array($comic_post, $new_post_date);
}
}
}
}
$final_post_day_counts = array();
// intersect all existing and potential new posts, counting how many
// posts occur on each day
foreach ($all_posts as $comic_post) {
if (isset($comic_posts_to_change[$comic_post->ID])) {
$date_to_use = $comic_posts_to_change[$comic_post->ID][1];
} else {
$date_to_use = $comic_post->post_date;
}
$day_to_use = strtotime(substr($date_to_use, 0, $wp_date_string_length));
if (!isset($final_post_day_counts[$day_to_use])) {
$final_post_day_counts[$day_to_use] = 0;
}
$final_post_day_counts[$day_to_use]++;
}
$posts_moved = array();
// move what can be moved
foreach ($comic_posts_to_change as $id => $info) {
list($comic_post, $new_post_date) = $info;
$new_post_day = strtotime(substr($new_post_date, 0, $wp_date_string_length));
if ($final_post_day_counts[$new_post_day] == 1) {
$old_post_date = $comic_post->post_date;
$comic_post->post_date = $new_post_date;
$comic_post->post_date_gmt = get_gmt_from_date($new_post_date);
wp_update_post($comic_post);
$comicpress_manager->messages[] = sprintf(__('<strong>Post %1$s moved to %2$s.</strong>', 'comicpress-manager'), $id, date("Y-m-d", $new_post_day));
$posts_moved[$new_post_day] = array($comic_post, $old_post_date);
} else {
$comicpress_manager->warnings[] = sprintf(__('<strong>Moving post %1$s to %2$s would cause two comic posts to exist on the same day.</strong> This is not allowed in the automated process.', 'comicpress-manager'), $id, date("Y-m-d", $new_post_day));
}
}
// try to move all the files, and roll back any changes to files and posts that fail
foreach ($comic_post_target_date_counts as $target_date => $count) {
if (!isset($final_post_day_counts[$target_date]) || ($final_post_day_counts[$target_date] == 1)) {
if ($count > 1) {
$comicpress_manager->warnings[] = sprintf(__("<strong>You are moving two comics to the same date: %s.</strong> This is not allowed in the automated process.", 'comicpress-manager'), $target_date);
} else {
list($comic_filename, $new_comic_filename) = $comic_files_to_date_shift[$target_date];
$roll_back_change = false;
$calculate_do_move = array();
foreach (array(
array(__('comic folder', 'comicpress-manager'), 'comic_folder', ""),
array(__('RSS feed folder', 'comicpress-manager'), 'rss_comic_folder', "rss"),
array(__('archive folder', 'comicpress-manager'), 'archive_comic_folder', "archive")) as $folder_info) {
list ($name, $property, $type) = $folder_info;
$do_move = true;
if ($type != "") {
if ($comicpress_manager->separate_thumbs_folder_defined[$type]) {
if ($comicpress_manager->thumbs_folder_writable[$type]) {
$do_move = ($comicpress_manager->get_cpm_option("${type}-generate-thumbnails") == 1);
}
}
$calculate_do_move[$type] = $do_move;
}
if ($do_move) {
$path = CPM_DOCUMENT_ROOT . '/' . $comicpress_manager->properties[$property];
if (!file_exists($path)) {
$comicpress_manager->errors[] = sprintf(__('The %1$s <strong>%2$s</strong> does not exist.', 'comicpress-manager'), $name, $comicpress_manager->properties[$property]);
$roll_back_change = true;
} else {
if (file_exists($path . '/' . $comic_filename)) {
if (@rename($path . '/' . $comic_filename, $path . '/' . $new_comic_filename)) {
$comicpress_manager->messages[] = sprintf(__('<strong>Rename %1$s file %2$s to %3$s.</strong>', 'comicpress-manager'), $name, $comic_filename, $new_comic_filename);
} else {
$comicpress_manager->warnings[] = sprintf(__('<strong>The renaming of %1$s to %2$s failed.</strong> Check the permissions on %3$s', 'comicpress-manager'), $comic_filename, $new_comic_filename, $path);
$roll_back_change = true;
}
}
}
}
}
if ($roll_back_change) {
foreach (array(
array(__('comic folder', 'comicpress-manager'), 'comic_folder',""),
array(__('RSS feed folder', 'comicpress-manager'), 'rss_comic_folder',"rss"),
array(__('archive folder', 'comicpress-manager'), 'archive_comic_folder',"archive")) as $folder_info) {
list ($name, $property) = $folder_info;
$do_move = isset($calculate_do_move[$type]) ? $calculate_do_move[$type] : true;
if ($do_move) {
$path = CPM_DOCUMENT_ROOT . '/' . $comicpress_manager->properties[$property];
if (file_exists($path . '/' . $new_comic_filename)) {
@rename($path . '/' . $new_comic_filename, $path . '/' . $comic_filename);
$comicpress_manager->messages[] = sprintf(__("<strong>Rolling back %s.</strong>", 'comicpress-manager'), $new_comic_filename);
}
}
}
if (isset($posts_moved[$target_date])) {
list($comic_post, $old_post_date) = $posts_moved[$target_date];
$comic_post->post_date = $old_post_date;
$comic_post->post_date_gmt = get_gmt_from_date($old_post_date);
wp_update_post($comic_post);
$comicpress_manager->messages[] = sprintf(__('<strong>Rename error, rolling back post %1$s to %2$s.</strong>', 'comicpress-manager'), $comic_post->ID, $old_post_date);
}
}
}
}
}
$comicpress_manager->comic_files = $comicpress_manager->read_comics_folder();
}
?>

View File

@ -0,0 +1,110 @@
<?php
function cpm_action_create_missing_posts() {
global $comicpress_manager, $comicpress_manager_admin;
$all_post_dates = array();
foreach ($comicpress_manager->query_posts() as $comic_post) {
$all_post_dates[] = date(CPM_DATE_FORMAT, strtotime($comic_post->post_date));
}
$all_post_dates = array_unique($all_post_dates);
$duplicate_posts_within_creation = array();
$posts_created = array();
$thumbnails_written = array();
$thumbnails_not_written = array();
$invalid_filenames = array();
$duplicate_posts = array();
$new_thumbnails_not_needed = array();
$execution_time = ini_get("max_execution_time");
$max_posts_imported = (int)($execution_time / 2);
$imported_post_count = 0;
$safe_exit = false;
if (strtotime($_POST['time']) === false) {
$comicpress_manager->warnings[] = sprintf(__('<strong>There was an error in the post time (%1$s)</strong>. The time is not parseable by strtotime().', 'comicpress-manager'), $_POST['time']);
} else {
foreach ($comicpress_manager->comic_files as $comic_file) {
$comic_file = pathinfo($comic_file, PATHINFO_BASENAME);
if (($result = $comicpress_manager->breakdown_comic_filename($comic_file)) !== false) {
extract($result, EXTR_PREFIX_ALL, 'filename');
$ok_to_create_post = !in_array($result['date'], $all_post_dates);
$show_duplicate_post_message = false;
$post_id = null;
if (isset($duplicate_posts_within_creation[$result['date']])) {
$ok_to_create_post = false;
$show_duplicate_post_message = true;
$post_id = $duplicate_posts_within_creation[$result['date']];
}
if ($ok_to_create_post) {
if (isset($_POST['duplicate_check'])) {
$ok_to_create_post = (($post_id = post_exists($post_title, $post_content, $post_date)) == 0);
}
} else {
if (!isset($_POST['duplicate_check'])) {
$ok_to_create_post = true;
}
}
if ($ok_to_create_post) {
if (($post_hash = $comicpress_manager->generate_post_hash($filename_date, $filename_converted_title)) !== false) {
if (!is_null($post_id = wp_insert_post($post_hash))) {
$imported_post_count++;
$posts_created[] = get_post($post_id, ARRAY_A);
$date = date(CPM_DATE_FORMAT, strtotime($filename_date));
$all_post_dates[] = $date;
$duplicate_posts_within_creation[$date] = $post_id;
foreach (array('hovertext', 'transcript') as $field) {
if (!empty($_POST["${field}-to-use"])) { update_post_meta($post_id, $field, $_POST["${field}-to-use"]); }
}
if (isset($_POST['thumbnails'])) {
$wrote_thumbnail = $comicpress_manager_admin->write_thumbnail($comicpress_manager->path . '/' . $comic_file, $comic_file);
if (!is_null($wrote_thumbnail)) {
if ($wrote_thumbnail) {
$thumbnails_written[] = $comic_file;
} else {
$thumbnails_not_written[] = $comic_file;
}
} else {
$new_thumbnails_not_needed[] = $comic_file;
}
}
}
} else {
$invalid_filenames[] = $comic_file;
}
} else {
if ($show_duplicate_post_message) {
$duplicate_posts[] = array(get_post($post_id, ARRAY_A), $comic_file);
}
}
}
if ($imported_post_count >= $max_posts_imported) {
$safe_exit = true; break;
}
}
}
$comicpress_manager->import_safe_exit = $safe_exit;
if ($safe_exit) {
$comicpress_manager->messages[] = __("<strong>Import safely exited before you ran out of execution time.</strong> Scroll down to continue creating missing posts.", 'comicpress-manager');
}
if (count($posts_created) > 0) {
$comicpress_manager_admin->display_operation_messages(compact('invalid_filenames', 'thumbnails_written',
'thumbnails_not_written', 'posts_created',
'duplicate_posts', 'new_thumbnails_not_needed'));
} else {
$comicpress_manager->messages[] = __("<strong>No new posts needed to be created.</strong>", 'comicpress-manager');
}
}
?>

View File

@ -0,0 +1,45 @@
<?php
function cpm_action_delete_comic_and_post() {
global $comicpress_manager;
$comic_file = pathinfo($_POST['comic'], PATHINFO_BASENAME);
if (file_exists($comicpress_manager->path . '/' . $comic_file)) {
if (($result = $comicpress_manager->breakdown_comic_filename($comic_file)) !== false) {
extract($result, EXTR_PREFIX_ALL, 'filename');
$all_possible_posts = array();
foreach ($comicpress_manager->query_posts() as $comic_post) {
if (date(CPM_DATE_FORMAT, strtotime($comic_post->post_date)) == $filename_date) {
$all_possible_posts[] = $comic_post->ID;
}
}
if (count($all_possible_posts) > 1) {
$comicpress_manager->messages[] = sprintf(
__('There are multiple posts (%1$s) with the date %2$s in the comic categories. Please manually delete the posts.', 'comicpress-manager'),
implode(", ", $all_possible_posts),
$filename_date
);
} else {
$delete_targets = array($comicpress_manager->path . '/' . $comic_file);
foreach ($comicpress_manager->thumbs_folder_writable as $type => $value) {
$delete_targets[] = CPM_DOCUMENT_ROOT . '/' . $comicpress_manager->properties[$type . "_comic_folder"] . '/' . $comic_file;
}
foreach ($delete_targets as $target) { @unlink($target); }
if (count($all_possible_posts) == 0) {
$comicpress_manager->messages[] = sprintf(__("<strong>%s deleted.</strong> No matching posts found. Any associated thumbnails were also deleted.", 'comicpress-manager'), $comic_file);
} else {
wp_delete_post($all_possible_posts[0]);
$comicpress_manager->messages[] = sprintf(__('<strong>%1$s and post %2$s deleted.</strong> Any associated thumbnails were also deleted.', 'comicpress-manager'), $comic_file, $all_possible_posts[0]);
}
$comicpress_manager->comic_files = $comicpress_manager->read_comics_folder();
}
}
}
}
?>

View File

@ -0,0 +1,52 @@
<?php
function cpm_action_do_first_run() {
global $comicpress_manager, $blog_id;
$dir_list = array(
CPM_DOCUMENT_ROOT,
CPM_DOCUMENT_ROOT . '/comics',
CPM_DOCUMENT_ROOT . '/comics-rss',
CPM_DOCUMENT_ROOT . '/comics-archive'
);
if ($is_wpmu = function_exists('get_site_option')) { $dir_list = cpm_wpmu_first_run_dir_list(); }
$any_made = false;
$all_made = true;
foreach ($dir_list as $dir_to_make) {
if (!file_exists($dir_to_make)) {
$any_made = true;
if (@mkdir($dir_to_make)) {
if (!$is_wpmu) {
$comicpress_manager->messages[] = sprintf(__("<strong>Directory created:</strong> %s", 'comicpress-manager'), $dir_to_make);
}
} else {
$all_made = false;
if (!$is_wpmu) {
$comicpress_manager->warnings[] = sprintf(__("<strong>Unable to create directory:</strong> %s", 'comicpress-manager'), $dir_to_make);
}
}
}
}
if (!$any_made) {
$comicpress_manager->messages[] = __("<strong>All the directories were already found, nothing to do!</strong>", "comicpress-manager");
}
if ($is_wpmu) {
if ($all_made) {
$comicpress_manager->messages[] = sprintf(__("<strong>All directories created!</strong>", 'comicpress-manager'), $dir_to_make);
cpm_wpmu_complete_first_run();
} else {
$comicpress_manager->warnings[] = sprintf(__("<strong>Unable to create directories!</strong> Contact your administrator.", 'comicpress-manager'), $dir_to_make);
}
$comicpress_manager->set_cpm_option("cpm-did-first-run", 1);
}
$comicpress_manager->did_first_run = true;
$comicpress_manager->read_information_and_check_config();
}
?>

View File

@ -0,0 +1,36 @@
<?php
function cpm_action_generate_thumbnails() {
global $comicpress_manager;
$ok_to_keep_uploading = true;
$files_created_in_operation = array();
foreach ($_POST['comics'] as $comic) {
$comic_file = stripslashes(pathinfo($comic, PATHINFO_BASENAME));
$wrote_thumbnail = cpm_write_thumbnail($comicpress_manager->path . '/' . $comic_file, $comic_file, true);
if (!is_null($wrote_thumbnail)) {
if (is_array($wrote_thumbnail)) {
$files_created_in_operation = array_merge($files_created_in_operation, $wrote_thumbnail);
$comicpress_manager->messages[] = sprintf(__("<strong>Wrote thumbnail for %s.</strong>", 'comicpress-manager'), $comic_file);
} else {
$comicpress_manager->warnings[] = sprintf(__("<strong>Could not write thumbnail for %s.</strong> Check the permissions on the thumbnail directories.", 'comicpress-manager'), $comic_file);
}
}
if (function_exists('cpm_wpmu_is_over_storage_limit')) {
if (cpm_wpmu_is_over_storage_limit()) { $ok_to_keep_uploading = false; break; }
}
}
if (!$ok_to_keep_uploading) {
$comicpress_manager->messages = array();
$comicpress_manager->warnings = array($comicpress_manager->wpmu_disk_space_message);
foreach ($files_created_in_operation as $file) { @unlink($file); }
}
}
?>

View File

@ -0,0 +1,29 @@
<?php
function cpm_action_manage_subcomic() {
global $comicpress_manager;
$target_category_id = (int)$_POST['comic'];
extract($comicpress_manager->normalize_storyline_structure());
$final_category_id = false;
$first = true;
foreach ($category_tree as $node) {
$category = get_category(end(explode("/", $node)));
if ($first) { $final_category_id = $category->term_id; }
if ($target_category_id == $category->term_id) {
if (is_dir(CPM_DOCUMENT_ROOT . '/' . $comicpress_manager->properties['comic_folder'] . '/' . $category->slug)) {
$final_category_id = $category->term_id; break;
}
}
$first = false;
}
update_option('comicpress-manager-manage-subcomic', $final_category_id);
$comicpress_manager->read_information_and_check_config();
$comicpress_manager->messages[] = sprintf(__("Now managing <strong>%s</strong>.", 'comicpress-manager'), get_cat_name($final_category_id));
}
?>

View File

@ -0,0 +1,41 @@
<?php
function cpm_action_multiple_upload_file() {
global $comicpress_manager, $comicpress_manager_admin;
if (strtotime($_POST['time']) === false) {
$comicpress_manager->warnings[] = sprintf(__('<strong>There was an error in the post time (%1$s)</strong>. The time is not parseable by strtotime().', 'comicpress-manager'), $_POST['time']);
} else {
$files_to_handle = array();
foreach ($_FILES as $name => $info) {
if (strpos($name, "upload-") !== false) {
if (is_uploaded_file($_FILES[$name]['tmp_name'])) {
$files_to_handle[] = $name;
} else {
switch ($_FILES[$name]['error']) {
case UPLOAD_ERR_INI_SIZE:
case UPLOAD_ERR_FORM_SIZE:
$comicpress_manager->warnings[] = sprintf(__("<strong>The file %s was too large.</strong> The max allowed filesize for uploads to your server is %s.", 'comicpress-manager'), $_FILES[$name]['name'], ini_get('upload_max_filesize'));
break;
case UPLOAD_ERR_NO_FILE:
break;
default:
$comicpress_manager->warnings[] = sprintf(__("<strong>There was an error in uploading %s.</strong> The <a href='http://php.net/manual/en/features.file-upload.errors.php'>PHP upload error code</a> was %s.", 'comicpress-manager'), $_FILES[$name]['name'], $_FILES[$name]['error']);
break;
}
}
}
}
if (count($files_to_handle) > 0) {
$comicpress_manager_admin->handle_file_uploads($files_to_handle);
$comicpress_manager->comic_files = $comicpress_manager->read_comics_folder();
} else {
$comicpress_manager->warnings[] = __("<strong>You didn't upload any files!</strong>", 'comicpress-manager');
}
}
}
?>

View File

@ -0,0 +1,24 @@
<?php
function cpm_action_restore_backup() {
global $comicpress_manager;
$config_dirname = dirname($comicpress_manager->config_filepath);
if (is_numeric($_POST['backup-file-time'])) {
if (file_exists($config_dirname . '/comicpress-config.php.' . $_POST['backup-file-time'])) {
if ($comicpress_manager->can_write_config) {
if (@copy($config_dirname . '/comicpress-config.php.' . $_POST['backup-file-time'],
$config_dirname . '/comicpress-config.php') !== false) {
$comicpress_manager->read_information_and_check_config();
$comicpress_manager->messages[] = sprintf(__("<strong>Restored %s</strong>. Check to make sure your site is functioning correctly.", 'comicpress-manager'), 'comicpress-config.php.' . $_POST['backup-file-time']);
} else {
$comicpress_manager->warnings[] = sprintf(__("<strong>Could not restore %s</strong>. Check the permissions of your theme folder and try again.", 'comicpress-manager'), 'comicpress-config.php.' . $_POST['backup-file-time']);
}
}
}
}
}
?>

View File

@ -0,0 +1,11 @@
<?php
function cpm_action_skip_first_run() {
global $comicpress_manager;
$comicpress_manager->messages[] = __("<strong>No directories were created.</strong> You'll need to create directories on your own.", 'comicpress-manager');
$comicpress_manager->read_information_and_check_config();
}
?>

View File

@ -0,0 +1,81 @@
<?php
function cpm_action_update_config() {
global $comicpress_manager;
$comicpress_manager->is_cpm_managing_posts = true;
$do_write = false;
$use_default_file = false;
if ($comicpress_manager->config_method == "comicpress-config.php") {
$do_write = !isset($_POST['just-show-config']);
} else {
$use_default_file = true;
}
include(realpath(dirname(__FILE__)) . '/../cp_configuration_options.php');
$original_properties = $comicpress_manager->properties;
foreach ($comicpress_configuration_options as $field_info) {
extract($field_info);
$config_id = (isset($field_info['variable_name'])) ? $field_info['variable_name'] : $field_info['id'];
switch ($type) {
case "folder":
$comicpress_manager->properties[$config_id] = $_POST[$_POST["folder-{$config_id}"] . "-" . $config_id];
break;
default:
if (isset($_POST[$config_id])) {
$comicpress_manager->properties[$config_id] = $_POST[$config_id];
}
break;
}
}
if (function_exists('get_site_option')) {
cpm_wpmu_save_options();
$comicpress_manager->is_wp_options = true;
}
if (!$comicpress_manager->is_wp_options) {
if (!$do_write) {
$file_output = write_comicpress_config_functions_php($comicpress_manager->config_filepath, true, $use_default_file);
$comicpress_manager->properties = $original_properties;
if ($use_default_file) {
$comicpress_manager->messages[] = __("<strong>No comicpress-config.php file was found in your theme folder.</strong> Using default configuration file.", 'comicpress-manager');
}
$comicpress_manager->messages[] = __("<strong>Your configuration:</strong>", 'comicpress-manager') . "<pre class=\"code-block\">" . htmlentities($file_output) . "</pre>";
} else {
if (!is_null($comicpress_manager->config_filepath)) {
if (is_array($file_output = write_comicpress_config_functions_php($comicpress_manager->config_filepath))) {
$comicpress_manager->read_comicpress_config();
$comicpress_manager->path = $comicpress_manager->get_comic_folder_path();
$comicpress_manager->plugin_path = PLUGINDIR . '/' . plugin_basename(__FILE__);
$comicpress_manager->read_information_and_check_config();
$backup_file = pathinfo($file_output[0], PATHINFO_BASENAME);
$comicpress_manager->messages[] = sprintf(__("<strong>Configuration updated and original config backed up to %s.</strong> Rename this file to comicpress-config.php if you are having problems.", 'comicpress-manager'), $backup_file);
} else {
$relative_path = substr(realpath($comicpress_manager->config_filepath), CPM_STRLEN_REALPATH_DOCUMENT_ROOT);
$comicpress_manager->warnings[] = sprintf(__("<strong>Configuration not updated</strong>, check the permissions of %s and the theme folder. They should be writable by the Webserver process. Alternatively, copy and paste the following code into your comicpress-config.php file:", 'comicpress-manager'), $relative_path) . "<pre class=\"code-block\">" . htmlentities($file_output) . "</pre>";
$comicpress_manager->properties = $original_properties;
}
}
}
} else {
$comicpress_manager->read_comicpress_config();
$comicpress_manager->messages[] = sprintf(__("<strong>Configuration updated in database.</strong>", 'comicpress-manager'), $backup_file);
}
}
?>

View File

@ -0,0 +1,58 @@
<?php
function cpm_action_update_cpm_config() {
global $comicpress_manager;
include(realpath(dirname(__FILE__)) . '/../cpm_configuration_options.php');
$all_valid = true;
$target_update_options = array();
foreach ($configuration_options as $option_info) {
$target_key = 'comicpress-manager-' . $option_info['id'];
switch ($option_info['type']) {
case "text":
case "textarea":
case "dropdown":
if (isset($_POST[$option_info['id']])) {
$validate_function_name = "cpm_validate_cpm_option_" . str_replace("-", "_", $option_info['id']);
$ok = true;
if (function_exists($validate_function_name)) {
$ok = call_user_func($validate_function_name, $_POST[$option_info['id']]);
}
if ($ok) {
$target_update_options[$target_key] = $_POST[$option_info['id']];
} else {
$all_valid = false;
break 2;
}
}
break;
case "checkbox":
$target_update_options[$target_key] = (isset($_POST[$option_info['id']]) ? "1" : "0");
break;
case "categories":
if (isset($_POST[$option_info['id']])) {
$all_categories = implode(",", $_POST[$option_info['id']]);
$target_update_options[$target_key] = $all_categories;
} else {
$target_update_options[$target_key] = "";
}
break;
}
}
if ($all_valid) {
$comicpress_manager->read_information_and_check_config();
foreach ($target_update_options as $option => $value) { update_option($option, $value); }
$comicpress_manager->messages[] = __("<strong>ComicPress Manager configuration updated.</strong>", 'comicpress-manager');
} else {
$comicpress_manager->warnings[] = __("<strong>You entered invalid data into your configuration.</strong> Configuration not updated.", 'comicpress-manager');
}
}
function cpm_validate_cpm_option_cpm_default_post_time($value) {
return (strtotime("2008-01-01 {$value}") !== false);
}
?>

View File

@ -0,0 +1,38 @@
<?php
function cpm_action_write_comic_post() {
global $comicpress_manager, $comicpress_manager_admin;
$files_to_handle = array();
if (isset($_FILES['upload'])) {
if (is_uploaded_file($_FILES['upload']['tmp_name'])) {
$files_to_handle[] = 'upload';
}
}
if (count($files_to_handle) > 0) {
list($posts_created, $duplicated_posts) = $comicpress_manager_admin->handle_file_uploads($files_to_handle);
if (count($posts_created) > 0) {
if (count($posts_created) == 1) {
?><script type="text/javascript">document.location.href = "post.php?action=edit&post=<?php echo $posts_created[0]['ID'] ?>";</script><?php
} else {
$comicpress_manager->warnings[] = __("<strong>More than one new post was generated!</strong> Please report this error.", 'comicpress-manager');
}
}
if (count($duplicated_posts) > 0) {
if (count($duplicated_posts) == 1) {
?><script type="text/javascript">document.location.href = "post.php?action=edit&post=<?php echo $duplicated_posts[0][0]['ID'] ?>";</script><?php
} else {
$comicpress_manager->warnings[] = __("<strong>More than one duplicate post was found!</strong> Please report this error.", 'comicpress-manager');
}
}
$comicpress_manager->warnings[] = __("<strong>No posts were created, and no duplicate posts could be found!</strong>", 'comicpress-manager');
} else {
$comicpress_manager->warnings[] = __("<strong>You didn't upload any files!</strong>", 'comicpress-manager');
}
}
?>

View File

@ -0,0 +1,27 @@
<?php
class ComicPressFileOperations {
function rename($source, $target) { return rename($source, $target); }
function file_exists($target) { return file_exists($target); }
function file_get_contents($target) { return file_get_contents($target); }
function file_write_contents($file, $data) {
//harmonious file_put_contents
if (function_exists('file_put_contents')) {
return file_put_contents($file, $data);
} else {
if (($fh = fopen($file, "w")) !== false) {
fwrite($fh, $data);
fclose($fh);
}
}
}
function chmod($file, $mode) { @chmod($file, $mode); }
function unlink($target) { return @unlink($target); }
function filemtime($file) { return @filemtime($file); }
function glob($pattern) { return glob($pattern); }
function realpath($path) { return @realpath($path); }
}
?>

View File

@ -0,0 +1,151 @@
<?php
class ComicPressGDProcessing {
function get_image_size($path) { return getimagesize($path); }
function convert_to_rgb($source, $target, $quality) {
$cmyk_data = imagecreatefromjpeg($source);
imagejpeg($cmyk_data, $target, $quality);
imagedestroy($cmyk_data);
return file_exists($target);
}
function generate_thumbnails($source, $targets_and_constraints, $target_format, $thumbnail_quality) {
$files_created_in_operation = array();
list ($width, $height) = getimagesize($source);
$ok = false;
if ($width > 0) {
$pixel_size_buffer = 1.25;
$max_bytes = $comicpress_manager->convert_short_size_string_to_bytes(ini_get('memory_limit'));
if ($max_bytes > 0) {
$max_thumb_size = 0;
foreach ($targets_and_constraints as $target_and_constraint) {
list($target, $constraint) = $target_and_constraint;
$width_to_use = $constraint['width'];
$archive_comic_height = (int)(($width_to_use * $height) / $width);
$max_thumb_size = max($width_to_use * $archive_comic_height * 4, $max_thumb_size);
}
$input_image_size = $width * $height * 4;
if (strtolower(pathinfo($input, PATHINFO_EXTENSION)) == "gif") { $input_image_size *= 2; }
$recommended_size = ($input_image_size + $max_thumb_size) * $pixel_size_buffer;
if (function_exists('memory_get_usage')) { $recommended_size += memory_get_usage(); }
if ($recommended_size > $max_bytes) {
$comicpress_manager->warnings[] = sprintf(__("<strong>You don't have enough memory available to PHP and GD to process this file.</strong> You should <strong>set your PHP <tt>memory_size</tt></strong> to at least <strong><tt>%sM</tt></strong> and try again. For more information, read the ComicPress Manager FAQ.", 'comicpress-manager'), (int)($recommended_size / (1024 * 1024)));
return false;
}
}
foreach ($targets_and_constraints as $target_and_constraint) {
list($target, $constraint) = $target_and_constraint;
$width_to_use = $constraint['width'];
$archive_comic_height = (int)(($width_to_use * $height) / $width);
$pathinfo = pathinfo($source);
$thumb_image = imagecreatetruecolor($width_to_use, $archive_comic_height);
imagealphablending($thumb_image, true);
switch(strtolower($pathinfo['extension'])) {
case "jpg":
case "jpeg":
$comic_image = imagecreatefromjpeg($source);
break;
case "gif":
$is_gif = true;
$temp_comic_image = imagecreatefromgif($source);
list($width, $height) = getimagesize($input);
$comic_image = imagecreatetruecolor($width, $height);
imagecopy($comic_image, $temp_comic_image, 0, 0, 0, 0, $width, $height);
imagedestroy($temp_comic_image);
break;
case "png":
$comic_image = imagecreatefrompng($source);
break;
default:
return false;
}
imagealphablending($comic_image, true);
if ($is_palette = !imageistruecolor($comic_image)) {
$number_of_colors = imagecolorstotal($comic_image);
}
imagecopyresampled($thumb_image, $comic_image, 0, 0, 0, 0, $width_to_use, $archive_comic_height, $width, $height);
$ok = true;
@touch($target);
if (file_exists($target)) {
@unlink($target);
switch(strtolower($target_format)) {
case "jpg":
case "jpeg":
if (imagetypes() & IMG_JPG) {
@imagejpeg($thumb_image, $target, $comicpress_manager->get_cpm_option("cpm-thumbnail-quality"));
} else {
return false;
}
break;
case "gif":
if (imagetypes() & IMG_GIF) {
if (function_exists('imagecolormatch')) {
$temp_comic_image = imagecreate($width_to_use, $archive_comic_height);
imagecopymerge($temp_comic_image, $thumb_image, 0, 0, 0, 0, $width_to_use, $archive_comic_height, 100);
imagecolormatch($thumb_image, $temp_comic_image);
@imagegif($temp_comic_image, $target);
imagedestroy($temp_comic_image);
} else {
@imagegif($thumb_image, $target);
}
} else {
return false;
}
break;
case "png":
if (imagetypes() & IMG_PNG) {
if ($is_palette) {
imagetruecolortopalette($thumb_image, true, $number_of_colors);
}
@imagepng($thumb_image, $target, 9);
} else {
return false;
}
break;
default:
return false;
}
}
if (!file_exists($target)) {
$ok = false;
} else {
@chmod($target, CPM_FILE_UPLOAD_CHMOD);
$files_created_in_operation[] = $target;
}
imagedestroy($comic_image);
imagedestroy($thumb_image);
}
}
return ($ok) ? $files_created_in_operation :false;
}
}
?>

View File

@ -0,0 +1,70 @@
<?php
class ComicPressImageMagickProcessing {
function get_image_size($path) { return false; }
function convert_to_rgb($source, $target, $quality) {
exec(implode(" ", array("convert",
"\"{$source}\"",
"-colorspace rgb",
"\"${target}\"")));
return file_exists($target);
}
function generate_thumbnails($source, $targets_and_constraints, $target_format, $thumbnail_quality) {
$files_created_in_operation = array();
$unique_colors = exec("identify -format '%k' '${$source}'");
if (empty($unique_colors)) { $unique_colors = 256; }
$ok = true;
foreach ($targets_and_constraints as $target_and_constraint) {
list($target, $constraint) = $target_and_constraint;
$width_to_use = $constraint['width'];
$command = array("convert",
"\"${source}\"",
"-filter Lanczos",
"-resize " . $width_to_use . "x");
$im_target = $target;
switch(strtolower($target_format)) {
case "jpg":
case "jpeg":
$command[] = "-quality " . $thumbnail_quality;
break;
case "gif":
$command[] = "-colors ${unique_colors}";
break;
case "png":
if ($unique_colors <= 256) {
$im_target = "png8:${im_target}";
$command[] = "-colors ${unique_colors}";
}
$command[] = "-quality 100";
break;
default:
}
$command[] = "\"${im_target}\"";
$convert_to_thumb = escapeshellcmd(implode(" ", $command));
exec($convert_to_thumb);
if (!file_exists($target)) {
$ok = false;
} else {
@chmod($target, CPM_FILE_UPLOAD_CHMOD);
$files_created_in_operation[] = $target;
}
}
return ($ok) ? $files_created_in_operation :false;
}
}
?>

View File

@ -0,0 +1,831 @@
<?php
require_once('ComicPressGDProcessing.php');
require_once('ComicPressImageMagickProcessing.php');
require_once('ComicPressFileOperations.php');
define("CPM_OPTION_PREFIX", "comicpress-manager");
class ComicPressManager {
var $properties = array(
// Leave these alone! These values should be read from your comicpress-config.php file.
// If your values from comicpress-config.php are not being read, then something is wrong in your config.
'comic_folder' => 'comics',
'comiccat' => '1',
'blogcat' => '2',
'rss_comic_folder' => 'comics',
'archive_comic_folder' => 'comics',
'archive_comic_width' => '380',
'rss_comic_width' => '380',
'blog_postcount' => '10'
);
var $warnings, $messages, $errors, $detailed_warnings, $show_config_editor;
var $config_method, $config_filepath, $path, $plugin_path;
var $comic_files;
var $scale_method, $identify_method_cache, $can_write_config;
var $need_calendars = false;
var $is_wp_options = false;
var $import_safe_exit = null;
var $did_first_run;
var $is_cpm_managing_posts, $is_cpm_modifying_categories;
var $wpmu_disk_space_message;
var $separate_thumbs_folder_defined = array('rss' => null, 'archive' => null);
var $thumbs_folder_writable = array('rss' => null, 'archive' => null);
var $allowed_extensions = array("gif", "jpg", "jpeg", "png");
var $category_info = array('comiccat' => null, 'blogcat' => null);
var $_f;
var $folders = array(
array('comic folder', 'comic_folder', true, ""),
array('RSS feed folder', 'rss_comic_folder', false, 'rss'),
array('archive folder', 'archive_comic_folder', false, 'archive'));
var $error_types = array(
'NOT_A_FOLDER' => 'not a folder',
'NOT_WRITABLE' => 'not writable',
'NOT_STATABLE' => 'not statable',
'INVALID_CATEGORY' => 'invalid category',
'CATEGORY_DOES_NOT_EXIST' => 'category does not exist'
);
function ComicPressManager() {
$this->_f = new ComicPressFileOperations();
$this->scale_method = false;
$this->gd_processor = false;
if (extension_loaded("gd")) {
$this->scale_method = new ComicPressGDProcessing();
$this->gd_processor = new ComicPressGDProcessing();
}
$result = @shell_exec("which convert") . @shell_exec("which identify");
if (!empty($result)) {
$this->scale_method = new ComicPressImageMagickProcessing();
}
if (function_exists('cpm_wpmu_config_setup')) { cpm_wpmu_config_setup($this); }
if (!defined('CPM_DOCUMENT_ROOT')) {
define('CPM_DOCUMENT_ROOT', $this->calculate_document_root());
}
if (!defined("CPM_STRLEN_REALPATH_DOCUMENT_ROOT")) {
define("CPM_STRLEN_REALPATH_DOCUMENT_ROOT", strlen(realpath(CPM_DOCUMENT_ROOT)));
}
}
/**
* Get the option name for a ComicPress Manager option.
* CPM options are prefixed with "comicpress-manager-".
* @param string $option_name The CPM key name.
* @return string The full WP options key name.
*/
function get_cpm_option_key($option_name) {
return CPM_OPTION_PREFIX . '-' . $option_name;
}
/**
* Retrieve a ComicPress Manager option.
* @param string $option_name The CPM key name.
* @return string The value of the option.
*/
function get_cpm_option($option_name) { return get_option($this->get_cpm_option_key($option_name)); }
/**
* Set a ComicPress Manager option.
* @param string $option_name The CPM key name.
* @param string $value The value to set.
*/
function set_cpm_option($option_name, $value) { update_option($this->get_cpm_option_key($option_name), $value); }
/**
* Calculate the document root where comics are stored.
* @param array $override_server_info If set, override $_SERVER with these values.
* @return string|boolean The document root, or false if there was an error.
*/
function calculate_document_root($override_server_info = null) {
global $cpm_attempted_document_roots;
$cpm_attempted_document_roots = array();
$server_info = !is_null($override_server_info) ? $override_server_info : $_SERVER;
// we need something to work with
$any_possible_data = false;
foreach (array('SCRIPT_FILENAME', 'DOCUMENT_ROOT') as $field) {
if (isset($server_info[$field])) {
$any_possible_data = true; break;
}
}
if (!$any_possible_data) { return false; }
$document_root = null;
// first try getting path info straight from server info
$translated_script_filename = str_replace('\\', '/', $server_info['SCRIPT_FILENAME']);
foreach (array('SCRIPT_NAME', 'SCRIPT_URL') as $var_to_try) {
if (isset($server_info[$var_to_try])) {
$root_to_try = substr($translated_script_filename, 0, -strlen($server_info[$var_to_try]));
$cpm_attempted_document_roots[] = $root_to_try;
if ($this->_f->file_exists($root_to_try . '/index.php')) {
$document_root = $root_to_try;
break;
}
}
}
// then use the URL if necessary
if (is_null($document_root) && isset($server_info['DOCUMENT_ROOT'])) {
$parsed_url = @parse_url(get_option('home'));
if ($parsed_url === false) { return false; }
$document_root = untrailingslashit($server_info['DOCUMENT_ROOT']) . $parsed_url['path'];
}
// still nothing found?
if (is_null($document_root)) { return false; }
// WPMU
if (function_exists('get_site_option')) {
$document_root = cpm_wpmu_modify_path($document_root);
}
return untrailingslashit($document_root);
}
/**
* Transform a date()-compatible string into a human-parseable string.
* Useful for generating examples of date() usage.
*/
function transform_date_string($string, $replacements) {
if (!is_array($replacements)) { return false; }
if (!is_string($string)) { return false; }
$transformed_string = $string;
foreach (array("Y", "m", "d") as $required_key) {
if (!isset($replacements[$required_key])) { return false; }
$transformed_string = preg_replace('#(?<![\\\])' . $required_key . '#', $replacements[$required_key], $transformed_string);
}
$transformed_string = str_replace('\\', '', $transformed_string);
return $transformed_string;
}
/**
* Generate an example date string.
* @param string $example_date The example date format.
* @return string The formatted string.
*/
function generate_example_date($example_date) {
return $this->transform_date_string($example_date, array('Y' => "YYYY", 'm' => "MM", 'd' => "DD"));
}
/**
* Build the URI to a comic file.
*/
function build_comic_uri($filename, $base_dir = null) {
if (!is_null($base_dir)) {
if (strlen($filename) < strlen($base_dir)) { return false; }
}
if (($realpath_result = realpath($filename)) !== false) {
$filename = $realpath_result;
}
if (!is_null($base_dir)) {
$filename = substr($filename, strlen($base_dir));
}
$parts = explode('/', str_replace('\\', '/', $filename));
if (count($parts) < 2) { return false; }
$parsed_url = parse_url(get_option('home'));
$path = $parsed_url['path'];
if (function_exists('get_site_option')) { $path = cpm_wpmu_fix_admin_uri($path); }
$count = 2;
if (($dirname = $this->get_subcomic_directory()) !== false) {
$count = 3;
if ($parts[count($parts) - 2] != $dirname) { return false; }
}
return $path . '/' . implode('/', array_slice($parts, -$count, $count));
}
function get_subcomic_directory() {
$result = get_option('comicpress-manager-manage-subcomic');
if (!empty($result)) {
if ($result != $this->properties['comiccat']) {
if (($category = get_category($result)) !== false) {
return $category->slug;
}
}
}
return false;
}
/**
* Breakdown the name of a comic file into a date and proper title.
*/
function breakdown_comic_filename($filename, $allow_override = false, $override_value = null) {
$pattern = CPM_DATE_FORMAT;
if ($allow_override) {
if (isset($_POST['upload-date-format']) && !empty($_POST['upload-date-format'])) { $pattern = $_POST['upload-date-format']; }
if (!is_null($override_value)) { $pattern = $override_value; }
}
$pattern = $this->transform_date_string($pattern, array("Y" => '[0-9]{4,4}',
"m" => '[0-9]{2,2}',
"d" => '[0-9]{2,2}'));
if (preg_match("/^(${pattern})(.*)\.[^\.]+$/", $filename, $matches) > 0) {
list($all, $date, $title) = $matches;
if (strtotime($date) === false) { return false; }
$converted_title = ucwords(trim(preg_replace('/[\-\_]/', ' ', $title)));
return compact('date', 'title', 'converted_title');
} else {
return false;
}
}
function build_query_posts_string() {
$query_posts_string = "posts_per_page=999999&post_status=draft,pending,future,inherit,publish&cat=";
$comic_categories = array();
$this->get_all_comic_categories();
if (is_array($this->category_tree)) {
foreach ($this->category_tree as $node) {
$comic_categories[] = end(explode("/", $node));
}
}
$query_posts_string .= implode(",", $comic_categories);
return $query_posts_string;
}
/**
* Retrieve posts from the WordPress database.
*/
function query_posts() {
$result = query_posts($this->build_query_posts_string());
if (empty($result)) { $result = array(); }
return $result;
}
/**
* Get a tree of the categories that are children of the comic category.
*/
function get_all_comic_categories() {
$max_id = 0;
$category_tree = array();
foreach (get_all_category_ids() as $category_id) {
$category = get_category($category_id);
$ok = true;
if ($category->parent == 0) { $ok = ($category_id == $this->properties['comiccat']); }
if ($ok) {
$category_tree[] = $category->parent . '/' . $category_id;
$max_id = max($max_id, $category_id);
}
}
// flatten parents and children
do {
$all_ok = true; $any_changes = false;
for ($i = 0; $i < count($category_tree); ++$i) {
$current_parts = explode("/", $category_tree[$i]);
if (reset($current_parts) != 0) {
$all_ok = false; $any_changes = false;
for ($j = 0; $j < count($category_tree); ++$j) {
$j_parts = explode("/", $category_tree[$j]);
if (end($j_parts) == reset($current_parts)) {
$category_tree[$i] = implode("/", array_merge($j_parts, array_slice($current_parts, 1)));
$any_changes = true;
break;
}
}
$all_ok = !$any_changes;
}
}
} while (!$all_ok);
$this->category_tree = $category_tree;
$this->max_id = $max_id;
// DEPRECATED: should be getting direct from object
return array('category_tree' => $this->category_tree,
'max_id' => $this->max_id);
}
/**
* Generate a hash for passing to wp_insert_post()
* @param string $filename_date The post date.
* @param string $filename_converted_title The title of the comic.
* @return array The post information or false if the date is invalid.
*/
function generate_post_hash($filename_date = null, $filename_converted_title = null, $override_post = null) {
$post_data = (!is_null($override_post)) ? $override_post : $_POST;
if (is_null($filename_date)) { return false; }
if (is_null($filename_converted_title)) { return false; }
if (isset($post_data['time']) && !empty($post_data['time'])) {
if (strtolower($post_data['time']) == "now") {
$filename_date .= " " . strftime("%H:%M:%S");
} else {
$filename_date .= " " . $post_data['time'];
}
}
if (($timestamp = strtotime($filename_date)) !== false) {
if ($filename_converted_title == "") {
$filename_converted_title = strftime("%m/%d/%Y", $timestamp);
}
$this->normalize_storyline_structure();
$selected_categories = array();
if (isset($post_data['in-comic-category'])) {
if (is_array($post_data['in-comic-category'])) {
foreach ($this->category_tree as $node) {
$category_id = end(explode("/", $node));
if (in_array($category_id, $post_data['in-comic-category'])) {
$selected_categories[$category_id] = get_cat_name($category_id);
}
}
}
}
$all_category_ids = get_all_category_ids();
if (isset($post_data['additional-categories'])) {
if (is_array($post_data['additional-categories'])) {
foreach ($post_data['additional-categories'] as $category_id) {
if (in_array($category_id, $all_category_ids)) {
$selected_categories[$category_id] = get_cat_name($category_id);
}
}
}
}
if (empty($selected_categories)) { return false; }
$post_category = array_keys($selected_categories);
$category_name = implode(", ", array_values($selected_categories));
$override_title = $post_data['override-title-to-use'];
$tags = $post_data['tags'];
if (get_magic_quotes_gpc()) {
$override_title = stripslashes($override_title);
$tags = stripslashes($tags);
}
$post_title = !empty($override_title) ? $override_title : $filename_converted_title;
$post_content = "";
if (isset($post_data['content']) && !empty($post_data['content'])) {
$post_content = str_replace(
array('{date}', '{title}', '{category}'),
array(
date('F j, Y', $timestamp),
$post_title,
$category_name
),
$post_data['content']
);
}
$post_date = date('Y-m-d H:i:s', $timestamp);
$post_date_gmt = get_gmt_from_date($post_date);
$publish_mode = ($timestamp > time()) ? "future" : "publish";
$post_status = isset($post_data['publish']) ? $publish_mode : "draft";
$tags_input = $tags;
return compact('post_content', 'post_title', 'post_date', 'post_date_gmt', 'post_category', 'post_status', 'tags_input');
}
return false;
}
/**
* Normalize a storyline structure, merging it with category changes as necessary.
* @return array A compact()ed array with the $max_id found and the $category_tree.
*/
function normalize_storyline_structure() {
$this->get_all_comic_categories();
do {
$did_normalize = false;
// sort it by this order as best as possible
if ($result = get_option("comicpress-storyline-category-order")) {
$sorted_tree = explode(",", $result);
$new_sorted_tree = array();
foreach ($sorted_tree as $node) {
if (in_array($node, $this->category_tree)) {
$new_sorted_tree[] = $node;
} else {
$did_normalize = true;
}
}
$sorted_tree = $new_sorted_tree;
foreach ($this->category_tree as $node) {
if (!in_array($node, $sorted_tree)) {
// try to find the nearest sibling
$parts = explode("/", $node);
while (count($parts) > 0) {
array_pop($parts);
$node_snippit = implode("/", $parts);
$last_sibling = null;
for ($i = 0; $i < count($sorted_tree); ++$i) {
if (strpos($sorted_tree[$i], $node_snippit) === 0) {
$last_sibling = $i;
}
}
if (!is_null($last_sibling)) {
$did_normalize = true;
array_splice($sorted_tree, $last_sibling + 1, 0, $node);
break;
}
}
}
}
$this->category_tree = $sorted_tree;
} else {
sort($this->category_tree);
}
if ($did_normalize || empty($result)) {
update_option("comicpress-storyline-category-order", implode(",", $this->category_tree));
}
} while ($did_normalize);
return array('category_tree' => $this->category_tree,
'max_id' => $this->max_id);
}
function convert_short_size_string_to_bytes($string) {
$max_bytes = trim($string);
$last = strtolower(substr($max_bytes, -1, 1));
switch($last) {
case 'g': $max_bytes *= 1024;
case 'm': $max_bytes *= 1024;
case 'k': $max_bytes *= 1024;
}
return $max_bytes;
}
/**
* Find all the valid comics in the comics folder.
* If CPM_SKIP_CHECKS is enabled, comic file validity is not checked, improving speed.
* @param array $provided_files If given, use the provided list of files rather than glob()bing the comic folder path.
* @return array The list of valid comic files in the comic folder.
*/
function read_comics_folder($provided_files = null) {
$glob_results = (is_array($provided_files) ? $provided_files : glob($this->get_comic_folder_path() . "/*"));
if ($glob_results === false) {
//$comicpress_manager->messages[] = "FYI: glob({$comicpress_manager->path}/*) returned false. This can happen on some PHP installations if you have no files in your comic directory. This message will disappear once you upload a comic to your site.";
return array();
}
$filtered_glob_results = array();
foreach ($glob_results as $result) {
if (in_array(strtolower(pathinfo($result, PATHINFO_EXTENSION)), $this->allowed_extensions)) {
$filtered_glob_results[] = $result;
}
}
if ($this->get_cpm_option("cpm-skip-checks") == 1) {
return $filtered_glob_results;
} else {
$files = array();
foreach ($filtered_glob_results as $file) {
if ($this->breakdown_comic_filename(pathinfo($file, PATHINFO_BASENAME)) !== false) {
$files[] = $file;
}
}
return $files;
}
}
/**
* Get the absolute filepath to the comic folder.
*/
function get_comic_folder_path() {
$output = CPM_DOCUMENT_ROOT . '/' . $this->properties['comic_folder'];
if (($subdir = $this->get_subcomic_directory()) !== false) {
$output .= '/' . $subdir;
}
$this->path = $output;
return $output;
}
/**
* Get the list of thumbnails to generate.
*/
function get_thumbnails_to_generate() {
$thumbnails_to_generate = array();
if ($this->scale_method !== false) {
foreach ($this->thumbs_folder_writable as $type => $value) {
if ($value) {
if ($this->separate_thumbs_folder_defined[$type] !== false) {
if ($this->get_cpm_option("cpm-${type}-generate-thumbnails") == 1) {
$thumbnails_to_generate[] = $type;
}
}
}
}
}
return $thumbnails_to_generate;
}
/**
* Read the ComicPress config.
*/
function read_comicpress_config($override_config = null) {
$method = null;
if (is_array($override_config)) {
$method = __("Unit Testing", 'comicpress-manager');
$this->properties = array_merge($this->properties, $override_config);
} else {
if (function_exists('get_site_option')) {
cpm_wpmu_load_options();
$method = __("WordPress Options", 'comicpress-manager');
} else {
$current_theme_info = get_theme(get_current_theme());
if (isset($current_theme_info['Template Dir'])) {
foreach (array("comicpress-config.php", "functions.php") as $possible_file) {
$filepath = WP_CONTENT_DIR . $current_theme_info['Template Dir'] . '/' . $possible_file;
if ($this->_f->file_exists($filepath)) {
$this->config_filepath = $filepath;
$file = $this->_f->file_get_contents($filepath);
$variable_values = array();
foreach (array_keys($this->properties) as $variable) {
if (preg_match("#\\$${variable}\ *\=\ *([^\;]*)\;#", $file, $matches) > 0) {
$variable_values[$variable] = preg_replace('#"#', '', $matches[1]);
}
}
$this->properties = array_merge($this->properties, $variable_values);
$method = basename($filepath);
$this->can_write_config = false;
$perm_check_filename = $filepath . '-' . md5(rand());
if (@touch($perm_check_filename) === true) {
$move_check_filename = $perm_check_filename . '-' . md5(rand());
if (@rename($perm_check_filename, $move_check_filename)) {
@unlink($move_check_filename);
$this->can_write_config = true;
} else {
@unlink($perm_check_filename);
}
}
break;
}
}
}
}
}
$this->config_method = $method;
}
function _check_separate_thumbnail_folders() {
foreach (array_keys($this->separate_thumbs_folder_defined) as $type) {
$this->separate_thumbs_folder_defined[$type] = ($this->properties['comic_folder'] != $this->properties[$type . '_comic_folder']);
}
}
function _test_image_folder_writable($path, $thumb_type) {
if (!is_dir($path)) {
return $this->error_types['NOT_A_FOLDER'];
}
do {
$tmp_filename = "test-" . md5(rand());
} while ($this->_f->file_exists($path . '/' . $tmp_filename));
$ok_to_warn = true;
if ($thumb_type != "") {
$ok_to_warn = ($this->get_cpm_option("cpm-${thumb_type}-generate-thumbnails") == 1);
}
$return_value = "";
if (!@touch($path . '/' . $tmp_filename)) {
if ($ok_to_warn) {
$return_value = $this->error_types['NOT_WRITABLE'];
}
} else {
if (@stat($path . '/' . $tmp_filename) === false) {
if ($ok_to_warn) {
$return_value = $this->error_types['NOT_STATABLE'];
}
}
}
if (($return_value !== "") || !$ok_to_warn) {
if ($thumb_type != "") {
$this->thumbs_folder_writable[$thumb_type] = false;
}
}
if (is_null($this->thumbs_folder_writable[$thumb_type])) {
if ($this->_f->file_exists($path . '/' . $tmp_filename)) {
@unlink($path . '/' . $tmp_filename);
}
if ($thumb_type != "") {
$this->thumbs_folder_writable[$thumb_type] = true;
}
}
return $return_value;
}
function _check_category($type) {
if (!is_numeric($this->properties[$type])) {
// the property is non-numeric
return $this->error_types['INVALID_CATEGORY'];
} else {
// one comic category is specified
$result = get_category($this->properties[$type]);
if (empty($result)) {
return $this->error_types['CATEGORY_DOES_NOT_EXIST'];
} else {
$this->category_info[$type] = get_object_vars($result);
}
}
return "";
}
/**
* Read information about the current installation.
*/
function read_information_and_check_config() {
global $cpm_attempted_document_roots, $blog_id;
$this->read_comicpress_config();
$this->get_comic_folder_path();
$this->plugin_path = PLUGINDIR . '/' . plugin_basename(__FILE__);
$this->_check_separate_thumbnail_folders();
$this->errors = array();
$this->warnings = array();
$this->detailed_warnings = array();
$this->messages = array();
$this->show_config_editor = true;
if ($this->get_cpm_option("cpm-skip-checks") == 1) {
// if the user knows what they're doing, disabling all of the checks improves performance
foreach ($this->folders as $folder_info) {
list ($name, $property, $is_fatal, $thumb_type) = $folder_info;
if ($thumb_type != "") {
$this->thumbs_folder_writable[$thumb_type] = true;
}
}
$this->category_info['comiccat'] = get_object_vars(get_category($this->properties['comiccat']));
$this->blog_category_info = get_object_vars(get_category($this->properties['blogcat']));
$this->comic_files = $this->read_comics_folder();
} else {
foreach ($this->folders as $folder_info) {
list ($name, $property, $is_fatal, $thumb_type) = $folder_info;
if ($thumb_type != "") {
$this->thumbs_folder_writable[$thumb_type] = null;
}
}
// quick check to see if the theme is ComicPress.
// this needs to be made more robust.
if (preg_match('/ComicPress/', get_current_theme()) == 0) {
$this->detailed_warnings[] = __("The current theme isn't the ComicPress theme. If you've renamed the theme, ignore this warning.", 'comicpress-manager');
}
$any_cpm_document_root_failures = false;
if (!function_exists('get_site_option')) {
// is the site root configured properly?
if (!$this->_f->file_exists(CPM_DOCUMENT_ROOT)) {
$this->errors[] = sprintf(__('The comics site root <strong>%s</strong> does not exist. Check your <a href="options-general.php">WordPress address and address settings</a>.', 'comicpress-manager'), CPM_DOCUMENT_ROOT);
$any_cpm_document_root_failures = true;
}
if (!$this->_f->file_exists(CPM_DOCUMENT_ROOT . '/index.php')) {
$this->errors[] = sprintf(__('The comics site root <strong>%s</strong> does not contain a WordPress index.php file. Check your <a href="options-general.php">WordPress address and address settings</a>.', 'comicpress-manager'), CPM_DOCUMENT_ROOT);
$any_cpm_document_root_failures = true;
}
}
if ($any_cpm_document_root_failures) {
$this->errors[] = print_r($cpm_attempted_document_roots, true);
}
// folders that are the same as the comics folder won't be written to
$all_the_same = array();
foreach ($this->separate_thumbs_folder_defined as $type => $value) {
if (!$value) { $all_the_same[] = $type; }
}
if (count($all_the_same) > 0) {
$this->detailed_warnings[] = sprintf(__("The <strong>%s</strong> folders and the comics folder are the same. You won't be able to generate thumbnails until you change these folders.", 'comicpress-manager'), implode(", ", $all_the_same));
}
if ($this->get_cpm_option('cpm-did-first-run') == 1) {
// check the existence and writability of all image folders
foreach ($this->folders as $folder_info) {
list ($name, $property, $is_fatal, $thumb_type) = $folder_info;
if (($thumb_type == "") || ($this->separate_thumbs_folder_defined[$thumb_type] == true)) {
$path = CPM_DOCUMENT_ROOT . '/' . $this->properties[$property];
$result = $this->_test_image_folder_writable($path, $thumb_type);
switch ($result) {
case $this->error_types['NOT_A_FOLDER']:
$this->errors[] = sprintf(__('The %1$s <strong>%2$s</strong> does not exist. Did you create it within the <strong>%3$s</strong> folder?' , 'comicpress-manager'), $name, $this->properties[$property], CPM_DOCUMENT_ROOT);
break;
case $this->error_types['NOT_WRITABLE']:
$message = sprintf(__('The %1$s <strong>%2$s</strong> is not writable by the Webserver.', 'comicpress-manager'), $name, $this->properties[$property]);
if ($is_fatal) {
$this->errors[] = $message;
} else {
$this->warnings[] = $message;
}
break;
case $this->error_types['NOT_STATABLE']:
$this->errors[] = __('<strong>Files written to the %s directory by the Webserver cannot be read again!</strong> Are you using IIS7 with FastCGI?', $this->properties[$property]);
break;
}
}
}
}
// to generate thumbnails, a supported image processor is needed
if ($this->scale_method == false) {
$this->detailed_warnings[] = __("No image resize methods are installed (GD or ImageMagick). You are unable to generate thumbnails automatically.", 'comicpress-manager');
}
// are there enough categories created?
if (count(get_all_category_ids()) < 2) {
$this->errors[] = __("You need to define at least two categories, a blog category and a comics category, to use ComicPress. Visit <a href=\"categories.php\">Manage -> Categories</a> and create at least two categories, then return here to continue your configuration.", 'comicpress-manager');
$this->show_config_editor = false;
} else {
foreach ($this->category_info as $type => $value) {
$result = $this->_check_category($type);
switch ($result) {
case $this->error_types['INVALID_CATEGORY']:
$this->errors[] = sprintf(__("%s needs to be defined as a number, not an alphanumeric string.", 'comicpress-manager'), $type);
break;
case $this->error_types['CATEGORY_DOES_NOT_EXIST'];
$this->errors[] = sprintf(__("The requested category ID for %s, <strong>%s</strong>, doesn't exist!", 'comicpress-manager'), $type, $this->properties[$type]);
break;
}
}
if ($this->properties['blogcat'] == $this->properties['comiccat']) {
$this->warnings[] = __("Your comic and blog categories are the same. This will cause browsing problems for visitors to your site.", 'comicpress-manager');
}
}
// a quick note if you have no comics uploaded.
// could be a sign of something more serious.
if (count($this->comic_files = $this->read_comics_folder()) == 0) {
$this->detailed_warnings[] = __("Your comics folder is empty!", 'comicpress-manager');
}
}
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,85 @@
<?php
class ComicPressView {
var $_partial_path;
function _storyline_setup() {
global $comicpress_manager;
foreach ($comicpress_manager->normalize_storyline_structure() as $key => $value) {
$this->{$key} = $value;
}
$this->comic_categories = array();
foreach ($this->category_tree as $node) {
$this->comic_categories[] = end(explode("/", $node));
}
$this->post_categories = array();
}
function _partial_path($file) {
if (empty($this->_partial_path)) {
$this->_partial_path = dirname(__FILE__) . '/views/' . get_class($this) . '/';
}
return $this->_partial_path . $file . ".inc";
}
function _display_storyline_checkboxes($prefix = "", $root_name = 'in-comic-category') {
foreach ($this->category_tree as $node) {
$parts = explode("/", $node);
$category_id = end($parts);
$name = (empty($prefix) ? "" : "${prefix}-") . $root_name; ?>
<div style="margin-left: <?php echo (count($parts) - 2) * 20 ?>px; white-space: nowrap">
<label>
<input type="checkbox"
name="<?php echo $name ?>[]"
value="<?php echo $category_id ?>" id="<?php echo $name ?>-<?php echo $category_id ?>"
<?php echo in_array($category_id, $this->post_categories) ? "checked=\"checked\"" : "" ?> />
<?php echo get_cat_name($category_id) ?>
</label>
</div>
<?php
}
}
/**
* Create a list of checkboxes that can be used to select additional categories.
*/
function _generate_additional_categories_checkboxes($override_name = null) {
global $comicpress_manager;
$additional_categories = array();
$invalid_ids = array($comicpress_manager->properties['blogcat']);
foreach ($this->category_tree as $node) { $invalid_ids[] = end(explode('/', $node)); }
foreach (get_all_category_ids() as $cat_id) {
if (!in_array($cat_id, $invalid_ids)) {
$category = get_category($cat_id);
$additional_categories[strtolower($category->cat_name)] = $category;
}
}
ksort($additional_categories);
$name = (!empty($override_name)) ? $override_name : "additional-categories";
$selected_additional_categories = explode(",", $comicpress_manager->get_cpm_option("cpm-default-additional-categories"));
$this->category_checkboxes = array();
if (count($additional_categories) > 0) {
foreach ($additional_categories as $category) {
$checked = (in_array($category->cat_ID, $selected_additional_categories) ? "checked=\"checked\"" : "");
$this->category_checkboxes[] = "<label><input id=\"additional-" . $category->cat_ID . "\" type=\"checkbox\" name=\"${name}[]\" value=\"" . $category->cat_ID . "\" ${checked} /> " . $category->cat_name . "</label><br />";
}
}
return $this->category_checkboxes;
}
function render_help() {
include($this->_partial_path('help'));
}
}
?>

View File

@ -0,0 +1,76 @@
<?php
class ComicPressEditPostShowComic extends ComicPressView {
function ComicPressEditPostShowComic() {
global $post, $comicpress_manager, $comicpress_manager_admin;
$comicpress_manager->read_comicpress_config();
$this->has_comic_file = false;
$this->in_comics_category = false;
$this->thumbnails_to_generate = $comicpress_manager->get_thumbnails_to_generate();
$this->_storyline_setup();
if ($post->ID !== 0) {
$this->post_categories = wp_get_post_categories($post->ID);
$in_comics_category = (count(array_intersect($this->comic_categories, $this->post_categories)) > 0);
$ok = true;
if ($comicpress_manager->get_subcomic_directory() !== false) {
$ok = in_array(get_option('comicpress-manager-manage-subcomic'), $this->post_categories);
}
if ($ok) {
$post_time = time();
foreach (array('post_date', 'post_modified', 'post_date_gmt', 'post_modified_gmt') as $time_value) {
if (($result = strtotime($post->{$time_value})) !== false) {
$post_time = $result; break;
}
}
if (($comic = $comicpress_manager_admin->find_comic_by_date($post_time)) !== false) {
$comic_uri = $comicpress_manager->build_comic_uri($comic);
$this->comic_filename = preg_replace('#^.*/([^\/]*)$#', '\1', $comic_uri);
$this->link = "<strong><a target=\"comic_window\" href=\"${comic_uri}\">{$this->comic_filename}</a></strong>";
$date_root = substr($comic_filename, 0, strlen(date(CPM_DATE_FORMAT)));
$this->thumbnails_found = $comicpress_manager_admin->find_thumbnails_by_filename($comic);
$icon_file_to_use = $comic;
foreach (array('rss', 'archive') as $type) {
if (isset($thumbnails_found[$type])) {
$icon_file_to_use = $this->thumbnails_found[$type];
}
}
$this->icon_uri = $comicpress_manager->build_comic_uri($icon_file_to_use);
$this->has_comic_file = true;
}
}
}
}
function render() {
global $post, $comicpress_manager, $comicpress_manager_admin;
$form_target = plugin_basename(realpath(dirname(__FILE__) . "/../comicpress_manager_admin.php"));
include($this->_partial_path("script"));
?>
<div id="comicdiv" class="postbox">
<h3><?php _e("Comic For This Post", 'comicpress-manager') ?></h3>
<div class="inside" style="overflow: hidden">
<?php include($this->_partial_path("info-box")) ?>
<?php include($this->_partial_path("edit-table")) ?>
</div>
</div>
<?php }
}
?>

View File

@ -0,0 +1,63 @@
<table class="form-table">
<tr>
<th scope="row">
<?php if ($this->has_comic_file) { ?>
<?php _e("Replace This Image", 'comicpress-manager') ?>
<?php } else { ?>
<?php _e("Upload a New Single Image", 'comicpress-manager') ?>
<?php } ?>
</th>
<td>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $comicpress_manager->convert_short_size_string_to_bytes(ini_get('upload_max_filesize')) ?>" />
<input type="file" id="comicpress-replace-image" name="comicpress-replace-image" class="button" /> <?php echo (empty($this->thumbnails_to_generate)) ? "" : __("<em>(thumbnails will be generated)</em>", 'comicpress-manager') ?><br />
<?php if ($this->has_comic_file) { ?>
<input type="hidden" name="overwrite-existing-file-choice" value="<?php echo $this->comic_filename ?>" />
<?php } ?>
<input type="hidden" name="upload-destination" value="comic" />
<input type="hidden" name="thumbnails" value="yes" />
</td>
<script type="text/javascript">
Event.observe('comicpress-replace-image', 'click', function() {
[<?php echo (is_array($comicpress_manager->properties['comiccat'])) ?
implode(",", $comicpress_manager->properties['comiccat']) :
$comicpress_manager->properties['comiccat'] ?>].each(function(i) {
$('in-category-' + i).checked = true;
});
});
</script>
</tr>
<?php
if ($comicpress_manager->get_cpm_option('cpm-skip-checks') != 1) {
if (!function_exists('get_comic_path')) { ?>
<tr>
<td colspan="2" style="background-color: #fee; border: solid #daa 1px">
<?php _e('<strong>It looks like you\'re running an older version of ComicPress.</strong> Storyline, hovertext, and transcript are fully supported in <a href="http://comicpress.org/">ComicPress 2.7</a>. You can use hovertext and transcripts in earlier themes by using <tt>get_post_meta($post->ID, "hovertext", true)</tt> and <tt>get_post_meta($post->ID, "transcript", true)</tt>.', 'comicpress-manager') ?>
</td>
</tr>
<?php }
} ?>
<?php if (get_option('comicpress-enable-storyline-support') == 1) { ?>
<tr>
<th scope="row">
<?php
if (count($this->category_tree) > 1) {
_e("Storyline", 'comicpress-manager');
} else {
_e("Category", 'comicpress-manager');
}
?>
</th>
<td>
<?php $this->_display_storyline_checkboxes(null, "post_category") ?>
</td>
</tr>
<?php } ?>
<tr>
<th scope="row"><?php _e('&lt;img title&gt;/hover text', 'comicpress-manager') ?></th>
<td><input type="text" name="comicpress-img-title" size="50" value="<?php echo get_post_meta($post->ID, 'hovertext', true) ?>" /></td>
</tr>
<tr>
<th scope="row"><?php _e("Transcript", 'comicpress-manager') ?></th>
<td><textarea name="comicpress-transcript" rows="8" cols="50"><?php echo get_post_meta($post->ID, 'transcript', true) ?></textarea></td>
</tr>
</table>

View File

@ -0,0 +1,37 @@
<?php if (count($comicpress_manager->comic_files) == 0) { ?>
<div style="border: solid #daa 1px; background-color: #ffe7e7; padding: 5px">
<strong>It looks like this is a new ComicPress install.</strong> You should test to make
sure uploading works correctly by visiting <a href="admin.php?page=<?php echo plugin_basename(realpath(dirname(__FILE__) . '/../comicpress_manager_admin.php')) ?>">ComicPress -> Upload</a>.
</div>
<?php } ?>
<?php if ($this->has_comic_file) { ?>
<div id="comic-hover" style="border: solid black 1px; position: absolute; display: none" onmouseout="hide_comic()">
<img id="preview-comic" src="<?php echo $this->comic_uri ?>" />
</div>
<a href="#" onclick="return false" onmouseover="show_comic()"><img id="comic-icon" src="<?php echo $this->icon_uri ?>" height="100" align="right" /></a>
<p>
<?php printf(__("The comic that will be shown with this post is %s.", 'comicpress-manager'), $this->link) ?>
<?php _e("Mouse over the icon to the right to see a larger version of the image.", 'comicpress-manager') ?>
</p>
<?php
if ($comicpress_manager->get_subcomic_directory() !== false) {
printf(__("Comic files will be uploaded to the <strong>%s</strong> comic subdirectory.", 'comicpress-manager'), get_cat_name(get_option('comicpress-manager-manage-subcomic')));
}
?>
<?php if (count($this->thumbnails_found) > 0) { ?>
<p><?php _e("The following thumbnails for this comic were also found:", 'comicpress-manager') ?>
<?php foreach ($this->thumbnails_found as $type => $file) { ?>
<a target="comic_window" href="<?php echo $comicpress_manager->build_comic_uri(CPM_DOCUMENT_ROOT . '/' . $file) ?>"><?php echo $type ?></a>
<?php } ?>
</p>
<?php } ?>
<?php } ?>
<?php if ($comicpress_manager->get_cpm_option("cpm-edit-post-integrate") == 1) { ?>
<p><em><strong>ComicPress Manager Edit Post file management is enabled.</strong></em> Any changes to post date, or deleting this post, will affect any associated comic files.</p>
<?php } ?>
<p><strong>NOTE: Upload errors will not be reported.</strong> If you are having trouble uploading files, use the <a href="admin.php?page=<?php echo plugin_basename(realpath(dirname(__FILE__) . '/../comicpress_manager_admin.php')) ?>">ComicPress -> Upload</a> screen.</p>

View File

@ -0,0 +1,26 @@
<script type="text/javascript">
function show_comic() {
if ($('comic-icon').offsetWidth > $('comic-icon').offsetHeight) {
$('preview-comic').width = 400;
} else {
$('preview-comic').height = 400;
}
Element.clonePosition('comic-hover', 'comic-icon', { setWidth: false, setHeight: false, offsetTop: -((Element.getDimensions('comic-hover')['height'] - Element.getDimensions('comic-icon')['height'])/2) });
$('comic-hover').show();
}
function hide_comic() { $('comic-hover').hide(); }
var all_comic_categories = [ <?php echo implode(",", $this->comic_categories) ?> ];
var storyline_enabled = <?php echo (get_option('comicpress-enable-storyline-support') == 1) ? 'true' : 'false' ?>;
Event.observe(window, 'load', function() {
$('post').encoding = "multipart/form-data";
if (storyline_enabled) {
$$('div#categories-all input').each(function(i) {
if (all_comic_categories.indexOf(Number(i.value)) != -1) { i.disabled = true; }
});
}
});
</script>

View File

@ -0,0 +1,50 @@
<?php
class ComicPressPostEditor extends ComicPressView {
function ComicPressPostEditor($width = 435, $is_import = false) {
global $comicpress_manager;
if (!is_null(get_category($comicpress_manager->properties['comiccat']))) {
$this->form_titles_and_fields = array();
$this->_storyline_setup();
if ($comicpress_manager->get_subcomic_directory() !== false) {
$this->post_categories = array(get_option('comicpress-manager-manage-subcomic'));
} else {
if ($comicpress_manager->get_cpm_option('cpm-default-comic-category-is-last-storyline') == 1) {
$this->post_categories = array(end(explode("/", end($this->category_tree))));
} else {
$this->post_categories = array(end(explode("/", reset($this->category_tree))));
}
}
$this->width = $width;
$this->is_import = $is_import;
}
}
function render() {
global $comicpress_manager;
if (is_null(get_category($comicpress_manager->properties['comiccat']))) { ?>
<p><strong>You don't have a comics category defined!</strong> Go to the
<a href="?page=<?php echo plugin_basename(__FILE__) ?>-config">ComicPress Config</a> screen and choose a category.
<?php return;
}
$this->category_checkboxes = $this->_generate_additional_categories_checkboxes();
if ($comicpress_manager->scale_method != false) {
$this->thumbnail_writes = $comicpress_manager->get_thumbnails_to_generate();
}
$this->all_tags = get_tags();
if (function_exists('wp_tiny_mce')) { wp_tiny_mce(); }
include($this->_partial_path('table'));
}
}
?>

View File

@ -0,0 +1,159 @@
<table class="form-table">
<tr>
<th valign="top" scope="row"><?php _e("Storyline:", 'comicpress-manager') ?></th>
<td valign="top"><?php echo $this->_display_storyline_checkboxes ?></td>
</tr>
<?php if (!empty($this->category_checkboxes)) { ?>
<tr>
<th valign="top" scope="row"><?php _e("Additional Categories", 'comicpress-manager') ?></th>
<td valign="top"><?php echo implode("\n", $this->category_checkboxes) ?></td>
</tr>
<?php } ?>
<tr>
<th valign="top" scope="row"><?php _e("Time to post:", 'comicpress-manager') ?></th>
<td valign="top">
<input type="text" name="time" value="<?php echo $comicpress_manager->get_cpm_option('cpm-default-post-time') ?>" size="10" />
<?php _e(" <em>(must be in the format <strong>HH:MM am/pm</strong> or <strong>now</strong>)</em>", 'comicpress-manager') ?>
</td>
</tr>
<tr>
<th valign="top" scope="row">
<label for="publish"><?php _e("Publish post:", 'comicpress-manager') ?></label>
</th>
<td valign="top">
<input id="publish" type="checkbox" name="publish" value="yes" checked="checked" />
<label for="publish">
<?php _e("(set the status of this post to <strong>published</strong> instead of <strong>draft</strong>)", 'comicpress-manager') ?>
</label>
</td>
</tr>
<?php if ($this->is_import) { ?>
<input type="hidden" name="duplicate_check" value="yes" />
<?php } else { ?>
<tr>
<th valign="top" scope="row">
<label for="duplicate-check">
<?php _e("Check for duplicate posts:", 'comicpress-manager') ?>
</label>
</th>
<td valign="top">
<input id="duplicate-check" type="checkbox" name="duplicate_check" value="yes" checked="checked" />
<label for="duplicate-check">
<?php _e("(if you've set up ComicPress to use multiple posts on the same day, you'll need to disable this option to allow ComicPress Manager to make multiple posts)", 'comicpress-manager') ?>
</label>
</td>
</tr>
<?php } ?>
<?php if (!empty($this->thumbnail_writes)) { ?>
<tr>
<th valign="top" scope="row">
<label for="thumbnails"><?php _e("Generate thumbnails:", 'comicpress-manager') ?></label>
</th>
<td valign="top">
<input onclick="hide_show_div_on_checkbox('thumbnail-write-holder', this, true)" type="checkbox" name="thumbnails" id="thumbnails" value="yes" checked="checked" />
<label for="thumbnails">
<?php printf(__("If enabled, you'll be writing thumbnails to: %s", 'comicpress-manager'), implode(", ", $this->thumbnail_writes)) ?>
</label>
</td>
</tr>
<?php } ?>
<tr>
<th valign="top" scope="row">
<?php _e("Title For All Posts:", 'comicpress-manager') ?>
</th>
<td valign="top">
<input type="text" name="override-title-to-use" value="<?php echo $comicpress_manager->get_cpm_option('cpm-default-override-title') ?>" />
<label>
<?php _e("(the title to use for all posts)", 'comicpress-manager') ?>
</label>
</td>
</tr>
<tr>
<th valign="top" scope="row">
<?php _e("&lt;img title&gt;/Hovertext For All Posts:", 'comicpress-manager') ?>
</th>
<td valign="top">
<input type="text" name="hovertext-to-use" value="<?php echo $comicpress_manager->get_cpm_option('cpm-default-hovertext') ?>" />
<label>
<?php _e('(the hovertext to use for all posts)', 'comicpress-manager') ?>
</label>
</td>
</tr>
<tr>
<th valign="top" scope="row">
<?php _e("Transcript For All Posts:", 'comicpress-manager') ?>
</th>
<td valign="top">
<textarea name="transcript-to-use" rows="5" cols="30"></textarea>
<label>
<?php _e('(the transcript to use for all posts)', 'comicpress-manager') ?>
</label>
</td>
</tr>
<tr>
<th valign="top" scope="row">
<?php _e("Upload Date Format:", 'comicpress-manager') ?>
</th>
<td valign="top">
<input type="text" name="upload-date-format" />
<label>
<?php _e('(if the files you are uploading have a different date format, specify it here. ex: <strong>Ymd</strong> for a file named <strong>20080101-my-new-years-day.jpg</strong>)', 'comicpress-manager') ?>
</label>
</td>
</tr>
<tr>
<th valign="top" scope="row">
<?php _e("Tags:", 'comicpress-manager') ?>
</th>
<td valign="top">
<input type="text" id="tags" name="tags" value="<?php echo $comicpress_manager->get_cpm_option('cpm-default-post-tags') ?>" />
<label>
<?php _e("(any tags to add to the post, separated by commas. any tags you've used before will be listed below.)", 'comicpress-manager') ?>
</label>
</td>
</tr>
<?php if (!empty($this->all_tags)) { ?>
<tr>
<th valign="top" scope="row">
<?php _e('Quick Tags (click to add):', 'comicpress-manager') ?>
</th>
<td valign="top">
<?php foreach ($this->all_tags as $tag) { ?>
<a href="#" class="tag"><?= $tag->name ?></a>
<?php } ?>
</td>
</tr>
<?php } ?>
</table>
<table class="form-table">
<tr>
<td valign="top">
<strong>Post body template:</strong>
<div id="title"></div>
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv' ?>" class="postarea">
<?php the_editor($comicpress_manager->get_cpm_option('cpm-default-post-content')) ?>
</div>
<br />
(<em><?php _e("Available wildcards:", 'comicpress-manager') ?></em>)
<ul>
<li><strong>{category}</strong>: <?php _e("The name of the category", 'comicpress-manager') ?></li>
<li><strong>{date}</strong>: <?php printf(__("The date of the comic (ex: <em>%s</em>)", 'comicpress-manager'), date("F j, Y", time())) ?></li>
<li><strong>{title}</strong>: <?php _e("The title of the comic", 'comicpress-manager') ?></li>
</ul>
</td>
</tr>
</table>

View File

@ -0,0 +1,119 @@
<?php
class ComicPressQuomicPressWidget extends ComicPressView {
function ComicPressQuomicPressWidget() {
global $comicpress_manager;
if (($this->show_widget = (count($comicpress_manager->errors) == 0)) === true) {
$ok_to_generate_thumbs = false;
$thumbnails_to_generate = array();
$comicpress_manager->need_calendars = true;
$this->thumbnails_to_generate = $comicpress_manager->get_thumbnails_to_generate();
$this->go_live_time_string = ($comicpress_manager->get_cpm_option('cpm-default-post-time') == "now") ?
__("<strong>now</strong>", 'comicpress-manager') :
sprintf(__("at <strong>%s</strong>", 'comicpress-manager'), $comicpress_manager->get_cpm_option('cpm-default-post-time'));
$this->show_new_setup_warning = ((count($comicpress_manager->comic_files) == 0) && ($comicpress_manager->get_subcomic_directory() === false));
$this->category_to_use = null;
$this->_storyline_setup();
if ($comicpress_manager->get_subcomic_directory() !== false) {
$this->category_to_use = get_option('comicpress-manager-manage-subcomic');
} else {
if ($comicpress_manager->get_cpm_option('cpm-default-comic-category-is-last-storyline') == 1) {
$this->category_to_use = end(explode("/", end($this->category_tree)));
} else {
$this->category_to_use = end(explode("/", reset($this->category_tree)));
}
}
}
}
function render() {
global $post, $comicpress_manager, $comicpress_manager_admin;
$category = get_category($this->category_to_use);
$comicpress_manager_admin->write_global_styles_scripts();
?>
<div class="wrap">
<?php $comicpress_manager_admin->handle_warnings() ?>
<?php if ($this->show_widget) { ?>
<?php if ($this->show_new_setup_warning) { ?>
<div style="border: solid #daa 1px; background-color: #ffe7e7; padding: 5px">
<strong>It looks like this is a new ComicPress install.</strong> You should test to make
sure uploading works correctly by visiting <a href="admin.php?page=<?php echo plugin_basename(realpath(dirname(__FILE__) . '/../../comicpress_manager_admin.php')) ?>">ComicPress -> Upload</a>.
</div>
<?php } ?>
<p>
<?php printf(__("<strong>Upload a single comic file</strong> and immediately start editing the associated published post. Your post will be going live %s on the provided date and will be posted in the <strong>%s</strong> category.", 'comicpress-manager'), $go_live_time_string, $category->cat_name) ?>
<?php
if ($comicpress_manager->get_subcomic_directory() !== false) {
printf(__("Comic files will be uploaded to the <strong>%s</strong> comic subdirectory.", 'comicpress-manager'), get_cat_name(get_option('comicpress-manager-manage-subcomic')));
}
?>
<?php if (!empty($this->thumbnails_to_generate)) {
$thumbnail_strings = array();
foreach ($this->thumbnails_to_generate as $type) {
$thumbnail_strings[] = sprintf(__("<strong>%s</strong> thumbnails that are <strong>%spx</strong> wide", 'comicpress-manager'), $type, $comicpress_manager->properties["${type}_comic_width"]);
}
?>
<?php printf(__("You'll be generating: %s.", 'comicpress-manager'), implode(", ", $thumbnail_strings)) ?>
<?php } ?>
</p>
<form action="?page=<?php echo plugin_basename(realpath(dirname(__FILE__) . '/../../comicpress-manager.php')) ?>" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $comicpress_manager->convert_short_size_string_to_bytes(ini_get('upload_max_filesize')) ?>" />
<input type="hidden" name="action" value="write-comic-post" />
<input type="hidden" name="upload-destination" value="comic" />
<input type="hidden" name="thumbnails" value="yes" />
<input type="hidden" name="new_post" value="yes" />
<?php echo generate_comic_categories_options('in-comic-category[]', false) ?>
<input type="hidden" name="time" value="<?php echo $comicpress_manager->get_cpm_option('cpm-default-post-time') ?>" />
<table class="form-table">
<tr>
<th scope="row"><?php _e('File:', 'comicpress-manager') ?></th>
<td><input type="file" name="upload" /></td>
</tr>
<?php if (count($category_checkboxes = $this->_generate_additional_categories_checkboxes()) > 0) {
?>
<tr>
<th scope="row"><?php _e("Additional Categories:", 'comicpress-manager') ?></th>
<td><?php echo implode("\n", $category_checkboxes) ?></td>
</tr>
<?php } ?>
<tr>
<th scope="row"><?php _e("Post date (leave blank if already in filename):", 'comicpress-manager') ?></th>
<td>
<div class="curtime"><input type="text" id="override-date" name="override-date" /></div>
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" class="button" value="Upload Comic File and Edit Post" /></td>
</tr>
</table>
</form>
<script type="text/javascript">
Calendar.setup({
inputField: "override-date",
ifFormat: "%Y-%m-%d",
button: "override-date"
});
</script>
<?php } ?>
</div>
<?php }
}
?>

View File

@ -0,0 +1,37 @@
<?php
require_once('ComicPressPostEditor.php');
class ComicPressUpload extends ComicPressView {
function ComicPressUpload() {
global $comicpress_manager;
$comicpress_manager->need_calendars = true;
$this->example_date = $comicpress_manager->generate_example_date(CPM_DATE_FORMAT);
$this->example_real_date = date(CPM_DATE_FORMAT);
$this->zip_extension_loaded = extension_loaded('zip');
$this->post_editor = new ComicPressPostEditor(420);
}
function render() {
global $comicpress_manager;
if ($comicpress_manager->get_subcomic_directory() !== false) {
$comicpress_manager->messages[] = sprintf(__("<strong>Reminder:</strong> You are managing the <strong>%s</strong> comic subdirectory.", 'comicpress-manager'), get_cat_name(get_option('comicpress-manager-manage-subcomic')));
}
// need to do checks better
// if ($comicpress_manager->get_cpm_option('cpm-skip-checks') != 1) {
// if (!function_exists('get_comic_path')) {
// $comicpress_manager->warnings[] = __('<strong>It looks like you\'re running an older version of ComicPress.</strong> Storyline, hovertext, and transcript are fully supported in <a href="http://comicpress.org/">ComicPress 2.7</a>. You can use hovertext and transcripts in earlier themes by using <tt>get_post_meta($post->ID, "hovertext", true)</tt> and <tt>get_post_meta($post->ID, "transcript", true)</tt>.', 'comicpress-manager');
// }
// }
if (count($_POST) == 0 && isset($_GET['upload'])) {
$comicpress_manager->warnings[] = sprintf(__("Your uploaded files were larger than the <strong><tt>post_max_size</tt></strong> setting, which is currently <strong><tt>%s</tt></strong>. Either upload fewer/smaller files, upload them via FTP/SFTP, or increase your server's <strong><tt>post_max_size</tt></strong>.", 'comicpress-manager'), ini_get('post_max_size'));
}
include($this->_partial_path('upload'));
}
}
?>

View File

@ -0,0 +1,40 @@
<p>
<strong>
<?php _e("ComicPress Manager manages your comics and your time.", 'comicpress-manager') ?>
</strong>
<?php _e("It makes uploading new comics, importing comics from a non-ComicPress setup, and batch uploading a lot of comics at once, very fast and configurable.", 'comicpress-manager') ?>
</p>
<p>
<strong>
<?php _e("ComicPress Manager also manages yours and your Website's sanity.", 'comicpress-manager') ?>
</strong>
<?php printf(__("It can check for misconfigured ComicPress setups, for incorrectly-named files (remember, it's <em>%s-single-comic-title.ext</em>) and for when you might be duplicating a post. You will also be shown which comic will appear with which blog post in the Post editor.", 'comicpress-manager'), $this->example_date) ?>
</p>
<p>
<?php printf(__("<strong>Single comic titles</strong> are generated from the incoming filename. If you've named your file <strong>%s-my-new-years-day.jpg</strong> and create a new post for the file, the post title will be <strong>My New Years Day</strong>. This default should handle the majority of cases. If a comic file does not have a title, the date in <strong>MM/DD/YYYY</strong> format will be used.", 'comicpress-manager'), $this->example_real_date) ?>
</p>
<p>
<?php _e("<strong>Upload image files</strong> lets you upload multiple comics at a time, and add a default post body for each comic.", 'comicpress-manager') ?>
<?php if ($this->zip_extension_loaded) { ?>
<?php _e("You can <strong>upload a Zip file and create new posts</strong> from the files contained within the Zip file.", 'comicpress-manager') ?>
<?php } else { ?>
<?php _e("<strong>You can't upload a Zip file</strong> because you do not have the PHP <strong>zip</strong> extension installed.", 'comicpress-manager') ?>
<?php } ?>
</p>
<p>
<?php _e("Has ComicPress Manager saved you time and sanity? <strong>Donate a few bucks to show your appreciation!</strong>", 'comicpress-manager') ?>
<span style="display: block; text-align: center">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHdwYJKoZIhvcNAQcEoIIHaDCCB2QCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBt5XgClPZfdf9s2CHnk4Ka5NQv+Aoswm3efVANJKvHR3h4msnSWwDzlJuve/JD5aE0rP4SRLnWuc4qIhOeeAP+MEGbs8WNDEPtUopmSy6aphnIVduSstqRWWSYElK5Wij/H8aJtiLML3rVBtiixgFBbj2HqD2JXuEgduepEvVMnDELMAkGBSsOAwIaBQAwgfQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIlFUk3PoXtLKAgdAjA3AjtLZz9ZnJslgJPALzIwYw8tMbNWvyJXWksgZRdfMw29INEcgMrSYoWNHY4AKpWMrSxUcx3fUlrgvPBBa1P96NcgKfJ6U0KwygOLrolH0JAzX0cC0WU3FYSyuV3BZdWyHyb38/s9AtodBFy26fxGqvwnwgWefQE5p9k66lWA4COoc3hszyFy9ZiJ+3PFtH/j8+5SVvmRUk4EUWBMopccHzLvkpN2WALLAU4RGKGfH30K1H8+t8E/+uKH1jt8p/N6p60jR+n7+GTffo3NahoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDkwMTA2MDAyOTQwWjAjBgkqhkiG9w0BCQQxFgQUITTqZaXyM43N5f08PBPDuRmzzdEwDQYJKoZIhvcNAQEBBQAEgYAV0szDQPbcyW/O9pZ7jUghTRdgHbCX4RyjPzR35IrI8MrqmtK94ENuD6Xf8PxkAJ3QdDr9OvkzWOHFVrb6YrAdh+XxBsMf1lD17UbwN3XZFn5HqvoWNFxNr5j3qx0DBsCh5RlGex+HAvtIoJu21uGRjbOQQsYFdlAPHxokkVP/Xw==-----END PKCS7-----
">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</span>
</p>

View File

@ -0,0 +1,130 @@
<h2 style="padding-right:0;">
<?php if ($this->zip_extension_loaded) {
_e("Upload Image &amp; Zip Files", 'comicpress-manager');
} else {
_e("Upload Image Files", 'comicpress-manager');
} ?>
</h2>
<h3>&mdash;
<?php if ($comicpress_manager->get_cpm_option('cpm-obfuscate-filenames-on-upload') === "none") { ?>
<?php _e("any existing files with the same name will be overwritten", 'comicpress-manager') ?>
<?php } else { ?>
<?php _e("uploaded filenames will be obfuscated, therefore no old files will be overwritten after uploading", 'comicpress-manager') ?>
<?php } ?>
</h3>
<?php if (!function_exists('get_site_option')) { ?>
<?php if (!$this->zip_extension_loaded) { ?>
<div id="zip-upload-warning">
<?php printf(__('<strong>You do not have the Zip extension installed.</strong> Uploading a Zip file <strong>will not work</strong>. Either upload files individually or <a href="%s">FTP/SFTP the files to your site and import them</a>.', 'comicpress-manager'), "?page=" . plugin_basename(realpath(dirname(__FILE__) . '/../comicpress_manager_admin.php') . '-import')) ?>
</div>
<?php } ?>
<?php } ?>
<?php $target_url = add_query_arg("upload", "1") ?>
<form onsubmit="$('submit').disabled=true" action="<?php echo $target_url ?>" method="post" enctype="multipart/form-data">
<input type="hidden" name="action" value="multiple-upload-file" />
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $comicpress_manager->convert_short_size_string_to_bytes(ini_get('upload_max_filesize')) ?>" />
<div id="multiple-file-upload">
</div>
<div style="text-align: center">
[<a href="#" onclick="add_file_upload(); return false"><?php _e("Add file to upload", 'comicpress-manager') ?></a>]
</div>
<table class="form-table">
<tr>
<th scope="row"><?php _e("Destination for uploaded files:", 'comicpress-manager') ?></th>
<td>
<select name="upload-destination" id="upload-destination">
<option value="comic"><?php _e("Comics folder", 'comicpress-manager') ?></option>
<option value="archive_comic"><?php _e("Archive folder", 'comicpress-manager') ?></option>
<option value="rss_comic"><?php _e("RSS feed folder", 'comicpress-manager') ?></option>
</select>
</td>
</tr>
<?php if (count($comicpress_manager->comic_files) > 0) { ?>
<tr id="overwrite-existing-holder">
<th scope="row"><?php _e("Overwrite an existing file:", 'comicpress-manager') ?></th>
<td>
<select name="overwrite-existing-file-choice" id="overwrite-existing-file-choice">
<option value=""><?php _e("-- no --", 'comicpress-manager') ?></option>
<?php
foreach ($comicpress_manager->comic_files as $file) {
$basename = pathinfo($file, PATHINFO_BASENAME); ?>
<option value="<?php echo $basename ?>"
<?php echo ($_GET['replace'] == $basename) ? "selected" : "" ?>><?php echo $basename ?></option>
<?php }
?>
</select>
</td>
</tr>
<tr id="rebuild-thumbnails">
<th scope="row"><?php _e("Rebuild thumbnails?", 'comicpress-manager') ?></th>
<td>
<label>
<input type="checkbox" id="replace-comic-rebuild-thumbnails" name="replace-comic-rebuild-thumbnails" value="yes" checked="checked" />
<em>(if replacing a comic in the <strong>comic</strong> folder, you can also regenerate thumbnails)</em>
</label>
</td>
</tr>
<?php } ?>
<tr>
<td align="center" colspan="2">
<input class="button" id="submit" type="submit" value="<?php
if ($this->zip_extension_loaded) {
_e("Upload Image &amp; Zip Files", 'comicpress-manager');
} else {
_e("Upload Image Files", 'comicpress-manager');
}
?>" />
</td>
</tr>
</table>
<div id="upload-destination-holder">
<table class="form-table">
<tr>
<th scope="row"><?php _e("Generate new posts for each uploaded file:", 'comicpress-manager') ?></th>
<td>
<input id="multiple-new-post-checkbox" type="checkbox" name="new_post" value="yes" checked="checked" />
<label for="multiple-new-post-checkbox"><em>(if you only want to upload a series of files to replace others, leave this unchecked)</em></label>
</td>
</tr>
</table>
<div id="multiple-new-post-holder">
<table class="form-table" id="specify-date-holder">
<tr>
<th scope="row"><?php _e("Date for uploaded file:", 'comicpress-manager') ?></th>
<td>
<div class="curtime"><input type="text" id="override-date" name="override-date" /> <?php _e("<em>(click to open calendar. for single file uploads only. can accept any date format parseable by <a href=\"http://us.php.net/strtotime\" target=\"php\">strtotime()</a>)</em>", 'comicpress-manager') ?></div>
</td>
</tr>
</table>
<?php $this->post_editor->render() ?>
<table class="form-table">
<tr>
<td align="center">
<input class="button" id="top-submit" type="submit" value="<?php
if (extension_loaded("zip")) {
_e("Upload Image &amp; Zip Files", 'comicpress-manager');
} else {
_e("Upload Image Files", 'comicpress-manager');
}
?>" />
</td>
</tr>
</table>
</div>
</div>
</form>
<script type="text/javascript">
Calendar.setup({
inputField: "override-date",
ifFormat: "%Y-%m-%d",
button: "override-date"
});
</script>

BIN
comicpress-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

46
comicpress-manager.php Normal file
View File

@ -0,0 +1,46 @@
<?php
/*
Plugin Name: ComicPress Manager
Plugin URI: http://www.coswellproductions.com/wordpress/wordpress-plugins/
Description: Manage the comics within a <a href="http://www.comicpress.org/">ComicPress</a> theme installation.
Version: 1.5
Author: John Bintz
Author URI: http://www.coswellproductions.com/wordpress/
Copyright 2009 John Bintz (email : john@coswellproductions.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* The loader for the rest of the plugin components.
*/
// load the config, since you can do useful things with this in your theme
require_once('comicpress_manager_config.php');
require_once('classes/ComicPressManager.php');
$comicpress_manager = new ComicPressManager();
// only load the plugin code of we're in the administration part of WordPress.
if (WP_ADMIN === true) {
require_once('classes/ComicPressManagerAdmin.php');
$comicpress_manager_admin = new ComicPressManagerAdmin();
require_once('comicpress_manager_admin.php');
}
?>

1574
comicpress-manager.pot Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,613 @@
<?php
//harmonious @maxdb @hash @zip:rename
require_once('classes/ComicPressManager.php');
require_once('classes/ComicPressManagerAdmin.php');
require_once('FirePHPCore/fb.php');
include('cp_configuration_options.php');
$default_comicpress_config_file_lines = array('<?' . 'php');
foreach ($comicpress_configuration_options as $option_info) {
$default_comicpress_config_file_lines[] = "//{$option_info['name']} - {$option_info['description']} (default \"{$option_info['default']}\")";
$default_comicpress_config_file_lines[] = "\${$option_info['id']} = \"{$option_info['default']}\";";
$default_comicpress_config_file_lines[] = "";
}
$default_comicpress_config_file_lines[] = "?>";
$default_comicpress_config_file = implode("\n", $default_comicpress_config_file_lines);
cpm_initialize_options();
/**
* Initialize ComicPress Manager options.
*/
function cpm_initialize_options() {
global $comicpress_manager;
include('cpm_configuration_options.php');
foreach ($configuration_options as $option_info) {
if (is_array($option_info)) {
$result = $comicpress_manager->get_cpm_option($option_info['id']);
if (isset($option_info['not_blank']) && empty($result)) { $result = false; }
if ($result === false) {
$default = (isset($option_info['default']) ? $option_info['default'] : "");
$comicpress_manager->set_cpm_option($option_info['id'], $default);
}
}
}
}
/**
* Wrap the help text and activity content in the CPM page style.
* @param string $help_content The content to show in the Help box.
* @param string $activity_content The content to show in the Activity box.
*/
function cpm_wrap_content($help_content, $activity_content, $show_sidebar = true) {
global $wp_scripts, $comicpress_manager;
cpm_write_global_styles_scripts();
?>
<div class="wrap">
<div id="cpm-container" <?php echo (!$show_sidebar || ($comicpress_manager->get_cpm_option('cpm-sidebar-type') == "none")) ? "class=\"no-sidebar\"" : "" ?>>
<?php if (cpm_handle_warnings()) { ?>
<!-- Header -->
<?php cpm_show_manager_header() ?>
<div style="overflow: hidden">
<div id="cpm-activity-column" <?php echo (!$show_sidebar || ($comicpress_manager->get_cpm_option('cpm-sidebar-type') == "none")) ? "class=\"no-sidebar\"" : "" ?>>
<div class="activity-box"><?php echo $activity_content ?></div>
<![if !IE]>
<script type="text/javascript">prepare_comicpress_manager()</script>
<![endif]>
</div>
<?php if ($show_sidebar && ($comicpress_manager->get_cpm_option('cpm-sidebar-type') !== "none")) { ?>
<div id="cpm-sidebar-column">
<?php
switch($comicpress_manager->get_cpm_option('cpm-sidebar-type')) {
case "latest":
cpm_show_latest_posts();
break;
case "standard":
default:
cpm_show_comicpress_details();
break;
}
?>
<?php if (!is_null($help_content) && ($comicpress_manager->get_cpm_option('cpm-sidebar-type') == "standard")) { ?>
<div id="comicpress-help">
<h2 style="padding-right:0;"><?php _e("Help!", 'comicpress-manager') ?></h2>
<?php echo $help_content ?>
</div>
<?php } ?>
</div>
<?php } ?>
</div>
<?php cpm_show_footer() ?>
<?php } ?>
</div>
</div>
<?php }
function cpm_manager_page_caller($page) {
global $comicpress_manager;
$do_first_run = false;
if (!$comicpress_manager->get_cpm_option('cpm-did-first-run')) {
$all_comic_folders_found = true;
foreach (array(''. 'rss_', 'archive_') as $folder_name) {
if (!file_exists(CPM_DOCUMENT_ROOT . '/' . $comicpress_manager->properties["${folder_name}comic_folder"])) { $all_comic_folders_found = false; break; }
}
$do_first_run = !$all_comic_folders_found;
if (!$do_first_run) {
if (!function_exists('get_site_option')) {
update_option("comicpress-manager-cpm-did-first-run", 1);
}
}
}
if ($do_first_run) {
include("pages/comicpress_first_run.php");
cpm_manager_first_run(plugin_basename(__FILE__));
if (!function_exists('get_site_option')) {
update_option("comicpress-manager-cpm-did-first-run", 1);
}
} else {
if ($comicpress_manager->did_first_run) { $page = "config"; }
include("pages/comicpress_${page}.php");
call_user_func("cpm_manager_${page}");
}
}
/**
* Wrappers around page calls to reduce the amount of code in _admin.php.
*/
function cpm_manager_index_caller() { cpm_manager_page_caller("index"); }
function cpm_manager_status_caller() { cpm_manager_page_caller("status"); }
function cpm_manager_dates_caller() { cpm_manager_page_caller("dates"); }
function cpm_manager_import_caller() { cpm_manager_page_caller("import"); }
function cpm_manager_config_caller() { cpm_manager_page_caller("config"); }
function cpm_manager_cpm_config_caller() { cpm_manager_page_caller("cpm_config"); }
function cpm_manager_storyline_caller() { cpm_manager_page_caller("storyline"); }
function cpm_manager_write_comic_caller() {
include("pages/write_comic_post.php");
cpm_manager_write_comic(plugin_basename(__FILE__));
}
/**
* Show the header.
*/
function cpm_show_manager_header() {
global $comicpress_manager; ?>
<div id="icon-admin" class="icon32"><br /></div>
<h2>
<?php if (!is_null($comicpress_manager->category_info['comiccat'])) { ?>
<?php printf(__("Managing &#8216;%s&#8217;", 'comicpress-manager'), $comicpress_manager->category_info['comiccat']['name']) ?>
<?php } else { ?>
<?php _e("Managing ComicPress", 'comicpress-manager') ?>
<?php } ?>
</h2>
<?php }
/**
* Find all the thumbnails for a particular image root.
*/
function cpm_find_thumbnails($date_root) {
global $comicpress_manager;
$thumbnails_found = array();
foreach (array('rss', 'archive') as $type) {
if ($comicpress_manager->separate_thumbs_folder_defined[$type]) {
$path = CPM_DOCUMENT_ROOT . '/' . $comicpress_manager->properties[$type . "_comic_folder"];
if (($subdir = $comicpress_manager->get_subcomic_directory()) !== false) {
$path .= '/' . $subdir;
}
$files = glob($path . '/' . $date_root . "*");
if ($files === false) { $files = array(); }
if (count($files) > 0) {
$thumbnails_found[$type] = substr(realpath(array_shift($files)), CPM_STRLEN_REALPATH_DOCUMENT_ROOT);
}
}
}
return $thumbnails_found;
}
function cpm_display_storyline_checkboxes($category_tree, $post_categories, $prefix = null, $root_name = "in-comic-category") {
foreach ($category_tree as $node) {
$parts = explode("/", $node);
$category_id = end($parts);
$name = (empty($prefix) ? "" : "${prefix}-") . $root_name;
?>
<div style="margin-left: <?php echo (count($parts) - 2) * 20 ?>px; white-space: nowrap">
<label>
<input type="checkbox"
name="<?php echo $name ?>[]"
value="<?php echo $category_id ?>" id="<?php echo $name ?>-<?php echo $category_id ?>"
<?php echo in_array($category_id, $post_categories) ? "checked" : "" ?> />
<?php echo get_cat_name($category_id) ?>
</label>
</div>
<?php }
}
/**
* Generate &lt;option&gt; elements for all comic categories.
*/
function generate_comic_categories_options($form_name, $label = true) {
global $comicpress_manager;
$number_of_categories = 0;
$first_category = null;
extract($comicpress_manager->normalize_storyline_structure());
if ($comicpress_manager->get_subcomic_directory() !== false) {
$default_category = get_option('comicpress-manager-manage-subcomic');
} else {
if ($comicpress_manager->get_cpm_option('cpm-default-comic-category-is-last-storyline') == 1) {
$default_category = end(explode("/", end($category_tree)));
} else {
$default_category = $comicpress_manager->properties['comiccat'];
}
}
ob_start();
foreach (get_all_category_ids() as $cat_id) {
$ok = ($cat_id == $default_category);
if ($ok) {
$number_of_categories++;
$category = get_category($cat_id);
if (is_null($first_category)) { $first_category = $category; }
?>
<option
value="<?php echo $category->cat_ID ?>"
<?php if (!is_null($comicpress_manager->category_info['comiccat'])) {
echo ($default_category == $cat_id) ? " selected" : "";
} ?>
><?php echo $category->cat_name; ?></option>
<?php }
}
$output = ob_get_clean();
if ($number_of_categories == 0) {
return false;
} else {
if ($number_of_categories == 1) {
$output = "<input type=\"hidden\" name=\"${form_name}\" value=\"{$first_category->cat_ID}\" />";
if ($label) { $output .= $first_category->cat_name; }
return $output;
} else {
return "<select name=\"${form_name}\">" . $output . "</select>";
}
}
}
/**
* Write the current ComicPress Config to disk.
*/
function write_comicpress_config_functions_php($filepath, $just_show_config = false, $use_default_file = false) {
global $comicpress_manager, $default_comicpress_config_file;
$file_lines = array();
if ($use_default_file) {
$file_lines = $default_comicpress_config_file;
} else {
foreach (file($filepath) as $line) {
$file_lines[] = rtrim($line, "\r\n");
}
}
include('cp_configuration_options.php');
$properties_written = array();
$closing_line = null;
for ($i = 0; $i < count($file_lines); $i++) {
foreach (array_keys($comicpress_manager->properties) as $variable) {
if (!in_array($variable, $properties_written)) {
if (preg_match("#\\$${variable}\ *\=\ *([^\;]*)\;#", $file_lines[$i], $matches) > 0) {
$value = $comicpress_manager->properties[$variable];
$file_lines[$i] = '$' . $variable . ' = "' . $value . '";';
$properties_written[] = $variable;
}
}
}
if (strpos($file_lines[$i], "?>") !== false) { $closing_line = $i; }
}
foreach (array_keys($comicpress_manager->properties) as $variable) {
if (!in_array($variable, $properties_written)) {
foreach ($comicpress_configuration_options as $option_info) {
if ($option_info['id'] == $variable) {
$comicpress_lines = array();
$comicpress_lines[] = "//{$option_info['name']} - {$option_info['description']} (default \"{$option_info['default']}\")";
$comicpress_lines[] = "\${$option_info['id']} = \"{$comicpress_manager->properties[$variable]}\";";
$comicpress_lines[] = "";
array_splice($file_lines, $closing_line, 0, $comicpress_lines);
break;
}
}
}
}
$file_output = implode("\n", $file_lines);
if (!$just_show_config) {
if ($comicpress_manager->can_write_config) {
$target_filepath = $filepath . '.' . time();
$temp_filepath = $target_filepath . '-tmp';
if ($comicpress_manager->_f->file_write_contents($temp_filepath, $file_output) !== false) {
if (file_exists($temp_filepath)) {
@chmod($temp_filepath, CPM_FILE_UPLOAD_CHMOD);
if (@rename($filepath, $target_filepath)) {
if (@rename($temp_filepath, $filepath)) {
return array($target_filepath);
} else {
@unlink($temp_filepath);
@rename($target_filepath, $filepath);
}
} else {
@unlink($temp_filepath);
}
}
}
}
}
return $file_output;
}
/**
* Generate links to view or edit a particular post.
* @param array $post_info The post information to use.
* @return string The view & edit post links for the post.
*/
function generate_view_edit_post_links($post_info) {
$view_post_link = sprintf("<a href=\"{$post_info['guid']}\">%s</a>", __("View post", 'comicpress-manager'));
$edit_post_link = sprintf("<a href=\"post.php?action=edit&amp;post={$post_info['ID']}\">%s</a>", __("Edit post", 'comicpress-manager'));
return $view_post_link . ' | ' . $edit_post_link;
}
/**
* Show the Post Body Template.
* @param integer $width The width of the editor in pixels.
*/
function cpm_show_post_body_template($width = 435) {
global $comicpress_manager; ?>
<?php
}
/**
* Sort backup files by timestamp.
*/
function cpm_available_backup_files_sort($a, $b) {
if ($a[1] == $b[1]) return 0;
return ($a[1] > $b[1]) ? -1 : 1;
}
/**
* Show the details of the current setup in the Sidebar.
*/
function cpm_show_comicpress_details() {
global $comicpress_manager;
$all_comic_dates_ok = true;
$all_comic_dates = array();
foreach ($comicpress_manager->comic_files as $comic_file) {
if (($result = $comicpress_manager->breakdown_comic_filename(pathinfo($comic_file, PATHINFO_BASENAME))) !== false) {
if (isset($all_comic_dates[$result['date']])) { $all_comic_dates_ok = false; break; }
$all_comic_dates[$result['date']] = true;
}
}
$subdir_path = '';
if (($subdir = $comicpress_manager->get_subcomic_directory()) !== false) {
$subdir_path .= '/' . $subdir;
}
?>
<!-- ComicPress details -->
<div id="comicpress-details">
<h2 style="padding-right: 0"><?php _e('ComicPress Details', 'comicpress-manager') ?></h2>
<ul style="padding-left: 30px; margin: 0">
<li><strong><?php _e("Configuration method:", 'comicpress-manager') ?></strong>
<?php if ($comicpress_manager->config_method == "comicpress-config.php") { ?>
<a href="?page=<?php echo plugin_basename(__FILE__) ?>-config"><?php echo $comicpress_manager->config_method ?></a>
<?php if ($comicpress_manager->can_write_config) { ?>
<?php _e('(click to edit)', 'comicpress-manager') ?>
<?php } else { ?>
<?php _e('(click to edit, cannot update automatically)', 'comicpress-manager') ?>
<?php } ?>
<?php } else { ?>
<?php echo $comicpress_manager->config_method ?>
<?php } ?>
</li>
<?php if (function_exists('get_site_option')) { ?>
<li><strong><?php _e("Available disk space:", 'comicpress-manager') ?></strong>
<?php printf(__("%0.2f MB"), cpm_wpmu_get_available_disk_space() / 1048576) ?>
<?php } ?>
<li><strong><?php _e('Comics folder:', 'comicpress-manager') ?></strong>
<?php
echo $comicpress_manager->properties['comic_folder'] . $subdir_path;
?><br />
<?php
$too_many_comics_message = "";
if (!$all_comic_dates_ok) {
ob_start(); ?>
, <a href="?page=<?php echo plugin_basename(__FILE__) ?>-status"><em><?php _e("multiple files on the same date!", 'comicpress-manager') ?></em></a>
<?php $too_many_comics_message = trim(ob_get_clean());
} ?>
<?php printf(__ngettext('(%d comic in folder%s)', '(%d comics in folder%s)', count($comicpress_manager->comic_files), 'comicpress-manager'), count($comicpress_manager->comic_files), $too_many_comics_message) ?>
</li>
<?php foreach (array('archive' => __('Archive folder:', 'comicpress-manager'),
'rss' => __('RSS feed folder:', 'comicpress-manager'))
as $type => $title) { ?>
<li><strong><?php echo $title ?></strong> <?php echo $comicpress_manager->properties["${type}_comic_folder"] . $subdir_path; ?>
<?php if (
($comicpress_manager->scale_method !== false) &&
($comicpress_manager->get_cpm_option("cpm-${type}-generate-thumbnails") == 1) &&
($comicpress_manager->separate_thumbs_folder_defined[$type]) &&
($comicpress_manager->thumbs_folder_writable[$type])
) { ?>
(<em><?php _e('generating', 'comicpress-manager') ?></em>)
<?php } else {
$reasons = array();
if ($comicpress_manager->scale_method == false) { $reasons[] = __("No scaling software", 'comicpress-manager'); }
if ($comicpress_manager->get_cpm_option("cpm-${type}-generate-thumbnails") == 0) {
$reasons[] = __("Generation disabled", 'comicpress-manager');
} else {
if (!$comicpress_manager->separate_thumbs_folder_defined[$type]) { $reasons[] = __("Same as comics folder", 'comicpress-manager'); }
if (!$comicpress_manager->thumbs_folder_writable[$type]) { $reasons[] = __("Not writable", 'comicpress-manager'); }
}
?>
(<em style="cursor: help; text-decoration: underline" title="<?php echo implode(", ", $reasons) ?>">not generating</em>)
<?php } ?>
</li>
<?php } ?>
<li><strong>
<?php
if (is_array($comicpress_manager->properties['comiccat']) && count($comicpress_manager->properties['comiccat']) != 1) {
_e("Comic categories:", 'comicpress-manager');
} else {
_e("Comic category:", 'comicpress-manager');
}
?></strong>
<?php if (is_array($comicpress_manager->properties['comiccat'])) { ?>
<ul>
<?php foreach ($comicpress_manager->properties['comiccat'] as $cat_id) { ?>
<li><a href="<?php echo get_category_link($cat_id) ?>"><?php echo get_cat_name($cat_id) ?></a>
<?php printf(__('(ID %s)', 'comicpress-manager'), $cat_id) ?></li>
<?php } ?>
</ul>
<?php } else { ?>
<a href="<?php echo get_category_link($comicpress_manager->properties['comiccat']) ?>"><?php echo $comicpress_manager->category_info['comiccat']['name'] ?></a>
<?php printf(__('(ID %s)', 'comicpress-manager'), $comicpress_manager->properties['comiccat']) ?>
<?php } ?>
</li>
<li><strong><?php _e('Blog category:', 'comicpress-manager') ?></strong> <a href="<?php echo get_category_link($comicpress_manager->properties['blogcat']) ?>" ?>
<?php echo $comicpress_manager->category_info['blogcat']['name'] ?></a> <?php printf(__('(ID %s)', 'comicpress-manager'), $comicpress_manager->properties['blogcat']) ?></li>
<?php if (!function_exists('get_site_option')) { ?>
<li><strong><?php _e("PHP Version:", 'comicpress-manager') ?></strong> <?php echo phpversion() ?>
<?php if (substr(phpversion(), 0, 3) < 5.2) { ?>
(<a href="http://gophp5.org/hosts"><?php _e("upgrade strongly recommended", 'comicpress-manager') ?></a>)
<?php } ?>
</li>
<li>
<strong><?php _e('Theme folder:', 'comicpress-manager') ?></strong>
<?php $theme_info = get_theme(get_current_theme());
if (!empty($theme_info['Template'])) {
echo $theme_info['Template'];
} else {
echo __("<em>Something's misconfigured with your theme...</em>", 'comicpress-manager');
} ?>
</li>
<?php if (count($comicpress_manager->detailed_warnings) != 0) { ?>
<li>
<strong><?php _e('Additional, non-fatal warnings:', 'comicpress-manager') ?></strong>
<ul>
<?php foreach ($comicpress_manager->detailed_warnings as $warning) { ?>
<li><?php echo $warning ?></li>
<?php } ?>
</ul>
</li>
<?php } ?>
<li>
<strong><a href="#" onclick="Element.show('debug-info'); $('cpm-right-column').style.minHeight = $('cpm-left-column').offsetHeight + 'px'; return false"><?php _e('Show debug info', 'comicpress-manager') ?></a></strong> (<em><?php _e("this data is sanitized to protect your server's configuration", 'comicpress-manager') ?></em>)
<?php echo cpm_show_debug_info() ?>
</li>
<?php } ?>
</ul>
</div>
<?php
}
/**
* Show the Latest Posts in the Sidebar.
*/
function cpm_show_latest_posts() {
global $comicpress_manager;
$is_current = false;
$is_previous = false;
$current_timestamp = time();
foreach ($comicpress_manager->query_posts() as $comic_post) {
$timestamp = strtotime($comic_post->post_date);
if ($timestamp < $current_timestamp) {
$is_current = true;
}
if ($is_current) {
if ($is_previous) {
$previous_post = $comic_post;
break;
}
$current_post = $comic_post;
$is_previous = true;
} else {
$upcoming_post = $comic_post;
}
}
$found_posts = compact('previous_post', 'current_post', 'upcoming_post');
$post_titles = array('previous_post' => __("Last Post", 'comicpress-manager'),
'current_post' => __("Current Post", 'comicpress-manager'),
'upcoming_post' => __("Upcoming Post", 'comicpress-manager'));
?>
<div id="comicpress-latest-posts">
<?php if (!empty($found_posts)) { ?>
<?php foreach ($post_titles as $key => $title) {
if (!empty($found_posts[$key])) {
$timestamp = strtotime($found_posts[$key]->post_date);
$post_date = date(CPM_DATE_FORMAT, $timestamp);
$comic_file = null;
foreach ($comicpress_manager->comic_files as $file) {
if (($result = $comicpress_manager->breakdown_comic_filename(pathinfo($file, PATHINFO_BASENAME))) !== false) {
if ($result['date'] == $post_date) { $comic_file = $file; break; }
}
}
?>
<div class="<?php echo (!empty($comic_file)) ? "comic-found" : "comic-not-found" ?>">
<h3><?php echo $title ?> &mdash; <?php echo $post_date ?></h3>
<h4><?php echo $found_posts[$key]->post_title ?> [<?php echo generate_view_edit_post_links((array)$found_posts[$key]) ?>]</h4>
<?php if (!empty($comic_file)) { ?>
<img alt="<?php echo $found_posts[$key]->post_title ?>" src="<?php echo $comicpress_manager->build_comic_uri($file, CPM_DOCUMENT_ROOT) ?>" width="320" />
<?php } else { ?>
<div class="alert">Comic file not found!</div>
<?php } ?>
</div>
<?php }
}
} else { ?>
<p>You don't have any comic posts!</p>
<?php } ?>
</div>
<?php
}
/**
* Show the footer.
*/
function cpm_show_footer() {
$version_string = "";
foreach (array('/', '/../') as $pathing) {
if (($path = realpath(dirname(__FILE__) . $pathing . 'comicpress-manager.php')) !== false) {
if (file_exists($path)) {
$info = get_plugin_data($path);
$version_string = sprintf(__("Version %s |", 'comicpress-manager'), $info['Version']);
break;
}
}
}
?>
<div id="cpm-footer">
<div id="cpm-footer-paypal">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHdwYJKoZIhvcNAQcEoIIHaDCCB2QCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBt5XgClPZfdf9s2CHnk4Ka5NQv+Aoswm3efVANJKvHR3h4msnSWwDzlJuve/JD5aE0rP4SRLnWuc4qIhOeeAP+MEGbs8WNDEPtUopmSy6aphnIVduSstqRWWSYElK5Wij/H8aJtiLML3rVBtiixgFBbj2HqD2JXuEgduepEvVMnDELMAkGBSsOAwIaBQAwgfQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIlFUk3PoXtLKAgdAjA3AjtLZz9ZnJslgJPALzIwYw8tMbNWvyJXWksgZRdfMw29INEcgMrSYoWNHY4AKpWMrSxUcx3fUlrgvPBBa1P96NcgKfJ6U0KwygOLrolH0JAzX0cC0WU3FYSyuV3BZdWyHyb38/s9AtodBFy26fxGqvwnwgWefQE5p9k66lWA4COoc3hszyFy9ZiJ+3PFtH/j8+5SVvmRUk4EUWBMopccHzLvkpN2WALLAU4RGKGfH30K1H8+t8E/+uKH1jt8p/N6p60jR+n7+GTffo3NahoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDkwMTA2MDAyOTQwWjAjBgkqhkiG9w0BCQQxFgQUITTqZaXyM43N5f08PBPDuRmzzdEwDQYJKoZIhvcNAQEBBQAEgYAV0szDQPbcyW/O9pZ7jUghTRdgHbCX4RyjPzR35IrI8MrqmtK94ENuD6Xf8PxkAJ3QdDr9OvkzWOHFVrb6YrAdh+XxBsMf1lD17UbwN3XZFn5HqvoWNFxNr5j3qx0DBsCh5RlGex+HAvtIoJu21uGRjbOQQsYFdlAPHxokkVP/Xw==-----END PKCS7-----
">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
<div id="cpm-footer-text">
<?php _e('<a href="http://wordpress.org/extend/plugins/comicpress-manager/" target="_new">ComicPress Manager</a> is built for the <a href="http://www.mindfaucet.com/comicpress/" target="_new">ComicPress</a> theme', 'comicpress-manager') ?> |
<?php _e('Copyright 2008-2009 <a href="mailto:john@coswellproductions.com?Subject=ComicPress Manager Comments">John Bintz</a>', 'comicpress-manager') ?> |
<?php _e('Released under the GNU GPL', 'comicpress-manager') ?> |
<?php echo $version_string ?>
<?php _e('<a href="http://bugs.comicpress.org/index.php?project=2">Report a Bug</a>', 'comicpress-manager') ?> |
<?php _e('Uses the <a target="_new" href="http://www.dynarch.com/projects/calendar/">Dynarch DHTML Calendar Widget</a>', 'comicpress-manager') ?>
</div>
</div>
<?php }
?>

View File

@ -0,0 +1,56 @@
<?php
// Select the level of access you want editors on your site to have.
$access_level = 10; // Administrator only
//$access_level = 5; // Editors only
//$access_level = 2; // Authors & Editors
define("CPM_SCALE_NONE", 0);
define("CPM_SCALE_IMAGEMAGICK", 1);
define("CPM_SCALE_GD", 2);
$result = get_option('comicpress-manager-cpm-date-format');
if (!empty($result)) {
define("CPM_DATE_FORMAT", $result);
} else {
define("CPM_DATE_FORMAT", "Y-m-d");
}
// for Windows users, your permissions will automatically be set to 0777 (writable).
// there is no easy way in PHP to modify permissions on an NTFS filesystem (and no
// permissions to speak of on FAT32!)
if (strpos(PHP_OS, "WIN") !== false) {
// for Windows users
define("CPM_FILE_UPLOAD_CHMOD", 0777);
} else {
$result = get_option('comicpress-manager-cpm-upload-permissions');
$chmod_to_use = 0664; // writable by owner and any group members (common)
if (!empty($result)) {
$requested_chmod_to_use = 0;
$strlen_result = strlen($result);
$is_ok = true;
for ($i = 0; $i < $strlen_result; ++$i) {
$char = $result{$strlen_result - 1 - $i};
if (preg_match('#[0-7]#', $char) > 0) {
$requested_chmod_to_use = $requested_chmod_to_use + ($char * pow(8, $i));
} else {
$is_ok = false;
}
}
if ($is_ok) {
$chmod_to_use = $requested_chmod_to_use;
}
}
define("CPM_FILE_UPLOAD_CHMOD", $chmod_to_use);
}
// CPM_DOCUMENT_ROOT override
$result = get_option("comicpress-manager-cpm-document-root");
if (!empty($result)) {
define('CPM_DOCUMENT_ROOT', untrailingslashit($result));
}
?>

View File

@ -0,0 +1,47 @@
<?php
global $blog_id;
if (!function_exists('add_action')) {
require_once("../../../wp-config.php");
}
if (WP_ADMIN) {
require_once('comicpress_manager_config.php');
require_once('classes/ComicPressManager.php');
$comicpress_manager = new ComicPressManager();
$comicpress_manager->read_information_and_check_config();
if (isset($_REQUEST['blog_id']) && function_exists('switch_to_blog')) {
switch_to_blog((int)$_REQUEST['blog_id']);
}
// TODO: handle different comic categories differently, this is still too geared
// toward one blog/one comic...
$all_post_dates = array();
foreach ($comicpress_manager->query_posts() as $comic_post) {
$all_post_dates[] = date(CPM_DATE_FORMAT, strtotime($comic_post->post_date));
}
$all_post_dates = array_unique($all_post_dates);
ob_start();
$missing_comic_count = 0;
foreach ($comicpress_manager->read_comics_folder() as $comic_file) {
$comic_file = pathinfo($comic_file, PATHINFO_BASENAME);
if (($result = $comicpress_manager->breakdown_comic_filename($comic_file)) !== false) {
if (!in_array($result['date'], $all_post_dates)) {
if (($post_hash = $comicpress_manager->generate_post_hash($result['date'],
$result['converted_title'],
array('in-comic-category' => array($comicpress_manager->properties['comiccat'])))) !== false) {
$missing_comic_count++;
}
}
}
}
header("X-JSON: {missing_posts: ${missing_comic_count}}");
ob_end_flush();
}
?>

View File

@ -0,0 +1,8 @@
<?php
/**
* Functions that are tested by test_comicpress_manager.php live here,
* to reduce the amount of WordPress simulation necessary for testing.
*/
?>

298
comicpress_styles.css Normal file
View File

@ -0,0 +1,298 @@
div#cpm-container {
padding: 10px;
padding-bottom: 0;
width: 955px
}
div#cpm-container.no-sidebar {
width: 100%;
padding: 0;
}
div#cpm-container h1 {
margin-top: 0;
margin-bottom: 5px;
}
div#cpm-container h2 {
margin-top: 0;
margin-bottom: 4px;
}
div#cpm-container div h2 {
padding-top: 0;
font-size: 20px;
font-style: normal;
font-weight: bold;
font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif
}
div#cpm-container h3 { margin-top: 0 }
div#cpm-container em { font-style: oblique }
div#cpm-container div#cpm-sidebar-column {
float: left;
display: inline;
width: 320px;
padding-top: 10px;
margin-left: 10px;
}
div#cpm-container div#cpm-activity-column {
float: left;
display: inline;
width: 625px;
}
div#cpm-container div#cpm-activity-column.no-sidebar {
margin-left: 0;
float: none;
display: block;
width: 100%
}
div#cpm-container div#comicpress-details {
border: solid #E3E3E3 1px;
background-color: #f1f1f1;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding: 10px;
}
div#cpm-container div#comicpress-details ul {
list-style-type: circle
}
div#cpm-container div#comicpress-help {
border: solid #464646 1px;
background-color: #b0b0b0;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding: 10px;
margin-top: 10px;
}
div#cpm-container div#config-editor {
border: solid #abc 1px;
background-color: #fed;
padding: 10px;
margin-top: 10px;
}
form#config-editor h3 {
margin-bottom: 5px;
margin-top: 5px;
}
form#config-editor table.form-table {
padding-bottom: 10px;
margin-top: 5px;
}
div#cpm-container div.activity-box {
overflow: hidden
}
div#cpm-container div.top-activity-box {
margin-top: 0;
}
div#cpm-container div#cpm-footer {
color: #777;
margin-top: 10px;
text-align: left;
clear: both;
overflow: hidden
}
div#cpm-footer-paypal {
width: 100px;
float: right;
display: inline;
text-align: right
}
div#zip-upload-warning {
border: solid red 1px;
background-color: #dcc;
margin: 5px;
padding: 5px;
}
div#image-preview {
margin: 5px;
padding: 5px;
background-color: #777;
border: solid black 2px
}
div#editor-toolbar {
text-align: right;
overflow: hidden
}
div#editor-toolbar a {
padding: 5px;
display: block;
float: right;
cursor: pointer;
cursor: hand;
}
div#editor-toolbar a.active {
background-color: #CEE1EF
}
form#config-editor input.update-config {
clear: both;
width: 295px;
}
.form-title {
font-weight: bold
}
form span.form-title {
width: 280px;
display: block;
position: absolute;
height: 30px;
}
form span.form-field {
width: 200px;
display: inline;
margin-left: 290px;
height: 30px;
}
table td {
padding-bottom: 5px
}
table input {
font-size: 12px;
border: solid black 1px;
padding: 1px;
}
#cpm-container h2 { padding-right: 0; }
#comicpress-details h3 {
color: #7f958a;
border-bottom: 1px solid #acb;
}
#comicpress-help h2 {
color: #333333;
border-color: #333333;
}
#categories-table { border-top: solid #aaa 1px }
#categories-table th { padding: 0 10px }
#categories-table td { border-top: solid #ddd 1px; }
.code-block {
background-color: white;
border:solid black 2px;
padding: 5px;
overflow: auto;
height: 300px;
font-family: 'courier new';
white-space: pre;
display: block
}
div.upload-holder {
text-align: center;
padding: 3px 0;
border-top: solid #ddd 1px;
}
div#cpm-messages, div#cpm-errors, div#cpm-warnings, div#import-count-information {
padding: 5px;
margin-bottom: 5px;
border-width: 1px;
border-style: solid
}
div#cpm-messages, div#import-count-information {
background-color: #ffe;
border-color: #ddc;
}
div#cpm-warnings {
background-color: #fee;
border-color: #dcc;
}
div#cpm-errors {
background-color: #330007;
border-color: #a00;
color: white
}
div#import-count-information {
text-align: center
}
div#first-run-holder {
border: solid #a77 1px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background-color: #fff0f0;
padding: 5px;
text-align: center;
margin-top: 10px
}
div#dashboard_quomicpress div.wrap {
margin: 0
}
div#dashboard_quomicpress div#cpm-container {
padding: 0
}
div#comicpress-latest-posts h3 {
text-align: center;
padding-top: 5px;
}
div#comicpress-latest-posts div.comic-found,
div#comicpress-latest-posts div.comic-not-found {
border-top: solid #aaa 1px;
padding: 0 5px 5px;
}
div#comicpress-latest-posts div.comic-not-found {
background-color: #ffe0e0
}
div#comicpress-latest-posts div.comic-not-found div.alert {
border: solid #a00 2px;
margin: 10px;
padding: 10px;
background-color: white;
text-align: center;
font-size: 18px;
font-weight: bold
}
tr.grey { background-color: #d4d4d4 }
table#status-table {
width: 100%
}
table#status-table td.comic {
background-color: #f3f3f3;
}
table#status-table td.post {
background-color: #e0e0e0;
}

View File

@ -0,0 +1,68 @@
<?php
$comicpress_configuration_options = array(
array(
'id' => 'comiccat',
'name' => 'Comic Category',
'type' => 'category',
'description' => 'The category ID of your comic category',
'default' => 1
),
array(
'id' => 'blogcat',
'name' => 'Blog Category',
'type' => 'category',
'description' => 'The category ID of your blog category',
'default' => 2
),
array(
'id' => 'comics_path',
'variable_name' => 'comic_folder',
'name' => 'Comic Folder',
'type' => 'folder',
'description' => 'The folder your comics are located in',
'default' => "comics",
'no_wpmu' => true
),
array(
'id' => 'comicsrss_path',
'variable_name' => 'rss_comic_folder',
'name' => 'RSS Comic Folder',
'type' => 'folder',
'description' => 'The folder your comics are located in for the RSS feed',
'default' => "comics-rss",
'no_wpmu' => true
),
array(
'id' => 'comicsarchive_path',
'variable_name' => 'archive_comic_folder',
'name' => 'Archive Comic Folder',
'type' => 'folder',
'description' => 'The folder your comics are located in for the Archive pages',
'default' => "comics-archive",
'no_wpmu' => true
),
array(
'id' => 'archive_comic_width',
'name' => 'Archive Comic Width',
'type' => 'integer',
'description' => 'The width your comics will appear on archive or search results',
'default' => "380"
),
array(
'id' => 'rss_comic_width',
'name' => 'RSS Comic Width',
'type' => 'integer',
'description' => 'The width your comics will appear in the RSS feed',
'default' => "380"
),
array(
'id' => 'blog_postcount',
'name' => 'Blog Post Count',
'type' => 'integer',
'description' => 'The number of blog entries to appear on the home page',
'default' => "10"
),
);
?>

View File

@ -0,0 +1,158 @@
<?php
// the list of all CPM configuration options that are saved to wp_options
$configuration_options = array(
'Basic Configuration',
array(
'id' => 'cpm-default-post-time',
'name' => "Default Post Time",
'type' => 'text',
'size' => 8,
'default' => '12:00am',
'message' => "Default time for comic posts to go live, cannot be blank. enter 'now' to always post at the current system time.",
'not_blank' => true
),
array(
'id' => 'cpm-default-post-content',
'name' => "Default Post Content",
'type' => 'textarea',
'message' => "Default content for comic posts"
),
array(
'id' => 'cpm-default-override-title',
'name' => "Default Post Title",
'type' => 'text',
'size' => 40,
'message' => "Default title for comic posts"
),
array(
'id' => 'cpm-default-post-tags',
'name' => "Default Post Tags",
'type' => 'text',
'size' => 40,
'message' => "Default tags for comic posts"
),
array(
'id' => 'cpm-default-comic-category-is-last-storyline',
'name' => "Default Comic Category is Last Storyline Category",
'type' => 'checkbox',
'default' => "1",
'message' => "If checked, the default comic cateogry for upload/import is the last category in the storyline"
),
array(
'id' => 'cpm-default-additional-categories',
'name' => "Default Additional Categories",
'type' => 'categories',
'message' => "Additional default categories for comic posts"
),
array(
'id' => 'cpm-archive-generate-thumbnails',
'name' => "Generate Archive Thumbnails?",
'type' => 'checkbox',
'default' => "1",
'message' => "If checked and server is configured correctly, generate archive thumbnails"
),
array(
'id' => 'cpm-rss-generate-thumbnails',
'name' => "Generate RSS Thumbnails?",
'type' => 'checkbox',
'default' => "1",
'message' => "If checked and server is configured correctly, generate RSS thumbnails"
),
array(
'id' => 'cpm-thumbnail-quality',
'name' => "Thumbnail Quality",
'type' => 'text',
'size' => 3,
'default' => "80",
'message' => "Quality of JPEG Thumbnails"
),
array(
'id' => 'cpm-strip-icc-profiles',
'name' => "Strip ICC Profiles",
'type' => 'checkbox',
'default' => "1",
'message' => "Strip ICC profiles from uploaded images. ImageMagick only.",
'imagemagick-only' => true
),
array(
'id' => 'cpm-obfuscate-filenames-on-upload',
'name' => "Obfuscate Filenames on Upload?",
'type' => 'dropdown',
'options' => "none:No obfuscation|append:Append code to title|replace:Replace title with code",
'default' => "none",
'message' => "add or replace the title of the image file with a random code to prevent nosy readers from looking ahead in your archive"
),
"Advanced Configuration",
array(
"id" => "cpm-skip-checks",
"name" => "Skip Checks?",
"type" => "checkbox",
'default' => "1",
"message" => "if you know your configuration is correct, enable this to improve performance. Enabling this also hides ComicPress version incompatibiity messages."
),
array(
"id" => "cpm-edit-post-integrate",
"name" => "Allow date change/deletions in Edit Post to affect associated comic files?",
"type" => "checkbox",
'default' => "1",
"message" => "if checked, working in Edit Post will affect your comic files"
),
array(
"id" => "cpm-sidebar-type",
"name" => "ComicPress Manager Sidebar:",
"type" => "dropdown",
'options' => 'standard:ComicPress Status and Help|latest:Latest Comic Posts|none:No Sidebar',
'default' => "standard",
"message" => "change the ComicPress Manager sidebar to a different default view"
),
array(
"id" => "cpm-date-format",
"name" => "ComicPress Manager Date Format",
"type" => "text",
"size" => 12,
'default' => "Y-m-d",
"message" => "if you've hacked on ComicPress to support a different date format, change it here"
),
array(
"id" => "cpm-perform-gd-check",
"name" => "Check uploaded files using GD?",
"type" => "checkbox",
'default' => "1",
"message" => "enable this to check if uploaded files are valid images using the GD library"
),
array(
"id" => "cpm-enable-dashboard-rss-feed",
"name" => "Enable the ComicPress RSS Feed on the Dashboard?",
"type" => "checkbox",
'default' => "1",
"message" => "enable this to get the latest ComicPress news on your Dashboard"
),
array(
"id" => "cpm-enable-quomicpress",
"name" => "Enable the QuomicPress (Quick ComicPress) panel on the Dashboard?",
"type" => "checkbox",
'default' => "1",
"message" => "enable this to use the QuomicPress (Quick ComicPress) posting box on your Dashboard"
),
array(
"id" => "cpm-upload-permissions",
"name" => "Unix chmod permissions to assign to uploaded files?",
"type" => "text",
"size" => 5,
"strip-wpmu" => true,
'default' => "664",
"message" => "if you're on a Unix-like operating system, and need to have files uploaded with specific permissions, enter them in here. Windows systems always upload with chmod 777"
),
array(
"id" => "cpm-document-root",
"name" => "Specify a WordPress DOCUMENT_ROOT",
"type" => "text",
"strip-wpmu" => true,
"size" => 30,
"message" => "if ComicPress Manager isn't able to automatically find the path to your index.php file and comics folders, enter in the proper absolute path here"
),
);
?>

46
js/comicpress_dates.js Normal file
View File

@ -0,0 +1,46 @@
function pad(s, l) { s = "0000" + (s + ""); return s.substr(s.length - l, l); }
function get_date_string(date) {
return date.getFullYear() + "-" + pad(date.getMonth() + 1, 2) + "-" + pad(date.getDate(), 2);
}
function reschedule_posts(start) {
var start_processing = false;
var interval = null;
var current_date = null;
var current_interval = 0;
for (var i = 0, l = comic_files_keys.length; i < l; ++i) {
if (start_processing) {
current_date += (interval[current_interval] * 86400 * 1000);
current_interval = (current_interval + 1) % interval.length;
date_string = get_date_string(new Date(current_date));
$('dates[' + comic_files_keys[i] + ']').value = date_string;
$('holder-' + comic_files_keys[i]).style.backgroundColor = "#ddd";
}
if (comic_files_keys[i] == start) {
start_processing = true;
interval = prompt(days_between_posts_message, "7");
if (interval !== null) {
var all_valid = true;
var parts = interval.split(",");
for (var j = 0, jl = parts.length; j < jl; ++j) {
if (!parts[j].toString().match(/^\d+$/)) { all_valid = false; break; }
}
if (all_valid) {
interval = parts;
date_parts = $F('dates[' + comic_files_keys[i] + ']').split("-");
current_date = Date.UTC(date_parts[0], date_parts[1] - 1, date_parts[2], 2) + 86400 * 1000;
} else {
alert(interval + " " + valid_interval_message);
break;
}
} else {
break;
}
}
}
}

165
js/comicpress_script.js Normal file
View File

@ -0,0 +1,165 @@
/**
* hide/show the new post holder box depending on the status of the checkbox.
*/
function hide_show_checkbox_holder(which, reverse) {
if (reverse !== true) { reverse = false; }
($(which + '-checkbox').checked !== reverse) ? new Effect.Appear(which + '-holder') : new Effect.BlindUp(which + '-holder');
}
function setup_hide_show_checkbox_holder(which) {
Event.observe(which + '-checkbox', 'click', function() { hide_show_checkbox_holder(which) });
hide_show_checkbox_holder(which);
}
function hide_show_div_on_checkbox(div, checkbox, flip_behavior) {
if ($(checkbox) && $(div)) {
ok = (flip_behavior) ? !$(checkbox).checked : $(checkbox).checked;
(ok) ? new Effect.Appear(div) : new Effect.BlindUp(div);
}
}
/**
* Show the preview image for deleting an image.
*/
function change_image_preview() {
var which = $F('delete-comic-dropdown');
$('image-preview').innerHTML = '<img src="' + which + '" width="420" />';
}
var current_file_index = 0;
var current_file_upload_count = 0;
var on_change_file_upload_count = null;
/**
* Add a file upload field.
*/
function add_file_upload() {
var field = "<div class=\"upload-holder\" id=\"upload-holder-" + current_file_index + "\">";
field += messages['add_file_upload_file'] + "<input size=\"35\" type=\"file\" name=\"upload-" + current_file_index + "\" />";
field += " [<a href=\"#\" onclick=\"remove_file_upload('" + current_file_index + "');\">" + messages['add_file_upload_remove'] + "</a>]";
field += "</div>";
Element.insert('multiple-file-upload', { bottom: field });
current_file_index++;
current_file_upload_count++;
if (on_change_file_upload_count) { on_change_file_upload_count(current_file_upload_count); }
}
function remove_file_upload(which) {
Element.remove('upload-holder-' + which);
current_file_upload_count--;
if (on_change_file_upload_count) { on_change_file_upload_count(current_file_upload_count); }
}
// page startup code
function prepare_comicpress_manager() {
if ($('multiple-new-post-checkbox')) {
setup_hide_show_checkbox_holder("multiple-new-post");
add_file_upload();
hide_show_div_on_checkbox('override-title-holder', 'override-title');
hide_show_div_on_checkbox('thumbnail-write-holder', 'no-thumbnails', true);
var add_to_tags = function(href) {
var all_tags = [];
if (!$F('tags').empty()) {
all_tags = $F('tags').replace(new RegExp("s*\,\s*"), ",").split(",");
}
if (all_tags.indexOf(href.innerHTML) == -1) {
all_tags.push(href.innerHTML);
}
$('tags').value = all_tags.join(",");
}
$$('a.tag').each(function(href) {
Event.observe(href, 'click', function(e) {
Event.stop(e);
add_to_tags(href);
});
});
}
var handle_show_rebuild_thumbnails = function(e) {
(($F('overwrite-existing-file-choice') != "") && ($F('upload-destination') == "comic")) ? $('rebuild-thumbnails').show() : $('rebuild-thumbnails').hide();
};
if ($('overwrite-existing-file-choice')) {
Event.observe('overwrite-existing-file-choice', 'change', handle_show_rebuild_thumbnails);
handle_show_rebuild_thumbnails();
}
if ($('replace-comic-rebuild-thumbnails') && $('thumbnails')) {
Event.observe($('replace-comic-rebuild-thumbnails'), 'click', function(e) {
$('thumbnails').checked = $('replace-comic-rebuild-thumbnails').checked;
});
}
if ($('upload-destination')) {
var toggle_upload_destination_holder = function() {
if ($F('overwrite-existing-file-choice') == "") {
if ($('upload-destination').options[$('upload-destination').selectedIndex].value == "comic") {
new Effect.Appear('upload-destination-holder');
} else {
new Effect.BlindUp('upload-destination-holder');
}
} else {
new Effect.BlindUp('upload-destination-holder');
}
handle_show_rebuild_thumbnails();
};
Event.observe('upload-destination', 'change', toggle_upload_destination_holder);
toggle_upload_destination_holder();
on_change_file_upload_count = function(count) {
if (count == 1) {
new Effect.Appear('specify-date-holder');
new Effect.Appear('overwrite-existing-holder');
} else {
new Effect.BlindUp('specify-date-holder');
new Effect.BlindUp('overwrite-existing-holder');
toggle_upload_destination_holder();
}
}
if ($('overwrite-existing-file-choice')) {
Event.observe('overwrite-existing-file-choice', 'change', function() {
toggle_upload_destination_holder();
});
}
}
if ($('count-missing-posts-clicker')) {
hide_show_div_on_checkbox('override-title-holder', 'override-title');
hide_show_div_on_checkbox('thumbnail-write-holder', 'no-thumbnails', true);
Event.observe('count-missing-posts-clicker', 'click', function() {
$('missing-posts-display').innerHTML = "..." + messages['count_missing_posts_counting'] + "...";
new Ajax.Request(ajax_request_uri,
{
method: 'post',
parameters: {
action: "count-missing-posts"
},
onSuccess: function(transport) {
if (transport.headerJSON) {
$('missing-posts-display').innerHTML = transport.headerJSON.missing_posts;
} else {
$('missing-posts-display').innerHTML = messages['count_missing_posts_none_missing'];
}
},
onFailure: function(transport) {
$('missing-posts-display').innerHTML = messages['failure_in_counting_posts'];
}
}
);
return false;
});
}
if ($('image-preview')) { change_image_preview(); }
}

63
js/comicpress_status.js Normal file
View File

@ -0,0 +1,63 @@
var active_filters = {};
function toggle_filter(id) {
if (active_filters[id] === undefined) { active_filters[id] = false; }
active_filters[id] = !active_filters[id];
var any_filters_active = false;
for (var key in active_filters) {
if (active_filters[key] === true) {
any_filters_active = true; break;
}
}
if (top.console && top.console.log) {
top.console.log(active_filters);
}
var rows = document.getElementsByClassName('data-row');
for (var i = 0, il = rows.length; i < il; ++i) {
if (any_filters_active) {
var filter_active = false;
for (var key in active_filters) {
if (top.console && top.console.log) {
top.console.log(key);
}
if (active_filters[key] === true) {
if (rows[i].hasClassName(key)) {
filter_active = true; break;
}
}
}
if (top.console && top.console.log) {
top.console.log(i + ": " + filter_active);
}
if (filter_active) {
Element.show(rows[i]);
} else {
Element.hide(rows[i]);
}
} else {
Element.show(rows[i]);
}
}
for (var key in active_filters) {
var target = $(key);
if (active_filters[key] === true) {
if (!Element.hasClassName(target, 'enabled')) { Element.addClassName(target, 'enabled'); }
} else {
if (Element.hasClassName(target, 'enabled')) { Element.removeClassName(target, 'enabled'); }
}
}
}
function setup_status_togglers() {
var togglers = document.getElementsByClassName('toggler');
for (var i = 0; i < togglers.length; ++i) {
Event.observe(togglers[i], 'click', function(e) {
var element = Event.element(e);
toggle_filter(element.id);
});
}
}

View File

@ -0,0 +1,6 @@
function pad(s,l){s="0000"+(s+"");return s.substr(s.length-l,l);}
function get_date_string(date){return date.getFullYear()+"-"+pad(date.getMonth()+1,2)+"-"+pad(date.getDate(),2);}
function reschedule_posts(start){var start_processing=false;var interval=null;var current_date=null;var current_interval=0;for(var i=0,l=comic_files_keys.length;i<l;++i){if(start_processing){current_date+=(interval[current_interval]*86400*1000);current_interval=(current_interval+1)%interval.length;date_string=get_date_string(new Date(current_date));$('dates['+comic_files_keys[i]+']').value=date_string;$('holder-'+comic_files_keys[i]).style.backgroundColor="#ddd";}
if(comic_files_keys[i]==start){start_processing=true;interval=prompt(days_between_posts_message,"7");if(interval!==null){var all_valid=true;var parts=interval.split(",");for(var j=0,jl=parts.length;j<jl;++j){if(!parts[j].toString().match(/^\d+$/)){all_valid=false;break;}}
if(all_valid){interval=parts;date_parts=$F('dates['+comic_files_keys[i]+']').split("-");current_date=Date.UTC(date_parts[0],date_parts[1]-1,date_parts[2],2)+86400*1000;}else{alert(interval+" "+valid_interval_message);break;}}else{break;}}}}

View File

@ -0,0 +1,19 @@
function hide_show_checkbox_holder(which,reverse){if(reverse!==true){reverse=false;}
($(which+'-checkbox').checked!==reverse)?new Effect.Appear(which+'-holder'):new Effect.BlindUp(which+'-holder');}
function setup_hide_show_checkbox_holder(which){Event.observe(which+'-checkbox','click',function(){hide_show_checkbox_holder(which)});hide_show_checkbox_holder(which);}
function hide_show_div_on_checkbox(div,checkbox,flip_behavior){if($(checkbox)&&$(div)){ok=(flip_behavior)?!$(checkbox).checked:$(checkbox).checked;(ok)?new Effect.Appear(div):new Effect.BlindUp(div);}}
function change_image_preview(){var which=$F('delete-comic-dropdown');$('image-preview').innerHTML='<img src="'+which+'" width="420" />';}
var current_file_index=0;var current_file_upload_count=0;var on_change_file_upload_count=null;function add_file_upload(){var field="<div class=\"upload-holder\" id=\"upload-holder-"+current_file_index+"\">";field+=messages['add_file_upload_file']+"<input size=\"35\" type=\"file\" name=\"upload-"+current_file_index+"\" />";field+=" [<a href=\"#\" onclick=\"remove_file_upload('"+current_file_index+"');\">"+messages['add_file_upload_remove']+"</a>]";field+="</div>";Element.insert('multiple-file-upload',{bottom:field});current_file_index++;current_file_upload_count++;if(on_change_file_upload_count){on_change_file_upload_count(current_file_upload_count);}}
function remove_file_upload(which){Element.remove('upload-holder-'+which);current_file_upload_count--;if(on_change_file_upload_count){on_change_file_upload_count(current_file_upload_count);}}
function prepare_comicpress_manager(){if($('multiple-new-post-checkbox')){setup_hide_show_checkbox_holder("multiple-new-post");add_file_upload();hide_show_div_on_checkbox('override-title-holder','override-title');hide_show_div_on_checkbox('thumbnail-write-holder','no-thumbnails',true);var add_to_tags=function(href){var all_tags=[];if(!$F('tags').empty()){all_tags=$F('tags').replace(new RegExp("s*\,\s*"),",").split(",");}
if(all_tags.indexOf(href.innerHTML)==-1){all_tags.push(href.innerHTML);}
$('tags').value=all_tags.join(",");}
$$('a.tag').each(function(href){Event.observe(href,'click',function(e){Event.stop(e);add_to_tags(href);});});}
var handle_show_rebuild_thumbnails=function(e){(($F('overwrite-existing-file-choice')!="")&&($F('upload-destination')=="comic"))?$('rebuild-thumbnails').show():$('rebuild-thumbnails').hide();};if($('overwrite-existing-file-choice')){Event.observe('overwrite-existing-file-choice','change',handle_show_rebuild_thumbnails);handle_show_rebuild_thumbnails();}
if($('replace-comic-rebuild-thumbnails')&&$('thumbnails')){Event.observe($('replace-comic-rebuild-thumbnails'),'click',function(e){$('thumbnails').checked=$('replace-comic-rebuild-thumbnails').checked;});}
if($('upload-destination')){var toggle_upload_destination_holder=function(){if($F('overwrite-existing-file-choice')==""){if($('upload-destination').options[$('upload-destination').selectedIndex].value=="comic"){new Effect.Appear('upload-destination-holder');}else{new Effect.BlindUp('upload-destination-holder');}}else{new Effect.BlindUp('upload-destination-holder');}
handle_show_rebuild_thumbnails();};Event.observe('upload-destination','change',toggle_upload_destination_holder);toggle_upload_destination_holder();on_change_file_upload_count=function(count){if(count==1){new Effect.Appear('specify-date-holder');new Effect.Appear('overwrite-existing-holder');}else{new Effect.BlindUp('specify-date-holder');new Effect.BlindUp('overwrite-existing-holder');toggle_upload_destination_holder();}}
if($('overwrite-existing-file-choice')){Event.observe('overwrite-existing-file-choice','change',function(){toggle_upload_destination_holder();});}}
if($('count-missing-posts-clicker')){hide_show_div_on_checkbox('override-title-holder','override-title');hide_show_div_on_checkbox('thumbnail-write-holder','no-thumbnails',true);Event.observe('count-missing-posts-clicker','click',function(){$('missing-posts-display').innerHTML="..."+messages['count_missing_posts_counting']+"...";new Ajax.Request(ajax_request_uri,{method:'post',parameters:{action:"count-missing-posts"},onSuccess:function(transport){if(transport.headerJSON){$('missing-posts-display').innerHTML=transport.headerJSON.missing_posts;}else{$('missing-posts-display').innerHTML=messages['count_missing_posts_none_missing'];}},onFailure:function(transport){$('missing-posts-display').innerHTML=messages['failure_in_counting_posts'];}});return false;});}
if($('image-preview')){change_image_preview();}}

View File

@ -0,0 +1,10 @@
var active_filters={};function toggle_filter(id){if(active_filters[id]===undefined){active_filters[id]=false;}
active_filters[id]=!active_filters[id];var any_filters_active=false;for(var key in active_filters){if(active_filters[key]===true){any_filters_active=true;break;}}
if(top.console&&top.console.log){top.console.log(active_filters);}
var rows=document.getElementsByClassName('data-row');for(var i=0,il=rows.length;i<il;++i){if(any_filters_active){var filter_active=false;for(var key in active_filters){if(top.console&&top.console.log){top.console.log(key);}
if(active_filters[key]===true){if(rows[i].hasClassName(key)){filter_active=true;break;}}}
if(top.console&&top.console.log){top.console.log(i+": "+filter_active);}
if(filter_active){Element.show(rows[i]);}else{Element.hide(rows[i]);}}else{Element.show(rows[i]);}}
for(var key in active_filters){var target=$(key);if(active_filters[key]===true){if(!Element.hasClassName(target,'enabled')){Element.addClassName(target,'enabled');}}else{if(Element.hasClassName(target,'enabled')){Element.removeClassName(target,'enabled');}}}}
function setup_status_togglers(){var togglers=document.getElementsByClassName('toggler');for(var i=0;i<togglers.length;++i){Event.observe(togglers[i],'click',function(e){var element=Event.element(e);toggle_filter(element.id);});}}

761
jscalendar-1.0/ChangeLog Normal file
View File

@ -0,0 +1,761 @@
2005-03-07 Mihai Bazon <mihai_bazon@yahoo.com>
* skins/aqua/theme.css: *** empty log message ***
* release-notes.html: updated release notes
* calendar-setup.js:
use a better approach to initialize the calendar--don't call _init twice,
it's the most time consuming function in the calendar. Instead, determine
the date beforehand if possible and pass it to the calendar at constructor.
* calendar.js:
avoid keyboard operation when 'multiple dates' is set (very buggy for now)
* calendar.js:
fixed keyboard handling problems: now it works fine when "showsOtherMonths"
is passed; it also seems to be fine with disabled dates (won't normally
allow selection)--however this area is still likely to be buggy, i.e. in a
month that has all the dates disabled.
* calendar.js:
some trivial performance improvements in the _init function
Added Date.parseDate (old Calendar.prototype.parseDate now calls this one)
2005-03-05 Mihai Bazon <mihai_bazon@yahoo.com>
* release-notes.html: updated release notes
* dayinfo.html: *** empty log message ***
* calendar-setup.js:
bugfix--update an inputField even if flat calendar is selected
* calendar.js:
fixed bugs in parseDate function (if for some reason the input string is
totally broken, then check numbers for NaN and use values from the current
date instead)
* make-release.pl: copy the skins subdirectory and all skins
* index.html: added Aqua skin
* skins/aqua/active-bg.gif, skins/aqua/dark-bg.gif, skins/aqua/hover-bg.gif, skins/aqua/menuarrow.gif, skins/aqua/normal-bg.gif, skins/aqua/rowhover-bg.gif, skins/aqua/status-bg.gif, skins/aqua/theme.css, skins/aqua/title-bg.gif, skins/aqua/today-bg.gif:
in the future, skins will go to this directory, each in a separate subdir; for now there's only Aqua, an excellent new skin
* calendar.js: workaround IE bug, needed in the Aqua theme
don't hide select elements unless browser is IE or Opera
* lang/calendar-bg.js, lang/calendar-big5-utf8.js, lang/calendar-big5.js, lang/calendar-br.js, lang/calendar-ca.js, lang/calendar-cs-utf8.js, lang/calendar-cs-win.js, lang/calendar-da.js, lang/calendar-de.js, lang/calendar-el.js, lang/calendar-en.js, lang/calendar-es.js, lang/calendar-fi.js, lang/calendar-fr.js, lang/calendar-he-utf8.js, lang/calendar-hu.js, lang/calendar-it.js, lang/calendar-ko-utf8.js, lang/calendar-ko.js, lang/calendar-lt-utf8.js, lang/calendar-lt.js, lang/calendar-lv.js, lang/calendar-nl.js, lang/calendar-no.js, lang/calendar-pl-utf8.js, lang/calendar-pl.js, lang/calendar-pt.js, lang/calendar-ro.js, lang/calendar-ru.js, lang/calendar-ru_win_.js, lang/calendar-si.js, lang/calendar-sk.js, lang/calendar-sp.js, lang/calendar-sv.js, lang/calendar-zh.js, lang/cn_utf8.js:
updated urls, copyright notices
* doc/reference.tex: updated documentation
* calendar.js, index.html:
renamed the global variable to _dynarch_popupCalendar to avoid name clashes
* multiple-dates.html: start with an empty array
* calendar.js:
fixed bugs in the time selector (12:XX pm was wrongfully understood as 12:XX am)
* calendar.js:
using innerHTML instead of text nodes; works better in Safari and also makes
a smaller, cleaner code
2005-03-04 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar.js:
fixed a performance regression that occurred after adding support for multiple dates
fixed the time selection bug (now it keeps time correctly)
clicking today will close the calendar if "today" is already selected
* lang/cn_utf8.js: new translation
2005-02-17 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-ar-utf8.zip: Added arabic translation
2004-10-19 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-zh.js: updated
2004-09-20 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-no.js: updated (Daniel Holmen)
2004-09-20 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-no.js: updated (Daniel Holmen)
2004-08-11 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-nl.js: updated language file (thanks to Arjen Duursma)
* lang/calendar-sp.js: updated (thanks to Rafael Velasco)
2004-07-21 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-br.js: updated
* calendar-setup.js: fixed bug (dateText)
2004-07-21 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-br.js: updated
* calendar-setup.js: fixed bug (dateText)
2004-07-04 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-lv.js:
added LV translation (thanks to Juris Valdovskis)
2004-06-25 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar.js:
fixed bug in IE (el.calendar.tooltips is null or not an object)
2004-06-24 Mihai Bazon <mihai_bazon@yahoo.com>
* doc/reference.tex: fixed latex compilation
* index.html: linking other sample files
* calendar-setup.js, calendar.js, dayinfo.html:
ability to display day info (dateText parameter) + sample file
2004-06-23 Mihai Bazon <mihai_bazon@yahoo.com>
* doc/reference.tex, lang/calendar-bg.js, lang/calendar-br.js, lang/calendar-ca.js, lang/calendar-en.js, lang/calendar-es.js, lang/calendar-fr.js, lang/calendar-it.js, lang/calendar-ko-utf8.js, lang/calendar-ko.js, lang/calendar-nl.js, lang/calendar-sv.js, README, calendar.js, index.html:
email address changed
2004-06-14 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-cs-utf8.js, lang/calendar-cs-win.js:
updated translations
* calendar-system.css: added z-index to drop downs
* lang/calendar-en.js:
first day of week can now be part of the language file
* lang/calendar-es.js:
updated language file (thanks to Servilio Afre Puentes)
* calendar-blue2.css, calendar-brown.css, calendar-green.css, calendar-tas.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css, calendar-blue.css:
added z-index property to drop downs (fixes bug)
2004-06-13 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar-setup.js: fixed bug (apply showOthers to flat calendars too)
2004-06-06 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar-setup.js:
firstDay defaults to "null", in which case the value in the language file
will be used
* calendar.js:
firstDayOfWeek can now default to a value specified in the language definition file
* index.html: first day of week is now numeric
2004-06-02 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar.js: added date tooltip function
2004-05-28 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-br.js: updated (thanks to Marcos Pont)
* calendar-setup.js: fixed small bug
2004-05-01 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar-setup.js: returns the calendar object
2004-04-28 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar-setup.js:
patch to read the date value from the inputField, according to ifFormat (if
both are passed), for flat calendars. (thanks Colin T. Hill)
2004-04-20 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar-setup.js, calendar.js, multiple-dates.html:
added support for multiple dates selection
* lang/calendar-nl.js:
updated Dutch translation, thanks to Jeroen Wolsink
* lang/calendar-big5-utf8.js, lang/calendar-big5.js:
Traditional Chinese language (thanks GaryFu)
2004-03-26 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-fr.js, lang/calendar-pt.js: updated
* lang/calendar-ru_win_.js, lang/calendar-ru.js:
updated, thanks to Sly Golovanov
2004-03-25 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-fr.js: updated (thanks to David Duret)
2004-03-24 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-da.js: updated (thanks to Michael Thingmand Henriksen)
2004-03-21 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-ca.js: updated (thanks to David Valls)
2004-03-17 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-de.js: updated to UTF8 (thanks to Jack (tR))
2004-03-09 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-bg.js: Bulgarian translation
2004-03-08 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-he-utf8.js: Hebrew translation (thanks to Idan Sofer)
* lang/calendar-hu.js: updated (thanks to Istvan Karaszi)
2004-02-27 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-it.js: updated (thanks to Fabio Di Bernardini)
2004-02-25 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar.js: fix for Safari (thanks to Olivier Chirouze / XPWeb)
2004-02-22 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-al.js: Albanian language file
2004-02-17 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-fr.js: fixed
* lang/calendar-fr.js:
FR translation updated (thanks to SIMON Alexandre)
* lang/calendar-es.js: ES translation updated, thanks to David Gonzales
2004-02-10 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-pt.js:
updated Portugese translation, thanks to Elcio Ferreira
2004-02-09 Mihai Bazon <mihai_bazon@yahoo.com>
* TODO: updated
2004-02-06 Mihai Bazon <mihai_bazon@yahoo.com>
* README: describe the PHP files
* make-release.pl: includes php files
* make-release.pl: ChangeLog included in the distribution (if found)
* calendar.js, doc/reference.tex, index.html: switched to version 0.9.6
* doc/Calendar.setup.tex, doc/reference.tex: updated documentation
* release-notes.html: updated release notes
* calendar.js: Fixed bug: Feb/29 and year change now keeps Feb in view
* calendar.js: fixed the "ESC" problem (call the close handler)
* calendar.js: fixed day of year range (1 to 366 instead of 0 to 365)
* calendar.js: fixed week number calculations
* doc/reference.tex: fixed (date input format)
* calendar.php: removed comment
* calendar-blue.css, calendar-blue2.css, calendar-brown.css, calendar-green.css, calendar-system.css, calendar-tas.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css, calendar.js:
workaround for IE bug (you can't normally specify through CSS the style for
an element having two classes or more; we had to change a classname)
* calendar-blue.css, calendar-blue2.css, calendar-brown.css, calendar-green.css, calendar-system.css, calendar-tas.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css:
smaller fonts on days that are in neighbor months
2004-02-04 Mihai Bazon <mihai_bazon@yahoo.com>
* index.html: first demo shows the "showOtherMonths" capability
* calendar-setup.js: support new parameters in the calendar.
added: firstDay, showOthers, cache.
* calendar-blue.css, calendar-blue2.css, calendar-brown.css, calendar-green.css, calendar-system.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css, calendar.js, lang/calendar-en.js, lang/calendar-ro.js:
new parameters: firstDayOfWeek, showsOtherMonths; removed mondayFirst.
This adds support for setting any day to be the first day of week (by just
clicking the day name in the display); also, if showsOtherMonths is enabled
then dates belonging to adjacent months that are in the current view will be
displayed and the calendar will have a fixed height.
all themes updated.
* test.php: test for calendar.php
* calendar.php: fixed bug (pass numeric values as numbers)
2004-02-01 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar.php: added PHP wrapper
* img.gif: icon updated
* TODO: updated TODO list
2004-01-27 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar.js:
Janusz Piwowarski sent over a patch for IE5 compatibility which is much more
elegant than the atrocities that I had wrote :-D I'm gettin' old.. Thanks Janusz!
* lang/calendar-fi.js: updated
2004-01-15 Mihai Bazon <mihai_bazon@yahoo.com>
* TODO: updated TODO list
* calendar-setup.js: default align changed to "Br"
* doc/reference.tex: changed default value for "align"
* calendar-setup.js: calling onchange event handler, if available
* calendar-setup.js: added "position" option
* simple-1.html: demonstrates "step" option
* calendar-setup.js: added "step" option
* calendar.js: added yearStep config parameter
* calendar.js:
fixed parseDate routine (the NaN bug which occurred when there was a space
after the date and no time)
2004-01-14 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-en.js: added "Time:"
* test-position.html: test for the new position algorithm
* index.html: do not destroy() the calendar
avoid bug in parseDate (%p must be separated by non-word characters)
* menuarrow2.gif: for calendar-blue2.css
* calendar-setup.js: honor "date" parameter if passed
* calendar.js: IE5 support is back
performance improvements in IE6 (mouseover combo boxes)
display "Time:" beside the clock area, if defined in the language file
new positioning algorithm (try to keep the calendar in page)
rewrote parseDate a little cleaner
* lang/calendar-el.js:
updated Greek translation (thanks Alexandros Pappas)
2004-01-13 Mihai Bazon <mihai_bazon@yahoo.com>
* index.html: added style blue2, using utf-8 instead of iso-8859-2
* calendar.js: performance under IE (which sucks, by the way)
* doc/reference.tex: Sunny added to sponsor list
* doc/Calendar.setup.tex: documenting parameter 'electric'
* calendar-blue.css, calendar-blue2.css, calendar-brown.css, calendar-green.css, calendar-system.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css:
fixed IE text size problems
2004-01-08 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-pl.js:
Polish translation updated to UTF-8 (thanks to Artur Filipiak)
2004-01-07 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-si.js: updated (David Milost)
* lang/calendar-si.js: Slovenian translation (thanks to David Milost)
2003-12-21 Mihai Bazon <mihai_bazon@yahoo.com>
* TODO: updated TODO list
* lang/calendar-de.js: German translation (thanks to Peter Strotmann)
2003-12-19 Mihai Bazon <mihai_bazon@yahoo.com>
* doc/reference.tex: Thank you, Ian Barrak
2003-12-18 Mihai Bazon <mihai_bazon@yahoo.com>
* doc/reference.tex: fixed documentation bug (thanks Mike)
2003-12-05 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-ko-utf8.js:
UTF8 version of the Korean language (hopefully correct)
* lang/calendar-pl-utf8.js, lang/calendar-pl.js:
updated Polish translation (thanks to Janusz Piwowarski)
2003-12-04 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-fr.js:
French translation updated (thanks to Angiras Rama)
2003-11-22 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-da.js: updated (thanks to Jesper M. Christensen)
2003-11-20 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar-blue2.css, calendar-tas.css:
new styles (thanks to Wendall Mosemann for blue2, Mark Lynch for tas)
* lang/calendar-lt-utf8.js, lang/calendar-lt.js:
Lithuanian translation (thanks to Martynas Majeris)
* lang/calendar-sp.js: updated
2003-11-17 Mihai Bazon <mihai_bazon@yahoo.com>
* TODO: added TODO list
2003-11-14 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-ko.js: Korean translation (thanks to Yourim Yi)
2003-11-12 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-jp.js: small bug fixed (thanks to TAHARA Yusei)
2003-11-10 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-fr.js: translation updated, thanks to Florent Ramiere
* calendar-setup.js:
added new parameter: electric (if false then the field will not get updated on each move)
* index.html: fixed DOCTYPE
2003-11-07 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar-setup.js:
fixed minor problem (maybe we're passing object reference instead of ID for
the flat calendar parent)
2003-11-06 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-fi.js:
added Finnish translation (thanks to Antti Tuppurainen)
2003-11-05 Mihai Bazon <mihai_bazon@yahoo.com>
* release-notes.html: fixed typo
* doc/reference.tex, index.html, calendar.js: 0.9.5
* README: fixed license statement
* release-notes.html: updated release notes (0.9.5)
2003-11-03 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-de.js:
updated German translation (thanks to Gerhard Neiner)
* calendar-setup.js: fixed license statement
* calendar.js: whitespace
* calendar.js: fixed license statement
* calendar.js:
fixed positioning problem when input field is inside scrolled divs
2003-11-01 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-af.js: Afrikaan language (thanks to Derick Olivier)
2003-10-31 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-it.js:
updated IT translation (thanks to Christian Blaser)
* lang/calendar-es.js: updated ES translation, thanks to Raul
2003-10-30 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-hu.js: updated thanks to Istvan Karaszi
* index.html, simple-1.html, simple-2.html, simple-3.html:
switched to utf-8 all encodings
* lang/calendar-sk.js:
added Slovak translation (thanks to Peter Valach)
* lang/calendar-ro.js: switched to utf-8
2003-10-29 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-es.js:
updated translation, thanks to Jose Ma. Martinez Miralles
* doc/reference.tex:
fixed the footnote problem (thanks Dominique de Waleffe for the tip)
* lang/calendar-ro.js: fixed typo
* lang/calendar-sv.js: oops, license should be LGPL
* lang/calendar-sw.js: new swedish translation is calendar-sv.js
* menuarrow.gif, menuarrow.png:
oops, forgot little drop-down menu arrows
* lang/calendar-sv.js: swedish translation thanks to Leonard Norrgard
* index.html: oops, some other minor changes
* index.html, release-notes.html:
latest changes in release-notes and index page for 0.9.4
* doc/reference.tex, calendar.js:
added %s date format (# of seconds since Epoch)
* calendar.js:
A click on TODAY will not close the calendar, even in single-click mode
2003-10-28 Mihai Bazon <mihai_bazon@yahoo.com>
* index.html: previous cal.html
* cal.html: moved to index.html
* README, cal.html, doc/reference.tex, lang/calendar-de.js, lang/calendar-en.js, lang/calendar-ro.js, release-notes.html:
LGPL license, forever.
* doc/Calendar.setup.tex, simple-1.html:
doc updated for the onUpdate parameter to Calendar.setup
2003-10-26 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar.js: fixed bug (correct display of the dropdown menus)
* doc/Calendar.setup.tex, doc/reference.tex, lang/calendar-de.js, lang/calendar-en.js, lang/calendar-ro.js, README, cal.html, calendar-blue.css, calendar-brown.css, calendar-green.css, calendar-setup.js, calendar-system.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css, calendar.js, release-notes.html, simple-1.html, simple-3.html:
lots of changes for the 0.9.4 release (see the release-notes.html)
2003-10-15 Mihai Bazon <mihai_bazon@yahoo.com>
* doc/reference.tex:
documentation updated for 0.9.4 (not yet finished though)
2003-10-07 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar.js, doc/reference.tex, release-notes.html, README, cal.html, calendar-setup.js:
modified project website
2003-10-06 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar-setup.js:
added some properties (onSelect, onClose, date) (thanks altblue)
2003-09-24 Mihai Bazon <mihai_bazon@yahoo.com>
* simple-3.html: dateIsSpecial does not need the "date" argument ;-)
2003-09-24 fsoft <fsoft@mishoo>
* calendar.js, simple-3.html:
added year, month, day to getDateStatus() function
2003-09-24 Mihai Bazon <mihai_bazon@yahoo.com>
* simple-3.html: example on how to use special dates
* calendar-setup.js, calendar.js, simple-1.html:
support for special dates (thanks fabio)
2003-09-17 Mihai Bazon <mihai_bazon@yahoo.com>
* doc/reference.tex: fixed error in section 3.
2003-08-01 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-jp.js: added Japanese translation
2003-07-16 Mihai Bazon <mihai_bazon@yahoo.com>
* simple-1.html: fixed problem with first example [IE,Opera]
2003-07-09 Mihai Bazon <mihai_bazon@yahoo.com>
* doc/Calendar.setup.tex: fixed typo (closing parenthesis)
* lang/calendar-de.js:
added German translation, thanks to Hartwig Weinkauf
2003-07-08 Mihai Bazon <mihai_bazon@yahoo.com>
* cal.html: added link to release-notes
* release-notes.html: 0.9.3 release notes
* make-release.pl:
Script to create distribution archive. It needs some additional packages:
- LaTeX
- tex2page
- jscrunch (JS compressor)
* doc/html/makedoc.sh, doc/html/reference.css, doc/reference.tex, doc/makedoc.sh:
documentation updates...
* calendar.js: added semicolon to make the code "compressible"
2003-07-06 Mihai Bazon <mihai_bazon@yahoo.com>
* doc/reference.tex: spell checked
* doc/reference.tex: [minor] changed credits order
* doc/reference.tex: various improvements and additions
* doc/html/reference.css: minor eye-candy tweaks
2003-07-05 Mihai Bazon <mihai_bazon@yahoo.com>
* doc/html/Calendar.setup.html.tex, doc/html/makedoc.sh, doc/html/reference.css, doc/html/reference.t2p, doc/hyperref.cfg, doc/makedoc.sh, doc/reference.tex, doc/Calendar.setup.tex, doc/Calendar.setup.pdf.tex:
full documentation in LaTeX, for PDF and HTML formats
* simple-2.html:
added demonstration of flat calendar with Calendar.setup
* simple-1.html:
modified some links, added link to documentation, added demonstration of
disableFunc property
* calendar-setup.js: added the ability to create flat calendar too
* cal.html: added links to documentation and simple-[12].html pages
* README: up-to-date...
* calendar-setup.html: removed: the documentation is unified
2003-07-03 Mihai Bazon <mihai_bazon@yahoo.com>
* cal.html: some links to newly added files
* calendar-setup.html, calendar-setup.js, img.gif, simple-1.html:
added some files to simplify calendar creation for non-(JS)-programmers
* lang/calendar-zh.js: added simplified chinese (thanks ATang)
2003-07-02 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar.js: * "yy"-related... [small fix]
* calendar.js:
* #721833 fixed (yy format will understand years prior to 29 as 20xx)
* calendar.js: * added refresh() function
* calendar.js: * fixed bug when in single click mode
* added alignment options to "showAtElement" member function
2003-06-25 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-pt.js:
added portugese translation (thanks Nuno Barreto)
2003-06-24 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar.js:
call user handler when the date was changed using the keyboard
* bugtest-hidden-selects.html:
file to test bug with hidden select-s (thanks Ying Zhang for reporting and for this test file)
* lang/calendar-hr-utf8.js:
added croatian translation in utf8 (thanks Krunoslav Zubrinic)
2003-06-23 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-hu.js: added hungarian translation
* lang/calendar-hr.js:
added croatian translation (thanks to Krunoslav Zubrinic)
2003-06-22 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar.js:
* #723335 fixed (clicking TODAY will not select the today date if the
disabledHandler rejects it)
* cal.html: * new code for to work with fix for bug #703238
* switch to new version
* calendar.js:
* some patches to make code compatible with Opera 7 (well, almost compatible)
* bug #703238 fixed (fix breaks compatibility with older code that uses
calendar in single-click mode)
* bug #703814 fixed
2003-04-09 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-tr.js: added turkish lang file
2003-03-19 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-ru.js: russian translation added
* lang/calendar-no.js: norwegian translation added
2003-03-15 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-no.js: norwegian translation
2003-03-12 Mihai Bazon <mihai_bazon@yahoo.com>
* lang/calendar-pl.js: added polish translation
2003-03-11 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar.js:
bugfix in parseDate (added base to parseInt, thanks Alan!)
2003-03-05 Mihai Bazon <mihai_bazon@yahoo.com>
* calendar.js, lang/calendar-br.js, lang/calendar-ca.js, lang/calendar-cs-win.js, lang/calendar-da.js, lang/calendar-du.js, lang/calendar-el.js, lang/calendar-en.js, lang/calendar-es.js, lang/calendar-fr.js, lang/calendar-it.js, lang/calendar-nl.js, lang/calendar-ro.js, lang/calendar-sp.js, lang/calendar-sw.js:
New file.
* calendar.js, lang/calendar-br.js, lang/calendar-ca.js, lang/calendar-cs-win.js, lang/calendar-da.js, lang/calendar-du.js, lang/calendar-el.js, lang/calendar-en.js, lang/calendar-es.js, lang/calendar-fr.js, lang/calendar-it.js, lang/calendar-nl.js, lang/calendar-ro.js, lang/calendar-sp.js, lang/calendar-sw.js:
moved to CVS at sourceforge.net
release: 0.9.2 + new language packs
* README, cal.html, calendar-blue.css, calendar-brown.css, calendar-green.css, calendar-system.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css:
New file.
* README, cal.html, calendar-blue.css, calendar-brown.css, calendar-green.css, calendar-system.css, calendar-win2k-1.css, calendar-win2k-2.css, calendar-win2k-cold-1.css, calendar-win2k-cold-2.css:
moved to CVS at sourceforge.net
release: 0.9.2 + new language packs

33
jscalendar-1.0/README Normal file
View File

@ -0,0 +1,33 @@
The DHTML Calendar
-------------------
Author: Mihai Bazon, <mihai_bazon@yahoo.com>
http://dynarch.com/mishoo/
This program is free software published under the
terms of the GNU Lesser General Public License.
For the entire license text please refer to
http://www.gnu.org/licenses/lgpl.html
Contents
---------
calendar.js -- the main program file
lang/*.js -- internalization files
*.css -- color themes
cal.html -- example usage file
doc/ -- documentation, in PDF and HTML
simple-1.html -- quick setup examples [popup calendars]
simple-2.html -- quick setup example for flat calendar
calendar.php -- PHP wrapper
test.php -- test file for the PHP wrapper
Homepage
---------
For details and latest versions please refer to calendar
homepage, located on my website:
http://dynarch.com/mishoo/calendar.epl

View File

@ -0,0 +1,108 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ro" lang="ro">
<head>
<title>Bug</title>
<link rel="stylesheet" type="text/css" media="all" href="calendar-win2k-1.css" title="win2k-1" />
<!-- import the calendar script -->
<script type="text/javascript" src="calendar.js"></script>
<!-- import the language module -->
<script type="text/javascript" src="lang/calendar-en.js"></script>
<!-- helper script that uses the calendar -->
<script type="text/javascript">
// This function gets called when the end-user clicks on some date.
function selected(cal, date) {
cal.sel.value = date; // just update the date in the input field.
if (cal.sel.id == "sel1" || cal.sel.id == "sel3")
// if we add this call we close the calendar on single-click.
// just to exemplify both cases, we are using this only for the 1st
// and the 3rd field, while 2nd and 4th will still require double-click.
cal.callCloseHandler();
}
// And this gets called when the end-user clicks on the _selected_ date,
// or clicks on the "Close" button. It just hides the calendar without
// destroying it.
function closeHandler(cal) {
cal.hide(); // hide the calendar
}
// This function shows the calendar under the element having the given id.
// It takes care of catching "mousedown" signals on document and hiding the
// calendar if the click was outside.
function showCalendar(id, format) {
var el = document.getElementById(id);
if (calendar != null) {
// we already have some calendar created
calendar.hide(); // so we hide it first.
} else {
// first-time call, create the calendar.
var cal = new Calendar(false, null, selected, closeHandler);
// uncomment the following line to hide the week numbers
// cal.weekNumbers = false;
calendar = cal; // remember it in the global var
cal.setRange(1900, 2070); // min/max year allowed.
cal.create();
}
calendar.setDateFormat(format); // set the specified date format
calendar.parseDate(el.value); // try to parse the text in field
calendar.sel = el; // inform it what input field we use
calendar.showAtElement(el); // show the calendar below it
return false;
}
var MINUTE = 60 * 1000;
var HOUR = 60 * MINUTE;
var DAY = 24 * HOUR;
var WEEK = 7 * DAY;
// If this handler returns true then the "date" given as
// parameter will be disabled. In this example we enable
// only days within a range of 10 days from the current
// date.
// You can use the functions date.getFullYear() -- returns the year
// as 4 digit number, date.getMonth() -- returns the month as 0..11,
// and date.getDate() -- returns the date of the month as 1..31, to
// make heavy calculations here. However, beware that this function
// should be very fast, as it is called for each day in a month when
// the calendar is (re)constructed.
function isDisabled(date) {
var today = new Date();
return (Math.abs(date.getTime() - today.getTime()) / DAY) > 10;
}
</script>
</head>
<body>
<form>
<b>Date:</b>
<br>
<input type="text" name="date1" id="sel1" size="30">
<input type="button" value="..." onclick="return showCalendar('sel1', 'y-m-d');">
<p>
<br>
<br><b>Visible &lt;select&gt;, hides and unhides as expected</b>
<br>
<select name="foo" multiple>
<option value="1">can use the functions date.getFullYear() -- returns</option>
<option value="2">4 digit number, date.getMonth() -- returns the month</option>
<option value="3">heavy calculations here. However, beware that this</option>
</select>
<p>
<br><b>Hidden &lt;select&gt;, it should stay hidden (but doesn't)</b>
<br>
<select name="foo2" multiple style="visibility: hidden">
<option value="1">this should</option>
<option value="2">remain hidden right?</option>
</select>
<p>
<br><b>Hidden textbox below, it stays hidden as expected</b>
<br>
<input type="text" name="foo3" value="this stays hidden just fine" style="visibility: hidden">
</form>
</body></html>

View File

@ -0,0 +1,232 @@
/* The main calendar widget. DIV containing a table. */
div.calendar { position: relative; }
.calendar, .calendar table {
border: 1px solid #556;
font-size: 11px;
color: #000;
cursor: default;
background: #eef;
font-family: tahoma,verdana,sans-serif;
}
/* Header part -- contains navigation buttons and day names. */
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
text-align: center; /* They are the navigation buttons */
padding: 2px; /* Make the buttons seem like they're pressing */
}
.calendar .nav {
background: #778 url(menuarrow.gif) no-repeat 100% 100%;
}
.calendar thead .title { /* This holds the current "month, year" */
font-weight: bold; /* Pressing it will take you to the current date */
text-align: center;
background: #fff;
color: #000;
padding: 2px;
}
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
background: #778;
color: #fff;
}
.calendar thead .daynames { /* Row <TR> containing the day names */
background: #bdf;
}
.calendar thead .name { /* Cells <TD> containing the day names */
border-bottom: 1px solid #556;
padding: 2px;
text-align: center;
color: #000;
}
.calendar thead .weekend { /* How a weekend day name shows in header */
color: #a66;
}
.calendar thead .hilite { /* How do the buttons in header appear when hover */
background-color: #aaf;
color: #000;
border: 1px solid #04f;
padding: 1px;
}
.calendar thead .active { /* Active (pressed) buttons in header */
background-color: #77c;
padding: 2px 0px 0px 2px;
}
/* The body part -- contains all the days in month. */
.calendar tbody .day { /* Cells <TD> containing month days dates */
width: 2em;
color: #456;
text-align: right;
padding: 2px 4px 2px 2px;
}
.calendar tbody .day.othermonth {
font-size: 80%;
color: #bbb;
}
.calendar tbody .day.othermonth.oweekend {
color: #fbb;
}
.calendar table .wn {
padding: 2px 3px 2px 2px;
border-right: 1px solid #000;
background: #bdf;
}
.calendar tbody .rowhilite td {
background: #def;
}
.calendar tbody .rowhilite td.wn {
background: #eef;
}
.calendar tbody td.hilite { /* Hovered cells <TD> */
background: #def;
padding: 1px 3px 1px 1px;
border: 1px solid #bbb;
}
.calendar tbody td.active { /* Active (pressed) cells <TD> */
background: #cde;
padding: 2px 2px 0px 2px;
}
.calendar tbody td.selected { /* Cell showing today date */
font-weight: bold;
border: 1px solid #000;
padding: 1px 3px 1px 1px;
background: #fff;
color: #000;
}
.calendar tbody td.weekend { /* Cells showing weekend days */
color: #a66;
}
.calendar tbody td.today { /* Cell showing selected date */
font-weight: bold;
color: #00f;
}
.calendar tbody .disabled { color: #999; }
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
visibility: hidden;
}
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
display: none;
}
/* The footer part -- status bar and "Close" button */
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
text-align: center;
background: #556;
color: #fff;
}
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
background: #fff;
color: #445;
border-top: 1px solid #556;
padding: 1px;
}
.calendar tfoot .hilite { /* Hover style for buttons in footer */
background: #aaf;
border: 1px solid #04f;
color: #000;
padding: 1px;
}
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
background: #77c;
padding: 2px 0px 0px 2px;
}
/* Combo boxes (menus that display months/years for direct selection) */
.calendar .combo {
position: absolute;
display: none;
top: 0px;
left: 0px;
width: 4em;
cursor: default;
border: 1px solid #655;
background: #def;
color: #000;
font-size: 90%;
z-index: 100;
}
.calendar .combo .label,
.calendar .combo .label-IEfix {
text-align: center;
padding: 1px;
}
.calendar .combo .label-IEfix {
width: 4em;
}
.calendar .combo .hilite {
background: #acf;
}
.calendar .combo .active {
border-top: 1px solid #46a;
border-bottom: 1px solid #46a;
background: #eef;
font-weight: bold;
}
.calendar td.time {
border-top: 1px solid #000;
padding: 1px 0px;
text-align: center;
background-color: #f4f0e8;
}
.calendar td.time .hour,
.calendar td.time .minute,
.calendar td.time .ampm {
padding: 0px 3px 0px 4px;
border: 1px solid #889;
font-weight: bold;
background-color: #fff;
}
.calendar td.time .ampm {
text-align: center;
}
.calendar td.time .colon {
padding: 0px 2px 0px 3px;
font-weight: bold;
}
.calendar td.time span.hilite {
border-color: #000;
background-color: #667;
color: #fff;
}
.calendar td.time span.active {
border-color: #f00;
background-color: #000;
color: #0f0;
}

View File

@ -0,0 +1,236 @@
/* The main calendar widget. DIV containing a table. */
div.calendar { position: relative; }
.calendar, .calendar table {
border: 1px solid #206A9B;
font-size: 11px;
color: #000;
cursor: default;
background: #F1F8FC;
font-family: tahoma,verdana,sans-serif;
}
/* Header part -- contains navigation buttons and day names. */
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
text-align: center; /* They are the navigation buttons */
padding: 2px; /* Make the buttons seem like they're pressing */
}
.calendar .nav {
background: #007ED1 url(menuarrow2.gif) no-repeat 100% 100%;
}
.calendar thead .title { /* This holds the current "month, year" */
font-weight: bold; /* Pressing it will take you to the current date */
text-align: center;
background: #000;
color: #fff;
padding: 2px;
}
.calendar thead tr { /* Row <TR> containing navigation buttons */
background: #007ED1;
color: #fff;
}
.calendar thead .daynames { /* Row <TR> containing the day names */
background: #C7E1F3;
}
.calendar thead .name { /* Cells <TD> containing the day names */
border-bottom: 1px solid #206A9B;
padding: 2px;
text-align: center;
color: #000;
}
.calendar thead .weekend { /* How a weekend day name shows in header */
color: #a66;
}
.calendar thead .hilite { /* How do the buttons in header appear when hover */
background-color: #34ABFA;
color: #000;
border: 1px solid #016DC5;
padding: 1px;
}
.calendar thead .active { /* Active (pressed) buttons in header */
background-color: #006AA9;
border: 1px solid #008AFF;
padding: 2px 0px 0px 2px;
}
/* The body part -- contains all the days in month. */
.calendar tbody .day { /* Cells <TD> containing month days dates */
width: 2em;
color: #456;
text-align: right;
padding: 2px 4px 2px 2px;
}
.calendar tbody .day.othermonth {
font-size: 80%;
color: #bbb;
}
.calendar tbody .day.othermonth.oweekend {
color: #fbb;
}
.calendar table .wn {
padding: 2px 3px 2px 2px;
border-right: 1px solid #000;
background: #C7E1F3;
}
.calendar tbody .rowhilite td {
background: #def;
}
.calendar tbody .rowhilite td.wn {
background: #F1F8FC;
}
.calendar tbody td.hilite { /* Hovered cells <TD> */
background: #def;
padding: 1px 3px 1px 1px;
border: 1px solid #8FC4E8;
}
.calendar tbody td.active { /* Active (pressed) cells <TD> */
background: #cde;
padding: 2px 2px 0px 2px;
}
.calendar tbody td.selected { /* Cell showing today date */
font-weight: bold;
border: 1px solid #000;
padding: 1px 3px 1px 1px;
background: #fff;
color: #000;
}
.calendar tbody td.weekend { /* Cells showing weekend days */
color: #a66;
}
.calendar tbody td.today { /* Cell showing selected date */
font-weight: bold;
color: #D50000;
}
.calendar tbody .disabled { color: #999; }
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
visibility: hidden;
}
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
display: none;
}
/* The footer part -- status bar and "Close" button */
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
text-align: center;
background: #206A9B;
color: #fff;
}
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
background: #000;
color: #fff;
border-top: 1px solid #206A9B;
padding: 1px;
}
.calendar tfoot .hilite { /* Hover style for buttons in footer */
background: #B8DAF0;
border: 1px solid #178AEB;
color: #000;
padding: 1px;
}
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
background: #006AA9;
padding: 2px 0px 0px 2px;
}
/* Combo boxes (menus that display months/years for direct selection) */
.calendar .combo {
position: absolute;
display: none;
top: 0px;
left: 0px;
width: 4em;
cursor: default;
border: 1px solid #655;
background: #def;
color: #000;
font-size: 90%;
z-index: 100;
}
.calendar .combo .label,
.calendar .combo .label-IEfix {
text-align: center;
padding: 1px;
}
.calendar .combo .label-IEfix {
width: 4em;
}
.calendar .combo .hilite {
background: #34ABFA;
border-top: 1px solid #46a;
border-bottom: 1px solid #46a;
font-weight: bold;
}
.calendar .combo .active {
border-top: 1px solid #46a;
border-bottom: 1px solid #46a;
background: #F1F8FC;
font-weight: bold;
}
.calendar td.time {
border-top: 1px solid #000;
padding: 1px 0px;
text-align: center;
background-color: #E3F0F9;
}
.calendar td.time .hour,
.calendar td.time .minute,
.calendar td.time .ampm {
padding: 0px 3px 0px 4px;
border: 1px solid #889;
font-weight: bold;
background-color: #F1F8FC;
}
.calendar td.time .ampm {
text-align: center;
}
.calendar td.time .colon {
padding: 0px 2px 0px 3px;
font-weight: bold;
}
.calendar td.time span.hilite {
border-color: #000;
background-color: #267DB7;
color: #fff;
}
.calendar td.time span.active {
border-color: red;
background-color: #000;
color: #A5FF00;
}

View File

@ -0,0 +1,225 @@
/* The main calendar widget. DIV containing a table. */
div.calendar { position: relative; }
.calendar, .calendar table {
border: 1px solid #655;
font-size: 11px;
color: #000;
cursor: default;
background: #ffd;
font-family: tahoma,verdana,sans-serif;
}
/* Header part -- contains navigation buttons and day names. */
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
text-align: center; /* They are the navigation buttons */
padding: 2px; /* Make the buttons seem like they're pressing */
}
.calendar .nav {
background: #edc url(menuarrow.gif) no-repeat 100% 100%;
}
.calendar thead .title { /* This holds the current "month, year" */
font-weight: bold; /* Pressing it will take you to the current date */
text-align: center;
background: #654;
color: #fed;
padding: 2px;
}
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
background: #edc;
color: #000;
}
.calendar thead .name { /* Cells <TD> containing the day names */
border-bottom: 1px solid #655;
padding: 2px;
text-align: center;
color: #000;
}
.calendar thead .weekend { /* How a weekend day name shows in header */
color: #f00;
}
.calendar thead .hilite { /* How do the buttons in header appear when hover */
background-color: #faa;
color: #000;
border: 1px solid #f40;
padding: 1px;
}
.calendar thead .active { /* Active (pressed) buttons in header */
background-color: #c77;
padding: 2px 0px 0px 2px;
}
.calendar thead .daynames { /* Row <TR> containing the day names */
background: #fed;
}
/* The body part -- contains all the days in month. */
.calendar tbody .day { /* Cells <TD> containing month days dates */
width: 2em;
text-align: right;
padding: 2px 4px 2px 2px;
}
.calendar tbody .day.othermonth {
font-size: 80%;
color: #bbb;
}
.calendar tbody .day.othermonth.oweekend {
color: #fbb;
}
.calendar table .wn {
padding: 2px 3px 2px 2px;
border-right: 1px solid #000;
background: #fed;
}
.calendar tbody .rowhilite td {
background: #ddf;
}
.calendar tbody .rowhilite td.wn {
background: #efe;
}
.calendar tbody td.hilite { /* Hovered cells <TD> */
background: #ffe;
padding: 1px 3px 1px 1px;
border: 1px solid #bbb;
}
.calendar tbody td.active { /* Active (pressed) cells <TD> */
background: #ddc;
padding: 2px 2px 0px 2px;
}
.calendar tbody td.selected { /* Cell showing today date */
font-weight: bold;
border: 1px solid #000;
padding: 1px 3px 1px 1px;
background: #fea;
}
.calendar tbody td.weekend { /* Cells showing weekend days */
color: #f00;
}
.calendar tbody td.today { font-weight: bold; }
.calendar tbody .disabled { color: #999; }
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
visibility: hidden;
}
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
display: none;
}
/* The footer part -- status bar and "Close" button */
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
text-align: center;
background: #988;
color: #000;
}
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
border-top: 1px solid #655;
background: #dcb;
color: #840;
}
.calendar tfoot .hilite { /* Hover style for buttons in footer */
background: #faa;
border: 1px solid #f40;
padding: 1px;
}
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
background: #c77;
padding: 2px 0px 0px 2px;
}
/* Combo boxes (menus that display months/years for direct selection) */
.calendar .combo {
position: absolute;
display: none;
top: 0px;
left: 0px;
width: 4em;
cursor: default;
border: 1px solid #655;
background: #ffe;
color: #000;
font-size: 90%;
z-index: 100;
}
.calendar .combo .label,
.calendar .combo .label-IEfix {
text-align: center;
padding: 1px;
}
.calendar .combo .label-IEfix {
width: 4em;
}
.calendar .combo .hilite {
background: #fc8;
}
.calendar .combo .active {
border-top: 1px solid #a64;
border-bottom: 1px solid #a64;
background: #fee;
font-weight: bold;
}
.calendar td.time {
border-top: 1px solid #a88;
padding: 1px 0px;
text-align: center;
background-color: #fed;
}
.calendar td.time .hour,
.calendar td.time .minute,
.calendar td.time .ampm {
padding: 0px 3px 0px 4px;
border: 1px solid #988;
font-weight: bold;
background-color: #fff;
}
.calendar td.time .ampm {
text-align: center;
}
.calendar td.time .colon {
padding: 0px 2px 0px 3px;
font-weight: bold;
}
.calendar td.time span.hilite {
border-color: #000;
background-color: #866;
color: #fff;
}
.calendar td.time span.active {
border-color: #f00;
background-color: #000;
color: #0f0;
}

View File

@ -0,0 +1,229 @@
/* The main calendar widget. DIV containing a table. */
div.calendar { position: relative; }
.calendar, .calendar table {
border: 1px solid #565;
font-size: 11px;
color: #000;
cursor: default;
background: #efe;
font-family: tahoma,verdana,sans-serif;
}
/* Header part -- contains navigation buttons and day names. */
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
text-align: center; /* They are the navigation buttons */
padding: 2px; /* Make the buttons seem like they're pressing */
background: #676;
color: #fff;
font-size: 90%;
}
.calendar .nav {
background: #676 url(menuarrow.gif) no-repeat 100% 100%;
}
.calendar thead .title { /* This holds the current "month, year" */
font-weight: bold; /* Pressing it will take you to the current date */
text-align: center;
padding: 2px;
background: #250;
color: #efa;
}
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
}
.calendar thead .name { /* Cells <TD> containing the day names */
border-bottom: 1px solid #565;
padding: 2px;
text-align: center;
color: #000;
}
.calendar thead .weekend { /* How a weekend day name shows in header */
color: #a66;
}
.calendar thead .hilite { /* How do the buttons in header appear when hover */
background-color: #afa;
color: #000;
border: 1px solid #084;
padding: 1px;
}
.calendar thead .active { /* Active (pressed) buttons in header */
background-color: #7c7;
padding: 2px 0px 0px 2px;
}
.calendar thead .daynames { /* Row <TR> containing the day names */
background: #dfb;
}
/* The body part -- contains all the days in month. */
.calendar tbody .day { /* Cells <TD> containing month days dates */
width: 2em;
color: #564;
text-align: right;
padding: 2px 4px 2px 2px;
}
.calendar tbody .day.othermonth {
font-size: 80%;
color: #bbb;
}
.calendar tbody .day.othermonth.oweekend {
color: #fbb;
}
.calendar table .wn {
padding: 2px 3px 2px 2px;
border-right: 1px solid #8a8;
background: #dfb;
}
.calendar tbody .rowhilite td {
background: #dfd;
}
.calendar tbody .rowhilite td.wn {
background: #efe;
}
.calendar tbody td.hilite { /* Hovered cells <TD> */
background: #efd;
padding: 1px 3px 1px 1px;
border: 1px solid #bbb;
}
.calendar tbody td.active { /* Active (pressed) cells <TD> */
background: #dec;
padding: 2px 2px 0px 2px;
}
.calendar tbody td.selected { /* Cell showing today date */
font-weight: bold;
border: 1px solid #000;
padding: 1px 3px 1px 1px;
background: #f8fff8;
color: #000;
}
.calendar tbody td.weekend { /* Cells showing weekend days */
color: #a66;
}
.calendar tbody td.today { font-weight: bold; color: #0a0; }
.calendar tbody .disabled { color: #999; }
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
visibility: hidden;
}
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
display: none;
}
/* The footer part -- status bar and "Close" button */
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
text-align: center;
background: #565;
color: #fff;
}
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
padding: 2px;
background: #250;
color: #efa;
}
.calendar tfoot .hilite { /* Hover style for buttons in footer */
background: #afa;
border: 1px solid #084;
color: #000;
padding: 1px;
}
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
background: #7c7;
padding: 2px 0px 0px 2px;
}
/* Combo boxes (menus that display months/years for direct selection) */
.calendar .combo {
position: absolute;
display: none;
top: 0px;
left: 0px;
width: 4em;
cursor: default;
border: 1px solid #565;
background: #efd;
color: #000;
font-size: 90%;
z-index: 100;
}
.calendar .combo .label,
.calendar .combo .label-IEfix {
text-align: center;
padding: 1px;
}
.calendar .combo .label-IEfix {
width: 4em;
}
.calendar .combo .hilite {
background: #af8;
}
.calendar .combo .active {
border-top: 1px solid #6a4;
border-bottom: 1px solid #6a4;
background: #efe;
font-weight: bold;
}
.calendar td.time {
border-top: 1px solid #8a8;
padding: 1px 0px;
text-align: center;
background-color: #dfb;
}
.calendar td.time .hour,
.calendar td.time .minute,
.calendar td.time .ampm {
padding: 0px 3px 0px 4px;
border: 1px solid #898;
font-weight: bold;
background-color: #fff;
}
.calendar td.time .ampm {
text-align: center;
}
.calendar td.time .colon {
padding: 0px 2px 0px 3px;
font-weight: bold;
}
.calendar td.time span.hilite {
border-color: #000;
background-color: #686;
color: #fff;
}
.calendar td.time span.active {
border-color: #f00;
background-color: #000;
color: #0f0;
}

View File

@ -0,0 +1,200 @@
/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/
* ---------------------------------------------------------------------------
*
* The DHTML Calendar
*
* Details and latest version at:
* http://dynarch.com/mishoo/calendar.epl
*
* This script is distributed under the GNU Lesser General Public License.
* Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
*
* This file defines helper functions for setting up the calendar. They are
* intended to help non-programmers get a working calendar on their site
* quickly. This script should not be seen as part of the calendar. It just
* shows you what one can do with the calendar, while in the same time
* providing a quick and simple method for setting it up. If you need
* exhaustive customization of the calendar creation process feel free to
* modify this code to suit your needs (this is recommended and much better
* than modifying calendar.js itself).
*/
// $Id: calendar-setup.js,v 1.25 2005/03/07 09:51:33 mishoo Exp $
/**
* This function "patches" an input field (or other element) to use a calendar
* widget for date selection.
*
* The "params" is a single object that can have the following properties:
*
* prop. name | description
* -------------------------------------------------------------------------------------------------
* inputField | the ID of an input field to store the date
* displayArea | the ID of a DIV or other element to show the date
* button | ID of a button or other element that will trigger the calendar
* eventName | event that will trigger the calendar, without the "on" prefix (default: "click")
* ifFormat | date format that will be stored in the input field
* daFormat | the date format that will be used to display the date in displayArea
* singleClick | (true/false) wether the calendar is in single click mode or not (default: true)
* firstDay | numeric: 0 to 6. "0" means display Sunday first, "1" means display Monday first, etc.
* align | alignment (default: "Br"); if you don't know what's this see the calendar documentation
* range | array with 2 elements. Default: [1900, 2999] -- the range of years available
* weekNumbers | (true/false) if it's true (default) the calendar will display week numbers
* flat | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID
* flatCallback | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar)
* disableFunc | function that receives a JS Date object and should return true if that date has to be disabled in the calendar
* onSelect | function that gets called when a date is selected. You don't _have_ to supply this (the default is generally okay)
* onClose | function that gets called when the calendar is closed. [default]
* onUpdate | function that gets called after the date is updated in the input field. Receives a reference to the calendar.
* date | the date that the calendar will be initially displayed to
* showsTime | default: false; if true the calendar will include a time selector
* timeFormat | the time format; can be "12" or "24", default is "12"
* electric | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close
* step | configures the step of the years in drop-down boxes; default: 2
* position | configures the calendar absolute position; default: null
* cache | if "true" (but default: "false") it will reuse the same calendar object, where possible
* showOthers | if "true" (but default: "false") it will show days from other months too
*
* None of them is required, they all have default values. However, if you
* pass none of "inputField", "displayArea" or "button" you'll get a warning
* saying "nothing to setup".
*/
Calendar.setup = function (params) {
function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } };
param_default("inputField", null);
param_default("displayArea", null);
param_default("button", null);
param_default("eventName", "click");
param_default("ifFormat", "%Y/%m/%d");
param_default("daFormat", "%Y/%m/%d");
param_default("singleClick", true);
param_default("disableFunc", null);
param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined
param_default("dateText", null);
param_default("firstDay", null);
param_default("align", "Br");
param_default("range", [1900, 2999]);
param_default("weekNumbers", true);
param_default("flat", null);
param_default("flatCallback", null);
param_default("onSelect", null);
param_default("onClose", null);
param_default("onUpdate", null);
param_default("date", null);
param_default("showsTime", false);
param_default("timeFormat", "24");
param_default("electric", true);
param_default("step", 2);
param_default("position", null);
param_default("cache", false);
param_default("showOthers", false);
param_default("multiple", null);
var tmp = ["inputField", "displayArea", "button"];
for (var i in tmp) {
if (typeof params[tmp[i]] == "string") {
params[tmp[i]] = document.getElementById(params[tmp[i]]);
}
}
if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) {
alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");
return false;
}
function onSelect(cal) {
var p = cal.params;
var update = (cal.dateClicked || p.electric);
if (update && p.inputField) {
p.inputField.value = cal.date.print(p.ifFormat);
if (typeof p.inputField.onchange == "function")
p.inputField.onchange();
}
if (update && p.displayArea)
p.displayArea.innerHTML = cal.date.print(p.daFormat);
if (update && typeof p.onUpdate == "function")
p.onUpdate(cal);
if (update && p.flat) {
if (typeof p.flatCallback == "function")
p.flatCallback(cal);
}
if (update && p.singleClick && cal.dateClicked)
cal.callCloseHandler();
};
if (params.flat != null) {
if (typeof params.flat == "string")
params.flat = document.getElementById(params.flat);
if (!params.flat) {
alert("Calendar.setup:\n Flat specified but can't find parent.");
return false;
}
var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect);
cal.showsOtherMonths = params.showOthers;
cal.showsTime = params.showsTime;
cal.time24 = (params.timeFormat == "24");
cal.params = params;
cal.weekNumbers = params.weekNumbers;
cal.setRange(params.range[0], params.range[1]);
cal.setDateStatusHandler(params.dateStatusFunc);
cal.getDateText = params.dateText;
if (params.ifFormat) {
cal.setDateFormat(params.ifFormat);
}
if (params.inputField && typeof params.inputField.value == "string") {
cal.parseDate(params.inputField.value);
}
cal.create(params.flat);
cal.show();
return false;
}
var triggerEl = params.button || params.displayArea || params.inputField;
triggerEl["on" + params.eventName] = function() {
var dateEl = params.inputField || params.displayArea;
var dateFmt = params.inputField ? params.ifFormat : params.daFormat;
var mustCreate = false;
var cal = window.calendar;
if (dateEl)
params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt);
if (!(cal && params.cache)) {
window.calendar = cal = new Calendar(params.firstDay,
params.date,
params.onSelect || onSelect,
params.onClose || function(cal) { cal.hide(); });
cal.showsTime = params.showsTime;
cal.time24 = (params.timeFormat == "24");
cal.weekNumbers = params.weekNumbers;
mustCreate = true;
} else {
if (params.date)
cal.setDate(params.date);
cal.hide();
}
if (params.multiple) {
cal.multiple = {};
for (var i = params.multiple.length; --i >= 0;) {
var d = params.multiple[i];
var ds = d.print("%Y%m%d");
cal.multiple[ds] = d;
}
}
cal.showsOtherMonths = params.showOthers;
cal.yearStep = params.step;
cal.setRange(params.range[0], params.range[1]);
cal.params = params;
cal.setDateStatusHandler(params.dateStatusFunc);
cal.getDateText = params.dateText;
cal.setDateFormat(dateFmt);
if (mustCreate)
cal.create();
cal.refresh();
if (!params.position)
cal.showAtElement(params.button || params.displayArea || params.inputField, params.align);
else
cal.showAt(params.position[0], params.position[1]);
return false;
};
return cal;
};

View File

@ -0,0 +1,21 @@
/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/
* ---------------------------------------------------------------------------
*
* The DHTML Calendar
*
* Details and latest version at:
* http://dynarch.com/mishoo/calendar.epl
*
* This script is distributed under the GNU Lesser General Public License.
* Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
*
* This file defines helper functions for setting up the calendar. They are
* intended to help non-programmers get a working calendar on their site
* quickly. This script should not be seen as part of the calendar. It just
* shows you what one can do with the calendar, while in the same time
* providing a quick and simple method for setting it up. If you need
* exhaustive customization of the calendar creation process feel free to
* modify this code to suit your needs (this is recommended and much better
* than modifying calendar.js itself).
*/
Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("dateText",null);param_default("firstDay",null);param_default("align","Br");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");param_default("electric",true);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("showOthers",false);param_default("multiple",null);var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}if(!(params.flat||params.multiple||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");return false;}function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.inputField){p.inputField.value=cal.date.print(p.ifFormat);if(typeof p.inputField.onchange=="function")p.inputField.onchange();}if(update&&p.displayArea)p.displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&typeof p.onUpdate=="function")p.onUpdate(cal);if(update&&p.flat){if(typeof p.flatCallback=="function")p.flatCallback(cal);}if(update&&p.singleClick&&cal.dateClicked)cal.callCloseHandler();};if(params.flat!=null){if(typeof params.flat=="string")params.flat=document.getElementById(params.flat);if(!params.flat){alert("Calendar.setup:\n Flat specified but can't find parent.");return false;}var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.showsOtherMonths=params.showOthers;cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;if(params.ifFormat){cal.setDateFormat(params.ifFormat);}if(params.inputField&&typeof params.inputField.value=="string"){cal.parseDate(params.inputField.value);}cal.create(params.flat);cal.show();return false;}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(dateEl)params.date=Date.parseDate(dateEl.value||dateEl.innerHTML,dateFmt);if(!(cal&&params.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{if(params.date)cal.setDate(params.date);cal.hide();}if(params.multiple){cal.multiple={};for(var i=params.multiple.length;--i>=0;){var d=params.multiple[i];var ds=d.print("%Y%m%d");cal.multiple[ds]=d;}}cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.refresh();if(!params.position)cal.showAtElement(params.button||params.displayArea||params.inputField,params.align);else cal.showAt(params.position[0],params.position[1]);return false;};return cal;};

View File

@ -0,0 +1,251 @@
/* The main calendar widget. DIV containing a table. */
.calendar {
position: relative;
display: none;
border: 1px solid;
border-color: #fff #000 #000 #fff;
font-size: 11px;
cursor: default;
background: Window;
color: WindowText;
font-family: tahoma,verdana,sans-serif;
}
.calendar table {
border: 1px solid;
border-color: #fff #000 #000 #fff;
font-size: 11px;
cursor: default;
background: Window;
color: WindowText;
font-family: tahoma,verdana,sans-serif;
}
/* Header part -- contains navigation buttons and day names. */
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
text-align: center;
padding: 1px;
border: 1px solid;
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
background: ButtonFace;
}
.calendar .nav {
background: ButtonFace url(menuarrow.gif) no-repeat 100% 100%;
}
.calendar thead .title { /* This holds the current "month, year" */
font-weight: bold;
padding: 1px;
border: 1px solid #000;
background: ActiveCaption;
color: CaptionText;
text-align: center;
}
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
}
.calendar thead .daynames { /* Row <TR> containing the day names */
}
.calendar thead .name { /* Cells <TD> containing the day names */
border-bottom: 1px solid ButtonShadow;
padding: 2px;
text-align: center;
background: ButtonFace;
color: ButtonText;
}
.calendar thead .weekend { /* How a weekend day name shows in header */
color: #f00;
}
.calendar thead .hilite { /* How do the buttons in header appear when hover */
border: 2px solid;
padding: 0px;
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
}
.calendar thead .active { /* Active (pressed) buttons in header */
border-width: 1px;
padding: 2px 0px 0px 2px;
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
}
/* The body part -- contains all the days in month. */
.calendar tbody .day { /* Cells <TD> containing month days dates */
width: 2em;
text-align: right;
padding: 2px 4px 2px 2px;
}
.calendar tbody .day.othermonth {
font-size: 80%;
color: #aaa;
}
.calendar tbody .day.othermonth.oweekend {
color: #faa;
}
.calendar table .wn {
padding: 2px 3px 2px 2px;
border-right: 1px solid ButtonShadow;
background: ButtonFace;
color: ButtonText;
}
.calendar tbody .rowhilite td {
background: Highlight;
color: HighlightText;
}
.calendar tbody td.hilite { /* Hovered cells <TD> */
padding: 1px 3px 1px 1px;
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
}
.calendar tbody td.active { /* Active (pressed) cells <TD> */
padding: 2px 2px 0px 2px;
border: 1px solid;
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
}
.calendar tbody td.selected { /* Cell showing selected date */
font-weight: bold;
border: 1px solid;
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
padding: 2px 2px 0px 2px;
background: ButtonFace;
color: ButtonText;
}
.calendar tbody td.weekend { /* Cells showing weekend days */
color: #f00;
}
.calendar tbody td.today { /* Cell showing today date */
font-weight: bold;
color: #00f;
}
.calendar tbody td.disabled { color: GrayText; }
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
visibility: hidden;
}
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
display: none;
}
/* The footer part -- status bar and "Close" button */
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
}
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
background: ButtonFace;
padding: 1px;
border: 1px solid;
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
color: ButtonText;
text-align: center;
}
.calendar tfoot .hilite { /* Hover style for buttons in footer */
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
padding: 1px;
background: #e4e0d8;
}
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
padding: 2px 0px 0px 2px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
}
/* Combo boxes (menus that display months/years for direct selection) */
.calendar .combo {
position: absolute;
display: none;
width: 4em;
top: 0px;
left: 0px;
cursor: default;
border: 1px solid;
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
background: Menu;
color: MenuText;
font-size: 90%;
padding: 1px;
z-index: 100;
}
.calendar .combo .label,
.calendar .combo .label-IEfix {
text-align: center;
padding: 1px;
}
.calendar .combo .label-IEfix {
width: 4em;
}
.calendar .combo .active {
padding: 0px;
border: 1px solid #000;
}
.calendar .combo .hilite {
background: Highlight;
color: HighlightText;
}
.calendar td.time {
border-top: 1px solid ButtonShadow;
padding: 1px 0px;
text-align: center;
background-color: ButtonFace;
}
.calendar td.time .hour,
.calendar td.time .minute,
.calendar td.time .ampm {
padding: 0px 3px 0px 4px;
border: 1px solid #889;
font-weight: bold;
background-color: Menu;
}
.calendar td.time .ampm {
text-align: center;
}
.calendar td.time .colon {
padding: 0px 2px 0px 3px;
font-weight: bold;
}
.calendar td.time span.hilite {
border-color: #000;
background-color: Highlight;
color: HighlightText;
}
.calendar td.time span.active {
border-color: #f00;
background-color: #000;
color: #0f0;
}

View File

@ -0,0 +1,239 @@
/* The main calendar widget. DIV containing a table. */
div.calendar { position: relative; }
.calendar, .calendar table {
border: 1px solid #655;
font-size: 11px;
color: #000;
cursor: default;
background: #ffd;
font-family: tahoma,verdana,sans-serif;
filter:
progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#DDDCCC,EndColorStr=#FFFFFF);
}
/* Header part -- contains navigation buttons and day names. */
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
text-align: center; /* They are the navigation buttons */
padding: 2px; /* Make the buttons seem like they're pressing */
color:#363636;
}
.calendar .nav {
background: #edc url(menuarrow.gif) no-repeat 100% 100%;
}
.calendar thead .title { /* This holds the current "month, year" */
font-weight: bold; /* Pressing it will take you to the current date */
text-align: center;
background: #654;
color: #363636;
padding: 2px;
filter:
progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#ffffff,EndColorStr=#dddccc);
}
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
/*background: #3B86A0;*/
color: #363636;
font-weight: bold;
filter:
progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#ffffff,EndColorStr=#3b86a0);
}
.calendar thead .name { /* Cells <TD> containing the day names */
border-bottom: 1px solid #655;
padding: 2px;
text-align: center;
color: #363636;
filter:
progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#DDDCCC,EndColorStr=#FFFFFF);
}
.calendar thead .weekend { /* How a weekend day name shows in header */
color: #f00;
}
.calendar thead .hilite { /* How do the buttons in header appear when hover */
background-color: #ffcc86;
color: #000;
border: 1px solid #b59345;
padding: 1px;
}
.calendar thead .active { /* Active (pressed) buttons in header */
background-color: #c77;
padding: 2px 0px 0px 2px;
}
.calendar thead .daynames { /* Row <TR> containing the day names */
background: #fed;
}
/* The body part -- contains all the days in month. */
.calendar tbody .day { /* Cells <TD> containing month days dates */
width: 2em;
text-align: right;
padding: 2px 4px 2px 2px;
}
.calendar tbody .day.othermonth {
font-size: 80%;
color: #aaa;
}
.calendar tbody .day.othermonth.oweekend {
color: #faa;
}
.calendar table .wn {
padding: 2px 3px 2px 2px;
border-right: 1px solid #000;
background: #fed;
}
.calendar tbody .rowhilite td {
background: #ddf;
}
.calendar tbody .rowhilite td.wn {
background: #efe;
}
.calendar tbody td.hilite { /* Hovered cells <TD> */
background: #ffe;
padding: 1px 3px 1px 1px;
border: 1px solid #bbb;
}
.calendar tbody td.active { /* Active (pressed) cells <TD> */
background: #ddc;
padding: 2px 2px 0px 2px;
}
.calendar tbody td.selected { /* Cell showing today date */
font-weight: bold;
border: 1px solid #000;
padding: 1px 3px 1px 1px;
background: #fea;
}
.calendar tbody td.weekend { /* Cells showing weekend days */
color: #f00;
}
.calendar tbody td.today { font-weight: bold; }
.calendar tbody .disabled { color: #999; }
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
visibility: hidden;
}
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
display: none;
}
/* The footer part -- status bar and "Close" button */
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
text-align: center;
background: #988;
color: #000;
}
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
border-top: 1px solid #655;
background: #dcb;
color: #363636;
font-weight: bold;
filter:
progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#FFFFFF,EndColorStr=#DDDCCC);
}
.calendar tfoot .hilite { /* Hover style for buttons in footer */
background: #faa;
border: 1px solid #f40;
padding: 1px;
}
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
background: #c77;
padding: 2px 0px 0px 2px;
}
/* Combo boxes (menus that display months/years for direct selection) */
.combo {
position: absolute;
display: none;
top: 0px;
left: 0px;
width: 4em;
cursor: default;
border: 1px solid #655;
background: #ffe;
color: #000;
font-size: smaller;
z-index: 100;
}
.combo .label,
.combo .label-IEfix {
text-align: center;
padding: 1px;
}
.combo .label-IEfix {
width: 4em;
}
.combo .hilite {
background: #fc8;
}
.combo .active {
border-top: 1px solid #a64;
border-bottom: 1px solid #a64;
background: #fee;
font-weight: bold;
}
.calendar td.time {
border-top: 1px solid #a88;
padding: 1px 0px;
text-align: center;
background-color: #fed;
}
.calendar td.time .hour,
.calendar td.time .minute,
.calendar td.time .ampm {
padding: 0px 3px 0px 4px;
border: 1px solid #988;
font-weight: bold;
background-color: #fff;
}
.calendar td.time .ampm {
text-align: center;
}
.calendar td.time .colon {
padding: 0px 2px 0px 3px;
font-weight: bold;
}
.calendar td.time span.hilite {
border-color: #000;
background-color: #866;
color: #fff;
}
.calendar td.time span.active {
border-color: #f00;
background-color: #000;
color: #0f0;
}

View File

@ -0,0 +1,271 @@
/* The main calendar widget. DIV containing a table. */
.calendar {
position: relative;
display: none;
border-top: 2px solid #fff;
border-right: 2px solid #000;
border-bottom: 2px solid #000;
border-left: 2px solid #fff;
font-size: 11px;
color: #000;
cursor: default;
background: #d4d0c8;
font-family: tahoma,verdana,sans-serif;
}
.calendar table {
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
font-size: 11px;
color: #000;
cursor: default;
background: #d4d0c8;
font-family: tahoma,verdana,sans-serif;
}
/* Header part -- contains navigation buttons and day names. */
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
text-align: center;
padding: 1px;
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
}
.calendar .nav {
background: transparent url(menuarrow.gif) no-repeat 100% 100%;
}
.calendar thead .title { /* This holds the current "month, year" */
font-weight: bold;
padding: 1px;
border: 1px solid #000;
background: #848078;
color: #fff;
text-align: center;
}
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
}
.calendar thead .daynames { /* Row <TR> containing the day names */
}
.calendar thead .name { /* Cells <TD> containing the day names */
border-bottom: 1px solid #000;
padding: 2px;
text-align: center;
background: #f4f0e8;
}
.calendar thead .weekend { /* How a weekend day name shows in header */
color: #f00;
}
.calendar thead .hilite { /* How do the buttons in header appear when hover */
border-top: 2px solid #fff;
border-right: 2px solid #000;
border-bottom: 2px solid #000;
border-left: 2px solid #fff;
padding: 0px;
background-color: #e4e0d8;
}
.calendar thead .active { /* Active (pressed) buttons in header */
padding: 2px 0px 0px 2px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
background-color: #c4c0b8;
}
/* The body part -- contains all the days in month. */
.calendar tbody .day { /* Cells <TD> containing month days dates */
width: 2em;
text-align: right;
padding: 2px 4px 2px 2px;
}
.calendar tbody .day.othermonth {
font-size: 80%;
color: #aaa;
}
.calendar tbody .day.othermonth.oweekend {
color: #faa;
}
.calendar table .wn {
padding: 2px 3px 2px 2px;
border-right: 1px solid #000;
background: #f4f0e8;
}
.calendar tbody .rowhilite td {
background: #e4e0d8;
}
.calendar tbody .rowhilite td.wn {
background: #d4d0c8;
}
.calendar tbody td.hilite { /* Hovered cells <TD> */
padding: 1px 3px 1px 1px;
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
}
.calendar tbody td.active { /* Active (pressed) cells <TD> */
padding: 2px 2px 0px 2px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
}
.calendar tbody td.selected { /* Cell showing selected date */
font-weight: bold;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
padding: 2px 2px 0px 2px;
background: #e4e0d8;
}
.calendar tbody td.weekend { /* Cells showing weekend days */
color: #f00;
}
.calendar tbody td.today { /* Cell showing today date */
font-weight: bold;
color: #00f;
}
.calendar tbody .disabled { color: #999; }
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
visibility: hidden;
}
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
display: none;
}
/* The footer part -- status bar and "Close" button */
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
}
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
background: #f4f0e8;
padding: 1px;
border: 1px solid #000;
background: #848078;
color: #fff;
text-align: center;
}
.calendar tfoot .hilite { /* Hover style for buttons in footer */
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
padding: 1px;
background: #e4e0d8;
}
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
padding: 2px 0px 0px 2px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
}
/* Combo boxes (menus that display months/years for direct selection) */
.calendar .combo {
position: absolute;
display: none;
width: 4em;
top: 0px;
left: 0px;
cursor: default;
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
background: #e4e0d8;
font-size: 90%;
padding: 1px;
z-index: 100;
}
.calendar .combo .label,
.calendar .combo .label-IEfix {
text-align: center;
padding: 1px;
}
.calendar .combo .label-IEfix {
width: 4em;
}
.calendar .combo .active {
background: #c4c0b8;
padding: 0px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
}
.calendar .combo .hilite {
background: #048;
color: #fea;
}
.calendar td.time {
border-top: 1px solid #000;
padding: 1px 0px;
text-align: center;
background-color: #f4f0e8;
}
.calendar td.time .hour,
.calendar td.time .minute,
.calendar td.time .ampm {
padding: 0px 3px 0px 4px;
border: 1px solid #889;
font-weight: bold;
background-color: #fff;
}
.calendar td.time .ampm {
text-align: center;
}
.calendar td.time .colon {
padding: 0px 2px 0px 3px;
font-weight: bold;
}
.calendar td.time span.hilite {
border-color: #000;
background-color: #766;
color: #fff;
}
.calendar td.time span.active {
border-color: #f00;
background-color: #000;
color: #0f0;
}

View File

@ -0,0 +1,271 @@
/* The main calendar widget. DIV containing a table. */
.calendar {
position: relative;
display: none;
border-top: 2px solid #fff;
border-right: 2px solid #000;
border-bottom: 2px solid #000;
border-left: 2px solid #fff;
font-size: 11px;
color: #000;
cursor: default;
background: #d4c8d0;
font-family: tahoma,verdana,sans-serif;
}
.calendar table {
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
font-size: 11px;
color: #000;
cursor: default;
background: #d4c8d0;
font-family: tahoma,verdana,sans-serif;
}
/* Header part -- contains navigation buttons and day names. */
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
text-align: center;
padding: 1px;
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
}
.calendar .nav {
background: transparent url(menuarrow.gif) no-repeat 100% 100%;
}
.calendar thead .title { /* This holds the current "month, year" */
font-weight: bold;
padding: 1px;
border: 1px solid #000;
background: #847880;
color: #fff;
text-align: center;
}
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
}
.calendar thead .daynames { /* Row <TR> containing the day names */
}
.calendar thead .name { /* Cells <TD> containing the day names */
border-bottom: 1px solid #000;
padding: 2px;
text-align: center;
background: #f4e8f0;
}
.calendar thead .weekend { /* How a weekend day name shows in header */
color: #f00;
}
.calendar thead .hilite { /* How do the buttons in header appear when hover */
border-top: 2px solid #fff;
border-right: 2px solid #000;
border-bottom: 2px solid #000;
border-left: 2px solid #fff;
padding: 0px;
background-color: #e4d8e0;
}
.calendar thead .active { /* Active (pressed) buttons in header */
padding: 2px 0px 0px 2px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
background-color: #c4b8c0;
}
/* The body part -- contains all the days in month. */
.calendar tbody .day { /* Cells <TD> containing month days dates */
width: 2em;
text-align: right;
padding: 2px 4px 2px 2px;
}
.calendar tbody .day.othermonth {
font-size: 80%;
color: #aaa;
}
.calendar tbody .day.othermonth.oweekend {
color: #faa;
}
.calendar table .wn {
padding: 2px 3px 2px 2px;
border-right: 1px solid #000;
background: #f4e8f0;
}
.calendar tbody .rowhilite td {
background: #e4d8e0;
}
.calendar tbody .rowhilite td.wn {
background: #d4c8d0;
}
.calendar tbody td.hilite { /* Hovered cells <TD> */
padding: 1px 3px 1px 1px;
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
}
.calendar tbody td.active { /* Active (pressed) cells <TD> */
padding: 2px 2px 0px 2px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
}
.calendar tbody td.selected { /* Cell showing selected date */
font-weight: bold;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
padding: 2px 2px 0px 2px;
background: #e4d8e0;
}
.calendar tbody td.weekend { /* Cells showing weekend days */
color: #f00;
}
.calendar tbody td.today { /* Cell showing today date */
font-weight: bold;
color: #00f;
}
.calendar tbody .disabled { color: #999; }
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
visibility: hidden;
}
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
display: none;
}
/* The footer part -- status bar and "Close" button */
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
}
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
background: #f4e8f0;
padding: 1px;
border: 1px solid #000;
background: #847880;
color: #fff;
text-align: center;
}
.calendar tfoot .hilite { /* Hover style for buttons in footer */
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
padding: 1px;
background: #e4d8e0;
}
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
padding: 2px 0px 0px 2px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
}
/* Combo boxes (menus that display months/years for direct selection) */
.calendar .combo {
position: absolute;
display: none;
width: 4em;
top: 0px;
left: 0px;
cursor: default;
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
background: #e4d8e0;
font-size: 90%;
padding: 1px;
z-index: 100;
}
.calendar .combo .label,
.calendar .combo .label-IEfix {
text-align: center;
padding: 1px;
}
.calendar .combo .label-IEfix {
width: 4em;
}
.calendar .combo .active {
background: #d4c8d0;
padding: 0px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
}
.calendar .combo .hilite {
background: #408;
color: #fea;
}
.calendar td.time {
border-top: 1px solid #000;
padding: 1px 0px;
text-align: center;
background-color: #f4f0e8;
}
.calendar td.time .hour,
.calendar td.time .minute,
.calendar td.time .ampm {
padding: 0px 3px 0px 4px;
border: 1px solid #889;
font-weight: bold;
background-color: #fff;
}
.calendar td.time .ampm {
text-align: center;
}
.calendar td.time .colon {
padding: 0px 2px 0px 3px;
font-weight: bold;
}
.calendar td.time span.hilite {
border-color: #000;
background-color: #766;
color: #fff;
}
.calendar td.time span.active {
border-color: #f00;
background-color: #000;
color: #0f0;
}

View File

@ -0,0 +1,265 @@
/* The main calendar widget. DIV containing a table. */
.calendar {
position: relative;
display: none;
border-top: 2px solid #fff;
border-right: 2px solid #000;
border-bottom: 2px solid #000;
border-left: 2px solid #fff;
font-size: 11px;
color: #000;
cursor: default;
background: #c8d0d4;
font-family: tahoma,verdana,sans-serif;
}
.calendar table {
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
font-size: 11px;
color: #000;
cursor: default;
background: #c8d0d4;
font-family: tahoma,verdana,sans-serif;
}
/* Header part -- contains navigation buttons and day names. */
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
text-align: center;
padding: 1px;
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
}
.calendar .nav {
background: transparent url(menuarrow.gif) no-repeat 100% 100%;
}
.calendar thead .title { /* This holds the current "month, year" */
font-weight: bold;
padding: 1px;
border: 1px solid #000;
background: #788084;
color: #fff;
text-align: center;
}
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
}
.calendar thead .daynames { /* Row <TR> containing the day names */
}
.calendar thead .name { /* Cells <TD> containing the day names */
border-bottom: 1px solid #000;
padding: 2px;
text-align: center;
background: #e8f0f4;
}
.calendar thead .weekend { /* How a weekend day name shows in header */
color: #f00;
}
.calendar thead .hilite { /* How do the buttons in header appear when hover */
border-top: 2px solid #fff;
border-right: 2px solid #000;
border-bottom: 2px solid #000;
border-left: 2px solid #fff;
padding: 0px;
background-color: #d8e0e4;
}
.calendar thead .active { /* Active (pressed) buttons in header */
padding: 2px 0px 0px 2px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
background-color: #b8c0c4;
}
/* The body part -- contains all the days in month. */
.calendar tbody .day { /* Cells <TD> containing month days dates */
width: 2em;
text-align: right;
padding: 2px 4px 2px 2px;
}
.calendar tbody .day.othermonth {
font-size: 80%;
color: #aaa;
}
.calendar tbody .day.othermonth.oweekend {
color: #faa;
}
.calendar table .wn {
padding: 2px 3px 2px 2px;
border-right: 1px solid #000;
background: #e8f4f0;
}
.calendar tbody .rowhilite td {
background: #d8e4e0;
}
.calendar tbody .rowhilite td.wn {
background: #c8d4d0;
}
.calendar tbody td.hilite { /* Hovered cells <TD> */
padding: 1px 3px 1px 1px;
border: 1px solid;
border-color: #fff #000 #000 #fff;
}
.calendar tbody td.active { /* Active (pressed) cells <TD> */
padding: 2px 2px 0px 2px;
border: 1px solid;
border-color: #000 #fff #fff #000;
}
.calendar tbody td.selected { /* Cell showing selected date */
font-weight: bold;
padding: 2px 2px 0px 2px;
border: 1px solid;
border-color: #000 #fff #fff #000;
background: #d8e0e4;
}
.calendar tbody td.weekend { /* Cells showing weekend days */
color: #f00;
}
.calendar tbody td.today { /* Cell showing today date */
font-weight: bold;
color: #00f;
}
.calendar tbody .disabled { color: #999; }
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
visibility: hidden;
}
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
display: none;
}
/* The footer part -- status bar and "Close" button */
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
}
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
background: #e8f0f4;
padding: 1px;
border: 1px solid #000;
background: #788084;
color: #fff;
text-align: center;
}
.calendar tfoot .hilite { /* Hover style for buttons in footer */
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
padding: 1px;
background: #d8e0e4;
}
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
padding: 2px 0px 0px 2px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
}
/* Combo boxes (menus that display months/years for direct selection) */
.calendar .combo {
position: absolute;
display: none;
width: 4em;
top: 0px;
left: 0px;
cursor: default;
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
background: #d8e0e4;
font-size: 90%;
padding: 1px;
z-index: 100;
}
.calendar .combo .label,
.calendar .combo .label-IEfix {
text-align: center;
padding: 1px;
}
.calendar .combo .label-IEfix {
width: 4em;
}
.calendar .combo .active {
background: #c8d0d4;
padding: 0px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
}
.calendar .combo .hilite {
background: #048;
color: #aef;
}
.calendar td.time {
border-top: 1px solid #000;
padding: 1px 0px;
text-align: center;
background-color: #e8f0f4;
}
.calendar td.time .hour,
.calendar td.time .minute,
.calendar td.time .ampm {
padding: 0px 3px 0px 4px;
border: 1px solid #889;
font-weight: bold;
background-color: #fff;
}
.calendar td.time .ampm {
text-align: center;
}
.calendar td.time .colon {
padding: 0px 2px 0px 3px;
font-weight: bold;
}
.calendar td.time span.hilite {
border-color: #000;
background-color: #667;
color: #fff;
}
.calendar td.time span.active {
border-color: #f00;
background-color: #000;
color: #0f0;
}

View File

@ -0,0 +1,271 @@
/* The main calendar widget. DIV containing a table. */
.calendar {
position: relative;
display: none;
border-top: 2px solid #fff;
border-right: 2px solid #000;
border-bottom: 2px solid #000;
border-left: 2px solid #fff;
font-size: 11px;
color: #000;
cursor: default;
background: #c8d4d0;
font-family: tahoma,verdana,sans-serif;
}
.calendar table {
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
font-size: 11px;
color: #000;
cursor: default;
background: #c8d4d0;
font-family: tahoma,verdana,sans-serif;
}
/* Header part -- contains navigation buttons and day names. */
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
text-align: center;
padding: 1px;
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
}
.calendar .nav {
background: transparent url(menuarrow.gif) no-repeat 100% 100%;
}
.calendar thead .title { /* This holds the current "month, year" */
font-weight: bold;
padding: 1px;
border: 1px solid #000;
background: #788480;
color: #fff;
text-align: center;
}
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
}
.calendar thead .daynames { /* Row <TR> containing the day names */
}
.calendar thead .name { /* Cells <TD> containing the day names */
border-bottom: 1px solid #000;
padding: 2px;
text-align: center;
background: #e8f4f0;
}
.calendar thead .weekend { /* How a weekend day name shows in header */
color: #f00;
}
.calendar thead .hilite { /* How do the buttons in header appear when hover */
border-top: 2px solid #fff;
border-right: 2px solid #000;
border-bottom: 2px solid #000;
border-left: 2px solid #fff;
padding: 0px;
background-color: #d8e4e0;
}
.calendar thead .active { /* Active (pressed) buttons in header */
padding: 2px 0px 0px 2px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
background-color: #b8c4c0;
}
/* The body part -- contains all the days in month. */
.calendar tbody .day { /* Cells <TD> containing month days dates */
width: 2em;
text-align: right;
padding: 2px 4px 2px 2px;
}
.calendar tbody .day.othermonth {
font-size: 80%;
color: #aaa;
}
.calendar tbody .day.othermonth.oweekend {
color: #faa;
}
.calendar table .wn {
padding: 2px 3px 2px 2px;
border-right: 1px solid #000;
background: #e8f4f0;
}
.calendar tbody .rowhilite td {
background: #d8e4e0;
}
.calendar tbody .rowhilite td.wn {
background: #c8d4d0;
}
.calendar tbody td.hilite { /* Hovered cells <TD> */
padding: 1px 3px 1px 1px;
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
}
.calendar tbody td.active { /* Active (pressed) cells <TD> */
padding: 2px 2px 0px 2px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
}
.calendar tbody td.selected { /* Cell showing selected date */
font-weight: bold;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
padding: 2px 2px 0px 2px;
background: #d8e4e0;
}
.calendar tbody td.weekend { /* Cells showing weekend days */
color: #f00;
}
.calendar tbody td.today { /* Cell showing today date */
font-weight: bold;
color: #00f;
}
.calendar tbody .disabled { color: #999; }
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
visibility: hidden;
}
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
display: none;
}
/* The footer part -- status bar and "Close" button */
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
}
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
background: #e8f4f0;
padding: 1px;
border: 1px solid #000;
background: #788480;
color: #fff;
text-align: center;
}
.calendar tfoot .hilite { /* Hover style for buttons in footer */
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
padding: 1px;
background: #d8e4e0;
}
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
padding: 2px 0px 0px 2px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
}
/* Combo boxes (menus that display months/years for direct selection) */
.calendar .combo {
position: absolute;
display: none;
width: 4em;
top: 0px;
left: 0px;
cursor: default;
border-top: 1px solid #fff;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #fff;
background: #d8e4e0;
font-size: 90%;
padding: 1px;
z-index: 100;
}
.calendar .combo .label,
.calendar .combo .label-IEfix {
text-align: center;
padding: 1px;
}
.calendar .combo .label-IEfix {
width: 4em;
}
.calendar .combo .active {
background: #c8d4d0;
padding: 0px;
border-top: 1px solid #000;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
border-left: 1px solid #000;
}
.calendar .combo .hilite {
background: #048;
color: #aef;
}
.calendar td.time {
border-top: 1px solid #000;
padding: 1px 0px;
text-align: center;
background-color: #e8f0f4;
}
.calendar td.time .hour,
.calendar td.time .minute,
.calendar td.time .ampm {
padding: 0px 3px 0px 4px;
border: 1px solid #889;
font-weight: bold;
background-color: #fff;
}
.calendar td.time .ampm {
text-align: center;
}
.calendar td.time .colon {
padding: 0px 2px 0px 3px;
font-weight: bold;
}
.calendar td.time span.hilite {
border-color: #000;
background-color: #667;
color: #fff;
}
.calendar td.time span.active {
border-color: #f00;
background-color: #000;
color: #0f0;
}

1806
jscalendar-1.0/calendar.js Normal file

File diff suppressed because it is too large Load Diff

119
jscalendar-1.0/calendar.php Normal file
View File

@ -0,0 +1,119 @@
<?php
/**
* File: calendar.php | (c) dynarch.com 2004
* Distributed as part of "The Coolest DHTML Calendar"
* under the same terms.
* -----------------------------------------------------------------
* This file implements a simple PHP wrapper for the calendar. It
* allows you to easily include all the calendar files and setup the
* calendar by instantiating and calling a PHP object.
*/
define('NEWLINE', "\n");
class DHTML_Calendar {
var $calendar_lib_path;
var $calendar_file;
var $calendar_lang_file;
var $calendar_setup_file;
var $calendar_theme_file;
var $calendar_options;
function DHTML_Calendar($calendar_lib_path = '/calendar/',
$lang = 'en',
$theme = 'calendar-win2k-1',
$stripped = true) {
if ($stripped) {
$this->calendar_file = 'calendar_stripped.js';
$this->calendar_setup_file = 'calendar-setup_stripped.js';
} else {
$this->calendar_file = 'calendar.js';
$this->calendar_setup_file = 'calendar-setup.js';
}
$this->calendar_lang_file = 'lang/calendar-' . $lang . '.js';
$this->calendar_theme_file = $theme.'.css';
$this->calendar_lib_path = preg_replace('/\/+$/', '/', $calendar_lib_path);
$this->calendar_options = array('ifFormat' => '%Y/%m/%d',
'daFormat' => '%Y/%m/%d');
}
function set_option($name, $value) {
$this->calendar_options[$name] = $value;
}
function load_files() {
echo $this->get_load_files_code();
}
function get_load_files_code() {
$code = ( '<link rel="stylesheet" type="text/css" media="all" href="' .
$this->calendar_lib_path . $this->calendar_theme_file .
'" />' . NEWLINE );
$code .= ( '<script type="text/javascript" src="' .
$this->calendar_lib_path . $this->calendar_file .
'"></script>' . NEWLINE );
$code .= ( '<script type="text/javascript" src="' .
$this->calendar_lib_path . $this->calendar_lang_file .
'"></script>' . NEWLINE );
$code .= ( '<script type="text/javascript" src="' .
$this->calendar_lib_path . $this->calendar_setup_file .
'"></script>' );
return $code;
}
function _make_calendar($other_options = array()) {
$js_options = $this->_make_js_hash(array_merge($this->calendar_options, $other_options));
$code = ( '<script type="text/javascript">Calendar.setup({' .
$js_options .
'});</script>' );
return $code;
}
function make_input_field($cal_options = array(), $field_attributes = array()) {
$id = $this->_gen_id();
$attrstr = $this->_make_html_attr(array_merge($field_attributes,
array('id' => $this->_field_id($id),
'type' => 'text')));
echo '<input ' . $attrstr .'/>';
echo '<a href="#" id="'. $this->_trigger_id($id) . '">' .
'<img align="middle" border="0" src="' . $this->calendar_lib_path . 'img.gif" alt="" /></a>';
$options = array_merge($cal_options,
array('inputField' => $this->_field_id($id),
'button' => $this->_trigger_id($id)));
echo $this->_make_calendar($options);
}
/// PRIVATE SECTION
function _field_id($id) { return 'f-calendar-field-' . $id; }
function _trigger_id($id) { return 'f-calendar-trigger-' . $id; }
function _gen_id() { static $id = 0; return ++$id; }
function _make_js_hash($array) {
$jstr = '';
reset($array);
while (list($key, $val) = each($array)) {
if (is_bool($val))
$val = $val ? 'true' : 'false';
else if (!is_numeric($val))
$val = '"'.$val.'"';
if ($jstr) $jstr .= ',';
$jstr .= '"' . $key . '":' . $val;
}
return $jstr;
}
function _make_html_attr($array) {
$attrstr = '';
reset($array);
while (list($key, $val) = each($array)) {
$attrstr .= $key . '="' . $val . '" ';
}
return $attrstr;
}
};
?>

File diff suppressed because one or more lines are too long

109
jscalendar-1.0/dayinfo.html Normal file
View File

@ -0,0 +1,109 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html> <head>
<title>How to include additional info in day cells</title>
<script type="text/javascript" src="calendar.js"></script>
<script type="text/javascript" src="lang/calendar-en.js"></script>
<script type="text/javascript" src="calendar-setup.js"></script>
<script type="text/javascript">
// define info for dates in this table:
var dateInfo = {
"20050308" : "Mishoo's&nbsp;birthday",
"20050310" : "foo",
"20050315" : "bar",
"20050318" : "25$",
"20050324" : "60$"
};
</script>
<style type="text/css">
@import url(calendar-win2k-1.css);
.calendar .inf { font-size: 80%; color: #444; }
.calendar .wn { font-weight: bold; vertical-align: top; }
</style>
</head>
<body>
<h1>How to include additional info in day cells</h1>
<div id="flatcal" style="float: right"></div>
<script type="text/javascript">
function getDateText(date, d) {
var inf = dateInfo[date.print("%Y%m%d")];
if (!inf) {
return d + "<div class='inf'>&nbsp;</div>";
} else {
return d + "<div class='inf'>" + inf + "</div>";
}
};
function flatCallback(cal) {
if (cal.dateClicked) {
// do something here
window.status = "Selected: " + cal.date;
var inf = dateInfo[cal.date.print("%Y%m%d")];
if (inf) {
window.status += ". Additional info: " + inf;
}
}
};
Calendar.setup({
flat: "flatcal",
dateText: getDateText,
flatCallback: flatCallback
});
</script>
<p>The idea is simple:</p>
<ol>
<li>
<p>Define a callback that takes two parameters like this:</p>
<pre>function getDateText(date, d)</pre>
<p>
This function will receive the date object as the first
parameter and the current date number (1..31) as the second (you
can get it as well by calling date.getDate() but since it's very
probably useful I thought I'd pass it too so that we can avoid a
function call).
</p>
<p>
This function <em>must</em> return the text to be inserted in
the cell of the passed date. That is, one should at least
"return d;".
</p>
</li>
<li>
Pass the above function as the "dateText" parameter to
Calendar.setup.
</li>
</ol>
<p>
The function could simply look like:
</p>
<pre
> function getDateText(date, d) {
if (d == 12) {
return "12th";
} else if (d == 13) {
return "bad luck";
} /* ... etc ... */
}</pre>
<p>
but it's easy to imagine that this approach sucks. For a better
way, see the source of this page and note the usage of an externally
defined "dateText" object which maps "date" to "date info", also
taking into account the year and month. This object can be easily
generated from a database, and the getDateText function becomes
extremely simple (and static).
</p>
<p>
Cheers!
</p>
<hr />
<address><a href="http://dynarch.com/mishoo/">mishoo</a></address>
<!-- hhmts start --> Last modified: Sat Mar 5 17:18:06 EET 2005 <!-- hhmts end -->
</body> </html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,193 @@
body {
color: black;
/* background-color: #e5e5e5;*/
background-color: #ffffff;
/*background-color: beige;*/
margin-top: 2em;
margin-left: 8%;
margin-right: 8%;
}
h1,h2,h3,h4,h5,h6 {
margin-top: .5em;
}
.title {
font-size: 200%;
font-weight: normal;
}
.partheading {
font-size: 100%;
}
.chapterheading {
font-size: 100%;
}
.beginsection {
font-size: 110%;
}
.tiny {
font-size: 40%;
}
.scriptsize {
font-size: 60%;
}
.footnotesize {
font-size: 75%;
}
.small {
font-size: 90%;
}
.normalsize {
font-size: 100%;
}
.large {
font-size: 120%;
}
.largecap {
font-size: 150%;
}
.largeup {
font-size: 200%;
}
.huge {
font-size: 300%;
}
.hugecap {
font-size: 350%;
}
pre {
margin-left: 2em;
}
blockquote {
margin-left: 2em;
}
ol {
list-style-type: decimal;
}
ol ol {
list-style-type: lower-alpha;
}
ol ol ol {
list-style-type: lower-roman;
}
ol ol ol ol {
list-style-type: upper-alpha;
}
/*
.verbatim {
color: #4d0000;
}
*/
tt i {
font-family: serif;
}
.verbatim em {
font-family: serif;
}
.scheme em {
font-family: serif;
color: black;
}
.scheme {
color: brown;
}
.scheme .keyword {
color: #990000;
font-weight: bold;
}
.scheme .builtin {
color: #990000;
}
.scheme .variable {
color: navy;
}
.scheme .global {
color: purple;
}
.scheme .selfeval {
color: green;
}
.scheme .comment {
color: teal;
}
.schemeresponse {
color: green;
}
.navigation {
color: red;
text-align: right;
font-size: medium;
font-style: italic;
}
.disable {
/* color: #e5e5e5; */
color: gray;
}
.smallcaps {
font-size: 75%;
}
.smallprint {
color: gray;
font-size: 75%;
text-align: right;
}
/*
.smallprint hr {
text-align: left;
width: 40%;
}
*/
.footnoterule {
text-align: left;
width: 40%;
}
.colophon {
color: gray;
font-size: 80%;
text-align: right;
}
.colophon a {
color: gray;
}

View File

@ -0,0 +1,34 @@
html { margin: 0px; padding: 0px; background-color: #08f; color: #444; font-family: georgia,serif; }
body { margin: 2em 8%; background-color: #fff; padding: 1em; border: 2px ridge #048; }
a:link, a:visited { text-decoration: none; color: #00f; }
a:hover { color: #f00; text-decoration: underline; }
a:active { color: #f84; }
h1, h2, h3, h4, h5, h6 { font-family: tahoma,verdana,sans-serif; }
h2, h3 { font-weight: normal; }
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { text-decoration: none; }
h1 { font-size: 170%; border: 2px ridge #048; letter-spacing: 2px; color: #000; margin-left: -2em; margin-right: -2em;
background-color: #fff; padding: 2px 1em; background-color: #def; }
h2 { font-size: 140%; color: #222; }
h3 { font-size: 120%; color: #444; }
h1.title { font-size: 300%; font-family: georgia,serif; font-weight: normal; color: #846; letter-spacing: -1px;
border: none;
padding: none;
background-color: #fff;
border-bottom: 3px double #624; padding-bottom: 2px; margin-left: 8%; margin-right: 8%; }
.colophon { padding-top: 2em; color: #999; font-size: 90%; font-family: georgia,"times new roman",serif; }
.colophon a:link, .colophon a:visited { color: #755; }
.colophon a:hover { color: #422; text-decoration: underline; }
.footnote { font-size: 90%; font-style: italic; font-family: georgia,"times new roman",serif; margin: 0px 3em; }
.footnote sup { font-size: 120%; padding: 0px 0.3em; position: relative; top: -0.2em; }
.small { font-size: 90%; }
.verbatim { background-color: #eee; padding: 0.2em 1em; border: 1px solid #aaa; }

File diff suppressed because it is too large Load Diff

Binary file not shown.

BIN
jscalendar-1.0/img.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

330
jscalendar-1.0/index.html Normal file
View File

@ -0,0 +1,330 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- $Id: index.html,v 1.15 2005/03/05 14:38:10 mishoo Exp $ -->
<head>
<meta http-equiv="content-type" content="text/xml; charset=utf-8" />
<title>The Coolest DHTML Calendar - Online Demo</title>
<link rel="stylesheet" type="text/css" media="all" href="skins/aqua/theme.css" title="Aqua" />
<link rel="alternate stylesheet" type="text/css" media="all" href="calendar-blue.css" title="winter" />
<link rel="alternate stylesheet" type="text/css" media="all" href="calendar-blue2.css" title="blue" />
<link rel="alternate stylesheet" type="text/css" media="all" href="calendar-brown.css" title="summer" />
<link rel="alternate stylesheet" type="text/css" media="all" href="calendar-green.css" title="green" />
<link rel="alternate stylesheet" type="text/css" media="all" href="calendar-win2k-1.css" title="win2k-1" />
<link rel="alternate stylesheet" type="text/css" media="all" href="calendar-win2k-2.css" title="win2k-2" />
<link rel="alternate stylesheet" type="text/css" media="all" href="calendar-win2k-cold-1.css" title="win2k-cold-1" />
<link rel="alternate stylesheet" type="text/css" media="all" href="calendar-win2k-cold-2.css" title="win2k-cold-2" />
<link rel="alternate stylesheet" type="text/css" media="all" href="calendar-system.css" title="system" />
<!-- import the calendar script -->
<script type="text/javascript" src="calendar.js"></script>
<!-- import the language module -->
<script type="text/javascript" src="lang/calendar-en.js"></script>
<!-- other languages might be available in the lang directory; please check
your distribution archive. -->
<!-- helper script that uses the calendar -->
<script type="text/javascript">
var oldLink = null;
// code to change the active stylesheet
function setActiveStyleSheet(link, title) {
var i, a, main;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == title) a.disabled = false;
}
}
if (oldLink) oldLink.style.fontWeight = 'normal';
oldLink = link;
link.style.fontWeight = 'bold';
return false;
}
// This function gets called when the end-user clicks on some date.
function selected(cal, date) {
cal.sel.value = date; // just update the date in the input field.
if (cal.dateClicked && (cal.sel.id == "sel1" || cal.sel.id == "sel3"))
// if we add this call we close the calendar on single-click.
// just to exemplify both cases, we are using this only for the 1st
// and the 3rd field, while 2nd and 4th will still require double-click.
cal.callCloseHandler();
}
// And this gets called when the end-user clicks on the _selected_ date,
// or clicks on the "Close" button. It just hides the calendar without
// destroying it.
function closeHandler(cal) {
cal.hide(); // hide the calendar
// cal.destroy();
_dynarch_popupCalendar = null;
}
// This function shows the calendar under the element having the given id.
// It takes care of catching "mousedown" signals on document and hiding the
// calendar if the click was outside.
function showCalendar(id, format, showsTime, showsOtherMonths) {
var el = document.getElementById(id);
if (_dynarch_popupCalendar != null) {
// we already have some calendar created
_dynarch_popupCalendar.hide(); // so we hide it first.
} else {
// first-time call, create the calendar.
var cal = new Calendar(1, null, selected, closeHandler);
// uncomment the following line to hide the week numbers
// cal.weekNumbers = false;
if (typeof showsTime == "string") {
cal.showsTime = true;
cal.time24 = (showsTime == "24");
}
if (showsOtherMonths) {
cal.showsOtherMonths = true;
}
_dynarch_popupCalendar = cal; // remember it in the global var
cal.setRange(1900, 2070); // min/max year allowed.
cal.create();
}
_dynarch_popupCalendar.setDateFormat(format); // set the specified date format
_dynarch_popupCalendar.parseDate(el.value); // try to parse the text in field
_dynarch_popupCalendar.sel = el; // inform it what input field we use
// the reference element that we pass to showAtElement is the button that
// triggers the calendar. In this example we align the calendar bottom-right
// to the button.
_dynarch_popupCalendar.showAtElement(el.nextSibling, "Br"); // show the calendar
return false;
}
var MINUTE = 60 * 1000;
var HOUR = 60 * MINUTE;
var DAY = 24 * HOUR;
var WEEK = 7 * DAY;
// If this handler returns true then the "date" given as
// parameter will be disabled. In this example we enable
// only days within a range of 10 days from the current
// date.
// You can use the functions date.getFullYear() -- returns the year
// as 4 digit number, date.getMonth() -- returns the month as 0..11,
// and date.getDate() -- returns the date of the month as 1..31, to
// make heavy calculations here. However, beware that this function
// should be very fast, as it is called for each day in a month when
// the calendar is (re)constructed.
function isDisabled(date) {
var today = new Date();
return (Math.abs(date.getTime() - today.getTime()) / DAY) > 10;
}
function flatSelected(cal, date) {
var el = document.getElementById("preview");
el.innerHTML = date;
}
function showFlatCalendar() {
var parent = document.getElementById("display");
// construct a calendar giving only the "selected" handler.
var cal = new Calendar(0, null, flatSelected);
// hide week numbers
cal.weekNumbers = false;
// We want some dates to be disabled; see function isDisabled above
cal.setDisabledHandler(isDisabled);
cal.setDateFormat("%A, %B %e");
// this call must be the last as it might use data initialized above; if
// we specify a parent, as opposite to the "showCalendar" function above,
// then we create a flat calendar -- not popup. Hidden, though, but...
cal.create(parent);
// ... we can show it here.
cal.show();
}
</script>
<style type="text/css">
.ex { font-weight: bold; background: #fed; color: #080 }
.help { color: #080; font-style: italic; }
body { background: #fea; font: 10pt tahoma,verdana,sans-serif; }
table { font: 13px verdana,tahoma,sans-serif; }
a { color: #00f; }
a:visited { color: #00f; }
a:hover { color: #f00; background: #fefaf0; }
a:active { color: #08f; }
.key { border: 1px solid #000; background: #fff; color: #008;
padding: 0px 5px; cursor: default; font-size: 80%; }
</style>
</head>
<body onload="showFlatCalendar()">
<h2><a href="http://www.dynarch.com/projects/calendar/"
title="Visit the project website">jscalendar</a>-1.0
"It is happening again"</h2>
<p>
<div style="float: right; border: 1px solid #b87; padding: 2px; font-size: 90%; background: #ffb;">
Theme:<br />
<a href="#" id="defaultTheme" onclick="return setActiveStyleSheet(this, 'Aqua');">Aqua</a>
|
<a href="#" onclick="return setActiveStyleSheet(this, 'winter');">winter</a>
|
<a href="#" onclick="return setActiveStyleSheet(this, 'blue');">blue</a>
|
<a href="#" onclick="return setActiveStyleSheet(this, 'summer');">summer</a>
|
<a href="#" onclick="return setActiveStyleSheet(this, 'green');">green</a>
<br />
<a href="#" onclick="return setActiveStyleSheet(this, 'win2k-1');">win2k-1</a>
|
<a href="#" onclick="return setActiveStyleSheet(this, 'win2k-2');">win2k-2</a>
|
<a href="#" onclick="return setActiveStyleSheet(this, 'win2k-cold-1');">win2k-cold-1</a>
|
<a href="#" onclick="return setActiveStyleSheet(this, 'win2k-cold-2');">win2k-cold-2</a>
<br />
<a href="#" onclick="return setActiveStyleSheet(this, 'system');">system</a>
<script type="text/javascript">
setActiveStyleSheet(document.getElementById("defaultTheme"), "Aqua");
</script>
</div>
<a href="release-notes.html">Release notes</a>.
<br />
Set it up in minutes:
<a href="simple-1.html">popup calendar</a>,
<a href="simple-2.html">flat calendar</a>.
Other samples:
<a href="simple-3.html">special days</a>,
<a href="dayinfo.html">day info</a>,
<a href="multiple-dates.html">multiple dates selection</a>
<br />
Documentation:
<a href="doc/html/reference.html">HTML</a>,
<a href="doc/reference.pdf">PDF</a>.
<br />
</p>
<div style="padding-left:20px; font-size: 90%; font-style: italic;">
</div>
<table style="width: 100%">
<tr valign="top">
<td style="background: #ffa; padding: 5px; border: 1px solid #995;">
<form action="#">
<div style="background: #995; color: #ffa; font-weight: bold; padding: 2px;">
Popup examples
</div>
<br />
<b>Date #1:</b> <input type="text" name="date1" id="sel1" size="30"
><input type="reset" value=" ... "
onclick="return showCalendar('sel1', '%Y-%m-%d [%W] %H:%M', '24', true);"> %Y-%m-%d [%W] %H:%M -- single
click<br />
<b>Date #2:</b> <input type="text" name="date2" id="sel2" size="30"
><input type="reset" value=" ... "
onclick="return showCalendar('sel2', '%a, %b %e, %Y [%I:%M %p]', '12');"> %a, %b %e, %Y [%I:%M %p]
-- double click
<br /><br />
<!--
if you remove this comment and leave the following HTML code
you will see a horrible effect, in all supported browsers (IE and Mozilla).
-->
<SELECT multiple size="4" name="component-select">
<OPTION selected value="Component_1_a">Component_1</OPTION>
<OPTION selected value="Component_1_b">Component_2</OPTION>
<OPTION>Component_3</OPTION>
<OPTION>Component_4</OPTION>
<OPTION>Component_5</OPTION>
<OPTION>Component_6</OPTION>
<OPTION>Component_7</OPTION>
</SELECT>
this select should hide when the calendar is above it.
<br /><br />
<b>Date #3:</b> <input type="text" name="date3" id="sel3" size="30"
><input type="reset" value=" ... "
onclick="return showCalendar('sel3', '%d/%m/%Y');"> %d/%m/%Y
-- single click
<br />
<b>Date #4:</b> <input type="text" name="date4" id="sel4" size="30"
><input type="reset" value=" ... "
onclick="return showCalendar('sel4', '%A, %B %e, %Y');"> %A, %B %e, %Y --
double click
</form>
<p>This is release <b>1.0</b>. Works on MSIE/Win 5.0 or better (really),
Opera 7+, Mozilla, Firefox, Netscape 6.x, 7.0 and all other Gecko-s,
Konqueror and Safari.</p>
<h4>Keyboard navigation</h4>
<p>Starting with version 0.9.2, you can also use the keyboard to select
dates (only for popup calendars; does <em>not</em> work with Opera
7 or Konqueror/Safari). The following keys are available:</p>
<ul>
<li><span class="key">&larr;</span> , <span class="key">&rarr;</span> ,
<span class="key">&uarr;</span> , <span class="key">&darr;</span> -- select date</li>
<li><span class="key">CTRL</span> + <span class="key">&larr;</span> ,
<span class="key">&rarr;</span> -- select month</li>
<li><span class="key">CTRL</span> + <span class="key">&uarr;</span> ,
<span class="key">&darr;</span> -- select year</li>
<li><span class="key">SPACE</span> -- go to <em>today</em> date</li>
<li><span class="key">ENTER</span> -- accept the currently selected date</li>
<li><span class="key">ESC</span> -- cancel selection</li>
</ul>
</td>
<td style="padding: 5px; margin: 5px; border: 1px solid #984; background: #ed9; width: 19em;">
<div style="background: #984; color: #fea; font-weight: bold; padding: 2px; text-align: center">
Flat calendar
</div>
<p style="width: 12em"><small>A non-popup version will appear below as soon
as the page is loaded. Note that it doesn't show the week number.</small></p>
<!-- the calendar will be inserted here -->
<div id="display" style="float: right; clear: both;"></div>
<div id="preview" style="font-size: 80%; text-align: center; padding: 2px">&nbsp;</div>
<p style="clear: both;"><small>
The example above uses the <code>setDisabledHandler()</code> member function
to setup a handler that would only enable days withing a range of 10 days,
forward or backward, from the current date.
</small></p>
</div>
</td>
</tr>
</table>
<hr /><address>
&copy; <a href="http://www.dynarch.com/">dynarch.com</a> 2002-2005 <br />
Author: <a href="http://www.bazon.net/mishoo/">Mihai
Bazon</a><br /> Distributed under the <a
href="http://www.gnu.org/licenses/lgpl.html">GNU LGPL</a>.</address>
<p style="font-size: smaller">If you use this script on a public page we
would love it if you would <a href="http://www.dynarch.com/contact.html">let us
know</a>.</p>
</body></html>

View File

@ -0,0 +1,39 @@
// ** I18N Afrikaans
Calendar._DN = new Array
("Sondag",
"Maandag",
"Dinsdag",
"Woensdag",
"Donderdag",
"Vrydag",
"Saterdag",
"Sondag");
Calendar._MN = new Array
("Januarie",
"Februarie",
"Maart",
"April",
"Mei",
"Junie",
"Julie",
"Augustus",
"September",
"Oktober",
"November",
"Desember");
// tooltips
Calendar._TT = {};
Calendar._TT["TOGGLE"] = "Verander eerste dag van die week";
Calendar._TT["PREV_YEAR"] = "Vorige jaar (hou vir keuselys)";
Calendar._TT["PREV_MONTH"] = "Vorige maand (hou vir keuselys)";
Calendar._TT["GO_TODAY"] = "Gaan na vandag";
Calendar._TT["NEXT_MONTH"] = "Volgende maand (hou vir keuselys)";
Calendar._TT["NEXT_YEAR"] = "Volgende jaar (hou vir keuselys)";
Calendar._TT["SEL_DATE"] = "Kies datum";
Calendar._TT["DRAG_TO_MOVE"] = "Sleep om te skuif";
Calendar._TT["PART_TODAY"] = " (vandag)";
Calendar._TT["MON_FIRST"] = "Vertoon Maandag eerste";
Calendar._TT["SUN_FIRST"] = "Display Sunday first";
Calendar._TT["CLOSE"] = "Close";
Calendar._TT["TODAY"] = "Today";

View File

@ -0,0 +1,101 @@
// Calendar ALBANIAN language
//author Rigels Gordani rige@hotmail.com
// ditet
Calendar._DN = new Array
("E Diele",
"E Hene",
"E Marte",
"E Merkure",
"E Enjte",
"E Premte",
"E Shtune",
"E Diele");
//ditet shkurt
Calendar._SDN = new Array
("Die",
"Hen",
"Mar",
"Mer",
"Enj",
"Pre",
"Sht",
"Die");
// muajt
Calendar._MN = new Array
("Janar",
"Shkurt",
"Mars",
"Prill",
"Maj",
"Qeshor",
"Korrik",
"Gusht",
"Shtator",
"Tetor",
"Nentor",
"Dhjetor");
// muajte shkurt
Calendar._SMN = new Array
("Jan",
"Shk",
"Mar",
"Pri",
"Maj",
"Qes",
"Kor",
"Gus",
"Sht",
"Tet",
"Nen",
"Dhj");
// ndihmesa
Calendar._TT = {};
Calendar._TT["INFO"] = "Per kalendarin";
Calendar._TT["ABOUT"] =
"Zgjedhes i ores/dates ne DHTML \n" +
"\n\n" +"Zgjedhja e Dates:\n" +
"- Perdor butonat \xab, \xbb per te zgjedhur vitin\n" +
"- Perdor butonat" + String.fromCharCode(0x2039) + ", " +
String.fromCharCode(0x203a) +
" per te zgjedhur muajin\n" +
"- Mbani shtypur butonin e mousit per nje zgjedje me te shpejte.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Zgjedhja e kohes:\n" +
"- Kliko tek ndonje nga pjeset e ores per ta rritur ate\n" +
"- ose kliko me Shift per ta zvogeluar ate\n" +
"- ose cliko dhe terhiq per zgjedhje me te shpejte.";
Calendar._TT["PREV_YEAR"] = "Viti i shkuar (prit per menune)";
Calendar._TT["PREV_MONTH"] = "Muaji i shkuar (prit per menune)";
Calendar._TT["GO_TODAY"] = "Sot";
Calendar._TT["NEXT_MONTH"] = "Muaji i ardhshem (prit per menune)";
Calendar._TT["NEXT_YEAR"] = "Viti i ardhshem (prit per menune)";
Calendar._TT["SEL_DATE"] = "Zgjidh daten";
Calendar._TT["DRAG_TO_MOVE"] = "Terhiqe per te levizur";
Calendar._TT["PART_TODAY"] = " (sot)";
// "%s" eshte dita e pare e javes
// %s do te zevendesohet me emrin e dite
Calendar._TT["DAY_FIRST"] = "Trego te %s te paren";
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Mbyll";
Calendar._TT["TODAY"] = "Sot";
Calendar._TT["TIME_PART"] = "Kliko me (Shift-)ose terhiqe per te ndryshuar
vleren";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
Calendar._TT["WK"] = "Java";
Calendar._TT["TIME"] = "Koha:";

View File

@ -0,0 +1,124 @@
// ** I18N
// Calendar BG language
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
// Translator: Valentin Sheiretsky, <valio@valio.eu.org>
// Encoding: Windows-1251
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("Íåäåëÿ",
"Ïîíåäåëíèê",
"Âòîðíèê",
"Ñðÿäà",
"×åòâúðòúê",
"Ïåòúê",
"Ñúáîòà",
"Íåäåëÿ");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("Íåä",
"Ïîí",
"Âòî",
"Ñðÿ",
"×åò",
"Ïåò",
"Ñúá",
"Íåä");
// full month names
Calendar._MN = new Array
("ßíóàðè",
"Ôåâðóàðè",
"Ìàðò",
"Àïðèë",
"Ìàé",
"Þíè",
"Þëè",
"Àâãóñò",
"Ñåïòåìâðè",
"Îêòîìâðè",
"Íîåìâðè",
"Äåêåìâðè");
// short month names
Calendar._SMN = new Array
("ßíó",
"Ôåâ",
"Ìàð",
"Àïð",
"Ìàé",
"Þíè",
"Þëè",
"Àâã",
"Ñåï",
"Îêò",
"Íîå",
"Äåê");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "Èíôîðìàöèÿ çà êàëåíäàðà";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
"\n\n" +
"Date selection:\n" +
"- Use the \xab, \xbb buttons to select year\n" +
"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" +
"- Hold mouse button on any of the above buttons for faster selection.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Time selection:\n" +
"- Click on any of the time parts to increase it\n" +
"- or Shift-click to decrease it\n" +
"- or click and drag for faster selection.";
Calendar._TT["PREV_YEAR"] = "Ïðåäíà ãîäèíà (çàäðúæòå çà ìåíþ)";
Calendar._TT["PREV_MONTH"] = "Ïðåäåí ìåñåö (çàäðúæòå çà ìåíþ)";
Calendar._TT["GO_TODAY"] = "Èçáåðåòå äíåñ";
Calendar._TT["NEXT_MONTH"] = "Ñëåäâàù ìåñåö (çàäðúæòå çà ìåíþ)";
Calendar._TT["NEXT_YEAR"] = "Ñëåäâàùà ãîäèíà (çàäðúæòå çà ìåíþ)";
Calendar._TT["SEL_DATE"] = "Èçáåðåòå äàòà";
Calendar._TT["DRAG_TO_MOVE"] = "Ïðåìåñòâàíå";
Calendar._TT["PART_TODAY"] = " (äíåñ)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "%s êàòî ïúðâè äåí";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Çàòâîðåòå";
Calendar._TT["TODAY"] = "Äíåñ";
Calendar._TT["TIME_PART"] = "(Shift-)Click èëè drag çà äà ïðîìåíèòå ñòîéíîñòòà";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
Calendar._TT["TT_DATE_FORMAT"] = "%A - %e %B %Y";
Calendar._TT["WK"] = "Ñåäì";
Calendar._TT["TIME"] = "×àñ:";

View File

@ -0,0 +1,123 @@
// ** I18N
// Calendar big5-utf8 language
// Author: Gary Fu, <gary@garyfu.idv.tw>
// Encoding: utf8
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
"星期日");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("日",
"一",
"二",
"三",
"四",
"五",
"六",
"日");
// full month names
Calendar._MN = new Array
("一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月");
// short month names
Calendar._SMN = new Array
("一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "關於";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
"\n\n" +
"日期選擇方法:\n" +
"- 使用 \xab, \xbb 按鈕可選擇年份\n" +
"- 使用 " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " 按鈕可選擇月份\n" +
"- 按住上面的按鈕可以加快選取";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"時間選擇方法:\n" +
"- 點擊任何的時間部份可增加其值\n" +
"- 同時按Shift鍵再點擊可減少其值\n" +
"- 點擊並拖曳可加快改變的值";
Calendar._TT["PREV_YEAR"] = "上一年 (按住選單)";
Calendar._TT["PREV_MONTH"] = "下一年 (按住選單)";
Calendar._TT["GO_TODAY"] = "到今日";
Calendar._TT["NEXT_MONTH"] = "上一月 (按住選單)";
Calendar._TT["NEXT_YEAR"] = "下一月 (按住選單)";
Calendar._TT["SEL_DATE"] = "選擇日期";
Calendar._TT["DRAG_TO_MOVE"] = "拖曳";
Calendar._TT["PART_TODAY"] = " (今日)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "將 %s 顯示在前";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "關閉";
Calendar._TT["TODAY"] = "今日";
Calendar._TT["TIME_PART"] = "點擊or拖曳可改變時間(同時按Shift為減)";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
Calendar._TT["WK"] = "週";
Calendar._TT["TIME"] = "Time:";

View File

@ -0,0 +1,123 @@
// ** I18N
// Calendar big5 language
// Author: Gary Fu, <gary@garyfu.idv.tw>
// Encoding: big5
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
"星期日");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("日",
"一",
"二",
"三",
"四",
"五",
"六",
"日");
// full month names
Calendar._MN = new Array
("一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月");
// short month names
Calendar._SMN = new Array
("一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "關於";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
"\n\n" +
"日期選擇方法:\n" +
"- 使用 \xab, \xbb 按鈕可選擇年份\n" +
"- 使用 " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " 按鈕可選擇月份\n" +
"- 按住上面的按鈕可以加快選取";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"時間選擇方法:\n" +
"- 點擊任何的時間部份可增加其值\n" +
"- 同時按Shift鍵再點擊可減少其值\n" +
"- 點擊並拖曳可加快改變的值";
Calendar._TT["PREV_YEAR"] = "上一年 (按住選單)";
Calendar._TT["PREV_MONTH"] = "下一年 (按住選單)";
Calendar._TT["GO_TODAY"] = "到今日";
Calendar._TT["NEXT_MONTH"] = "上一月 (按住選單)";
Calendar._TT["NEXT_YEAR"] = "下一月 (按住選單)";
Calendar._TT["SEL_DATE"] = "選擇日期";
Calendar._TT["DRAG_TO_MOVE"] = "拖曳";
Calendar._TT["PART_TODAY"] = " (今日)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "將 %s 顯示在前";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "關閉";
Calendar._TT["TODAY"] = "今日";
Calendar._TT["TIME_PART"] = "點擊or拖曳可改變時間(同時按Shift為減)";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
Calendar._TT["WK"] = "週";
Calendar._TT["TIME"] = "Time:";

View File

@ -0,0 +1,108 @@
// ** I18N
// Calendar pt-BR language
// Author: Fernando Dourado, <fernando.dourado@ig.com.br>
// Encoding: any
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("Domingo",
"Segunda",
"Terça",
"Quarta",
"Quinta",
"Sexta",
"Sabádo",
"Domingo");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
// [No changes using default values]
// full month names
Calendar._MN = new Array
("Janeiro",
"Fevereiro",
"Março",
"Abril",
"Maio",
"Junho",
"Julho",
"Agosto",
"Setembro",
"Outubro",
"Novembro",
"Dezembro");
// short month names
// [No changes using default values]
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "Sobre o calendário";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
"\n\n" +
"Translate to portuguese Brazil (pt-BR) by Fernando Dourado (fernando.dourado@ig.com.br)\n" +
"Tradução para o português Brasil (pt-BR) por Fernando Dourado (fernando.dourado@ig.com.br)" +
"\n\n" +
"Selecionar data:\n" +
"- Use as teclas \xab, \xbb para selecionar o ano\n" +
"- Use as teclas " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para selecionar o mês\n" +
"- Clique e segure com o mouse em qualquer botão para selecionar rapidamente.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Selecionar hora:\n" +
"- Clique em qualquer uma das partes da hora para aumentar\n" +
"- ou Shift-clique para diminuir\n" +
"- ou clique e arraste para selecionar rapidamente.";
Calendar._TT["PREV_YEAR"] = "Ano anterior (clique e segure para menu)";
Calendar._TT["PREV_MONTH"] = "Mês anterior (clique e segure para menu)";
Calendar._TT["GO_TODAY"] = "Ir para a data atual";
Calendar._TT["NEXT_MONTH"] = "Próximo mês (clique e segure para menu)";
Calendar._TT["NEXT_YEAR"] = "Próximo ano (clique e segure para menu)";
Calendar._TT["SEL_DATE"] = "Selecione uma data";
Calendar._TT["DRAG_TO_MOVE"] = "Clique e segure para mover";
Calendar._TT["PART_TODAY"] = " (hoje)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "Exibir %s primeiro";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Fechar";
Calendar._TT["TODAY"] = "Hoje";
Calendar._TT["TIME_PART"] = "(Shift-)Clique ou arraste para mudar o valor";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y";
Calendar._TT["TT_DATE_FORMAT"] = "%d de %B de %Y";
Calendar._TT["WK"] = "sem";
Calendar._TT["TIME"] = "Hora:";

View File

@ -0,0 +1,123 @@
// ** I18N
// Calendar CA language
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
// Encoding: any
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("Diumenge",
"Dilluns",
"Dimarts",
"Dimecres",
"Dijous",
"Divendres",
"Dissabte",
"Diumenge");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("Diu",
"Dil",
"Dmt",
"Dmc",
"Dij",
"Div",
"Dis",
"Diu");
// full month names
Calendar._MN = new Array
("Gener",
"Febrer",
"Març",
"Abril",
"Maig",
"Juny",
"Juliol",
"Agost",
"Setembre",
"Octubre",
"Novembre",
"Desembre");
// short month names
Calendar._SMN = new Array
("Gen",
"Feb",
"Mar",
"Abr",
"Mai",
"Jun",
"Jul",
"Ago",
"Set",
"Oct",
"Nov",
"Des");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "Sobre el calendari";
Calendar._TT["ABOUT"] =
"DHTML Selector de Data/Hora\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
"\n\n" +
"Sel.lecció de Dates:\n" +
"- Fes servir els botons \xab, \xbb per sel.leccionar l'any\n" +
"- Fes servir els botons " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " per se.lecciconar el mes\n" +
"- Manté el ratolí apretat en qualsevol dels anteriors per sel.lecció ràpida.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Time selection:\n" +
"- claca en qualsevol de les parts de la hora per augmentar-les\n" +
"- o Shift-click per decrementar-la\n" +
"- or click and arrastra per sel.lecció ràpida.";
Calendar._TT["PREV_YEAR"] = "Any anterior (Mantenir per menu)";
Calendar._TT["PREV_MONTH"] = "Mes anterior (Mantenir per menu)";
Calendar._TT["GO_TODAY"] = "Anar a avui";
Calendar._TT["NEXT_MONTH"] = "Mes següent (Mantenir per menu)";
Calendar._TT["NEXT_YEAR"] = "Any següent (Mantenir per menu)";
Calendar._TT["SEL_DATE"] = "Sel.leccionar data";
Calendar._TT["DRAG_TO_MOVE"] = "Arrastrar per moure";
Calendar._TT["PART_TODAY"] = " (avui)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "Mostra %s primer";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Tanca";
Calendar._TT["TODAY"] = "Avui";
Calendar._TT["TIME_PART"] = "(Shift-)Click a arrastra per canviar el valor";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
Calendar._TT["WK"] = "st";
Calendar._TT["TIME"] = "Hora:";

View File

@ -0,0 +1,65 @@
/*
calendar-cs-win.js
language: Czech
encoding: windows-1250
author: Lubos Jerabek (xnet@seznam.cz)
Jan Uhlir (espinosa@centrum.cz)
*/
// ** I18N
Calendar._DN = new Array('Neděle','Pondělí','Úterý','Středa','Čtvrtek','Pátek','Sobota','Neděle');
Calendar._SDN = new Array('Ne','Po','Út','St','Čt','Pá','So','Ne');
Calendar._MN = new Array('Leden','Únor','Březen','Duben','Květen','Červen','Červenec','Srpen','Září','Říjen','Listopad','Prosinec');
Calendar._SMN = new Array('Led','Úno','Bře','Dub','Kvě','Črv','Čvc','Srp','Zář','Říj','Lis','Pro');
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "O komponentě kalendář";
Calendar._TT["TOGGLE"] = "Změna prvního dne v týdnu";
Calendar._TT["PREV_YEAR"] = "Předchozí rok (přidrž pro menu)";
Calendar._TT["PREV_MONTH"] = "Předchozí měsíc (přidrž pro menu)";
Calendar._TT["GO_TODAY"] = "Dnešní datum";
Calendar._TT["NEXT_MONTH"] = "Další měsíc (přidrž pro menu)";
Calendar._TT["NEXT_YEAR"] = "Další rok (přidrž pro menu)";
Calendar._TT["SEL_DATE"] = "Vyber datum";
Calendar._TT["DRAG_TO_MOVE"] = "Chyť a táhni, pro přesun";
Calendar._TT["PART_TODAY"] = " (dnes)";
Calendar._TT["MON_FIRST"] = "Ukaž jako první Pondělí";
//Calendar._TT["SUN_FIRST"] = "Ukaž jako první Neděli";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
"\n\n" +
"Výběr datumu:\n" +
"- Use the \xab, \xbb buttons to select year\n" +
"- Použijte tlačítka " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " k výběru měsíce\n" +
"- Podržte tlačítko myši na jakémkoliv z těch tlačítek pro rychlejší výběr.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Výběr času:\n" +
"- Klikněte na jakoukoliv z částí výběru času pro zvýšení.\n" +
"- nebo Shift-click pro snížení\n" +
"- nebo klikněte a táhněte pro rychlejší výběr.";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "Zobraz %s první";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Zavřít";
Calendar._TT["TODAY"] = "Dnes";
Calendar._TT["TIME_PART"] = "(Shift-)Klikni nebo táhni pro změnu hodnoty";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "d.m.yy";
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
Calendar._TT["WK"] = "wk";
Calendar._TT["TIME"] = "Čas:";

View File

@ -0,0 +1,65 @@
/*
calendar-cs-win.js
language: Czech
encoding: windows-1250
author: Lubos Jerabek (xnet@seznam.cz)
Jan Uhlir (espinosa@centrum.cz)
*/
// ** I18N
Calendar._DN = new Array('Nedìle','Pondìlí','Úterý','Støeda','Ètvrtek','Pátek','Sobota','Nedìle');
Calendar._SDN = new Array('Ne','Po','Út','St','Èt','Pá','So','Ne');
Calendar._MN = new Array('Leden','Únor','Bøezen','Duben','Kvìten','Èerven','Èervenec','Srpen','Záøí','Øíjen','Listopad','Prosinec');
Calendar._SMN = new Array('Led','Úno','Bøe','Dub','Kvì','Èrv','Èvc','Srp','Záø','Øíj','Lis','Pro');
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "O komponentì kalendáø";
Calendar._TT["TOGGLE"] = "Zmìna prvního dne v týdnu";
Calendar._TT["PREV_YEAR"] = "Pøedchozí rok (pøidrž pro menu)";
Calendar._TT["PREV_MONTH"] = "Pøedchozí mìsíc (pøidrž pro menu)";
Calendar._TT["GO_TODAY"] = "Dnešní datum";
Calendar._TT["NEXT_MONTH"] = "Další mìsíc (pøidrž pro menu)";
Calendar._TT["NEXT_YEAR"] = "Další rok (pøidrž pro menu)";
Calendar._TT["SEL_DATE"] = "Vyber datum";
Calendar._TT["DRAG_TO_MOVE"] = "Chy<68> a táhni, pro pøesun";
Calendar._TT["PART_TODAY"] = " (dnes)";
Calendar._TT["MON_FIRST"] = "Ukaž jako první Pondìlí";
//Calendar._TT["SUN_FIRST"] = "Ukaž jako první Nedìli";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
"\n\n" +
"Výbìr datumu:\n" +
"- Use the \xab, \xbb buttons to select year\n" +
"- Použijte tlaèítka " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " k výbìru mìsíce\n" +
"- Podržte tlaèítko myši na jakémkoliv z tìch tlaèítek pro rychlejší výbìr.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Výbìr èasu:\n" +
"- Kliknìte na jakoukoliv z èástí výbìru èasu pro zvýšení.\n" +
"- nebo Shift-click pro snížení\n" +
"- nebo kliknìte a táhnìte pro rychlejší výbìr.";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "Zobraz %s první";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Zavøít";
Calendar._TT["TODAY"] = "Dnes";
Calendar._TT["TIME_PART"] = "(Shift-)Klikni nebo táhni pro zmìnu hodnoty";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "d.m.yy";
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
Calendar._TT["WK"] = "wk";
Calendar._TT["TIME"] = "Èas:";

View File

@ -0,0 +1,123 @@
// ** I18N
// Calendar DA language
// Author: Michael Thingmand Henriksen, <michael (a) thingmand dot dk>
// Encoding: any
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("Søndag",
"Mandag",
"Tirsdag",
"Onsdag",
"Torsdag",
"Fredag",
"Lørdag",
"Søndag");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("Søn",
"Man",
"Tir",
"Ons",
"Tor",
"Fre",
"Lør",
"Søn");
// full month names
Calendar._MN = new Array
("Januar",
"Februar",
"Marts",
"April",
"Maj",
"Juni",
"Juli",
"August",
"September",
"Oktober",
"November",
"December");
// short month names
Calendar._SMN = new Array
("Jan",
"Feb",
"Mar",
"Apr",
"Maj",
"Jun",
"Jul",
"Aug",
"Sep",
"Okt",
"Nov",
"Dec");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "Om Kalenderen";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"For den seneste version besøg: http://www.dynarch.com/projects/calendar/\n"; +
"Distribueret under GNU LGPL. Se http://gnu.org/licenses/lgpl.html for detajler." +
"\n\n" +
"Valg af dato:\n" +
"- Brug \xab, \xbb knapperne for at vælge år\n" +
"- Brug " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " knapperne for at vælge måned\n" +
"- Hold knappen på musen nede på knapperne ovenfor for hurtigere valg.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Valg af tid:\n" +
"- Klik på en vilkårlig del for større værdi\n" +
"- eller Shift-klik for for mindre værdi\n" +
"- eller klik og træk for hurtigere valg.";
Calendar._TT["PREV_YEAR"] = "Ét år tilbage (hold for menu)";
Calendar._TT["PREV_MONTH"] = "Én måned tilbage (hold for menu)";
Calendar._TT["GO_TODAY"] = "Gå til i dag";
Calendar._TT["NEXT_MONTH"] = "Én måned frem (hold for menu)";
Calendar._TT["NEXT_YEAR"] = "Ét år frem (hold for menu)";
Calendar._TT["SEL_DATE"] = "Vælg dag";
Calendar._TT["DRAG_TO_MOVE"] = "Træk vinduet";
Calendar._TT["PART_TODAY"] = " (i dag)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "Vis %s først";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Luk";
Calendar._TT["TODAY"] = "I dag";
Calendar._TT["TIME_PART"] = "(Shift-)klik eller træk for at ændre værdi";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%d-%m-%Y";
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
Calendar._TT["WK"] = "Uge";
Calendar._TT["TIME"] = "Tid:";

View File

@ -0,0 +1,124 @@
// ** I18N
// Calendar DE language
// Author: Jack (tR), <jack@jtr.de>
// Encoding: any
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("Sonntag",
"Montag",
"Dienstag",
"Mittwoch",
"Donnerstag",
"Freitag",
"Samstag",
"Sonntag");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("So",
"Mo",
"Di",
"Mi",
"Do",
"Fr",
"Sa",
"So");
// full month names
Calendar._MN = new Array
("Januar",
"Februar",
"M\u00e4rz",
"April",
"Mai",
"Juni",
"Juli",
"August",
"September",
"Oktober",
"November",
"Dezember");
// short month names
Calendar._SMN = new Array
("Jan",
"Feb",
"M\u00e4r",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Okt",
"Nov",
"Dez");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "\u00DCber dieses Kalendarmodul";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this ;-)
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
"\n\n" +
"Datum ausw\u00e4hlen:\n" +
"- Benutzen Sie die \xab, \xbb Buttons um das Jahr zu w\u00e4hlen\n" +
"- Benutzen Sie die " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " Buttons um den Monat zu w\u00e4hlen\n" +
"- F\u00fcr eine Schnellauswahl halten Sie die Maustaste \u00fcber diesen Buttons fest.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Zeit ausw\u00e4hlen:\n" +
"- Klicken Sie auf die Teile der Uhrzeit, um diese zu erh\u00F6hen\n" +
"- oder klicken Sie mit festgehaltener Shift-Taste um diese zu verringern\n" +
"- oder klicken und festhalten f\u00fcr Schnellauswahl.";
Calendar._TT["TOGGLE"] = "Ersten Tag der Woche w\u00e4hlen";
Calendar._TT["PREV_YEAR"] = "Voriges Jahr (Festhalten f\u00fcr Schnellauswahl)";
Calendar._TT["PREV_MONTH"] = "Voriger Monat (Festhalten f\u00fcr Schnellauswahl)";
Calendar._TT["GO_TODAY"] = "Heute ausw\u00e4hlen";
Calendar._TT["NEXT_MONTH"] = "N\u00e4chst. Monat (Festhalten f\u00fcr Schnellauswahl)";
Calendar._TT["NEXT_YEAR"] = "N\u00e4chst. Jahr (Festhalten f\u00fcr Schnellauswahl)";
Calendar._TT["SEL_DATE"] = "Datum ausw\u00e4hlen";
Calendar._TT["DRAG_TO_MOVE"] = "Zum Bewegen festhalten";
Calendar._TT["PART_TODAY"] = " (Heute)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "Woche beginnt mit %s ";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Schlie\u00dfen";
Calendar._TT["TODAY"] = "Heute";
Calendar._TT["TIME_PART"] = "(Shift-)Klick oder Festhalten und Ziehen um den Wert zu \u00e4ndern";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y";
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
Calendar._TT["WK"] = "wk";
Calendar._TT["TIME"] = "Zeit:";

View File

@ -0,0 +1,45 @@
// ** I18N
Calendar._DN = new Array
("Zondag",
"Maandag",
"Dinsdag",
"Woensdag",
"Donderdag",
"Vrijdag",
"Zaterdag",
"Zondag");
Calendar._MN = new Array
("Januari",
"Februari",
"Maart",
"April",
"Mei",
"Juni",
"Juli",
"Augustus",
"September",
"Oktober",
"November",
"December");
// tooltips
Calendar._TT = {};
Calendar._TT["TOGGLE"] = "Toggle startdag van de week";
Calendar._TT["PREV_YEAR"] = "Vorig jaar (indrukken voor menu)";
Calendar._TT["PREV_MONTH"] = "Vorige month (indrukken voor menu)";
Calendar._TT["GO_TODAY"] = "Naar Vandaag";
Calendar._TT["NEXT_MONTH"] = "Volgende Maand (indrukken voor menu)";
Calendar._TT["NEXT_YEAR"] = "Volgend jaar (indrukken voor menu)";
Calendar._TT["SEL_DATE"] = "Selecteer datum";
Calendar._TT["DRAG_TO_MOVE"] = "Sleep om te verplaatsen";
Calendar._TT["PART_TODAY"] = " (vandaag)";
Calendar._TT["MON_FIRST"] = "Toon Maandag eerst";
Calendar._TT["SUN_FIRST"] = "Toon Zondag eerst";
Calendar._TT["CLOSE"] = "Sluiten";
Calendar._TT["TODAY"] = "Vandaag";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd";
Calendar._TT["TT_DATE_FORMAT"] = "D, M d";
Calendar._TT["WK"] = "wk";

View File

@ -0,0 +1,89 @@
// ** I18N
Calendar._DN = new Array
("Κυριακή",
"Δευτέρα",
"Τρίτη",
"Τετάρτη",
"Πέμπτη",
"Παρασκευή",
"Σάββατο",
"Κυριακή");
Calendar._SDN = new Array
("Κυ",
"Δε",
"Tρ",
"Τε",
"Πε",
"Πα",
"Σα",
"Κυ");
Calendar._MN = new Array
("Ιανουάριος",
"Φεβρουάριος",
"Μάρτιος",
"Απρίλιος",
"Μάϊος",
"Ιούνιος",
"Ιούλιος",
"Αύγουστος",
"Σεπτέμβριος",
"Οκτώβριος",
"Νοέμβριος",
"Δεκέμβριος");
Calendar._SMN = new Array
("Ιαν",
"Φεβ",
"Μαρ",
"Απρ",
"Μαι",
"Ιουν",
"Ιουλ",
"Αυγ",
"Σεπ",
"Οκτ",
"Νοε",
"Δεκ");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "Για το ημερολόγιο";
Calendar._TT["ABOUT"] =
"Επιλογέας ημερομηνίας/ώρας σε DHTML\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"Για τελευταία έκδοση: http://www.dynarch.com/projects/calendar/\n" +
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
"\n\n" +
"Επιλογή ημερομηνίας:\n" +
"- Χρησιμοποιείστε τα κουμπιά \xab, \xbb για επιλογή έτους\n" +
"- Χρησιμοποιείστε τα κουμπιά " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " για επιλογή μήνα\n" +
"- Κρατήστε κουμπί ποντικού πατημένο στα παραπάνω κουμπιά για πιο γρήγορη επιλογή.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Επιλογή ώρας:\n" +
"- Κάντε κλικ σε ένα από τα μέρη της ώρας για αύξηση\n" +
"- ή Shift-κλικ για μείωση\n" +
"- ή κλικ και μετακίνηση για πιο γρήγορη επιλογή.";
Calendar._TT["TOGGLE"] = "Μπάρα πρώτης ημέρας της εβδομάδας";
Calendar._TT["PREV_YEAR"] = "Προηγ. έτος (κρατήστε για το μενού)";
Calendar._TT["PREV_MONTH"] = "Προηγ. μήνας (κρατήστε για το μενού)";
Calendar._TT["GO_TODAY"] = "Σήμερα";
Calendar._TT["NEXT_MONTH"] = "Επόμενος μήνας (κρατήστε για το μενού)";
Calendar._TT["NEXT_YEAR"] = "Επόμενο έτος (κρατήστε για το μενού)";
Calendar._TT["SEL_DATE"] = "Επιλέξτε ημερομηνία";
Calendar._TT["DRAG_TO_MOVE"] = "Σύρτε για να μετακινήσετε";
Calendar._TT["PART_TODAY"] = " (σήμερα)";
Calendar._TT["MON_FIRST"] = "Εμφάνιση Δευτέρας πρώτα";
Calendar._TT["SUN_FIRST"] = "Εμφάνιση Κυριακής πρώτα";
Calendar._TT["CLOSE"] = "Κλείσιμο";
Calendar._TT["TODAY"] = "Σήμερα";
Calendar._TT["TIME_PART"] = "(Shift-)κλικ ή μετακίνηση για αλλαγή";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-y";
Calendar._TT["TT_DATE_FORMAT"] = "D, d M";
Calendar._TT["WK"] = "εβδ";

View File

@ -0,0 +1,127 @@
// ** I18N
// Calendar EN language
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
// Encoding: any
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun");
// First day of the week. "0" means display Sunday first, "1" means display
// Monday first, etc.
Calendar._FD = 0;
// full month names
Calendar._MN = new Array
("January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December");
// short month names
Calendar._SMN = new Array
("Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "About the calendar";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
"\n\n" +
"Date selection:\n" +
"- Use the \xab, \xbb buttons to select year\n" +
"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" +
"- Hold mouse button on any of the above buttons for faster selection.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Time selection:\n" +
"- Click on any of the time parts to increase it\n" +
"- or Shift-click to decrease it\n" +
"- or click and drag for faster selection.";
Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)";
Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)";
Calendar._TT["GO_TODAY"] = "Go Today";
Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)";
Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)";
Calendar._TT["SEL_DATE"] = "Select date";
Calendar._TT["DRAG_TO_MOVE"] = "Drag to move";
Calendar._TT["PART_TODAY"] = " (today)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "Display %s first";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Close";
Calendar._TT["TODAY"] = "Today";
Calendar._TT["TIME_PART"] = "(Shift-)Click or drag to change value";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
Calendar._TT["WK"] = "wk";
Calendar._TT["TIME"] = "Time:";

View File

@ -0,0 +1,129 @@
// ** I18N
// Calendar ES (spanish) language
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
// Updater: Servilio Afre Puentes <servilios@yahoo.com>
// Updated: 2004-06-03
// Encoding: utf-8
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("Domingo",
"Lunes",
"Martes",
"Miércoles",
"Jueves",
"Viernes",
"Sábado",
"Domingo");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("Dom",
"Lun",
"Mar",
"Mié",
"Jue",
"Vie",
"Sáb",
"Dom");
// First day of the week. "0" means display Sunday first, "1" means display
// Monday first, etc.
Calendar._FD = 1;
// full month names
Calendar._MN = new Array
("Enero",
"Febrero",
"Marzo",
"Abril",
"Mayo",
"Junio",
"Julio",
"Agosto",
"Septiembre",
"Octubre",
"Noviembre",
"Diciembre");
// short month names
Calendar._SMN = new Array
("Ene",
"Feb",
"Mar",
"Abr",
"May",
"Jun",
"Jul",
"Ago",
"Sep",
"Oct",
"Nov",
"Dic");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "Acerca del calendario";
Calendar._TT["ABOUT"] =
"Selector DHTML de Fecha/Hora\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"Para conseguir la última versión visite: http://www.dynarch.com/projects/calendar/\n" +
"Distribuido bajo licencia GNU LGPL. Visite http://gnu.org/licenses/lgpl.html para más detalles." +
"\n\n" +
"Selección de fecha:\n" +
"- Use los botones \xab, \xbb para seleccionar el año\n" +
"- Use los botones " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para seleccionar el mes\n" +
"- Mantenga pulsado el ratón en cualquiera de estos botones para una selección rápida.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Selección de hora:\n" +
"- Pulse en cualquiera de las partes de la hora para incrementarla\n" +
"- o pulse las mayúsculas mientras hace clic para decrementarla\n" +
"- o haga clic y arrastre el ratón para una selección más rápida.";
Calendar._TT["PREV_YEAR"] = "Año anterior (mantener para menú)";
Calendar._TT["PREV_MONTH"] = "Mes anterior (mantener para menú)";
Calendar._TT["GO_TODAY"] = "Ir a hoy";
Calendar._TT["NEXT_MONTH"] = "Mes siguiente (mantener para menú)";
Calendar._TT["NEXT_YEAR"] = "Año siguiente (mantener para menú)";
Calendar._TT["SEL_DATE"] = "Seleccionar fecha";
Calendar._TT["DRAG_TO_MOVE"] = "Arrastrar para mover";
Calendar._TT["PART_TODAY"] = " (hoy)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "Hacer %s primer día de la semana";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Cerrar";
Calendar._TT["TODAY"] = "Hoy";
Calendar._TT["TIME_PART"] = "(Mayúscula-)Clic o arrastre para cambiar valor";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y";
Calendar._TT["TT_DATE_FORMAT"] = "%A, %e de %B de %Y";
Calendar._TT["WK"] = "sem";
Calendar._TT["TIME"] = "Hora:";

View File

@ -0,0 +1,98 @@
// ** I18N
// Calendar FI language (Finnish, Suomi)
// Author: Jarno Käyhkö, <gambler@phnet.fi>
// Encoding: UTF-8
// Distributed under the same terms as the calendar itself.
// full day names
Calendar._DN = new Array
("Sunnuntai",
"Maanantai",
"Tiistai",
"Keskiviikko",
"Torstai",
"Perjantai",
"Lauantai",
"Sunnuntai");
// short day names
Calendar._SDN = new Array
("Su",
"Ma",
"Ti",
"Ke",
"To",
"Pe",
"La",
"Su");
// full month names
Calendar._MN = new Array
("Tammikuu",
"Helmikuu",
"Maaliskuu",
"Huhtikuu",
"Toukokuu",
"Kesäkuu",
"Heinäkuu",
"Elokuu",
"Syyskuu",
"Lokakuu",
"Marraskuu",
"Joulukuu");
// short month names
Calendar._SMN = new Array
("Tam",
"Hel",
"Maa",
"Huh",
"Tou",
"Kes",
"Hei",
"Elo",
"Syy",
"Lok",
"Mar",
"Jou");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "Tietoja kalenterista";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"Uusin versio osoitteessa: http://www.dynarch.com/projects/calendar/\n" +
"Julkaistu GNU LGPL lisenssin alaisuudessa. Lisätietoja osoitteessa http://gnu.org/licenses/lgpl.html" +
"\n\n" +
"Päivämäärä valinta:\n" +
"- Käytä \xab, \xbb painikkeita valitaksesi vuosi\n" +
"- Käytä " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " painikkeita valitaksesi kuukausi\n" +
"- Pitämällä hiiren painiketta minkä tahansa yllä olevan painikkeen kohdalla, saat näkyviin valikon nopeampaan siirtymiseen.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Ajan valinta:\n" +
"- Klikkaa kellonajan numeroita lisätäksesi aikaa\n" +
"- tai pitämällä Shift-näppäintä pohjassa saat aikaa taaksepäin\n" +
"- tai klikkaa ja pidä hiiren painike pohjassa sekä liikuta hiirtä muuttaaksesi aikaa nopeasti eteen- ja taaksepäin.";
Calendar._TT["PREV_YEAR"] = "Edell. vuosi (paina hetki, näet valikon)";
Calendar._TT["PREV_MONTH"] = "Edell. kuukausi (paina hetki, näet valikon)";
Calendar._TT["GO_TODAY"] = "Siirry tähän päivään";
Calendar._TT["NEXT_MONTH"] = "Seur. kuukausi (paina hetki, näet valikon)";
Calendar._TT["NEXT_YEAR"] = "Seur. vuosi (paina hetki, näet valikon)";
Calendar._TT["SEL_DATE"] = "Valitse päivämäärä";
Calendar._TT["DRAG_TO_MOVE"] = "Siirrä kalenterin paikkaa";
Calendar._TT["PART_TODAY"] = " (tänään)";
Calendar._TT["MON_FIRST"] = "Näytä maanantai ensimmäisenä";
Calendar._TT["SUN_FIRST"] = "Näytä sunnuntai ensimmäisenä";
Calendar._TT["CLOSE"] = "Sulje";
Calendar._TT["TODAY"] = "Tänään";
Calendar._TT["TIME_PART"] = "(Shift-) Klikkaa tai liikuta muuttaaksesi aikaa";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y";
Calendar._TT["TT_DATE_FORMAT"] = "%d.%m.%Y";
Calendar._TT["WK"] = "Vko";

View File

@ -0,0 +1,125 @@
// ** I18N
// Calendar EN language
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
// Encoding: any
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// Translator: David Duret, <pilgrim@mala-template.net> from previous french version
// full day names
Calendar._DN = new Array
("Dimanche",
"Lundi",
"Mardi",
"Mercredi",
"Jeudi",
"Vendredi",
"Samedi",
"Dimanche");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("Dim",
"Lun",
"Mar",
"Mar",
"Jeu",
"Ven",
"Sam",
"Dim");
// full month names
Calendar._MN = new Array
("Janvier",
"Février",
"Mars",
"Avril",
"Mai",
"Juin",
"Juillet",
"Août",
"Septembre",
"Octobre",
"Novembre",
"Décembre");
// short month names
Calendar._SMN = new Array
("Jan",
"Fev",
"Mar",
"Avr",
"Mai",
"Juin",
"Juil",
"Aout",
"Sep",
"Oct",
"Nov",
"Dec");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "A propos du calendrier";
Calendar._TT["ABOUT"] =
"DHTML Date/Heure Selecteur\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"Pour la derniere version visitez : http://www.dynarch.com/projects/calendar/\n" +
"Distribué par GNU LGPL. Voir http://gnu.org/licenses/lgpl.html pour les details." +
"\n\n" +
"Selection de la date :\n" +
"- Utiliser les bouttons \xab, \xbb pour selectionner l\'annee\n" +
"- Utiliser les bouttons " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " pour selectionner les mois\n" +
"- Garder la souris sur n'importe quels boutons pour une selection plus rapide";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Selection de l\'heure :\n" +
"- Cliquer sur heures ou minutes pour incrementer\n" +
"- ou Maj-clic pour decrementer\n" +
"- ou clic et glisser-deplacer pour une selection plus rapide";
Calendar._TT["PREV_YEAR"] = "Année préc. (maintenir pour menu)";
Calendar._TT["PREV_MONTH"] = "Mois préc. (maintenir pour menu)";
Calendar._TT["GO_TODAY"] = "Atteindre la date du jour";
Calendar._TT["NEXT_MONTH"] = "Mois suiv. (maintenir pour menu)";
Calendar._TT["NEXT_YEAR"] = "Année suiv. (maintenir pour menu)";
Calendar._TT["SEL_DATE"] = "Sélectionner une date";
Calendar._TT["DRAG_TO_MOVE"] = "Déplacer";
Calendar._TT["PART_TODAY"] = " (Aujourd'hui)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "Afficher %s en premier";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Fermer";
Calendar._TT["TODAY"] = "Aujourd'hui";
Calendar._TT["TIME_PART"] = "(Maj-)Clic ou glisser pour modifier la valeur";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y";
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
Calendar._TT["WK"] = "Sem.";
Calendar._TT["TIME"] = "Heure :";

View File

@ -0,0 +1,123 @@
// ** I18N
// Calendar EN language
// Author: Idan Sofer, <idan@idanso.dyndns.org>
// Encoding: UTF-8
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("ראשון",
"שני",
"שלישי",
"רביעי",
"חמישי",
"שישי",
"שבת",
"ראשון");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("א",
"ב",
"ג",
"ד",
"ה",
"ו",
"ש",
"א");
// full month names
Calendar._MN = new Array
("ינואר",
"פברואר",
"מרץ",
"אפריל",
"מאי",
"יוני",
"יולי",
"אוגוסט",
"ספטמבר",
"אוקטובר",
"נובמבר",
"דצמבר");
// short month names
Calendar._SMN = new Array
("ינא",
"פבר",
"מרץ",
"אפר",
"מאי",
"יונ",
"יול",
"אוג",
"ספט",
"אוק",
"נוב",
"דצמ");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "אודות השנתון";
Calendar._TT["ABOUT"] =
"בחרן תאריך/שעה DHTML\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"הגירסא האחרונה זמינה ב: http://www.dynarch.com/projects/calendar/\n" +
"מופץ תחת זיכיון ה GNU LGPL. עיין ב http://gnu.org/licenses/lgpl.html לפרטים נוספים." +
"\n\n" +
בחירת תאריך:\n" +
"- השתמש בכפתורים \xab, \xbb לבחירת שנה\n" +
"- השתמש בכפתורים " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " לבחירת חודש\n" +
"- החזק העכבר לחוץ מעל הכפתורים המוזכרים לעיל לבחירה מהירה יותר.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"בחירת זמן:\n" +
"- לחץ על כל אחד מחלקי הזמן כדי להוסיף\n" +
"- או shift בשילוב עם לחיצה כדי להחסיר\n" +
"- או לחץ וגרור לפעולה מהירה יותר.";
Calendar._TT["PREV_YEAR"] = "שנה קודמת - החזק לקבלת תפריט";
Calendar._TT["PREV_MONTH"] = "חודש קודם - החזק לקבלת תפריט";
Calendar._TT["GO_TODAY"] = "עבור להיום";
Calendar._TT["NEXT_MONTH"] = "חודש הבא - החזק לתפריט";
Calendar._TT["NEXT_YEAR"] = "שנה הבאה - החזק לתפריט";
Calendar._TT["SEL_DATE"] = "בחר תאריך";
Calendar._TT["DRAG_TO_MOVE"] = "גרור להזזה";
Calendar._TT["PART_TODAY"] = " )היום(";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "הצג %s קודם";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "6";
Calendar._TT["CLOSE"] = "סגור";
Calendar._TT["TODAY"] = "היום";
Calendar._TT["TIME_PART"] = "(שיפט-)לחץ וגרור כדי לשנות ערך";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
Calendar._TT["WK"] = "wk";
Calendar._TT["TIME"] = "שעה::";

View File

@ -0,0 +1,49 @@
/* Croatian language file for the DHTML Calendar version 0.9.2
* Author Krunoslav Zubrinic <krunoslav.zubrinic@vip.hr>, June 2003.
* Feel free to use this script under the terms of the GNU Lesser General
* Public License, as long as you do not remove or alter this notice.
*/
Calendar._DN = new Array
("Nedjelja",
"Ponedjeljak",
"Utorak",
"Srijeda",
"Četvrtak",
"Petak",
"Subota",
"Nedjelja");
Calendar._MN = new Array
("Siječanj",
"Veljača",
"Ožujak",
"Travanj",
"Svibanj",
"Lipanj",
"Srpanj",
"Kolovoz",
"Rujan",
"Listopad",
"Studeni",
"Prosinac");
// tooltips
Calendar._TT = {};
Calendar._TT["TOGGLE"] = "Promjeni dan s kojim počinje tjedan";
Calendar._TT["PREV_YEAR"] = "Prethodna godina (dugi pritisak za meni)";
Calendar._TT["PREV_MONTH"] = "Prethodni mjesec (dugi pritisak za meni)";
Calendar._TT["GO_TODAY"] = "Idi na tekući dan";
Calendar._TT["NEXT_MONTH"] = "Slijedeći mjesec (dugi pritisak za meni)";
Calendar._TT["NEXT_YEAR"] = "Slijedeća godina (dugi pritisak za meni)";
Calendar._TT["SEL_DATE"] = "Izaberite datum";
Calendar._TT["DRAG_TO_MOVE"] = "Pritisni i povuci za promjenu pozicije";
Calendar._TT["PART_TODAY"] = " (today)";
Calendar._TT["MON_FIRST"] = "Prikaži ponedjeljak kao prvi dan";
Calendar._TT["SUN_FIRST"] = "Prikaži nedjelju kao prvi dan";
Calendar._TT["CLOSE"] = "Zatvori";
Calendar._TT["TODAY"] = "Danas";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-y";
Calendar._TT["TT_DATE_FORMAT"] = "DD, dd.mm.y";
Calendar._TT["WK"] = "Tje";

Binary file not shown.

View File

@ -0,0 +1,124 @@
// ** I18N
// Calendar HU language
// Author: ???
// Modifier: KARASZI Istvan, <jscalendar@spam.raszi.hu>
// Encoding: any
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("Vasárnap",
"Hétfõ",
"Kedd",
"Szerda",
"Csütörtök",
"Péntek",
"Szombat",
"Vasárnap");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("v",
"h",
"k",
"sze",
"cs",
"p",
"szo",
"v");
// full month names
Calendar._MN = new Array
("január",
"február",
"március",
"április",
"május",
"június",
"július",
"augusztus",
"szeptember",
"október",
"november",
"december");
// short month names
Calendar._SMN = new Array
("jan",
"feb",
"már",
"ápr",
"máj",
"jún",
"júl",
"aug",
"sze",
"okt",
"nov",
"dec");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "A kalendáriumról";
Calendar._TT["ABOUT"] =
"DHTML dátum/idõ kiválasztó\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"a legfrissebb verzió megtalálható: http://www.dynarch.com/projects/calendar/\n" +
"GNU LGPL alatt terjesztve. Lásd a http://gnu.org/licenses/lgpl.html oldalt a részletekhez." +
"\n\n" +
"Dátum választás:\n" +
"- használja a \xab, \xbb gombokat az év kiválasztásához\n" +
"- használja a " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " gombokat a hónap kiválasztásához\n" +
"- tartsa lenyomva az egérgombot a gyors választáshoz.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Idõ választás:\n" +
"- kattintva növelheti az idõt\n" +
"- shift-tel kattintva csökkentheti\n" +
"- lenyomva tartva és húzva gyorsabban kiválaszthatja.";
Calendar._TT["PREV_YEAR"] = "Elõzõ év (tartsa nyomva a menühöz)";
Calendar._TT["PREV_MONTH"] = "Elõzõ hónap (tartsa nyomva a menühöz)";
Calendar._TT["GO_TODAY"] = "Mai napra ugrás";
Calendar._TT["NEXT_MONTH"] = "Köv. hónap (tartsa nyomva a menühöz)";
Calendar._TT["NEXT_YEAR"] = "Köv. év (tartsa nyomva a menühöz)";
Calendar._TT["SEL_DATE"] = "Válasszon dátumot";
Calendar._TT["DRAG_TO_MOVE"] = "Húzza a mozgatáshoz";
Calendar._TT["PART_TODAY"] = " (ma)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "%s legyen a hét elsõ napja";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Bezár";
Calendar._TT["TODAY"] = "Ma";
Calendar._TT["TIME_PART"] = "(Shift-)Klikk vagy húzás az érték változtatásához";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
Calendar._TT["TT_DATE_FORMAT"] = "%b %e, %a";
Calendar._TT["WK"] = "hét";
Calendar._TT["TIME"] = "idõ:";

View File

@ -0,0 +1,124 @@
// ** I18N
// Calendar EN language
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
// Translator: Fabio Di Bernardini, <altraqua@email.it>
// Encoding: any
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("Domenica",
"Lunedì",
"Martedì",
"Mercoledì",
"Giovedì",
"Venerdì",
"Sabato",
"Domenica");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("Dom",
"Lun",
"Mar",
"Mer",
"Gio",
"Ven",
"Sab",
"Dom");
// full month names
Calendar._MN = new Array
("Gennaio",
"Febbraio",
"Marzo",
"Aprile",
"Maggio",
"Giugno",
"Luglio",
"Augosto",
"Settembre",
"Ottobre",
"Novembre",
"Dicembre");
// short month names
Calendar._SMN = new Array
("Gen",
"Feb",
"Mar",
"Apr",
"Mag",
"Giu",
"Lug",
"Ago",
"Set",
"Ott",
"Nov",
"Dic");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "Informazioni sul calendario";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"Per gli aggiornamenti: http://www.dynarch.com/projects/calendar/\n" +
"Distribuito sotto licenza GNU LGPL. Vedi http://gnu.org/licenses/lgpl.html per i dettagli." +
"\n\n" +
"Selezione data:\n" +
"- Usa \xab, \xbb per selezionare l'anno\n" +
"- Usa " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " per i mesi\n" +
"- Tieni premuto a lungo il mouse per accedere alle funzioni di selezione veloce.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Selezione orario:\n" +
"- Clicca sul numero per incrementarlo\n" +
"- o Shift+click per decrementarlo\n" +
"- o click e sinistra o destra per variarlo.";
Calendar._TT["PREV_YEAR"] = "Anno prec.(clicca a lungo per il menù)";
Calendar._TT["PREV_MONTH"] = "Mese prec. (clicca a lungo per il menù)";
Calendar._TT["GO_TODAY"] = "Oggi";
Calendar._TT["NEXT_MONTH"] = "Pross. mese (clicca a lungo per il menù)";
Calendar._TT["NEXT_YEAR"] = "Pross. anno (clicca a lungo per il menù)";
Calendar._TT["SEL_DATE"] = "Seleziona data";
Calendar._TT["DRAG_TO_MOVE"] = "Trascina per spostarlo";
Calendar._TT["PART_TODAY"] = " (oggi)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "Mostra prima %s";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Chiudi";
Calendar._TT["TODAY"] = "Oggi";
Calendar._TT["TIME_PART"] = "(Shift-)Click o trascina per cambiare il valore";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%d-%m-%Y";
Calendar._TT["TT_DATE_FORMAT"] = "%a:%b:%e";
Calendar._TT["WK"] = "set";
Calendar._TT["TIME"] = "Ora:";

View File

@ -0,0 +1,45 @@
// ** I18N
Calendar._DN = new Array
("日",
"月",
"火",
"水",
"木",
"金",
"土",
"日");
Calendar._MN = new Array
("1月",
"2月",
"3月",
"4月",
"5月",
"6月",
"7月",
"8月",
"9月",
"10月",
"11月",
"12月");
// tooltips
Calendar._TT = {};
Calendar._TT["TOGGLE"] = "週の最初の曜日を切り替え";
Calendar._TT["PREV_YEAR"] = "前年";
Calendar._TT["PREV_MONTH"] = "前月";
Calendar._TT["GO_TODAY"] = "今日";
Calendar._TT["NEXT_MONTH"] = "翌月";
Calendar._TT["NEXT_YEAR"] = "翌年";
Calendar._TT["SEL_DATE"] = "日付選択";
Calendar._TT["DRAG_TO_MOVE"] = "ウィンドウの移動";
Calendar._TT["PART_TODAY"] = " (今日)";
Calendar._TT["MON_FIRST"] = "月曜日を先頭に";
Calendar._TT["SUN_FIRST"] = "日曜日を先頭に";
Calendar._TT["CLOSE"] = "閉じる";
Calendar._TT["TODAY"] = "今日";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd";
Calendar._TT["TT_DATE_FORMAT"] = "%m月 %d日 (%a)";
Calendar._TT["WK"] = "週";

View File

@ -0,0 +1,120 @@
// ** I18N
// Calendar EN language
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
// Translation: Yourim Yi <yyi@yourim.net>
// Encoding: EUC-KR
// lang : ko
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("일요일",
"월요일",
"화요일",
"수요일",
"목요일",
"금요일",
"토요일",
"일요일");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("일",
"월",
"화",
"수",
"목",
"금",
"토",
"일");
// full month names
Calendar._MN = new Array
("1월",
"2월",
"3월",
"4월",
"5월",
"6월",
"7월",
"8월",
"9월",
"10월",
"11월",
"12월");
// short month names
Calendar._SMN = new Array
("1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "calendar 에 대해서";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"\n"+
"최신 버전을 받으시려면 http://www.dynarch.com/projects/calendar/ 에 방문하세요\n" +
"\n"+
"GNU LGPL 라이센스로 배포됩니다. \n"+
"라이센스에 대한 자세한 내용은 http://gnu.org/licenses/lgpl.html 을 읽으세요." +
"\n\n" +
"날짜 선택:\n" +
"- 연도를 선택하려면 \xab, \xbb 버튼을 사용합니다\n" +
"- 달을 선택하려면 " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " 버튼을 누르세요\n" +
"- 계속 누르고 있으면 위 값들을 빠르게 선택하실 수 있습니다.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"시간 선택:\n" +
"- 마우스로 누르면 시간이 증가합니다\n" +
"- Shift 키와 함께 누르면 감소합니다\n" +
"- 누른 상태에서 마우스를 움직이면 좀 더 빠르게 값이 변합니다.\n";
Calendar._TT["PREV_YEAR"] = "지난 해 (길게 누르면 목록)";
Calendar._TT["PREV_MONTH"] = "지난 달 (길게 누르면 목록)";
Calendar._TT["GO_TODAY"] = "오늘 날짜로";
Calendar._TT["NEXT_MONTH"] = "다음 달 (길게 누르면 목록)";
Calendar._TT["NEXT_YEAR"] = "다음 해 (길게 누르면 목록)";
Calendar._TT["SEL_DATE"] = "날짜를 선택하세요";
Calendar._TT["DRAG_TO_MOVE"] = "마우스 드래그로 이동 하세요";
Calendar._TT["PART_TODAY"] = " (오늘)";
Calendar._TT["MON_FIRST"] = "월요일을 한 주의 시작 요일로";
Calendar._TT["SUN_FIRST"] = "일요일을 한 주의 시작 요일로";
Calendar._TT["CLOSE"] = "닫기";
Calendar._TT["TODAY"] = "오늘";
Calendar._TT["TIME_PART"] = "(Shift-)클릭 또는 드래그 하세요";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
Calendar._TT["TT_DATE_FORMAT"] = "%b/%e [%a]";
Calendar._TT["WK"] = "주";

View File

@ -0,0 +1,120 @@
// ** I18N
// Calendar EN language
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
// Translation: Yourim Yi <yyi@yourim.net>
// Encoding: EUC-KR
// lang : ko
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("일요일",
"월요일",
"화요일",
"수요일",
"목요일",
"금요일",
"토요일",
"일요일");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("일",
"월",
"화",
"수",
"목",
"금",
"토",
"일");
// full month names
Calendar._MN = new Array
("1월",
"2월",
"3월",
"4월",
"5월",
"6월",
"7월",
"8월",
"9월",
"10월",
"11월",
"12월");
// short month names
Calendar._SMN = new Array
("1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "calendar 에 대해서";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"\n"+
"최신 버전을 받으시려면 http://www.dynarch.com/projects/calendar/ 에 방문하세요\n" +
"\n"+
"GNU LGPL 라이센스로 배포됩니다. \n"+
"라이센스에 대한 자세한 내용은 http://gnu.org/licenses/lgpl.html 을 읽으세요." +
"\n\n" +
"날짜 선택:\n" +
"- 연도를 선택하려면 \xab, \xbb 버튼을 사용합니다\n" +
"- 달을 선택하려면 " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " 버튼을 누르세요\n" +
"- 계속 누르고 있으면 위 값들을 빠르게 선택하실 수 있습니다.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"시간 선택:\n" +
"- 마우스로 누르면 시간이 증가합니다\n" +
"- Shift 키와 함께 누르면 감소합니다\n" +
"- 누른 상태에서 마우스를 움직이면 좀 더 빠르게 값이 변합니다.\n";
Calendar._TT["PREV_YEAR"] = "지난 해 (길게 누르면 목록)";
Calendar._TT["PREV_MONTH"] = "지난 달 (길게 누르면 목록)";
Calendar._TT["GO_TODAY"] = "오늘 날짜로";
Calendar._TT["NEXT_MONTH"] = "다음 달 (길게 누르면 목록)";
Calendar._TT["NEXT_YEAR"] = "다음 해 (길게 누르면 목록)";
Calendar._TT["SEL_DATE"] = "날짜를 선택하세요";
Calendar._TT["DRAG_TO_MOVE"] = "마우스 드래그로 이동 하세요";
Calendar._TT["PART_TODAY"] = " (오늘)";
Calendar._TT["MON_FIRST"] = "월요일을 한 주의 시작 요일로";
Calendar._TT["SUN_FIRST"] = "일요일을 한 주의 시작 요일로";
Calendar._TT["CLOSE"] = "닫기";
Calendar._TT["TODAY"] = "오늘";
Calendar._TT["TIME_PART"] = "(Shift-)클릭 또는 드래그 하세요";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
Calendar._TT["TT_DATE_FORMAT"] = "%b/%e [%a]";
Calendar._TT["WK"] = "주";

View File

@ -0,0 +1,114 @@
// ** I18N
// Calendar LT language
// Author: Martynas Majeris, <martynas@solmetra.lt>
// Encoding: UTF-8
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("Sekmadienis",
"Pirmadienis",
"Antradienis",
"Trečiadienis",
"Ketvirtadienis",
"Pentadienis",
"Šeštadienis",
"Sekmadienis");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("Sek",
"Pir",
"Ant",
"Tre",
"Ket",
"Pen",
"Šeš",
"Sek");
// full month names
Calendar._MN = new Array
("Sausis",
"Vasaris",
"Kovas",
"Balandis",
"Gegužė",
"Birželis",
"Liepa",
"Rugpjūtis",
"Rugsėjis",
"Spalis",
"Lapkritis",
"Gruodis");
// short month names
Calendar._SMN = new Array
("Sau",
"Vas",
"Kov",
"Bal",
"Geg",
"Bir",
"Lie",
"Rgp",
"Rgs",
"Spa",
"Lap",
"Gru");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "Apie kalendorių";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"Naujausią versiją rasite: http://www.dynarch.com/projects/calendar/\n" +
"Platinamas pagal GNU LGPL licenciją. Aplankykite http://gnu.org/licenses/lgpl.html" +
"\n\n" +
"Datos pasirinkimas:\n" +
"- Metų pasirinkimas: \xab, \xbb\n" +
"- Mėnesio pasirinkimas: " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + "\n" +
"- Nuspauskite ir laikykite pelės klavišą greitesniam pasirinkimui.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Laiko pasirinkimas:\n" +
"- Spustelkite ant valandų arba minučių - skaičius padidės vienetu.\n" +
"- Jei spausite kartu su Shift, skaičius sumažės.\n" +
"- Greitam pasirinkimui spustelkite ir pajudinkite pelę.";
Calendar._TT["PREV_YEAR"] = "Ankstesni metai (laikykite, jei norite meniu)";
Calendar._TT["PREV_MONTH"] = "Ankstesnis mėnuo (laikykite, jei norite meniu)";
Calendar._TT["GO_TODAY"] = "Pasirinkti šiandieną";
Calendar._TT["NEXT_MONTH"] = "Kitas mėnuo (laikykite, jei norite meniu)";
Calendar._TT["NEXT_YEAR"] = "Kiti metai (laikykite, jei norite meniu)";
Calendar._TT["SEL_DATE"] = "Pasirinkite datą";
Calendar._TT["DRAG_TO_MOVE"] = "Tempkite";
Calendar._TT["PART_TODAY"] = " (šiandien)";
Calendar._TT["MON_FIRST"] = "Pirma savaitės diena - pirmadienis";
Calendar._TT["SUN_FIRST"] = "Pirma savaitės diena - sekmadienis";
Calendar._TT["CLOSE"] = "Uždaryti";
Calendar._TT["TODAY"] = "Šiandien";
Calendar._TT["TIME_PART"] = "Spustelkite arba tempkite jei norite pakeisti";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
Calendar._TT["TT_DATE_FORMAT"] = "%A, %Y-%m-%d";
Calendar._TT["WK"] = "sav";

Some files were not shown because too many files have changed in this diff Show More