<script type="text/javascript">
<!--
var baseUrl = 'http://www.wikispaces.com/_/2008040706';
var autosaveDetected = false;
var checkoutStatus = '';
var checkoutUser = '';
var checkoutMessage = '';
function disableEditButton(element) {
if (element.className == 'WikiPageMenuEditButton') {
element.className='WikiPageMenuEditButtonDisabled';
}
jQuery(element).unbind("click");
element.style.cursor='default';
element.href='#';
return true;
}
function enableEditButton(element) {
log('enabledEditButton');
if (element.className == 'WikiPageMenuEditButtonDisabled') {
element.className='WikiPageMenuEditButton';
}
jQuery(element).click(function() {
jQuery('.WikiNotice').remove();
jQuery('.WikiBanner').remove();
try {
disableEditButton(element);
showFiles();
editorEnable();
return false;
} catch (e) {
element.href = '/page/edit/' + encodeURIComponent(wikispaces_page);
redirectToEditPage(false);
return true;
}
});
element.style.cursor='pointer';
element.href='/page/edit/' + encodeURIComponent(wikispaces_page);
return true;
}
function editorEnable() {
if (navigator.userAgent.toLowerCase().indexOf('safari') + 1 ||
navigator.userAgent.toLowerCase().indexOf('opera') + 1) {
redirectToEditPage(true);
exit();
}
try {
var url = '/page/dump/' + encodeURIComponent(wikispaces_page) + '?format=Wikispaces2';
jQuery.ajax({ url: url, type: "GET", timeout: 2000, global: false, error: redirectToEditPageCallback, success: editorEnableCallback });
} catch (e) {
redirectToEditPage(false);
}
}
function redirectToEditPageCallback(request, errorString, errorException) {
log('redirectToEditPageCallback');
redirectToEditPage(false);
}
function redirectToEditPage(textEditor) {
log('redirectToEditPage');
document.location = '/page/edit/' + encodeURIComponent(wikispaces_page) + (textEditor ? '?texteditor=1' : '');
}
function editorEnableCallback(xml) {
log('editorEnableCallback');
// Load the fetched XML and set it up for the editor
if (loadXMLData(xml)) {
if (checkoutStatus == 'locked' && (!wikispaces_isUserLoggedIn || checkoutUser != wikispaces_username)) {
alert(checkoutMessage);
enableEditButton(document.getElementById('editButton'));
return false;
}
// Setup autosave
if (autosaveDetected) {
log('autosaveDetected');
if (typeof(Dialog) != 'undefined') {
if (typeof(showAutosavePopup) != 'undefined') {
log('showAutosavePopup');
showAutosavePopup();
} else {
log('ERROR: undefined showAutosavePopup');
redirectToEditPage(false);
return false;
}
} else {
log('ERROR: undefined Dialog');
redirectToEditPage(false);
return false;
}
} else {
//Only start the autosave loop after the modal autosave popup has closed or if it wasn't displayed
log('autosaveLoop setTimeout');
setTimeout("autosaveLoop()", 1000);
}
jQuery('#editor_wrap').show();
if (customEditorStart('WikispacesEditorContentHidden')) {
jQuery('#WikiTags').hide();
jQuery('#content_view').hide();
jQuery('#WikiAds').hide();
o = jQuery('#WikiAdMargin');
if (o) {
o.css('marginRight', 0);
}
return true;
} else {
log('customEditorStart failed');
}
}
// Something failed, and we're in a callback, so we have to change the page location to the edit page like this
redirectToEditPage(false);
}
function loadXMLData(xml) {
log('loadXMLData');
try {
var contentBlock = xml.getElementsByTagName('dump')[0].getElementsByTagName('content')[0];
var wikiPageData = '';
if (contentBlock && contentBlock.childNodes.length > 0) {
for (var i = 0; i < contentBlock.childNodes.length; i++) {
wikiPageData += contentBlock.childNodes[i].nodeValue;
}
}
var versionBlock = xml.getElementsByTagName('dump')[0].getElementsByTagName('version')[0]
if (versionBlock && versionBlock.firstChild) {
version = versionBlock.firstChild.nodeValue;
}
// If we got back a version, but not any data
if (!wikiPageData && version != 0) {
return false;
}
// Store loaded page data in the same place that the edit page would have it
if (wikiPageData) {
document.getElementById('WikispacesEditorContentHidden').innerHTML = wikiPageData;
}
checkoutStatus = xml.getElementsByTagName('checkout')[0].getElementsByTagName('checkoutStatus')[0].firstChild.nodeValue;
if (checkoutStatus == 'locked') {
checkoutUser = xml.getElementsByTagName('checkout')[0].getElementsByTagName('checkoutUser')[0].firstChild.nodeValue;
var checkoutDate = xml.getElementsByTagName('checkout')[0].getElementsByTagName('checkoutDate')[0].firstChild.nodeValue;
var checkoutRefreshDate = xml.getElementsByTagName('checkout')[0].getElementsByTagName('checkoutRefreshDate')[0].firstChild.nodeValue;
checkoutMessage = 'This page was locked for editing by ' + checkoutUser + ' on ' + checkoutDate + '. The page will be available for editing after the changes have been saved.';
}
if (xml.getElementsByTagName('dump')[0].getElementsByTagName('autosave').length > 0) {
var autosaveRoot = xml.getElementsByTagName('dump')[0].getElementsByTagName('autosave')[0];
var autosaveContentBlock = autosaveRoot.getElementsByTagName('autosaveContent')[0];
var autosaveContent = '';
if (autosaveContentBlock && autosaveContentBlock.childNodes.length > 0) {
for (var i = 0; i < autosaveContentBlock.childNodes.length; i++) {
autosaveContent += autosaveContentBlock.childNodes[i].nodeValue;
}
}
var autosaveDate = autosaveRoot.getElementsByTagName('autosaveDate')[0].firstChild.nodeValue;
autosaveVersion = autosaveRoot.getElementsByTagName('autosaveVersion')[0].firstChild.nodeValue;
document.getElementById('autosavePrompt').innerHTML = '<h1>Draft Recovered</h1><p class="wikispaces_p">We have recovered an unsaved draft of this page, created ' + autosaveDate + '.</p>' +
(autosaveVersion != version ? '<p class="wikispaces_p">However, another person has edited this page since your last draft. If you continue, their changes will be overwritten. To view these changes, <a href="/page/diff/' + encodeURIComponent(wikispaces_page) + '?v1=' + autosaveVersion + '&v2=' + version + '">click here</a>.</p>' : '');
document.getElementById('autosaveContent').innerHTML = autosaveContent;
autosaveDetected = true;
}
return true;
} catch (e) {
return false;
}
}
// Link the edit button to the dynamic in-page editor and remove the href to the standalone editor
jQuery(document).ready(function() {
if (document.getElementById('editButton')) {
enableEditButton(document.getElementById('editButton'));
}
} );
//-->
</script>
<!-- The wiki div is styled in the customizable stylesheet -->
<!-- google_ad_section_start -->
Part of the Story
While I was at ASCD 2008 in New Orleans in March 2008, I started a conversation with some ASCD Leadership Council members and my online network of educators about the need for educators familiar with Web 2.0 pedagogies to spread the word about how they are successfully using the new 21st Century technology to improve student learning. That conversation has continued until today, April 3, 2008. We have less than a month to pool our collective intelligence to help ASCD do a "bang up" job for it's membership in Orlando in March 2009 on technology and engaging students in learning. See the home page of this wiki for more details.
Go
here to read the conversation as it developed on
Professional Development 2.0 from March 16, 2008 to April 3, 2008 when I then created this wiki. Join this wiki and help us develop a comprehensive proposal. In the process we will show how the online nextwork of educators works. If nothing else, at least that will be impressive. If you help out!