This commit is contained in:
rGaillard
2011-07-06 10:10:43 +00:00
parent 31d94236ac
commit d1a13007b9
4695 changed files with 0 additions and 339293 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -1,225 +0,0 @@
jQuery.extend({
createUploadIframe: function(id, uri)
{
//create frame
var frameId = 'jUploadFrame' + id;
if(window.ActiveXObject) {
var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
if(typeof uri== 'boolean'){
io.src = 'javascript:false';
}
else if(typeof uri== 'string'){
io.src = uri;
}
}
else {
var io = document.createElement('iframe');
io.id = frameId;
io.name = frameId;
}
io.style.position = 'absolute';
io.style.top = '-1000px';
io.style.left = '-1000px';
document.body.appendChild(io);
return io;
},
createUploadForm: function(id, fileElementId)
{
//create form
var formId = 'jUploadForm' + id;
var fileId = 'jUploadFile' + id;
var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
var oldElement = jQuery('#' + fileElementId);
var newElement = jQuery(oldElement).clone();
jQuery(oldElement).attr('id', fileId);
jQuery(oldElement).before(newElement);
jQuery(oldElement).appendTo(form);
//set attributes
jQuery(form).css('position', 'absolute');
jQuery(form).css('top', '-1200px');
jQuery(form).css('left', '-1200px');
jQuery(form).appendTo('body');
return form;
},
ajaxFileUpload: function(s) {
// TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
s = jQuery.extend({}, jQuery.ajaxSettings, s);
var id = s.fileElementId;
var form = jQuery.createUploadForm(id, s.fileElementId);
var io = jQuery.createUploadIframe(id, s.secureuri);
var frameId = 'jUploadFrame' + id;
var formId = 'jUploadForm' + id;
if( s.global && ! jQuery.active++ )
{
// Watch for a new set of requests
jQuery.event.trigger( "ajaxStart" );
}
var requestDone = false;
// Create the request object
var xml = {};
if( s.global )
{
jQuery.event.trigger("ajaxSend", [xml, s]);
}
var uploadCallback = function(isTimeout)
{
// Wait for a response to come back
var io = document.getElementById(frameId);
try
{
if(io.contentWindow)
{
xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
}else if(io.contentDocument)
{
xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
}
}catch(e)
{
jQuery.handleError(s, xml, null, e);
}
if( xml || isTimeout == "timeout")
{
requestDone = true;
var status;
try {
status = isTimeout != "timeout" ? "success" : "error";
// Make sure that the request was successful or notmodified
if( status != "error" )
{
// process the data (runs the xml through httpData regardless of callback)
var data = jQuery.uploadHttpData( xml, s.dataType );
if( s.success )
{
// ifa local callback was specified, fire it and pass it the data
s.success( data, status );
};
if( s.global )
{
// Fire the global callback
jQuery.event.trigger( "ajaxSuccess", [xml, s] );
};
} else
{
jQuery.handleError(s, xml, status);
}
} catch(e)
{
status = "error";
jQuery.handleError(s, xml, status, e);
};
if( s.global )
{
// The request was completed
jQuery.event.trigger( "ajaxComplete", [xml, s] );
};
// Handle the global AJAX counter
if(s.global && ! --jQuery.active)
{
jQuery.event.trigger("ajaxStop");
};
if(s.complete)
{
s.complete(xml, status);
} ;
jQuery(io).unbind();
setTimeout(function()
{ try
{
jQuery(io).remove();
jQuery(form).remove();
} catch(e)
{
jQuery.handleError(s, xml, null, e);
}
}, 100);
xml = null;
};
}
// Timeout checker
if( s.timeout > 0 )
{
setTimeout(function(){
if( !requestDone )
{
// Check to see ifthe request is still happening
uploadCallback( "timeout" );
}
}, s.timeout);
}
try
{
var form = jQuery('#' + formId);
jQuery(form).attr('action', s.url);
jQuery(form).attr('method', 'POST');
jQuery(form).attr('target', frameId);
if(form.encoding)
{
form.encoding = 'multipart/form-data';
}
else
{
form.enctype = 'multipart/form-data';
}
jQuery(form).submit();
} catch(e)
{
jQuery.handleError(s, xml, null, e);
}
if(window.attachEvent){
document.getElementById(frameId).attachEvent('onload', uploadCallback);
}
else{
document.getElementById(frameId).addEventListener('load', uploadCallback, false);
}
return {abort: function () {}};
},
uploadHttpData: function( r, type ) {
var data = !type;
data = type == "xml" || data ? r.responseXML : r.responseText;
// ifthe type is "script", eval it in global context
if( type == "script" )
{
jQuery.globalEval( data );
}
// Get the JavaScript object, ifJSON is used.
if( type == "json" )
{
eval( "data = " + data );
}
// evaluate scripts within html
if( type == "html" )
{
jQuery("<div>").html(data).evalScripts();
}
return data;
}
});
@@ -1,873 +0,0 @@
/*
* author: Logan Cai
* Email: cailongqun [at] yahoo [dot] com [dot] cn
* Website: www.phpletter.com
* Created At: 21/April/2007
*/
/**
* get current selected mode value
*/
function getModeValue()
{
//check if an mode has been selected or selected first one be default
var CheckedElem = null;
for(var i = 0; i < document.formAction.mode.length; i++)
{
if(document.formAction.mode[i].checked || i == 0)
{
CheckedElem = document.formAction.mode[i];
}
}
CheckedElem.checked = true;
return CheckedElem.value;
};
/**
* get fired when mode changed
* fire according function
*/
function changeMode(restore, force)
{
var mode = getModeValue();
var imageMode = $('#image_mode');
if(mode != $(imageMode).val() || (typeof(restore) == "boolean"))
{
/**
* confirm it when there has been some changes before go further
*/
if(isImageHistoryExist() || typeof(force) == 'boolean')
{
if(typeof(restore) == "boolean" || typeof(force) == 'boolean' )
{
if(!restoreToOriginal(restore))
{
return false;
}
clearImageHistory();
}
else if(!window.confirm(warningLostChanges))
{
cancelChangeMode();
return false;
}else
{
restoreToOriginal(false);
clearImageHistory();
}
}else if((typeof(restore) == "boolean" && restore))
{
return false;
}
initPositionHandler();
switch(mode)
{
case "resize":
switch($('#image_mode').val())
{
case "crop":
disableCrop();
break;
case "rotate":
disableRotate();
break;
case "flip":
disableFlip();
break;
default:
disableRotate();
}
enableResize(document.formAction.constraint.checked);
break;
case "crop":
switch($('#image_mode').val())
{
case "resize":
disableResize();
break;
case "rotate":
disableRotate();
break;
case "flip":
disableFlip();
break;
default:
disableRotate();
}
enableCrop();
break;
case "rotate":
switch($('#image_mode').val())
{
case "resize":
disableResize();
break;
case "crop":
disableCrop();
break;
case "flip":
disableFlip();
break;
default:
//do nothing
}
enableRotate();
break;
case "flip":
switch($('#image_mode').val())
{
case "resize":
disableResize();
break;
case "crop":
disableCrop();
break;
case "rotate":
disableRotate();
break;
default:
//do nothing
}
enableFlip();
break;
default:
alert('Unexpected Operation!');
return false;
}
$('#image_mode').val(mode);
}
};
function resetEditor()
{
if(isImageHistoryExist())
{
changeMode(true);
}else
{
alert(warningResetEmpty);
}
return false;
};
/**
* enable to crop function
*/
function enableCrop()
{
var widthField = $('#width');
var heightField = $('#height');
var topField = $('#y');
var leftField = $('#x');
var imageToResize = getImageElement();
var imageWidth = $(imageToResize).attr('width');
var imageHeight = $(imageToResize).attr('height');
var overlay = $('#resizeMe');
var imageContainer = $('#imageContainer');
var imageContainerTop = parseInt($(imageContainer).css('top').replace('px', ''));
var imageContainerLeft = parseInt($(imageContainer).css('left').replace('px', ''));
//Init Container
$(imageContainer).css('width', imageWidth + 'px');
$(imageContainer).css('height', imageHeight + 'px');
$(imageToResize).css('opacity', '.5');
//Init Overlay
overlay.css('background-image', 'url('+ $(imageToResize).attr('src')+')');
overlay.css('width', imageWidth + 'px');
overlay.css('height', imageHeight + 'px');
//Init Form
widthField.val(imageWidth);
heightField.val(imageHeight);
topField.val(0);
leftField.val(0);
$(overlay).Resizable(
{
minWidth: 10,
minHeight: 10,
maxWidth: imageWidth,
maxHeight: imageHeight,
minTop: imageContainerTop,
minLeft: imageContainerLeft,
maxRight: (parseInt(imageWidth) + imageContainerLeft),
maxBottom: (parseInt(imageHeight) + imageContainerTop),
dragHandle: true,
onDrag: function(x, y)
{
this.style.backgroundPosition = '-' + (x - imageContainerLeft) + 'px -' + (y - imageContainerTop) + 'px';
$(topField).val(Math.round(y - imageContainerTop));
$(leftField).val(Math.round(x - imageContainerLeft));
addImageHistory();
},
handlers: {
se: '#resizeSE',
e: '#resizeE',
ne: '#resizeNE',
n: '#resizeN',
nw: '#resizeNW',
w: '#resizeW',
sw: '#resizeSW',
s: '#resizeS'
},
onResize : function(size, position) {
this.style.backgroundPosition = '-' + (position.left - imageContainerLeft) + 'px -' + (position.top - imageContainerTop) + 'px';
$(widthField).val(Math.round(size.width));
$(heightField).val(Math.round(size.height));
$(topField).val(Math.round(position.top - imageContainerTop));
$(leftField).val(Math.round(position.left - imageContainerLeft));
addImageHistory();
$('#ratio').val($(overlay).ResizableRatio() );
}
}
);
enableConstraint();
toggleConstraint();
disableRotate();
};
/*
* disable crop function
*/
function disableCrop()
{
$('#resizeMe').ResizableDestroy();
hideHandlers();
};
/**
* disable resize function
*/
function disableResize()
{
$('#resizeMe').ResizableDestroy();
hideHandlers();
};
/**
* hide all handlers
*/
function hideHandlers()
{
$('#resizeSE').hide();
$('#resizeE').hide();
$('#resizeNE').hide();
$('#resizeN').hide();
$('#resizeNW').hide();
$('#resizeW').hide();
$('#resizeSW').hide();
$('#resizeS').hide();
};
/**
*
* enable to resize the image
*/
function enableResize(constraint)
{
hideHandlers();
var imageToResize = getImageElement();
var imageContainer = $('#imageContainer');
var imageContainerTop = parseInt($(imageContainer).css('top').replace('px', ''));
var imageContainerLeft = parseInt($(imageContainer).css('left').replace('px', ''));
var resizeMe = $('#resizeMe');
var width = $('#width');
var height = $('#height');
//ensure the container has same size with the image
$(imageContainer).css('width', $(imageToResize).attr('width') + 'px');
$(imageContainer).css('height', $(imageToResize).attr('height') + 'px');
$(resizeMe).css('width', $(imageToResize).attr('width') + 'px');
$(resizeMe).css('height', $(imageToResize).attr('height') + 'px');
$('#width').val($(imageToResize).attr('width'));
$('#height').val($(imageToResize).attr('height'));
$('#x').val(0);
$('#y').val(0);
$(resizeMe).Resizable(
{
minWidth: 10,
minHeight: 10,
maxWidth: 2000,
maxHeight: 2000,
minTop: imageContainerTop,
minLeft: imageContainerLeft,
maxRight: 2000,
maxBottom: 2000,
handlers: {
s: '#resizeS',
se: '#resizeSE',
e: '#resizeE'
},
onResize: function(size)
{
$(imageToResize).attr('height', Math.round(size.height).toString());
$(imageToResize).attr('width', Math.round(size.width).toString());
$(width).val(Math.round(size.width));
$(height).val(Math.round(size.height));
$(imageContainer).css('width', $(imageToResize).attr('width') + 'px');
$(imageContainer).css('height', $(imageToResize).attr('height') + 'px');
$('#ratio').val($(resizeMe).ResizableRatio() );
addImageHistory();
}
}
);
$(resizeMe).ResizeConstraint(constraint);
if(typeof(constraint) == 'boolean' && constraint)
{
$('#resizeS').hide();
$('#resizeE').hide();
}else
{
$('#resizeS').show();
$('#resizeE').show();
}
$('#resizeSE').show();
$('#ratio').val($(resizeMe).ResizableRatio() );
};
/**
* initiate the position of handler
*/
function initPositionHandler()
{
var widthField = $('#width');
var heightField = $('#height');
var topField = $('#x');
var leftField = $('#y');
var imageToResize = getImageElement();
var imageWidth = $(imageToResize).attr('width');
var imageHeight = $(imageToResize).attr('height');
var overlay = $('#resizeMe');
var imageContainer = $('#imageContainer');
var imageContainerTop = parseInt($(imageContainer).css('top').replace('px', ''));
var imageContainerLeft = parseInt($(imageContainer).css('left').replace('px', ''));
//Init Container
$(imageContainer).css('width', imageWidth + 'px');
$(imageContainer).css('height', imageHeight + 'px');
//Init Overlay
$(imageToResize).css('opacity', '100');
$(overlay).css('width', imageWidth + 'px');
$(overlay).css('height', imageHeight + 'px');
$(overlay).css('background-image', '');
$(overlay).css('backgroundPosition', '0 0');
$(overlay).css('left', imageContainerLeft);
$(overlay).css('top', imageContainerTop);
//Init Form
$(widthField).val(imageWidth);
$(heightField).val(imageHeight);
$(topField).val(0);
$(leftField).val(0);
$('#angle').val(0);
$('#flip_angle').val('');
};
/**
* enable rotate function
*/
function enableRotate()
{
hideHandlers();
toggleDisabledButton('actionRotateLeft', false);
toggleDisabledButton('actionRotateRight', false);
};
/**
* disable rotation function
*/
function disableRotate()
{
toggleDisabledButton('actionRotateLeft', true);
toggleDisabledButton('actionRotateRight', true);
};
function enableConstraint()
{
$('#constraint').removeAttr('disabled');
};
function disableConstraint()
{
$('#constraint').attr('disabled', 'disabled');
};
function ShowHandlers()
{
$('#resizeSE').show();
$('#resizeE').show();
$('#resizeNE').show();
$('#resizeN').show();
$('#resizeNW').show();
$('#resizeW').show();
$('#resizeSW').show();
$('#resizeS').show();
} ;
/**
* turn constraint on or off
*/
function toggleConstraint()
{
hideHandlers();
if(document.formAction.constraint.checked)
{
$('#resizeMe').ResizeConstraint(true);
switch(getModeValue())
{
case "resize":
$('#resizeSE').show();
break;
case "crop":
$('#resizeSE').show();
$('#resizeNE').show();
$('#resizeNW').show();
$('#resizeSW').show();
break;
case "rotate":
break;
}
}else
{
$('#resizeMe').ResizeConstraint(false);
switch(getModeValue())
{
case "resize":
$('#resizeSE').show();
$('#resizeE').show();
$('#resizeS').show();
break;
case "crop":
ShowHandlers();
break;
case "rotate":
break;
}
}
};
/**
* restore to the state the image was
*/
function restoreToOriginal(warning)
{
if(typeof(warning) == "boolean" && warning)
{
if(!window.confirm(warningReset))
{
return false;
}
}
$("#imageContainer").empty();
$("#hiddenImage img").clone().appendTo("#imageContainer");
return true;
};
/*
* left rotate
*/
function leftRotate()
{
var imageToResize = getImageElement();
$(imageToResize).rotate(-90);
swapWidthWithHeight();
addImageHistory();
var angle = $('#angle');
var angleDegree = (parseInt($(angle).val()) + 90);
angleDegree = ((angleDegree == 360)?angleDegree:angleDegree%360);
$(angle).val((angleDegree ));
return false;
};
/**
* cancel mode change
*/
function cancelChangeMode()
{
$('#formAction input[@value=' + $('#image_mode').val() + ']').attr('checked', 'checked');
};
/**
* get the image element which is going to be modified
*/
function getImageElement()
{
var imageElement = null;
var imageContainer = document.getElementById('imageContainer');
for(var i = 0; i < imageContainer.childNodes.length; i++)
{
if((typeof(imageContainer.childNodes[i].name) != "undefined" && imageContainer.childNodes[i].name.toLowerCase() == 'image') || (typeof(imageContainer.childNodes[i].tagName) != "undefined" && (imageContainer.childNodes[i].tagName.toLowerCase() == 'canvas' || imageContainer.childNodes[i].tagName.toLowerCase() == 'img')) )
{
imageElement = imageContainer.childNodes[i];
}
}
return imageElement;
};
/*
right rotate
*/
function rightRotate()
{
var imageToResize = getImageElement();
$(imageToResize).rotate(90);
swapWidthWithHeight();
addImageHistory();
var angle = $('#angle');
var angleDegree = (parseInt($(angle).val()) - 90 );
if(angleDegree < 0)
{
angleDegree += 360;
}
angleDegree = ((angleDegree == 360)?angleDegree:angleDegree%360);
$(angle).val((angleDegree ));
return false;
} ;
/**
* swap image width with height when rotation fired
*/
function swapWidthWithHeight()
{
var imageContainer = $('#imageContainer');
var resizeMe = $('#resizeMe');
var width = $('#width');
var height = $('#height');
var imageToResize = getImageElement();
var newWidth = 0;
var newHeight = 0;
newWidth = $(imageToResize).attr('width');
newHeight = $(imageToResize).attr('height');
$(imageContainer).css('width', newWidth + 'px');
$(imageContainer).css('height', newHeight + 'px');
$(width).val(newWidth);
$(height).val(newHeight);
$(resizeMe).css('width', newWidth + 'px');
$(resizeMe).css('height', newHeight + 'px');
};
/**
* records all change mede to the image
* this features will be implemented next release
*/
function addImageHistory()
{
imageHistory = true;
initDisabledButtons(false);
};
/**
* cleare all records
* this features will be implemented next release
*/
function clearImageHistory()
{
imageHistory = false;
initDisabledButtons(true);
};
function initDisabledButtons(forceDisable)
{
if(numSessionHistory)
{
toggleDisabledButton('actionUndo', false);
}else
{
toggleDisabledButton('actionUndo', true);
}
if(imageHistory)
{
toggleDisabledButton('actionSave', false);
toggleDisabledButton('actionReset', false);
}else
{
toggleDisabledButton('actionSave', true);
toggleDisabledButton('actionReset', true);
}
};
/**
* return record
* this features will be implemented next release
*/
function getImageHistory()
{
return imageHistory;
};
/**
* check if there exists any changes
* this features will be implemented next release
*/
function isImageHistoryExist()
{
return imageHistory;
};
function flipHorizontal()
{
if(window.confirm(warningFlipHorizotal))
{
addImageHistory();
$('#flip_angle').val('horizontal');
$('#mode').val('flip');
saveImage();
}
return false;
};
function flipVertical()
{
if(window.confirm(warningFlipVertical))
{
addImageHistory();
$('#flip_angle').val('vertical');
$('#mode').val('flip');
saveImage();
}
return false;
};
function enableFlip()
{
toggleDisabledButton('actionFlipH', false);
toggleDisabledButton('actionFlipV', false);
};
function toggleDisabledButton(buttonId, forceDisable)
{
var disabledButton = $('#' + buttonId);
var newClass = '';
var changeRequired = true;
var toBeDisabled = false;
var currentClass = $(disabledButton).attr('class') ;
if(typeof(forceDisable) == 'boolean')
{
if(forceDisable && currentClass == 'button')
{
newClass = 'disabledButton';
$(disabledButton).attr('disabled', 'disabled');
}else if(!forceDisable && currentClass == 'disabledButton')
{
newClass = 'button';
$(disabledButton).removeAttr('disabled');
}else
{
changeRequired = false;
}
}
else if(currentClass == 'button')
{
newClass = 'disabledButton';
$(disabledButton).attr('disabled', 'disabled');
}else
{
newClass = 'button';
$(disabledButton).removeAttr('disabled');
}
if(changeRequired)
{
$(disabledButton).removeClass('button disabledButton');
$(disabledButton).addClass(newClass);
}
};
function disableFlip()
{
toggleDisabledButton('actionFlipH', true);
toggleDisabledButton('actionFlipV', true);
};
function undoImage()
{
if(numSessionHistory < 1)
{
alert(warningResetEmpty);
}else
{
if(window.confirm(warningUndoImage))
{
processImage('formAction');
}
}
return false;
};
function processImage(formId)
{
$("#loading")
.ajaxStart(function(){
$(this).show();
})
.ajaxComplete(function(){
$(this).hide();
});
var options =
{
dataType: 'json',
error: function (data, status, e)
{
alert(e);
},
success: function(data)
{
if(typeof(data.error) == 'undefined')
{
alert('Unexpected information ');
}
else if(data.error != '')
{
alert(data.error);
}else
{
$("#loading").show();
currentFolder = data.folder_path;
if(data.save_as == '1')
{
numSessionHistory = 0;
}else
{
numSessionHistory = parseInt(data.history);
}
$('#file_path').val(data.path);
$('#path').val(data.path);
var preImage = new Image();
preImage.width = data.width;
preImage.height = data.height;
preImage.onload = function()
{
$('#hiddenImage').empty();
$(preImage).appendTo('#hiddenImage');
changeMode(false, true);
$('#loading').hide();
$('#windowSaveAs').jqm({modal: true}).jqmHide();
};
var now = new Date();
preImage.src = data.path + "?" + now.getTime();
}
}
};
$('#' + formId).ajaxSubmit(options);
return false;
};
function saveAsImagePre()
{
$('#windowSaveAs').jqm({modal: true}).jqmShow();
var saveTo = $('#save_to');
$(saveTo).removeOption(/./);
$(saveTo).ajaxAddOption(urlGetFolderList, {}, false,
function()
{
$(saveTo).selectOptions(currentFolder);
});
return false;
};
function saveAsImage()
{
var pattern=/^[A-Za-z0-9_ \-]+$/i;
var newName = $('#new_name');
var saveAs = $('#save_to').get(0);
//alert($(saveAs).val());
if(!pattern.test($(newName).val()))
{
alert(warningInvalidNewName);
}else if(saveAs.selectedIndex < 0)
{
alert(warningNoFolderSelected);
}else
{
$('#hidden_new_name').val($(newName).val());
$('#hidden_save_to').val(saveAs.options[saveAs.selectedIndex].value);
if(saveImage(true))
{
}
}
return false;
};
function saveImage(saveAs)
{
if(typeof(saveAs) == 'boolean' && saveAs)
{
}else
{//remove new name if just normal save
$('#hidden_new_name').val('');
$('#hidden_save_to').val('');
}
if (!isImageHistoryExist() && (typeof(saveAs) == 'undefined' || !saveAs))
{
alert(noChangeMadeBeforeSave);
}else
{
if(processImage('formImageInfo'))
{
return true;
}
}
return false;
};
function editorClose()
{
if(window.confirm(warningEditorClose))
{
window.close();
}
return false;
};
File diff suppressed because one or more lines are too long
@@ -1,91 +0,0 @@
function save(id, text)
{
jQuery('#text').val(text);
jQuery('#save_as_request').val('0');
jQuery('#name').val(currentName);
jQuery('#folder').val(currentFolder);
do_save(false);
};
function do_save(saveAsRequest)
{
jQuery('#windowProcessing').jqmShow();
var options =
{
dataType: 'json',
error: function (data, status, e)
{
alert(e);
},
success: function(data)
{
if(typeof(data.error) == 'undefined')
{
alert('Unexpected information ');
if(typeof(saveAsRequest) == 'boolean' && saveAsRequest)
{
jQuery('#windowSaveAs').jqmShow();
}
}
else if(data.error != '')
{
alert(data.error);
jQuery('#windowProcessing').jqmHide();
if(typeof(saveAsRequest) == 'boolean' && saveAsRequest)
{
jQuery('#windowSaveAs').jqmShow();
}
}else
{
jQuery('#windowProcessing').jqmHide();
jQuery('#windowSaveAs').jqmHide();
currentFolder = data.folder;
currentName = data.name;
}
}
};
jQuery('#frmProcessing').ajaxSubmit(options);
};
function save_as(id, text)
{
jQuery('#text').val(text);
jQuery('#windowSaveAs').jqmShow();
var saveTo = jQuery('#save_to');
jQuery(saveTo).removeOption(/./);
jQuery(saveTo).ajaxAddOption(urlGetFolderList, {}, false,
function()
{
jQuery(saveTo).selectOptions(currentFolder);
});
};
function do_save_as()
{
var pattern=/^[A-Za-z0-9_ \-]+$/i;
var newName = jQuery('#new_name');
var saveAs = jQuery('#save_to').get(0);
var ext = jQuery('#ext').get(0);
if(!pattern.test(jQuery(newName).val()))
{
alert(warningInvalidName);
}else if(saveAs.selectedIndex < 0)
{
alert(waringFolderNotSelected);
}else if(ext.selectedIndex < 0)
{
alert(warningExtNotSelected);
}
else
{
jQuery('#name').val(jQuery(newName).val() + "." + ext.options[ext.selectedIndex].value);
jQuery('#folder').val(saveAs.options[saveAs.selectedIndex].value);
jQuery('#save_as_request').val('1');
jQuery('#windowSaveAs').jqmHide();
do_save(true);
}
return false;
};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
(function($){var menu,shadow,trigger,content,hash,currentTarget;var defaults={menuStyle:{width:'100px'},itemStyle:{},itemHoverStyle:{},eventPosX:'pageX',eventPosY:'pageY',shadow:true,onContextMenu:null,onShowMenu:null};$.fn.contextMenu=function(id,options){if(!menu){menu=$('<div id="jqContextMenu"></div>').hide().css({position:'absolute',zIndex:'500'}).appendTo('body').bind('click',function(e){e.stopPropagation()})}if(!shadow){shadow=$('<div></div>').css({zIndex:499}).appendTo('body').hide()}hash=hash||[];hash.push({id:id,menuStyle:$.extend({},defaults.menuStyle,options.menuStyle||{}),itemStyle:$.extend({},defaults.itemStyle,options.itemStyle||{}),itemHoverStyle:$.extend({},defaults.itemHoverStyle,options.itemHoverStyle||{}),bindings:options.bindings||{},shadow:options.shadow||options.shadow===false?options.shadow:defaults.shadow,onContextMenu:options.onContextMenu||defaults.onContextMenu,onShowMenu:options.onShowMenu||defaults.onShowMenu,eventPosX:options.eventPosX||defaults.eventPosX,eventPosY:options.eventPosY||defaults.eventPosY});var index=hash.length-1;$(this).bind('contextmenu',function(e){var bShowContext=(!!hash[index].onContextMenu)?hash[index].onContextMenu(e):true;if(bShowContext)display(index,this,e,options);return false});return this};function display(index,trigger,e,options){var cur=hash[index];content=$('#'+cur.id).find('ul:first').clone(true);content.css(cur.menuStyle).find('li').css(cur.itemStyle).hover(function(){$(this).css(cur.itemHoverStyle)},function(){$(this).css(cur.itemStyle)}).find('img').css({verticalAlign:'middle',paddingRight:'2px'});menu.html(content);if(!!cur.onShowMenu)menu=cur.onShowMenu(e,menu);$.each(cur.bindings,function(id,func){$('#'+id,menu).bind('click',function(e){hide();func(trigger,currentTarget)})});menu.css({'left':e[cur.eventPosX],'top':e[cur.eventPosY]}).show();if(cur.shadow)shadow.css({width:menu.width(),height:menu.height(),left:e.pageX+2,top:e.pageY+2}).show();$(document).one('click',hide)}function hide(){menu.hide();shadow.hide()}$.contextMenu={defaults:function(userDefaults){$.each(userDefaults,function(i,val){if(typeof val=='object'&&defaults[i]){$.extend(defaults[i],val)}else defaults[i]=val})}}})(jQuery);$(function(){$('div.contextMenu').hide()});
@@ -1,352 +0,0 @@
body, html{
margin: 0;
padding: 0;
height: 100%;
border: none;
overflow: hidden;
background-color: #FFFFFF;
}
body, html, table, form, textarea{
font: 12px monospace, sans-serif;
}
#editor{
border: solid #888888 1px;
overflow: hidden;
}
#result{
z-index: 4;
overflow: scroll;
border-top: solid #888888 1px;
border-bottom: solid #888888 1px;
position: relative;
}
#container{
overflow: hidden;
/*height: 100px;*/
border: solid blue 0px;
position: relative;
padding: 0 5px 0px 0;
z-index: 10;
}
#textarea{
position: relative;
top: 0px;
left: 0px;
padding: 0px 0px 0px 45px;
width: 100%;
height: 100%;
/*position: absolute;*/
overflow: hidden;
z-index: 7;
border: solid green 0px;
/* background: none;
background-color: transparent;*/
}
#content_highlight{
white-space: pre;
/*background-color: #FFFFFF;*/
padding: 1px 0 0 45px;
position : absolute;
z-index: 4;
overflow: visible;
border: solid yellow 0px;
}
#selection_field{
padding: 0px 0px 0 45px;
background-color: #FFFF99;
height: 1px;
position: absolute;
z-index: 5;
top: -100px;
margin: 1px 0 0 0px;
white-space: pre;
overflow: hidden;
}
#line_number{
position: absolute;
overflow: hidden;
border-right: solid black 1px;
z-index:8;
width: 38px;
padding-right: 5px;
text-align: right;
color: #AAAAAA;
}
#test_font_size{
padding: 0;
margin: 0;
visibility: hidden;
position: absolute;
white-space: pre;
}
pre{
margin: 0;
padding: 0;
}
.hidden{
opacity: 0.2;
-moz-opacity: 0.2;
filter:alpha(opacity=20);
}
#result .edit_area_cursor{
position: absolute;
z-index:6;
background-color: #FF6633;
top: -100px;
margin: 1px 0 0 0px;
}
#result .edit_area_selection_field .overline{
background-color: #996600;
}
/* area popup */
.editarea_popup{
border: solid 1px #888888;
background-color: #ECE9D8;
width: 250px;
padding: 4px;
position: absolute;
visibility: hidden;
/*display: none;*/
z-index: 15;
top: -500px;
/*font-family: Aria, Verdana, sans-serif;
font-size: 10pt;*/
}
.editarea_popup, .editarea_popup table{
font-family: sans-serif;
font-size: 10pt;
}
.editarea_popup img{
border: 0;
}
.editarea_popup .close_popup{
float: right;
line-height: 16px;
border: 0px;
padding: 0px;
}
.editarea_popup h1,.editarea_popup h2,.editarea_popup h3,.editarea_popup h4,.editarea_popup h5,.editarea_popup h6{
margin: 0px;
padding: 0px;
}
.editarea_popup .copyright{
text-align: right;
}
/* Area_search */
div#area_search_replace{
/*width: 250px;*/
}
div#area_search_replace img{
border: 0px;
}
div#area_search_replace div.button{
text-align: center;
line-height: 1.7em;
}
div#area_search_replace .button a{
cursor: pointer;
border: solid 1px #888888;
background-color: #DEDEDE;
text-decoration: none;
padding: 0 2px;
color: #000000;
white-space: nowrap;
}
div#area_search_replace a:hover{
/*border: solid 1px #888888;*/
background-color: #EDEDED;
}
div#area_search_replace #move_area_search_replace{
cursor: move;
border: solid 1px #888888;
}
div#area_search_replace #close_area_search_replace{
text-align: right;
vertical-align: top;
white-space: nowrap;
}
div#area_search_replace #area_search_msg{
height: 18px;
overflow: hidden;
border-top: solid 1px #888888;
margin-top: 3px;
}
/* area help */
#edit_area_help{
width: 350px;
}
#edit_area_help div.close_popup{
float: right;
}
/* area_toolbar */
.area_toolbar{
/*font: 11px sans-serif;*/
width: 100%;
/*height: 21px; */
margin: 0px;
padding: 0px;
background-color: #ECE9D8;
text-align: center;
}
.area_toolbar, .area_toolbar table{
font: 11px sans-serif;
}
.area_toolbar img{
border: 0px;
vertical-align: middle;
}
.area_toolbar input{
margin: 0px;
padding: 0px;
}
.area_toolbar select{
font-family: 'MS Sans Serif',sans-serif,Verdana,Arial;
font-size: 7pt;
font-weight: normal;
margin: 2px 0 0 0 ;
padding: 0;
vertical-align: top;
background-color: #F0F0EE;
}
table.statusbar{
width: 100%;
}
.area_toolbar td.infos{
text-align: center;
width: 130px;
border-right: solid 1px #888888;
border-width: 0 1px 0 0;
padding: 0;
}
.area_toolbar td.total{
text-align: right;
width: 50px;
padding: 0;
}
.area_toolbar td.resize{
text-align: right;
}
/*
.area_toolbar span{
line-height: 1px;
padding: 0;
margin: 0;
}*/
.area_toolbar span#resize_area{
cursor: nw-resize;
visibility: hidden;
}
/* toolbar buttons */
.editAreaButtonNormal, .editAreaButtonOver, .editAreaButtonDown, .editAreaSeparator, .editAreaSeparatorLine, .editAreaButtonDisabled, .editAreaButtonSelected {
border: 0px; margin: 0px; padding: 0px; background: transparent;
margin-top: 0px;
margin-left: 1px;
padding: 0px;
}
.editAreaButtonNormal {
border: 1px solid #ECE9D8 !important;
cursor: pointer;
}
.editAreaButtonOver {
border: 1px solid #0A246A !important;
cursor: pointer;
background-color: #B6BDD2;
}
.editAreaButtonDown {
cursor: pointer;
border: 1px solid #0A246A !important;
background-color: #8592B5;
}
.editAreaButtonSelected {
border: 1px solid #C0C0BB !important;
cursor: pointer;
background-color: #F4F2E8;
}
.editAreaButtonDisabled {
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
-moz-opacity:0.3;
opacity: 0.3;
border: 1px solid #F0F0EE !important;
cursor: pointer;
}
.editAreaSeparatorLine {
margin: 1px 2px;
background-color: #C0C0BB;
width: 2px;
height: 18px;
}
/* waiting screen */
#processing{
display: none;
background-color:#ECE9D8;
border: solid #888888 1px;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 100;
text-align: center;
}
#processing_text{
position:absolute;
left: 50%;
top: 50%;
width: 200px;
height: 20px;
margin-left: -100px;
margin-top: -10px;
text-align: center;
}
/* end */
File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 B

@@ -1,45 +0,0 @@
editAreaLoader.lang["de"]={
new_document: "neues leeres Dokument",
search_button: "suchen und ersetzen",
search_command: "suche n&auml;chsten / &ouml;ffne Suchfeld",
search: "suche",
replace: "ersetze",
replace_command: "ersetze / &ouml;ffne Suchfeld",
find_next: "finde n&auml;chsten",
replace_all: "ersetze alle Treffer",
reg_exp: "regul&auml;re Ausdr&uuml;cke",
match_case: "passt auf den Begriff<br />",
not_found: "Nicht gefunden.",
occurrence_replaced: "Die Vorkommen wurden ersetzt.",
search_field_empty: "leeres Suchfeld",
restart_search_at_begin: "Ende des zu durchsuchenden Bereiches erreicht. Es wird die Suche von Anfang an fortgesetzt.", //find a shorter translation
move_popup: "Suchfenster bewegen",
font_size: "--Schriftgr&ouml;&szlig;e--",
go_to_line: "gehe zu Zeile",
go_to_line_prompt: "gehe zu Zeilennummmer:",
undo: "r&uuml;ckg&auml;ngig machen",
redo: "wiederherstellen",
change_smooth_selection: "aktiviere/deaktiviere einige Features (weniger Bildschirmnutzung aber mehr CPU-Belastung)",
highlight: "Syntax Highlighting an- und ausschalten",
reset_highlight: "Highlighting zur&uuml;cksetzen (falls mit Text nicht konform)",
help: "&uuml;ber",
save: "sichern",
load: "&ouml;ffnen",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Position",
total: "Gesamt",
close_popup: "Popup schlie&szligen",
shortcuts: "Shortcuts",
add_tab: "Tab zum Text hinzuf&uuml;gen",
remove_tab: "Tab aus Text entfernen",
about_notice: "Bemerkung: Syntax Highlighting ist nur f&uuml;r kurze Texte",
toggle: "Editor an- und ausschalten",
accesskey: "Accesskey",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "In Bearbeitung...",
fullscreen: "fullscreen"
};
@@ -1,45 +0,0 @@
editAreaLoader.lang["dk"]={
new_document: "nyt tomt dokument",
search_button: "s&oslash;g og erstat",
search_command: "find n&aelig;ste / &aring;ben s&oslash;gefelt",
search: "s&oslash;g",
replace: "erstat",
replace_command: "erstat / &aring;ben s&oslash;gefelt",
find_next: "find n&aelig;ste",
replace_all: "erstat alle",
reg_exp: "regular expressions",
match_case: "forskel på store/sm&aring; bogstaver<br />",
not_found: "not found.",
occurrence_replaced: "occurences replaced.",
search_field_empty: "Search field empty",
restart_search_at_begin: "End of area reached. Restart at begin.",
move_popup: "flyt søgepopup",
font_size: "--Skriftstørrelse--",
go_to_line: "g&aring; til linie",
go_to_line_prompt: "gå til linienummer:",
undo: "fortryd",
redo: "gentag",
change_smooth_selection: "sl&aring; display funktioner til/fra (smartere display men mere CPU kr&aelig;vende)",
highlight: "sl&aring; syntax highlight til/fra",
reset_highlight: "nulstil highlight (hvis den er desynkroniseret fra teksten)",
help: "om",
save: "gem",
load: "hent",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Position",
total: "Total",
close_popup: "luk popup",
shortcuts: "Genveje",
add_tab: "tilf&oslash;j tabulation til tekst",
remove_tab: "fjern tabulation fra tekst",
about_notice: "Husk: syntax highlight funktionen b&oslash;r kun bruge til sm&aring; tekster",
toggle: "Sl&aring; editor til / fra",
accesskey: "Accesskey",
tab: "Tab",
shift: "Skift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Processing...",
fullscreen: "fullscreen"
};
@@ -1,46 +0,0 @@
editAreaLoader.lang["en"]={
new_document: "new empty document",
search_button: "search and replace",
search_command: "search next / open search area",
search: "search",
replace: "replace",
replace_command: "replace / open search area",
find_next: "find next",
replace_all: "replace all",
reg_exp: "regular expressions",
match_case: "match case",
not_found: "not found.",
occurrence_replaced: "occurences replaced.",
search_field_empty: "Search field empty",
restart_search_at_begin: "End of area reached. Restart at begin.",
move_popup: "move search popup",
font_size: "--Font size--",
go_to_line: "go to line",
go_to_line_prompt: "go to line number:",
undo: "undo",
redo: "redo",
change_smooth_selection: "enable/disable some display features (smarter display but more CPU charge)",
highlight: "toggle syntax highlight on/off",
reset_highlight: "reset highlight (if desyncronized from text)",
help: "about",
save: "save",
save_as: "save as",
load: "load",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Position",
total: "Total",
close_popup: "close popup",
shortcuts: "Shortcuts",
add_tab: "add tabulation to text",
remove_tab: "remove tabulation to text",
about_notice: "Notice: syntax highlight function is only for small text",
toggle: "Toggle editor",
accesskey: "Accesskey",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Processing...",
fullscreen: "fullscreen"
};
@@ -1,45 +0,0 @@
editAreaLoader.lang["fr"]={
new_document: "nouveau document (efface le contenu)",
search_button: "rechercher / remplacer",
search_command: "rechercher suivant / ouvrir la fen&ecirc;tre de recherche",
search: "rechercher",
replace: "remplacer",
replace_command: "remplacer / ouvrir la fen&ecirc;tre de recherche",
find_next: "rechercher",
replace_all: "tout remplacer",
reg_exp: "expr. r&eacute;guli&egrave;re",
match_case: "respecter la casse",
not_found: "pas trouv&eacute;.",
occurrence_replaced: "remplacements &eacute;ffectu&eacute;s.",
search_field_empty: "Le champ de recherche est vide.",
restart_search_at_begin: "Fin du texte atteint, poursuite au d&eacute;but.",
move_popup: "d&eacute;placer la fen&ecirc;tre de recherche",
font_size: "--Taille police--",
go_to_line: "aller &agrave; la ligne",
go_to_line_prompt: "aller a la ligne numero:",
undo: "annuler",
redo: "refaire",
change_smooth_selection: "activer/d&eacute;sactiver des fonctions d'affichage (meilleur affichage mais plus de charge processeur)",
highlight: "activer/d&eacute;sactiver la coloration syntaxique",
reset_highlight: "r&eacute;initialiser la coloration syntaxique (si d&eacute;syncronis&eacute;e du texte)",
help: "&agrave; propos",
save: "sauvegarder",
load: "charger",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Position",
total: "Total",
close_popup: "fermer le popup",
shortcuts: "Racourcis clavier",
add_tab: "ajouter une tabulation dans le texte",
remove_tab: "retirer une tabulation dans le texte",
about_notice: "Note: la coloration syntaxique n'est pr&eacute;vue que pour de courts textes.",
toggle: "basculer l'&eacute;diteur",
accesskey: "Accesskey",
tab: "Tab",
shift: "Maj",
ctrl: "Ctrl",
esc: "Esc",
processing: "chargement...",
fullscreen: "plein &eacute;cran"
};
@@ -1,45 +0,0 @@
editAreaLoader.lang["hr"]={
new_document: "Novi dokument",
search_button: "Traži i izmijeni",
search_command: "Traži dalje / Otvori prozor za traženje",
search: "Traži",
replace: "Izmijeni",
replace_command: "Izmijeni / Otvori prozor za traženje",
find_next: "Traži dalje",
replace_all: "Izmjeni sve",
reg_exp: "Regularni izrazi",
match_case: "Bitna vel. slova",
not_found: "nije naðeno.",
occurrence_replaced: "izmjenjenih.",
search_field_empty: "Prazno polje za traženje!",
restart_search_at_begin: "Došao do kraja. Poèeo od poèetka.",
move_popup: "Pomakni prozor",
font_size: "--Velièina teksta--",
go_to_line: "Odi na redak",
go_to_line_prompt: "Odi na redak:",
undo: "Vrati natrag",
redo: "Napravi ponovo",
change_smooth_selection: "Ukljuèi/iskljuèi neke moguænosti prikaza (pametniji prikaz, ali zagušeniji CPU)",
highlight: "Ukljuèi/iskljuèi bojanje sintakse",
reset_highlight: "Ponovi kolorizaciju (ako je nesinkronizirana s tekstom)",
help: "O edit_area",
save: "Spremi",
load: "Uèitaj",
line_abbr: "Ln",
char_abbr: "Zn",
position: "Pozicija",
total: "Ukupno",
close_popup: "Zatvori prozor",
shortcuts: "Kratice",
add_tab: "Dodaj tabulaciju",
remove_tab: "Makni tabulaciju",
about_notice: "Napomena: koloriziranje sintakse je samo za kratke kodove",
toggle: "Prebaci naèin ureðivanja",
accesskey: "Accesskey",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Procesiram...",
fullscreen: "Cijeli prozor"
};
@@ -1,45 +0,0 @@
editAreaLoader.lang["it"]={
new_document: "nuovo documento vuoto",
search_button: "cerca e sostituisci",
search_command: "trova successivo / apri finestra di ricerca",
search: "cerca",
replace: "sostituisci",
replace_command: "sostituisci / apri finestra di ricerca",
find_next: "trova successivo",
replace_all: "sostituisci tutti",
reg_exp: "espressioni regolari",
match_case: "confronta maiuscole/minuscole<br />",
not_found: "non trovato.",
occurrence_replaced: "occorrenze sostituite.",
search_field_empty: "Campo ricerca vuoto",
restart_search_at_begin: "Fine del testo raggiunta. Ricomincio dall'inizio.",
move_popup: "sposta popup di ricerca",
font_size: "-- Dimensione --",
go_to_line: "vai alla linea",
go_to_line_prompt: "vai alla linea numero:",
undo: "annulla",
redo: "ripeti",
change_smooth_selection: "abilita/disabilita alcune caratteristiche della visualizzazione",
highlight: "abilita/disabilita colorazione della sintassi",
reset_highlight: "aggiorna colorazione (se non sincronizzata)",
help: "informazioni su...",
save: "salva",
load: "carica",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Posizione",
total: "Totale",
close_popup: "chiudi popup",
shortcuts: "Scorciatoie",
add_tab: "aggiungi tabulazione",
remove_tab: "rimuovi tabulazione",
about_notice: "Avviso: la colorazione della sintassi vale solo con testo piccolo",
toggle: "Abilita/disabilita editor",
accesskey: "Accesskey",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "In corso...",
fullscreen: "fullscreen"
};
@@ -1,45 +0,0 @@
editAreaLoader.lang["ja"]={
new_document: "新規作成",
search_button: "検索・置換",
search_command: "次を検索 / 検索窓を表示",
search: "検索",
replace: "置換",
replace_command: "置換 / 置換窓を表示",
find_next: "次を検索",
replace_all: "全置換",
reg_exp: "正規表現",
match_case: "大文字小文字の区別",
not_found: "見つかりません。",
occurrence_replaced: "置換しました。",
search_field_empty: "検索対象文字列が空です。",
restart_search_at_begin: "終端に達しました、始めに戻ります",
move_popup: "検索窓を移動",
font_size: "--フォントサイズ--",
go_to_line: "指定行へ移動",
go_to_line_prompt: "指定行へ移動します:",
undo: "元に戻す",
redo: "やり直し",
change_smooth_selection: "スムース表示の切り替え(CPUを使います)",
highlight: "構文強調表示の切り替え",
reset_highlight: "構文強調表示のリセット",
help: "ヘルプを表示",
save: "保存",
load: "読み込み",
line_abbr: "行",
char_abbr: "文字",
position: "位置",
total: "合計",
close_popup: "ポップアップを閉じる",
shortcuts: "ショートカット",
add_tab: "タブを挿入する",
remove_tab: "タブを削除する",
about_notice: "注意:構文強調表示は短いテキストでしか有効に機能しません。",
toggle: "テキストエリアとeditAreaの切り替え",
accesskey: "アクセスキー",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "処理中です...",
fullscreen: "fullscreen"
};
@@ -1,45 +0,0 @@
editAreaLoader.lang["nl"]={
new_document: "nieuw leeg document",
search_button: "zoek en vervang",
search_command: "zoek volgende / zoekscherm openen",
search: "zoek",
replace: "vervang",
replace_command: "vervang / zoekscherm openen",
find_next: "volgende vinden",
replace_all: "alles vervangen",
reg_exp: "reguliere expressies",
match_case: "hoofdletter gevoelig",
not_found: "niet gevonden.",
occurrence_replaced: "object vervangen.",
search_field_empty: "Zoek veld leeg",
restart_search_at_begin: "Niet meer instanties gevonden, begin opnieuw",
move_popup: "versleep zoek scherm",
font_size: "--Letter grootte--",
go_to_line: "Ga naar regel",
go_to_line_prompt: "Ga naar regel nummer:",
undo: "Ongedaan maken",
redo: "Opnieuw doen",
change_smooth_selection: "zet wat schermopties aan/uit (kan langzamer zijn)",
highlight: "zet syntax highlight aan/uit",
reset_highlight: "reset highlight (indien gedesynchronizeerd)",
help: "informatie",
save: "opslaan",
load: "laden",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Positie",
total: "Totaal",
close_popup: "Popup sluiten",
shortcuts: "Snelkoppelingen",
add_tab: "voeg tabs toe in tekst",
remove_tab: "verwijder tabs uit tekst",
about_notice: "Notitie: syntax highlight functie is alleen voor kleine tekst",
toggle: "geavanceerde bewerkingsopties",
accesskey: "Accessknop",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Verwerken...",
fullscreen: "fullscreen"
};
@@ -1,45 +0,0 @@
editAreaLoader.lang["pl"]={
new_document: "nowy dokument",
search_button: "znajdź i zamień",
search_command: "znajdź następny",
search: "znajdź",
replace: "zamień",
replace_command: "zamień",
find_next: "następny",
replace_all: "zamień wszystko",
reg_exp: "wyrażenie regularne",
match_case: "uwzględnij wielkość liter<br />",
not_found: "nie znaleziono.",
occurrence_replaced: "wystąpień zamieniono.",
search_field_empty: "Nie wprowadzono tekstu",
restart_search_at_begin: "Koniec dokumentu. Wyszukiwanie od początku.",
move_popup: "przesuń okienko wyszukiwania",
font_size: "Rozmiar",
go_to_line: "idź do linii",
go_to_line_prompt: "numer linii:",
undo: "cofnij",
redo: "przywróć",
change_smooth_selection: "włącz/wyłącz niektóre opcje wyglądu (zaawansowane opcje wyglądu obciążają procesor)",
highlight: "włącz/wyłącz podświetlanie składni",
reset_highlight: "odśwież podświetlanie składni (jeśli rozsynchronizowało się z tekstem)",
help: "o programie",
save: "zapisz",
load: "otwórz",
line_abbr: "Ln",
char_abbr: "Zn",
position: "Pozycja",
total: "W sumie",
close_popup: "zamknij okienko",
shortcuts: "Skróty klawiaturowe",
add_tab: "dodaj wcięcie do zaznaczonego tekstu",
remove_tab: "usuń wcięcie",
about_notice: "Uwaga: podświetlanie składni nie jest zalecane dla długich tekstów",
toggle: "Włącz/wyłącz edytor",
accesskey: "Alt+",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Przetwarzanie...",
fullscreen: "fullscreen"
};
@@ -1,45 +0,0 @@
editAreaLoader.lang["pt"]={
new_document: "Novo documento",
search_button: "Localizar e substituir",
search_command: "Localizar próximo",
search: "Localizar",
replace: "Substituir",
replace_command: "Substituir",
find_next: "Localizar",
replace_all: "Subst. tudo",
reg_exp: "Expressões regulares",
match_case: "Diferenciar maiúsculas e minúsculas",
not_found: "Não encontrado.",
occurrence_replaced: "Ocorrências substituidas",
search_field_empty: "Campo localizar vazio.",
restart_search_at_begin: "Fim das ocorrências. Recomeçar do inicio.",
move_popup: "Mover janela",
font_size: "--Tamanho da fonte--",
go_to_line: "Ir para linha",
go_to_line_prompt: "Ir para a linha:",
undo: "Desfazer",
redo: "Refazer",
change_smooth_selection: "Opções visuais",
highlight: "Cores de sintaxe",
reset_highlight: "Resetar cores (se não sincronizado)",
help: "Sobre",
save: "Salvar",
load: "Carregar",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Posição",
total: "Total",
close_popup: "Fechar",
shortcuts: "Shortcuts",
add_tab: "Adicionar tabulação",
remove_tab: "Remover tabulação",
about_notice: "Atenção: Cores de sintaxe são indicados somente para textos pequenos",
toggle: "Exibir editor",
accesskey: "Accesskey",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "Processando...",
fullscreen: "fullscreen"
};
@@ -1,46 +0,0 @@
editAreaLoader.lang["zh_cn"]={
new_document: "新建文件",
search_button: "查找与替换",
search_command: "新查找/打开查找框",
search: "查找",
replace: "替换",
replace_command: "替换/打开查找框",
find_next: "查找下一个",
replace_all: "替换全部",
reg_exp: "正则表达式",
match_case: "大小写区分",
not_found: "无匹配.",
occurrence_replaced: "被替换次数.",
search_field_empty: "查找关键词为空",
restart_search_at_begin: "已达文字框底,重新开始.",
move_popup: "移动查找窗口",
font_size: "--文字大小--",
go_to_line: "指定行数",
go_to_line_prompt: "移动到指定行数:",
undo: "上一步",
redo: "下一步",
change_smooth_selection: "激活/禁止某些显示特效",
highlight: "代码高亮开关",
reset_highlight: "重设代码高亮",
help: "关于",
save: "保存",
save_as: "别存为",
load: "加载",
line_abbr: "行数",
char_abbr: "字节",
position: "位置",
total: "总共",
close_popup: "关闭窗口",
shortcuts: "快捷键",
add_tab: "添加间隔号",
remove_tab: "删除间隔号",
about_notice: "提示:代码高度功能只适用于小文档",
toggle: "转换编辑",
accesskey: "可访问键",
tab: "间隔号",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "处理中...",
fullscreen: "全屏"
};
@@ -1,69 +0,0 @@
editAreaLoader.load_syntax["basic"] = {
'COMMENT_SINGLE' : {1 : "'", 2 : 'rem'}
,'COMMENT_MULTI' : { }
,'QUOTEMARKS' : {1: '"'}
,'KEYWORD_CASE_SENSITIVE' : false
,'KEYWORDS' : {
'statements' : [
'if','then','for','wend','while',
'else','elseif','select','case','end select',
'until','next','step','to','end if', 'call'
]
,'keywords' : [
'sub', 'end sub', 'function', 'end function', 'exit',
'exit function', 'dim', 'redim', 'shared', 'const',
'is', 'absolute', 'access', 'any', 'append', 'as',
'base', 'beep', 'binary', 'bload', 'bsave', 'chain',
'chdir', 'circle', 'clear', 'close', 'cls', 'color',
'com', 'common', 'data', 'date', 'declare', 'def',
'defdbl', 'defint', 'deflng', 'defsng', 'defstr',
'double', 'draw', 'environ', 'erase', 'error', 'field',
'files', 'fn', 'get', 'gosub', 'goto', 'integer', 'key',
'kill', 'let', 'line', 'list', 'locate', 'lock', 'long',
'lprint', 'lset', 'mkdir', 'name', 'off', 'on', 'open',
'option', 'out', 'output', 'paint', 'palette', 'pcopy',
'poke', 'preset', 'print', 'pset', 'put', 'random',
'randomize', 'read', 'reset', 'restore', 'resume',
'return', 'rmdir', 'rset', 'run', 'screen', 'seg',
'shell', 'single', 'sleep', 'sound', 'static', 'stop',
'strig', 'string', 'swap', 'system', 'time', 'timer',
'troff', 'tron', 'type', 'unlock', 'using', 'view',
'wait', 'width', 'window', 'write'
]
,'functions' : [
'abs', 'asc', 'atn', 'cdbl', 'chr', 'cint', 'clng',
'cos', 'csng', 'csrlin', 'cvd', 'cvdmbf', 'cvi', 'cvl',
'cvs', 'cvsmbf', 'eof', 'erdev', 'erl', 'err', 'exp',
'fileattr', 'fix', 'fre', 'freefile', 'hex', 'inkey',
'inp', 'input', 'instr', 'int', 'ioctl', 'lbound',
'lcase', 'left', 'len', 'loc', 'lof', 'log', 'lpos',
'ltrim', 'mid', 'mkd', 'mkdmbf', 'mki', 'mkl', 'mks',
'mksmbf', 'oct', 'peek', 'pen', 'play', 'pmap', 'point',
'pos', 'right', 'rnd', 'rtrim', 'seek', 'sgn', 'sin',
'space', 'spc', 'sqr', 'stick', 'str', 'tab', 'tan',
'ubound', 'ucase', 'val', 'varptr', 'varseg'
]
,'operators' : [
'and', 'eqv', 'imp', 'mod', 'not', 'or', 'xor'
]
}
,'OPERATORS' :[
'+', '-', '/', '*', '=', '<', '>', '!', '&'
]
,'DELIMITERS' :[
'(', ')', '[', ']', '{', '}'
]
,'STYLES' : {
'COMMENTS': 'color: #99CC00;'
,'QUOTESMARKS': 'color: #333399;'
,'KEYWORDS' : {
'keywords' : 'color: #3366FF;'
,'functions' : 'color: #0000FF;'
,'statements' : 'color: #3366FF;'
,'operators' : 'color: #FF0000;'
}
,'OPERATORS' : 'color: #FF0000;'
,'DELIMITERS' : 'color: #0000FF;'
}
};
@@ -1,44 +0,0 @@
editAreaLoader.load_syntax["brainfuck"] = {
'COMMENT_SINGLE' : {}
,'COMMENT_MULTI' : {}
,'QUOTEMARKS' : {}
,'KEYWORD_CASE_SENSITIVE' : true
,'OPERATORS' :[
'+', '-'
]
,'DELIMITERS' :[
'[', ']'
]
,'REGEXPS' : {
'bfispis' : {
'search' : '()(\\.)()'
,'class' : 'bfispis'
,'modifiers' : 'g'
,'execute' : 'before'
}
,'bfupis' : {
'search' : '()(\\,)()'
,'class' : 'bfupis'
,'modifiers' : 'g'
,'execute' : 'before'
}
,'bfmemory' : {
'search' : '()([<>])()'
,'class' : 'bfmemory'
,'modifiers' : 'g'
,'execute' : 'before'
}
}
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #6381F8;'
,'OPERATORS' : 'color: #88AA00;'
,'DELIMITERS' : 'color: #00C138;'
,'REGEXPS' : {
'bfispis' : 'color: #EE0000;'
,'bfupis' : 'color: #4455ee;'
,'bfmemory' : 'color: #DD00DD;'
}
}
};
@@ -1,62 +0,0 @@
editAreaLoader.load_syntax["c"] = {
'COMMENT_SINGLE' : {1 : '//'}
,'COMMENT_MULTI' : {'/*' : '*/'}
,'QUOTEMARKS' : {1: "'", 2: '"'}
,'KEYWORD_CASE_SENSITIVE' : true
,'KEYWORDS' : {
'constants' : [
'NULL', 'false', 'stdin', 'stdout', 'stderr', 'true'
]
,'types' : [
'FILE', 'auto', 'char', 'const', 'double',
'extern', 'float', 'inline', 'int', 'long', 'register',
'short', 'signed', 'size_t', 'static', 'struct',
'time_t', 'typedef', 'union', 'unsigned', 'void',
'volatile'
]
,'statements' : [
'do', 'else', 'enum', 'for', 'goto', 'if', 'sizeof',
'switch', 'while'
]
,'keywords' : [
'break', 'case', 'continue', 'default', 'delete',
'return'
]
}
,'OPERATORS' :[
'+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
]
,'DELIMITERS' :[
'(', ')', '[', ']', '{', '}'
]
,'REGEXPS' : {
'precompiler' : {
'search' : '()(#[^\r\n]*)()'
,'class' : 'precompiler'
,'modifiers' : 'g'
,'execute' : 'before'
}
/* ,'precompilerstring' : {
'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
,'class' : 'precompilerstring'
,'modifiers' : 'g'
,'execute' : 'before'
}*/
}
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #6381F8;'
,'KEYWORDS' : {
'constants' : 'color: #EE0000;'
,'types' : 'color: #0000EE;'
,'statements' : 'color: #60CA00;'
,'keywords' : 'color: #48BDDF;'
}
,'OPERATORS' : 'color: #FF00FF;'
,'DELIMITERS' : 'color: #0038E1;'
,'REGEXPS' : {
'precompiler' : 'color: #009900;'
,'precompilerstring' : 'color: #994400;'
}
}
};
@@ -1,65 +0,0 @@
editAreaLoader.load_syntax["cpp"] = {
'COMMENT_SINGLE' : {1 : '//'}
,'COMMENT_MULTI' : {'/*' : '*/'}
,'QUOTEMARKS' : {1: "'", 2: '"'}
,'KEYWORD_CASE_SENSITIVE' : true
,'KEYWORDS' : {
'constants' : [
'NULL', 'false', 'std', 'stdin', 'stdout', 'stderr',
'true'
]
,'types' : [
'FILE', 'auto', 'char', 'class', 'const', 'double',
'extern', 'float', 'friend', 'inline', 'int',
'iterator', 'long', 'map', 'operator', 'queue',
'register', 'short', 'signed', 'size_t', 'stack',
'static', 'string', 'struct', 'time_t', 'typedef',
'union', 'unsigned', 'vector', 'void', 'volatile'
]
,'statements' : [
'catch', 'do', 'else', 'enum', 'for', 'goto', 'if',
'sizeof', 'switch', 'this', 'throw', 'try', 'while'
]
,'keywords' : [
'break', 'case', 'continue', 'default', 'delete',
'namespace', 'new', 'private', 'protected', 'public',
'return', 'using'
]
}
,'OPERATORS' :[
'+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
]
,'DELIMITERS' :[
'(', ')', '[', ']', '{', '}'
]
,'REGEXPS' : {
'precompiler' : {
'search' : '()(#[^\r\n]*)()'
,'class' : 'precompiler'
,'modifiers' : 'g'
,'execute' : 'before'
}
/* ,'precompilerstring' : {
'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
,'class' : 'precompilerstring'
,'modifiers' : 'g'
,'execute' : 'before'
}*/
}
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #6381F8;'
,'KEYWORDS' : {
'constants' : 'color: #EE0000;'
,'types' : 'color: #0000EE;'
,'statements' : 'color: #60CA00;'
,'keywords' : 'color: #48BDDF;'
}
,'OPERATORS' : 'color: #FF00FF;'
,'DELIMITERS' : 'color: #0038E1;'
,'REGEXPS' : {
'precompiler' : 'color: #009900;'
,'precompilerstring' : 'color: #994400;'
}
}
};
@@ -1,84 +0,0 @@
editAreaLoader.load_syntax["css"] = {
'COMMENT_SINGLE' : {1 : '@'}
,'COMMENT_MULTI' : {'/*' : '*/'}
,'QUOTEMARKS' : ['"', "'"]
,'KEYWORD_CASE_SENSITIVE' : false
,'KEYWORDS' : {
'attributes' : [
'aqua', 'azimuth', 'background-attachment', 'background-color',
'background-image', 'background-position', 'background-repeat',
'background', 'border-bottom-color', 'border-bottom-style',
'border-bottom-width', 'border-left-color', 'border-left-style',
'border-left-width', 'border-right', 'border-right-color',
'border-right-style', 'border-right-width', 'border-top-color',
'border-top-style', 'border-top-width','border-bottom', 'border-collapse',
'border-left', 'border-width', 'border-color', 'border-spacing',
'border-style', 'border-top', 'border', 'caption-side',
'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset',
'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display',
'elevation', 'empty-cells', 'float', 'font-family', 'font-size',
'font-size-adjust', 'font-stretch', 'font-style', 'font-variant',
'font-weight', 'font', 'height', 'letter-spacing', 'line-height',
'list-style', 'list-style-image', 'list-style-position', 'list-style-type',
'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin',
'marker-offset', 'marks', 'max-height', 'max-width', 'min-height',
'min-width', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style',
'outline-width', 'overflow', 'padding-bottom', 'padding-left',
'padding-right', 'padding-top', 'padding', 'page', 'page-break-after',
'page-break-before', 'page-break-inside', 'pause-after', 'pause-before',
'pause', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes',
'richness', 'right', 'size', 'speak-header', 'speak-numeral', 'speak-punctuation',
'speak', 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration',
'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi',
'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows',
'width', 'word-spacing', 'z-index', 'bottom', 'left'
]
,'values' : [
'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid',
'baseline', 'behind', 'below', 'bidi-override', 'black', 'blue', 'blink', 'block', 'bold', 'bolder', 'both',
'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic',
'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive',
'dashed', 'decimal-leading-zero', 'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
'e-resize', 'embed', 'extra-condensed', 'extra-expanded', 'expanded',
'fantasy', 'far-left', 'far-right', 'faster', 'fast', 'fixed', 'fuchsia',
'georgian', 'gray', 'green', 'groove', 'hebrew', 'help', 'hidden', 'hide', 'higher',
'high', 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table', 'inline',
'inset', 'inside', 'invert', 'italic', 'justify', 'katakana-iroha', 'katakana',
'landscape', 'larger', 'large', 'left-side', 'leftwards', 'level', 'lighter', 'lime', 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr', 'lower', 'low',
'maroon', 'medium', 'message-box', 'middle', 'mix', 'monospace',
'n-resize', 'narrower', 'navy', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize',
'oblique', 'olive', 'once', 'open-quote', 'outset', 'outside', 'overline',
'pointer', 'portrait', 'purple', 'px',
'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side', 'rightwards',
's-resize', 'sans-serif', 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid', 'spell-out', 'square',
'static', 'status-bar', 'super', 'sw-resize',
'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom', 'text-top', 'thick', 'thin', 'transparent',
'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url',
'visible',
'w-resize', 'wait', 'white', 'wider',
'x-fast', 'x-high', 'x-large', 'x-loud', 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small',
'yellow', 'yes'
]
,'specials' : [
'important'
]
}
,'OPERATORS' :[
':', ';', '!', '.', '#'
]
,'DELIMITERS' :[
'{', '}'
]
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #6381F8;'
,'KEYWORDS' : {
'attributes' : 'color: #48BDDF;'
,'values' : 'color: #2B60FF;'
,'specials' : 'color: #FF0000;'
}
,'OPERATORS' : 'color: #FF00FF;'
,'DELIMITERS' : 'color: #60CA00;'
}
};
@@ -1,50 +0,0 @@
/*
* last update: 2006-08-24
*/
editAreaLoader.load_syntax["html"] = {
'COMMENT_SINGLE' : {}
,'COMMENT_MULTI' : {'<!--' : '-->'}
,'QUOTEMARKS' : {1: "'", 2: '"'}
,'KEYWORD_CASE_SENSITIVE' : false
,'KEYWORDS' : {
}
,'OPERATORS' :[
]
,'DELIMITERS' :[
]
,'REGEXPS' : {
'doctype' : {
'search' : '()(<!DOCTYPE[^>]*>)()'
,'class' : 'doctype'
,'modifiers' : ''
,'execute' : 'before' // before or after
}
,'tags' : {
'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
,'class' : 'tags'
,'modifiers' : 'gi'
,'execute' : 'before' // before or after
}
,'attributes' : {
'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
,'class' : 'attributes'
,'modifiers' : 'g'
,'execute' : 'before' // before or after
}
}
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #6381F8;'
,'KEYWORDS' : {
}
,'OPERATORS' : 'color: #E775F0;'
,'DELIMITERS' : ''
,'REGEXPS' : {
'attributes': 'color: #B1AC41;'
,'tags': 'color: #E62253;'
,'doctype': 'color: #8DCFB5;'
,'test': 'color: #00FF00;'
}
}
};
@@ -1,60 +0,0 @@
editAreaLoader.load_syntax["js"] = {
'COMMENT_SINGLE' : {1 : '//'}
,'COMMENT_MULTI' : {'/*' : '*/'}
,'QUOTEMARKS' : {1: "'", 2: '"'}
,'KEYWORD_CASE_SENSITIVE' : true
,'KEYWORDS' : {
'statements' : [
'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
'while', 'write', 'with'
]
,'keywords' : [
'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document',
// the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice
'Link ', 'outerHeight ', 'Anchor', 'FileUpload',
'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self',
'arguments', 'locationbar', 'pageXoffset', 'Form',
'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status',
'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy',
'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden',
'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents',
'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text',
'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity',
'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed',
'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents',
'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus',
'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document',
'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window',
'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy'
]
,'functions' : [
// common functions for Window object
'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home',
'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status',
'stop'
]
}
,'OPERATORS' :[
'+', '-', '/', '*', '=', '<', '>', '%', '!'
]
,'DELIMITERS' :[
'(', ')', '[', ']', '{', '}'
]
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #6381F8;'
,'KEYWORDS' : {
'statements' : 'color: #60CA00;'
,'keywords' : 'color: #48BDDF;'
,'functions' : 'color: #2B60FF;'
}
,'OPERATORS' : 'color: #FF00FF;'
,'DELIMITERS' : 'color: #0038E1;'
}
};
@@ -1,82 +0,0 @@
editAreaLoader.load_syntax["pas"] = {
'COMMENT_SINGLE' : {}
,'COMMENT_MULTI' : {'{' : '}', '(*':'*)'}
,'QUOTEMARKS' : {1: '"', 2: "'"}
,'KEYWORD_CASE_SENSITIVE' : false
,'KEYWORDS' : {
'constants' : [
'Blink', 'Black', 'Blue', 'Green', 'Cyan', 'Red',
'Magenta', 'Brown', 'LightGray', 'DarkGray',
'LightBlue', 'LightGreen', 'LightCyan', 'LightRed',
'LightMagenta', 'Yellow', 'White', 'MaxSIntValue',
'MaxUIntValue', 'maxint', 'maxLongint', 'maxSmallint',
'erroraddr', 'errorcode', 'LineEnding'
]
,'keywords' : [
'in', 'or', 'div', 'mod', 'and', 'shl', 'shr', 'xor',
'pow', 'is', 'not','Absolute', 'And_then', 'Array',
'Begin', 'Bindable', 'Case', 'Const', 'Do', 'Downto',
'Else', 'End', 'Export', 'File', 'For', 'Function',
'Goto', 'If', 'Import', 'Implementation', 'Inherited',
'Inline', 'Interface', 'Label', 'Module', 'Nil',
'Object', 'Of', 'Only', 'Operator', 'Or_else',
'Otherwise', 'Packed', 'Procedure', 'Program',
'Protected', 'Qualified', 'Record', 'Repeat',
'Restricted', 'Set', 'Then', 'To', 'Type', 'Unit',
'Until', 'Uses', 'Value', 'Var', 'Virtual', 'While',
'With'
]
,'functions' : [
'Abs', 'Addr', 'Append', 'Arctan', 'Assert', 'Assign',
'Assigned', 'BinStr', 'Blockread', 'Blockwrite',
'Break', 'Chdir', 'Chr', 'Close', 'CompareByte',
'CompareChar', 'CompareDWord', 'CompareWord', 'Concat',
'Continue', 'Copy', 'Cos', 'CSeg', 'Dec', 'Delete',
'Dispose', 'DSeg', 'Eof', 'Eoln', 'Erase', 'Exclude',
'Exit', 'Exp', 'Filepos', 'Filesize', 'FillByte',
'Fillchar', 'FillDWord', 'Fillword', 'Flush', 'Frac',
'Freemem', 'Getdir', 'Getmem', 'GetMemoryManager',
'Halt', 'HexStr', 'Hi', 'High', 'Inc', 'Include',
'IndexByte', 'IndexChar', 'IndexDWord', 'IndexWord',
'Insert', 'IsMemoryManagerSet', 'Int', 'IOresult',
'Length', 'Ln', 'Lo', 'LongJmp', 'Low', 'Lowercase',
'Mark', 'Maxavail', 'Memavail', 'Mkdir', 'Move',
'MoveChar0', 'New', 'Odd', 'OctStr', 'Ofs', 'Ord',
'Paramcount', 'Paramstr', 'Pi', 'Pos', 'Power', 'Pred',
'Ptr', 'Random', 'Randomize', 'Read', 'Readln',
'Real2Double', 'Release', 'Rename', 'Reset', 'Rewrite',
'Rmdir', 'Round', 'Runerror', 'Seek', 'SeekEof',
'SeekEoln', 'Seg', 'SetMemoryManager', 'SetJmp',
'SetLength', 'SetString', 'SetTextBuf', 'Sin', 'SizeOf',
'Sptr', 'Sqr', 'Sqrt', 'SSeg', 'Str', 'StringOfChar',
'Succ', 'Swap', 'Trunc', 'Truncate', 'Upcase', 'Val',
'Write', 'WriteLn'
]
,'types' : [
'Integer', 'Shortint', 'SmallInt', 'Longint',
'Longword', 'Int64', 'Byte', 'Word', 'Cardinal',
'QWord', 'Boolean', 'ByteBool', 'LongBool', 'Char',
'Real', 'Single', 'Double', 'Extended', 'Comp',
'String', 'ShortString', 'AnsiString', 'PChar'
]
}
,'OPERATORS' :[
'@', '*', '+', '-', '/', '^', ':=', '<', '=', '>'
]
,'DELIMITERS' :[
'(', ')', '[', ']'
]
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #6381F8;'
,'KEYWORDS' : {
'specials' : 'color: #EE0000;'
,'constants' : 'color: #654321;'
,'keywords' : 'color: #48BDDF;'
,'functions' : 'color: #449922;'
,'types' : 'color: #2B60FF;'
}
,'OPERATORS' : 'color: #FF00FF;'
,'DELIMITERS' : 'color: #60CA00;'
}
};
@@ -1,75 +0,0 @@
editAreaLoader.load_syntax["php"] = {
'COMMENT_SINGLE' : {1 : '//', 2 : '#'}
,'COMMENT_MULTI' : {'/*' : '*/'}
,'QUOTEMARKS' : {1: "'", 2: '"'}
,'KEYWORD_CASE_SENSITIVE' : false
,'KEYWORDS' : {
'statements' : [
'include', 'require', 'include_once', 'require_once',
'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile',
'endif', 'switch', 'case', 'endswitch',
'return', 'break', 'continue'
]
,'reserved' : [
'_GET', '_POST', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST',
'null', '__LINE__', '__FILE__',
'false', '&lt;?php', '?&gt;', '&lt;?',
'&lt;script language', '&lt;/script&gt;',
'true', 'var', 'default',
'function', 'class', 'new', '&amp;new', 'this',
'__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION',
'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR',
'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR',
'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT',
'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE',
'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR',
'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL'
]
,'functions' : [
'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined',
'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions',
'extension_loaded', 'get_extension_funcs', 'debug_backtrace',
'constant', 'bin2hex', 'sleep', 'usleep', 'time', 'mktime', 'gmmktime', 'strftime', 'gmstrftime', 'strtotime', 'date', 'gmdate', 'getdate', 'localtime', 'checkdate', 'flush', 'wordwrap', 'htmlspecialchars', 'htmlentities', 'html_entity_decode', 'md5', 'md5_file', 'crc32', 'getimagesize', 'image_type_to_mime_type', 'phpinfo', 'phpversion', 'phpcredits', 'strnatcmp', 'strnatcasecmp', 'substr_count', 'strspn', 'strcspn', 'strtok', 'strtoupper', 'strtolower', 'strpos', 'strrpos', 'strrev', 'hebrev', 'hebrevc', 'nl2br', 'basename', 'dirname', 'pathinfo', 'stripslashes', 'stripcslashes', 'strstr', 'stristr', 'strrchr', 'str_shuffle', 'str_word_count', 'strcoll', 'substr', 'substr_replace', 'quotemeta', 'ucfirst', 'ucwords', 'strtr', 'addslashes', 'addcslashes', 'rtrim', 'str_replace', 'str_repeat', 'count_chars', 'chunk_split', 'trim', 'ltrim', 'strip_tags', 'similar_text', 'explode', 'implode', 'setlocale', 'localeconv',
'parse_str', 'str_pad', 'chop', 'strchr', 'sprintf', 'printf', 'vprintf', 'vsprintf', 'sscanf', 'fscanf', 'parse_url', 'urlencode', 'urldecode', 'rawurlencode', 'rawurldecode', 'readlink', 'linkinfo', 'link', 'unlink', 'exec', 'system', 'escapeshellcmd', 'escapeshellarg', 'passthru', 'shell_exec', 'proc_open', 'proc_close', 'rand', 'srand', 'getrandmax', 'mt_rand', 'mt_srand', 'mt_getrandmax', 'base64_decode', 'base64_encode', 'abs', 'ceil', 'floor', 'round', 'is_finite', 'is_nan', 'is_infinite', 'bindec', 'hexdec', 'octdec', 'decbin', 'decoct', 'dechex', 'base_convert', 'number_format', 'fmod', 'ip2long', 'long2ip', 'getenv', 'putenv', 'getopt', 'microtime', 'gettimeofday', 'getrusage', 'uniqid', 'quoted_printable_decode', 'set_time_limit', 'get_cfg_var', 'magic_quotes_runtime', 'set_magic_quotes_runtime', 'get_magic_quotes_gpc', 'get_magic_quotes_runtime',
'import_request_variables', 'error_log', 'serialize', 'unserialize', 'memory_get_usage', 'var_dump', 'var_export', 'debug_zval_dump', 'print_r','highlight_file', 'show_source', 'highlight_string', 'ini_get', 'ini_get_all', 'ini_set', 'ini_alter', 'ini_restore', 'get_include_path', 'set_include_path', 'restore_include_path', 'setcookie', 'header', 'headers_sent', 'connection_aborted', 'connection_status', 'ignore_user_abort', 'parse_ini_file', 'is_uploaded_file', 'move_uploaded_file', 'intval', 'floatval', 'doubleval', 'strval', 'gettype', 'settype', 'is_null', 'is_resource', 'is_bool', 'is_long', 'is_float', 'is_int', 'is_integer', 'is_double', 'is_real', 'is_numeric', 'is_string', 'is_array', 'is_object', 'is_scalar',
'ereg', 'ereg_replace', 'eregi', 'eregi_replace', 'split', 'spliti', 'join', 'sql_regcase', 'dl', 'pclose', 'popen', 'readfile', 'rewind', 'rmdir', 'umask', 'fclose', 'feof', 'fgetc', 'fgets', 'fgetss', 'fread', 'fopen', 'fpassthru', 'ftruncate', 'fstat', 'fseek', 'ftell', 'fflush', 'fwrite', 'fputs', 'mkdir', 'rename', 'copy', 'tempnam', 'tmpfile', 'file', 'file_get_contents', 'stream_select', 'stream_context_create', 'stream_context_set_params', 'stream_context_set_option', 'stream_context_get_options', 'stream_filter_prepend', 'stream_filter_append', 'fgetcsv', 'flock', 'get_meta_tags', 'stream_set_write_buffer', 'set_file_buffer', 'set_socket_blocking', 'stream_set_blocking', 'socket_set_blocking', 'stream_get_meta_data', 'stream_register_wrapper', 'stream_wrapper_register', 'stream_set_timeout', 'socket_set_timeout', 'socket_get_status', 'realpath', 'fnmatch', 'fsockopen', 'pfsockopen', 'pack', 'unpack', 'get_browser', 'crypt', 'opendir', 'closedir', 'chdir', 'getcwd', 'rewinddir', 'readdir', 'dir', 'glob', 'fileatime', 'filectime', 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', 'filesize', 'filetype', 'file_exists', 'is_writable', 'is_writeable', 'is_readable', 'is_executable', 'is_file', 'is_dir', 'is_link', 'stat', 'lstat', 'chown',
'touch', 'clearstatcache', 'mail', 'ob_start', 'ob_flush', 'ob_clean', 'ob_end_flush', 'ob_end_clean', 'ob_get_flush', 'ob_get_clean', 'ob_get_length', 'ob_get_level', 'ob_get_status', 'ob_get_contents', 'ob_implicit_flush', 'ob_list_handlers', 'ksort', 'krsort', 'natsort', 'natcasesort', 'asort', 'arsort', 'sort', 'rsort', 'usort', 'uasort', 'uksort', 'shuffle', 'array_walk', 'count', 'end', 'prev', 'next', 'reset', 'current', 'key', 'min', 'max', 'in_array', 'array_search', 'extract', 'compact', 'array_fill', 'range', 'array_multisort', 'array_push', 'array_pop', 'array_shift', 'array_unshift', 'array_splice', 'array_slice', 'array_merge', 'array_merge_recursive', 'array_keys', 'array_values', 'array_count_values', 'array_reverse', 'array_reduce', 'array_pad', 'array_flip', 'array_change_key_case', 'array_rand', 'array_unique', 'array_intersect', 'array_intersect_assoc', 'array_diff', 'array_diff_assoc', 'array_sum', 'array_filter', 'array_map', 'array_chunk', 'array_key_exists', 'pos', 'sizeof', 'key_exists', 'assert', 'assert_options', 'version_compare', 'ftok', 'str_rot13', 'aggregate',
'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode',
'session_start', 'session_destroy', 'session_unset', 'session_set_save_handler', 'session_cache_limiter', 'session_cache_expire', 'session_set_cookie_params', 'session_get_cookie_params', 'session_write_close', 'preg_match', 'preg_match_all', 'preg_replace', 'preg_replace_callback', 'preg_split', 'preg_quote', 'preg_grep', 'overload', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', 'ctype_lower', 'ctype_graph', 'ctype_print', 'ctype_punct', 'ctype_space', 'ctype_upper', 'ctype_xdigit', 'virtual', 'apache_request_headers', 'apache_note', 'apache_lookup_uri', 'apache_child_terminate', 'apache_setenv', 'apache_response_headers', 'apache_get_version', 'getallheaders', 'mysql_connect', 'mysql_pconnect', 'mysql_close', 'mysql_select_db', 'mysql_create_db', 'mysql_drop_db', 'mysql_query', 'mysql_unbuffered_query', 'mysql_db_query', 'mysql_list_dbs', 'mysql_list_tables', 'mysql_list_fields', 'mysql_list_processes', 'mysql_error', 'mysql_errno', 'mysql_affected_rows', 'mysql_insert_id', 'mysql_result', 'mysql_num_rows', 'mysql_num_fields', 'mysql_fetch_row', 'mysql_fetch_array', 'mysql_fetch_assoc', 'mysql_fetch_object', 'mysql_data_seek', 'mysql_fetch_lengths', 'mysql_fetch_field', 'mysql_field_seek', 'mysql_free_result', 'mysql_field_name', 'mysql_field_table', 'mysql_field_len', 'mysql_field_type', 'mysql_field_flags', 'mysql_escape_string', 'mysql_real_escape_string', 'mysql_stat',
'mysql_thread_id', 'mysql_client_encoding', 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', 'mysql_get_server_info', 'mysql_info', 'mysql', 'mysql_fieldname', 'mysql_fieldtable', 'mysql_fieldlen', 'mysql_fieldtype', 'mysql_fieldflags', 'mysql_selectdb', 'mysql_createdb', 'mysql_dropdb', 'mysql_freeresult', 'mysql_numfields', 'mysql_numrows', 'mysql_listdbs', 'mysql_listtables', 'mysql_listfields', 'mysql_db_name', 'mysql_dbname', 'mysql_tablename', 'mysql_table_name', 'pg_connect', 'pg_pconnect', 'pg_close', 'pg_connection_status', 'pg_connection_busy', 'pg_connection_reset', 'pg_host', 'pg_dbname', 'pg_port', 'pg_tty', 'pg_options', 'pg_ping', 'pg_query', 'pg_send_query', 'pg_cancel_query', 'pg_fetch_result', 'pg_fetch_row', 'pg_fetch_assoc', 'pg_fetch_array', 'pg_fetch_object', 'pg_fetch_all', 'pg_affected_rows', 'pg_get_result', 'pg_result_seek', 'pg_result_status', 'pg_free_result', 'pg_last_oid', 'pg_num_rows', 'pg_num_fields', 'pg_field_name', 'pg_field_num', 'pg_field_size', 'pg_field_type', 'pg_field_prtlen', 'pg_field_is_null', 'pg_get_notify', 'pg_get_pid', 'pg_result_error', 'pg_last_error', 'pg_last_notice', 'pg_put_line', 'pg_end_copy', 'pg_copy_to', 'pg_copy_from',
'pg_trace', 'pg_untrace', 'pg_lo_create', 'pg_lo_unlink', 'pg_lo_open', 'pg_lo_close', 'pg_lo_read', 'pg_lo_write', 'pg_lo_read_all', 'pg_lo_import', 'pg_lo_export', 'pg_lo_seek', 'pg_lo_tell', 'pg_escape_string', 'pg_escape_bytea', 'pg_unescape_bytea', 'pg_client_encoding', 'pg_set_client_encoding', 'pg_meta_data', 'pg_convert', 'pg_insert', 'pg_update', 'pg_delete', 'pg_select', 'pg_exec', 'pg_getlastoid', 'pg_cmdtuples', 'pg_errormessage', 'pg_numrows', 'pg_numfields', 'pg_fieldname', 'pg_fieldsize', 'pg_fieldtype', 'pg_fieldnum', 'pg_fieldprtlen', 'pg_fieldisnull', 'pg_freeresult', 'pg_result', 'pg_loreadall', 'pg_locreate', 'pg_lounlink', 'pg_loopen', 'pg_loclose', 'pg_loread', 'pg_lowrite', 'pg_loimport', 'pg_loexport',
'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die'
]
}
,'OPERATORS' :[
'+', '-', '/', '*', '=', '<', '>', '%', '!', '&&', '||'
]
,'DELIMITERS' :[
'(', ')', '[', ']', '{', '}'
]
,'REGEXPS' : {
// highlight all variables ($...)
'variables' : {
'search' : '()(\\$\\w+)()'
,'class' : 'variables'
,'modifiers' : 'g'
,'execute' : 'before' // before or after
}
}
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #879EFA;'
,'KEYWORDS' : {
'reserved' : 'color: #48BDDF;'
,'functions' : 'color: #0040FD;'
,'statements' : 'color: #60CA00;'
}
,'OPERATORS' : 'color: #FF00FF;'
,'DELIMITERS' : 'color: #2B60FF;'
,'REGEXPS' : {
'variables' : 'color: #E0BD54;'
}
}
};
@@ -1,144 +0,0 @@
/**
* Python syntax v 1.1
*
* v1.1 by Andre Roberge (2006/12/27)
*
**/
editAreaLoader.load_syntax["python"] = {
'COMMENT_SINGLE' : {1 : '#'}
,'COMMENT_MULTI' : {}
,'QUOTEMARKS' : {1: "'", 2: '"'}
,'KEYWORD_CASE_SENSITIVE' : true
,'KEYWORDS' : {
/*
** Set 1: reserved words
** http://python.org/doc/current/ref/keywords.html
** Note: 'as' and 'with' have been added starting with Python 2.5
*/
'reserved' : [
'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',
'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if',
'import', 'is', 'in', 'lambda', 'not', 'or', 'pass', 'print', 'raise',
'return', 'try', 'while', 'with', 'yield'
//the following are *almost* reserved; we'll treat them as such
, 'False', 'True', 'None'
]
/*
** Set 2: builtins
** http://python.org/doc/current/lib/built-in-funcs.html
*/
,'builtins' : [
'__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp',
'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile',
'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help',
'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals',
'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',
'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode',
'vars', 'xrange', 'zip',
// Built-in constants: http://www.python.org/doc/2.4.1/lib/node35.html
//'False', 'True', 'None' have been included in 'reserved'
'NotImplemented', 'Ellipsis',
// Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html
'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError',
'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError',
'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError',
'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError',
'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError',
'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError',
'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning',
'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning',
'RuntimeWarning', 'FutureWarning',
// we will include the string methods as well
// http://python.org/doc/current/lib/string-methods.html
'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs',
'find', 'index', 'isalnum', 'isaplpha', 'isdigit', 'islower', 'isspace', 'istitle',
'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust',
'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
'translate', 'upper', 'zfill'
]
/*
** Set 3: standard library
** http://python.org/doc/current/lib/modindex.html
*/
,'stdlib' : [
'__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm',
'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer',
'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi',
'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop',
'collections', 'colorsys', 'commands', 'compileall', 'compiler', 'compiler',
'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt',
'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE',
'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm',
'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl',
'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl',
'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob',
'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib',
'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect',
'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap',
'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify',
'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator',
'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes',
'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile',
'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random',
're', 'readline', 'repr', 'resource', 'rexec', 'rfc822', 'rgbimg', 'rlcompleter',
'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve',
'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd',
'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string',
'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev',
'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios',
'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token',
'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2',
'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings',
'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml',
'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib'
]
/*
** Set 4: special methods
** http://python.org/doc/current/ref/specialnames.html
*/
,'special' : [
// Basic customization: http://python.org/doc/current/ref/customization.html
'__new__', '__init__', '__del__', '__repr__', '__str__',
'__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__',
'__hash__', '__nonzero__', '__unicode__', '__dict__',
// Attribute access: http://python.org/doc/current/ref/attribute-access.html
'__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__',
'__delete__', '__slots__',
// Class creation, callable objects
'__metaclass__', '__call__',
// Container types: http://python.org/doc/current/ref/sequence-types.html
'__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__',
'__getslice__', '__setslice__', '__delslice__',
// Numeric types: http://python.org/doc/current/ref/numeric-types.html
'__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__',
'__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__',
'__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__',
'__long__','__lshift__',
'__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__',
'__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__',
'__rshift__','__rsub__','__rmul__','__repr__','__rand__','__rxor__','__ror__',
'__sub__','__xor__'
]
}
,'OPERATORS' :[
'+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','
]
,'DELIMITERS' :[
'(', ')', '[', ']', '{', '}'
]
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #660066;'
,'KEYWORDS' : {
'reserved' : 'color: #0000FF;'
,'builtins' : 'color: #009900;'
,'stdlib' : 'color: #009900;'
,'special': 'color: #006666;'
}
,'OPERATORS' : 'color: #993300;'
,'DELIMITERS' : 'color: #993300;'
}
};
@@ -1,52 +0,0 @@
editAreaLoader.load_syntax["vb"] = {
'COMMENT_SINGLE' : {1 : "'"}
,'COMMENT_MULTI' : { }
,'QUOTEMARKS' : {1: '"'}
,'KEYWORD_CASE_SENSITIVE' : false
,'KEYWORDS' : {
'statements' : [
'if','then','for','each','while','do','loop',
'else','elseif','select','case','end select',
'until','next','step','to','in','end if'
]
,'keywords' : [
'empty','isempty','nothing','null','isnull','true','false',
'set','call',
'sub','end sub','function','end function','exit','exit function',
'dim','Mod','In','private','public','shared','const'
]
,'functions' : [
'CDate','Date','DateAdd','DateDiff','DatePart','DateSerial','DateValue','Day','FormatDateTime',
'Hour','IsDate','Minute','Month',
'MonthName','Now','Second','Time','Timer','TimeSerial','TimeValue','Weekday','WeekdayName ','Year',
'Asc','CBool','CByte','CCur','CDate','CDbl','Chr','CInt','CLng','CSng','CStr','Hex','Oct','FormatCurrency',
'FormatDateTime','FormatNumber','FormatPercent','Abs','Atn','Cos','Exp','Hex','Int','Fix','Log','Oct',
'Rnd','Sgn','Sin','Sqr','Tan',
'Array','Filter','IsArray','Join','LBound','Split','UBound',
'InStr','InStrRev','LCase','Left','Len','LTrim','RTrim','Trim','Mid','Replace','Right','Space','StrComp',
'String','StrReverse','UCase',
'CreateObject','Eval','GetLocale','GetObject','GetRef','InputBox','IsEmpty','IsNull','IsNumeric',
'IsObject','LoadPicture','MsgBox','RGB','Round','ScriptEngine','ScriptEngineBuildVersion','ScriptEngineMajorVersion',
'ScriptEngineMinorVersion','SetLocale','TypeName','VarType'
]
}
,'OPERATORS' :[
'+', '-', '/', '*', '=', '<', '>', '!', '&'
]
,'DELIMITERS' :[
'(', ')', '[', ']', '{', '}'
]
,'STYLES' : {
'COMMENTS': 'color: #99CC00;'
,'QUOTESMARKS': 'color: #333399;'
,'KEYWORDS' : {
'keywords' : 'color: #3366FF;'
,'functions' : 'color: #0000FF;'
,'statements' : 'color: #3366FF;'
}
,'OPERATORS' : 'color: #FF0000;'
,'DELIMITERS' : 'color: #0000FF;'
}
};
@@ -1,56 +0,0 @@
/*
* last update: 2006-08-24
*/
editAreaLoader.load_syntax["xml"] = {
'COMMENT_SINGLE' : {}
,'COMMENT_MULTI' : {'<!--' : '-->'}
,'QUOTEMARKS' : {1: "'", 2: '"'}
,'KEYWORD_CASE_SENSITIVE' : false
,'KEYWORDS' : {
}
,'OPERATORS' :[
]
,'DELIMITERS' :[
]
,'REGEXPS' : {
'xml' : {
'search' : '()(<\\?[^>]*?\\?>)()'
,'class' : 'xml'
,'modifiers' : 'g'
,'execute' : 'before' // before or after
}
,'cdatas' : {
'search' : '()(<!\\[CDATA\\[.*?\\]\\]>)()'
,'class' : 'cdata'
,'modifiers' : 'g'
,'execute' : 'before' // before or after
}
,'tags' : {
'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
,'class' : 'tags'
,'modifiers' : 'gi'
,'execute' : 'before' // before or after
}
,'attributes' : {
'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
,'class' : 'attributes'
,'modifiers' : 'g'
,'execute' : 'before' // before or after
}
}
,'STYLES' : {
'COMMENTS': 'color: #AAAAAA;'
,'QUOTESMARKS': 'color: #6381F8;'
,'KEYWORDS' : {
}
,'OPERATORS' : 'color: #E775F0;'
,'DELIMITERS' : ''
,'REGEXPS' : {
'attributes': 'color: #B1AC41;'
,'tags': 'color: #E62253;'
,'xml': 'color: #8DCFB5;'
,'cdata': 'color: #50B020;'
}
}
};
@@ -1,27 +0,0 @@
//function below added by logan (cailongqun [at] yahoo [dot] com [dot] cn) from www.phpletter.com
function selectFile()
{
var selectedFileRowNum = $('#selectedFileRowNum').val();
if(selectedFileRowNum != '' && $('#row' + selectedFileRowNum))
{
// insert information now
var url = $('#fileUrl'+selectedFileRowNum).val();
window.opener.SetUrl( url ) ;
window.close() ;
}else
{
alert(noFileSelected);
}
}
function cancelSelectFile()
{
// close popup window
window.close() ;
}
@@ -1,16 +0,0 @@
function selectFile(url)
{
window.opener.document.getElementById(elementId).value = url;
window.close() ;
}
function cancelSelectFile()
{
// close popup window
window.close() ;
}
@@ -1,5 +0,0 @@
function cancelSelectFile()
{
// close popup window
window.close();
}
@@ -1,248 +0,0 @@
// Some global instances
var tinymce = null, tinyMCEPopup, tinyMCE;
tinyMCEPopup = {
init : function() {
var t = this, w = t.getWin(), ti;
// Find API
tinymce = w.tinymce;
tinyMCE = w.tinyMCE;
t.editor = tinymce.EditorManager.activeEditor;
t.params = t.editor.windowManager.params;
// Setup local DOM
t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document);
t.dom.loadCSS(t.editor.settings.popup_css);
// Setup on init listeners
t.listeners = [];
t.onInit = {
add : function(f, s) {
t.listeners.push({func : f, scope : s});
}
};
t.isWindow = !t.getWindowArg('mce_inline');
t.id = t.getWindowArg('mce_window_id');
t.editor.windowManager.onOpen.dispatch(t.editor.windowManager, window);
},
getWin : function() {
return window.dialogArguments || opener || parent || top;
},
getWindowArg : function(n, dv) {
var v = this.params[n];
return tinymce.is(v) ? v : dv;
},
getParam : function(n, dv) {
return this.editor.getParam(n, dv);
},
getLang : function(n, dv) {
return this.editor.getLang(n, dv);
},
execCommand : function(cmd, ui, val) {
this.restoreSelection();
return this.editor.execCommand(cmd, ui, val);
},
resizeToInnerSize : function() {
var t = this, n, b = document.body, vp = t.dom.getViewPort(window), dw, dh;
dw = t.getWindowArg('mce_width') - vp.w;
dh = t.getWindowArg('mce_height') - vp.h;
if (t.isWindow)
window.resizeBy(dw, dh);
else
t.editor.windowManager.resizeBy(dw, dh, t.id);
},
executeOnLoad : function(s) {
this.onInit.add(function() {
eval(s);
});
},
storeSelection : function() {
this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark('simple');
},
restoreSelection : function() {
var t = tinyMCEPopup;
if (!t.isWindow && tinymce.isIE)
t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark);
},
requireLangPack : function() {
var u = this.getWindowArg('plugin_url') || this.getWindowArg('theme_url');
if (u)
document.write('<script type="text/javascript" src="' + u + '/langs/' + this.editor.settings.language + '_dlg.js' + '"></script>');
},
pickColor : function(e, element_id) {
this.execCommand('mceColorPicker', true, {
color : document.getElementById(element_id).value,
func : function(c) {
document.getElementById(element_id).value = c;
if (tinymce.is(document.getElementById(element_id).onchange, 'function'))
document.getElementById(element_id).onchange();
}
});
},
openBrowser : function(element_id, type, option) {
tinyMCEPopup.restoreSelection();
this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window);
},
close : function() {
var t = this;
t.dom = t.dom.doc = null; // Cleanup
t.editor.windowManager.close(window, t.id);
},
// Internal functions
_restoreSelection : function() {
var e = window.event.srcElement;
if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button'))
tinyMCEPopup.restoreSelection();
},
/* _restoreSelection : function() {
var e = window.event.srcElement;
// If user focus a non text input or textarea
if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text')
tinyMCEPopup.restoreSelection();
},*/
_onDOMLoaded : function() {
var t = this, ti = document.title, bm, h;
// Translate page
h = document.body.innerHTML;
// Replace a=x with a="x" in IE
if (tinymce.isIE)
h = h.replace(/ (value|title|alt)=([^\s>]+)/gi, ' $1="$2"');
document.body.innerHTML = t.editor.translate(h);
document.title = ti = t.editor.translate(ti);
document.body.style.display = '';
// Restore selection in IE when focus is placed on a non textarea or input element of the type text
if (tinymce.isIE)
document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);
t.restoreSelection();
// Call onInit
tinymce.each(t.listeners, function(o) {
o.func.call(o.scope, t.editor);
});
t.resizeToInnerSize();
if (t.isWindow)
window.focus();
else
t.editor.windowManager.setTitle(ti, t.id);
if (!tinymce.isIE && !t.isWindow) {
tinymce.dom.Event._add(document, 'focus', function() {
t.editor.windowManager.focus(t.id)
});
}
// Patch for accessibility
tinymce.each(t.dom.select('select'), function(e) {
e.onkeydown = tinyMCEPopup._accessHandler;
});
// Move focus to window
window.focus();
},
_accessHandler : function(e) {
var e = e || window.event;
if (e.keyCode == 13 || e.keyCode == 32) {
e = e.target || e.srcElement;
if (e.onchange)
e.onchange();
return tinymce.dom.Event.cancel(e);
}
},
_wait : function() {
var t = this, ti;
if (tinymce.isIE && document.location.protocol != 'https:') {
// Fake DOMContentLoaded on IE
document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>');
document.getElementById("__ie_onload").onreadystatechange = function() {
if (this.readyState == "complete") {
t._onDOMLoaded();
document.getElementById("__ie_onload").onreadystatechange = null; // Prevent leak
}
};
} else {
if (tinymce.isIE || tinymce.isWebKit) {
ti = setInterval(function() {
if (/loaded|complete/.test(document.readyState)) {
clearInterval(ti);
t._onDOMLoaded();
}
}, 10);
} else {
window.addEventListener('DOMContentLoaded', function() {
t._onDOMLoaded();
}, false);
}
}
}
};
tinyMCEPopup.init();
//tinyMCEPopup._wait(); // Wait for DOM Content Loaded
//tinyMCEPopup.requireLangPack();
function selectFile(url)
{
if(typeof(url) != 'undefined')
{
}
if(url != '')
{
var win = tinyMCEPopup.getWindowArg("window");
win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = url;
//for image browsers
try { win.ImageDialog.showPreviewImage(url); }
catch (e) { void(e); }
tinyMCEPopup.close();
}
}
function cancelSelectFile()
{
// close popup window
tinyMCEPopup.close();
}
-807
View File
@@ -1,807 +0,0 @@
/*
* jQuery form plugin
* @requires jQuery v1.1 or later
*
* Examples at: http://malsup.com/jquery/form/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: form.js,v 1.3 2008/10/13 07:24:50 cvs Exp $
* Version: 1.0.3
*/
(function($) {
/**
* ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
*
* ajaxSubmit accepts a single argument which can be either a success callback function
* or an options Object. If a function is provided it will be invoked upon successful
* completion of the submit and will be passed the response from the server.
* If an options Object is provided, the following attributes are supported:
*
* target: Identifies the element(s) in the page to be updated with the server response.
* This value may be specified as a jQuery selection string, a jQuery object,
* or a DOM element.
* default value: null
*
* url: URL to which the form data will be submitted.
* default value: value of form's 'action' attribute
*
* type: The method in which the form data should be submitted, 'GET' or 'POST'.
* default value: value of form's 'method' attribute (or 'GET' if none found)
*
* beforeSubmit: Callback method to be invoked before the form is submitted.
* default value: null
*
* success: Callback method to be invoked after the form has been successfully submitted
* and the response has been returned from the server
* default value: null
*
* dataType: Expected dataType of the response. One of: null, 'xml', 'script', or 'json'
* default value: null
*
* semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
* default value: false
*
* resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
*
* clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
*
*
* The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
* validating the form data. If the 'beforeSubmit' callback returns false then the form will
* not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
* in array format, the jQuery object, and the options object passed into ajaxSubmit.
* The form data array takes the following form:
*
* [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
*
* If a 'success' callback method is provided it is invoked after the response has been returned
* from the server. It is passed the responseText or responseXML value (depending on dataType).
* See jQuery.ajax for further details.
*
*
* The dataType option provides a means for specifying how the server response should be handled.
* This maps directly to the jQuery.httpData method. The following values are supported:
*
* 'xml': if dataType == 'xml' the server response is treated as XML and the 'success'
* callback method, if specified, will be passed the responseXML value
* 'json': if dataType == 'json' the server response will be evaluted and passed to
* the 'success' callback, if specified
* 'script': if dataType == 'script' the server response is evaluated in the global context
*
*
* Note that it does not make sense to use both the 'target' and 'dataType' options. If both
* are provided the target will be ignored.
*
* The semantic argument can be used to force form serialization in semantic order.
* This is normally true anyway, unless the form contains input elements of type='image'.
* If your form must be submitted with name/value pairs in semantic order and your form
* contains an input of type='image" then pass true for this arg, otherwise pass false
* (or nothing) to avoid the overhead for this logic.
*
*
* When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
*
* $("#form-id").submit(function() {
* $(this).ajaxSubmit(options);
* return false; // cancel conventional submit
* });
*
* When using ajaxForm(), however, this is done for you.
*
* @example
* $('#myForm').ajaxSubmit(function(data) {
* alert('Form submit succeeded! Server returned: ' + data);
* });
* @desc Submit form and alert server response
*
*
* @example
* var options = {
* target: '#myTargetDiv'
* };
* $('#myForm').ajaxSubmit(options);
* @desc Submit form and update page element with server response
*
*
* @example
* var options = {
* success: function(responseText) {
* alert(responseText);
* }
* };
* $('#myForm').ajaxSubmit(options);
* @desc Submit form and alert the server response
*
*
* @example
* var options = {
* beforeSubmit: function(formArray, jqForm) {
* if (formArray.length == 0) {
* alert('Please enter data.');
* return false;
* }
* }
* };
* $('#myForm').ajaxSubmit(options);
* @desc Pre-submit validation which aborts the submit operation if form data is empty
*
*
* @example
* var options = {
* url: myJsonUrl.php,
* dataType: 'json',
* success: function(data) {
* // 'data' is an object representing the the evaluated json data
* }
* };
* $('#myForm').ajaxSubmit(options);
* @desc json data returned and evaluated
*
*
* @example
* var options = {
* url: myXmlUrl.php,
* dataType: 'xml',
* success: function(responseXML) {
* // responseXML is XML document object
* var data = $('myElement', responseXML).text();
* }
* };
* $('#myForm').ajaxSubmit(options);
* @desc XML data returned from server
*
*
* @example
* var options = {
* resetForm: true
* };
* $('#myForm').ajaxSubmit(options);
* @desc submit form and reset it if successful
*
* @example
* $('#myForm).submit(function() {
* $(this).ajaxSubmit();
* return false;
* });
* @desc Bind form's submit event to use ajaxSubmit
*
*
* @name ajaxSubmit
* @type jQuery
* @param options object literal containing options which control the form submission process
* @cat Plugins/Form
* @return jQuery
*/
$.fn.ajaxSubmit = function(options) {
if (typeof options == 'function')
options = { success: options };
options = $.extend({
url: this.attr('action') || window.location,
type: this.attr('method') || 'GET'
}, options || {});
var a = this.formToArray(options.semantic);
// give pre-submit callback an opportunity to abort the submit
if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;
// fire vetoable 'validate' event
var veto = {};
$.event.trigger('form.submit.validate', [a, this, options, veto]);
if (veto.veto)
return this;
var q = $.param(a);//.replace(/%20/g,'+');
if (options.type.toUpperCase() == 'GET') {
options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
options.data = null; // data is null for 'get'
}
else
options.data = q; // data is the query string for 'post'
var $form = this, callbacks = [];
if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
// perform a load on the target only if dataType is not provided
if (!options.dataType && options.target) {
var oldSuccess = options.success;// || function(){};
callbacks.push(function(data) {
$(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments);
});
}
else if (options.success)
callbacks.push(options.success);
options.success = function(data, status) {
for (var i=0, max=callbacks.length; i < max; i++)
callbacks[i](data, status, $form);
};
// are there files to upload?
var files = $('input:file', this).fieldValue();
var found = false;
for (var j=0; j < files.length; j++)
if (files[j])
found = true;
if (options.iframe || found) // options.iframe allows user to force iframe mode
fileUpload();
else
$.ajax(options);
// fire 'notify' event
$.event.trigger('form.submit.notify', [this, options]);
return this;
// private function for handling file uploads (hat tip to YAHOO!)
function fileUpload() {
var form = $form[0];
var opts = $.extend({}, $.ajaxSettings, options);
var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
var $io = $('<iframe id="' + id + '" name="' + id + '" />');
var io = $io[0];
var op8 = $.browser.opera && window.opera.version() < 9;
if ($.browser.msie || op8) io.src = 'javascript:false;document.write("");';
$io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
var xhr = { // mock object
responseText: null,
responseXML: null,
status: 0,
statusText: 'n/a',
getAllResponseHeaders: function() {},
getResponseHeader: function() {},
setRequestHeader: function() {}
};
var g = opts.global;
// trigger ajax global events so that activity/block indicators work like normal
if (g && ! $.active++) $.event.trigger("ajaxStart");
if (g) $.event.trigger("ajaxSend", [xhr, opts]);
var cbInvoked = 0;
var timedOut = 0;
// take a breath so that pending repaints get some cpu time before the upload starts
setTimeout(function() {
$io.appendTo('body');
// jQuery's event binding doesn't work for iframe events in IE
io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
// make sure form attrs are set
var encAttr = form.encoding ? 'encoding' : 'enctype';
var t = $form.attr('target');
$form.attr({
target: id,
method: 'POST',
encAttr: 'multipart/form-data',
action: opts.url
});
// support timout
if (opts.timeout)
setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
form.submit();
$form.attr('target', t); // reset target
}, 10);
function cb() {
if (cbInvoked++) return;
io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
var ok = true;
try {
if (timedOut) throw 'timeout';
// extract the server response from the iframe
var data, doc;
doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
xhr.responseText = doc.body ? doc.body.innerHTML : null;
xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
if (opts.dataType == 'json' || opts.dataType == 'script') {
var ta = doc.getElementsByTagName('textarea')[0];
data = ta ? ta.value : xhr.responseText;
if (opts.dataType == 'json')
eval("data = " + data);
else
$.globalEval(data);
}
else if (opts.dataType == 'xml') {
data = xhr.responseXML;
if (!data && xhr.responseText != null)
data = toXml(xhr.responseText);
}
else {
data = xhr.responseText;
}
}
catch(e){
ok = false;
$.handleError(opts, xhr, 'error', e);
}
// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
if (ok) {
opts.success(data, 'success');
if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
}
if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
if (g && ! --$.active) $.event.trigger("ajaxStop");
if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
// clean up
setTimeout(function() {
$io.remove();
xhr.responseXML = null;
}, 100);
};
function toXml(s, doc) {
if (window.ActiveXObject) {
doc = new ActiveXObject('Microsoft.XMLDOM');
doc.async = 'false';
doc.loadXML(s);
}
else
doc = (new DOMParser()).parseFromString(s, 'text/xml');
return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
};
};
};
$.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids
/**
* ajaxForm() provides a mechanism for fully automating form submission.
*
* The advantages of using this method instead of ajaxSubmit() are:
*
* 1: This method will include coordinates for <input type="image" /> elements (if the element
* is used to submit the form).
* 2. This method will include the submit element's name/value data (for the element that was
* used to submit the form).
* 3. This method binds the submit() method to the form for you.
*
* Note that for accurate x/y coordinates of image submit elements in all browsers
* you need to also use the "dimensions" plugin (this method will auto-detect its presence).
*
* The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
* passes the options argument along after properly binding events for submit elements and
* the form itself. See ajaxSubmit for a full description of the options argument.
*
*
* @example
* var options = {
* target: '#myTargetDiv'
* };
* $('#myForm').ajaxSForm(options);
* @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
* when the form is submitted.
*
*
* @example
* var options = {
* success: function(responseText) {
* alert(responseText);
* }
* };
* $('#myForm').ajaxSubmit(options);
* @desc Bind form's submit event so that server response is alerted after the form is submitted.
*
*
* @example
* var options = {
* beforeSubmit: function(formArray, jqForm) {
* if (formArray.length == 0) {
* alert('Please enter data.');
* return false;
* }
* }
* };
* $('#myForm').ajaxSubmit(options);
* @desc Bind form's submit event so that pre-submit callback is invoked before the form
* is submitted.
*
*
* @name ajaxForm
* @param options object literal containing options which control the form submission process
* @return jQuery
* @cat Plugins/Form
* @type jQuery
*/
$.fn.ajaxForm = function(options) {
return this.ajaxFormUnbind().submit(submitHandler).each(function() {
// store options in hash
this.formPluginId = $.fn.ajaxForm.counter++;
$.fn.ajaxForm.optionHash[this.formPluginId] = options;
$(":submit,input:image", this).click(clickHandler);
});
};
$.fn.ajaxForm.counter = 1;
$.fn.ajaxForm.optionHash = {};
function clickHandler(e) {
var $form = this.form;
$form.clk = this;
if (this.type == 'image') {
if (e.offsetX != undefined) {
$form.clk_x = e.offsetX;
$form.clk_y = e.offsetY;
} else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
var offset = $(this).offset();
$form.clk_x = e.pageX - offset.left;
$form.clk_y = e.pageY - offset.top;
} else {
$form.clk_x = e.pageX - this.offsetLeft;
$form.clk_y = e.pageY - this.offsetTop;
}
}
// clear form vars
setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10);
};
function submitHandler() {
// retrieve options from hash
var id = this.formPluginId;
var options = $.fn.ajaxForm.optionHash[id];
$(this).ajaxSubmit(options);
return false;
};
/**
* ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
*
* @name ajaxFormUnbind
* @return jQuery
* @cat Plugins/Form
* @type jQuery
*/
$.fn.ajaxFormUnbind = function() {
this.unbind('submit', submitHandler);
return this.each(function() {
$(":submit,input:image", this).unbind('click', clickHandler);
});
};
/**
* formToArray() gathers form element data into an array of objects that can
* be passed to any of the following ajax functions: $.get, $.post, or load.
* Each object in the array has both a 'name' and 'value' property. An example of
* an array for a simple login form might be:
*
* [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
*
* It is this array that is passed to pre-submit callback functions provided to the
* ajaxSubmit() and ajaxForm() methods.
*
* The semantic argument can be used to force form serialization in semantic order.
* This is normally true anyway, unless the form contains input elements of type='image'.
* If your form must be submitted with name/value pairs in semantic order and your form
* contains an input of type='image" then pass true for this arg, otherwise pass false
* (or nothing) to avoid the overhead for this logic.
*
* @example var data = $("#myForm").formToArray();
* $.post( "myscript.cgi", data );
* @desc Collect all the data from a form and submit it to the server.
*
* @name formToArray
* @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
* @type Array<Object>
* @cat Plugins/Form
*/
$.fn.formToArray = function(semantic) {
var a = [];
if (this.length == 0) return a;
var form = this[0];
var els = semantic ? form.getElementsByTagName('*') : form.elements;
if (!els) return a;
for(var i=0, max=els.length; i < max; i++) {
var el = els[i];
var n = el.name;
if (!n) continue;
if (semantic && form.clk && el.type == "image") {
// handle image inputs on the fly when semantic == true
if(!el.disabled && form.clk == el)
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
continue;
}
var v = $.fieldValue(el, true);
if (v && v.constructor == Array) {
for(var j=0, jmax=v.length; j < jmax; j++)
a.push({name: n, value: v[j]});
}
else if (v !== null && typeof v != 'undefined')
a.push({name: n, value: v});
}
if (!semantic && form.clk) {
// input type=='image' are not found in elements array! handle them here
var inputs = form.getElementsByTagName("input");
for(var i=0, max=inputs.length; i < max; i++) {
var input = inputs[i];
var n = input.name;
if(n && !input.disabled && input.type == "image" && form.clk == input)
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
}
}
return a;
};
/**
* Serializes form data into a 'submittable' string. This method will return a string
* in the format: name1=value1&amp;name2=value2
*
* The semantic argument can be used to force form serialization in semantic order.
* If your form must be submitted with name/value pairs in semantic order then pass
* true for this arg, otherwise pass false (or nothing) to avoid the overhead for
* this logic (which can be significant for very large forms).
*
* @example var data = $("#myForm").formSerialize();
* $.ajax('POST', "myscript.cgi", data);
* @desc Collect all the data from a form into a single string
*
* @name formSerialize
* @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
* @type String
* @cat Plugins/Form
*/
$.fn.formSerialize = function(semantic) {
//hand off to jQuery.param for proper encoding
return $.param(this.formToArray(semantic));
};
/**
* Serializes all field elements in the jQuery object into a query string.
* This method will return a string in the format: name1=value1&amp;name2=value2
*
* The successful argument controls whether or not serialization is limited to
* 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
* The default value of the successful argument is true.
*
* @example var data = $("input").formSerialize();
* @desc Collect the data from all successful input elements into a query string
*
* @example var data = $(":radio").formSerialize();
* @desc Collect the data from all successful radio input elements into a query string
*
* @example var data = $("#myForm :checkbox").formSerialize();
* @desc Collect the data from all successful checkbox input elements in myForm into a query string
*
* @example var data = $("#myForm :checkbox").formSerialize(false);
* @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
*
* @example var data = $(":input").formSerialize();
* @desc Collect the data from all successful input, select, textarea and button elements into a query string
*
* @name fieldSerialize
* @param successful true if only successful controls should be serialized (default is true)
* @type String
* @cat Plugins/Form
*/
$.fn.fieldSerialize = function(successful) {
var a = [];
this.each(function() {
var n = this.name;
if (!n) return;
var v = $.fieldValue(this, successful);
if (v && v.constructor == Array) {
for (var i=0,max=v.length; i < max; i++)
a.push({name: n, value: v[i]});
}
else if (v !== null && typeof v != 'undefined')
a.push({name: this.name, value: v});
});
//hand off to jQuery.param for proper encoding
return $.param(a);
};
/**
* Returns the value(s) of the element in the matched set. For example, consider the following form:
*
* <form><fieldset>
* <input name="A" type="text" />
* <input name="A" type="text" />
* <input name="B" type="checkbox" value="B1" />
* <input name="B" type="checkbox" value="B2"/>
* <input name="C" type="radio" value="C1" />
* <input name="C" type="radio" value="C2" />
* </fieldset></form>
*
* var v = $(':text').fieldValue();
* // if no values are entered into the text inputs
* v == ['','']
* // if values entered into the text inputs are 'foo' and 'bar'
* v == ['foo','bar']
*
* var v = $(':checkbox').fieldValue();
* // if neither checkbox is checked
* v === undefined
* // if both checkboxes are checked
* v == ['B1', 'B2']
*
* var v = $(':radio').fieldValue();
* // if neither radio is checked
* v === undefined
* // if first radio is checked
* v == ['C1']
*
* The successful argument controls whether or not the field element must be 'successful'
* (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
* The default value of the successful argument is true. If this value is false the value(s)
* for each element is returned.
*
* Note: This method *always* returns an array. If no valid value can be determined the
* array will be empty, otherwise it will contain one or more values.
*
* @example var data = $("#myPasswordElement").fieldValue();
* alert(data[0]);
* @desc Alerts the current value of the myPasswordElement element
*
* @example var data = $("#myForm :input").fieldValue();
* @desc Get the value(s) of the form elements in myForm
*
* @example var data = $("#myForm :checkbox").fieldValue();
* @desc Get the value(s) for the successful checkbox element(s) in the jQuery object.
*
* @example var data = $("#mySingleSelect").fieldValue();
* @desc Get the value(s) of the select control
*
* @example var data = $(':text').fieldValue();
* @desc Get the value(s) of the text input or textarea elements
*
* @example var data = $("#myMultiSelect").fieldValue();
* @desc Get the values for the select-multiple control
*
* @name fieldValue
* @param Boolean successful true if only the values for successful controls should be returned (default is true)
* @type Array<String>
* @cat Plugins/Form
*/
$.fn.fieldValue = function(successful) {
for (var val=[], i=0, max=this.length; i < max; i++) {
var el = this[i];
var v = $.fieldValue(el, successful);
if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
continue;
v.constructor == Array ? $.merge(val, v) : val.push(v);
}
return val;
};
/**
* Returns the value of the field element.
*
* The successful argument controls whether or not the field element must be 'successful'
* (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
* The default value of the successful argument is true. If the given element is not
* successful and the successful arg is not false then the returned value will be null.
*
* Note: If the successful flag is true (default) but the element is not successful, the return will be null
* Note: The value returned for a successful select-multiple element will always be an array.
* Note: If the element has no value the return value will be undefined.
*
* @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
* @desc Gets the current value of the myPasswordElement element
*
* @name fieldValue
* @param Element el The DOM element for which the value will be returned
* @param Boolean successful true if value returned must be for a successful controls (default is true)
* @type String or Array<String> or null or undefined
* @cat Plugins/Form
*/
$.fieldValue = function(el, successful) {
var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
if (typeof successful == 'undefined') successful = true;
if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
(t == 'checkbox' || t == 'radio') && !el.checked ||
(t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
tag == 'select' && el.selectedIndex == -1))
return null;
if (tag == 'select') {
var index = el.selectedIndex;
if (index < 0) return null;
var a = [], ops = el.options;
var one = (t == 'select-one');
var max = (one ? index+1 : ops.length);
for(var i=(one ? index : 0); i < max; i++) {
var op = ops[i];
if (op.selected) {
// extra pain for IE...
var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
if (one) return v;
a.push(v);
}
}
return a;
}
return el.value;
};
/**
* Clears the form data. Takes the following actions on the form's input fields:
* - input text fields will have their 'value' property set to the empty string
* - select elements will have their 'selectedIndex' property set to -1
* - checkbox and radio inputs will have their 'checked' property set to false
* - inputs of type submit, button, reset, and hidden will *not* be effected
* - button elements will *not* be effected
*
* @example $('form').clearForm();
* @desc Clears all forms on the page.
*
* @name clearForm
* @type jQuery
* @cat Plugins/Form
*/
$.fn.clearForm = function() {
return this.each(function() {
$('input,select,textarea', this).clearFields();
});
};
/**
* Clears the selected form elements. Takes the following actions on the matched elements:
* - input text fields will have their 'value' property set to the empty string
* - select elements will have their 'selectedIndex' property set to -1
* - checkbox and radio inputs will have their 'checked' property set to false
* - inputs of type submit, button, reset, and hidden will *not* be effected
* - button elements will *not* be effected
*
* @example $('.myInputs').clearFields();
* @desc Clears all inputs with class myInputs
*
* @name clearFields
* @type jQuery
* @cat Plugins/Form
*/
$.fn.clearFields = $.fn.clearInputs = function() {
return this.each(function() {
var t = this.type, tag = this.tagName.toLowerCase();
if (t == 'text' || t == 'password' || tag == 'textarea')
this.value = '';
else if (t == 'checkbox' || t == 'radio')
this.checked = false;
else if (tag == 'select')
this.selectedIndex = -1;
});
};
/**
* Resets the form data. Causes all form elements to be reset to their original value.
*
* @example $('form').resetForm();
* @desc Resets all forms on the page.
*
* @name resetForm
* @type jQuery
* @cat Plugins/Form
*/
$.fn.resetForm = function() {
return this.each(function() {
// guard against an input with the name of 'reset'
// note that IE reports the reset function as an 'object'
if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
this.reset();
});
};
})(jQuery);
@@ -1,764 +0,0 @@
jQuery.iUtil = {
getPosition : function(e)
{
var x = 0;
var y = 0;
var es = e.style;
var restoreStyles = false;
if (jQuery(e).css('display') == 'none') {
var oldVisibility = es.visibility;
var oldPosition = es.position;
restoreStyles = true;
es.visibility = 'hidden';
es.display = 'block';
es.position = 'absolute';
}
var el = e;
while (el){
x += el.offsetLeft + (el.currentStyle && !jQuery.browser.opera ?parseInt(el.currentStyle.borderLeftWidth)||0:0);
y += el.offsetTop + (el.currentStyle && !jQuery.browser.opera ?parseInt(el.currentStyle.borderTopWidth)||0:0);
el = el.offsetParent;
}
el = e;
while (el && el.tagName && el.tagName.toLowerCase() != 'body')
{
x -= el.scrollLeft||0;
y -= el.scrollTop||0;
el = el.parentNode;
}
if (restoreStyles == true) {
es.display = 'none';
es.position = oldPosition;
es.visibility = oldVisibility;
}
return {x:x, y:y};
},
getPositionLite : function(el)
{
var x = 0, y = 0;
while(el) {
x += el.offsetLeft || 0;
y += el.offsetTop || 0;
el = el.offsetParent;
}
return {x:x, y:y};
},
getSize : function(e)
{
var w = jQuery.css(e,'width');
var h = jQuery.css(e,'height');
var wb = 0;
var hb = 0;
var es = e.style;
if (jQuery(e).css('display') != 'none') {
wb = e.offsetWidth;
hb = e.offsetHeight;
} else {
var oldVisibility = es.visibility;
var oldPosition = es.position;
es.visibility = 'hidden';
es.display = 'block';
es.position = 'absolute';
wb = e.offsetWidth;
hb = e.offsetHeight;
es.display = 'none';
es.position = oldPosition;
es.visibility = oldVisibility;
}
return {w:w, h:h, wb:wb, hb:hb};
},
getSizeLite : function(el)
{
return {
wb:el.offsetWidth||0,
hb:el.offsetHeight||0
};
},
getClient : function(e)
{
var h, w, de;
if (e) {
w = e.clientWidth;
h = e.clientHeight;
} else {
de = document.documentElement;
w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
}
return {w:w,h:h};
},
getScroll : function (e)
{
var t=0, l=0, w=0, h=0, iw=0, ih=0;
if (e && e.nodeName.toLowerCase() != 'body') {
t = e.scrollTop;
l = e.scrollLeft;
w = e.scrollWidth;
h = e.scrollHeight;
iw = 0;
ih = 0;
} else {
if (document.documentElement) {
t = document.documentElement.scrollTop;
l = document.documentElement.scrollLeft;
w = document.documentElement.scrollWidth;
h = document.documentElement.scrollHeight;
} else if (document.body) {
t = document.body.scrollTop;
l = document.body.scrollLeft;
w = document.body.scrollWidth;
h = document.body.scrollHeight;
}
iw = self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
ih = self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;
}
return { t: t, l: l, w: w, h: h, iw: iw, ih: ih };
},
getMargins : function(e, toInteger)
{
var el = jQuery(e);
var t = el.css('marginTop') || '';
var r = el.css('marginRight') || '';
var b = el.css('marginBottom') || '';
var l = el.css('marginLeft') || '';
if (toInteger)
return {
t: parseInt(t)||0,
r: parseInt(r)||0,
b: parseInt(b)||0,
l: parseInt(l)
};
else
return {t: t, r: r, b: b, l: l};
},
getPadding : function(e, toInteger)
{
var el = jQuery(e);
var t = el.css('paddingTop') || '';
var r = el.css('paddingRight') || '';
var b = el.css('paddingBottom') || '';
var l = el.css('paddingLeft') || '';
if (toInteger)
return {
t: parseInt(t)||0,
r: parseInt(r)||0,
b: parseInt(b)||0,
l: parseInt(l)
};
else
return {t: t, r: r, b: b, l: l};
},
getBorder : function(e, toInteger)
{
var el = jQuery(e);
var t = el.css('borderTopWidth') || '';
var r = el.css('borderRightWidth') || '';
var b = el.css('borderBottomWidth') || '';
var l = el.css('borderLeftWidth') || '';
if (toInteger)
return {
t: parseInt(t)||0,
r: parseInt(r)||0,
b: parseInt(b)||0,
l: parseInt(l)||0
};
else
return {t: t, r: r, b: b, l: l};
},
getPointer : function(event)
{
var x = event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)) || 0;
var y = event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) || 0;
return {x:x, y:y};
},
traverseDOM : function(nodeEl, func)
{
func(nodeEl);
nodeEl = nodeEl.firstChild;
while(nodeEl){
jQuery.iUtil.traverseDOM(nodeEl, func);
nodeEl = nodeEl.nextSibling;
}
},
purgeEvents : function(nodeEl)
{
jQuery.iUtil.traverseDOM(
nodeEl,
function(el)
{
for(var attr in el){
if(typeof el[attr] === 'function') {
el[attr] = null;
}
}
}
);
},
centerEl : function(el, axis)
{
var clientScroll = jQuery.iUtil.getScroll();
var windowSize = jQuery.iUtil.getSize(el);
if (!axis || axis == 'vertically')
jQuery(el).css(
{
top: clientScroll.t + ((Math.max(clientScroll.h,clientScroll.ih) - clientScroll.t - windowSize.hb)/2) + 'px'
}
);
if (!axis || axis == 'horizontally')
jQuery(el).css(
{
left: clientScroll.l + ((Math.max(clientScroll.w,clientScroll.iw) - clientScroll.l - windowSize.wb)/2) + 'px'
}
);
},
fixPNG : function (el, emptyGIF) {
var images = jQuery('img[@src*="png"]', el||document), png;
images.each( function() {
png = this.src;
this.src = emptyGIF;
this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + png + "')";
});
}
};
// Helper function to support older browsers!
[].indexOf || (Array.prototype.indexOf = function(v, n){
n = (n == null) ? 0 : n;
var m = this.length;
for (var i=n; i<m; i++)
if (this[i] == v)
return i;
return -1;
});
//iresizable show below
/**
* Interface Elements for jQuery
* Resizable
*
* http://interface.eyecon.ro
*
* Copyright (c) 2006 Stefan Petre
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
*
*/
jQuery.iResize = {
resizeElement: null,
resizeDirection: null,
dragged: null,
pointer: null,
sizes: null,
position: null,
/**
* internal: Start function
*/
startDrag: function(e) {
jQuery.iResize.dragged = (this.dragEl) ? this.dragEl: this;
jQuery.iResize.pointer = jQuery.iUtil.getPointer(e);
// Save original size
jQuery.iResize.sizes = {
width: parseInt(jQuery(jQuery.iResize.dragged).css('width')) || 0,
height: parseInt(jQuery(jQuery.iResize.dragged).css('height')) || 0
};
// Save original position
jQuery.iResize.position = {
top: parseInt(jQuery(jQuery.iResize.dragged).css('top')) || 0,
left: parseInt(jQuery(jQuery.iResize.dragged).css('left')) || 0
};
// Assign event handlers
jQuery(document)
.bind('mousemove', jQuery.iResize.moveDrag)
.bind('mouseup', jQuery.iResize.stopDrag);
// Callback?
if (typeof jQuery.iResize.dragged.resizeOptions.onDragStart === 'function') {
jQuery.iResize.dragged.resizeOptions.onDragStart.apply(jQuery.iResize.dragged);
}
return false;
},
/**
* internal: Stop function
*/
stopDrag: function(e) {
// Unbind event handlers
jQuery(document)
.unbind('mousemove', jQuery.iResize.moveDrag)
.unbind('mouseup', jQuery.iResize.stopDrag);
// Callback?
if (typeof jQuery.iResize.dragged.resizeOptions.onDragStop === 'function') {
jQuery.iResize.dragged.resizeOptions.onDragStop.apply(jQuery.iResize.dragged);
}
// Remove dragged element
jQuery.iResize.dragged = null;
},
/**
* internal: Move function
*/
moveDrag: function(e) {
if (!jQuery.iResize.dragged) {
return;
}
pointer = jQuery.iUtil.getPointer(e);
// Calculate new positions
newTop = jQuery.iResize.position.top - jQuery.iResize.pointer.y + pointer.y;
newLeft = jQuery.iResize.position.left - jQuery.iResize.pointer.x + pointer.x;
newTop = Math.max(
Math.min(newTop, jQuery.iResize.dragged.resizeOptions.maxBottom - jQuery.iResize.sizes.height),
jQuery.iResize.dragged.resizeOptions.minTop
);
newLeft = Math.max(
Math.min(newLeft, jQuery.iResize.dragged.resizeOptions.maxRight- jQuery.iResize.sizes.width),
jQuery.iResize.dragged.resizeOptions.minLeft
);
// Callback
if (typeof jQuery.iResize.dragged.resizeOptions.onDrag === 'function') {
var newPos = jQuery.iResize.dragged.resizeOptions.onDrag.apply(jQuery.iResize.dragged, [newLeft, newTop]);
if (typeof newPos == 'array' && newPos.length == 2) {
newLeft = newPos[0];
newTop = newPos[1];
}
}
// Update the element
jQuery.iResize.dragged.style.top = newTop + 'px';
jQuery.iResize.dragged.style.left = newLeft + 'px';
return false;
},
start: function(e) {
// Bind event handlers
jQuery(document)
.bind('mousemove', jQuery.iResize.move)
.bind('mouseup', jQuery.iResize.stop);
// Initialize resizable
jQuery.iResize.resizeElement = this.resizeElement;
jQuery.iResize.resizeDirection = this.resizeDirection;
jQuery.iResize.pointer = jQuery.iUtil.getPointer(e);
jQuery.iResize.sizes = {
width: parseInt(jQuery(this.resizeElement).css('width'))||0,
height: parseInt(jQuery(this.resizeElement).css('height'))||0
};
jQuery.iResize.position = {
top: parseInt(jQuery(this.resizeElement).css('top'))||0,
left: parseInt(jQuery(this.resizeElement).css('left'))||0
};
// Callback function
if (jQuery.iResize.resizeElement.resizeOptions.onStart) {
jQuery.iResize.resizeElement.resizeOptions.onStart.apply(jQuery.iResize.resizeElement, [this]);
}
return false;
},
stop: function() {
// Unbind event handlers
jQuery(document)
.unbind('mousemove', jQuery.iResize.move)
.unbind('mouseup', jQuery.iResize.stop);
// Callback function
if (jQuery.iResize.resizeElement.resizeOptions.onStop) {
jQuery.iResize.resizeElement.resizeOptions.onStop.apply(jQuery.iResize.resizeElement, [jQuery.iResize.resizeDirection]);
}
// Unbind
jQuery.iResize.resizeElement = null;
jQuery.iResize.resizeDirection = null;
},
getWidth: function(dx, side) {
return Math.min(
Math.max(jQuery.iResize.sizes.width + dx * side, jQuery.iResize.resizeElement.resizeOptions.minWidth),
jQuery.iResize.resizeElement.resizeOptions.maxWidth
);
},
getHeight: function(dy, side) {
return Math.min(
Math.max(jQuery.iResize.sizes.height + dy * side, jQuery.iResize.resizeElement.resizeOptions.minHeight),
jQuery.iResize.resizeElement.resizeOptions.maxHeight
);
},
getHeightMinMax: function(height) {
return Math.min(
Math.max(height, jQuery.iResize.resizeElement.resizeOptions.minHeight),
jQuery.iResize.resizeElement.resizeOptions.maxHeight
);
},
/**
* setting and getting the ratio value
* defined by Logan Cai cailongqun [at] yahoo [dot] com [dot] cn
*/
ResizeRatio: function(value)
{
var ratio;
this.each(
function() {
var el = this;
if(typeof(value) == 'integer')
{//setting new ratio
el.resizeOptions.ratio = value;
}else
{//getting the ratio
if(el.resizeOptions.ratio)
{
ratio = el.resizeOptions.ratio;
}else
{
var width = parseInt(jQuery(el).css('width')) || 0;
var height = parseInt(jQuery(el).css('height'))|| 0;
if(width > 0 && height > 0)
{
ratio = (Math.round(height/width * 10000)/10000);
}else
{
ratio = null;
}
}
}
}
);
return ratio;
},
/**
* setting and getting the ratio value
* defined by Logan Cai cailongqun [at] yahoo [dot] com [dot] cn
*/
ResizeConstraint: function(OnOrOff)
{
var ratio;
this.each(
function()
{
var el = this;
if(typeof(OnOrOff) != 'boolean' || !OnOrOff)
{//turn off resize constraint
el.resizeOptions.ratio = null;
}else
{//turn on the resize constraint and set the ratio calculated from current image width & height
var width = parseInt(jQuery(el).css('width')) || 0;
var height = parseInt(jQuery(el).css('height'))|| 0;
if(width > 0 && height > 0)
{
el.resizeOptions.ratio = (Math.round(height/width * 10000)/10000);
}else
{
el.resizeOptions.ratio = null;
}
}
}
);
},
move: function(e) {
if (jQuery.iResize.resizeElement == null) {
return;
}
pointer = jQuery.iUtil.getPointer(e);
dx = pointer.x - jQuery.iResize.pointer.x;
dy = pointer.y - jQuery.iResize.pointer.y;
newSizes = {
width: jQuery.iResize.sizes.width,
height: jQuery.iResize.sizes.height
};
newPosition = {
top: jQuery.iResize.position.top,
left: jQuery.iResize.position.left
};
switch (jQuery.iResize.resizeDirection){
case 'e':
newSizes.width = jQuery.iResize.getWidth(dx,1);
break;
case 'se':
newSizes.width = jQuery.iResize.getWidth(dx,1);
newSizes.height = jQuery.iResize.getHeight(dy,1);
break;
case 'w':
newSizes.width = jQuery.iResize.getWidth(dx,-1);
newPosition.left = jQuery.iResize.position.left - newSizes.width + jQuery.iResize.sizes.width;
break;
case 'sw':
newSizes.width = jQuery.iResize.getWidth(dx,-1);
newPosition.left = jQuery.iResize.position.left - newSizes.width + jQuery.iResize.sizes.width;
newSizes.height = jQuery.iResize.getHeight(dy,1);
break;
case 'nw':
newSizes.height = jQuery.iResize.getHeight(dy,-1);
newPosition.top = jQuery.iResize.position.top - newSizes.height + jQuery.iResize.sizes.height;
newSizes.width = jQuery.iResize.getWidth(dx,-1);
newPosition.left = jQuery.iResize.position.left - newSizes.width + jQuery.iResize.sizes.width;
break;
case 'n':
newSizes.height = jQuery.iResize.getHeight(dy,-1);
newPosition.top = jQuery.iResize.position.top - newSizes.height + jQuery.iResize.sizes.height;
break;
case 'ne':
newSizes.height = jQuery.iResize.getHeight(dy,-1);
newPosition.top = jQuery.iResize.position.top - newSizes.height + jQuery.iResize.sizes.height;
newSizes.width = jQuery.iResize.getWidth(dx,1);
break;
case 's':
newSizes.height = jQuery.iResize.getHeight(dy,1);
break;
}
if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
if (jQuery.iResize.resizeDirection == 'n' || jQuery.iResize.resizeDirection == 's')
nWidth = newSizes.height * jQuery.iResize.resizeElement.resizeOptions.ratio;
else
nWidth = newSizes.width;
nHeight = jQuery.iResize.getHeightMinMax(nWidth * jQuery.iResize.resizeElement.resizeOptions.ratio);
nWidth = nHeight / jQuery.iResize.resizeElement.resizeOptions.ratio;
switch (jQuery.iResize.resizeDirection){
case 'n':
case 'nw':
case 'ne':
newPosition.top += newSizes.height - nHeight;
break;
}
switch (jQuery.iResize.resizeDirection){
case 'nw':
case 'w':
case 'sw':
newPosition.left += newSizes.width - nWidth;
break;
}
newSizes.height = nHeight;
newSizes.width = nWidth;
}
if (newPosition.top < jQuery.iResize.resizeElement.resizeOptions.minTop) {
nHeight = newSizes.height + newPosition.top - jQuery.iResize.resizeElement.resizeOptions.minTop;
newPosition.top = jQuery.iResize.resizeElement.resizeOptions.minTop;
if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
nWidth = nHeight / jQuery.iResize.resizeElement.resizeOptions.ratio;
switch (jQuery.iResize.resizeDirection){
case 'nw':
case 'w':
case 'sw':
newPosition.left += newSizes.width - nWidth;
break;
}
newSizes.width = nWidth;
}
newSizes.height = nHeight;
}
if (newPosition.left < jQuery.iResize.resizeElement.resizeOptions.minLeft ) {
nWidth = newSizes.width + newPosition.left - jQuery.iResize.resizeElement.resizeOptions.minLeft;
newPosition.left = jQuery.iResize.resizeElement.resizeOptions.minLeft;
if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
nHeight = nWidth * jQuery.iResize.resizeElement.resizeOptions.ratio;
switch (jQuery.iResize.resizeDirection){
case 'n':
case 'nw':
case 'ne':
newPosition.top += newSizes.height - nHeight;
break;
}
newSizes.height = nHeight;
}
newSizes.width = nWidth;
}
if (newPosition.top + newSizes.height > jQuery.iResize.resizeElement.resizeOptions.maxBottom) {
newSizes.height = jQuery.iResize.resizeElement.resizeOptions.maxBottom - newPosition.top;
if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
newSizes.width = newSizes.height / jQuery.iResize.resizeElement.resizeOptions.ratio;
}
}
if (newPosition.left + newSizes.width > jQuery.iResize.resizeElement.resizeOptions.maxRight) {
newSizes.width = jQuery.iResize.resizeElement.resizeOptions.maxRight - newPosition.left;
if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
newSizes.height = newSizes.width * jQuery.iResize.resizeElement.resizeOptions.ratio;
}
}
var newDimensions = false;
if (jQuery.iResize.resizeElement.resizeOptions.onResize) {
newDimensions = jQuery.iResize.resizeElement.resizeOptions.onResize.apply( jQuery.iResize.resizeElement, [ newSizes, newPosition ] );
if (newDimensions) {
if (newDimensions.sizes) {
jQuery.extend(newSizes, newDimensions.sizes);
}
if (newDimensions.position) {
jQuery.extend(newPosition, newDimensions.position);
}
}
}
elS = jQuery.iResize.resizeElement.style;
elS.left = newPosition.left + 'px';
elS.top = newPosition.top + 'px';
elS.width = newSizes.width + 'px';
elS.height = newSizes.height + 'px';
return false;
},
/**
* Builds the resizable
*/
build: function(options) {
if (!options || !options.handlers || options.handlers.constructor != Object) {
return;
}
return this.each(
function() {
var el = this;
el.resizeOptions = options;
el.resizeOptions.minWidth = options.minWidth || 10;
el.resizeOptions.minHeight = options.minHeight || 10;
el.resizeOptions.maxWidth = options.maxWidth || 3000;
el.resizeOptions.maxHeight = options.maxHeight || 3000;
el.resizeOptions.minTop = options.minTop || -1000;
el.resizeOptions.minLeft = options.minLeft || -1000;
el.resizeOptions.maxRight = options.maxRight || 3000;
el.resizeOptions.maxBottom = options.maxBottom || 3000;
elPosition = jQuery(el).css('position');
if (!(elPosition == 'relative' || elPosition == 'absolute')) {
el.style.position = 'relative';
}
directions = /n|ne|e|se|s|sw|w|nw/g;
for (i in el.resizeOptions.handlers) {
if (i.toLowerCase().match(directions) != null) {
if (el.resizeOptions.handlers[i].constructor == String) {
handle = jQuery(el.resizeOptions.handlers[i]);
if (handle.size() > 0) {
el.resizeOptions.handlers[i] = handle.get(0);
}
}
if (el.resizeOptions.handlers[i].tagName) {
el.resizeOptions.handlers[i].resizeElement = el;
el.resizeOptions.handlers[i].resizeDirection = i;
jQuery(el.resizeOptions.handlers[i]).bind('mousedown', jQuery.iResize.start);
}
}
}
if (el.resizeOptions.dragHandle) {
if (typeof el.resizeOptions.dragHandle === 'string') {
handleEl = jQuery(el.resizeOptions.dragHandle);
if (handleEl.size() > 0) {
handleEl.each(function() {
this.dragEl = el;
});
handleEl.bind('mousedown', jQuery.iResize.startDrag);
}
} else if (el.resizeOptions.dragHandle == true) {
jQuery(this).bind('mousedown', jQuery.iResize.startDrag);
}
}
}
);
},
/**
* Destroys the resizable
*/
destroy: function() {
return this.each(
function() {
var el = this;
// Unbind the handlers
for (i in el.resizeOptions.handlers) {
el.resizeOptions.handlers[i].resizeElement = null;
el.resizeOptions.handlers[i].resizeDirection = null;
jQuery(el.resizeOptions.handlers[i]).unbind('mousedown', jQuery.iResize.start);
}
// Remove the draghandle
if (el.resizeOptions.dragHandle) {
if (typeof el.resizeOptions.dragHandle === 'string') {
handle = jQuery(el.resizeOptions.dragHandle);
if (handle.size() > 0) {
handle.unbind('mousedown', jQuery.iResize.startDrag);
}
} else if (el.resizeOptions.dragHandle == true) {
jQuery(this).unbind('mousedown', jQuery.iResize.startDrag);
}
}
// Reset the options
el.resizeOptions = null;
}
);
}
};
jQuery.fn.extend ({
/**
* Create a resizable element with a number of advanced options including callback, dragging
*
* @name Resizable
* @description Create a resizable element with a number of advanced options including callback, dragging
* @param Hash hash A hash of parameters. All parameters are optional.
* @option Hash handlers hash with keys for each resize direction (e, es, s, sw, w, nw, n) and value string selection
* @option Integer minWidth (optional) the minimum width that element can be resized to
* @option Integer maxWidth (optional) the maximum width that element can be resized to
* @option Integer minHeight (optional) the minimum height that element can be resized to
* @option Integer maxHeight (optional) the maximum height that element can be resized to
* @option Integer minTop (optional) the minmum top position to wich element can be moved to
* @option Integer minLeft (optional) the minmum left position to wich element can be moved to
* @option Integer maxRight (optional) the maximum right position to wich element can be moved to
* @option Integer maxBottom (optional) the maximum bottom position to wich element can be moved to
* @option Float ratio (optional) the ratio between width and height to constrain elements sizes to that ratio
* @option Mixed dragHandle (optional) true to make the element draggable, string selection for drag handle
* @option Function onDragStart (optional) A function to be executed whenever the dragging starts
* @option Function onDragStop (optional) A function to be executed whenever the dragging stops
* @option Function onDrag (optional) A function to be executed whenever the element is dragged
* @option Function onStart (optional) A function to be executed whenever the element starts to be resized
* @option Function onStop (optional) A function to be executed whenever the element stops to be resized
* @option Function onResize (optional) A function to be executed whenever the element is resized
* @type jQuery
* @cat Plugins/Interface
* @author Stefan Petre
*/
Resizable: jQuery.iResize.build,
ResizableRatio: jQuery.iResize.ResizeRatio,
ResizeConstraint: jQuery.iResize.ResizeConstraint,
/**
* Destroy a resizable
*
* @name ResizableDestroy
* @description Destroy a resizable
* @type jQuery
* @cat Plugins/Interface
* @author Stefan Petre
*/
ResizableDestroy: jQuery.iResize.destroy
});
@@ -1,527 +0,0 @@
/**
* Interface Elements for jQuery
* Resizable
*
* http://interface.eyecon.ro
*
* Copyright (c) 2006 Stefan Petre
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
*
*/
jQuery.iResize = {
resizeElement: null,
resizeDirection: null,
dragged: null,
pointer: null,
sizes: null,
position: null,
/**
* internal: Start function
*/
startDrag: function(e) {
jQuery.iResize.dragged = (this.dragEl) ? this.dragEl: this;
jQuery.iResize.pointer = jQuery.iUtil.getPointer(e);
// Save original size
jQuery.iResize.sizes = {
width: parseInt(jQuery(jQuery.iResize.dragged).css('width')) || 0,
height: parseInt(jQuery(jQuery.iResize.dragged).css('height')) || 0
};
// Save original position
jQuery.iResize.position = {
top: parseInt(jQuery(jQuery.iResize.dragged).css('top')) || 0,
left: parseInt(jQuery(jQuery.iResize.dragged).css('left')) || 0
};
// Assign event handlers
jQuery(document)
.bind('mousemove', jQuery.iResize.moveDrag)
.bind('mouseup', jQuery.iResize.stopDrag);
// Callback?
if (typeof jQuery.iResize.dragged.resizeOptions.onDragStart === 'function') {
jQuery.iResize.dragged.resizeOptions.onDragStart.apply(jQuery.iResize.dragged);
}
return false;
},
/**
* internal: Stop function
*/
stopDrag: function(e) {
// Unbind event handlers
jQuery(document)
.unbind('mousemove', jQuery.iResize.moveDrag)
.unbind('mouseup', jQuery.iResize.stopDrag);
// Callback?
if (typeof jQuery.iResize.dragged.resizeOptions.onDragStop === 'function') {
jQuery.iResize.dragged.resizeOptions.onDragStop.apply(jQuery.iResize.dragged);
}
// Remove dragged element
jQuery.iResize.dragged = null;
},
/**
* internal: Move function
*/
moveDrag: function(e) {
if (!jQuery.iResize.dragged) {
return;
}
pointer = jQuery.iUtil.getPointer(e);
// Calculate new positions
newTop = jQuery.iResize.position.top - jQuery.iResize.pointer.y + pointer.y;
newLeft = jQuery.iResize.position.left - jQuery.iResize.pointer.x + pointer.x;
newTop = Math.max(
Math.min(newTop, jQuery.iResize.dragged.resizeOptions.maxBottom - jQuery.iResize.sizes.height),
jQuery.iResize.dragged.resizeOptions.minTop
);
newLeft = Math.max(
Math.min(newLeft, jQuery.iResize.dragged.resizeOptions.maxRight- jQuery.iResize.sizes.width),
jQuery.iResize.dragged.resizeOptions.minLeft
);
// Callback
if (typeof jQuery.iResize.dragged.resizeOptions.onDrag === 'function') {
var newPos = jQuery.iResize.dragged.resizeOptions.onDrag.apply(jQuery.iResize.dragged, [newLeft, newTop]);
if (typeof newPos == 'array' && newPos.length == 2) {
newLeft = newPos[0];
newTop = newPos[1];
}
}
// Update the element
jQuery.iResize.dragged.style.top = newTop + 'px';
jQuery.iResize.dragged.style.left = newLeft + 'px';
return false;
},
start: function(e) {
// Bind event handlers
jQuery(document)
.bind('mousemove', jQuery.iResize.move)
.bind('mouseup', jQuery.iResize.stop);
// Initialize resizable
jQuery.iResize.resizeElement = this.resizeElement;
jQuery.iResize.resizeDirection = this.resizeDirection;
jQuery.iResize.pointer = jQuery.iUtil.getPointer(e);
jQuery.iResize.sizes = {
width: parseInt(jQuery(this.resizeElement).css('width'))||0,
height: parseInt(jQuery(this.resizeElement).css('height'))||0
};
jQuery.iResize.position = {
top: parseInt(jQuery(this.resizeElement).css('top'))||0,
left: parseInt(jQuery(this.resizeElement).css('left'))||0
};
// Callback function
if (jQuery.iResize.resizeElement.resizeOptions.onStart) {
jQuery.iResize.resizeElement.resizeOptions.onStart.apply(jQuery.iResize.resizeElement, [this]);
}
return false;
},
stop: function() {
// Unbind event handlers
jQuery(document)
.unbind('mousemove', jQuery.iResize.move)
.unbind('mouseup', jQuery.iResize.stop);
// Callback function
if (jQuery.iResize.resizeElement.resizeOptions.onStop) {
jQuery.iResize.resizeElement.resizeOptions.onStop.apply(jQuery.iResize.resizeElement, [jQuery.iResize.resizeDirection]);
}
// Unbind
jQuery.iResize.resizeElement = null;
jQuery.iResize.resizeDirection = null;
},
getWidth: function(dx, side) {
return Math.min(
Math.max(jQuery.iResize.sizes.width + dx * side, jQuery.iResize.resizeElement.resizeOptions.minWidth),
jQuery.iResize.resizeElement.resizeOptions.maxWidth
);
},
getHeight: function(dy, side) {
return Math.min(
Math.max(jQuery.iResize.sizes.height + dy * side, jQuery.iResize.resizeElement.resizeOptions.minHeight),
jQuery.iResize.resizeElement.resizeOptions.maxHeight
);
},
getHeightMinMax: function(height) {
return Math.min(
Math.max(height, jQuery.iResize.resizeElement.resizeOptions.minHeight),
jQuery.iResize.resizeElement.resizeOptions.maxHeight
);
},
/**
* setting and getting the ratio value
* defined by Logan Cai cailongqun [at] yahoo [dot] com [dot] cn
*/
ResizeRatio: function(value)
{
var ratio;
this.each(
function() {
var el = this;
if(typeof(value) == 'integer')
{//setting new ratio
el.resizeOptions.ratio = value;
}else
{//getting the ratio
if(el.resizeOptions.ratio)
{
ratio = el.resizeOptions.ratio;
}else
{
var width = parseInt(jQuery(el).css('width')) || 0;
var height = parseInt(jQuery(el).css('height'))|| 0;
if(width > 0 && height > 0)
{
ratio = (Math.round(height/width * 10000)/10000);
}else
{
ratio = null;
}
}
}
}
);
return ratio;
},
/**
* setting and getting the ratio value
* defined by Logan Cai cailongqun [at] yahoo [dot] com [dot] cn
*/
ResizeConstraint: function(OnOrOff)
{
var ratio;
this.each(
function()
{
var el = this;
if(typeof(OnOrOff) != 'boolean' || !OnOrOff)
{//turn off resize constraint
el.resizeOptions.ratio = null;
}else
{//turn on the resize constraint and set the ratio calculated from current image width & height
var width = parseInt(jQuery(el).css('width')) || 0;
var height = parseInt(jQuery(el).css('height'))|| 0;
if(width > 0 && height > 0)
{
el.resizeOptions.ratio = (Math.round(height/width * 10000)/10000);
}else
{
el.resizeOptions.ratio = null;
}
}
}
);
},
move: function(e) {
if (jQuery.iResize.resizeElement == null) {
return;
}
pointer = jQuery.iUtil.getPointer(e);
dx = pointer.x - jQuery.iResize.pointer.x;
dy = pointer.y - jQuery.iResize.pointer.y;
newSizes = {
width: jQuery.iResize.sizes.width,
height: jQuery.iResize.sizes.height
};
newPosition = {
top: jQuery.iResize.position.top,
left: jQuery.iResize.position.left
};
switch (jQuery.iResize.resizeDirection){
case 'e':
newSizes.width = jQuery.iResize.getWidth(dx,1);
break;
case 'se':
newSizes.width = jQuery.iResize.getWidth(dx,1);
newSizes.height = jQuery.iResize.getHeight(dy,1);
break;
case 'w':
newSizes.width = jQuery.iResize.getWidth(dx,-1);
newPosition.left = jQuery.iResize.position.left - newSizes.width + jQuery.iResize.sizes.width;
break;
case 'sw':
newSizes.width = jQuery.iResize.getWidth(dx,-1);
newPosition.left = jQuery.iResize.position.left - newSizes.width + jQuery.iResize.sizes.width;
newSizes.height = jQuery.iResize.getHeight(dy,1);
break;
case 'nw':
newSizes.height = jQuery.iResize.getHeight(dy,-1);
newPosition.top = jQuery.iResize.position.top - newSizes.height + jQuery.iResize.sizes.height;
newSizes.width = jQuery.iResize.getWidth(dx,-1);
newPosition.left = jQuery.iResize.position.left - newSizes.width + jQuery.iResize.sizes.width;
break;
case 'n':
newSizes.height = jQuery.iResize.getHeight(dy,-1);
newPosition.top = jQuery.iResize.position.top - newSizes.height + jQuery.iResize.sizes.height;
break;
case 'ne':
newSizes.height = jQuery.iResize.getHeight(dy,-1);
newPosition.top = jQuery.iResize.position.top - newSizes.height + jQuery.iResize.sizes.height;
newSizes.width = jQuery.iResize.getWidth(dx,1);
break;
case 's':
newSizes.height = jQuery.iResize.getHeight(dy,1);
break;
}
if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
if (jQuery.iResize.resizeDirection == 'n' || jQuery.iResize.resizeDirection == 's')
nWidth = newSizes.height * jQuery.iResize.resizeElement.resizeOptions.ratio;
else
nWidth = newSizes.width;
nHeight = jQuery.iResize.getHeightMinMax(nWidth * jQuery.iResize.resizeElement.resizeOptions.ratio);
nWidth = nHeight / jQuery.iResize.resizeElement.resizeOptions.ratio;
switch (jQuery.iResize.resizeDirection){
case 'n':
case 'nw':
case 'ne':
newPosition.top += newSizes.height - nHeight;
break;
}
switch (jQuery.iResize.resizeDirection){
case 'nw':
case 'w':
case 'sw':
newPosition.left += newSizes.width - nWidth;
break;
}
newSizes.height = nHeight;
newSizes.width = nWidth;
}
if (newPosition.top < jQuery.iResize.resizeElement.resizeOptions.minTop) {
nHeight = newSizes.height + newPosition.top - jQuery.iResize.resizeElement.resizeOptions.minTop;
newPosition.top = jQuery.iResize.resizeElement.resizeOptions.minTop;
if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
nWidth = nHeight / jQuery.iResize.resizeElement.resizeOptions.ratio;
switch (jQuery.iResize.resizeDirection){
case 'nw':
case 'w':
case 'sw':
newPosition.left += newSizes.width - nWidth;
break;
}
newSizes.width = nWidth;
}
newSizes.height = nHeight;
}
if (newPosition.left < jQuery.iResize.resizeElement.resizeOptions.minLeft ) {
nWidth = newSizes.width + newPosition.left - jQuery.iResize.resizeElement.resizeOptions.minLeft;
newPosition.left = jQuery.iResize.resizeElement.resizeOptions.minLeft;
if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
nHeight = nWidth * jQuery.iResize.resizeElement.resizeOptions.ratio;
switch (jQuery.iResize.resizeDirection){
case 'n':
case 'nw':
case 'ne':
newPosition.top += newSizes.height - nHeight;
break;
}
newSizes.height = nHeight;
}
newSizes.width = nWidth;
}
if (newPosition.top + newSizes.height > jQuery.iResize.resizeElement.resizeOptions.maxBottom) {
newSizes.height = jQuery.iResize.resizeElement.resizeOptions.maxBottom - newPosition.top;
if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
newSizes.width = newSizes.height / jQuery.iResize.resizeElement.resizeOptions.ratio;
}
}
if (newPosition.left + newSizes.width > jQuery.iResize.resizeElement.resizeOptions.maxRight) {
newSizes.width = jQuery.iResize.resizeElement.resizeOptions.maxRight - newPosition.left;
if (jQuery.iResize.resizeElement.resizeOptions.ratio) {
newSizes.height = newSizes.width * jQuery.iResize.resizeElement.resizeOptions.ratio;
}
}
var newDimensions = false;
if (jQuery.iResize.resizeElement.resizeOptions.onResize) {
newDimensions = jQuery.iResize.resizeElement.resizeOptions.onResize.apply( jQuery.iResize.resizeElement, [ newSizes, newPosition ] );
if (newDimensions) {
if (newDimensions.sizes) {
jQuery.extend(newSizes, newDimensions.sizes);
}
if (newDimensions.position) {
jQuery.extend(newPosition, newDimensions.position);
}
}
}
elS = jQuery.iResize.resizeElement.style;
elS.left = newPosition.left + 'px';
elS.top = newPosition.top + 'px';
elS.width = newSizes.width + 'px';
elS.height = newSizes.height + 'px';
return false;
},
/**
* Builds the resizable
*/
build: function(options) {
if (!options || !options.handlers || options.handlers.constructor != Object) {
return;
}
return this.each(
function() {
var el = this;
el.resizeOptions = options;
el.resizeOptions.minWidth = options.minWidth || 10;
el.resizeOptions.minHeight = options.minHeight || 10;
el.resizeOptions.maxWidth = options.maxWidth || 3000;
el.resizeOptions.maxHeight = options.maxHeight || 3000;
el.resizeOptions.minTop = options.minTop || -1000;
el.resizeOptions.minLeft = options.minLeft || -1000;
el.resizeOptions.maxRight = options.maxRight || 3000;
el.resizeOptions.maxBottom = options.maxBottom || 3000;
elPosition = jQuery(el).css('position');
if (!(elPosition == 'relative' || elPosition == 'absolute')) {
el.style.position = 'relative';
}
directions = /n|ne|e|se|s|sw|w|nw/g;
for (i in el.resizeOptions.handlers) {
if (i.toLowerCase().match(directions) != null) {
if (el.resizeOptions.handlers[i].constructor == String) {
handle = jQuery(el.resizeOptions.handlers[i]);
if (handle.size() > 0) {
el.resizeOptions.handlers[i] = handle.get(0);
}
}
if (el.resizeOptions.handlers[i].tagName) {
el.resizeOptions.handlers[i].resizeElement = el;
el.resizeOptions.handlers[i].resizeDirection = i;
jQuery(el.resizeOptions.handlers[i]).bind('mousedown', jQuery.iResize.start);
}
}
}
if (el.resizeOptions.dragHandle) {
if (typeof el.resizeOptions.dragHandle === 'string') {
handleEl = jQuery(el.resizeOptions.dragHandle);
if (handleEl.size() > 0) {
handleEl.each(function() {
this.dragEl = el;
});
handleEl.bind('mousedown', jQuery.iResize.startDrag);
}
} else if (el.resizeOptions.dragHandle == true) {
jQuery(this).bind('mousedown', jQuery.iResize.startDrag);
}
}
}
);
},
/**
* Destroys the resizable
*/
destroy: function() {
return this.each(
function() {
var el = this;
// Unbind the handlers
for (i in el.resizeOptions.handlers) {
el.resizeOptions.handlers[i].resizeElement = null;
el.resizeOptions.handlers[i].resizeDirection = null;
jQuery(el.resizeOptions.handlers[i]).unbind('mousedown', jQuery.iResize.start);
}
// Remove the draghandle
if (el.resizeOptions.dragHandle) {
if (typeof el.resizeOptions.dragHandle === 'string') {
handle = jQuery(el.resizeOptions.dragHandle);
if (handle.size() > 0) {
handle.unbind('mousedown', jQuery.iResize.startDrag);
}
} else if (el.resizeOptions.dragHandle == true) {
jQuery(this).unbind('mousedown', jQuery.iResize.startDrag);
}
}
// Reset the options
el.resizeOptions = null;
}
);
}
};
jQuery.fn.extend ({
/**
* Create a resizable element with a number of advanced options including callback, dragging
*
* @name Resizable
* @description Create a resizable element with a number of advanced options including callback, dragging
* @param Hash hash A hash of parameters. All parameters are optional.
* @option Hash handlers hash with keys for each resize direction (e, es, s, sw, w, nw, n) and value string selection
* @option Integer minWidth (optional) the minimum width that element can be resized to
* @option Integer maxWidth (optional) the maximum width that element can be resized to
* @option Integer minHeight (optional) the minimum height that element can be resized to
* @option Integer maxHeight (optional) the maximum height that element can be resized to
* @option Integer minTop (optional) the minmum top position to wich element can be moved to
* @option Integer minLeft (optional) the minmum left position to wich element can be moved to
* @option Integer maxRight (optional) the maximum right position to wich element can be moved to
* @option Integer maxBottom (optional) the maximum bottom position to wich element can be moved to
* @option Float ratio (optional) the ratio between width and height to constrain elements sizes to that ratio
* @option Mixed dragHandle (optional) true to make the element draggable, string selection for drag handle
* @option Function onDragStart (optional) A function to be executed whenever the dragging starts
* @option Function onDragStop (optional) A function to be executed whenever the dragging stops
* @option Function onDrag (optional) A function to be executed whenever the element is dragged
* @option Function onStart (optional) A function to be executed whenever the element starts to be resized
* @option Function onStop (optional) A function to be executed whenever the element stops to be resized
* @option Function onResize (optional) A function to be executed whenever the element is resized
* @type jQuery
* @cat Plugins/Interface
* @author Stefan Petre
*/
Resizable: jQuery.iResize.build,
ResizableRatio: jQuery.iResize.ResizeRatio,
ResizeConstraint: jQuery.iResize.ResizeConstraint,
/**
* Destroy a resizable
*
* @name ResizableDestroy
* @description Destroy a resizable
* @type jQuery
* @cat Plugins/Interface
* @author Stefan Petre
*/
ResizableDestroy: jQuery.iResize.destroy
});
-245
View File
@@ -1,245 +0,0 @@
/**
* Interface Elements for jQuery
* utility function
*
* http://interface.eyecon.ro
*
* Copyright (c) 2006 Stefan Petre
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
*
*/
jQuery.iUtil = {
getPosition : function(e)
{
var x = 0;
var y = 0;
var es = e.style;
var restoreStyles = false;
if (jQuery(e).css('display') == 'none') {
var oldVisibility = es.visibility;
var oldPosition = es.position;
restoreStyles = true;
es.visibility = 'hidden';
es.display = 'block';
es.position = 'absolute';
}
var el = e;
while (el){
x += el.offsetLeft + (el.currentStyle && !jQuery.browser.opera ?parseInt(el.currentStyle.borderLeftWidth)||0:0);
y += el.offsetTop + (el.currentStyle && !jQuery.browser.opera ?parseInt(el.currentStyle.borderTopWidth)||0:0);
el = el.offsetParent;
}
el = e;
while (el && el.tagName && el.tagName.toLowerCase() != 'body')
{
x -= el.scrollLeft||0;
y -= el.scrollTop||0;
el = el.parentNode;
}
if (restoreStyles == true) {
es.display = 'none';
es.position = oldPosition;
es.visibility = oldVisibility;
}
return {x:x, y:y};
},
getPositionLite : function(el)
{
var x = 0, y = 0;
while(el) {
x += el.offsetLeft || 0;
y += el.offsetTop || 0;
el = el.offsetParent;
}
return {x:x, y:y};
},
getSize : function(e)
{
var w = jQuery.css(e,'width');
var h = jQuery.css(e,'height');
var wb = 0;
var hb = 0;
var es = e.style;
if (jQuery(e).css('display') != 'none') {
wb = e.offsetWidth;
hb = e.offsetHeight;
} else {
var oldVisibility = es.visibility;
var oldPosition = es.position;
es.visibility = 'hidden';
es.display = 'block';
es.position = 'absolute';
wb = e.offsetWidth;
hb = e.offsetHeight;
es.display = 'none';
es.position = oldPosition;
es.visibility = oldVisibility;
}
return {w:w, h:h, wb:wb, hb:hb};
},
getSizeLite : function(el)
{
return {
wb:el.offsetWidth||0,
hb:el.offsetHeight||0
};
},
getClient : function(e)
{
var h, w, de;
if (e) {
w = e.clientWidth;
h = e.clientHeight;
} else {
de = document.documentElement;
w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
}
return {w:w,h:h};
},
getScroll : function (e)
{
var t=0, l=0, w=0, h=0, iw=0, ih=0;
if (e && e.nodeName.toLowerCase() != 'body') {
t = e.scrollTop;
l = e.scrollLeft;
w = e.scrollWidth;
h = e.scrollHeight;
iw = 0;
ih = 0;
} else {
if (document.documentElement) {
t = document.documentElement.scrollTop;
l = document.documentElement.scrollLeft;
w = document.documentElement.scrollWidth;
h = document.documentElement.scrollHeight;
} else if (document.body) {
t = document.body.scrollTop;
l = document.body.scrollLeft;
w = document.body.scrollWidth;
h = document.body.scrollHeight;
}
iw = self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
ih = self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;
}
return { t: t, l: l, w: w, h: h, iw: iw, ih: ih };
},
getMargins : function(e, toInteger)
{
var el = jQuery(e);
var t = el.css('marginTop') || '';
var r = el.css('marginRight') || '';
var b = el.css('marginBottom') || '';
var l = el.css('marginLeft') || '';
if (toInteger)
return {
t: parseInt(t)||0,
r: parseInt(r)||0,
b: parseInt(b)||0,
l: parseInt(l)
};
else
return {t: t, r: r, b: b, l: l};
},
getPadding : function(e, toInteger)
{
var el = jQuery(e);
var t = el.css('paddingTop') || '';
var r = el.css('paddingRight') || '';
var b = el.css('paddingBottom') || '';
var l = el.css('paddingLeft') || '';
if (toInteger)
return {
t: parseInt(t)||0,
r: parseInt(r)||0,
b: parseInt(b)||0,
l: parseInt(l)
};
else
return {t: t, r: r, b: b, l: l};
},
getBorder : function(e, toInteger)
{
var el = jQuery(e);
var t = el.css('borderTopWidth') || '';
var r = el.css('borderRightWidth') || '';
var b = el.css('borderBottomWidth') || '';
var l = el.css('borderLeftWidth') || '';
if (toInteger)
return {
t: parseInt(t)||0,
r: parseInt(r)||0,
b: parseInt(b)||0,
l: parseInt(l)||0
};
else
return {t: t, r: r, b: b, l: l};
},
getPointer : function(event)
{
var x = event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)) || 0;
var y = event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) || 0;
return {x:x, y:y};
},
traverseDOM : function(nodeEl, func)
{
func(nodeEl);
nodeEl = nodeEl.firstChild;
while(nodeEl){
jQuery.iUtil.traverseDOM(nodeEl, func);
nodeEl = nodeEl.nextSibling;
}
},
purgeEvents : function(nodeEl)
{
jQuery.iUtil.traverseDOM(
nodeEl,
function(el)
{
for(var attr in el){
if(typeof el[attr] === 'function') {
el[attr] = null;
}
}
}
);
},
centerEl : function(el, axis)
{
var clientScroll = jQuery.iUtil.getScroll();
var windowSize = jQuery.iUtil.getSize(el);
if (!axis || axis == 'vertically')
jQuery(el).css(
{
top: clientScroll.t + ((Math.max(clientScroll.h,clientScroll.ih) - clientScroll.t - windowSize.hb)/2) + 'px'
}
);
if (!axis || axis == 'horizontally')
jQuery(el).css(
{
left: clientScroll.l + ((Math.max(clientScroll.w,clientScroll.iw) - clientScroll.l - windowSize.wb)/2) + 'px'
}
);
},
fixPNG : function (el, emptyGIF) {
var images = jQuery('img[@src*="png"]', el||document), png;
images.each( function() {
png = this.src;
this.src = emptyGIF;
this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + png + "')";
});
}
};
// Helper function to support older browsers!
[].indexOf || (Array.prototype.indexOf = function(v, n){
n = (n == null) ? 0 : n;
var m = this.length;
for (var i=n; i<m; i++)
if (this[i] == v)
return i;
return -1;
});
File diff suppressed because one or more lines are too long
-444
View File
@@ -1,444 +0,0 @@
/*
* jQuery Media Plugin for converting elements into rich media content.
*
* Examples and documentation at: http://malsup.com/jquery/media/
* Copyright (c) 2007 M. Alsup
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* @author: M. Alsup
* @version: 0.70 (7/05/2007)
* @requires jQuery v1.1.2 or later
*
* Supported Media Players:
* - Flash
* - Quicktime
* - Real Player
* - Silverlight
* - Windows Media Player
* - iframe
*
* Supported Media Formats:
* Any types supported by the above players, such as:
* Video: asf, avi, flv, mov, mpg, mpeg, mp4, qt, smil, swf, wmv, 3g2, 3gp
* Audio: aif, aac, au, gsm, mid, midi, mov, mp3, m4a, snd, rm, wav, wma
* Other: bmp, html, pdf, psd, qif, qtif, qti, tif, tiff, xaml
*
* Thanks to Mark Hicken and Brent Pedersen for helping me debug this on the Mac!
*/
(function($) {
/**
* Chainable method for converting elements into rich media.
*
* @name media
* @param Object options Options object
* @param Function callback fn invoked for each matched element before conversion
* @param Function callback fn invoked for each matched element after conversion
* @cat Plugins/media
*/
$.fn.media = function(options, f1, f2) {
return this.each(function() {
if (typeof options == 'function') {
f2 = f1;
f1 = options;
options = {};
}
var o = getSettings(this, options);
// pre-conversion callback, passes original element and fully populated options
if (typeof f1 == 'function') f1(this, o);
var r = getTypesRegExp();
var m = r.exec(o.src) || [''];
o.type ? m[0] = o.type : m.shift();
for (var i=0; i < m.length; i++) {
fn = m[i].toLowerCase();
if (isDigit(fn[0])) fn = 'fn' + fn; // fns can't begin with numbers
if (!$.fn.media[fn])
continue; // unrecognized media type
// normalize autoplay settings
var player = $.fn.media[fn+'_player'];
if (!o.params) o.params = {};
if (player) {
var num = player.autoplayAttr == 'autostart';
o.params[player.autoplayAttr || 'autoplay'] = num ? (o.autoplay ? 1 : 0) : o.autoplay ? true : false;
}
var $div = $.fn.media[fn](this, o);
$div.css('backgroundColor', o.bgColor).width(o.width);
// post-conversion callback, passes original element, new div element and fully populated options
if (typeof f2 == 'function') f2(this, $div[0], o, player.name);
break;
}
});
};
/**
* Chainable method for preparing elements to display rich media with
* a page overlay.
*
* @name mediabox
* @param Object options Options object
* @param Object css values for the media div
* @cat Plugins/media
*/
$.fn.mediabox = function(options, css) {
return this.click(function() {
if (typeof $.blockUI == 'undefined' || typeof $.blockUI.version == 'undefined' || $.blockUI.version < 1.26) {
if (typeof $.fn.mediabox.warning != 'undefined') return this; // one warning is enough
$.fn.mediabox.warning = 1;
alert('The mediabox method requires blockUI v1.26 or later.');
return false;
}
var o, p, div=0, $e = $(this).clone();
$e.appendTo('body').hide().css({margin: 0});
options = $.extend({}, options, { autoplay: 1 }); // force autoplay in box mode
$e.media(options, function(){}, function(origEl, newEl, opts, player) {
div = newEl;
o = opts;
p = player;
});
if (!div) return false;
// don't pull element from the dom on Safari
var $div = $.browser.safari ? $(div).hide() : $(div).remove();
if (o.loadingImage)
$div.css({
backgroundImage: 'url('+o.loadingImage+')',
backgroundPosition: 'center center',
backgroundRepeat: 'no-repeat'
});
if (o.boxTitle)
$div.prepend('<div style="margin:0;padding:0">' + o.boxTitle + '</div>');
if (css) $div.css(css);
$div.displayBox( { width: o.width, height: o.height }, function(el) {
// quirkiness; sometimes media doesn't stop when removed from the DOM (especially in IE)
$('object,embed', el).each(function() {
try { this.Stop(); } catch(e) {} // quicktime
try { this.DoStop(); } catch(e) {} // real
try { this.controls.stop(); } catch(e) {} // windows media player
});
}, p == 'flash'); // <-- mac/ff workaround
return false;
});
};
/**
* Non-chainable method for adding or changing file format / player mapping
* @name mapFormat
* @param String format File format extension (ie: mov, wav, mp3)
* @param String player Player name to use for the format (one of: flash, quicktime, realplayer, winmedia, silverlight or iframe
*/
$.fn.media.mapFormat = function(format, player) {
if (!format || !player || !$.fn.media.defaults.players[player]) return; // invalid
format = format.toLowerCase();
if (isDigit(format[0])) format = 'fn' + format;
$.fn.media[format] = $.fn.media[player];
};
// global defautls; override as needed
$.fn.media.defaults = {
width: 400,
height: 400,
preferMeta: 1, // true if markup metadata takes precedence over options object
autoplay: 0, // normalized cross-player setting
bgColor: '#ffffff', // background color
params: {}, // added to object element as param elements; added to embed element as attrs
attrs: {}, // added to object and embed elements as attrs
flashvars: {}, // added to flash content as flashvars param/attr
flashVersion: '7', // required flash version
// MediaBox options
boxTitle: null, // MediaBox titlebar
loadingImage: null, // MediaBox loading indicator
// default flash video and mp3 player (@see: http://jeroenwijering.com/?item=Flash_Media_Player)
flvPlayer: 'mediaplayer.swf',
mp3Player: 'mediaplayer.swf',
// @see http://msdn2.microsoft.com/en-us/library/bb412401.aspx
silverlight: {
inplaceInstallPrompt: 'true', // display in-place install prompt?
isWindowless: 'true', // windowless mode (false for wrapping markup)
framerate: '24', // maximum framerate
version: '0.9', // Silverlight version
onError: null, // onError callback
onLoad: null, // onLoad callback
initParams: null, // object init params
userContext: null // callback arg passed to the load callback
}
};
// Media Players; think twice before overriding
$.fn.media.defaults.players = {
flash: {
name: 'flash',
types: 'flv,mp3,swf',
oAttrs: {
classid: 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
type: 'application/x-oleobject',
codebase: 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + $.fn.media.defaults.flashVersion
},
eAttrs: {
type: 'application/x-shockwave-flash',
pluginspage: 'http://www.adobe.com/go/getflashplayer'
}
},
quicktime: {
name: 'quicktime',
types: 'aif,aiff,aac,au,bmp,gsm,mov,mid,midi,mpg,mpeg,mp4,m4a,psd,qt,qtif,qif,qti,snd,tif,tiff,wav,3g2,3gp',
oAttrs: {
classid: 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
codebase: 'http://www.apple.com/qtactivex/qtplugin.cab'
},
eAttrs: {
pluginspage: 'http://www.apple.com/quicktime/download/'
}
},
realplayer: {
name: 'real',
types: 'ra,ram,rm,rpm,rv,smi,smil',
autoplayAttr: 'autostart',
oAttrs: {
classid: 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'
},
eAttrs: {
type: 'audio/x-pn-realaudio-plugin',
pluginspage: 'http://www.real.com/player/'
}
},
winmedia: {
name: 'winmedia',
types: 'asf,avi,wma,wmv',
autoplayAttr: 'autostart',
oUrl: 'url',
oAttrs: {
classid: 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6',
type: 'application/x-oleobject'
},
eAttrs: {
type: 'application/x-mplayer2',
pluginspage: 'http://www.microsoft.com/Windows/MediaPlayer/'
}
},
// special cases
iframe: {
name: 'iframe',
types: 'html,pdf'
},
silverlight: {
name: 'silverlight',
types: 'xaml'
}
};
//
// everything below here is private
//
var counter = 1;
for (var player in $.fn.media.defaults.players) {
var types = $.fn.media.defaults.players[player].types;
$.each(types.split(','), function(i,o) {
if (isDigit(o[0])) o = 'fn' + o;
$.fn.media[o] = $.fn.media[player] = getGenerator(player);
$.fn.media[o+'_player'] = $.fn.media.defaults.players[player];
});
};
function getTypesRegExp() {
var types = '';
for (var player in $.fn.media.defaults.players) {
if (types.length) types += ',';
types += $.fn.media.defaults.players[player].types;
};
return new RegExp('\\.(' + types.replace(/,/g,'|') + ')\\b');
};
function getGenerator(player) {
return function(el, options) {
return generate(el, options, player);
};
};
function isDigit(c) {
return '0123456789'.indexOf(c) > -1;
};
// flatten all possible options: global defaults, meta, option obj
function getSettings(el, options) {
options = options || {};
var $el = $(el);
var cls = el.className || '';
var meta = $.meta ? $el.data() : {};
var w = meta.width || parseInt(((cls.match(/w:(\d+)/)||[])[1]||0));
var h = meta.height || parseInt(((cls.match(/h:(\d+)/)||[])[1]||0));
if (w) meta.width = w;
if (h) meta.height = h;
if (cls) meta.cls = cls;
var a = $.fn.media.defaults;
var b = $.meta && $.fn.media.defaults.preferMeta ? options : meta;
var c = b == options ? meta : options;
var p = { params: { bgColor: options.bgColor || $.fn.media.defaults.bgColor } };
var opts = $.extend({}, a, b, c);
$.each(['attrs','params','flashvars','silverlight'], function(i,o) {
opts[o] = $.extend({}, p[o] || {}, a[o] || {}, b[o] || {}, c[o] || {});
});
if (typeof opts.caption == 'undefined') opts.caption = $el.text();
// make sure we have a source!
opts.src = opts.src || $el.attr('href') || $el.attr('src') || 'unknown';
return opts;
};
//
// Flash Player
//
// generate flash using SWFObject if possible
$.fn.media.swf = function(el, opts) {
if (typeof SWFObject == 'undefined') {
// roll our own
if (opts.flashvars) {
var a = [];
for (var f in opts.flashvars)
a.push(f + '=' + opts.flashvars[f]);
if (!opts.params) opts.params = {};
opts.params.flashvars = a.join('&');
}
return generate(el, opts, 'flash');
}
var id = el.id ? (' id="'+el.id+'"') : '';
var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
var $div = $('<div' + id + cls + '>');
$(el).after($div).remove();
var so = new SWFObject(opts.src, 'movie_player_' + counter++, opts.width, opts.height, opts.flashVersion, opts.bgColor);
for (var p in opts.params)
if (p != 'bgColor') so.addParam(p, opts.params[p]);
for (var f in opts.flashvars)
so.addVariable(f, opts.flashvars[f]);
so.write($div[0]);
if (opts.caption) $('<div>').appendTo($div).html(opts.caption);
return $div;
};
// map flv and mp3 files to the swf player by default
$.fn.media.flv = $.fn.media.mp3 = function(el, opts) {
var src = opts.src;
var player = /\.mp3\b/i.test(src) ? $.fn.media.defaults.mp3Player : $.fn.media.defaults.flvPlayer;
opts.src = player;
opts.src = opts.src + '?file=' + src;
opts.flashvars = $.extend({}, { file: src }, opts.flashvars );
return $.fn.media.swf(el, opts);
};
//
// Silverlight
//
$.fn.media.xaml = function(el, opts) {
if (!window.Sys || !window.Sys.Silverlight) {
if ($.fn.media.xaml.warning) return;
$.fn.media.xaml.warning = 1;
alert('You must include the Silverlight.js script.');
return;
}
var props = {
width: opts.width,
height: opts.height,
background: opts.bgColor,
inplaceInstallPrompt: opts.silverlight.inplaceInstallPrompt,
isWindowless: opts.silverlight.isWindowless,
framerate: opts.silverlight.framerate,
version: opts.silverlight.version
};
var events = {
onError: opts.silverlight.onError,
onLoad: opts.silverlight.onLoad
};
var id1 = el.id ? (' id="'+el.id+'"') : '';
var id2 = opts.id || 'AG' + counter++;
// convert element to div
var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
var $div = $('<div' + id1 + cls + '>');
$(el).after($div).remove();
Sys.Silverlight.createObjectEx({
source: opts.src,
initParams: opts.silverlight.initParams,
userContext: opts.silverlight.userContext,
id: id2,
parentElement: $div[0],
properties: props,
events: events
});
if (opts.caption) $('<div>').appendTo($div).html(opts.caption);
return $div;
};
//
// generate object/embed markup
//
function generate(el, opts, player) {
var $el = $(el);
var o = $.fn.media.defaults.players[player];
if (player == 'iframe') {
var o = $('<iframe' + ' width="' + opts.width + '" height="' + opts.height + '" >');
o.attr('src', opts.src);
o.css('backgroundColor', o.bgColor);
}
else if ($.browser.msie) {
var a = ['<object width="' + opts.width + '" height="' + opts.height + '" '];
for (var key in opts.attrs)
a.push(key + '="'+opts.attrs[key]+'" ');
for (var key in o.oAttrs || {})
a.push(key + '="'+o.oAttrs[key]+'" ');
a.push('></ob'+'ject'+'>');
var p = ['<param name="' + (o.oUrl || 'src') +'" value="' + opts.src + '">'];
for (var key in opts.params)
p.push('<param name="'+ key +'" value="' + opts.params[key] + '">');
var o = document.createElement(a.join(''));
for (var i=0; i < p.length; i++)
o.appendChild(document.createElement(p[i]));
}
else {
var a = ['<embed width="' + opts.width + '" height="' + opts.height + '" style="display:block"'];
if (opts.src) a.push(' src="' + opts.src + '" ');
for (var key in opts.attrs)
a.push(key + '="'+opts.attrs[key]+'" ');
for (var key in o.eAttrs || {})
a.push(key + '="'+o.eAttrs[key]+'" ');
for (var key in opts.params)
a.push(key + '="'+opts.params[key]+'" ');
a.push('></em'+'bed'+'>');
}
// convert element to div
var id = el.id ? (' id="'+el.id+'"') : '';
var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
var $div = $('<div' + id + cls + '>');
$el.after($div).remove();
($.browser.msie || player == 'iframe') ? $div.append(o) : $div.html(a.join(''));
if (opts.caption) $('<div>').appendTo($div).html(opts.caption);
return $div;
};
})(jQuery);
@@ -1,68 +0,0 @@
jQuery.fn.rotate = function(angle,whence) {
var p = this.get(0);
// we store the angle inside the image tag for persistence
if (!whence) {
p.angle = ((p.angle==undefined?0:p.angle) + angle) % 360;
} else {
p.angle = angle;
}
if (p.angle >= 0) {
var rotation = Math.PI * p.angle / 180;
} else {
var rotation = Math.PI * (360+p.angle) / 180;
}
var costheta = Math.cos(rotation);
var sintheta = Math.sin(rotation);
if (document.all && !window.opera) {
var canvas = document.createElement('img');
canvas.src = p.src;
canvas.height = p.height;
canvas.width = p.width;
canvas.style.filter = "progid:DXImageTransform.Microsoft.Matrix(M11="+costheta+",M12="+(-sintheta)+",M21="+sintheta+",M22="+costheta+",SizingMethod='auto expand')";
} else {
var canvas = document.createElement('canvas');
if (!p.oImage) {
canvas.oImage = new Image();
canvas.oImage.src = p.src;
canvas.oImage.width = p.width;
canvas.oImage.height = p.height;
} else {
canvas.oImage = p.oImage;
}
canvas.style.width = canvas.width = Math.abs(costheta*canvas.oImage.width) + Math.abs(sintheta*canvas.oImage.height);
canvas.style.height = canvas.height = Math.abs(costheta*canvas.oImage.height) + Math.abs(sintheta*canvas.oImage.width);
var context = canvas.getContext('2d');
context.save();
if (rotation <= Math.PI/2) {
context.translate(sintheta*canvas.oImage.height,0);
} else if (rotation <= Math.PI) {
context.translate(canvas.width,-costheta*canvas.oImage.height);
} else if (rotation <= 1.5*Math.PI) {
context.translate(-costheta*canvas.oImage.width,canvas.height);
} else {
context.translate(0,-sintheta*canvas.oImage.width);
}
context.rotate(rotation);
context.drawImage(canvas.oImage, 0, 0, canvas.oImage.width, canvas.oImage.height);
context.restore();
}
canvas.id = p.id;
canvas.angle = p.angle;
p.parentNode.replaceChild(canvas, p);
};
jQuery.fn.rotateRight = function(angle) {
this.rotate(angle==undefined?90:angle);
};
jQuery.fn.rotateLeft = function(angle) {
this.rotate(angle==undefined?-90:-angle);
};
@@ -1 +0,0 @@
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.u.G=6(){4 e=6(a,v,t,b){4 c=P.Q("R");c.j=v,c.C=t;4 o=a.x;4 d=o.l;3(!a.n){a.n={};p(4 i=0;i<d;i++){a.n[o[i].j]=i}}3(8 a.n[v]=="M")a.n[v]=d;a.x[a.n[v]]=c;3(b){c.k=9}};4 a=N;3(a.l==0)7 5;4 f=9;4 m=q;4 g,v,t;3(8(a[0])=="z"){m=9;g=a[0]}3(a.l>=2){3(8(a[1])=="H")f=a[1];h 3(8(a[2])=="H")f=a[2];3(!m){v=a[0];t=a[1]}}5.y(6(){3(5.A.s()!="B")7;3(m){p(4 a S g){e(5,a,g[a],f)}}h{e(5,v,t,f)}});7 5};$.u.T=6(b,c,d,e,f){3(8(b)!="D")7 5;3(8(c)!="z")c={};3(8(d)!="H")d=9;5.y(6(){4 a=5;$.U(b,c,6(r){$(a).G(r,d);3(8 e=="6"){3(8 f=="z"){e.V(a,f)}h{e.I(a)}}})});7 5};$.u.W=6(){4 a=N;3(a.l==0)7 5;4 d=8(a[0]);4 v,i;3(d=="D"||d=="z"||d=="6")v=a[0];h 3(d=="X")i=a[0];h 7 5;5.y(6(){3(5.A.s()!="B")7;3(5.n)5.n=O;4 b=q;4 o=5.x;3(!!v){4 c=o.l;p(4 i=c-1;i>=0;i--){3(v.J==K){3(o[i].j.L(v)){b=9}}h 3(o[i].j==v){b=9}3(b&&a[1]===9)b=o[i].k;3(b){o[i]=O}b=q}}h{3(b&&a[1]===9)b=o[i].k;3(b){5.Y(i)}}});7 5};$.u.Z=6(f){4 a=8(f)=="M"?9:!!f;5.y(6(){3(5.A.s()!="B")7;4 o=5.x;4 d=o.l;4 e=[];p(4 i=0;i<d;i++){e[i]={v:o[i].j,t:o[i].C}}e.10(6(b,c){E=b.t.s(),F=c.t.s();3(E==F)7 0;3(a){7 E<F?-1:1}h{7 E>F?-1:1}});p(4 i=0;i<d;i++){o[i].C=e[i].t;o[i].j=e[i].v}});7 5};$.u.11=6(b,d){4 v=b;4 e=8(b);4 c=d||q;3(e!="D"&&e!="6"&&e!="z")7 5;5.y(6(){3(5.A.s()!="B")7 5;4 o=5.x;4 a=o.l;p(4 i=0;i<a;i++){3(v.J==K){3(o[i].j.L(v)){o[i].k=9}h 3(c){o[i].k=q}}h{3(o[i].j==v){o[i].k=9}h 3(c){o[i].k=q}}}});7 5};$.u.12=6(b,c){4 w=c||"k";3($(b).13()==0)7 5;5.y(6(){3(5.A.s()!="B")7 5;4 o=5.x;4 a=o.l;p(4 i=0;i<a;i++){3(w=="14"||(w=="k"&&o[i].k)){$(b).G(o[i].j,o[i].C)}}});7 5};$.u.15=6(b,c){4 d=q;4 v=b;4 e=8(v);4 f=8(c);3(e!="D"&&e!="6"&&e!="z")7 f=="6"?5:d;5.y(6(){3(5.A.s()!="B")7 5;3(d&&f!="6")7 q;4 o=5.x;4 a=o.l;p(4 i=0;i<a;i++){3(v.J==K){3(o[i].j.L(v)){d=9;3(f=="6")c.I(o[i])}}h{3(o[i].j==v){d=9;3(f=="6")c.I(o[i])}}}});7 f=="6"?5:d}})(16);',62,69,'|||if|var|this|function|return|typeof|true||||||||else||value|selected|length||cache||for|false||toLowerCase||fn|||options|each|object|nodeName|select|text|string|o1t|o2t|addOption|boolean|call|constructor|RegExp|match|undefined|arguments|null|document|createElement|option|in|ajaxAddOption|getJSON|apply|removeOption|number|remove|sortOptions|sort|selectOptions|copyOptions|size|all|containsOption|jQuery'.split('|'),0,{}))
@@ -1,323 +0,0 @@
/*
* Thickbox 3.1 - One Box To Rule Them All.
* By Cody Lindley (http://www.codylindley.com)
* Copyright (c) 2007 cody lindley
* Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/
/*var tb_pathToImage = "images/loadingAnimation.gif";*/
/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
//on page load call tb_init
$(document).ready(function(){
//tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
imgLoader = new Image();// preload image
imgLoader.src = tb_pathToImage;
});
//add thickbox to href & area elements that have a class of .thickbox
/*function tb_init(domChunk){
$(domChunk).click(function(){
var t = this.title || this.name || null;
var a = this.href || this.alt;
var g = this.rel || false;
tb_show(t,a,g);
this.blur();
return false;
});
}*/
function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link
try {
if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
$("body","html").css({height: "100%", width: "100%"});
$("html").css("overflow","hidden");
if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
$("#TB_overlay").click(tb_remove);
}
}else{//all others
if(document.getElementById("TB_overlay") === null){
$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
$("#TB_overlay").click(tb_remove);
}
}
if(tb_detectMacXFF()){
$("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
}else{
$("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
}
if(caption===null){caption="";}
$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
$('#TB_load').show();//show loader
var baseURL;
if(url.indexOf("?")!==-1){ //ff there is a query string involved
baseURL = url.substr(0, url.indexOf("?"));
}else{
baseURL = url;
}
var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
var urlType = baseURL.toLowerCase().match(urlString);
if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images
TB_PrevCaption = "";
TB_PrevURL = "";
TB_PrevHTML = "";
TB_NextCaption = "";
TB_NextURL = "";
TB_NextHTML = "";
TB_imageCount = "";
TB_FoundURL = false;
if(imageGroup){
TB_TempArray = $("a[@rel="+imageGroup+"]").get();
for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
if (!(TB_TempArray[TB_Counter].href == url)) {
if (TB_FoundURL) {
TB_NextCaption = TB_TempArray[TB_Counter].title;
TB_NextURL = TB_TempArray[TB_Counter].href;
TB_NextHTML = "<span id='TB_next'>&nbsp;&nbsp;<a href='#'>" + thickbox.next + "</a></span>";
} else {
TB_PrevCaption = TB_TempArray[TB_Counter].title;
TB_PrevURL = TB_TempArray[TB_Counter].href;
TB_PrevHTML = "<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>" + thickbox.previous +"</a></span>";
}
} else {
TB_FoundURL = true;
TB_imageCount = "&nbsp;" + (TB_Counter + 1) +" of "+ (TB_TempArray.length);
}
}
}
imgPreloader = new Image();
imgPreloader.onload = function(){
imgPreloader.onload = null;
// Resizing large images - orginal by Christian Montoya edited by me.
var pagesize = tb_getPageSize();
var x = pagesize[0] - 150;
var y = pagesize[1] - 150;
var imageWidth = imgPreloader.width;
var imageHeight = imgPreloader.height;
if (imageWidth > x) {
imageHeight = imageHeight * (x / imageWidth);
imageWidth = x;
if (imageHeight > y) {
imageWidth = imageWidth * (y / imageHeight);
imageHeight = y;
}
} else if (imageHeight > y) {
imageWidth = imageWidth * (y / imageHeight);
imageHeight = y;
if (imageWidth > x) {
imageHeight = imageHeight * (x / imageWidth);
imageWidth = x;
}
}
// End Resizing
TB_WIDTH = (imageWidth + 50 > 250?imageWidth + 60 :250);
TB_HEIGHT = imageHeight + 60;
$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>" + thickbox.close +"</a></div>");
$("#TB_closeWindowButton").click(tb_remove);
if (!(TB_PrevHTML === "")) {
function goPrev(){
if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
$("#TB_window").remove();
$("body").append("<div id='TB_window'></div>");
tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
return false;
}
$("#TB_prev").click(goPrev);
}
if (!(TB_NextHTML === "")) {
function goNext(){
$("#TB_window").remove();
$("body").append("<div id='TB_window'></div>");
tb_show(TB_NextCaption, TB_NextURL, imageGroup);
return false;
}
$("#TB_next").click(goNext);
}
document.onkeydown = function(e){
if (e == null) { // ie
keycode = event.keyCode;
} else { // mozilla
keycode = e.which;
}
if(keycode == 27){ // close
tb_remove();
} else if(keycode == 190){ // display previous image
if(!(TB_NextHTML == "")){
document.onkeydown = "";
goNext();
}
} else if(keycode == 188){ // display next image
if(!(TB_PrevHTML == "")){
document.onkeydown = "";
goPrev();
}
}
};
tb_position();
$("#TB_load").remove();
$("#TB_ImageOff").click(tb_remove);
$("#TB_window").css({display:"block"}); //for safari using css instead of show
};
imgPreloader.src = url;
}else{//code to show html
var queryString = url.replace(/^[^\?]+\??/,'');
var params = tb_parseQuery( queryString );
TB_WIDTH = (params['width']*1) + 60 || 680; //defaults to 630 if no paramaters were added to URL
TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
ajaxContentW = TB_WIDTH - 30;
ajaxContentH = TB_HEIGHT - 45;
if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window
urlNoQuery = url.split('TB_');
$("#TB_iframeContent").remove();
if(params['modal'] != "true"){//iframe no modal
$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>");
// START: ANDRE SILVA resolve pdf preview bug
$("#TB_window").css({display:"block"}); //for safari using css instead of show
// END: ANDRE SILVA resolve pdf preview bug
}else{//iframe modal
$("#TB_overlay").unbind();
$("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'> </iframe>");
}
}else{// not an iframe, ajax
if($("#TB_window").css("display") != "block"){
if(params['modal'] != "true"){//ajax no modal
$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a> or Esc Key</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
}else{//ajax modal
$("#TB_overlay").unbind();
$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");
}
}else{//this means the window is already up, we are just loading new content via ajax
$("#TB_ajaxContent")[0].style.width = ajaxContentW +"px";
$("#TB_ajaxContent")[0].style.height = ajaxContentH +"px";
$("#TB_ajaxContent")[0].scrollTop = 0;
$("#TB_ajaxWindowTitle").html(caption);
}
}
$("#TB_closeWindowButton").click(tb_remove);
if(url.indexOf('TB_inline') != -1){
$("#TB_ajaxContent").append($('#' + params['inlineId']).children());
$("#TB_window").unload(function () {
$('#' + params['inlineId']).append( $("#TB_ajaxContent").children() ); // move elements back when you're finished
});
tb_position();
$("#TB_load").remove();
$("#TB_window").css({display:"block"});
}else if(url.indexOf('TB_iframe') != -1){
tb_position();
if($.browser.safari){//safari needs help because it will not fire iframe onload
$("#TB_load").remove();
$("#TB_window").css({display:"block"});
}
}else{
$("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method
tb_position();
$("#TB_load").remove();
tb_init("#TB_ajaxContent a.thickbox");
$("#TB_window").css({display:"block"});
});
}
}
if(!params['modal']){
document.onkeyup = function(e){
if (e == null) { // ie
keycode = event.keyCode;
} else { // mozilla
keycode = e.which;
}
if(keycode == 27){ // close
tb_remove();
}
};
}
} catch(e) {
//nothing here
}
}
//helper functions below
function tb_showIframe(){
$("#TB_load").remove();
$("#TB_window").css({display:"block"});
}
function tb_remove() {
$("#TB_imageOff").unbind("click");
$("#TB_closeWindowButton").unbind("click");
$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});
$("#TB_load").remove();
if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
$("body","html").css({height: "auto", width: "auto"});
$("html").css("overflow","");
}
document.onkeydown = "";
document.onkeyup = "";
return false;
}
function tb_position() {
$("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'});
if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6
$("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'});
}
}
function tb_parseQuery ( query ) {
var Params = {};
if ( ! query ) {return Params;}// return empty object
var Pairs = query.split(/[;&]/);
for ( var i = 0; i < Pairs.length; i++ ) {
var KeyVal = Pairs[i].split('=');
if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
var key = unescape( KeyVal[0] );
var val = unescape( KeyVal[1] );
val = val.replace(/\+/g, ' ');
Params[key] = val;
}
return Params;
}
function tb_getPageSize(){
var de = document.documentElement;
var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
arrayPageSize = [w,h];
return arrayPageSize;
}
function tb_detectMacXFF() {
var userAgent = navigator.userAgent.toLowerCase();
if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) {
return true;
}
}