[wp-hackers] HTMLArea Integration
Bjorn Wijers
bjorn at waag.org
Thu Oct 7 14:50:51 UTC 2004
Interesting.
Would this mean that we can have a "switch" for the input area, so the
people understanding HTML can just insert HTML code into the input area
and the people that don`t know HTML press a button and see the WYSIWYG
editor? I think I saw something similar with Textpattern. This can be
very useful to lower the treshold for less tech savy users in using
Wordpress.
Related to this I`ve been thinking about creating a possibility to let
people create their posts in Open Office (which more and more
companies/governments etc are using). This would mean that the interface
would remain the same for them, while they can use new possibilities.
In theory, would this be possible with XML-RPC??
grtz
BjornW
--
Bjorn Wijers
Interaction Developer
Waag Society / for old and new media
Nieuwmarkt 4
1012 CR Amsterdam / The Netherlands
T: +31 20 557 98 98
F: +31 20 557 98 80
http://www.waag.org
Jason Trommetter wrote:
> Has anyone ever considered integrating a WYSIWYG editor like HTMLArea
> into the base WP code? I had to modify just one core file to get it
> to work, admin-header.php.
>
> <script type="text/javascript">
> _editor_url = "/htmlarea/";
> _editor_lang = "en";
> </script>
> <script type="text/javascript" src="/htmlarea/htmlarea.js"></script>
> </head>
> <body onload="HTMLArea.replace('content'); return false; " >
>
>
> ------------------------------------------------------------------------
>
> <?php
>
> require_once('../wp-config.php');
> require_once(ABSPATH . '/wp-admin/auth.php');
> require(ABSPATH . '/wp-admin/admin-functions.php');
>
> $dogs = $wpdb->get_results("SELECT * FROM $wpdb->categories");
> foreach ($dogs as $catt) {
> $cache_categories[$catt->cat_ID] = $catt;
> }
>
> get_currentuserinfo();
>
> $posts_per_page = get_settings('posts_per_page');
> $what_to_show = get_settings('what_to_show');
> $date_format = get_settings('date_format');
> $time_format = get_settings('time_format');
>
> $wpvarstoreset = array('profile','standalone','redirect','redirect_url','a','popuptitle','popupurl','text', 'trackback', 'pingback');
> for ($i=0; $i<count($wpvarstoreset); $i += 1) {
> $wpvar = $wpvarstoreset[$i];
> if (!isset($$wpvar)) {
> if (empty($_POST["$wpvar"])) {
> if (empty($_GET["$wpvar"])) {
> $$wpvar = '';
> } else {
> $$wpvar = $_GET["$wpvar"];
> }
> } else {
> $$wpvar = $_POST["$wpvar"];
> }
> }
> }
>
> if ($standalone == 0) :
>
> ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <title><?php bloginfo('name') ?> › <?php echo $title; ?> — WordPress</title>
> <link rel="stylesheet" href="wp-admin.css" type="text/css" />
> <link rel="shortcut icon" href="../wp-images/wp-favicon.png" />
> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_settings('blog_charset'); ?>" />
> <?php
> if ($redirect==1) {
> ?>
> <script type="text/javascript">
> <!--
> function redirect() {
> window.location = "<?php echo $redirect_url; ?>";
> }
> setTimeout("redirect();", 600);
> //-->
> </script>
> <?php
> } // redirect
> ?>
>
> <?php if (isset($xfn)) : ?>
> <script type="text/javascript">
> //<![CDATA[
>
> function GetElementsWithClassName(elementName, className) {
> var allElements = document.getElementsByTagName(elementName);
> var elemColl = new Array();
> for (i = 0; i < allElements.length; i++) {
> if (allElements[i].className == className) {
> elemColl[elemColl.length] = allElements[i];
> }
> }
> return elemColl;
> }
>
> function blurry() {
> if (!document.getElementById) return;
>
> var aInputs = document.getElementsByTagName('input');
>
> for (var i = 0; i < aInputs.length; i++) {
> aInputs[i].onclick = function() {
> var inputColl = GetElementsWithClassName('input','valinp');
> var rel = document.getElementById('rel');
> var inputs = '';
> for (i = 0; i < inputColl.length; i++) {
> if (inputColl[i].checked) {
> if (inputColl[i].value != '') inputs += inputColl[i].value + ' ';
> }
> }
> inputs = inputs.substr(0,inputs.length - 1);
> if (rel != null) {
> rel.value = inputs;
> }
> }
>
> aInputs[i].onkeyup = function() {
> var inputColl = GetElementsWithClassName('input','valinp');
> var rel = document.getElementById('rel');
> var inputs = '';
> for (i = 0; i < inputColl.length; i++) {
> if (inputColl[i].checked) {
> inputs += inputColl[i].value + ' ';
> }
> }
> inputs = inputs.substr(0,inputs.length - 1);
> if (rel != null) {
> rel.value = inputs;
> }
> }
>
> }
> }
>
> window.onload = blurry;
> //]]>
> </script>
> <?php endif; ?>
>
> <?php do_action('admin_head', ''); ?>
> </head>
> <body>
>
> <div id="wphead">
> <h1><?php echo wptexturize(get_settings(('blogname'))); ?> <span>(<a href="<?php echo get_settings('home') . '/' . get_settings('blogfilename'); ?>"><?php _e('View site') ?> »</a>)</span></h1>
> </div>
>
> <?php
> require('./menu.php');
> endif;
> ?>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> hackers mailing list
> hackers at wordpress.org
> http://wordpress.org/mailman/listinfo/hackers_wordpress.org
More information about the hackers
mailing list