diff --git a/examples/upload.php b/examples/upload.php index a1308cccc..8b17376ca 100644 --- a/examples/upload.php +++ b/examples/upload.php @@ -1,4 +1,14 @@ ' + - '
' + - '
' + - '
' + - '
' + - '
' + _('Select files') + '
' + - '
' + _('Add files to the upload queue and click the start button.') + '
' + - '
' + - '
' + - - '
' + - '
' + - '
' + _('Filename') + '
' + - '
 
' + - '
' + _('Status') + '
' + - '
' + _('Size') + '
' + - '
 
' + - '
' + - - '
    ' + - - '' + - '
    ' + - '
    ' + - '
    ' + - '' + - '' - ); - }; - - $.fn.pluploadQueue = function(settings) { - if (settings) { - this.each(function() { - var uploader, target, id; - - uploader = new plupload.Uploader(settings); - target = $(this); - id = target.attr('id'); - - if (!id) { - id = plupload.guid(); - target.attr('id', id); - } - - uploaders[id] = uploader; - - function handleStatus(file) { - var actionClass; - - if (file.status == plupload.DONE) - actionClass = 'plupload_done'; - - if (file.status == plupload.FAILED) - actionClass = 'plupload_failed'; - - if (file.status == plupload.QUEUED) - actionClass = 'plupload_delete'; - - if (file.status == plupload.UPLOADING) - actionClass = 'plupload_uploading'; - - $('#' + file.id).attr('class', actionClass).find('a').css('display', 'block'); - }; - - function updateList() { - var fileList = $('ul.plupload_filelist', target).html(''), inputCount = 0, inputHTML; - - $.each(uploader.files, function(i, file) { - inputHTML = ''; - - if (file.status == plupload.DONE) { - if (file.target_name) - inputHTML += ''; - - inputHTML += ''; - inputHTML += ''; - - inputCount++; - - $('#' + id + '_count').val(inputCount); - } - - fileList.append( - '
  • ' + - '
    ' + file.name + '
    ' + - '
    ' + - '
    ' + file.percent + '%
    ' + - '
    ' + plupload.formatSize(file.size) + '
    ' + - '
     
    ' + - inputHTML + - '
  • ' - ); - - handleStatus(file); - - $('#' + file.id + '.plupload_delete a').click(function(e) { - $('#' + file.id).remove(); - uploader.removeFile(file); - - e.preventDefault(); - }); - }); - - $('span.plupload_total_file_size', target).html(plupload.formatSize(uploader.total.size)); - - if (uploader.total.queued == 0) - $('span.plupload_add_text', target).text(_('Add files.')); - else - $('span.plupload_add_text', target).text(uploader.total.queued + ' files queued.'); - - $('a.plupload_start', target).toggleClass('plupload_disabled', uploader.files.length == 0); - - // Scroll to end of file list - fileList[0].scrollTop = fileList[0].scrollHeight; - - updateTotalProgress(); - }; - - function updateTotalProgress() { - $('span.plupload_total_status', target).html(uploader.total.percent + '%'); - $('div.plupload_progress_bar', target).css('width', uploader.total.percent + '%'); - $('span.plupload_upload_status', target).text('Uploaded ' + uploader.total.uploaded + '/' + uploader.files.length + ' files'); - - // All files are uploaded - if (uploader.total.uploaded == uploader.files.length) - uploader.stop(); - }; - - // Set unique target filenames - if (uploader.settings.unique_names) { - uploader.bind("UploadFile", function(up, file) { - file.target_name = (uploader.settings.salt || '') + file.id + '.tmp'; - $('#' + file.id).addClass('plupload_current_file'); - }); - } - - uploader.bind('PreInit', function() { - renderUI(id, target); - - $('a.plupload_add', target).click(function(e) { - uploader.browse(); - e.preventDefault(); - }).css('display', 'block').attr('id', id + '_browse'); - - uploader.settings.browse_button = id + '_browse'; - - $('a.plupload_start', target).click(function(e) { - if (!$(this).hasClass('plupload_disabled')) - uploader.start(); - - e.preventDefault(); - }); - - $('a.plupload_stop', target).click(function(e) { - uploader.stop(); - - e.preventDefault(); - }); - - $('a.plupload_start', target).css('display', 'block').addClass('plupload_disabled'); - }); - - uploader.init(); - - uploader.bind('StateChanged', function() { - if (uploader.state === plupload.STARTED) { - $('a.plupload_delete,a.plupload_start,a.plupload_add', target).hide(); - $('span.plupload_upload_status,div.plupload_progress,a.plupload_stop', target).css('display', 'block'); - $('span.plupload_upload_status', target).text('Uploaded 0/' + uploader.files.length + ' files'); - } else { - $('a.plupload_stop,div.plupload_progress,span.plupload_upload_status', target).hide(); - $('a.plupload_delete,a.plupload_add,a.plupload_start', target).css('display', 'block'); - } - }); - - uploader.bind('QueueChanged', updateList); - - uploader.bind('StateChanged', function(up) { - if (up.state == plupload.STOPPED) - updateList(); - }); - - uploader.bind('FileUploaded', function(up, file) { - handleStatus(file); - }); - - uploader.bind("UploadProgress", function(up, file) { - // Set file specific progress - $('#' + file.id + ' div.plupload_file_status', target).html(file.percent + '%'); - - handleStatus(file); - updateTotalProgress(); - }); - }); - - return this; - } else { - // Get uploader instance for specified element - return uploaders[$(this[0]).attr('id')]; - } - }; -})(jQuery); +/** + * jquery.plupload.queue.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +(function($) { + var uploaders = {}; + + function _(str) { + return str; + }; + + function renderUI(id, target) { + target.html( + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + _('Select files') + '
    ' + + '
    ' + _('Add files to the upload queue and click the start button.') + '
    ' + + '
    ' + + '
    ' + + + '
    ' + + '
    ' + + '
    ' + _('Filename') + '
    ' + + '
     
    ' + + '
    ' + _('Status') + '
    ' + + '
    ' + _('Size') + '
    ' + + '
     
    ' + + '
    ' + + + '
      ' + + + '' + + '
      ' + + '
      ' + + '
      ' + + '' + + '
      ' + ); + }; + + $.fn.pluploadQueue = function(settings) { + if (settings) { + this.each(function() { + var uploader, target, id; + + uploader = new plupload.Uploader(settings); + target = $(this); + id = target.attr('id'); + + if (!id) { + id = plupload.guid(); + target.attr('id', id); + } + + uploaders[id] = uploader; + + function handleStatus(file) { + var actionClass; + + if (file.status == plupload.DONE) + actionClass = 'plupload_done'; + + if (file.status == plupload.FAILED) + actionClass = 'plupload_failed'; + + if (file.status == plupload.QUEUED) + actionClass = 'plupload_delete'; + + if (file.status == plupload.UPLOADING) + actionClass = 'plupload_uploading'; + + $('#' + file.id).attr('class', actionClass).find('a').css('display', 'block'); + }; + + function updateList() { + var fileList = $('ul.plupload_filelist', target).html(''), inputCount = 0, inputHTML; + + $.each(uploader.files, function(i, file) { + inputHTML = ''; + + if (file.status == plupload.DONE) { + if (file.target_name) + inputHTML += ''; + + inputHTML += ''; + inputHTML += ''; + + inputCount++; + + $('#' + id + '_count').val(inputCount); + } + + fileList.append( + '
    • ' + + '
      ' + file.name + '
      ' + + '
      ' + + '
      ' + file.percent + '%
      ' + + '
      ' + plupload.formatSize(file.size) + '
      ' + + '
       
      ' + + inputHTML + + '
    • ' + ); + + handleStatus(file); + + $('#' + file.id + '.plupload_delete a').click(function(e) { + $('#' + file.id).remove(); + uploader.removeFile(file); + + e.preventDefault(); + }); + }); + + $('span.plupload_total_file_size', target).html(plupload.formatSize(uploader.total.size)); + + if (uploader.total.queued == 0) + $('span.plupload_add_text', target).text(_('Add files.')); + else + $('span.plupload_add_text', target).text(uploader.total.queued + ' files queued.'); + + $('a.plupload_start', target).toggleClass('plupload_disabled', uploader.files.length == 0); + + // Scroll to end of file list + fileList[0].scrollTop = fileList[0].scrollHeight; + + updateTotalProgress(); + }; + + function updateTotalProgress() { + $('span.plupload_total_status', target).html(uploader.total.percent + '%'); + $('div.plupload_progress_bar', target).css('width', uploader.total.percent + '%'); + $('span.plupload_upload_status', target).text('Uploaded ' + uploader.total.uploaded + '/' + uploader.files.length + ' files'); + + // All files are uploaded + if (uploader.total.uploaded == uploader.files.length) + uploader.stop(); + }; + + // Set unique target filenames + if (uploader.settings.unique_names) { + uploader.bind("UploadFile", function(up, file) { + file.target_name = (uploader.settings.salt || '') + file.id + '.tmp'; + $('#' + file.id).addClass('plupload_current_file'); + }); + } + + uploader.bind('PreInit', function() { + renderUI(id, target); + + $('a.plupload_add', target).click(function(e) { + uploader.browse(); + e.preventDefault(); + }).css('display', 'block').attr('id', id + '_browse'); + + uploader.settings.browse_button = id + '_browse'; + + $('a.plupload_start', target).click(function(e) { + if (!$(this).hasClass('plupload_disabled')) + uploader.start(); + + e.preventDefault(); + }); + + $('a.plupload_stop', target).click(function(e) { + uploader.stop(); + + e.preventDefault(); + }); + + $('a.plupload_start', target).css('display', 'block').addClass('plupload_disabled'); + }); + + uploader.init(); + + uploader.bind('StateChanged', function() { + if (uploader.state === plupload.STARTED) { + $('a.plupload_delete,a.plupload_start,a.plupload_add', target).hide(); + $('span.plupload_upload_status,div.plupload_progress,a.plupload_stop', target).css('display', 'block'); + $('span.plupload_upload_status', target).text('Uploaded 0/' + uploader.files.length + ' files'); + } else { + $('a.plupload_stop,div.plupload_progress,span.plupload_upload_status', target).hide(); + $('a.plupload_delete,a.plupload_add,a.plupload_start', target).css('display', 'block'); + } + }); + + uploader.bind('QueueChanged', updateList); + + uploader.bind('StateChanged', function(up) { + if (up.state == plupload.STOPPED) + updateList(); + }); + + uploader.bind('FileUploaded', function(up, file) { + handleStatus(file); + }); + + uploader.bind("UploadProgress", function(up, file) { + // Set file specific progress + $('#' + file.id + ' div.plupload_file_status', target).html(file.percent + '%'); + + handleStatus(file); + updateTotalProgress(); + }); + }); + + return this; + } else { + // Get uploader instance for specified element + return uploaders[$(this[0]).attr('id')]; + } + }; +})(jQuery); diff --git a/src/javascript/jquery.plupload.single.js b/src/javascript/jquery.plupload.single.js index e327dfcce..b2a7030db 100644 --- a/src/javascript/jquery.plupload.single.js +++ b/src/javascript/jquery.plupload.single.js @@ -1,101 +1,101 @@ -/** - * jquery.plupload.single.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under GPL License. - * - * License: http://www.plupload/license - * Contributing: http://www.plupload/contributing - */ - -(function($) { - var uploaders = {}; - - function renderUI(id, target) { - target.html( - '
      ' + - '
      ' + - '' + - '' + - '' + - '
      ' + - '
      ' - ); - }; - - $.fn.pluploadSingle = function(settings) { - if (settings) { - this.each(function() { - var uploader, target, id; - - uploader = new plupload.Uploader(settings); - target = $(this); - id = target.attr('id'); - - if (!id) { - id = plupload.guid(); - target.attr('id', id); - } - - uploader.settings.browse_button = id + '_browse'; - uploader.settings.multi_selection = false; - - uploaders[id] = uploader; - - uploader.bind('PreInit', function() { - renderUI(id, target); - - $('.plupload_file_name,.plupload_browse', target).click(function(e) { - uploader.browse(); - e.preventDefault(); - }); - - // Set unique target filenames - if (uploader.settings.unique_names) { - uploader.bind("UploadFile", function(up, file) { - file.target_name = (uploader.settings.salt || '') + file.id + '.tmp'; - }); - } - - uploader.bind('QueueChanged', function(up) { - var file; - - if (up.files.length) { - file = up.files[up.files.length - 1]; - - $('.plupload_file_name', target).val(file.name).attr('disabled', 'disabled'); - $('.plupload_status', target).html('Size: ' + plupload.formatSize(file.size)); - $('.plupload_browse', target).attr('disabled', 'disabled'); - - up.start(); - } - }); - - uploader.bind("UploadProgress", function(up, file) { - if (file.status == plupload.DONE) - $('.plupload_status', target).html('File uploaded.'); - else - $('.plupload_status', target).html('Uploading: ' + file.percent + '%'); - }); - - uploader.bind('FileUploaded', function(up, file) { - if (file.status == plupload.DONE) { - if (file.target_name) - target.append(''); - - target.append(''); - } else - $('.plupload_file_name,.plupload_browse', target).attr('disabled', ''); - }); - }); - - uploader.init(); - }); - - return this; - } else { - // Get uploader instance for specified element - return uploaders[$(this[0]).attr('id')]; - } - }; -})(jQuery); +/** + * jquery.plupload.single.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +(function($) { + var uploaders = {}; + + function renderUI(id, target) { + target.html( + '
      ' + + '
      ' + + '' + + '' + + '' + + '
      ' + + '
      ' + ); + }; + + $.fn.pluploadSingle = function(settings) { + if (settings) { + this.each(function() { + var uploader, target, id; + + uploader = new plupload.Uploader(settings); + target = $(this); + id = target.attr('id'); + + if (!id) { + id = plupload.guid(); + target.attr('id', id); + } + + uploader.settings.browse_button = id + '_browse'; + uploader.settings.multi_selection = false; + + uploaders[id] = uploader; + + uploader.bind('PreInit', function() { + renderUI(id, target); + + $('.plupload_file_name,.plupload_browse', target).click(function(e) { + uploader.browse(); + e.preventDefault(); + }); + + // Set unique target filenames + if (uploader.settings.unique_names) { + uploader.bind("UploadFile", function(up, file) { + file.target_name = (uploader.settings.salt || '') + file.id + '.tmp'; + }); + } + + uploader.bind('QueueChanged', function(up) { + var file; + + if (up.files.length) { + file = up.files[up.files.length - 1]; + + $('.plupload_file_name', target).val(file.name).attr('disabled', 'disabled'); + $('.plupload_status', target).html('Size: ' + plupload.formatSize(file.size)); + $('.plupload_browse', target).attr('disabled', 'disabled'); + + up.start(); + } + }); + + uploader.bind("UploadProgress", function(up, file) { + if (file.status == plupload.DONE) + $('.plupload_status', target).html('File uploaded.'); + else + $('.plupload_status', target).html('Uploading: ' + file.percent + '%'); + }); + + uploader.bind('FileUploaded', function(up, file) { + if (file.status == plupload.DONE) { + if (file.target_name) + target.append(''); + + target.append(''); + } else + $('.plupload_file_name,.plupload_browse', target).attr('disabled', ''); + }); + }); + + uploader.init(); + }); + + return this; + } else { + // Get uploader instance for specified element + return uploaders[$(this[0]).attr('id')]; + } + }; +})(jQuery); diff --git a/src/javascript/plupload.flash.js b/src/javascript/plupload.flash.js index 9df42594f..77dbe375f 100644 --- a/src/javascript/plupload.flash.js +++ b/src/javascript/plupload.flash.js @@ -1,207 +1,207 @@ -/** - * plupload.flash.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under GPL License. - * - * License: http://www.plupload/license - * Contributing: http://www.plupload/contributing - */ - -(function(plupload) { - var uploadInstances = {}; - - function getFlashVersion() { - var version; - - try { - version = navigator.plugins['Shockwave Flash']; - version = version.description; - } catch (ex) { - try { - version = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version'); - } catch (ex) { - version = '0.0'; - } - } - - version = version.match(/\d+/g); - - return parseFloat(version[0] + '.' + version[1]); - }; - - plupload.flash = { - trigger : function(id, name, obj) { - // Detach the call so that error handling in the browser is presented correctly - setTimeout(function() { - var uploader = uploadInstances[id], i, args; - - if (uploader) - uploader.trigger('Flash:' + name, obj); - }, 0); - } - }; - - /** - * FlashRuntime implementation. - * - * @static - * @class plupload.FlashRuntime - * @extends plupload.Runtime - */ - plupload.FlashRuntime = plupload.addRuntime("flash", { - /** - * Checks if the Flash is installed or not. - * - * @method isSupported - * @return {boolean} true/false if the runtime exists. - */ - isSupported : function() { - return getFlashVersion() >= 10; - }, - - /** - * Initializes the upload runtime. This method should add necessary items to the DOM and register events needed for operation. - * - * @method init - * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized. - */ - init : function(uploader) { - var browseButton, flashContainer, flashVars; - - uploadInstances[uploader.id] = uploader; - - // Find browse button and set to to be relative - browseButton = document.getElementById(uploader.settings.browse_button); - - // Create flash container and insert it at an absolute position within the browse button - flashContainer = document.createElement('div'); - flashContainer.id = uploader.id + '_flash_container'; - - plupload.extend(flashContainer.style, { - position : 'absolute', - background : uploader.settings.flash_bgcolor || 'transparent', - width : '100px', - height : '100px' - }); - - flashContainer.className = 'plupload_flash'; - document.body.appendChild(flashContainer); - - flashVars = 'id=' + escape(uploader.id); - - // Insert the Flash inide the flash container - flashContainer.innerHTML = '' + - '' + - '' + - '' + - ''; - - function getFlashObj() { - return document.getElementById(uploader.id + '_flash'); - }; - - // Fix IE memory leaks - browseButton = flashContainer = null; - - // Wait for Flash to send init event - uploader.bind("Flash:Init", function() { - var lookup = {}; - - getFlashObj().setFileFilters(uploader.settings.filters, uploader.settings.multi_selection); - - uploader.bind("UploadFile", function(up, file) { - var url = up.settings.url; - - url += (url.indexOf('?') == -1 ? '?' : '&') + 'name=' + escape(file.target_name || file.name); - - getFlashObj().uploadFile(lookup[file.id], url, up.settings.chunk_size); - }); - - uploader.bind("Flash:UploadProcess", function(up, flash_file) { - var file = up.getFile(lookup[flash_file.id]); - - file.loaded = flash_file.loaded; - - up.trigger('UploadProgress', file); - }); - - uploader.bind("Flash:UploadChunkComplete", function(up, info) { - var chunkArgs, file = up.getFile(lookup[info.id]); - - chunkArgs = { - file : file, - chunk : info.chunk, - chunks : info.chunks, - response : info.text - }; - - up.trigger('ChunkUploaded', chunkArgs); - - // Stop upload - if (chunkArgs.cancelled) { - getFlashObj().cancelUpload(); - file.status = plupload.FAILED; - up.trigger('FileUploaded', file); - return; - } - }); - - uploader.bind("Flash:UploadComplete", function(up, flash_file) { - var file = up.getFile(lookup[flash_file.id]); - - file.status = plupload.DONE; - - up.trigger('FileUploaded', file); - }); - - uploader.bind("Flash:SelectFiles", function(up, selected_files) { - var file, i, files = [], id; - - // Add the selected files to the file queue - for (i = 0; i < selected_files.length; i++) { - file = selected_files[i]; - - // Store away flash ref internally - id = plupload.guid(); - lookup[id] = file.id; - lookup[file.id] = id; - - files.push(new plupload.File(id, file.name, file.size)); - } - - // trigger FilesSelected event - uploader.trigger("FilesSelected", files); - }); - - uploader.bind("QueueChanged", function(up) { - uploader.trigger("Flash:PositionAtBrowseButton"); - }); - - uploader.bind("FileRemoved", function(up, file) { - getFlashObj().removeFile(lookup[file.id]); - }); - - uploader.bind("StateChanged", function(up) { - uploader.trigger("Flash:PositionAtBrowseButton"); - }); - }); - - uploader.bind("Flash:PositionAtBrowseButton", function(up) { - var browseButton, browsePos; - - browseButton = document.getElementById(up.settings.browse_button); - browsePos = plupload.getPos(browseButton); - - plupload.extend(document.getElementById(up.id + '_flash_container').style, { - top : browsePos.y + 'px', - left : browsePos.x + 'px', - width : browseButton.clientWidth + 'px', - height : browseButton.clientHeight + 'px' - }); - }); - - uploader.trigger("Flash:PositionAtBrowseButton"); - } - }); -})(plupload); +/** + * plupload.flash.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +(function(plupload) { + var uploadInstances = {}; + + function getFlashVersion() { + var version; + + try { + version = navigator.plugins['Shockwave Flash']; + version = version.description; + } catch (ex) { + try { + version = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version'); + } catch (ex) { + version = '0.0'; + } + } + + version = version.match(/\d+/g); + + return parseFloat(version[0] + '.' + version[1]); + }; + + plupload.flash = { + trigger : function(id, name, obj) { + // Detach the call so that error handling in the browser is presented correctly + setTimeout(function() { + var uploader = uploadInstances[id], i, args; + + if (uploader) + uploader.trigger('Flash:' + name, obj); + }, 0); + } + }; + + /** + * FlashRuntime implementation. + * + * @static + * @class plupload.FlashRuntime + * @extends plupload.Runtime + */ + plupload.FlashRuntime = plupload.addRuntime("flash", { + /** + * Checks if the Flash is installed or not. + * + * @method isSupported + * @return {boolean} true/false if the runtime exists. + */ + isSupported : function() { + return getFlashVersion() >= 10; + }, + + /** + * Initializes the upload runtime. This method should add necessary items to the DOM and register events needed for operation. + * + * @method init + * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized. + */ + init : function(uploader) { + var browseButton, flashContainer, flashVars; + + uploadInstances[uploader.id] = uploader; + + // Find browse button and set to to be relative + browseButton = document.getElementById(uploader.settings.browse_button); + + // Create flash container and insert it at an absolute position within the browse button + flashContainer = document.createElement('div'); + flashContainer.id = uploader.id + '_flash_container'; + + plupload.extend(flashContainer.style, { + position : 'absolute', + background : uploader.settings.flash_bgcolor || 'transparent', + width : '100px', + height : '100px' + }); + + flashContainer.className = 'plupload_flash'; + document.body.appendChild(flashContainer); + + flashVars = 'id=' + escape(uploader.id); + + // Insert the Flash inide the flash container + flashContainer.innerHTML = '' + + '' + + '' + + '' + + ''; + + function getFlashObj() { + return document.getElementById(uploader.id + '_flash'); + }; + + // Fix IE memory leaks + browseButton = flashContainer = null; + + // Wait for Flash to send init event + uploader.bind("Flash:Init", function() { + var lookup = {}; + + getFlashObj().setFileFilters(uploader.settings.filters, uploader.settings.multi_selection); + + uploader.bind("UploadFile", function(up, file) { + var url = up.settings.url; + + url += (url.indexOf('?') == -1 ? '?' : '&') + 'name=' + escape(file.target_name || file.name); + + getFlashObj().uploadFile(lookup[file.id], url, up.settings.chunk_size); + }); + + uploader.bind("Flash:UploadProcess", function(up, flash_file) { + var file = up.getFile(lookup[flash_file.id]); + + file.loaded = flash_file.loaded; + + up.trigger('UploadProgress', file); + }); + + uploader.bind("Flash:UploadChunkComplete", function(up, info) { + var chunkArgs, file = up.getFile(lookup[info.id]); + + chunkArgs = { + file : file, + chunk : info.chunk, + chunks : info.chunks, + response : info.text + }; + + up.trigger('ChunkUploaded', chunkArgs); + + // Stop upload + if (chunkArgs.cancelled) { + getFlashObj().cancelUpload(); + file.status = plupload.FAILED; + up.trigger('FileUploaded', file); + return; + } + }); + + uploader.bind("Flash:UploadComplete", function(up, flash_file) { + var file = up.getFile(lookup[flash_file.id]); + + file.status = plupload.DONE; + + up.trigger('FileUploaded', file); + }); + + uploader.bind("Flash:SelectFiles", function(up, selected_files) { + var file, i, files = [], id; + + // Add the selected files to the file queue + for (i = 0; i < selected_files.length; i++) { + file = selected_files[i]; + + // Store away flash ref internally + id = plupload.guid(); + lookup[id] = file.id; + lookup[file.id] = id; + + files.push(new plupload.File(id, file.name, file.size)); + } + + // trigger FilesSelected event + uploader.trigger("FilesSelected", files); + }); + + uploader.bind("QueueChanged", function(up) { + uploader.trigger("Flash:PositionAtBrowseButton"); + }); + + uploader.bind("FileRemoved", function(up, file) { + getFlashObj().removeFile(lookup[file.id]); + }); + + uploader.bind("StateChanged", function(up) { + uploader.trigger("Flash:PositionAtBrowseButton"); + }); + }); + + uploader.bind("Flash:PositionAtBrowseButton", function(up) { + var browseButton, browsePos; + + browseButton = document.getElementById(up.settings.browse_button); + browsePos = plupload.getPos(browseButton); + + plupload.extend(document.getElementById(up.id + '_flash_container').style, { + top : browsePos.y + 'px', + left : browsePos.x + 'px', + width : browseButton.clientWidth + 'px', + height : browseButton.clientHeight + 'px' + }); + }); + + uploader.trigger("Flash:PositionAtBrowseButton"); + } + }); +})(plupload); diff --git a/src/javascript/plupload.gears.js b/src/javascript/plupload.gears.js index 809392be4..ab3567483 100644 --- a/src/javascript/plupload.gears.js +++ b/src/javascript/plupload.gears.js @@ -1,136 +1,136 @@ -/** - * plupload.gears.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under GPL License. - * - * License: http://www.plupload/license - * Contributing: http://www.plupload/contributing - */ - -(function(plupload) { - var blobs = {}; - - /** - * Gears implementation. - * - * @static - * @class plupload.GearsRuntime - * @extends plupload.Runtime - */ - plupload.GearsRuntime = plupload.addRuntime("gears", { - /** - * Checks if the Google Gears is installed or not. - * - * @method isSupported - * @return {boolean} true/false if the runtime exists. - */ - isSupported : function() { - return !!(window.google && google.gears); - }, - - /** - * Initializes the upload runtime. This method should add necessary items to the DOM and register events needed for operation. - * - * @method init - * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized. - */ - init : function(uploader) { - uploader.bind("UploadFile", function(up, file) { - var chunk = 0, chunks, chunkSize, loaded = 0; - - chunkSize = up.settings.chunk_size; - chunks = Math.ceil(file.size / chunkSize); - - // Start uploading chunks - uploadNextChunk(); - - function uploadNextChunk() { - var url = up.settings.url, req, curChunkSize; - - // File upload finished - if (file.status == plupload.DONE || file.status == plupload.FAILED || up.state == plupload.STOPPED) - return; - - curChunkSize = Math.min(chunkSize, file.size - (chunk * chunkSize)); - - req = google.gears.factory.create('beta.httprequest'); - req.open('POST', url + (url.indexOf('?') == -1 ? '?' : '&') + 'name=' + escape(file.target_name || file.name) + '&chunk=' + chunk + '&chunks=' + chunks); - - req.setRequestHeader('Content-Disposition', 'attachment; filename="' + file.name + '"'); - req.setRequestHeader('Content-Type', 'application/octet-stream'); - - req.upload.onprogress = function(progress) { - file.loaded = loaded + progress.loaded; - up.trigger('UploadProgress', file); - }; - - req.onreadystatechange = function() { - var chunkArgs; - - if (req.readyState == 4) { - if (req.status == 200) { - chunkArgs = { - file : file, - chunk : chunk, - chunks : chunks, - response : req.responseText - }; - - up.trigger('ChunkUploaded', chunkArgs); - - // Stop upload - if (chunkArgs.cancelled) { - file.status = plupload.FAILED; - up.trigger('FileUploaded', file); - return; - } - - loaded += curChunkSize; - - if (++chunk >= chunks) { - file.status = plupload.DONE; - up.trigger('FileUploaded', file); - } else - uploadNextChunk(); - } else - up.trigger('UploadChunkError', {file : file, chunk : chunk, chunks : chunks, error : 'Status: ' + req.status}); - } - }; - - if (chunk < chunks) - req.send(blobs[file.id].slice(chunk * chunkSize, curChunkSize)); - }; - }); - - uploader.bind("SelectFiles", function(up) { - var desk = google.gears.factory.create('beta.desktop'), filters = [], i, a; - - for (i = 0; i < up.settings.filters.length; i++) { - ext = up.settings.filters[i].extensions.split(';'); - - for (a = 0; a < ext.length; a++) - filters.push(ext[a].replace(/^[^.]+\./, '.')); - } - - desk.openFiles(function(selected_files) { - var file, i, files = [], id; - - // Add the selected files to the file queue - for (i = 0; i < selected_files.length; i++) { - file = selected_files[i]; - - // Store away gears blob internally - id = plupload.guid(); - blobs[id] = file.blob; - - files.push(new plupload.File(id, file.name, file.blob.length)); - } - - // Fire FilesSelected event - uploader.trigger("FilesSelected", files); - }, {singleFile : !up.settings.multi_selection, filter : filters}); - }); - } - }); -})(plupload); +/** + * plupload.gears.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +(function(plupload) { + var blobs = {}; + + /** + * Gears implementation. + * + * @static + * @class plupload.GearsRuntime + * @extends plupload.Runtime + */ + plupload.GearsRuntime = plupload.addRuntime("gears", { + /** + * Checks if the Google Gears is installed or not. + * + * @method isSupported + * @return {boolean} true/false if the runtime exists. + */ + isSupported : function() { + return !!(window.google && google.gears); + }, + + /** + * Initializes the upload runtime. This method should add necessary items to the DOM and register events needed for operation. + * + * @method init + * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized. + */ + init : function(uploader) { + uploader.bind("UploadFile", function(up, file) { + var chunk = 0, chunks, chunkSize, loaded = 0; + + chunkSize = up.settings.chunk_size; + chunks = Math.ceil(file.size / chunkSize); + + // Start uploading chunks + uploadNextChunk(); + + function uploadNextChunk() { + var url = up.settings.url, req, curChunkSize; + + // File upload finished + if (file.status == plupload.DONE || file.status == plupload.FAILED || up.state == plupload.STOPPED) + return; + + curChunkSize = Math.min(chunkSize, file.size - (chunk * chunkSize)); + + req = google.gears.factory.create('beta.httprequest'); + req.open('POST', url + (url.indexOf('?') == -1 ? '?' : '&') + 'name=' + escape(file.target_name || file.name) + '&chunk=' + chunk + '&chunks=' + chunks); + + req.setRequestHeader('Content-Disposition', 'attachment; filename="' + file.name + '"'); + req.setRequestHeader('Content-Type', 'application/octet-stream'); + + req.upload.onprogress = function(progress) { + file.loaded = loaded + progress.loaded; + up.trigger('UploadProgress', file); + }; + + req.onreadystatechange = function() { + var chunkArgs; + + if (req.readyState == 4) { + if (req.status == 200) { + chunkArgs = { + file : file, + chunk : chunk, + chunks : chunks, + response : req.responseText + }; + + up.trigger('ChunkUploaded', chunkArgs); + + // Stop upload + if (chunkArgs.cancelled) { + file.status = plupload.FAILED; + up.trigger('FileUploaded', file); + return; + } + + loaded += curChunkSize; + + if (++chunk >= chunks) { + file.status = plupload.DONE; + up.trigger('FileUploaded', file); + } else + uploadNextChunk(); + } else + up.trigger('UploadChunkError', {file : file, chunk : chunk, chunks : chunks, error : 'Status: ' + req.status}); + } + }; + + if (chunk < chunks) + req.send(blobs[file.id].slice(chunk * chunkSize, curChunkSize)); + }; + }); + + uploader.bind("SelectFiles", function(up) { + var desk = google.gears.factory.create('beta.desktop'), filters = [], i, a; + + for (i = 0; i < up.settings.filters.length; i++) { + ext = up.settings.filters[i].extensions.split(';'); + + for (a = 0; a < ext.length; a++) + filters.push(ext[a].replace(/^[^.]+\./, '.')); + } + + desk.openFiles(function(selected_files) { + var file, i, files = [], id; + + // Add the selected files to the file queue + for (i = 0; i < selected_files.length; i++) { + file = selected_files[i]; + + // Store away gears blob internally + id = plupload.guid(); + blobs[id] = file.blob; + + files.push(new plupload.File(id, file.name, file.blob.length)); + } + + // Fire FilesSelected event + uploader.trigger("FilesSelected", files); + }, {singleFile : !up.settings.multi_selection, filter : filters}); + }); + } + }); +})(plupload); diff --git a/src/javascript/plupload.html5.js b/src/javascript/plupload.html5.js index 9a4b9efb5..ce3a8e897 100644 --- a/src/javascript/plupload.html5.js +++ b/src/javascript/plupload.html5.js @@ -1,175 +1,175 @@ -/** - * plupload.html5.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under GPL License. - * - * License: http://www.plupload/license - * Contributing: http://www.plupload/contributing - */ - -(function(plupload) { - /** - * Returns the absolute x, y position of a node. The position will be returned in a object with x, y fields. - * - * @param {Element/String} node HTML element or element id to get x, y position from. - * @param {Element} root Optional root element to stop calculations at. - * @return {object} Absolute position of the specified element object with x, y fields. - */ - function getPos(node, root) { - var x = 0, y = 0, parent; - - node = node; - root = root || document.body; - - parent = node; - while (parent && parent != root && parent.nodeType) { - x += parent.offsetLeft || 0; - y += parent.offsetTop || 0; - parent = parent.offsetParent; - } - - r = node.parentNode; - while (parent && parent != root && parent.nodeType) { - x -= parent.scrollLeft || 0; - y -= parent.scrollTop || 0; - parent = parent.parentNode; - } - - return {x : x, y : y}; - }; - - /** - * HMTL5 implementation. - * - * @static - * @class plupload.Html5Runtime - * @extends plupload.Runtime - */ - plupload.Html5Runtime = plupload.addRuntime("html5", { - /** - * Checks if the browser has HTML 5 upload support or not. - * - * @method isSupported - * @return {boolean} true/false if the runtime exists. - */ - isSupported : function() { - var xhr; - - if (window.XMLHttpRequest) { - xhr = new XMLHttpRequest(); - - return !!(xhr.sendAsBinary || xhr.upload); - } - - return false; - }, - - /** - * Initializes the upload runtime. This method should add necessary items to the DOM and register events needed for operation. - * - * @method init - * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized. - */ - init : function(uploader) { - var browseButton, browsePos, inputContainer, html5files = {}; - - browseButton = document.getElementById(uploader.settings.browse_button); - browsePos = plupload.getPos(browseButton); - - // Create input container and insert it at an absolute position within the browse button - inputContainer = document.createElement('div'); - inputContainer.id = uploader.id + '_html5_container'; - - plupload.extend(inputContainer.style, { - position : 'absolute', - background : uploader.settings.html5_bgcolor || 'transparent', - width : '100px', - height : '100px', - overflow : 'hidden', - opacity : 0 - }); - - inputContainer.className = 'plupload_html5'; - document.body.appendChild(inputContainer); - - // Insert the input inide the input container - inputContainer.innerHTML = ''; - - uploader.bind("HTML5:PositionAtBrowseButton", function(up) { - var browseButton, browsePos; - - browseButton = document.getElementById(uploader.settings.browse_button); - browsePos = plupload.getPos(browseButton); - - plupload.extend(document.getElementById(uploader.id + '_html5_container').style, { - top : browsePos.y + 'px', - left : browsePos.x + 'px', - width : browseButton.offsetWidth + 'px', - height : browseButton.offsetHeight + 'px' - }); - }); - - uploader.bind("UploadFile", function(up, file) { - var xhr = new XMLHttpRequest(), upload, url = up.settings.url; - - // File upload finished - if (file.status == plupload.DONE || file.status == plupload.FAILED || up.state == plupload.STOPPED) - return; - - if (upload = xhr.upload) { - upload.onload = function() { - file.status = plupload.DONE; - up.trigger('FileUploaded', file); - }; - - upload.onprogress = function(e) { - file.loaded = e.loaded; - up.trigger('UploadProgress', file); - }; - } - - xhr.onreadystatechange = function() { - if (xhr.readyState == 4) { - file.status = plupload.DONE; - file.loaded = file.size; - up.trigger('UploadProgress', file); - up.trigger('FileUploaded', file); - } - }; - - xhr.open("post", url + (url.indexOf('?') == -1 ? '?' : '&') + 'name=' + escape(file.target_name || file.name), true); - xhr.setRequestHeader('Content-Type', 'application/octet-stream'); - - if (xhr.sendAsBinary) - xhr.sendAsBinary(html5files[file.id].getAsBinary()); - else - xhr.send(html5files[file.id]); - }); - - document.getElementById(uploader.id + '_html5').onchange = function() { - var file, i, files = [], id; - - // Add the selected files to the file queue - for (i = 0; i < this.files.length; i++) { - file = this.files[i]; - - // Store away gears blob internally - id = plupload.guid(); - html5files[id] = file; - - // Expose id, name and size - files.push(new plupload.File(id, file.fileName, file.fileSize)); - } - - // Fire FilesSelected event - uploader.trigger("FilesSelected", files); - - // Clearing the value enables the user to select the same file again if they want to - this.value = ''; - }; - - uploader.trigger('HTML5:PositionAtBrowseButton'); - } - }); -})(plupload); +/** + * plupload.html5.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +(function(plupload) { + /** + * Returns the absolute x, y position of a node. The position will be returned in a object with x, y fields. + * + * @param {Element/String} node HTML element or element id to get x, y position from. + * @param {Element} root Optional root element to stop calculations at. + * @return {object} Absolute position of the specified element object with x, y fields. + */ + function getPos(node, root) { + var x = 0, y = 0, parent; + + node = node; + root = root || document.body; + + parent = node; + while (parent && parent != root && parent.nodeType) { + x += parent.offsetLeft || 0; + y += parent.offsetTop || 0; + parent = parent.offsetParent; + } + + r = node.parentNode; + while (parent && parent != root && parent.nodeType) { + x -= parent.scrollLeft || 0; + y -= parent.scrollTop || 0; + parent = parent.parentNode; + } + + return {x : x, y : y}; + }; + + /** + * HMTL5 implementation. + * + * @static + * @class plupload.Html5Runtime + * @extends plupload.Runtime + */ + plupload.Html5Runtime = plupload.addRuntime("html5", { + /** + * Checks if the browser has HTML 5 upload support or not. + * + * @method isSupported + * @return {boolean} true/false if the runtime exists. + */ + isSupported : function() { + var xhr; + + if (window.XMLHttpRequest) { + xhr = new XMLHttpRequest(); + + return !!(xhr.sendAsBinary || xhr.upload); + } + + return false; + }, + + /** + * Initializes the upload runtime. This method should add necessary items to the DOM and register events needed for operation. + * + * @method init + * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized. + */ + init : function(uploader) { + var browseButton, browsePos, inputContainer, html5files = {}; + + browseButton = document.getElementById(uploader.settings.browse_button); + browsePos = plupload.getPos(browseButton); + + // Create input container and insert it at an absolute position within the browse button + inputContainer = document.createElement('div'); + inputContainer.id = uploader.id + '_html5_container'; + + plupload.extend(inputContainer.style, { + position : 'absolute', + background : uploader.settings.html5_bgcolor || 'transparent', + width : '100px', + height : '100px', + overflow : 'hidden', + opacity : 0 + }); + + inputContainer.className = 'plupload_html5'; + document.body.appendChild(inputContainer); + + // Insert the input inide the input container + inputContainer.innerHTML = ''; + + uploader.bind("HTML5:PositionAtBrowseButton", function(up) { + var browseButton, browsePos; + + browseButton = document.getElementById(uploader.settings.browse_button); + browsePos = plupload.getPos(browseButton); + + plupload.extend(document.getElementById(uploader.id + '_html5_container').style, { + top : browsePos.y + 'px', + left : browsePos.x + 'px', + width : browseButton.offsetWidth + 'px', + height : browseButton.offsetHeight + 'px' + }); + }); + + uploader.bind("UploadFile", function(up, file) { + var xhr = new XMLHttpRequest(), upload, url = up.settings.url; + + // File upload finished + if (file.status == plupload.DONE || file.status == plupload.FAILED || up.state == plupload.STOPPED) + return; + + if (upload = xhr.upload) { + upload.onload = function() { + file.status = plupload.DONE; + up.trigger('FileUploaded', file); + }; + + upload.onprogress = function(e) { + file.loaded = e.loaded; + up.trigger('UploadProgress', file); + }; + } + + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + file.status = plupload.DONE; + file.loaded = file.size; + up.trigger('UploadProgress', file); + up.trigger('FileUploaded', file); + } + }; + + xhr.open("post", url + (url.indexOf('?') == -1 ? '?' : '&') + 'name=' + escape(file.target_name || file.name), true); + xhr.setRequestHeader('Content-Type', 'application/octet-stream'); + + if (xhr.sendAsBinary) + xhr.sendAsBinary(html5files[file.id].getAsBinary()); + else + xhr.send(html5files[file.id]); + }); + + document.getElementById(uploader.id + '_html5').onchange = function() { + var file, i, files = [], id; + + // Add the selected files to the file queue + for (i = 0; i < this.files.length; i++) { + file = this.files[i]; + + // Store away gears blob internally + id = plupload.guid(); + html5files[id] = file; + + // Expose id, name and size + files.push(new plupload.File(id, file.fileName, file.fileSize)); + } + + // Fire FilesSelected event + uploader.trigger("FilesSelected", files); + + // Clearing the value enables the user to select the same file again if they want to + this.value = ''; + }; + + uploader.trigger('HTML5:PositionAtBrowseButton'); + } + }); +})(plupload); diff --git a/src/javascript/plupload.js b/src/javascript/plupload.js index ff5d7d90d..5fe7a6f52 100644 --- a/src/javascript/plupload.js +++ b/src/javascript/plupload.js @@ -1,763 +1,763 @@ -/** - * plupload.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under GPL License. - * - * License: http://www.plupload/license - * Contributing: http://www.plupload/contributing - */ - -(function() { - var count = 0, runtimes = []; - - /** - * Plupload class with some global constants and functions. - * - * @static - * @class plupload - */ - var plupload = { - /** - * Inital state of the queue and also the state ones it's finished all it's uploads. - * - * @property STOPPED - * @final - */ - STOPPED : 1, - - /** - * Upload process is running - * - * @property STARTED - * @final - */ - STARTED : 2, - - /** - * File is queued for upload - * - * @property QUEUED - * @final - */ - QUEUED : 1, - - /** - * File is being uploaded - * - * @property UPLOADING - * @final - */ - UPLOADING : 2, - - /** - * File has failed to be uploaded - * - * @property FAILED - * @final - */ - FAILED : 4, - - /** - * File has been uploaded successfully - * - * @property DONE - * @final - */ - DONE : 5, - - /** - * Extends the specified object with another object. - * - * @method extend - * @param {Object} target Object to extend. - * @param {Object..} obj Multiple objects to extend with. - * @return {Object} Same as target, the extended object. - */ - extend : function(target) { - var key, obj, i; - - for (i = 1; i < arguments.length; i++) { - obj = arguments[i]; - - for (key in obj) - target[key] = obj[key]; - } - - return target; - }, - - /** - * Cleans the specified name from national characters. The result will be a name with only a-z, 0-9 and _. - * - * @method cleanName - * @param {String} s String to clean up. - * @return {String} Cleaned string. - */ - cleanName : function(name) { - var i, lookup; - - // Replace diacritics - lookup = [ - /[\300-\306]/g, 'A', /[\340-\346]/g, 'a', - /\307/g, 'C', /\347/g, 'c', - /[\310-\313]/g, 'E', /[\350-\353]/g, 'e', - /[\314-\317]/g, 'I', /[\354-\357]/g, 'i', - /\321/g, 'N', /\361/g, 'n', - /[\322-\330]/g, 'O', /[\362-\370]/g, 'o', - /[\331-\334]/g, 'U', /[\371-\374]/g, 'u' - ]; - - for (i = 0; i < lookup.length; i += 2) - name = name.replace(lookup[i], lookup[i + 1]); - - // Replace whitespace - name = name.replace(/\s+/g, '_'); - - // Remove anything else - name = name.replace(/[^a-z0-9_\-\.]+/gi, ''); - - return name; - }, - - /** - * Adds a specific upload runtime like for example flash or gears. - * - * @method addRuntime - * @param {String} name Runtime name for example flash. - * @param {Object} obj Object containing init/destroy method. - */ - addRuntime : function(name, runtime) { - runtime.name = name; - runtimes[name] = runtime; - runtimes.push(runtime); - - return runtime; - }, - - /** - * Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers. - * The only way a user would be able to get the same ID is if the two persons at the same exact milisecond manages - * to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique. - * It's more probable for the earth to be hit with an ansteriod. - * - * @method guid - * @return {String} Virtually unique id. - */ - guid : function() { - var guid = new Date().getTime().toString(32), i; - - for (i = 0; i < 5; i++) - guid += Math.floor(Math.random() * 65535 + count).toString(32); - - return guid; - }, - - /** - * Formats the specified number as a size string for example 1024 becomes 1 KB. - * - * @method formatSize - * @param {Number} size Size to format as string. - * @return {String} Formatted size string. - */ - formatSize : function(size) { - // MB - if (size > 1048576) - return Math.round(size / 1048576, 1) + " MB"; - - // KB - if (size > 1024) - return Math.round(size / 1024, 1) + " KB"; - - return size + " b"; - }, - - /** - * Returns the absolute x, y position of a node. The position will be returned in a object with x, y fields. - * - * @method getPos - * @param {Element/String} node HTML element or element id to get x, y position from. - * @param {Element} root Optional root element to stop calculations at. - * @return {object} Absolute position of the specified element object with x, y fields. - */ - getPos : function(node, root) { - var x = 0, y = 0, parent; - - node = node; - root = root || document.body; - - parent = node; - while (parent && parent != root && parent.nodeType) { - x += parent.offsetLeft || 0; - y += parent.offsetTop || 0; - parent = parent.offsetParent; - } - - parent = node.parentNode; - while (parent && parent != root && parent.nodeType) { - x -= parent.scrollLeft || 0; - y -= parent.scrollTop || 0; - parent = parent.parentNode; - } - - return {x : x, y : y}; - }, - - /** - * Parses the specified size string into a byte value. For example 10kb becomes 10240. - * - * @method parseSize - * @param {String/Number} size String to parse or number to just pass through. - * @return {Number} Size in bytes. - */ - parseSize : function(size) { - var mul; - - if (typeof(size) == 'string') { - size = /^([0-9]+)([mgk]+)$/.exec(size.toLowerCase().replace(/[^0-9mkg]/g, '')); - mul = size[2]; - size = parseInt(size[1]); - - if (mul == 'g') - size *= 1073741824; - - if (mul == 'm') - size *= 1048576; - - if (mul == 'k') - size *= 1024; - } - - return size; - }, - - /** - * Encodes the specified string. - * - * @method xmlEncode - * @param {String} s String to encode. - * @return {String} Encoded string. - */ - xmlEncode : function(s) { - var lo = {'<' : 'lt', '>' : 'gt', '&' : 'amp', '"' : 'quot', '\'' : '#39'}; - - return s ? ('' + s).replace(/[<>&\"\']/g, function(c) { - return lo[c] ? '&' + lo[c] + ';' : c; - }) : s; - }, - - /** - * Forces anything into an array. - * - * @method toArray - * @param {Object} obj Object with length field. - * @return {Array} Array object containing all items. - */ - toArray : function(obj) { - var i, arr = []; - - for (i = 0; i < obj.length; i++) - arr[i] = obj[i]; - - return arr; - } - }; - - /** - * Uploader class, an instance of this class will be created for each upload field. - * - * @class plupload.Uploader - */ - plupload.Uploader = function(settings) { - var events = {}, total, files = [], fileIndex; - - // Inital total state - total = new plupload.QueueProgress(); - - // Default settings - settings = plupload.extend({ - chunk_size : '1mb', - max_file_size : '1gb', - multi_selection : true - }, settings); - - // Private methods - function uploadNext() { - var file; - - if (this.state == plupload.STARTED && fileIndex < files.length) { - file = files[fileIndex++]; - - if (file.status == plupload.QUEUED) - this.trigger("UploadFile", file); - else - uploadNext.call(this); - } else - this.stop(); - }; - - function calc() { - var i; - - // Reset stats - total.reset(); - - // Check status, size, loaded etc on all files - for (i = 0; i < files.length; i++) { - total.size += files[i].size; - total.loaded += files[i].loaded; - - if (files[i].status == plupload.DONE) - total.uploaded++; - else if (files[i].status == plupload.FAILED) - total.failed++; - else - total.queued++; - } - - total.percent = total.size > 0 ? Math.ceil(total.loaded / total.size * 100) : 0; - }; - - // Add public methods - plupload.extend(this, { - state : plupload.STOPPED, - - /** - * Array of File instances. - * - * @property files - * @type Array - * @see plupload.File - */ - files : files, - - /** - * Object with name/value settings. - * - * @property settings - * @type Object - */ - settings : settings, - - /** - * Total progess information. - * - * @property total - * @type plupload.QueueProgress - */ - total : total, - - /** - * Unique id for the Uploader instance. - * - * @property id - * @type String - */ - id : plupload.guid(), - - /** - * Initializes the Uploader instance and adds internal event listeners. - * - * @method init - */ - init : function() { - var i, runtimeList, a; - - settings.page_url = settings.page_url || document.location.pathname.replace(/\/[^\/]+$/g, '/'); - - // If url is relative force it absolute to the current page - if (!/^(\w+:\/\/|\/)/.test(settings.url)) - settings.url = settings.page_url + settings.url; - - // Convert settings - settings.chunk_size = plupload.parseSize(settings.chunk_size); - settings.max_file_size = plupload.parseSize(settings.max_file_size); - - // Find a suitable runtime - if (settings.runtimes) { - runtimeList = settings.runtimes.split(','); - - for (i = 0; i < runtimeList.length; i++) { - runtime = runtimes[runtimeList[i]]; - - // Look for suitable runtime - if (runtime && runtime.isSupported() !== false) { - this.runtime = runtime; - this.trigger('PreInit', runtime.name); - break; - } - } - } else { - for (i = 0; i < runtimes.length; i++) { - runtime = runtimes[i]; - - // Look for suitable runtime - if (runtime && runtime.isSupported() !== false) { - this.runtime = runtime; - this.trigger('PreInit', runtime.name); - break; - } - } - } - - // Add files to queue - this.bind('FilesSelected', function(up, selected_files) { - var i, file; - - for (i = 0; i < selected_files.length; i++) { - file = selected_files[i]; - file.loaded = 0; - file.percent = 0; - - if (selected_files[i].size > settings.max_file_size) - file.status = plupload.FAILED; - else - file.status = plupload.QUEUED; - - files.push(file); - } - - this.trigger("QueueChanged"); - }); - - this.bind('UploadProgress', function(up, file) { - if (file.status == plupload.QUEUED) - file.status = plupload.UPLOADING; - - file.percent = file.size > 0 ? Math.ceil(file.loaded / file.size * 100) : 0; - calc(); - }); - - this.bind('QueueChanged', calc); - - this.bind("FileUploaded", function(up, file) { - file.status = plupload.DONE; - up.trigger('UploadProgress', file); - uploadNext.call(this); - }); - - // Initialize runtime - if (this.runtime) { - this.runtime.init(this); - this.trigger('Init', this.runtime.name); - } - }, - - /** - * Browse for files to upload. - * - * @method browse - * @param {Object} browse_settings name/value collection of settings. - */ - browse : function(browse_settings) { - this.trigger("SelectFiles", plupload.extend({}, settings, browse_settings)); - }, - - /** - * Starts uploading the queued files. - * - * @method start - */ - start : function() { - if (this.state != plupload.STARTED) { - fileIndex = 0; - - this.state = plupload.STARTED; - this.trigger("StateChanged"); - - uploadNext.call(this); - } - }, - - /** - * Stops the upload of the queued files. - * - * @method stop - */ - stop : function() { - if (this.state != plupload.STOPPED) { - this.state = plupload.STOPPED; - this.trigger("StateChanged"); - } - }, - - /** - * Returns the specified file object by id. - * - * @method getFile - * @param {String} id File id to look for. - * @return {plupload.File} File object or undefined if it wasn't found; - */ - getFile : function(id) { - var i; - - for (i = files.length - 1; i >= 0; i--) { - if (files[i].id === id) { - return files[i]; - } - } - }, - - /** - * Removes a specific file. - * - * @method removeFile - * @param {plupload.File} file File to remove from queue. - */ - removeFile : function(file) { - var i; - - for (i = files.length - 1; i >= 0; i--) { - if (files[i].id === file.id) { - files.splice(i, 1); - this.trigger("FileRemoved", file); - } - } - - this.trigger("QueueChanged"); - }, - - /** - * Clears the upload queue. All pending, finished or failed files will be removed from queue. - * - * @method removeAll - */ - removeAll : function() { - var i, file; - - for (i = files.length - 1; i >= 0; i--) { - file = files[i]; - files.splice(i, 1); - this.trigger("FileRemoved", file); - } - - this.trigger("QueueChanged"); - }, - - /** - * Dispatches the specified event name and it's arguments to all listeners. - * - * - * @method trigger - * @param {String} name Event name to fire. - * @param {Object..} Multiple arguments to pass along to the listener functions. - */ - trigger : function(name) { - var list = events[name.toLowerCase()], i; - - // console.log(name, arguments); - - if (list) { - // Replace name with sender - arguments[0] = this; - - // Dispatch event to all listeners - for (i = 0; i < list.length; i++) { - // Fire event, break chain if false is returned - if (list[i].func.apply(list[i].scope, arguments) === false) - return false; - } - } - - return true; - }, - - /** - * Adds an event listener by name. - * - * @method bind - * @param {String} name Event name to listen for. - * @param {function} func Function to call ones the event gets fired. - * @param {Object} scope Optional scope to execute the specified function in. - */ - bind : function(name, func, scope) { - var list; - - name = name.toLowerCase(); - list = events[name] || []; - list.push({func : func, scope : scope || this}); - events[name] = list; - }, - - /** - * Removes the specified event listener. - * - * @method unbind - * @param {String} name Name of event to remove. - * @param {function} func Function to remove from listener. - */ - unbind : function(name, func) { - var list = events[name.toLowerCase()], i; - - if (list) { - for (i = list.length - 1; i >= 0; i--) { - if (list[i].func === func) - list.splice(i, 1); - } - } - } - - /** - * Fires when a file is to be uploaded by the runtime. - * - * @event UploadFile - * @param {plupload.Uploader} uploader Uploader instance sending the event. - * @param {plupload.File} file File to be uploaded. - */ - }); - }; - - /** - * File instance. - * - * @class plupload.File - * @param {String} name Name of the file. - * @param {Number} size File size. - */ - plupload.File = function(id, name, size) { - var t = this; - - /** - * File id this is a globally unique id for the specific file. - * - * @property id - * @type String - */ - t.id = id; - - /** - * File name for example "myfile.gif". - * - * @property name - * @type String - */ - t.name = name; - - /** - * File size in bytes. - * - * @property size - * @type Number - */ - t.size = size; - - /** - * Number of bytes uploaded of the files total size. - * - * @property loaded - * @type Number - */ - t.loaded = 0; - - /** - * Number of percentage uploaded of the file. - * - * @property percent - * @type Number - */ - t.percent = 0; - - /** - * Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE. - * - * @property status - * @type Number - */ - t.status = 0; - }; - - /** - * Runtime class gets implemented by each upload runtime. - * - * @static - * @class plupload.Runtime - */ - plupload.Runtime = function() { - /** - * Checks if the runtime is supported by the browser or not. - * - * @method isSupported - * @return {boolean} true/false if the runtime exists. - */ - this.isSupported = function() { - }; - - /** - * Initializes the upload runtime. This method should add necessary items to the DOM and register events needed for operation. - * - * @method init - * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized. - */ - this.init = function(uploader) { - }; - }; - - /** - * Runtime class gets implemented by each upload runtime. - * - * @class plupload.QueueProgress - */ - plupload.QueueProgress = function() { - var t = this; - - /** - * Total queue file size. - * - * @property size - * @type Number - */ - t.size = 0; - - /** - * Total bytes uploaded. - * - * @property loaded - * @type Number - */ - t.loaded = 0; - - /** - * Number of files uploaded. - * - * @property uploaded - * @type Number - */ - t.uploaded = 0; - - /** - * Number of files failed to upload. - * - * @property failed - * @type Number - */ - t.failed = 0; - - /** - * Number of files yet to be uploaded. - * - * @property queued - * @type Number - */ - t.queued = 0; - - /** - * Total percent of the uploaded bytes. - * - * @property percent - * @type Number - */ - t.percent = 0; - - /** - * Resets the progress to it's initial values. - * - * @method reset - */ - t.reset = function() { - t.size = t.loaded = t.uploaded = t.failed = t.queued = t.percent = 0; - }; - }; - - // Expose plupload namespace - window.plupload = plupload; -})(); +/** + * plupload.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +(function() { + var count = 0, runtimes = []; + + /** + * Plupload class with some global constants and functions. + * + * @static + * @class plupload + */ + var plupload = { + /** + * Inital state of the queue and also the state ones it's finished all it's uploads. + * + * @property STOPPED + * @final + */ + STOPPED : 1, + + /** + * Upload process is running + * + * @property STARTED + * @final + */ + STARTED : 2, + + /** + * File is queued for upload + * + * @property QUEUED + * @final + */ + QUEUED : 1, + + /** + * File is being uploaded + * + * @property UPLOADING + * @final + */ + UPLOADING : 2, + + /** + * File has failed to be uploaded + * + * @property FAILED + * @final + */ + FAILED : 4, + + /** + * File has been uploaded successfully + * + * @property DONE + * @final + */ + DONE : 5, + + /** + * Extends the specified object with another object. + * + * @method extend + * @param {Object} target Object to extend. + * @param {Object..} obj Multiple objects to extend with. + * @return {Object} Same as target, the extended object. + */ + extend : function(target) { + var key, obj, i; + + for (i = 1; i < arguments.length; i++) { + obj = arguments[i]; + + for (key in obj) + target[key] = obj[key]; + } + + return target; + }, + + /** + * Cleans the specified name from national characters. The result will be a name with only a-z, 0-9 and _. + * + * @method cleanName + * @param {String} s String to clean up. + * @return {String} Cleaned string. + */ + cleanName : function(name) { + var i, lookup; + + // Replace diacritics + lookup = [ + /[\300-\306]/g, 'A', /[\340-\346]/g, 'a', + /\307/g, 'C', /\347/g, 'c', + /[\310-\313]/g, 'E', /[\350-\353]/g, 'e', + /[\314-\317]/g, 'I', /[\354-\357]/g, 'i', + /\321/g, 'N', /\361/g, 'n', + /[\322-\330]/g, 'O', /[\362-\370]/g, 'o', + /[\331-\334]/g, 'U', /[\371-\374]/g, 'u' + ]; + + for (i = 0; i < lookup.length; i += 2) + name = name.replace(lookup[i], lookup[i + 1]); + + // Replace whitespace + name = name.replace(/\s+/g, '_'); + + // Remove anything else + name = name.replace(/[^a-z0-9_\-\.]+/gi, ''); + + return name; + }, + + /** + * Adds a specific upload runtime like for example flash or gears. + * + * @method addRuntime + * @param {String} name Runtime name for example flash. + * @param {Object} obj Object containing init/destroy method. + */ + addRuntime : function(name, runtime) { + runtime.name = name; + runtimes[name] = runtime; + runtimes.push(runtime); + + return runtime; + }, + + /** + * Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers. + * The only way a user would be able to get the same ID is if the two persons at the same exact milisecond manages + * to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique. + * It's more probable for the earth to be hit with an ansteriod. + * + * @method guid + * @return {String} Virtually unique id. + */ + guid : function() { + var guid = new Date().getTime().toString(32), i; + + for (i = 0; i < 5; i++) + guid += Math.floor(Math.random() * 65535 + count).toString(32); + + return guid; + }, + + /** + * Formats the specified number as a size string for example 1024 becomes 1 KB. + * + * @method formatSize + * @param {Number} size Size to format as string. + * @return {String} Formatted size string. + */ + formatSize : function(size) { + // MB + if (size > 1048576) + return Math.round(size / 1048576, 1) + " MB"; + + // KB + if (size > 1024) + return Math.round(size / 1024, 1) + " KB"; + + return size + " b"; + }, + + /** + * Returns the absolute x, y position of a node. The position will be returned in a object with x, y fields. + * + * @method getPos + * @param {Element/String} node HTML element or element id to get x, y position from. + * @param {Element} root Optional root element to stop calculations at. + * @return {object} Absolute position of the specified element object with x, y fields. + */ + getPos : function(node, root) { + var x = 0, y = 0, parent; + + node = node; + root = root || document.body; + + parent = node; + while (parent && parent != root && parent.nodeType) { + x += parent.offsetLeft || 0; + y += parent.offsetTop || 0; + parent = parent.offsetParent; + } + + parent = node.parentNode; + while (parent && parent != root && parent.nodeType) { + x -= parent.scrollLeft || 0; + y -= parent.scrollTop || 0; + parent = parent.parentNode; + } + + return {x : x, y : y}; + }, + + /** + * Parses the specified size string into a byte value. For example 10kb becomes 10240. + * + * @method parseSize + * @param {String/Number} size String to parse or number to just pass through. + * @return {Number} Size in bytes. + */ + parseSize : function(size) { + var mul; + + if (typeof(size) == 'string') { + size = /^([0-9]+)([mgk]+)$/.exec(size.toLowerCase().replace(/[^0-9mkg]/g, '')); + mul = size[2]; + size = parseInt(size[1]); + + if (mul == 'g') + size *= 1073741824; + + if (mul == 'm') + size *= 1048576; + + if (mul == 'k') + size *= 1024; + } + + return size; + }, + + /** + * Encodes the specified string. + * + * @method xmlEncode + * @param {String} s String to encode. + * @return {String} Encoded string. + */ + xmlEncode : function(s) { + var lo = {'<' : 'lt', '>' : 'gt', '&' : 'amp', '"' : 'quot', '\'' : '#39'}; + + return s ? ('' + s).replace(/[<>&\"\']/g, function(c) { + return lo[c] ? '&' + lo[c] + ';' : c; + }) : s; + }, + + /** + * Forces anything into an array. + * + * @method toArray + * @param {Object} obj Object with length field. + * @return {Array} Array object containing all items. + */ + toArray : function(obj) { + var i, arr = []; + + for (i = 0; i < obj.length; i++) + arr[i] = obj[i]; + + return arr; + } + }; + + /** + * Uploader class, an instance of this class will be created for each upload field. + * + * @class plupload.Uploader + */ + plupload.Uploader = function(settings) { + var events = {}, total, files = [], fileIndex; + + // Inital total state + total = new plupload.QueueProgress(); + + // Default settings + settings = plupload.extend({ + chunk_size : '1mb', + max_file_size : '1gb', + multi_selection : true + }, settings); + + // Private methods + function uploadNext() { + var file; + + if (this.state == plupload.STARTED && fileIndex < files.length) { + file = files[fileIndex++]; + + if (file.status == plupload.QUEUED) + this.trigger("UploadFile", file); + else + uploadNext.call(this); + } else + this.stop(); + }; + + function calc() { + var i; + + // Reset stats + total.reset(); + + // Check status, size, loaded etc on all files + for (i = 0; i < files.length; i++) { + total.size += files[i].size; + total.loaded += files[i].loaded; + + if (files[i].status == plupload.DONE) + total.uploaded++; + else if (files[i].status == plupload.FAILED) + total.failed++; + else + total.queued++; + } + + total.percent = total.size > 0 ? Math.ceil(total.loaded / total.size * 100) : 0; + }; + + // Add public methods + plupload.extend(this, { + state : plupload.STOPPED, + + /** + * Array of File instances. + * + * @property files + * @type Array + * @see plupload.File + */ + files : files, + + /** + * Object with name/value settings. + * + * @property settings + * @type Object + */ + settings : settings, + + /** + * Total progess information. + * + * @property total + * @type plupload.QueueProgress + */ + total : total, + + /** + * Unique id for the Uploader instance. + * + * @property id + * @type String + */ + id : plupload.guid(), + + /** + * Initializes the Uploader instance and adds internal event listeners. + * + * @method init + */ + init : function() { + var i, runtimeList, a; + + settings.page_url = settings.page_url || document.location.pathname.replace(/\/[^\/]+$/g, '/'); + + // If url is relative force it absolute to the current page + if (!/^(\w+:\/\/|\/)/.test(settings.url)) + settings.url = settings.page_url + settings.url; + + // Convert settings + settings.chunk_size = plupload.parseSize(settings.chunk_size); + settings.max_file_size = plupload.parseSize(settings.max_file_size); + + // Find a suitable runtime + if (settings.runtimes) { + runtimeList = settings.runtimes.split(','); + + for (i = 0; i < runtimeList.length; i++) { + runtime = runtimes[runtimeList[i]]; + + // Look for suitable runtime + if (runtime && runtime.isSupported() !== false) { + this.runtime = runtime; + this.trigger('PreInit', runtime.name); + break; + } + } + } else { + for (i = 0; i < runtimes.length; i++) { + runtime = runtimes[i]; + + // Look for suitable runtime + if (runtime && runtime.isSupported() !== false) { + this.runtime = runtime; + this.trigger('PreInit', runtime.name); + break; + } + } + } + + // Add files to queue + this.bind('FilesSelected', function(up, selected_files) { + var i, file; + + for (i = 0; i < selected_files.length; i++) { + file = selected_files[i]; + file.loaded = 0; + file.percent = 0; + + if (selected_files[i].size > settings.max_file_size) + file.status = plupload.FAILED; + else + file.status = plupload.QUEUED; + + files.push(file); + } + + this.trigger("QueueChanged"); + }); + + this.bind('UploadProgress', function(up, file) { + if (file.status == plupload.QUEUED) + file.status = plupload.UPLOADING; + + file.percent = file.size > 0 ? Math.ceil(file.loaded / file.size * 100) : 0; + calc(); + }); + + this.bind('QueueChanged', calc); + + this.bind("FileUploaded", function(up, file) { + file.status = plupload.DONE; + up.trigger('UploadProgress', file); + uploadNext.call(this); + }); + + // Initialize runtime + if (this.runtime) { + this.runtime.init(this); + this.trigger('Init', this.runtime.name); + } + }, + + /** + * Browse for files to upload. + * + * @method browse + * @param {Object} browse_settings name/value collection of settings. + */ + browse : function(browse_settings) { + this.trigger("SelectFiles", plupload.extend({}, settings, browse_settings)); + }, + + /** + * Starts uploading the queued files. + * + * @method start + */ + start : function() { + if (this.state != plupload.STARTED) { + fileIndex = 0; + + this.state = plupload.STARTED; + this.trigger("StateChanged"); + + uploadNext.call(this); + } + }, + + /** + * Stops the upload of the queued files. + * + * @method stop + */ + stop : function() { + if (this.state != plupload.STOPPED) { + this.state = plupload.STOPPED; + this.trigger("StateChanged"); + } + }, + + /** + * Returns the specified file object by id. + * + * @method getFile + * @param {String} id File id to look for. + * @return {plupload.File} File object or undefined if it wasn't found; + */ + getFile : function(id) { + var i; + + for (i = files.length - 1; i >= 0; i--) { + if (files[i].id === id) { + return files[i]; + } + } + }, + + /** + * Removes a specific file. + * + * @method removeFile + * @param {plupload.File} file File to remove from queue. + */ + removeFile : function(file) { + var i; + + for (i = files.length - 1; i >= 0; i--) { + if (files[i].id === file.id) { + files.splice(i, 1); + this.trigger("FileRemoved", file); + } + } + + this.trigger("QueueChanged"); + }, + + /** + * Clears the upload queue. All pending, finished or failed files will be removed from queue. + * + * @method removeAll + */ + removeAll : function() { + var i, file; + + for (i = files.length - 1; i >= 0; i--) { + file = files[i]; + files.splice(i, 1); + this.trigger("FileRemoved", file); + } + + this.trigger("QueueChanged"); + }, + + /** + * Dispatches the specified event name and it's arguments to all listeners. + * + * + * @method trigger + * @param {String} name Event name to fire. + * @param {Object..} Multiple arguments to pass along to the listener functions. + */ + trigger : function(name) { + var list = events[name.toLowerCase()], i; + + // console.log(name, arguments); + + if (list) { + // Replace name with sender + arguments[0] = this; + + // Dispatch event to all listeners + for (i = 0; i < list.length; i++) { + // Fire event, break chain if false is returned + if (list[i].func.apply(list[i].scope, arguments) === false) + return false; + } + } + + return true; + }, + + /** + * Adds an event listener by name. + * + * @method bind + * @param {String} name Event name to listen for. + * @param {function} func Function to call ones the event gets fired. + * @param {Object} scope Optional scope to execute the specified function in. + */ + bind : function(name, func, scope) { + var list; + + name = name.toLowerCase(); + list = events[name] || []; + list.push({func : func, scope : scope || this}); + events[name] = list; + }, + + /** + * Removes the specified event listener. + * + * @method unbind + * @param {String} name Name of event to remove. + * @param {function} func Function to remove from listener. + */ + unbind : function(name, func) { + var list = events[name.toLowerCase()], i; + + if (list) { + for (i = list.length - 1; i >= 0; i--) { + if (list[i].func === func) + list.splice(i, 1); + } + } + } + + /** + * Fires when a file is to be uploaded by the runtime. + * + * @event UploadFile + * @param {plupload.Uploader} uploader Uploader instance sending the event. + * @param {plupload.File} file File to be uploaded. + */ + }); + }; + + /** + * File instance. + * + * @class plupload.File + * @param {String} name Name of the file. + * @param {Number} size File size. + */ + plupload.File = function(id, name, size) { + var t = this; + + /** + * File id this is a globally unique id for the specific file. + * + * @property id + * @type String + */ + t.id = id; + + /** + * File name for example "myfile.gif". + * + * @property name + * @type String + */ + t.name = name; + + /** + * File size in bytes. + * + * @property size + * @type Number + */ + t.size = size; + + /** + * Number of bytes uploaded of the files total size. + * + * @property loaded + * @type Number + */ + t.loaded = 0; + + /** + * Number of percentage uploaded of the file. + * + * @property percent + * @type Number + */ + t.percent = 0; + + /** + * Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE. + * + * @property status + * @type Number + */ + t.status = 0; + }; + + /** + * Runtime class gets implemented by each upload runtime. + * + * @static + * @class plupload.Runtime + */ + plupload.Runtime = function() { + /** + * Checks if the runtime is supported by the browser or not. + * + * @method isSupported + * @return {boolean} true/false if the runtime exists. + */ + this.isSupported = function() { + }; + + /** + * Initializes the upload runtime. This method should add necessary items to the DOM and register events needed for operation. + * + * @method init + * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized. + */ + this.init = function(uploader) { + }; + }; + + /** + * Runtime class gets implemented by each upload runtime. + * + * @class plupload.QueueProgress + */ + plupload.QueueProgress = function() { + var t = this; + + /** + * Total queue file size. + * + * @property size + * @type Number + */ + t.size = 0; + + /** + * Total bytes uploaded. + * + * @property loaded + * @type Number + */ + t.loaded = 0; + + /** + * Number of files uploaded. + * + * @property uploaded + * @type Number + */ + t.uploaded = 0; + + /** + * Number of files failed to upload. + * + * @property failed + * @type Number + */ + t.failed = 0; + + /** + * Number of files yet to be uploaded. + * + * @property queued + * @type Number + */ + t.queued = 0; + + /** + * Total percent of the uploaded bytes. + * + * @property percent + * @type Number + */ + t.percent = 0; + + /** + * Resets the progress to it's initial values. + * + * @method reset + */ + t.reset = function() { + t.size = t.loaded = t.uploaded = t.failed = t.queued = t.percent = 0; + }; + }; + + // Expose plupload namespace + window.plupload = plupload; +})(); diff --git a/src/javascript/plupload.silverlight.js b/src/javascript/plupload.silverlight.js index 6bd1b2f1f..8ce22bd36 100644 --- a/src/javascript/plupload.silverlight.js +++ b/src/javascript/plupload.silverlight.js @@ -1,225 +1,225 @@ -/** - * plupload.silverlight.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under GPL License. - * - * License: http://www.plupload/license - * Contributing: http://www.plupload/contributing - */ - -(function(plupload) { - var uploadInstances = {}; - - function isInstalled(version) { - var isVersionSupported = false; - var container = null; - - try { - var control = null; - - try { - control = new ActiveXObject('AgControl.AgControl'); - - if (version == null) - isVersionSupported = true; - else if (control.IsVersionSupported(version)) - isVersionSupported = true; - - control = null; - } catch (e) { - var plugin = navigator.plugins["Silverlight Plug-In"]; - - if (plugin) { - if (version === null) { - isVersionSupported = true; - } else { - var actualVer = plugin.description; - - if (actualVer === "1.0.30226.2") - actualVer = "2.0.30226.2"; - - var actualVerArray = actualVer.split("."); - - while (actualVerArray.length > 3) - actualVerArray.pop(); - - while ( actualVerArray.length < 4) - actualVerArray.push(0); - - var reqVerArray = version.split("."); - - while (reqVerArray.length > 4) - reqVerArray.pop(); - - var requiredVersionPart, actualVersionPart, index = 0; - - do { - requiredVersionPart = parseInt(reqVerArray[index]); - actualVersionPart = parseInt(actualVerArray[index]); - index++; - } while (index < reqVerArray.length && requiredVersionPart === actualVersionPart); - - if (requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart)) - isVersionSupported = true; - } - } - } - } catch (e) { - isVersionSupported = false; - } - - return isVersionSupported; - }; - - plupload.silverlight = { - trigger : function(id, name) { - var uploader = uploadInstances[id], i, args; - - if (uploader) { - args = plupload.toArray(arguments).slice(1); - args[0] = 'Silverlight:' + name; - - // Detach the call so that error handling in the browser is presented correctly - setTimeout(function() { - uploader.trigger.apply(uploader, args); - }, 0); - } - } - }; - - /** - * Silverlight implementation. - * - * @static - * @class plupload.SilverlightRuntime - * @extends plupload.Runtime - */ - plupload.SilverlightRuntime = plupload.addRuntime("silverlight", { - /** - * Checks if Silverlight is installed or not. - * - * @method isSupported - * @return {boolean} true/false if the runtime exists. - */ - isSupported : function() { - return isInstalled('2.0.31005.0'); - }, - - /** - * Initializes the upload runtime. This method should add necessary items to the DOM and register events needed for operation. - * - * @method init - * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized. - */ - init : function(uploader) { - var silverlightContainer; - - uploadInstances[uploader.id] = uploader; - - // Create silverlight container and insert it at an absolute position within the browse button - silverlightContainer = document.createElement('div'); - silverlightContainer.id = uploader.id + '_silverlight_container'; - - plupload.extend(silverlightContainer.style, { - position : 'absolute', - top : '-1000px', - background : uploader.settings.silverlight_bgcolor || 'transparent', - width : '1px', - height : '1px' - }); - - silverlightContainer.className = 'plupload_silverlight'; - document.body.appendChild(silverlightContainer); - - // Insert the Silverlight object inide the Silverlight container - silverlightContainer.innerHTML = '' + - '' + - '' + - ''; - - function getSilverlightObj() { - return document.getElementById(uploader.id + '_silverlight').content.Upload; - }; - - uploader.bind("Silverlight:Init", function() { - var selectedFiles, lookup = {}; - - uploader.bind("SelectFiles", function(up) { - var i, filter = '', filters = up.settings.filters; - - for (i = 0; i < filters.length; i++) - filter += (filter != '' ? '|' : '') + filters[i].title + " | " + filters[i].extensions; - - selectedFiles = []; - getSilverlightObj().SelectFiles(filter, up.settings.multi_selection); - }); - - uploader.bind("Silverlight:SelectFile", function(up, sl_id, name, size) { - var id; - - // Store away silverlight ids - id = plupload.guid(); - lookup[id] = sl_id; - lookup[sl_id] = id; - - // Expose id, name and size - selectedFiles.push(new plupload.File(id, name, size)); - }); - - uploader.bind("Silverlight:SelectSuccessful", function() { - uploader.trigger("FilesSelected", selectedFiles); - }); - - uploader.bind("Silverlight:UploadFileProgress", function(up, sl_id, loaded, total) { - var file = up.getFile(lookup[sl_id]); - - file.loaded = loaded; - - up.trigger('UploadProgress', file); - }); - - uploader.bind("Silverlight:UploadChunkSuccessful", function(up, sl_id, chunk, chunks, text) { - var chunkArgs, file = up.getFile(lookup[sl_id]); - - chunkArgs = { - file : file, - chunk : chunk, - chunks : chunks, - response : text - }; - - up.trigger('ChunkUploaded', chunkArgs); - - // Stop upload - if (chunkArgs.cancelled) { - getSilverlightObj().CancelUpload(); - file.status = plupload.FAILED; - up.trigger('FileUploaded', file); - return; - } - }); - - uploader.bind("Silverlight:UploadSuccessful", function(up, sl_id) { - var file = up.getFile(lookup[sl_id]); - - file.status = plupload.DONE; - - up.trigger('FileUploaded', file); - }); - - uploader.bind("FileRemoved", function(up, file) { - getSilverlightObj().RemoveFile(lookup[file.id]); - }); - - uploader.bind("UploadFile", function(up, file) { - var url = up.settings.url; - - url += (url.indexOf('?') == -1 ? '?' : '&') + 'name=' + escape(file.target_name || file.name); - - getSilverlightObj().UploadFile(lookup[file.id], url, up.settings.chunk_size); - }); - }); - } - }); -})(plupload); +/** + * plupload.silverlight.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +(function(plupload) { + var uploadInstances = {}; + + function isInstalled(version) { + var isVersionSupported = false; + var container = null; + + try { + var control = null; + + try { + control = new ActiveXObject('AgControl.AgControl'); + + if (version == null) + isVersionSupported = true; + else if (control.IsVersionSupported(version)) + isVersionSupported = true; + + control = null; + } catch (e) { + var plugin = navigator.plugins["Silverlight Plug-In"]; + + if (plugin) { + if (version === null) { + isVersionSupported = true; + } else { + var actualVer = plugin.description; + + if (actualVer === "1.0.30226.2") + actualVer = "2.0.30226.2"; + + var actualVerArray = actualVer.split("."); + + while (actualVerArray.length > 3) + actualVerArray.pop(); + + while ( actualVerArray.length < 4) + actualVerArray.push(0); + + var reqVerArray = version.split("."); + + while (reqVerArray.length > 4) + reqVerArray.pop(); + + var requiredVersionPart, actualVersionPart, index = 0; + + do { + requiredVersionPart = parseInt(reqVerArray[index]); + actualVersionPart = parseInt(actualVerArray[index]); + index++; + } while (index < reqVerArray.length && requiredVersionPart === actualVersionPart); + + if (requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart)) + isVersionSupported = true; + } + } + } + } catch (e) { + isVersionSupported = false; + } + + return isVersionSupported; + }; + + plupload.silverlight = { + trigger : function(id, name) { + var uploader = uploadInstances[id], i, args; + + if (uploader) { + args = plupload.toArray(arguments).slice(1); + args[0] = 'Silverlight:' + name; + + // Detach the call so that error handling in the browser is presented correctly + setTimeout(function() { + uploader.trigger.apply(uploader, args); + }, 0); + } + } + }; + + /** + * Silverlight implementation. + * + * @static + * @class plupload.SilverlightRuntime + * @extends plupload.Runtime + */ + plupload.SilverlightRuntime = plupload.addRuntime("silverlight", { + /** + * Checks if Silverlight is installed or not. + * + * @method isSupported + * @return {boolean} true/false if the runtime exists. + */ + isSupported : function() { + return isInstalled('2.0.31005.0'); + }, + + /** + * Initializes the upload runtime. This method should add necessary items to the DOM and register events needed for operation. + * + * @method init + * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized. + */ + init : function(uploader) { + var silverlightContainer; + + uploadInstances[uploader.id] = uploader; + + // Create silverlight container and insert it at an absolute position within the browse button + silverlightContainer = document.createElement('div'); + silverlightContainer.id = uploader.id + '_silverlight_container'; + + plupload.extend(silverlightContainer.style, { + position : 'absolute', + top : '-1000px', + background : uploader.settings.silverlight_bgcolor || 'transparent', + width : '1px', + height : '1px' + }); + + silverlightContainer.className = 'plupload_silverlight'; + document.body.appendChild(silverlightContainer); + + // Insert the Silverlight object inide the Silverlight container + silverlightContainer.innerHTML = '' + + '' + + '' + + ''; + + function getSilverlightObj() { + return document.getElementById(uploader.id + '_silverlight').content.Upload; + }; + + uploader.bind("Silverlight:Init", function() { + var selectedFiles, lookup = {}; + + uploader.bind("SelectFiles", function(up) { + var i, filter = '', filters = up.settings.filters; + + for (i = 0; i < filters.length; i++) + filter += (filter != '' ? '|' : '') + filters[i].title + " | " + filters[i].extensions; + + selectedFiles = []; + getSilverlightObj().SelectFiles(filter, up.settings.multi_selection); + }); + + uploader.bind("Silverlight:SelectFile", function(up, sl_id, name, size) { + var id; + + // Store away silverlight ids + id = plupload.guid(); + lookup[id] = sl_id; + lookup[sl_id] = id; + + // Expose id, name and size + selectedFiles.push(new plupload.File(id, name, size)); + }); + + uploader.bind("Silverlight:SelectSuccessful", function() { + uploader.trigger("FilesSelected", selectedFiles); + }); + + uploader.bind("Silverlight:UploadFileProgress", function(up, sl_id, loaded, total) { + var file = up.getFile(lookup[sl_id]); + + file.loaded = loaded; + + up.trigger('UploadProgress', file); + }); + + uploader.bind("Silverlight:UploadChunkSuccessful", function(up, sl_id, chunk, chunks, text) { + var chunkArgs, file = up.getFile(lookup[sl_id]); + + chunkArgs = { + file : file, + chunk : chunk, + chunks : chunks, + response : text + }; + + up.trigger('ChunkUploaded', chunkArgs); + + // Stop upload + if (chunkArgs.cancelled) { + getSilverlightObj().CancelUpload(); + file.status = plupload.FAILED; + up.trigger('FileUploaded', file); + return; + } + }); + + uploader.bind("Silverlight:UploadSuccessful", function(up, sl_id) { + var file = up.getFile(lookup[sl_id]); + + file.status = plupload.DONE; + + up.trigger('FileUploaded', file); + }); + + uploader.bind("FileRemoved", function(up, file) { + getSilverlightObj().RemoveFile(lookup[file.id]); + }); + + uploader.bind("UploadFile", function(up, file) { + var url = up.settings.url; + + url += (url.indexOf('?') == -1 ? '?' : '&') + 'name=' + escape(file.target_name || file.name); + + getSilverlightObj().UploadFile(lookup[file.id], url, up.settings.chunk_size); + }); + }); + } + }); +})(plupload); diff --git a/tools/templates/css/grids.css b/tools/templates/css/grids.css index 31f02355c..4c35381d0 100644 --- a/tools/templates/css/grids.css +++ b/tools/templates/css/grids.css @@ -1,467 +1,467 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.7.0 -*/ -/** - * YUI Grids - * @module grids - * @namespace yui- - * @requires reset, fonts - */ - -/** - * Note: Throughout this file, the *property (star-property) filter is used - * to give a value to IE that other browsers do not see. _property is only seen - * by IE7, so the combo of *prop and _prop can target between IE6 and IE7. - * - * More information on these filters and related validation errors: - * http://tech.groups.yahoo.com/group/ydn-javascript/message/40059 - */ - -/** - * Section: General Rules - */ - -body { - text-align: center; -} - -/** - * Section: Page Width Rules (#doc, #doc2, #doc3, #doc4) - */ - -#doc,#doc2,#doc3,#doc4, -.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 { - margin: auto; - text-align: left; - width: 57.69em; - *width: 56.25em; -} - -/* 950 Centered (doc2) */ -#doc2 { - width: 73.076em; - *width: 71.25em; -} - -/* 100% (doc3) */ -#doc3 { -/** - * Left and Right margins are not a structural part of Grids. Without them - * Grids works fine, but content bleeds to the very edge of the document, which - * often impairs readability and usability. They are provided because they - * prevent the content from "bleeding" into the browser's chrome. - */ - margin: auto 10px; - width: auto; -} - -/* 974 Centered (doc4) */ -#doc4 { - width: 74.923em; - *width: 73.05em; -} - -/** - * Section: Preset Template Rules (.yui-t[1-6]) - */ - - -.yui-b { - /* to preserve source-order independence for Gecko */ - position: relative; -} - -.yui-b { - /* to preserve source-order independence for IE */ - _position: static; -} - -#yui-main .yui-b { - /* to preserve source-order independence for Gecko */ - position: static; -} - -#yui-main, -.yui-g .yui-u .yui-g { - width: 100%; -} - -.yui-t1 #yui-main, -.yui-t2 #yui-main, -.yui-t3 #yui-main { - float: right; - /* IE: preserve layout at narrow widths */ - margin-left: -25em; -} - -.yui-t4 #yui-main, -.yui-t5 #yui-main, -.yui-t6 #yui-main { - float: left; - /* IE: preserve layout at narrow widths */ - margin-right: -25em; -} - -/** - * For Specific Template Presets - */ - -.yui-t1 .yui-b { - float: left; - width: 12.30769em; - *width: 12.00em; -} - -.yui-t1 #yui-main .yui-b { - margin-left: 13.30769em; - *margin-left: 13.05em; -} - -.yui-t2 .yui-b { - float: left; - width: 13.8461em; - *width: 13.50em; -} - -.yui-t2 #yui-main .yui-b { - margin-left: 14.8461em; - *margin-left: 14.55em; -} - -.yui-t3 .yui-b { - float: left; - width: 23.0769em; - *width: 22.50em; -} - -.yui-t3 #yui-main .yui-b { - margin-left: 24.0769em; - *margin-left: 23.62em; -} - -.yui-t4 .yui-b { - float: right; - width: 13.8456em; - *width: 13.50em; -} - -.yui-t4 #yui-main .yui-b { - margin-right: 14.8456em; - *margin-right: 14.55em; -} - -.yui-t5 .yui-b { - float: right; - width: 18.4615em; - *width: 18.00em; -} - -.yui-t5 #yui-main .yui-b { - margin-right: 19.4615em; - *margin-right: 19.125em; -} - -.yui-t6 .yui-b { - float: right; - width: 23.0769em; - *width: 22.50em; -} - -.yui-t6 #yui-main .yui-b { - margin-right: 24.0769em; - *margin-right: 23.62em; -} - -.yui-t7 #yui-main .yui-b { - display: block; - margin: 0 0 1em 0; -} - -#yui-main .yui-b { - float: none; - width: auto; -} - -/** - * Section: Grids and Nesting Grids - */ - -/* Children generally take half the available space */ -.yui-gb .yui-u, -.yui-g .yui-gb .yui-u, -.yui-gb .yui-g, -.yui-gb .yui-gb, -.yui-gb .yui-gc, -.yui-gb .yui-gd, -.yui-gb .yui-ge, -.yui-gb .yui-gf, -.yui-gc .yui-u, -.yui-gc .yui-g, -.yui-gd .yui-u { - float: left; -} - -/* Float units (and sub grids) to the right */ -.yui-g .yui-u, -.yui-g .yui-g, -.yui-g .yui-gb, -.yui-g .yui-gc, -.yui-g .yui-gd, -.yui-g .yui-ge, -.yui-g .yui-gf, -.yui-gc .yui-u, -.yui-gd .yui-g, -.yui-g .yui-gc .yui-u, -.yui-ge .yui-u, -.yui-ge .yui-g, -.yui-gf .yui-g, -.yui-gf .yui-u { - float: right; -} - -/*Float units (and sub grids) to the left */ -.yui-g div.first, -.yui-gb div.first, -.yui-gc div.first, -.yui-gd div.first, -.yui-ge div.first, -.yui-gf div.first, -.yui-g .yui-gc div.first, -.yui-g .yui-ge div.first, -.yui-gc div.first div.first { - float: left; -} - -.yui-g .yui-u, -.yui-g .yui-g, -.yui-g .yui-gb, -.yui-g .yui-gc, -.yui-g .yui-gd, -.yui-g .yui-ge, -.yui-g .yui-gf { - width: 49.1%; -} - -.yui-gb .yui-u, -.yui-g .yui-gb .yui-u, -.yui-gb .yui-g, -.yui-gb .yui-gb, -.yui-gb .yui-gc, -.yui-gb .yui-gd, -.yui-gb .yui-ge, -.yui-gb .yui-gf, -.yui-gc .yui-u, -.yui-gc .yui-g, -.yui-gd .yui-u { - width: 32%; - margin-left: 1.99%; -} - -/* Give IE some extra breathing room for 1/3-based rounding issues */ -.yui-gb .yui-u { - *margin-left: 1.9%; - *width: 31.9%; -} - -.yui-gc div.first, - .yui-gd .yui-u { - width: 66%; -} - -.yui-gd div.first { - width: 32%; -} - -.yui-ge div.first, - .yui-gf .yui-u { - width: 74.2%; -} - -.yui-ge .yui-u, - .yui-gf div.first { - width: 24%; -} - -.yui-g .yui-gb div.first, -.yui-gb div.first, -.yui-gc div.first, -.yui-gd div.first { - margin-left: 0; -} - -/** - * Section: Deep Nesting - */ - -.yui-g .yui-g .yui-u, -.yui-gb .yui-g .yui-u, -.yui-gc .yui-g .yui-u, -.yui-gd .yui-g .yui-u, -.yui-ge .yui-g .yui-u, -.yui-gf .yui-g .yui-u { - width: 49%; - *width: 48.1%; - *margin-left: 0; -} - -.yui-g .yui-g .yui-u { - width: 48.1%; -} - -/*SF 1927599 from 1.14 to 2.6.0*/ -.yui-g .yui-gb div.first, - .yui-gb .yui-gb div.first { - *margin-right: 0; - *width: 32%; - _width: 31.7%; -} - -.yui-g .yui-gc div.first, - .yui-gd .yui-g { - width: 66%; -} - -.yui-gb .yui-g div.first { - *margin-right: 4%; - _margin-right: 1.3%; -} - -.yui-gb .yui-gc div.first, - .yui-gb .yui-gd div.first { - *margin-right: 0; -} - -.yui-gb .yui-gb .yui-u, - .yui-gb .yui-gc .yui-u { - *margin-left: 1.8%; - _margin-left: 4%; -} - -.yui-g .yui-gb .yui-u { - _margin-left: 1.0%; -} - -.yui-gb .yui-gd .yui-u { - *width: 66%; - _width: 61.2%; -} - -.yui-gb .yui-gd div.first { - *width: 31%; - _width: 29.5%; -} - -.yui-g .yui-gc .yui-u, - .yui-gb .yui-gc .yui-u { - width: 32%; - _float: right; - margin-right: 0; - _margin-left: 0; -} - -.yui-gb .yui-gc div.first { - width: 66%; - *float: left; - *margin-left: 0; -} - -.yui-gb .yui-ge .yui-u, - .yui-gb .yui-gf .yui-u { - margin: 0; -} - -.yui-gb .yui-gb .yui-u { - _margin-left: .7%; -} - -.yui-gb .yui-g div.first, - .yui-gb .yui-gb div.first { - *margin-left: 0; -} - -.yui-gc .yui-g .yui-u, - .yui-gd .yui-g .yui-u { - *width: 48.1%; - *margin-left: 0; -} - -.yui-gb .yui-gd div.first { - width: 32%; -} - -.yui-g .yui-gd div.first { - _width: 29.9%; -} - -.yui-ge .yui-g { - width: 24%; -} - -.yui-gf .yui-g { - width: 74.2%; -} - -.yui-gb .yui-ge div.yui-u, - .yui-gb .yui-gf div.yui-u { - float: right; -} - -.yui-gb .yui-ge div.first, - .yui-gb .yui-gf div.first { - float: left; -} - -/* Width Accommodation for Nested Contexts */ -.yui-gb .yui-ge .yui-u, - .yui-gb .yui-gf div.first { - *width: 24%; - _width: 20%; -} - -/* Width Accommodation for Nested Contexts */ -.yui-gb .yui-ge div.first, - .yui-gb .yui-gf .yui-u { - *width: 73.5%; - _width: 65.5%; -} - -/* Patch for GD within GE */ -.yui-ge div.first .yui-gd .yui-u { - width: 65%; -} - -.yui-ge div.first .yui-gd div.first { - width: 32%; -} - -/* @group Clearing */ -#hd:after, -#bd:after, -#ft:after, -.yui-g:after, -.yui-gb:after, -.yui-gc:after, -.yui-gd:after, -.yui-ge:after, -.yui-gf:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} - -#hd, -#bd, -#ft, -.yui-g, -.yui-gb, -.yui-gc, -.yui-gd, -.yui-ge, -.yui-gf { - zoom: 1; -} +/* +Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.7.0 +*/ +/** + * YUI Grids + * @module grids + * @namespace yui- + * @requires reset, fonts + */ + +/** + * Note: Throughout this file, the *property (star-property) filter is used + * to give a value to IE that other browsers do not see. _property is only seen + * by IE7, so the combo of *prop and _prop can target between IE6 and IE7. + * + * More information on these filters and related validation errors: + * http://tech.groups.yahoo.com/group/ydn-javascript/message/40059 + */ + +/** + * Section: General Rules + */ + +body { + text-align: center; +} + +/** + * Section: Page Width Rules (#doc, #doc2, #doc3, #doc4) + */ + +#doc,#doc2,#doc3,#doc4, +.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 { + margin: auto; + text-align: left; + width: 57.69em; + *width: 56.25em; +} + +/* 950 Centered (doc2) */ +#doc2 { + width: 73.076em; + *width: 71.25em; +} + +/* 100% (doc3) */ +#doc3 { +/** + * Left and Right margins are not a structural part of Grids. Without them + * Grids works fine, but content bleeds to the very edge of the document, which + * often impairs readability and usability. They are provided because they + * prevent the content from "bleeding" into the browser's chrome. + */ + margin: auto 10px; + width: auto; +} + +/* 974 Centered (doc4) */ +#doc4 { + width: 74.923em; + *width: 73.05em; +} + +/** + * Section: Preset Template Rules (.yui-t[1-6]) + */ + + +.yui-b { + /* to preserve source-order independence for Gecko */ + position: relative; +} + +.yui-b { + /* to preserve source-order independence for IE */ + _position: static; +} + +#yui-main .yui-b { + /* to preserve source-order independence for Gecko */ + position: static; +} + +#yui-main, +.yui-g .yui-u .yui-g { + width: 100%; +} + +.yui-t1 #yui-main, +.yui-t2 #yui-main, +.yui-t3 #yui-main { + float: right; + /* IE: preserve layout at narrow widths */ + margin-left: -25em; +} + +.yui-t4 #yui-main, +.yui-t5 #yui-main, +.yui-t6 #yui-main { + float: left; + /* IE: preserve layout at narrow widths */ + margin-right: -25em; +} + +/** + * For Specific Template Presets + */ + +.yui-t1 .yui-b { + float: left; + width: 12.30769em; + *width: 12.00em; +} + +.yui-t1 #yui-main .yui-b { + margin-left: 13.30769em; + *margin-left: 13.05em; +} + +.yui-t2 .yui-b { + float: left; + width: 13.8461em; + *width: 13.50em; +} + +.yui-t2 #yui-main .yui-b { + margin-left: 14.8461em; + *margin-left: 14.55em; +} + +.yui-t3 .yui-b { + float: left; + width: 23.0769em; + *width: 22.50em; +} + +.yui-t3 #yui-main .yui-b { + margin-left: 24.0769em; + *margin-left: 23.62em; +} + +.yui-t4 .yui-b { + float: right; + width: 13.8456em; + *width: 13.50em; +} + +.yui-t4 #yui-main .yui-b { + margin-right: 14.8456em; + *margin-right: 14.55em; +} + +.yui-t5 .yui-b { + float: right; + width: 18.4615em; + *width: 18.00em; +} + +.yui-t5 #yui-main .yui-b { + margin-right: 19.4615em; + *margin-right: 19.125em; +} + +.yui-t6 .yui-b { + float: right; + width: 23.0769em; + *width: 22.50em; +} + +.yui-t6 #yui-main .yui-b { + margin-right: 24.0769em; + *margin-right: 23.62em; +} + +.yui-t7 #yui-main .yui-b { + display: block; + margin: 0 0 1em 0; +} + +#yui-main .yui-b { + float: none; + width: auto; +} + +/** + * Section: Grids and Nesting Grids + */ + +/* Children generally take half the available space */ +.yui-gb .yui-u, +.yui-g .yui-gb .yui-u, +.yui-gb .yui-g, +.yui-gb .yui-gb, +.yui-gb .yui-gc, +.yui-gb .yui-gd, +.yui-gb .yui-ge, +.yui-gb .yui-gf, +.yui-gc .yui-u, +.yui-gc .yui-g, +.yui-gd .yui-u { + float: left; +} + +/* Float units (and sub grids) to the right */ +.yui-g .yui-u, +.yui-g .yui-g, +.yui-g .yui-gb, +.yui-g .yui-gc, +.yui-g .yui-gd, +.yui-g .yui-ge, +.yui-g .yui-gf, +.yui-gc .yui-u, +.yui-gd .yui-g, +.yui-g .yui-gc .yui-u, +.yui-ge .yui-u, +.yui-ge .yui-g, +.yui-gf .yui-g, +.yui-gf .yui-u { + float: right; +} + +/*Float units (and sub grids) to the left */ +.yui-g div.first, +.yui-gb div.first, +.yui-gc div.first, +.yui-gd div.first, +.yui-ge div.first, +.yui-gf div.first, +.yui-g .yui-gc div.first, +.yui-g .yui-ge div.first, +.yui-gc div.first div.first { + float: left; +} + +.yui-g .yui-u, +.yui-g .yui-g, +.yui-g .yui-gb, +.yui-g .yui-gc, +.yui-g .yui-gd, +.yui-g .yui-ge, +.yui-g .yui-gf { + width: 49.1%; +} + +.yui-gb .yui-u, +.yui-g .yui-gb .yui-u, +.yui-gb .yui-g, +.yui-gb .yui-gb, +.yui-gb .yui-gc, +.yui-gb .yui-gd, +.yui-gb .yui-ge, +.yui-gb .yui-gf, +.yui-gc .yui-u, +.yui-gc .yui-g, +.yui-gd .yui-u { + width: 32%; + margin-left: 1.99%; +} + +/* Give IE some extra breathing room for 1/3-based rounding issues */ +.yui-gb .yui-u { + *margin-left: 1.9%; + *width: 31.9%; +} + +.yui-gc div.first, + .yui-gd .yui-u { + width: 66%; +} + +.yui-gd div.first { + width: 32%; +} + +.yui-ge div.first, + .yui-gf .yui-u { + width: 74.2%; +} + +.yui-ge .yui-u, + .yui-gf div.first { + width: 24%; +} + +.yui-g .yui-gb div.first, +.yui-gb div.first, +.yui-gc div.first, +.yui-gd div.first { + margin-left: 0; +} + +/** + * Section: Deep Nesting + */ + +.yui-g .yui-g .yui-u, +.yui-gb .yui-g .yui-u, +.yui-gc .yui-g .yui-u, +.yui-gd .yui-g .yui-u, +.yui-ge .yui-g .yui-u, +.yui-gf .yui-g .yui-u { + width: 49%; + *width: 48.1%; + *margin-left: 0; +} + +.yui-g .yui-g .yui-u { + width: 48.1%; +} + +/*SF 1927599 from 1.14 to 2.6.0*/ +.yui-g .yui-gb div.first, + .yui-gb .yui-gb div.first { + *margin-right: 0; + *width: 32%; + _width: 31.7%; +} + +.yui-g .yui-gc div.first, + .yui-gd .yui-g { + width: 66%; +} + +.yui-gb .yui-g div.first { + *margin-right: 4%; + _margin-right: 1.3%; +} + +.yui-gb .yui-gc div.first, + .yui-gb .yui-gd div.first { + *margin-right: 0; +} + +.yui-gb .yui-gb .yui-u, + .yui-gb .yui-gc .yui-u { + *margin-left: 1.8%; + _margin-left: 4%; +} + +.yui-g .yui-gb .yui-u { + _margin-left: 1.0%; +} + +.yui-gb .yui-gd .yui-u { + *width: 66%; + _width: 61.2%; +} + +.yui-gb .yui-gd div.first { + *width: 31%; + _width: 29.5%; +} + +.yui-g .yui-gc .yui-u, + .yui-gb .yui-gc .yui-u { + width: 32%; + _float: right; + margin-right: 0; + _margin-left: 0; +} + +.yui-gb .yui-gc div.first { + width: 66%; + *float: left; + *margin-left: 0; +} + +.yui-gb .yui-ge .yui-u, + .yui-gb .yui-gf .yui-u { + margin: 0; +} + +.yui-gb .yui-gb .yui-u { + _margin-left: .7%; +} + +.yui-gb .yui-g div.first, + .yui-gb .yui-gb div.first { + *margin-left: 0; +} + +.yui-gc .yui-g .yui-u, + .yui-gd .yui-g .yui-u { + *width: 48.1%; + *margin-left: 0; +} + +.yui-gb .yui-gd div.first { + width: 32%; +} + +.yui-g .yui-gd div.first { + _width: 29.9%; +} + +.yui-ge .yui-g { + width: 24%; +} + +.yui-gf .yui-g { + width: 74.2%; +} + +.yui-gb .yui-ge div.yui-u, + .yui-gb .yui-gf div.yui-u { + float: right; +} + +.yui-gb .yui-ge div.first, + .yui-gb .yui-gf div.first { + float: left; +} + +/* Width Accommodation for Nested Contexts */ +.yui-gb .yui-ge .yui-u, + .yui-gb .yui-gf div.first { + *width: 24%; + _width: 20%; +} + +/* Width Accommodation for Nested Contexts */ +.yui-gb .yui-ge div.first, + .yui-gb .yui-gf .yui-u { + *width: 73.5%; + _width: 65.5%; +} + +/* Patch for GD within GE */ +.yui-ge div.first .yui-gd .yui-u { + width: 65%; +} + +.yui-ge div.first .yui-gd div.first { + width: 32%; +} + +/* @group Clearing */ +#hd:after, +#bd:after, +#ft:after, +.yui-g:after, +.yui-gb:after, +.yui-gc:after, +.yui-gd:after, +.yui-ge:after, +.yui-gf:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +#hd, +#bd, +#ft, +.yui-g, +.yui-gb, +.yui-gc, +.yui-gd, +.yui-ge, +.yui-gf { + zoom: 1; +} diff --git a/tools/templates/css/jquery.treeview.css b/tools/templates/css/jquery.treeview.css index dfce99794..2aafdd62c 100644 --- a/tools/templates/css/jquery.treeview.css +++ b/tools/templates/css/jquery.treeview.css @@ -2,15 +2,15 @@ padding: 0; margin: 0; list-style: none; - + } - - -.treeview ul { -background-color: white; -margin-top: 4px; + + +.treeview ul { +background-color: white; +margin-top: 4px; } .treeview .hitarea { @@ -25,7 +25,7 @@ cursor: pointer; * html .hitarea { display: inline; float: none; - + } .treeview li { @@ -45,12 +45,12 @@ cursor: pointer; .treeview .expandable-hitarea { background-position: -80px -3px; } .treeview li.last { background-position: 0 -1766px } - + .treeview li.lastCollapsable { background-position: 0 -111px } - + .treeview li.lastExpandable { background-position: -32px -67px } -.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; } +.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; } .treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(../img/treeview-famfamfam.gif); } diff --git a/tools/templates/css/reset.css b/tools/templates/css/reset.css index 8913056ed..7066a44d6 100644 --- a/tools/templates/css/reset.css +++ b/tools/templates/css/reset.css @@ -1,142 +1,142 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.7.0 -*/ -/** - * YUI Reset - * @module reset - * @namespace - * @requires - */ -html { - color: #000; - background: #FFF; -} - -body, -div, -dl, -dt, -dd, -ul, -ol, -li, -h1, -h2, -h3, -h4, -h5, -h6, -pre, -code, -form, -fieldset, -legend, -input, -button, -textarea, -p, -blockquote, -th, -td { - margin: 0; - padding: 0; -} - -table { - border-collapse: collapse; - border-spacing: 0; -} - -fieldset, -img { - border: 0; -} - -address, -caption, -cite, -code, -dfn, -em, -strong, -th, -var, -optgroup { - font-style: inherit; - font-weight: inherit; -} - -del, -ins { - text-decoration: none; -} - -li { - list-style: none; -} - -caption, -th { - text-align: left; -} - -h1, -h2, -h3, -h4, -h5, -h6 { - font-size: 100%; - font-weight: normal; -} - -q:before, -q:after { - content: ''; -} - -abbr, -acronym { - border: 0; - font-variant: normal; -} - -sup { - vertical-align: baseline; -} - -sub { - vertical-align: baseline; -} - -/*because legend doesn't inherit in IE */ -legend { - color: #000; -} - -input, -button, -textarea, -select, -optgroup, -option { - font-family: inherit; - font-size: inherit; - font-style: inherit; - font-weight: inherit; -} - -/*@purpose To enable resizing for IE */ -/*@branch For IE6-Win, IE7-Win */ -input, -button, -textarea, -select { - *font-size: 100%; -} - - - +/* +Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.7.0 +*/ +/** + * YUI Reset + * @module reset + * @namespace + * @requires + */ +html { + color: #000; + background: #FFF; +} + +body, +div, +dl, +dt, +dd, +ul, +ol, +li, +h1, +h2, +h3, +h4, +h5, +h6, +pre, +code, +form, +fieldset, +legend, +input, +button, +textarea, +p, +blockquote, +th, +td { + margin: 0; + padding: 0; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +fieldset, +img { + border: 0; +} + +address, +caption, +cite, +code, +dfn, +em, +strong, +th, +var, +optgroup { + font-style: inherit; + font-weight: inherit; +} + +del, +ins { + text-decoration: none; +} + +li { + list-style: none; +} + +caption, +th { + text-align: left; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: 100%; + font-weight: normal; +} + +q:before, +q:after { + content: ''; +} + +abbr, +acronym { + border: 0; + font-variant: normal; +} + +sup { + vertical-align: baseline; +} + +sub { + vertical-align: baseline; +} + +/*because legend doesn't inherit in IE */ +legend { + color: #000; +} + +input, +button, +textarea, +select, +optgroup, +option { + font-family: inherit; + font-size: inherit; + font-style: inherit; + font-weight: inherit; +} + +/*@purpose To enable resizing for IE */ +/*@branch For IE6-Win, IE7-Win */ +input, +button, +textarea, +select { + *font-size: 100%; +} + + + diff --git a/tools/templates/js/general.js b/tools/templates/js/general.js index 39d1d1fce..dfb57af85 100644 --- a/tools/templates/js/general.js +++ b/tools/templates/js/general.js @@ -1,96 +1,96 @@ -(function($){ - var currentPage, currentHash; - - function resizeUI() { - $('#doc3').css('height', (window.innerHeight || document.documentElement.clientHeight) - $('#hd').height() - 12); - } - - function scrollToHash(hash) { - if (hash) { - $(hash).each(function() { - $(this)[0].scrollIntoView(); - }); - } - } - - function loadURL(url) { - var parts, hash; - - // Trim away everything but the file name - url = /([^\/]+)$/.exec(url)[0]; - - // Parse out parts - parts = /^([^#]+)(#.+)?$/.exec(url); - hash = parts[2]; - - // In page link, no need to load anything - if (parts[1] == currentPage) { - if (hash) - scrollToHash(hash); - else - $('#detailsView')[0].scrollTop = 0; - - return; - } - - currentPage = parts[1]; - - $("#classView a.selected").removeClass('selected'); - $("#classView a[href='" + currentPage.replace(/^.*\/([^\/]+)$/, '$1') + "']").addClass('selected').focus().parents("li.expandable").each(function() { - var li = $(this).removeClass("expandable").addClass("collapsable"); - - li.find("> div.expandable-hitarea").removeClass("expandable-hitarea").addClass("collapsable-hitarea"); - li.find("> ul").show(); - }); - - $('#detailsView').find("div.page").hide(); - - // Check if the page has been loaded before - if ($("#detailsView div[url='" + currentPage + "']").show().length == 0) { - $('#detailsView').addClass("loading"); - - // Load page and cache it in a div - $.get(currentPage, "", function(data) { - data = /]*>([\s\S]+)<\/body>/.exec(data); - - if (data) { - $('#detailsView').removeClass("loading").append('
      ' + data[1] + '
      ')[0].scrollTop = 0; - - SyntaxHighlighter.config.clipboardSwf = 'js/clipboard.swf'; - SyntaxHighlighter.highlight({gutter : false}); - - scrollToHash(hash); - } - }); - } else - scrollToHash(hash); - } - - $().ready(function(){ - $("#browser").treeview(); - $(window).resize(resizeUI).trigger('resize'); - - window.setInterval(function() { - var hash = document.location.hash; - - if (hash != currentHash && hash) { - loadURL(hash.replace(/\-/g, '#').substring(1)); - currentHash = hash; - } - }, 100); - - $("a").live("click", function(e) { - var url = e.target.href; - - if (e.button == 0) { - if (url.indexOf('class_') != -1 || url.indexOf('alias_') != -1 || url.indexOf('member_') != -1) { - document.location.hash = e.target.href.replace(/^.*\/([^\/]+)/, '$1').replace(/#/g, '-'); - - loadURL(url); - } - - e.preventDefault(); - } - }); - }); -})(jQuery); +(function($){ + var currentPage, currentHash; + + function resizeUI() { + $('#doc3').css('height', (window.innerHeight || document.documentElement.clientHeight) - $('#hd').height() - 12); + } + + function scrollToHash(hash) { + if (hash) { + $(hash).each(function() { + $(this)[0].scrollIntoView(); + }); + } + } + + function loadURL(url) { + var parts, hash; + + // Trim away everything but the file name + url = /([^\/]+)$/.exec(url)[0]; + + // Parse out parts + parts = /^([^#]+)(#.+)?$/.exec(url); + hash = parts[2]; + + // In page link, no need to load anything + if (parts[1] == currentPage) { + if (hash) + scrollToHash(hash); + else + $('#detailsView')[0].scrollTop = 0; + + return; + } + + currentPage = parts[1]; + + $("#classView a.selected").removeClass('selected'); + $("#classView a[href='" + currentPage.replace(/^.*\/([^\/]+)$/, '$1') + "']").addClass('selected').focus().parents("li.expandable").each(function() { + var li = $(this).removeClass("expandable").addClass("collapsable"); + + li.find("> div.expandable-hitarea").removeClass("expandable-hitarea").addClass("collapsable-hitarea"); + li.find("> ul").show(); + }); + + $('#detailsView').find("div.page").hide(); + + // Check if the page has been loaded before + if ($("#detailsView div[url='" + currentPage + "']").show().length == 0) { + $('#detailsView').addClass("loading"); + + // Load page and cache it in a div + $.get(currentPage, "", function(data) { + data = /]*>([\s\S]+)<\/body>/.exec(data); + + if (data) { + $('#detailsView').removeClass("loading").append('
      ' + data[1] + '
      ')[0].scrollTop = 0; + + SyntaxHighlighter.config.clipboardSwf = 'js/clipboard.swf'; + SyntaxHighlighter.highlight({gutter : false}); + + scrollToHash(hash); + } + }); + } else + scrollToHash(hash); + } + + $().ready(function(){ + $("#browser").treeview(); + $(window).resize(resizeUI).trigger('resize'); + + window.setInterval(function() { + var hash = document.location.hash; + + if (hash != currentHash && hash) { + loadURL(hash.replace(/\-/g, '#').substring(1)); + currentHash = hash; + } + }, 100); + + $("a").live("click", function(e) { + var url = e.target.href; + + if (e.button == 0) { + if (url.indexOf('class_') != -1 || url.indexOf('alias_') != -1 || url.indexOf('member_') != -1) { + document.location.hash = e.target.href.replace(/^.*\/([^\/]+)/, '$1').replace(/#/g, '-'); + + loadURL(url); + } + + e.preventDefault(); + } + }); + }); +})(jQuery); diff --git a/tools/templates/js/jquery.treeview.min.js b/tools/templates/js/jquery.treeview.min.js index 96202d9cb..59707f4ad 100644 --- a/tools/templates/js/jquery.treeview.min.js +++ b/tools/templates/js/jquery.treeview.min.js @@ -1,15 +1,15 @@ -/* - * Treeview 1.4 - jQuery plugin to hide and show branches of a tree - * - * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ - * http://docs.jquery.com/Plugins/Treeview - * - * Copyright (c) 2007 Jörn Zaefferer - * - * 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: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $ - * +/* + * Treeview 1.4 - jQuery plugin to hide and show branches of a tree + * + * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ + * http://docs.jquery.com/Plugins/Treeview + * + * Copyright (c) 2007 Jörn Zaefferer + * + * 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: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $ + * */;(function($){$.extend($.fn,{swapClass:function(c1,c2){var c1Elements=this.filter('.'+c1);this.filter('.'+c2).removeClass(c2).addClass(c1);c1Elements.removeClass(c1).addClass(c2);return this;},replaceClass:function(c1,c2){return this.filter('.'+c1).removeClass(c1).addClass(c2).end();},hoverClass:function(className){className=className||"hover";return this.hover(function(){$(this).addClass(className);},function(){$(this).removeClass(className);});},heightToggle:function(animated,callback){animated?this.animate({height:"toggle"},animated,callback):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();if(callback)callback.apply(this,arguments);});},heightHide:function(animated,callback){if(animated){this.animate({height:"hide"},animated,callback);}else{this.hide();if(callback)this.each(callback);}},prepareBranches:function(settings){if(!settings.prerendered){this.filter(":last-child:not(ul)").addClass(CLASSES.last);this.filter((settings.collapsed?"":"."+CLASSES.closed)+":not(."+CLASSES.open+")").find(">ul").hide();}return this.filter(":has(>ul)");},applyClasses:function(settings,toggler){this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event){toggler.apply($(this).next());}).add($("a",this)).hoverClass();if(!settings.prerendered){this.filter(":has(>ul:hidden)").addClass(CLASSES.expandable).replaceClass(CLASSES.last,CLASSES.lastExpandable);this.not(":has(>ul:hidden)").addClass(CLASSES.collapsable).replaceClass(CLASSES.last,CLASSES.lastCollapsable);this.prepend("
      ").find("div."+CLASSES.hitarea).each(function(){var classes="";$.each($(this).parent().attr("class").split(" "),function(){classes+=this+"-hitarea ";});$(this).addClass(classes);});}this.find("div."+CLASSES.hitarea).click(toggler);},treeview:function(settings){settings=$.extend({cookieId:"treeview"},settings);if(settings.add){return this.trigger("add",[settings.add]);}if(settings.toggle){var callback=settings.toggle;settings.toggle=function(){return callback.apply($(this).parent()[0],arguments);};}function treeController(tree,control){function handler(filter){return function(){toggler.apply($("div."+CLASSES.hitarea,tree).filter(function(){return filter?$(this).parent("."+filter).length:true;}));return false;};}$("a:eq(0)",control).click(handler(CLASSES.collapsable));$("a:eq(1)",control).click(handler(CLASSES.expandable));$("a:eq(2)",control).click(handler());}function toggler(){$(this).parent().find(">.hitarea").swapClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).swapClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().swapClass(CLASSES.collapsable,CLASSES.expandable).swapClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightToggle(settings.animated,settings.toggle);if(settings.unique){$(this).parent().siblings().find(">.hitarea").replaceClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).replaceClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().replaceClass(CLASSES.collapsable,CLASSES.expandable).replaceClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightHide(settings.animated,settings.toggle);}}function serialize(){function binary(arg){return arg?1:0;}var data=[];branches.each(function(i,e){data[i]=$(e).is(":has(>ul:visible)")?1:0;});$.cookie(settings.cookieId,data.join(""));}function deserialize(){var stored=$.cookie(settings.cookieId);if(stored){var data=stored.split("");branches.each(function(i,e){$(e).find(">ul")[parseInt(data[i])?"show":"hide"]();});}}this.addClass("treeview");var branches=this.find("li").prepareBranches(settings);switch(settings.persist){case"cookie":var toggleCallback=settings.toggle;settings.toggle=function(){serialize();if(toggleCallback){toggleCallback.apply(this,arguments);}};deserialize();break;case"location":var current=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase();});if(current.length){current.addClass("selected").parents("ul, li").add(current.next()).show();}break;}branches.applyClasses(settings,toggler);if(settings.control){treeController(this,settings.control);$(settings.control).show();}return this.bind("add",function(event,branches){$(branches).prev().removeClass(CLASSES.last).removeClass(CLASSES.lastCollapsable).removeClass(CLASSES.lastExpandable).find(">.hitarea").removeClass(CLASSES.lastCollapsableHitarea).removeClass(CLASSES.lastExpandableHitarea);$(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings,toggler);});}});var CLASSES=$.fn.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"};$.fn.Treeview=$.fn.treeview;})(jQuery); \ No newline at end of file diff --git a/tools/templates/js/shCore.js b/tools/templates/js/shCore.js index 6a72403b8..5b2a16396 100644 --- a/tools/templates/js/shCore.js +++ b/tools/templates/js/shCore.js @@ -27,4 +27,4 @@ * You should have received a copy of the GNU General Public License * along with SyntaxHighlighter. If not, see . */ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[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}('f(!1q.2E){l 2E=h(){l p={77:{"1e-1f":"","79-2P":1,"1I":u,"6V-70":U,"1C-2A":4,"5f":N,"4Z":U,"1z":U,"56":N,"7G-7F":U,"6Z":N,"4S-1m":U},M:{52:u,5P:16,5S:16,8k:N,8l:N,83:"4R",1k:{3Y:"97 1c",41:"9b 1c",5U:"9O 93 7A",6t:"9B I 9E 23 8w 7A 8o",34:"34",6P:"?",1v:"2E\\n\\n",6F:"8p\'t 8I 87 D: ",7X:"8V 8v\'t bD D 2u-2c bf: ",6H:"<2u ay=\\"2g://6D.6v.6m/as/8r\\"><6l><8T 2g-92=\\"8P-8L\\" 5B=\\"2d/2u; 8E=8s-8\\" /><3B>8C 2E<2L 1n=\\"3N-8x:8Z,9y,9H,9I-9Q;9S-4v:#9K;4v:#9J;3N-2A:9L;2d-6k:6i;\\">2E6f 2.0.9j (9n 9s 6n)2g://6j.4U96 I 94 95.9f 9e-6n 9c 9t."},6T:N},1t:{4D:u,3k:u,3P:u,5K:{}},2B:{},85:{9u:/\\/\\*[\\s\\S]*?\\*\\//4k,9N:/\\/\\/.*$/4k,9M:/#.*$/4k,9P:/"(?:\\.|(\\\\\\")|[^\\""\\n])*"/g,9T:/\'(?:\\.|(\\\\\\\')|[^\\\'\'\\n])*\'/g,9R:/"(?:\\.|(\\\\\\")|[^\\""])*"/g,9z:/\'(?:\\.|(\\\\\\\')|[^\\\'\'])*\'/g,3p:/\\w+:\\/\\/[\\w-.\\/?%&=]*/g,9x:{E:/(&1F;|<)\\?=?/g,13:/\\?(&2o;|>)/g},9v:{E:/(&1F;|<)%=?/g,13:/%(&2o;|>)/g},9w:{E:/(&1F;|<)\\s*2c.*?(&2o;|>)/4x,13:/(&1F;|<)\\/\\s*2c\\s*(&2o;|>)/4x}},1z:{12:h(3s){l 3y=L.1s("3j"),4o=p.1z.65;3y.J="1z";D(l 2Y 23 4o){l 6o=4o[2Y],4J=T 6o(3s),28=4J.12();3s.5I[2Y]=4J;f(28==u){1H}f(9G(28)=="9F"){28=p.1z.6s(28,3s.1g,2Y)}28.J+="5k "+2Y;3y.1G(28)}q 3y},6s:h(4A,6r,4h){l a=L.1s("a"),4Q=a.1n,4P=p.M,4F=4P.5P,48=4P.5S;a.2q="#"+4h;a.3B=4A;a.5M=6r;a.6q=4h;a.1x=4A;f(55(4F)==N){4Q.1S=4F+"5x"}f(55(48)==N){4Q.2t=48+"5x"}a.8t=h(e){8D{p.1z.6p(c,e||1q.6w,c.5M,c.6q)}8m(e){p.B.1v(e.6u)}q N};q a},6p:h(69,68,6h,6g,67){l 3U=p.1t.5K[6h],3X;f(3U==u||(3X=3U.5I[6g])==u){q u}q 3X.2h(69,68,67)},65:{3Y:h(4b){c.12=h(){f(4b.V("56")!=U){q}q p.M.1k.3Y};c.2h=h(42,8X,91){l A=4b.A;42.7T.5a(42);A.J=A.J.C("51","")}},41:h(66){c.12=h(){q p.M.1k.41};c.2h=h(8R,8Q,8J){l 3Q=p.B.3G(66.4W).C(/"+3Q+"");2i.L.5O()}},5U:h(5e){l 3S,8F,5L=5e.1g;c.12=h(){l 2S=p.M;f(2S.52==u){q u}h 1A(5E){l 5s="";D(l 5y 23 5E){5s+="<8S 1f=\'"+5y+"\' 1U=\'"+5E[5y]+"\'/>"}q 5s};h 2v(5t){l 5Q="";D(l 5w 23 5t){5Q+=" "+5w+"=\'"+5t[5w]+"\'"}q 5Q};l 5m={1S:2S.5P,2t:2S.5S,1g:5L+"b8",6N:"b7/x-6a-6b",3B:p.M.1k.5U},5h={b6:"b4",b5:"b9",ba:"5M="+5L,bd:"N"},5g=2S.52,3H;f(/bb/i.1R(5Z.5W)){3H="<6e"+2v({bc:"b3:b2-aU-aT-aS-aQ",aR:"2g://aW.b1.4U/b0/6a/aX/6b/bg.bh#6f=9,0,0,0"})+2v(5m)+">"+1A(5h)+1A({bB:5g})+""}F{3H=""}3S=L.1s("A");3S.1x=3H;q 3S};c.2h=h(bH,bG,5T){l 6d=5T.bE;6z(6d){2N"7u":l 53=p.B.2D(p.B.3G(5e.4W).C(/&1F;/g,"<").C(/&2o;/g,">").C(/&bw;/g,"&"));f(1q.6c){1q.6c.bm("2d",53)}F{q p.B.2D(53)}2N"bk":p.B.1v(p.M.1k.6t);2m;2N"bj":p.B.1v(5T.6u);2m}}},bo:h(58){c.12=h(){q p.M.1k.34};c.2h=h(bu,bt,bs){l 1W=L.1s("bp"),1O=u;f(p.1t.3P!=u){L.2L.5a(p.1t.3P)}p.1t.3P=1W;1W.1n.bq="aP:aO;1S:6L;2t:6L;E:-6K;43:-6K;";L.2L.1G(1W);1O=1W.5c.L;6J(1O,1q.L);1O.3h(""+58.A.1x+"");1O.5O();1W.5c.4d();1W.5c.34();h 6J(6M,64){l 2F=64.82("4Y");D(l i=0;i<2F.v;i++){f(2F[i].6R.ac()=="6Q"&&/aa\\.19$/.1R(2F[i].2q)){6M.3h("<4Y 6N=\\"2d/19\\" 6R=\\"6Q\\" 2q=\\""+2F[i].2q+"\\">")}}}}},af:h(ag){c.12=h(){q p.M.1k.6P};c.2h=h(aj,ah){l 2i=p.B.54("","57",ai,a9,"6O=0"),1O=2i.L;1O.3h(p.M.1k.6H);1O.5O();2i.4d()}}}},B:{5H:h(6G){q 6G+3J.9Y(3J.9W()*9X).2r()},5o:h(5R,5G){l 3m={},1T;D(1T 23 5R){3m[1T]=5R[1T]}D(1T 23 5G){3m[1T]=5G[1T]}q 3m},8d:h(5z){6z(5z){2N"U":q U;2N"N":q N}q 5z},54:h(3p,6x,44,4c,2J){l x=(6y.1S-44)/2,y=(6y.2t-4c)/2;2J+=", E="+x+", 43="+y+", 1S="+44+", 2t="+4c;2J=2J.C(/^,/,"");l 49=1q.a5(3p,6x,2J);49.4d();q 49},7Q:h(1M,25,24){f(1M.6A){1M["e"+25+24]=24;1M[25+24]=h(){1M["e"+25+24](1q.6w)};1M.6A("an"+25,1M[25+24])}F{1M.aG(25,24,N)}},1v:h(z){1v(p.M.1k.1v+z)},4l:h(4M,6B){l 2k=p.1t.4D,3b=u;f(2k==u){2k={};D(l 4G 23 p.2B){l 37=p.2B[4G].aF;f(37==u){1H}D(l i=0;i<37.v;i++){2k[37[i]]=4G}}p.1t.4D=2k}3b=p.2B[2k[4M]];f(3b==u&&6B!=N){p.B.1v(p.M.1k.6F+4M)}q 3b},4n:h(z,6E){l 2U=z.1P("\\n");D(l i=0;i<2U.v;i++){2U[i]=6E(2U[i])}q 2U.5u("\\n")},74:h(){l A=L.1s("A"),3e=L.1s("A"),6C=10,i=1;29(i<=aD){f(i%6C===0){A.1x+=i;i+=(i+"").v}F{A.1x+="&aI;";i++}}3e.J="5f 2P";3e.1G(A);q 3e},6W:h(z){q z.C(/^[ ]*[\\n]+|[\\n]*[ ]*$/g,"")},84:h(z){l 3d,4u={},4p=T R("^\\\\[(?<4q>(.*?))\\\\]$"),6S=T R("(?<1f>[\\\\w-]+)"+"\\\\s*:\\\\s*"+"(?<1U>"+"[\\\\w-%#]+|"+"\\\\[.*?\\\\]|"+"\\".*?\\"|"+"\'.*?\'"+")\\\\s*;?","g");29((3d=6S.Q(z))!=u){l 2f=3d.1U.C(/^[\'"]|[\'"]$/g,"");f(2f!=u&&4p.1R(2f)){l m=4p.Q(2f);2f=m.4q.v>0?m.4q.1P(/\\s*,\\s*/):[]}4u[3d.1f]=2f}q 4u},7g:h(z,19){f(z==u||z.v==0||z=="\\n"){q z}z=z.C(/"+2s+""})}q z},7a:h(61,62){l 2I=61.2r();29(2I.v<62){2I="0"+2I}q 2I},5p:h(){l 3x=L.1s("A"),35,3r=0,5i=L.2L,1g=p.B.5H("5p"),2Q="",4H="";3x.1x=2Q+"7P\\">"+2Q+"1m\\">"+2Q+"2P\\">"+2Q+"5B"+"\\"><1V 1e=\\"7i\\"><1V 1g=\\""+1g+"\\">&1X;"+4H+4H+2V+2V+2V+2V;5i.1G(3x);35=L.ar(1g);f(/aq/i.1R(5Z.5W)){l 63=1q.ao(35,u);3r=7b(63.ap("1S"))}F{3r=35.at}5i.5a(3x);q 3r},76:h(5Y,60){l 1C="";D(l i=0;i<60;i++){1C+=" "}q 5Y.C(/\\t/g,1C)},71:h(2C,4w){l az=2C.1P("\\n"),1C="\\t",40="";D(l i=0;i<50;i++){40+=" "}h 6I(3z,18,5X){q 3z.1Q(0,18)+40.1Q(0,5X)+3z.1Q(18+1,3z.v)};2C=p.B.4n(2C,h(2a){f(2a.1i(1C)==-1){q 2a}l 18=0;29((18=2a.1i(1C))!=-1){l 7r=4w-18%4w;2a=6I(2a,18,7r)}q 2a});q 2C},3G:h(z){l br=/|&1F;br\\s*\\/?&2o;/4x;f(p.M.8k==U){z=z.C(br,"\\n")}f(p.M.8l==U){z=z.C(br,"")}q z},33:h(z){q z.C(/\\s*$/g,"").C(/^\\s*/,"")},2D:h(z){l 21=p.B.3G(z).1P("\\n"),av=T 5V(),8a=/^\\s*/,1Z=ax;D(l i=0;i<21.v&&1Z>0;i++){l 3V=21[i];f(p.B.33(3V).v==0){1H}l 3W=8a.Q(3V);f(3W==u){q z}1Z=3J.1Z(3W[0].v,1Z)}f(1Z>0){D(l i=0;i<21.v;i++){21[i]=21[i].1Q(1Z)}}q 21.5u("\\n")},7d:h(2K,2O){f(2K.G<2O.G){q-1}F{f(2K.G>2O.G){q 1}F{f(2K.v<2O.v){q-1}F{f(2K.v>2O.v){q 1}}}}q 0},30:h(7S,2H){h 7R(4V,7Y){q[T p.4i(4V[0],4V.G,7Y.19)]};l au=0,5N=u,39=[],7Z=2H.4L?2H.4L:7R;29((5N=2H.3q.Q(7S))!=u){39=39.31(7Z(5N,2H))}q 39},7C:h(86){q 86.C(p.85.3p,h(m){q""+m+""})}},1I:h(88,4T){h 81(5j){l 59=[];D(l i=0;i<5j.v;i++){59.K(5j[i])}q 59};l 3g=4T?[4T]:81(L.82(p.M.83)),80="1x",2e=u;f(3g.v===0){q}D(l i=0;i<3g.v;i++){l 2G=3g[i],2l=p.B.84(2G.J),32;2l=p.B.5o(88,2l);32=2l["87"];f(32==u){1H}f(2l["2u-2c"]=="U"){2e=T p.4B(32)}F{l 4O=p.B.4l(32);f(4O){2e=T 4O()}F{1H}}2e.1I(2G[80],2l);l 2p=2e.A;f(p.M.6T){2p=L.1s("aA");2p.1U=2e.A.1x;2p.1n.1S="aB";2p.1n.2t="aK"}2G.7T.aJ(2p,2G)}},aL:h(7U){p.B.7Q(1q,"aM",h(){p.1I(7U)})}};p.4i=h(4j,7V,19){c.1U=4j;c.G=7V;c.v=4j.v;c.19=19};p.4i.Y.2r=h(){q c.1U};p.4B=h(4y){l 1J=p.B.4l(4y),4z=T p.2B.aN(),aH=u;f(1J==u){q}1J=T 1J();c.4E=4z;f(1J.3O==u){p.B.1v(p.M.1k.7X+4y);q}4z.5n.K({3q:1J.3O.I,4L:89});h 3a(4K,7W){D(l j=0;j<4K.v;j++){4K[j].G+=7W}};h 89(17,aC){l 8f=17.I,1L=[],4N=1J.5n,8e=17.G+17.E.v,2Z=1J.3O,1l;D(l i=0;i<4N.v;i++){1l=p.B.30(8f,4N[i]);3a(1l,8e);1L=1L.31(1l)}f(2Z.E!=u&&17.E!=u){1l=p.B.30(17.E,2Z.E);3a(1l,17.G);1L=1L.31(1l)}f(2Z.13!=u&&17.13!=u){1l=p.B.30(17.13,2Z.13);3a(1l,17.G+17[0].aE(17.13));1L=1L.31(1l)}q 1L}};p.4B.Y.1I=h(8h,8i){c.4E.1I(8h,8i);c.A=c.4E.A};p.8b=h(){};p.8b.Y={V:h(8c,8g){l 3Z=c.1A[8c];q p.B.8d(3Z==u?8g:3Z)},12:h(8j){q L.1s(8j)},72:h(38,7O){l 2w=[];f(38!=u){D(l i=0;i<38.v;i++){2w=2w.31(p.B.30(7O,38[i]))}}2w=2w.am(p.B.7d);q 2w},73:h(){l 26=c.2R;D(l i=0;i<26.v;i++){f(26[i]===u){1H}l 2x=26[i],45=2x.G+2x.v;D(l j=i+1;j<26.v&&26[i]!==u;j++){l 20=26[j];f(20===u){1H}F{f(20.G>45){2m}F{f(20.G==2x.G&&20.v>2x.v){c.2R[i]=u}F{f(20.G>=2x.G&&20.G<45){c.2R[j]=u}}}}}}},7m:h(2M){l 36=2M.1P(/\\n/g),3f=7b(c.V("79-2P")),7e=(3f+36.v).2r().v,7f=c.V("1I",[]);2M="";D(l i=0;i<36.v;i++){l 1r=36[i],2y=/^(&1X;|\\s)+/.Q(1r),5A="2P a3"+(i%2==0?1:2),7j=p.B.7a(3f+i,7e),7k=7f.1i((3f+i).2r())!=-1,1E=u;f(2y!=u){1E=2y[0].2r();1r=1r.1Q(1E.v);1E=1E.C(/&1X;/g," ");2y=p.1t.3k*1E.v}F{2y=0}1r=p.B.33(1r);f(1r.v==0){1r="&1X;"}f(7k){5A+=" a6"}2M+=""+""+7j+"."+"<1V 1e=\\"5B\\">"+(1E!=u?""+1E.C(/\\s/g,"&1X;")+"":"")+"<1V 1e=\\"7i\\" 1n=\\"5D-E: "+2y+"5x !78;\\">"+1r+""+""+""}q 2M},7l:h(5v,5r){l 18=0,3o="",3n=p.B.7g;D(l i=0;i<5r.v;i++){l 1N=5r[i];f(1N===u||1N.v===0){1H}3o+=3n(5v.1Q(18,1N.G-18),"7h")+3n(1N.1U,1N.19);18=1N.G+1N.v}3o+=3n(5v.1Q(18),"7h");q 3o},1I:h(1j,6Y){l a1=p.M,3l=p.1t,A,9Z,3i,a0="78";c.1A={};c.A=u;c.1m=u;c.I=u;c.1h=u;c.5I={};c.1g=p.B.5H("a8");3l.5K[c.1g]=c;f(1j===u){1j=""}f(3l.3k===u){3l.3k=p.B.5p()}c.1A=p.B.5o(p.77,6Y||{});f(c.V("6Z")==U){c.1A.1z=c.1A.4Z=N}c.A=A=c.12("3j");c.1m=c.12("3j");c.1m.J="1m";J="7P";A.1g=c.1g;f(c.V("56")){J+=" 51"}f(c.V("4Z")==N){J+=" ak"}f(c.V("4S-1m")==N){c.1m.J+=" al-4S"}J+=" "+c.V("1e-1f");A.J=J;c.4W=1j;c.I=p.B.6W(1j).C(/\\r/g," ");3i=c.V("1C-2A");c.I=c.V("6V-70")==U?p.B.71(c.I,3i):p.B.76(c.I,3i);c.I=p.B.2D(c.I);f(c.V("1z")){c.1h=c.12("3j");c.1h.J="1h";c.1h.1G(p.1z.12(c));A.1G(c.1h);l 1h=c.1h;h 5d(){1h.J=1h.J.C("75","")};A.ab=h(){5d();1h.J+=" 75"};A.ad=h(){5d()}}f(c.V("5f")){A.1G(p.B.74())}A.1G(c.1m);c.2R=c.72(c.5n,c.I);c.73();1j=c.7l(c.I,c.2R);1j=c.7m(p.B.33(1j));f(c.V("7G-7F")){1j=p.B.7C(1j)}c.1m.1x=1j},bn:h(z){z=z.C(/^\\s+|\\s+$/g,"").C(/\\s+/g,"\\\\b|\\\\b");q"\\\\b"+z+"\\\\b"},bl:h(2W){c.3O={E:{3q:2W.E,19:"2c"},13:{3q:2W.13,19:"2c"},I:T R("(?"+2W.E.1c+")"+"(?.*?)"+"(?<13>"+2W.13.1c+")","bv")}}};q p}()}f(!5V.1i){5V.Y.1i=h(7M,3R){3R=3J.bF(3R||0,0);D(l i=3R;i|[7B]{[^}]+})[\\S\\s]?|\\((?=\\?(?!#|<[\\w$]+>)))+|(\\()(?:\\?(?:(#)[^)]*\\)|<([$\\w]+)>))?|\\\\(?:k<([\\w$]+)>|[7B]{([^}]+)})|(\\[\\^?)|([\\S\\s])/g,by:/(?:[^$]+|\\$(?![1-9$&`\']|{[$\\w]+}))+|\\$(?:([1-9]\\d*|[$&`\'])|{([$\\w]+)})/g,3M:/^(?:\\s+|#.*)+/,5F:/^(?:[?*+]|{\\d+(?:,\\d*)?})/,7x:/&&\\[\\^?/g,7v:/]/g},7n=h(5l,5k,4X){D(l i=4X||0;i<5l.v;i++){f(5l[i]===5k){q i}}q-1},7y=/()??/.Q("")[1]!==3K,3w={};R=h(1d,1Y){f(1d 3T 11){f(1Y!==3K){3L 7N("4C\'t 4I bJ 7H aY 7J 11 4X aZ")}q 1d.3C()}l 1Y=1Y||"",7w=1Y.1i("s")>-1,6X=1Y.1i("x")>-1,5q=N,3u=[],14=[],W=1K.W,H,3D,3F,3E,3v;W.O=0;29(H=2z.Q.2n(W,1d)){f(H[2]){f(!1K.5F.1R(1d.15(W.O))){14.K("(?:)")}}F{f(H[1]){3u.K(H[3]||u);f(H[3]){5q=U}14.K("(")}F{f(H[4]){3E=7n(3u,H[4]);14.K(3E>-1?"\\\\"+(3E+1)+(55(1d.5J(W.O))?"":"(?:)"):H[0])}F{f(H[5]){14.K(3w.7t?3w.7t.7u(H[5],H[0].5J(1)==="P"):H[0])}F{f(H[6]){f(1d.5J(W.O)==="]"){14.K(H[6]==="["?"(?!)":"[\\\\S\\\\s]");W.O++}F{3D=R.7q("&&"+1d.15(H.G),1K.7x,1K.7v,"",{7s:"\\\\"})[0];14.K(H[6]+3D+"]");W.O+=3D.v+1}}F{f(H[7]){f(7w&&H[7]==="."){14.K("[\\\\S\\\\s]")}F{f(6X&&1K.3M.1R(H[7])){3F=2z.Q.2n(1K.3M,1d.15(W.O-1))[0].v;f(!1K.5F.1R(1d.15(W.O-1+3F))){14.K("(?:)")}W.O+=3F-1}F{14.K(H[7])}}}F{14.K(H[0])}}}}}}}3v=11(14.5u(""),2z.C.2n(1Y,/[8y]+/g,""));3v.1u={1c:1d,2j:5q?3u:u};q 3v};R.8B=h(1f,o){3w[1f]=o};11.Y.Q=h(z){l 1b=2z.Q.2n(c,z),1f,i,5C;f(1b){f(7y&&1b.v>1){5C=T 11("^"+c.1c+"$(?!\\\\s)",c.4a());2z.C.2n(1b[0],5C,h(){D(i=1;i<7z.v-2;i++){f(7z[i]===3K){1b[i]=3K}}})}f(c.1u&&c.1u.2j){D(i=1;i<1b.v;i++){1f=c.1u.2j[i-1];f(1f){1b[1f]=1b[i]}}}f(c.3A&&c.O>(1b.G+1b[0].v)){c.O--}}q 1b}})()}11.Y.4a=h(){q(c.3A?"g":"")+(c.8M?"i":"")+(c.7D?"m":"")+(c.3M?"x":"")+(c.8Y?"y":"")};11.Y.3C=h(7o){l 4g=T R(c.1c,(7o||"")+c.4a());f(c.1u){4g.1u={1c:c.1u.1c,2j:c.1u.2j?c.1u.2j.15(0):u}}q 4g};11.Y.2n=h(90,z){q c.Q(z)};11.Y.8W=h(8U,7p){q c.Q(7p[0])};R.47=h(4f,4e){l 46="/"+4f+"/"+(4e||"");q R.47[46]||(R.47[46]=T R(4f,4e))};R.3t=h(z){q z.C(/[-[\\]{}()*+?.\\\\^$|,#\\s]/g,"\\\\$&")};R.7q=h(z,E,Z,1a,2T){l 2T=2T||{},2X=2T.7s,X=2T.8A,1a=1a||"",4s=1a.1i("g")>-1,7E=1a.1i("i")>-1,7L=1a.1i("m")>-1,4t=1a.1i("y")>-1,1a=1a.C(/y/g,""),E=E 3T 11?(E.3A?E:E.3C("g")):T R(E,"g"+1a),Z=Z 3T 11?(Z.3A?Z:Z.3C("g")):T R(Z,"g"+1a),1D=[],2b=0,1o=0,1p=0,1y=0,27,22,1w,1B,3I,4m;f(2X){f(2X.v>1){3L 8n("4C\'t 4I 8q 8z 7J 3t 7I")}f(7L){3L 7N("4C\'t 4I 3t 7I 7H 9U 9D 7D 9C")}3I=R.3t(2X);4m=T 11("^(?:"+3I+"[\\\\S\\\\s]|(?:(?!"+E.1c+"|"+Z.1c+")[^"+3I+"])+)+",7E?"i":"")}29(U){E.O=Z.O=1p+(2X?(4m.Q(z.15(1p))||[""])[0].v:0);1w=E.Q(z);1B=Z.Q(z);f(1w&&1B){f(1w.G<=1B.G){1B=u}F{1w=u}}f(1w||1B){1o=(1w||1B).G;1p=(1w?E:Z).O}F{f(!2b){2m}}f(4t&&!2b&&1o>1y){2m}f(1w){f(!2b++){27=1o;22=1p}}F{f(1B&&2b){f(!--2b){f(X){f(X[0]&&27>1y){1D.K([X[0],z.15(1y,27),1y,27])}f(X[1]){1D.K([X[1],z.15(27,22),27,22])}f(X[2]){1D.K([X[2],z.15(22,1o),22,1o])}f(X[3]){1D.K([X[3],z.15(1o,1p),1o,1p])}}F{1D.K(z.15(22,1o))}1y=1p;f(!4s){2m}}}F{E.O=Z.O=0;3L 9q("9A 9i 9a 9d 8u")}}f(1o===1p){1p++}}f(4s&&!4t&&X&&X[0]&&z.v>1y){1D.K([X[0],z.15(1y),1y,z.v])}E.O=Z.O=0;q 1D};',62,728,'||||||||||||this|||if||function||||var||||sh|return||||null|length||||str|div|utils|replace|for|left|else|index|_10f|code|className|push|document|config|false|lastIndex||exec|XRegExp||new|true|getParam|part|vN|prototype|_127||RegExp|create|right|_10d|slice||_c4|pos|css|_128|_117|source|_107|class|name|id|bar|indexOf|_f0|strings|_cb|lines|style|_132|_133|window|_e3|createElement|vars|_x|alert|_137|innerHTML|_134|toolbar|params|_138|tab|_130|_e8|lt|appendChild|continue|highlight|_be|lib|_c7|obj|_ef|doc|split|substr|test|width|_4b|value|span|_3c|nbsp|_108|min|_dc|_98|_136|in|_57|_56|_d7|_135|_8|while|_91|_131|script|text|_b2|_6e|http|execute|wnd|captureNames|_5b|_b5|break|call|gt|_b8|href|toString|_75|height|html|attributes|_d5|_d9|_e4|_fe|size|brushes|_88|unindent|SyntaxHighlighter|_40|_b4|_a2|_7a|_51|m1|body|_dd|case|m2|line|_80|matches|_28|_129|_62|_81|_fa|_12a|_5|_ca|getMatches|concat|_b6|trim|print|_7c|_de|_5e|_d3|_a7|offsetMatches|_5c|_76|_6a|_65|_df|_b0|write|_f6|DIV|spaceWidth|_f3|_4a|_ed|_ec|url|regex|_7d|_2|escape|_10c|_113|_106|_7b|_3|_8e|global|title|addFlags|cc|_112|len|fixInputString|_32|_139|Math|undefined|throw|extended|font|htmlScript|printFrame|_22|_fc|_25|instanceof|_17|_9d|_9e|_18|expandSource|_d1|_8c|viewSource|_1a|top|_4f|_da|key|cache|_10|win|getNativeFlags|_19|_50|focus|_122|_121|_11c|_b|Match|_ba|gm|findBrush|esc|eachLine|_4|_6c|values|_73|_12c|_12f|_6b|color|_89|gi|_bd|_bf|_9|HtmlScript|can|discoveredBrushes|xmlBrush|_f|_5d|_82|supply|_7|_c1|func|_59|_c8|_b7|_e|_d|pre|wrap|_ac|com|_a3|originalCode|from|link|gutter||collapsed|clipboardSwf|_37|popup|isNaN|collapse|_blank|_38|_ae|removeChild|String|contentWindow|hide|_24|ruler|swf|_30|_7e|_ad|item|_101|_2f|regexList|merge|measureSpace|_10b|_ea|_2a|_2c|join|_e9|_2e|px|_2b|_4c|_e5|content|r2|margin|_29|quantifier|_49|guid|toolbarCommands|charAt|highlighters|_27|highlighterId|_a6|close|toolbarItemWidth|_2d|_48|toolbarItemHeight|_35|copyToClipboard|Array|userAgent|_90|_84|navigator|_85|_78|_79|_83|_3f|items|_1e|_16|_13|_12|shockwave|flash|clipboardData|_36|object|version|_15|_14|center|alexgorbatchev|align|head|org|2009|_6|executeCommand|commandName|_a|createButton|copyToClipboardConfirmation|message|w3|event|_4e|screen|switch|attachEvent|_5a|_66|www|_61|noBrush|_47|aboutDialog|insertSpaces|copyStyles|500px|0px|_3e|type|scrollbars|help|stylesheet|rel|_6d|debug|DTD|smart|trimFirstAndLastLines|_10a|_f1|light|tabs|processSmartTabs|findMatches|removeNestedMatches|createRuler|show|processTabs|defaults|important|first|padNumber|parseInt|xhtml1|matchesSortCallback|_e0|_e1|decorate|plain|block|_e6|_e7|processMatches|createDisplayLines|_100|_11b|args|matchRecursive|_93|escapeChar|unicode|get|classRight|_109|classLeft|_105|arguments|clipboard|pP|processUrls|multiline|_12d|links|auto|when|character|one|match|_12e|_fb|TypeError|_d4|syntaxhighlighter|addEvent|defaultAdd|_a1|parentNode|_b9|_bb|_c2|brushNotHtmlScript|_a4|_a8|_b1|toArray|getElementsByTagName|tagName|parseParams|regexLib|_a9|brush|_ab|process|_9a|Highlighter|_cf|toBoolean|_c9|_c6|_d0|_cd|_ce|_d2|bloggerMode|stripBrs|catch|SyntaxError|now|Can|more|xhtml|utf|onclick|delimiters|wasn|your|family|sx|than|valueNames|addPlugin|About|try|charset|_26|400|750|find|_21|location|Type|ignoreCase|menubar|resizable|Content|_20|_1f|param|meta|_11f|Brush|apply|_1b|sticky|Geneva|_11d|_1c|equiv|to|syntax|highlighter|JavaScript|expand|none|3em|contains|view|Alex|unbalanced|2004|Copyright|decoration|0099FF|data|320|4em|bottom|75em|May|large|xx|Error|target|03|Gorbatchev|multiLineCComments|aspScriptTags|scriptScriptTags|phpScriptTags|Arial|multiLineSingleQuotedString|subject|The|flag|the|is|string|typeof|Helvetica|sans|000|fff|1em|singleLinePerlComments|singleLineCComments|copy|doubleQuotedString|serif|multiLineDoubleQuotedString|background|singleQuotedString|using|W3C|random|1000000|round|_f5|_f7|_f2|spaces|alt|transitional|open|highlighted|number|highlighter_|250|shCore|onmouseover|toLowerCase|onmouseout|printing|about|_42|_44|500|_43|nogutter|no|sort|on|getComputedStyle|getPropertyValue|opera|getElementById|1999|offsetWidth|_a5|_99|dtd|1000|xmlns|_8a|textarea|70em|_c5|150|lastIndexOf|aliases|addEventListener|_c0|middot|replaceChild|30em|all|load|Xml|absolute|position|444553540000|codebase|96b8|11cf|ae6d|PUBLIC|download|cabs|constructing|another|pub|macromedia|d27cdb6e|clsid|always|wmode|allowScriptAccess|application|_clipboard|transparent|flashVars|msie|classid|menu|DOCTYPE|option|swflash|cab|TR|error|ok|forHtmlScript|setData|getKeywords|printSource|IFRAME|cssText||_3b|_3a|_39|sgi|amp|Transitional|replaceVar|XHTML|embed|movie|src|configured|command|max|_34|_33|EN|flags'.split('|'),0,{})) +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[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}('f(!1q.2E){l 2E=h(){l p={77:{"1e-1f":"","79-2P":1,"1I":u,"6V-70":U,"1C-2A":4,"5f":N,"4Z":U,"1z":U,"56":N,"7G-7F":U,"6Z":N,"4S-1m":U},M:{52:u,5P:16,5S:16,8k:N,8l:N,83:"4R",1k:{3Y:"97 1c",41:"9b 1c",5U:"9O 93 7A",6t:"9B I 9E 23 8w 7A 8o",34:"34",6P:"?",1v:"2E\\n\\n",6F:"8p\'t 8I 87 D: ",7X:"8V 8v\'t bD D 2u-2c bf: ",6H:"<2u ay=\\"2g://6D.6v.6m/as/8r\\"><6l><8T 2g-92=\\"8P-8L\\" 5B=\\"2d/2u; 8E=8s-8\\" /><3B>8C 2E<2L 1n=\\"3N-8x:8Z,9y,9H,9I-9Q;9S-4v:#9K;4v:#9J;3N-2A:9L;2d-6k:6i;\\">2E6f 2.0.9j (9n 9s 6n)2g://6j.4U96 I 94 95.9f 9e-6n 9c 9t."},6T:N},1t:{4D:u,3k:u,3P:u,5K:{}},2B:{},85:{9u:/\\/\\*[\\s\\S]*?\\*\\//4k,9N:/\\/\\/.*$/4k,9M:/#.*$/4k,9P:/"(?:\\.|(\\\\\\")|[^\\""\\n])*"/g,9T:/\'(?:\\.|(\\\\\\\')|[^\\\'\'\\n])*\'/g,9R:/"(?:\\.|(\\\\\\")|[^\\""])*"/g,9z:/\'(?:\\.|(\\\\\\\')|[^\\\'\'])*\'/g,3p:/\\w+:\\/\\/[\\w-.\\/?%&=]*/g,9x:{E:/(&1F;|<)\\?=?/g,13:/\\?(&2o;|>)/g},9v:{E:/(&1F;|<)%=?/g,13:/%(&2o;|>)/g},9w:{E:/(&1F;|<)\\s*2c.*?(&2o;|>)/4x,13:/(&1F;|<)\\/\\s*2c\\s*(&2o;|>)/4x}},1z:{12:h(3s){l 3y=L.1s("3j"),4o=p.1z.65;3y.J="1z";D(l 2Y 23 4o){l 6o=4o[2Y],4J=T 6o(3s),28=4J.12();3s.5I[2Y]=4J;f(28==u){1H}f(9G(28)=="9F"){28=p.1z.6s(28,3s.1g,2Y)}28.J+="5k "+2Y;3y.1G(28)}q 3y},6s:h(4A,6r,4h){l a=L.1s("a"),4Q=a.1n,4P=p.M,4F=4P.5P,48=4P.5S;a.2q="#"+4h;a.3B=4A;a.5M=6r;a.6q=4h;a.1x=4A;f(55(4F)==N){4Q.1S=4F+"5x"}f(55(48)==N){4Q.2t=48+"5x"}a.8t=h(e){8D{p.1z.6p(c,e||1q.6w,c.5M,c.6q)}8m(e){p.B.1v(e.6u)}q N};q a},6p:h(69,68,6h,6g,67){l 3U=p.1t.5K[6h],3X;f(3U==u||(3X=3U.5I[6g])==u){q u}q 3X.2h(69,68,67)},65:{3Y:h(4b){c.12=h(){f(4b.V("56")!=U){q}q p.M.1k.3Y};c.2h=h(42,8X,91){l A=4b.A;42.7T.5a(42);A.J=A.J.C("51","")}},41:h(66){c.12=h(){q p.M.1k.41};c.2h=h(8R,8Q,8J){l 3Q=p.B.3G(66.4W).C(/"+3Q+"");2i.L.5O()}},5U:h(5e){l 3S,8F,5L=5e.1g;c.12=h(){l 2S=p.M;f(2S.52==u){q u}h 1A(5E){l 5s="";D(l 5y 23 5E){5s+="<8S 1f=\'"+5y+"\' 1U=\'"+5E[5y]+"\'/>"}q 5s};h 2v(5t){l 5Q="";D(l 5w 23 5t){5Q+=" "+5w+"=\'"+5t[5w]+"\'"}q 5Q};l 5m={1S:2S.5P,2t:2S.5S,1g:5L+"b8",6N:"b7/x-6a-6b",3B:p.M.1k.5U},5h={b6:"b4",b5:"b9",ba:"5M="+5L,bd:"N"},5g=2S.52,3H;f(/bb/i.1R(5Z.5W)){3H="<6e"+2v({bc:"b3:b2-aU-aT-aS-aQ",aR:"2g://aW.b1.4U/b0/6a/aX/6b/bg.bh#6f=9,0,0,0"})+2v(5m)+">"+1A(5h)+1A({bB:5g})+""}F{3H=""}3S=L.1s("A");3S.1x=3H;q 3S};c.2h=h(bH,bG,5T){l 6d=5T.bE;6z(6d){2N"7u":l 53=p.B.2D(p.B.3G(5e.4W).C(/&1F;/g,"<").C(/&2o;/g,">").C(/&bw;/g,"&"));f(1q.6c){1q.6c.bm("2d",53)}F{q p.B.2D(53)}2N"bk":p.B.1v(p.M.1k.6t);2m;2N"bj":p.B.1v(5T.6u);2m}}},bo:h(58){c.12=h(){q p.M.1k.34};c.2h=h(bu,bt,bs){l 1W=L.1s("bp"),1O=u;f(p.1t.3P!=u){L.2L.5a(p.1t.3P)}p.1t.3P=1W;1W.1n.bq="aP:aO;1S:6L;2t:6L;E:-6K;43:-6K;";L.2L.1G(1W);1O=1W.5c.L;6J(1O,1q.L);1O.3h(""+58.A.1x+"");1O.5O();1W.5c.4d();1W.5c.34();h 6J(6M,64){l 2F=64.82("4Y");D(l i=0;i<2F.v;i++){f(2F[i].6R.ac()=="6Q"&&/aa\\.19$/.1R(2F[i].2q)){6M.3h("<4Y 6N=\\"2d/19\\" 6R=\\"6Q\\" 2q=\\""+2F[i].2q+"\\">")}}}}},af:h(ag){c.12=h(){q p.M.1k.6P};c.2h=h(aj,ah){l 2i=p.B.54("","57",ai,a9,"6O=0"),1O=2i.L;1O.3h(p.M.1k.6H);1O.5O();2i.4d()}}}},B:{5H:h(6G){q 6G+3J.9Y(3J.9W()*9X).2r()},5o:h(5R,5G){l 3m={},1T;D(1T 23 5R){3m[1T]=5R[1T]}D(1T 23 5G){3m[1T]=5G[1T]}q 3m},8d:h(5z){6z(5z){2N"U":q U;2N"N":q N}q 5z},54:h(3p,6x,44,4c,2J){l x=(6y.1S-44)/2,y=(6y.2t-4c)/2;2J+=", E="+x+", 43="+y+", 1S="+44+", 2t="+4c;2J=2J.C(/^,/,"");l 49=1q.a5(3p,6x,2J);49.4d();q 49},7Q:h(1M,25,24){f(1M.6A){1M["e"+25+24]=24;1M[25+24]=h(){1M["e"+25+24](1q.6w)};1M.6A("an"+25,1M[25+24])}F{1M.aG(25,24,N)}},1v:h(z){1v(p.M.1k.1v+z)},4l:h(4M,6B){l 2k=p.1t.4D,3b=u;f(2k==u){2k={};D(l 4G 23 p.2B){l 37=p.2B[4G].aF;f(37==u){1H}D(l i=0;i<37.v;i++){2k[37[i]]=4G}}p.1t.4D=2k}3b=p.2B[2k[4M]];f(3b==u&&6B!=N){p.B.1v(p.M.1k.6F+4M)}q 3b},4n:h(z,6E){l 2U=z.1P("\\n");D(l i=0;i<2U.v;i++){2U[i]=6E(2U[i])}q 2U.5u("\\n")},74:h(){l A=L.1s("A"),3e=L.1s("A"),6C=10,i=1;29(i<=aD){f(i%6C===0){A.1x+=i;i+=(i+"").v}F{A.1x+="&aI;";i++}}3e.J="5f 2P";3e.1G(A);q 3e},6W:h(z){q z.C(/^[ ]*[\\n]+|[\\n]*[ ]*$/g,"")},84:h(z){l 3d,4u={},4p=T R("^\\\\[(?<4q>(.*?))\\\\]$"),6S=T R("(?<1f>[\\\\w-]+)"+"\\\\s*:\\\\s*"+"(?<1U>"+"[\\\\w-%#]+|"+"\\\\[.*?\\\\]|"+"\\".*?\\"|"+"\'.*?\'"+")\\\\s*;?","g");29((3d=6S.Q(z))!=u){l 2f=3d.1U.C(/^[\'"]|[\'"]$/g,"");f(2f!=u&&4p.1R(2f)){l m=4p.Q(2f);2f=m.4q.v>0?m.4q.1P(/\\s*,\\s*/):[]}4u[3d.1f]=2f}q 4u},7g:h(z,19){f(z==u||z.v==0||z=="\\n"){q z}z=z.C(/"+2s+""})}q z},7a:h(61,62){l 2I=61.2r();29(2I.v<62){2I="0"+2I}q 2I},5p:h(){l 3x=L.1s("A"),35,3r=0,5i=L.2L,1g=p.B.5H("5p"),2Q="",4H="";3x.1x=2Q+"7P\\">"+2Q+"1m\\">"+2Q+"2P\\">"+2Q+"5B"+"\\"><1V 1e=\\"7i\\"><1V 1g=\\""+1g+"\\">&1X;"+4H+4H+2V+2V+2V+2V;5i.1G(3x);35=L.ar(1g);f(/aq/i.1R(5Z.5W)){l 63=1q.ao(35,u);3r=7b(63.ap("1S"))}F{3r=35.at}5i.5a(3x);q 3r},76:h(5Y,60){l 1C="";D(l i=0;i<60;i++){1C+=" "}q 5Y.C(/\\t/g,1C)},71:h(2C,4w){l az=2C.1P("\\n"),1C="\\t",40="";D(l i=0;i<50;i++){40+=" "}h 6I(3z,18,5X){q 3z.1Q(0,18)+40.1Q(0,5X)+3z.1Q(18+1,3z.v)};2C=p.B.4n(2C,h(2a){f(2a.1i(1C)==-1){q 2a}l 18=0;29((18=2a.1i(1C))!=-1){l 7r=4w-18%4w;2a=6I(2a,18,7r)}q 2a});q 2C},3G:h(z){l br=/|&1F;br\\s*\\/?&2o;/4x;f(p.M.8k==U){z=z.C(br,"\\n")}f(p.M.8l==U){z=z.C(br,"")}q z},33:h(z){q z.C(/\\s*$/g,"").C(/^\\s*/,"")},2D:h(z){l 21=p.B.3G(z).1P("\\n"),av=T 5V(),8a=/^\\s*/,1Z=ax;D(l i=0;i<21.v&&1Z>0;i++){l 3V=21[i];f(p.B.33(3V).v==0){1H}l 3W=8a.Q(3V);f(3W==u){q z}1Z=3J.1Z(3W[0].v,1Z)}f(1Z>0){D(l i=0;i<21.v;i++){21[i]=21[i].1Q(1Z)}}q 21.5u("\\n")},7d:h(2K,2O){f(2K.G<2O.G){q-1}F{f(2K.G>2O.G){q 1}F{f(2K.v<2O.v){q-1}F{f(2K.v>2O.v){q 1}}}}q 0},30:h(7S,2H){h 7R(4V,7Y){q[T p.4i(4V[0],4V.G,7Y.19)]};l au=0,5N=u,39=[],7Z=2H.4L?2H.4L:7R;29((5N=2H.3q.Q(7S))!=u){39=39.31(7Z(5N,2H))}q 39},7C:h(86){q 86.C(p.85.3p,h(m){q""+m+""})}},1I:h(88,4T){h 81(5j){l 59=[];D(l i=0;i<5j.v;i++){59.K(5j[i])}q 59};l 3g=4T?[4T]:81(L.82(p.M.83)),80="1x",2e=u;f(3g.v===0){q}D(l i=0;i<3g.v;i++){l 2G=3g[i],2l=p.B.84(2G.J),32;2l=p.B.5o(88,2l);32=2l["87"];f(32==u){1H}f(2l["2u-2c"]=="U"){2e=T p.4B(32)}F{l 4O=p.B.4l(32);f(4O){2e=T 4O()}F{1H}}2e.1I(2G[80],2l);l 2p=2e.A;f(p.M.6T){2p=L.1s("aA");2p.1U=2e.A.1x;2p.1n.1S="aB";2p.1n.2t="aK"}2G.7T.aJ(2p,2G)}},aL:h(7U){p.B.7Q(1q,"aM",h(){p.1I(7U)})}};p.4i=h(4j,7V,19){c.1U=4j;c.G=7V;c.v=4j.v;c.19=19};p.4i.Y.2r=h(){q c.1U};p.4B=h(4y){l 1J=p.B.4l(4y),4z=T p.2B.aN(),aH=u;f(1J==u){q}1J=T 1J();c.4E=4z;f(1J.3O==u){p.B.1v(p.M.1k.7X+4y);q}4z.5n.K({3q:1J.3O.I,4L:89});h 3a(4K,7W){D(l j=0;j<4K.v;j++){4K[j].G+=7W}};h 89(17,aC){l 8f=17.I,1L=[],4N=1J.5n,8e=17.G+17.E.v,2Z=1J.3O,1l;D(l i=0;i<4N.v;i++){1l=p.B.30(8f,4N[i]);3a(1l,8e);1L=1L.31(1l)}f(2Z.E!=u&&17.E!=u){1l=p.B.30(17.E,2Z.E);3a(1l,17.G);1L=1L.31(1l)}f(2Z.13!=u&&17.13!=u){1l=p.B.30(17.13,2Z.13);3a(1l,17.G+17[0].aE(17.13));1L=1L.31(1l)}q 1L}};p.4B.Y.1I=h(8h,8i){c.4E.1I(8h,8i);c.A=c.4E.A};p.8b=h(){};p.8b.Y={V:h(8c,8g){l 3Z=c.1A[8c];q p.B.8d(3Z==u?8g:3Z)},12:h(8j){q L.1s(8j)},72:h(38,7O){l 2w=[];f(38!=u){D(l i=0;i<38.v;i++){2w=2w.31(p.B.30(7O,38[i]))}}2w=2w.am(p.B.7d);q 2w},73:h(){l 26=c.2R;D(l i=0;i<26.v;i++){f(26[i]===u){1H}l 2x=26[i],45=2x.G+2x.v;D(l j=i+1;j<26.v&&26[i]!==u;j++){l 20=26[j];f(20===u){1H}F{f(20.G>45){2m}F{f(20.G==2x.G&&20.v>2x.v){c.2R[i]=u}F{f(20.G>=2x.G&&20.G<45){c.2R[j]=u}}}}}}},7m:h(2M){l 36=2M.1P(/\\n/g),3f=7b(c.V("79-2P")),7e=(3f+36.v).2r().v,7f=c.V("1I",[]);2M="";D(l i=0;i<36.v;i++){l 1r=36[i],2y=/^(&1X;|\\s)+/.Q(1r),5A="2P a3"+(i%2==0?1:2),7j=p.B.7a(3f+i,7e),7k=7f.1i((3f+i).2r())!=-1,1E=u;f(2y!=u){1E=2y[0].2r();1r=1r.1Q(1E.v);1E=1E.C(/&1X;/g," ");2y=p.1t.3k*1E.v}F{2y=0}1r=p.B.33(1r);f(1r.v==0){1r="&1X;"}f(7k){5A+=" a6"}2M+=""+""+7j+"."+"<1V 1e=\\"5B\\">"+(1E!=u?""+1E.C(/\\s/g,"&1X;")+"":"")+"<1V 1e=\\"7i\\" 1n=\\"5D-E: "+2y+"5x !78;\\">"+1r+""+""+""}q 2M},7l:h(5v,5r){l 18=0,3o="",3n=p.B.7g;D(l i=0;i<5r.v;i++){l 1N=5r[i];f(1N===u||1N.v===0){1H}3o+=3n(5v.1Q(18,1N.G-18),"7h")+3n(1N.1U,1N.19);18=1N.G+1N.v}3o+=3n(5v.1Q(18),"7h");q 3o},1I:h(1j,6Y){l a1=p.M,3l=p.1t,A,9Z,3i,a0="78";c.1A={};c.A=u;c.1m=u;c.I=u;c.1h=u;c.5I={};c.1g=p.B.5H("a8");3l.5K[c.1g]=c;f(1j===u){1j=""}f(3l.3k===u){3l.3k=p.B.5p()}c.1A=p.B.5o(p.77,6Y||{});f(c.V("6Z")==U){c.1A.1z=c.1A.4Z=N}c.A=A=c.12("3j");c.1m=c.12("3j");c.1m.J="1m";J="7P";A.1g=c.1g;f(c.V("56")){J+=" 51"}f(c.V("4Z")==N){J+=" ak"}f(c.V("4S-1m")==N){c.1m.J+=" al-4S"}J+=" "+c.V("1e-1f");A.J=J;c.4W=1j;c.I=p.B.6W(1j).C(/\\r/g," ");3i=c.V("1C-2A");c.I=c.V("6V-70")==U?p.B.71(c.I,3i):p.B.76(c.I,3i);c.I=p.B.2D(c.I);f(c.V("1z")){c.1h=c.12("3j");c.1h.J="1h";c.1h.1G(p.1z.12(c));A.1G(c.1h);l 1h=c.1h;h 5d(){1h.J=1h.J.C("75","")};A.ab=h(){5d();1h.J+=" 75"};A.ad=h(){5d()}}f(c.V("5f")){A.1G(p.B.74())}A.1G(c.1m);c.2R=c.72(c.5n,c.I);c.73();1j=c.7l(c.I,c.2R);1j=c.7m(p.B.33(1j));f(c.V("7G-7F")){1j=p.B.7C(1j)}c.1m.1x=1j},bn:h(z){z=z.C(/^\\s+|\\s+$/g,"").C(/\\s+/g,"\\\\b|\\\\b");q"\\\\b"+z+"\\\\b"},bl:h(2W){c.3O={E:{3q:2W.E,19:"2c"},13:{3q:2W.13,19:"2c"},I:T R("(?"+2W.E.1c+")"+"(?.*?)"+"(?<13>"+2W.13.1c+")","bv")}}};q p}()}f(!5V.1i){5V.Y.1i=h(7M,3R){3R=3J.bF(3R||0,0);D(l i=3R;i|[7B]{[^}]+})[\\S\\s]?|\\((?=\\?(?!#|<[\\w$]+>)))+|(\\()(?:\\?(?:(#)[^)]*\\)|<([$\\w]+)>))?|\\\\(?:k<([\\w$]+)>|[7B]{([^}]+)})|(\\[\\^?)|([\\S\\s])/g,by:/(?:[^$]+|\\$(?![1-9$&`\']|{[$\\w]+}))+|\\$(?:([1-9]\\d*|[$&`\'])|{([$\\w]+)})/g,3M:/^(?:\\s+|#.*)+/,5F:/^(?:[?*+]|{\\d+(?:,\\d*)?})/,7x:/&&\\[\\^?/g,7v:/]/g},7n=h(5l,5k,4X){D(l i=4X||0;i<5l.v;i++){f(5l[i]===5k){q i}}q-1},7y=/()??/.Q("")[1]!==3K,3w={};R=h(1d,1Y){f(1d 3T 11){f(1Y!==3K){3L 7N("4C\'t 4I bJ 7H aY 7J 11 4X aZ")}q 1d.3C()}l 1Y=1Y||"",7w=1Y.1i("s")>-1,6X=1Y.1i("x")>-1,5q=N,3u=[],14=[],W=1K.W,H,3D,3F,3E,3v;W.O=0;29(H=2z.Q.2n(W,1d)){f(H[2]){f(!1K.5F.1R(1d.15(W.O))){14.K("(?:)")}}F{f(H[1]){3u.K(H[3]||u);f(H[3]){5q=U}14.K("(")}F{f(H[4]){3E=7n(3u,H[4]);14.K(3E>-1?"\\\\"+(3E+1)+(55(1d.5J(W.O))?"":"(?:)"):H[0])}F{f(H[5]){14.K(3w.7t?3w.7t.7u(H[5],H[0].5J(1)==="P"):H[0])}F{f(H[6]){f(1d.5J(W.O)==="]"){14.K(H[6]==="["?"(?!)":"[\\\\S\\\\s]");W.O++}F{3D=R.7q("&&"+1d.15(H.G),1K.7x,1K.7v,"",{7s:"\\\\"})[0];14.K(H[6]+3D+"]");W.O+=3D.v+1}}F{f(H[7]){f(7w&&H[7]==="."){14.K("[\\\\S\\\\s]")}F{f(6X&&1K.3M.1R(H[7])){3F=2z.Q.2n(1K.3M,1d.15(W.O-1))[0].v;f(!1K.5F.1R(1d.15(W.O-1+3F))){14.K("(?:)")}W.O+=3F-1}F{14.K(H[7])}}}F{14.K(H[0])}}}}}}}3v=11(14.5u(""),2z.C.2n(1Y,/[8y]+/g,""));3v.1u={1c:1d,2j:5q?3u:u};q 3v};R.8B=h(1f,o){3w[1f]=o};11.Y.Q=h(z){l 1b=2z.Q.2n(c,z),1f,i,5C;f(1b){f(7y&&1b.v>1){5C=T 11("^"+c.1c+"$(?!\\\\s)",c.4a());2z.C.2n(1b[0],5C,h(){D(i=1;i<7z.v-2;i++){f(7z[i]===3K){1b[i]=3K}}})}f(c.1u&&c.1u.2j){D(i=1;i<1b.v;i++){1f=c.1u.2j[i-1];f(1f){1b[1f]=1b[i]}}}f(c.3A&&c.O>(1b.G+1b[0].v)){c.O--}}q 1b}})()}11.Y.4a=h(){q(c.3A?"g":"")+(c.8M?"i":"")+(c.7D?"m":"")+(c.3M?"x":"")+(c.8Y?"y":"")};11.Y.3C=h(7o){l 4g=T R(c.1c,(7o||"")+c.4a());f(c.1u){4g.1u={1c:c.1u.1c,2j:c.1u.2j?c.1u.2j.15(0):u}}q 4g};11.Y.2n=h(90,z){q c.Q(z)};11.Y.8W=h(8U,7p){q c.Q(7p[0])};R.47=h(4f,4e){l 46="/"+4f+"/"+(4e||"");q R.47[46]||(R.47[46]=T R(4f,4e))};R.3t=h(z){q z.C(/[-[\\]{}()*+?.\\\\^$|,#\\s]/g,"\\\\$&")};R.7q=h(z,E,Z,1a,2T){l 2T=2T||{},2X=2T.7s,X=2T.8A,1a=1a||"",4s=1a.1i("g")>-1,7E=1a.1i("i")>-1,7L=1a.1i("m")>-1,4t=1a.1i("y")>-1,1a=1a.C(/y/g,""),E=E 3T 11?(E.3A?E:E.3C("g")):T R(E,"g"+1a),Z=Z 3T 11?(Z.3A?Z:Z.3C("g")):T R(Z,"g"+1a),1D=[],2b=0,1o=0,1p=0,1y=0,27,22,1w,1B,3I,4m;f(2X){f(2X.v>1){3L 8n("4C\'t 4I 8q 8z 7J 3t 7I")}f(7L){3L 7N("4C\'t 4I 3t 7I 7H 9U 9D 7D 9C")}3I=R.3t(2X);4m=T 11("^(?:"+3I+"[\\\\S\\\\s]|(?:(?!"+E.1c+"|"+Z.1c+")[^"+3I+"])+)+",7E?"i":"")}29(U){E.O=Z.O=1p+(2X?(4m.Q(z.15(1p))||[""])[0].v:0);1w=E.Q(z);1B=Z.Q(z);f(1w&&1B){f(1w.G<=1B.G){1B=u}F{1w=u}}f(1w||1B){1o=(1w||1B).G;1p=(1w?E:Z).O}F{f(!2b){2m}}f(4t&&!2b&&1o>1y){2m}f(1w){f(!2b++){27=1o;22=1p}}F{f(1B&&2b){f(!--2b){f(X){f(X[0]&&27>1y){1D.K([X[0],z.15(1y,27),1y,27])}f(X[1]){1D.K([X[1],z.15(27,22),27,22])}f(X[2]){1D.K([X[2],z.15(22,1o),22,1o])}f(X[3]){1D.K([X[3],z.15(1o,1p),1o,1p])}}F{1D.K(z.15(22,1o))}1y=1p;f(!4s){2m}}}F{E.O=Z.O=0;3L 9q("9A 9i 9a 9d 8u")}}f(1o===1p){1p++}}f(4s&&!4t&&X&&X[0]&&z.v>1y){1D.K([X[0],z.15(1y),1y,z.v])}E.O=Z.O=0;q 1D};',62,728,'||||||||||||this|||if||function||||var||||sh|return||||null|length||||str|div|utils|replace|for|left|else|index|_10f|code|className|push|document|config|false|lastIndex||exec|XRegExp||new|true|getParam|part|vN|prototype|_127||RegExp|create|right|_10d|slice||_c4|pos|css|_128|_117|source|_107|class|name|id|bar|indexOf|_f0|strings|_cb|lines|style|_132|_133|window|_e3|createElement|vars|_x|alert|_137|innerHTML|_134|toolbar|params|_138|tab|_130|_e8|lt|appendChild|continue|highlight|_be|lib|_c7|obj|_ef|doc|split|substr|test|width|_4b|value|span|_3c|nbsp|_108|min|_dc|_98|_136|in|_57|_56|_d7|_135|_8|while|_91|_131|script|text|_b2|_6e|http|execute|wnd|captureNames|_5b|_b5|break|call|gt|_b8|href|toString|_75|height|html|attributes|_d5|_d9|_e4|_fe|size|brushes|_88|unindent|SyntaxHighlighter|_40|_b4|_a2|_7a|_51|m1|body|_dd|case|m2|line|_80|matches|_28|_129|_62|_81|_fa|_12a|_5|_ca|getMatches|concat|_b6|trim|print|_7c|_de|_5e|_d3|_a7|offsetMatches|_5c|_76|_6a|_65|_df|_b0|write|_f6|DIV|spaceWidth|_f3|_4a|_ed|_ec|url|regex|_7d|_2|escape|_10c|_113|_106|_7b|_3|_8e|global|title|addFlags|cc|_112|len|fixInputString|_32|_139|Math|undefined|throw|extended|font|htmlScript|printFrame|_22|_fc|_25|instanceof|_17|_9d|_9e|_18|expandSource|_d1|_8c|viewSource|_1a|top|_4f|_da|key|cache|_10|win|getNativeFlags|_19|_50|focus|_122|_121|_11c|_b|Match|_ba|gm|findBrush|esc|eachLine|_4|_6c|values|_73|_12c|_12f|_6b|color|_89|gi|_bd|_bf|_9|HtmlScript|can|discoveredBrushes|xmlBrush|_f|_5d|_82|supply|_7|_c1|func|_59|_c8|_b7|_e|_d|pre|wrap|_ac|com|_a3|originalCode|from|link|gutter||collapsed|clipboardSwf|_37|popup|isNaN|collapse|_blank|_38|_ae|removeChild|String|contentWindow|hide|_24|ruler|swf|_30|_7e|_ad|item|_101|_2f|regexList|merge|measureSpace|_10b|_ea|_2a|_2c|join|_e9|_2e|px|_2b|_4c|_e5|content|r2|margin|_29|quantifier|_49|guid|toolbarCommands|charAt|highlighters|_27|highlighterId|_a6|close|toolbarItemWidth|_2d|_48|toolbarItemHeight|_35|copyToClipboard|Array|userAgent|_90|_84|navigator|_85|_78|_79|_83|_3f|items|_1e|_16|_13|_12|shockwave|flash|clipboardData|_36|object|version|_15|_14|center|alexgorbatchev|align|head|org|2009|_6|executeCommand|commandName|_a|createButton|copyToClipboardConfirmation|message|w3|event|_4e|screen|switch|attachEvent|_5a|_66|www|_61|noBrush|_47|aboutDialog|insertSpaces|copyStyles|500px|0px|_3e|type|scrollbars|help|stylesheet|rel|_6d|debug|DTD|smart|trimFirstAndLastLines|_10a|_f1|light|tabs|processSmartTabs|findMatches|removeNestedMatches|createRuler|show|processTabs|defaults|important|first|padNumber|parseInt|xhtml1|matchesSortCallback|_e0|_e1|decorate|plain|block|_e6|_e7|processMatches|createDisplayLines|_100|_11b|args|matchRecursive|_93|escapeChar|unicode|get|classRight|_109|classLeft|_105|arguments|clipboard|pP|processUrls|multiline|_12d|links|auto|when|character|one|match|_12e|_fb|TypeError|_d4|syntaxhighlighter|addEvent|defaultAdd|_a1|parentNode|_b9|_bb|_c2|brushNotHtmlScript|_a4|_a8|_b1|toArray|getElementsByTagName|tagName|parseParams|regexLib|_a9|brush|_ab|process|_9a|Highlighter|_cf|toBoolean|_c9|_c6|_d0|_cd|_ce|_d2|bloggerMode|stripBrs|catch|SyntaxError|now|Can|more|xhtml|utf|onclick|delimiters|wasn|your|family|sx|than|valueNames|addPlugin|About|try|charset|_26|400|750|find|_21|location|Type|ignoreCase|menubar|resizable|Content|_20|_1f|param|meta|_11f|Brush|apply|_1b|sticky|Geneva|_11d|_1c|equiv|to|syntax|highlighter|JavaScript|expand|none|3em|contains|view|Alex|unbalanced|2004|Copyright|decoration|0099FF|data|320|4em|bottom|75em|May|large|xx|Error|target|03|Gorbatchev|multiLineCComments|aspScriptTags|scriptScriptTags|phpScriptTags|Arial|multiLineSingleQuotedString|subject|The|flag|the|is|string|typeof|Helvetica|sans|000|fff|1em|singleLinePerlComments|singleLineCComments|copy|doubleQuotedString|serif|multiLineDoubleQuotedString|background|singleQuotedString|using|W3C|random|1000000|round|_f5|_f7|_f2|spaces|alt|transitional|open|highlighted|number|highlighter_|250|shCore|onmouseover|toLowerCase|onmouseout|printing|about|_42|_44|500|_43|nogutter|no|sort|on|getComputedStyle|getPropertyValue|opera|getElementById|1999|offsetWidth|_a5|_99|dtd|1000|xmlns|_8a|textarea|70em|_c5|150|lastIndexOf|aliases|addEventListener|_c0|middot|replaceChild|30em|all|load|Xml|absolute|position|444553540000|codebase|96b8|11cf|ae6d|PUBLIC|download|cabs|constructing|another|pub|macromedia|d27cdb6e|clsid|always|wmode|allowScriptAccess|application|_clipboard|transparent|flashVars|msie|classid|menu|DOCTYPE|option|swflash|cab|TR|error|ok|forHtmlScript|setData|getKeywords|printSource|IFRAME|cssText||_3b|_3a|_39|sgi|amp|Transitional|replaceVar|XHTML|embed|movie|src|configured|command|max|_34|_33|EN|flags'.split('|'),0,{}))