Index: openacs-4/packages/richtext-xinha/richtext-xinha.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/richtext-xinha.info,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/richtext-xinha.info 3 Jan 2016 20:46:21 -0000 1.1.2.1 @@ -0,0 +1,27 @@ + + + + + Richtext Xinha + Richtext Xinha + f + t + f + f + + + Gustaf Neumann + Richtext editor plugin for integrating Xinha with acs-templating + 0 + + + + + + + + + + + + Index: openacs-4/packages/richtext-xinha/tcl/richtext-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/tcl/richtext-init.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/tcl/richtext-init.tcl 3 Jan 2016 20:46:21 -0000 1.1.2.1 @@ -0,0 +1 @@ +template::util::richtext::register_editor xinha Index: openacs-4/packages/richtext-xinha/tcl/richtext-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/tcl/richtext-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/tcl/richtext-procs.tcl 3 Jan 2016 20:46:21 -0000 1.1.2.1 @@ -0,0 +1,180 @@ +ad_library { + + Xinha integration with the richtext widget of acs-templating. + + This script defines the following two procs: + + ::richtext-xinha::initialize_widget + ::richtext-xinha::render_widgets + + @author Gustaf Neumann + @creation-date 1 Jan 2016 + @cvs-id $Id: richtext-procs.tcl,v 1.1.2.1 2016/01/03 20:46:21 gustafn Exp $ +} + +namespace eval ::richtext-xinha { + + ad_proc initialize_widget { + -form_id + -text_id + {-options {}} + } { + + Initialize an Xinha richtext editor widget. + This proc defines finally the global variables + + ::acs_blank_master(xinha.options) + ::acs_blank_master(xinha.plugins) + + } { + ns_log debug "initialize XINHA instance with <$options>" + + # The richtext widget might be specified by "options {editor + # xinha}" or via the package parameter "RichTextEditor" of + # acs-templating. + # + # The following options can be specified in the widget spec of + # the richtext widget: + # + # editor plugins width height folder_id fs_package_id + # + if {[dict exists $options plugins]} { + set plugins [dict get $options plugins] + } else { + set plugins [parameter::get \ + -package_id [apm_package_id_from_key "richtext-xinha"] \ + -parameter "XinhaDefaultPlugins" \ + -default ""] + set pluginsLegacy [parameter::get \ + -package_id [apm_package_id_from_key "acs-templating"] \ + -parameter "XinhaDefaultPlugins" \ + -default ""] + + if {$pluginsLegacy ne ""} { + if {$plugins eq ""} { + # + # We have no per-package config, but got a legacy + # config. + # + set plugins $pluginsLegacy + ns_log notice "richtext-xinha uses legacy parameters from acs-templating" + } else { + # + # Config for this package and legacy config in + # acs-templating is set, ignore config from + # acs-templating. + # + ns_log warning "richtext-xinha ignores legacy parameters from acs-templating" + } + } + } + + set quoted [list] + foreach e $plugins {lappend quoted '$e'} + set ::acs_blank_master(xinha.plugins) [join $quoted ", "] + + set xinha_options "" + foreach e {width height folder_id fs_package_id script_dir file_types attach_parent_id wiki_p} { + if {[dict exists $options $e]} { + append xinha_options "xinha_config.$e = '[dict get $options $e]';\n" + } + } + # + # Pass as well the actual package_id to xinha (for e.g. plugins) + # + append xinha_options "xinha_config.package_id = '[ad_conn package_id]';\n" + + # DAVEB find out if there is a key datatype in the form + if {[info exists ::af_key_name($form_id)]} { + set key [template::element get_value $form_id $::af_key_name($form_id)] + append xinha_options "xinha_config.key = '$key';\n" + } + + if {[dict exists options javascript]} { + append xinha_options [dict get $options javascript] \n + } + + #ns_log notice "final ::acs_blank_master(xinha.options):\n$xinha_options" + set ::acs_blank_master(xinha.options) $xinha_options + + return "" + } + + + ad_proc render_widgets {} { + + Render the xinha rich-text widgets. This function is created + at a time when all rich-text widgets of this page are already + initialized. The function is controlled via the global variables + + ::acs_blank_master(xinha) + ::acs_blank_master(xinha.options) + ::acs_blank_master(xinha.plugins) + ::acs_blank_master(xinha.params) + ::acs_blank_master__htmlareas + + } { + # + # In case no xinha instances are created, nothing has to be + # done. + # + if {![info exists ::acs_blank_master(xinha)]} { + return + } + set ::xinha_dir /resources/richtext-xinha/xinha-nightly/ + set ::xinha_lang [lang::conn::language] + # + # Xinha localization covers 33 languages, removing + # the following restriction should be fine. + # + #if {$::xinha_lang ne "en" && $::xinha_lang ne "de"} { + # set ::xinha_lang en + #} + + # We could add site wide Xinha configurations (.js code) into xinha_params + set xinha_params "" + if {[info exists ::acs_blank_master(xinha.params)]} { + set xinha_params $::acs_blank_master(xinha.params) + } + + # Per call configuration + set xinha_plugins $::acs_blank_master(xinha.plugins) + set xinha_options $::acs_blank_master(xinha.options) + + # HTML ids of the textareas used for Xinha + set htmlarea_ids '[join $::acs_blank_master__htmlareas "','"]' + + template::head::add_script -type text/javascript -script " + xinha_editors = null; + xinha_init = null; + xinha_config = null; + xinha_plugins = null; + xinha_init = xinha_init ? xinha_init : function() { + xinha_plugins = xinha_plugins ? xinha_plugins : + \[$xinha_plugins\]; + + // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING + if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return; + + xinha_editors = xinha_editors ? xinha_editors :\[ $htmlarea_ids \]; + xinha_config = xinha_config ? xinha_config() : new Xinha.Config(); + $xinha_params + $xinha_options + xinha_editors = + Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); + Xinha.startEditors(xinha_editors); + } + //window.onload = xinha_init; + " + + template::add_body_handler -event onload -script "xinha_init();" + template::add_script -src ${::xinha_dir}XinhaCore.js -section body + } + +} + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/Xinha.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/Xinha.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/Xinha.css 3 Jan 2016 20:46:21 -0000 1.1.2.1 @@ -0,0 +1,388 @@ +.htmlarea { background: #fff; } +.htmlarea td { margin:0 !important;padding:0 !important; } + +.htmlarea .toolbarRow { + width:1px; +} + +.htmlarea .toolbar { + cursor: default; + background: ButtonFace; + padding: 3px; + border: 1px solid; + border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; +} +.htmlarea .toolbar table { margin: 0; font-family: Tahoma, Verdana,sans-serif; font-size: 11px; } +.htmlarea .toolbar img { border: none; vertical-align: top; } +.htmlarea .toolbar .label { padding: 0 3px; } + +.htmlarea .toolbar .button { + background: ButtonFace; + color: ButtonText; + border: 1px solid ButtonFace; + padding: 1px; + margin: 0; + width: 18px; + height: 18px; +} +.htmlarea .toolbar a.button:hover { + border: 1px solid; + border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; +} +.htmlarea .toolbar a.buttonDisabled:hover { + border-color: ButtonFace; +} +.htmlarea .toolbar .buttonActive, +.htmlarea .toolbar .buttonPressed +{ + padding: 2px 0 0 2px; + border: 1px solid; + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; +} +.htmlarea .toolbar .buttonPressed { + background: ButtonHighlight; +} +.htmlarea .toolbar .indicator { + padding: 0 3px; + overflow: hidden; + width: 20px; + text-align: center; + cursor: default; + border: 1px solid ButtonShadow; +} + +.htmlarea .toolbar .buttonDisabled img { + filter: gray() alpha(opacity = 25); + -moz-opacity: 0.25; + opacity: 0.25; +} + +.htmlarea .toolbar .separator { + /*position: relative;*/ + margin:0 3px; + border-left: 1px solid ButtonShadow; + border-right: 1px solid ButtonHighlight; + width: 0; + height: 18px; + padding: 0; +} + +.htmlarea .toolbar .space { width: 5px; } + +.htmlarea .toolbar select, .htmlarea .toolbar option { font: 11px Tahoma,Verdana,sans-serif;} + +.htmlarea .toolbar select, +.htmlarea .toolbar select:hover, +.htmlarea .toolbar select:active { + position:relative; + top:-2px; + margin-bottom:-2px; + color: ButtonText; +} + +.htmlarea iframe.xinha_iframe, .htmlarea textarea.xinha_textarea +{ + border: none; /*1px solid;*/ +} + +.htmlarea .statusBar { + border: 1px solid; + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; + padding: 2px 4px; + background-color: ButtonFace; + color: ButtonText; + font: 11px Tahoma,Verdana,sans-serif; + height:16px; + overflow: hidden; +} + +.htmlarea .statusBar .statusBarTree a { + padding: 2px 5px; + color: #00f; +} + +.htmlarea .statusBar .statusBarTree a:visited { color: #00f; } +.htmlarea .statusBar .statusBarTree a:hover { + background-color: Highlight; + color: HighlightText; + padding: 1px 4px; + border: 1px solid HighlightText; +} + +.statusBarWidgetContainer { + background-color: ButtonFace; +} + +/* popup dialogs */ + +.dialog { + color: ButtonText; + background: ButtonFace; + border: 1px outset; + border-color: WindowFrame; +} +div.dialog { + padding-bottom:10px; + border-radius: 8px 8px 0 0; + -moz-border-radius: 8px 8px 0 0; + -webkit-border-top-left-radius: 8px; + -webkit-border-top-right-radius: 8px; + + box-shadow: 9px 9px 10px #444; + -moz-box-shadow: 9px 9px 10px #444; + -webkit-box-shadow: 9px 9px 10px #444; +} +div.dialog.modeless { + box-shadow: 4px 4px 5px #888; + -moz-box-shadow: 4px 4px 5px #888; + -webkit-box-shadow: 4px 4px 5px #888; +} +div.dialog.chrome { + -webkit-box-shadow: none !IMPORTANT; +} +.panels div.dialog.panel { + border-radius:0; + -moz-border-radius: 0; + -webkit-border-radius:0; + + box-shadow: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; +} +.xinha_dialog_background { + filter: alpha(opacity=0); + -moz-opacity: 0; + opacity: 0; + border:none; +} +.xinha_dialog_background_modal_greyout { + background-color:#666; + filter: alpha(opacity=70) !IMPORTANT; + -moz-opacity: 0.7; + opacity: 0.7; +} +.xinha_dialog_background_modal { + filter: alpha(opacity=0) !IMPORTANT; + -moz-opacity: 0; + opacity: 0; + border:none; +} +body.xinha_dialog_background_modal_greyout { + filter: alpha(opacity=100) !IMPORTANT; +} +body.xinha_dialog_background_modal { + filter: alpha(opacity=0); +} +.dialog .content { padding: 2px; } + +.dialog, .dialog button, .dialog input, .dialog select, .dialog textarea, .dialog table { + font: 11px Tahoma,Verdana,sans-serif; +} + +.dialog table { border-collapse: collapse; } + +.dialog .title, .dialog h1 +{ + background: ActiveCaption; + color: CaptionText; + border-bottom: 1px solid #000; + padding: 1px 0 2px 5px; + font-size: 12px; + font-weight: bold; + cursor: default; + letter-spacing: 0.01em; +} +.dialog h1 { + padding-left:22px; + margin:0; + border-radius: 8px 8px 0 0; + -moz-border-radius: 8px 8px 0 0; + -webkit-border-top-left-radius: 8px; + -webkit-border-top-right-radius: 8px; +} +.panels .dialog.panel h1 { + -moz-border-radius: 0; + -webkit-border-radius:0; +} + +.dialog .title .button { + float: right; + border: 1px solid #66a; + padding: 0 1px 0 2px; + margin-right: 1px; + color: #fff; + text-align: center; +} + +.dialog .title .button-hilite { border-color: #88f; background: #44c; } + +.dialog button { + width: 5.5em; + padding: 0; +} +.dialog .closeButton { + padding: 0; + cursor: default; + border: 1px solid; + border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; + height : 11px; + width : 11px; + vertical-align : top; + position : absolute; + top : 3px; + right : 2px; + background-color: ButtonFace; + color: ButtonText; + font-size: 13px; + font-family: Tahoma,Verdana,sans-serif; + text-align:center; + letter-spacing:0; + overflow:hidden; +} +.dialog .buttonColor { + width :1em; + padding: 1px; + cursor: default; + border: 1px solid; + border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; +} + +.dialog .buttonColor .chooser, .dialog .buttonColor .nocolor { + height: 0.6em; + border: 1px solid; + padding: 0 1em; + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; +} + +.dialog .buttonClick { + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; +} +.dialog .buttonColor-hilite { + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; +} + +.dialog .buttonColor .nocolor { padding: 0; } +.dialog .buttonColor .nocolor-hilite { background-color: #fff; color: #f00; } + +.dialog .label { text-align: right; width: 6em; } +.dialog .value input { width: 100%; } + +.dialog legend { font-weight: bold; } +.dialog fieldset table { margin: 2px 0; } + +.dialog .buttons { + + padding: 1em; + text-align: center; +} +.dialog .resizeHandle { + -moz-appearance : resizer; + width: 12px; + height: 12px; + border-bottom: 2px solid #000; + border-right: 2px solid #000; + cursor : se-resize; +} +.popupwin { + padding: 0; + margin: 0; +} + +.popupwin .title { + background: #fff; + color: #000; + font-weight: bold; + font-size: 120%; + padding: 3px 10px; + margin-bottom: 10px; + border-bottom: 1px solid black; + letter-spacing: 2px; +} + +form { margin: 0; border: none; } + + +/** Panels **/ +.htmlarea .panels_top +{ + border-bottom : 1px solid; + border-color: ButtonShadow; +} + +.htmlarea .panels_right +{ + border-left : 1px solid; + border-color: ButtonShadow; +} + +.htmlarea .panels_left +{ + border-right : 1px solid; + border-color: ButtonShadow; +} + +.htmlarea .panels_bottom +{ + border-top : 1px solid; + border-color: ButtonShadow; +} + +.htmlarea .panel h1 { + clear:left; + font-size:0.9em; +} + +.htmlarea .panel { + overflow:hidden; + background-color:white; + padding-bottom:0 !IMPORTANT; + border: none !IMPORTANT; +} +.htmlarea .panels_left .panel { border-right:none; border-left:none; } +.htmlarea .panels_left h1 { border-right:none; } +.htmlarea .panels_right .panel { border-right:none; border-left:none; } +.htmlarea .panels_left h1 { border-left:none; } +.htmlarea { border: 1px solid black; } + +.loading +{ + font-family:sans-serif; + position:absolute; + z-index:998; + text-align:center; + width:212px; + padding: 55px 0 5px 0; + border:2px solid #ccc; + /* border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;*/ + background: url(images/xinha_logo.gif) no-repeat #fff center 5px; +} +.loading_main +{ + font-size:11px; + color:#000; + +} +.loading_sub +{ + font-size:9px; + color:#666; + text-align:center; +} +/* Classes for filemanager styles in a dialog. */ +.dialog a img +{ +border: 0 none transparent; +} + +.dialog fieldset.collapsed { +border: 0 none transparent; +} + +.dialog fieldset.collapsed form { +display: none; +} + +.hidden +{ +display: none; +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/XinhaConfig.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/XinhaConfig.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/XinhaConfig.js 3 Jan 2016 20:46:21 -0000 1.1.2.1 @@ -0,0 +1,5992 @@ + + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- Xinha (is not htmlArea) - http://xinha.gogo.co.nz/ + -- + -- Use of Xinha is granted by the terms of the htmlArea License (based on + -- BSD license) please read license.txt in this package for details. + -- + -- Xinha was originally based on work by Mihai Bazon which is: + -- Copyright (c) 2003-2004 dynarch.com. + -- Copyright (c) 2002-2003 interactivetools.com, inc. + -- This copyright notice MUST stay intact for use. + -- + -- Developers - Coding Style: + -- For the sake of not committing needlessly conflicting changes, + -- + -- * New code to be indented with 2 spaces ("soft tab"). + -- * New code preferably uses BSD-Style Bracing + -- if ( foo ) + -- { + -- bar(); + -- } + -- * Don't change brace styles unless you're working on the non BSD-Style + -- area (so we don't get spurious changes in line numbering). + -- * Don't change indentation unless you're working on the badly indented + -- area (so we don't get spurious changes of large blocks of code). + -- * Jedit is the recommended editor, a comment of this format should be + -- included in the top 10 lines of the file (see the embedded edit mode) + -- + -- $HeadURL: http://svn.xinha.python-hosting.com/trunk/XinhaConfig.js $ + -- $LastChangedDate: 2007-04-12 09:23:45 +1200 (Thu, 12 Apr 2007) $ + -- $LastChangedRevision: 811 $ + -- $LastChangedBy: ray $ + --------------------------------------------------------------------------*/ + +Xinha.version = +{ + 'Release' : 'Trunk', + 'Head' : '$HeadURL: http://svn.xinha.python-hosting.com/trunk/XinhaConfig.js $'.replace(/^[^:]*: (.*) \$$/, '$1'), + 'Date' : '$LastChangedDate: 2007-04-12 09:23:45 +1200 (Thu, 12 Apr 2007) $'.replace(/^[^:]*: ([0-9-]*) ([0-9:]*) ([+0-9]*) \((.*)\) \$/, '$4 $2 $3'), + 'Revision' : '$LastChangedRevision: 811 $'.replace(/^[^:]*: (.*) \$$/, '$1'), + 'RevisionBy': '$LastChangedBy: ray $'.replace(/^[^:]*: (.*) \$$/, '$1') +}; + +//must be here. it is called while converting _editor_url to absolute +Xinha._resolveRelativeUrl = function( base, url ) +{ + if(url.match(/^([^:]+\:)?\//)) + { + return url; + } + else + { + var b = base.split("/"); + if(b[b.length - 1] == "") + { + b.pop(); + } + var p = url.split("/"); + if(p[0] == ".") + { + p.shift(); + } + while(p[0] == "..") + { + b.pop(); + p.shift(); + } + return b.join("/") + "/" + p.join("/"); + } +} + +if ( typeof _editor_url == "string" ) +{ + // Leave exactly one backslash at the end of _editor_url + _editor_url = _editor_url.replace(/\x2f*$/, '/'); + + // convert _editor_url to absolute + if(!_editor_url.match(/^([^:]+\:)?\//)){ + var path = window.location.toString().split("/"); + path.pop(); + _editor_url = Xinha._resolveRelativeUrl(path.join("/"), _editor_url); + } +} +else +{ + alert("WARNING: _editor_url is not set! You should set this variable to the editor files path; it should preferably be an absolute path, like in '/htmlarea/', but it can be relative if you prefer. Further we will try to load the editor files correctly but we'll probably fail."); + _editor_url = ''; +} + +// make sure we have a language +if ( typeof _editor_lang == "string" ) +{ + _editor_lang = _editor_lang.toLowerCase(); +} +else +{ + _editor_lang = "en"; +} + +// skin stylesheet to load +if ( typeof _editor_skin !== "string" ) +{ + _editor_skin = ""; +} + +var __xinhas = []; + +// browser identification +Xinha.agt = navigator.userAgent.toLowerCase(); +Xinha.is_ie = ((Xinha.agt.indexOf("msie") != -1) && (Xinha.agt.indexOf("opera") == -1)); +Xinha.ie_version= parseFloat(Xinha.agt.substring(Xinha.agt.indexOf("msie")+5)); +Xinha.is_opera = (Xinha.agt.indexOf("opera") != -1); +Xinha.is_khtml = (Xinha.agt.indexOf("khtml") != -1); +Xinha.is_safari = (Xinha.agt.indexOf("safari") != -1); +Xinha.opera_version = navigator.appVersion.substring(0, navigator.appVersion.indexOf(" "))*1; +Xinha.is_mac = (Xinha.agt.indexOf("mac") != -1); +Xinha.is_mac_ie = (Xinha.is_ie && Xinha.is_mac); +Xinha.is_win_ie = (Xinha.is_ie && !Xinha.is_mac); +Xinha.is_gecko = (navigator.product == "Gecko" && !Xinha.is_safari); // Safari lies! +Xinha.isRunLocally = document.URL.toLowerCase().search(/^file:/) != -1; +Xinha.is_designMode = (typeof document.designMode != 'undefined' && !Xinha.is_ie); // IE has designMode, but we're not using it +Xinha.checkSupportedBrowser = function() +{ + if ( Xinha.is_gecko ) + { + if ( navigator.productSub < 20021201 ) + { + alert("You need at least Mozilla-1.3 Alpha.\nSorry, your Gecko is not supported."); + return false; + } + if ( navigator.productSub < 20030210 ) + { + alert("Mozilla < 1.3 Beta is not supported!\nI'll try, though, but it might not work."); + } + } + if ( Xinha.is_opera ) + { + alert("Sorry, Opera is not yet supported by Xinha."); + } + return Xinha.is_gecko || (Xinha.is_opera && Xinha.opera_version >= 9.1) || Xinha.ie_version >= 5.5; +}; + +Xinha.isSupportedBrowser = Xinha.checkSupportedBrowser(); + +if ( Xinha.isRunLocally && Xinha.isSupportedBrowser) +{ + alert('Xinha *must* be installed on a web server. Locally opened files (those that use the "file://" protocol) cannot properly function. Xinha will try to initialize but may not be correctly loaded.'); +} + +// Creates a new Xinha object. Tries to replace the textarea with the given +// ID with it. +function Xinha(textarea, config) +{ + if ( !Xinha.isSupportedBrowser ) return; + + if ( !textarea ) + { + throw("Tried to create Xinha without textarea specified."); + } + + if ( typeof config == "undefined" ) + { + this.config = new Xinha.Config(); + } + else + { + this.config = config; + } + this._htmlArea = null; + + if ( typeof textarea != 'object' ) + { + textarea = Xinha.getElementById('textarea', textarea); + } + this._textArea = textarea; + this._textArea.spellcheck = false; + + // Before we modify anything, get the initial textarea size + this._initial_ta_size = + { + w: textarea.style.width ? textarea.style.width : ( textarea.offsetWidth ? ( textarea.offsetWidth + 'px' ) : ( textarea.cols + 'em') ), + h: textarea.style.height ? textarea.style.height : ( textarea.offsetHeight ? ( textarea.offsetHeight + 'px' ) : ( textarea.rows + 'em') ) + }; + + if ( document.getElementById("loading_" + textarea.id) || this.config.showLoading ) + { + if (!document.getElementById("loading_" + textarea.id)) + { + Xinha.createLoadingMessage(textarea); + } + this.setLoadingMessage(Xinha._lc("Constructing object")); + } + + this._editMode = "wysiwyg"; + this.plugins = {}; + this._timerToolbar = null; + this._timerUndo = null; + this._undoQueue = [this.config.undoSteps]; + this._undoPos = -1; + this._customUndo = true; + this._mdoc = document; // cache the document, we need it in plugins + this.doctype = ''; + this.__htmlarea_id_num = __xinhas.length; + __xinhas[this.__htmlarea_id_num] = this; + + this._notifyListeners = {}; + + // Panels + var panels = + { + right: + { + on: true, + container: document.createElement('td'), + panels: [] + }, + left: + { + on: true, + container: document.createElement('td'), + panels: [] + }, + top: + { + on: true, + container: document.createElement('td'), + panels: [] + }, + bottom: + { + on: true, + container: document.createElement('td'), + panels: [] + } + }; + + for ( var i in panels ) + { + if(!panels[i].container) { continue; } // prevent iterating over wrong type + panels[i].div = panels[i].container; // legacy + panels[i].container.className = 'panels ' + i; + Xinha.freeLater(panels[i], 'container'); + Xinha.freeLater(panels[i], 'div'); + } + // finally store the variable + this._panels = panels; + + Xinha.freeLater(this, '_textArea'); +} + +Xinha.onload = function() { }; +Xinha.init = function() { Xinha.onload(); }; + +// cache some regexps +Xinha.RE_tagName = /(<\/|<)\s*([^ \t\n>]+)/ig; +Xinha.RE_doctype = /()\n?/i; +Xinha.RE_head = /((.|\n)*?)<\/head>/i; +Xinha.RE_body = /]*>((.|\n|\r|\t)*?)<\/body>/i; +Xinha.RE_Specials = /([\/\^$*+?.()|{}[\]])/g; +Xinha.RE_email = /[_a-z\d\-\.]{3,}@[_a-z\d\-]{2,}(\.[_a-z\d\-]{2,})+/i; +Xinha.RE_url = /(https?:\/\/)?(([a-z0-9_]+:[a-z0-9_]+@)?[a-z0-9_-]{2,}(\.[a-z0-9_-]{2,}){2,}(:[0-9]+)?(\/\S+)*)/i; + +Xinha.Config = function() +{ + var cfg = this; + this.version = Xinha.version.Revision; + + // Width and Height + // you may set these as follows + // width = 'auto' -- the width of the original textarea will be used + // width = 'toolbar' -- the width of the toolbar will be used + // width = '' -- use any css measurement, eg width = '75%' + // + // height = 'auto' -- the height of the original textarea + // height = '' -- any css measurement, eg height = '480px' + this.width = "auto"; + this.height = "auto"; + + // the next parameter specifies whether the toolbar should be included + // in the size above, or are extra to it. If false then it's recommended + // to have explicit pixel sizes above (or on your textarea and have auto above) + this.sizeIncludesBars = true; + + // the next parameter specifies whether the panels should be included + // in the size above, or are extra to it. If false then it's recommended + // to have explicit pixel sizes above (or on your textarea and have auto above) + this.sizeIncludesPanels = true; + + // each of the panels has a dimension, for the left/right it's the width + // for the top/bottom it's the height. + // + // WARNING: PANEL DIMENSIONS MUST BE SPECIFIED AS PIXEL WIDTHS + this.panel_dimensions = + { + left: '200px', // Width + right: '200px', + top: '100px', // Height + bottom: '100px' + }; + + // enable creation of a status bar? + this.statusBar = true; + + // intercept ^V and use the Xinha paste command + // If false, then passes ^V through to browser editor widget + this.htmlareaPaste = false; + + this.mozParaHandler = 'best'; // set to 'built-in', 'dirty' or 'best' + // built-in: will (may) use 'br' instead of 'p' tags + // dirty : will use p and work good enough for the majority of cases, + // best : works the best, but it's about 12kb worth of javascript + // and will probably be slower than 'dirty'. This is the "EnterParagraphs" + // plugin from "hipikat", rolled in to be part of the core code + + + // possible values + // 'DOMwalk' (the "original") + // 'TransformInnerHTML' (this used to be the GetHtml plugin) + this.getHtmlMethod = 'DOMwalk'; + + // maximum size of the undo queue + this.undoSteps = 20; + + // the time interval at which undo samples are taken + this.undoTimeout = 500; // 1/2 sec. + + // set this to true if you want to explicitly right-justify when + // setting the text direction to right-to-left + this.changeJustifyWithDirection = false; + + // if true then Xinha will retrieve the full HTML, starting with the + // tag. + this.fullPage = false; + + // style included in the iframe document + this.pageStyle = ""; + + // external stylesheets to load (REFERENCE THESE ABSOLUTELY) + this.pageStyleSheets = []; + + // specify a base href for relative links + this.baseHref = null; + + // when the editor is in different directory depth as the edited page relative image sources + // will break the display of your images + // this fixes an issue where Mozilla converts the urls of images and links that are on the same server + // to relative ones (../) when dragging them around in the editor (Ticket #448) + this.expandRelativeUrl = true; + + // we can strip the base href out of relative links to leave them relative, reason for this + // especially if you don't specify a baseHref is that mozilla at least (& IE ?) will prefix + // the baseHref to any relative links to make them absolute, which isn't what you want most the time. + this.stripBaseHref = true; + + // and we can strip the url of the editor page from named links (eg ...) + // reason for this is that mozilla at least (and IE ?) prefixes location.href to any + // that don't have a url prefixing them + this.stripSelfNamedAnchors = true; + + // sometimes high-ascii in links can cause problems for servers (basically they don't recognise them) + // so you can use this flag to ensure that all characters other than the normal ascii set (actually + // only ! through ~) are escaped in URLs to % codes + this.only7BitPrintablesInURLs = true; + + // if you are putting the HTML written in Xinha into an email you might want it to be 7-bit + // characters only. This config option (off by default) will convert all characters consuming + // more than 7bits into UNICODE decimal entity references (actually it will convert anything + // below (chr 20) except cr, lf and tab and above (~, chr 7E)) + this.sevenBitClean = false; + + // sometimes we want to be able to replace some string in the html comng in and going out + // so that in the editor we use the "internal" string, and outside and in the source view + // we use the "external" string this is useful for say making special codes for + // your absolute links, your external string might be some special code, say "{server_url}" + // an you say that the internal represenattion of that should be http://your.server/ + this.specialReplacements = {}; // { 'external_string' : 'internal_string' } + + // set to true if you want Word code to be cleaned upon Paste + this.killWordOnPaste = true; + + // enable the 'Target' field in the Make Link dialog + this.makeLinkShowsTarget = true; + + // CharSet of the iframe, default is the charset of the document + this.charSet = (typeof document.characterSet != 'undefined') ? document.characterSet : document.charset; + + // Whether the edited document should be rendered in Quirksmode or Standard Compliant (Strict) Mode + // This is commonly known as the "doctype switch" + // for details read here http://www.quirksmode.org/css/quirksmode.html + // + // Possible values: + // true : Quirksmode is used + // false : Strict mode is used + // leave empty : the mode of the document Xinha is in is used + this.browserQuirksMode = ''; + + // URL-s + this.imgURL = "images/"; + this.popupURL = "popups/"; + + // remove tags (these have to be a regexp, or null if this functionality is not desired) + this.htmlRemoveTags = null; + + // Turning this on will turn all "linebreak" and "separator" items in your toolbar into soft-breaks, + // this means that if the items between that item and the next linebreak/separator can + // fit on the same line as that which came before then they will, otherwise they will + // float down to the next line. + + // If you put a linebreak and separator next to each other, only the separator will + // take effect, this allows you to have one toolbar that works for both flowToolbars = true and false + // infact the toolbar below has been designed in this way, if flowToolbars is false then it will + // create explictly two lines (plus any others made by plugins) breaking at justifyleft, however if + // flowToolbars is false and your window is narrow enough then it will create more than one line + // even neater, if you resize the window the toolbars will reflow. Niiiice. + + this.flowToolbars = true; + + // set to true if you want the loading panel to show at startup + this.showLoading = false; + + // set to false if you want to allow JavaScript in the content, otherwise '); \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/inline-dialog.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/inline-dialog.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/inline-dialog.js 3 Jan 2016 20:46:24 -0000 1.1.2.1 @@ -0,0 +1,327 @@ + +Xinha.Dialog = function(editor, html, localizer) +{ + this.id = { }; + this.r_id = { }; // reverse lookup id + this.editor = editor; + this.document = document; + + this.rootElem = document.createElement('div'); + this.rootElem.className = 'dialog'; + this.rootElem.style.position = 'absolute'; + this.rootElem.style.display = 'none'; + this.editor._framework.ed_cell.insertBefore(this.rootElem, this.editor._framework.ed_cell.firstChild); + this.rootElem.style.width = this.width = this.editor._framework.ed_cell.offsetWidth + 'px'; + this.rootElem.style.height = this.height = this.editor._framework.ed_cell.offsetHeight + 'px'; + + var dialog = this; + if(typeof localizer == 'function') + { + this._lc = localizer; + } + else if(localizer) + { + this._lc = function(string) + { + return Xinha._lc(string,localizer); + }; + } + else + { + this._lc = function(string) + { + return string; + }; + } + + html = html.replace(/\[([a-z0-9_]+)\]/ig, + function(fullString, id) + { + if(typeof dialog.id[id] == 'undefined') + { + dialog.id[id] = Xinha.uniq('Dialog'); + dialog.r_id[dialog.id[id]] = id; + } + return dialog.id[id]; + } + ).replace(/(.*?)<\/l10n>/ig, + function(fullString,translate) + { + return dialog._lc(translate) ; + } + ).replace(/="_\((.*?)\)"/g, + function(fullString, translate) + { + return '="' + dialog._lc(translate) + '"'; + } + ); + + this.rootElem.innerHTML = html; + + + + + this.editor.notifyOn + ('resize', + function(e, args) + { + dialog.rootElem.style.width = dialog.width = dialog.editor._framework.ed_cell.offsetWidth + 'px'; + dialog.rootElem.style.height = dialog.height = dialog.editor._framework.ed_cell.offsetHeight + 'px'; + dialog.onresize(); + } + ); +}; + +Xinha.Dialog.prototype.onresize = function() +{ + return true; +}; + +Xinha.Dialog.prototype.show = function(values) +{ + // We need to preserve the selection for IE + if(Xinha.is_ie) + { + this._lastRange = this.editor._createRange(this.editor._getSelection()); + } + + if(typeof values != 'undefined') + { + this.setValues(values); + } + this._restoreTo = [this.editor._textArea.style.display, this.editor._iframe.style.visibility, this.editor.hidePanels()]; + + this.editor._textArea.style.display = 'none'; + this.editor._iframe.style.visibility = 'hidden'; + this.rootElem.style.display = ''; +}; + +Xinha.Dialog.prototype.hide = function() +{ + this.rootElem.style.display = 'none'; + this.editor._textArea.style.display = this._restoreTo[0]; + this.editor._iframe.style.visibility = this._restoreTo[1]; + this.editor.showPanels(this._restoreTo[2]); + + // Restore the selection + if(Xinha.is_ie) + { + this._lastRange.select(); + } + this.editor.updateToolbar(); + return this.getValues(); +}; + +Xinha.Dialog.prototype.toggle = function() +{ + if(this.rootElem.style.display == 'none') + { + this.show(); + } + else + { + this.hide(); + } +}; + +Xinha.Dialog.prototype.setValues = function(values) +{ + for(var i in values) + { + var elems = this.getElementsByName(i); + if(!elems) continue; + for(var x = 0; x < elems.length; x++) + { + var e = elems[x]; + switch(e.tagName.toLowerCase()) + { + case 'select' : + { + for(var j = 0; j < e.options.length; j++) + { + if(typeof values[i] == 'object') + { + for(var k = 0; k < values[i].length; k++) + { + if(values[i][k] == e.options[j].value) + { + e.options[j].selected = true; + } + } + } + else if(values[i] == e.options[j].value) + { + e.options[j].selected = true; + } + } + break; + } + + + case 'textarea': + case 'input' : + { + switch(e.getAttribute('type')) + { + case 'radio' : + { + if(e.value == values[i]) + { + e.checked = true; + } + break; + } + + case 'checkbox': + { + if(typeof values[i] == 'object') + { + for(var j in values[i]) + { + if(values[i][j] == e.value) + { + e.checked = true; + } + } + } + else + { + if(values[i] == e.value) + { + e.checked = true; + } + } + break; + } + + default : + { + e.value = values[i]; + } + } + break; + } + + default : + break; + } + } + } +}; + +Xinha.Dialog.prototype.getValues = function() +{ + var values = [ ]; + var inputs = Xinha.collectionToArray(this.rootElem.getElementsByTagName('input')) + .append(Xinha.collectionToArray(this.rootElem.getElementsByTagName('textarea'))) + .append(Xinha.collectionToArray(this.rootElem.getElementsByTagName('select'))); + + for(var x = 0; x < inputs.length; x++) + { + var i = inputs[x]; + if(!(i.name && this.r_id[i.name])) continue; + + if(typeof values[this.r_id[i.name]] == 'undefined') + { + values[this.r_id[i.name]] = null; + } + var v = values[this.r_id[i.name]]; + + switch(i.tagName.toLowerCase()) + { + case 'select': + { + if(i.multiple) + { + if(!v.push) + { + if(v != null) + { + v = [v]; + } + else + { + v = new Array(); + } + } + for(var j = 0; j < i.options.length; j++) + { + if(i.options[j].selected) + { + v.push(i.options[j].value); + } + } + } + else + { + if(i.selectedIndex >= 0) + { + v = i.options[i.selectedIndex]; + } + } + break; + } + + case 'textarea': + case 'input' : + default : + { + switch(i.type.toLowerCase()) + { + case 'radio': + { + if(i.checked) + { + v = i.value; + break; + } + } + + case 'checkbox': + { + if(v == null) + { + if(this.getElementsByName(this.r_id[i.name]).length > 1) + { + v = new Array(); + } + } + + if(i.checked) + { + if(v != null && typeof v == 'object' && v.push) + { + v.push(i.value); + } + else + { + v = i.value; + } + } + break; + } + + default : + { + v = i.value; + break; + } + } + } + + } + + values[this.r_id[i.name]] = v; + } + return values; +}; + +Xinha.Dialog.prototype.getElementById = function(id) +{ + return this.document.getElementById(this.id[id] ? this.id[id] : id); +}; + +Xinha.Dialog.prototype.getElementsByName = function(name) +{ + return this.document.getElementsByName(this.id[name] ? this.id[name] : name); +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/license.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/license.txt,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/license.txt 3 Jan 2016 20:46:24 -0000 1.1.2.1 @@ -0,0 +1,30 @@ +htmlArea License (based on BSD license) +Copyright (c) 2002-2004, interactivetools.com, inc. +Copyright (c) 2003-2004 dynarch.com +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1) Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2) Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3) Neither the name of interactivetools.com, inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/panel-dialog.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/panel-dialog.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/panel-dialog.js 3 Jan 2016 20:46:24 -0000 1.1.2.1 @@ -0,0 +1,76 @@ + +Xinha.PanelDialog = function(editor, side, html, localizer) +{ + this.id = { }; + this.r_id = { }; // reverse lookup id + this.editor = editor; + this.document = document; + this.rootElem = editor.addPanel(side); + + var dialog = this; + if(typeof localizer == 'function') + { + this._lc = localizer; + } + else if(localizer) + { + this._lc = function(string) + { + return Xinha._lc(string,localizer); + }; + } + else + { + this._lc = function(string) + { + return string; + }; + } + + html = html.replace(/\[([a-z0-9_]+)\]/ig, + function(fullString, id) + { + if(typeof dialog.id[id] == 'undefined') + { + dialog.id[id] = Xinha.uniq('Dialog'); + dialog.r_id[dialog.id[id]] = id; + } + return dialog.id[id]; + } + ).replace(/(.*?)<\/l10n>/ig, + function(fullString,translate) + { + return dialog._lc(translate) ; + } + ).replace(/="_\((.*?)\)"/g, + function(fullString, translate) + { + return '="' + dialog._lc(translate) + '"'; + } + ); + + this.rootElem.innerHTML = html; +}; + +Xinha.PanelDialog.prototype.show = function(values) +{ + this.editor.showPanel(this.rootElem); +}; + +Xinha.PanelDialog.prototype.hide = function() +{ + this.editor.hidePanel(this.rootElem); + return this.getValues(); +}; + +Xinha.PanelDialog.prototype.onresize = Xinha.Dialog.prototype.onresize; + +Xinha.PanelDialog.prototype.toggle = Xinha.Dialog.prototype.toggle; + +Xinha.PanelDialog.prototype.setValues = Xinha.Dialog.prototype.setValues; + +Xinha.PanelDialog.prototype.getValues = Xinha.Dialog.prototype.getValues; + +Xinha.PanelDialog.prototype.getElementById = Xinha.Dialog.prototype.getElementById; + +Xinha.PanelDialog.prototype.getElementsByName = Xinha.Dialog.prototype.getElementsByName; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/popupdiv.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/popupdiv.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/popupdiv.js 3 Jan 2016 20:46:24 -0000 1.1.2.1 @@ -0,0 +1,369 @@ +/** This file is derived from PopupDiv, developed by Mihai Bazon for + * SamWare.net. Modifications were needed to make it usable in HTMLArea. + * HTMLArea is a free WYSIWYG online HTML editor from InteractiveTools.com. + * + * This file does not function standalone. It is dependent of global functions + * defined in HTMLArea-3.0 (htmlarea.js). + * + * Please see file htmlarea.js for further details. + **/ + +var is_ie = ( (navigator.userAgent.toLowerCase().indexOf("msie") != -1) && + (navigator.userAgent.toLowerCase().indexOf("opera") == -1) ); +var is_compat = (document.compatMode == "BackCompat"); + +function PopupDiv(editor, titleText, handler, initFunction) { + var self = this; + + this.editor = editor; + this.doc = editor._mdoc; + this.handler = handler; + + var el = this.doc.createElement("div"); + el.className = "content"; + + var popup = this.doc.createElement("div"); + popup.className = "dialog popupdiv"; + this.element = popup; + var s = popup.style; + s.position = "absolute"; + s.left = "0px"; + s.top = "0px"; + + var title = this.doc.createElement("div"); + title.className = "title"; + this.title = title; + popup.appendChild(title); + + HTMLArea._addEvent(title, "mousedown", function(ev) { + self._dragStart(is_ie ? window.event : ev); + }); + + var button = this.doc.createElement("div"); + button.className = "button"; + title.appendChild(button); + button.innerHTML = "×"; + title.appendChild(this.doc.createTextNode(titleText)); + this.titleText = titleText; + + button.onmouseover = function() { + this.className += " button-hilite"; + }; + button.onmouseout = function() { + this.className = this.className.replace(/\s*button-hilite\s*/g, " "); + }; + button.onclick = function() { + this.className = this.className.replace(/\s*button-hilite\s*/g, " "); + self.close(); + }; + + popup.appendChild(el); + this.content = el; + + this.doc.body.appendChild(popup); + + this.dragging = false; + this.onShow = null; + this.onClose = null; + this.modal = false; + + initFunction(this); +}; + +PopupDiv.currentPopup = null; + +PopupDiv.prototype.showAtElement = function(el, mode) { + this.defaultSize(); + var pos, ew, eh; + var popup = this.element; + popup.style.display = "block"; + var w = popup.offsetWidth; + var h = popup.offsetHeight; + popup.style.display = "none"; + if (el != window) { + pos = PopupDiv.getAbsolutePos(el); + ew = el.offsetWidth; + eh = el.offsetHeight; + } else { + pos = {x:0, y:0}; + var size = PopupDiv.getWindowSize(); + ew = size.x; + eh = size.y; + } + var FX = false, FY = false; + if (mode.indexOf("l") != -1) { + pos.x -= w; + FX = true; + } + if (mode.indexOf("r") != -1) { + pos.x += ew; + FX = true; + } + if (mode.indexOf("t") != -1) { + pos.y -= h; + FY = true; + } + if (mode.indexOf("b") != -1) { + pos.y += eh; + FY = true; + } + if (mode.indexOf("c") != -1) { + FX || (pos.x += Math.round((ew - w) / 2)); + FY || (pos.y += Math.round((eh - h) / 2)); + } + this.showAt(pos.x, pos.y); +}; + +PopupDiv.prototype.defaultSize = function() { + var s = this.element.style; + var cs = this.element.currentStyle; + var addX = (is_ie && is_compat) ? (parseInt(cs.borderLeftWidth) + + parseInt(cs.borderRightWidth) + + parseInt(cs.paddingLeft) + + parseInt(cs.paddingRight)) : 0; + var addY = (is_ie && is_compat) ? (parseInt(cs.borderTopWidth) + + parseInt(cs.borderBottomWidth) + + parseInt(cs.paddingTop) + + parseInt(cs.paddingBottom)) : 0; + s.display = "block"; + s.width = (this.content.offsetWidth + addX) + "px"; + s.height = (this.content.offsetHeight + this.title.offsetHeight) + "px"; + s.display = "none"; +}; + +PopupDiv.prototype.showAt = function(x, y) { + this.defaultSize(); + var s = this.element.style; + s.display = "block"; + s.left = x + "px"; + s.top = y + "px"; + this.hideShowCovered(); + + PopupDiv.currentPopup = this; + HTMLArea._addEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup); + HTMLArea._addEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup); + if (is_ie && this.modal) { + this.doc.body.setCapture(false); + this.doc.body.onlosecapture = function() { + (PopupDiv.currentPopup) && (this.doc.body.setCapture(false)); + }; + } + window.event && HTMLArea._stopEvent(window.event); + + if (typeof this.onShow == "function") { + this.onShow(); + } else if (typeof this.onShow == "string") { + eval(this.onShow); + } + + var field = this.element.getElementsByTagName("input")[0]; + if (!field) { + field = this.element.getElementsByTagName("select")[0]; + } + if (!field) { + field = this.element.getElementsByTagName("textarea")[0]; + } + if (field) { + field.focus(); + } +}; + +PopupDiv.prototype.close = function() { + this.element.style.display = "none"; + PopupDiv.currentPopup = null; + this.hideShowCovered(); + HTMLArea._removeEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup); + HTMLArea._removeEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup); + is_ie && this.modal && this.doc.body.releaseCapture(); + if (typeof this.onClose == "function") { + this.onClose(); + } else if (typeof this.onClose == "string") { + eval(this.onClose); + } + this.element.parentNode.removeChild(this.element); +}; + +PopupDiv.prototype.getForm = function() { + var forms = this.content.getElementsByTagName("form"); + return (forms.length > 0) ? forms[0] : null; +}; + +PopupDiv.prototype.callHandler = function() { + var tags = ["input", "textarea", "select"]; + var params = new Object(); + for (var ti = tags.length; --ti >= 0;) { + var tag = tags[ti]; + var els = this.content.getElementsByTagName(tag); + for (var j = 0; j < els.length; ++j) { + var el = els[j]; + params[el.name] = el.value; + } + } + this.handler(this, params); + return false; +}; + +PopupDiv.getAbsolutePos = function(el) { + var r = { x: el.offsetLeft, y: el.offsetTop }; + if (el.offsetParent) { + var tmp = PopupDiv.getAbsolutePos(el.offsetParent); + r.x += tmp.x; + r.y += tmp.y; + } + return r; +}; + +PopupDiv.getWindowSize = function() { + if (window.innerHeight) { + return { y: window.innerHeight, x: window.innerWidth }; + } + if (this.doc.body.clientHeight) { + return { y: this.doc.body.clientHeight, x: this.doc.body.clientWidth }; + } + return { y: this.doc.documentElement.clientHeight, x: this.doc.documentElement.clientWidth }; +}; + +PopupDiv.prototype.hideShowCovered = function () { + var self = this; + function isContained(el) { + while (el) { + if (el == self.element) { + return true; + } + el = el.parentNode; + } + return false; + }; + var tags = new Array("applet", "select"); + var el = this.element; + + var p = PopupDiv.getAbsolutePos(el); + var EX1 = p.x; + var EX2 = el.offsetWidth + EX1; + var EY1 = p.y; + var EY2 = el.offsetHeight + EY1; + + if (el.style.display == "none") { + EX1 = EX2 = EY1 = EY2 = 0; + } + + for (var k = tags.length; k > 0; ) { + var ar = this.doc.getElementsByTagName(tags[--k]); + var cc = null; + + for (var i = ar.length; i > 0;) { + cc = ar[--i]; + if (isContained(cc)) { + cc.style.visibility = "visible"; + continue; + } + + p = PopupDiv.getAbsolutePos(cc); + var CX1 = p.x; + var CX2 = cc.offsetWidth + CX1; + var CY1 = p.y; + var CY2 = cc.offsetHeight + CY1; + + if ((CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { + cc.style.visibility = "visible"; + } else { + cc.style.visibility = "hidden"; + } + } + } +}; + +PopupDiv.prototype._dragStart = function (ev) { + if (this.dragging) { + return false; + } + this.dragging = true; + PopupDiv.currentPopup = this; + var posX = ev.clientX; + var posY = ev.clientY; + if (is_ie) { + posY += this.doc.body.scrollTop; + posX += this.doc.body.scrollLeft; + } else { + posY += window.scrollY; + posX += window.scrollX; + } + var st = this.element.style; + this.xOffs = posX - parseInt(st.left); + this.yOffs = posY - parseInt(st.top); + HTMLArea._addEvent(this.doc, "mousemove", PopupDiv.dragIt); + HTMLArea._addEvent(this.doc, "mouseover", HTMLArea._stopEvent); + HTMLArea._addEvent(this.doc, "mouseup", PopupDiv.dragEnd); + HTMLArea._stopEvent(ev); +}; + +PopupDiv.dragIt = function (ev) { + var popup = PopupDiv.currentPopup; + if (!(popup && popup.dragging)) { + return false; + } + is_ie && (ev = window.event); + var posX = ev.clientX; + var posY = ev.clientY; + if (is_ie) { + posY += this.doc.body.scrollTop; + posX += this.doc.body.scrollLeft; + } else { + posY += window.scrollY; + posX += window.scrollX; + } + popup.hideShowCovered(); + var st = popup.element.style; + st.left = (posX - popup.xOffs) + "px"; + st.top = (posY - popup.yOffs) + "px"; + HTMLArea._stopEvent(ev); +}; + +PopupDiv.dragEnd = function () { + var popup = PopupDiv.currentPopup; + if (!popup) { + return false; + } + popup.dragging = false; + HTMLArea._removeEvent(popup.doc, "mouseup", PopupDiv.dragEnd); + HTMLArea._removeEvent(popup.doc, "mouseover", HTMLArea._stopEvent); + HTMLArea._removeEvent(popup.doc, "mousemove", PopupDiv.dragIt); + popup.hideShowCovered(); +}; + +PopupDiv.checkPopup = function (ev) { + is_ie && (ev = window.event); + var el = is_ie ? ev.srcElement : ev.target; + var cp = PopupDiv.currentPopup; + for (; (el != null) && (el != cp.element); el = el.parentNode); + if (el == null) { + cp.modal || ev.type == "mouseover" || cp.close(); + HTMLArea._stopEvent(ev); + } +}; + +PopupDiv.prototype.addButtons = function() { + var self = this; + var div = this.doc.createElement("div"); + this.content.appendChild(div); + div.className = "buttons"; + for (var i = 0; i < arguments.length; ++i) { + var btn = arguments[i]; + var button = this.doc.createElement("button"); + div.appendChild(button); + button.innerHTML = HTMLArea._lc(buttons[btn], 'HTMLArea'); + switch (btn) { + case "ok": + button.onclick = function() { + self.callHandler(); + self.close(); + }; + break; + case "cancel": + button.onclick = function() { + self.close(); + }; + break; + } + } +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/popupwin.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/popupwin.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/popupwin.js 3 Jan 2016 20:46:24 -0000 1.1.2.1 @@ -0,0 +1,178 @@ +// (c) dynarch.com 2003-2004 +// Distributed under the same terms as HTMLArea itself. + +function PopupWin(editor, title, handler, initFunction) +{ + this.editor = editor; + this.handler = handler; + var dlg = window.open("", "__ha_dialog", "toolbar=no,menubar=no,personalbar=no,width=600,height=600,left=20,top=40,scrollbars=no,resizable=no"); + this.window = dlg; + var doc = dlg.document; + this.doc = doc; + var self = this; + + var base = document.baseURI || document.URL; + if ( base && base.match(/(.*)\/([^\/]+)/) ) + { + base = RegExp.$1 + "/"; + } + // @fixme: why using a regex here and not a simple string test ? + if ( typeof _editor_url != "undefined" && ! ( /^\//.test(_editor_url) ) && ! ( /http:\/\//.test(_editor_url) ) ) + { + // _editor_url doesn't start with '/' which means it's relative + // FIXME: there's a problem here, it could be http:// which + // doesn't start with slash but it's not relative either. + base += _editor_url; + } + else + { + base = _editor_url; + } + + // @fixme: why using a regex here and not a simple string test ? + if ( ! ( /\/$/.test(base) ) ) + { + // base does not end in slash, add it now + base += '/'; + } + this.baseURL = base; + + doc.open(); + var html = "" + title + "\n"; + // html += "\n"; + html += '\n'; + if ( _editor_skin != "" ) + { + html += '\n'; + } + html += "\n"; + html += ''; + doc.write(html); + doc.close(); + + // sometimes I Hate Mozilla... ;-( + function init2() + { + var body = doc.body; + if ( !body ) + { + setTimeout(init2, 25); + return false; + } + dlg.title = title; + doc.documentElement.style.padding = "0px"; + doc.documentElement.style.margin = "0px"; + var content = doc.createElement("div"); + content.className = "content"; + self.content = content; + body.appendChild(content); + self.element = body; + initFunction(self); + dlg.focus(); + } + init2(); +} + +PopupWin.prototype.callHandler = function() +{ + var tags = ["input", "textarea", "select"]; + var params = {}; + for ( var ti = tags.length; --ti >= 0; ) + { + var tag = tags[ti]; + var els = this.content.getElementsByTagName(tag); + for ( var j = 0; j < els.length; ++j ) + { + var el = els[j]; + var val = el.value; + if ( el.tagName.toLowerCase() == "input" ) + { + if ( el.type == "checkbox" ) + { + val = el.checked; + } + } + params[el.name] = val; + } + } + this.handler(this, params); + return false; +}; + +PopupWin.prototype.close = function() +{ + this.window.close(); +}; + +PopupWin.prototype.addButtons = function() +{ + // @fixme: isn't self a predefined variable used to access self frame in most browsers ? + // if yes, then we break it here + var self = this; + var div = this.doc.createElement("div"); + this.content.appendChild(div); + div.id = "buttons"; + div.className = "buttons"; + for ( var i = 0; i < arguments.length; ++i ) + { + var btn = arguments[i]; + var button = this.doc.createElement("button"); + div.appendChild(button); + button.innerHTML = HTMLArea._lc(btn, 'HTMLArea'); + switch (btn.toLowerCase()) + { + case "ok": + HTMLArea.addDom0Event(button, 'click', + function() + { + self.callHandler(); + self.close(); + return false; + } + ); + break; + case "cancel": + HTMLArea.addDom0Event(button, 'click', + function() + { + self.close(); + return false; + } + ); + break; + } + } +}; + +PopupWin.prototype.showAtElement = function() +{ + var self = this; + // Mozilla needs some time to realize what's goin' on.. + setTimeout(function() + { + var w = self.content.offsetWidth + 4; + var h = self.content.offsetHeight + 4; + // size to content -- that's fuckin' buggy in all fuckin' browsers!!! + // so that we set a larger size for the dialog window and then center + // the element inside... phuck! + + // center... + var el = self.content; + var s = el.style; + // s.width = el.offsetWidth + "px"; + // s.height = el.offsetHeight + "px"; + s.position = "absolute"; + s.left = parseInt((w - el.offsetWidth) / 2, 10) + "px"; + s.top = parseInt((h - el.offsetHeight) / 2, 10) + "px"; + if (HTMLArea.is_gecko) + { + self.window.innerWidth = w; + self.window.innerHeight = h; + } + else + { + self.window.resizeTo(w + 8, h + 35); + } + }, + 25); +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/release-notes.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/release-notes.txt,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/release-notes.txt 3 Jan 2016 20:46:25 -0000 1.1.2.1 @@ -0,0 +1,380 @@ +Xinha - The Community-Built Online HTML Editor + +For bug reports, forum, and updates go to +http://xinha.org + +Release History + +Xinha 0.96 +== Bugs Fixed == + + * #1425 [SmartReplace][Gecko] When inserting opening quote, the space before the cursor is deleted + * #1429 Problems with Apache and HEAD requests... + * #1478 Further important security precautions for ExtendedFileManager and ImageManager + * #1478 Hide all dotfiles from the Linker scanner, the linker shouldn't be showing "hidden" files. + * #1478 CSS fix to dTree in linker, just to make sure it's styles were not getting clobbered. + * #1478 Stop the Stylist from possibly adding a duplicate stylesheet into pageStyleSheets, this was creating a subtle problem in certain circumstances. + * #1227 Improved handling of CSS imports in Stylist plugin. + * #1448 a[b.id] is undefined + * #1387 prevent crash in IE + * #1198 Fix for bad sizing of editor. + * #1121 Disable tab in Internet Explorer because it exits the Xinha area. + * #472 Disable InsertPicture + * #579 Pass value to dropdown handlers. + * #1472 _top not respected in editing link. + * #1467 autofocus=false not working as expected. + * #1461 Special characters in image make thumbnail not appear. + * #1435 IE failed in TransformInnerHTML + * #1232 Clickable icons on ExtendedFileManager + * #1409 Image Properties broken in ContextMenu + * #1419 Stylist display problem in IE6/7, HasLayout bug. + * #1262 Alternative method for restoring from fullscreen mode. + * #1388 Change — to &8212; for xml compatability. + * #1093, #1377 Rewrite the InsertSmiley plugin. Remains compatible with ray's changes in r904 if people have made a specific configuration. + * #1282 Opera losing it's events when designMode turned on causing status bar to not update amongst other things. + * r1228 Remove PersistantStorage from Newbie example, because it not actually usable atm + * r1229 Fix firefox version detection. + * r1230 avoid unecessary pollution of global namespace + * r1232 Removed CC license from Tango iconset, as it seems not appropriate + * r1232 Changed HtmlEntities plugin license to HTMLArea + * #1488 Fix Control Selection in IE8 + * r1235 Change license to HTMLArea - see http://xinha.org/punbb/viewtopic.php?id=2499 + * #1497 TransformInnerHtml handling of object tag + * #1498 Color picker display in new dialogs in IE6 + * #1499 Fix focus errors in new dialogs in IE + * #1503 xinha_to_js did not handle booleans correctly + * #1509 Prevent attempting to compress REs in Safari 4 + * #1515 Security patch to prevent rogue access to the compressors in contrib. + * #1518 Security patch which prevents non-default keys in xinha_pass_to_php_backend. + * #1518 Issue an error and ignore the special backend configuration when the key location is non default, for both the ImageManager and ExtendedFileManager deprecated config passing methods. + * #1209 and #1182 Upgrade Equation to use new AsciiMath, fix multiple equation editing. Thanks to Niraj Bhawnani of University of New South Wales. + * #1483 Fix cancel button in Equation editor. + * #1485 Add a double-click handler which will bring up the link/image insertion dialogs (or ImageManager/Linker) when a link or image is double clicked. + * #1492 Fix linker in some situations. + * #1471, #1508, #1510 Fix IE8 problems with TableOperations and other buttons, and absolute positioned editing. + +== New Features == + + * r1189 added toolbar config to Newbie example + * #1478 Add new method Xinha.extend to provide more classical object oriented subclasses within Javascript. + * #1478 Add new method Xinha.Dialog::setLocalizer() to more easily set a specific localizer for a dialog. + * #1478 File-Picker on arbitrary fields outside Xinha (ExtendedFileManager) + * #1478 Add config option to use HSpace and VSpace in ImageManager (default off) + * #1478 Add YouTube and Flickr support to ImageManager so that videos and Flickr images can be searched and selected in the ImageManager. + * #1478 Add a new dialog type "DetachedDialog" to help leverage Xinha plugins to perform tasks outside of Xinha, and an example of a simple dialog for those who wish to make their own. + * #1478 Link-Picker on arbitrary fields outside Xinha (Linker) + * #1478 New Plugin: WysiwygWrap - combined with an appropriate pageStyleSheet(s) you can more easily simulate in Xinha what it will "look like" when that HTML is "published". + * #1446 Provide a means for adding custom hooks into the ContextMenu plugin. + * #1220 Add ability to pass extra arguments in the post to the backend handler for SuperClean. + * #1465 Add an option `resize_files` to both ExtendedFileManager and ImageManager, defaults true, false turns off the automatic image resizing. + * #1189 Add the xml:lang attribute to LangMarks plugin. The configuration for this plugin has changed, old configurations are accepted with a warning to the console. + * #1433 Add a SaveOnBlur plugin, authored by Peter Siewert (with a clean up by James Sleeman). + * #1479 Add CSSPicker plugin. + * #1205 Add allow_delete and allow_edit to ImageManager + * #1205 Add allow_delete to ExtendedFileManager + * #1496 Make dialog title bar logo skinable + * r1243 Added a method to allow plugins to easily load assets synchronously (for dependancies). + * #1502 Add new plugin MootoolsFileManager - an advanced image and file uploader/picker/inserter with multi-file-upload, progress bars, and previews. + * #1507 Config option to show fonts in toolbar using actual fonts. + +== Translation == + + * #1477 Danish translation for ExtendedFileManager and SuperClean + * r1205 Updated Danish translation. + * #1470 Contribution from Niels Baggesen to assist translators. + * #1454, #1455, #1456, #1457, #1458, #1459, #1460 Spanish translations. + * #1469 Updated danish translation. + + +Xinha 0.96beta2 +Bugs Fixed + * #1376 [IE6 & IE7 Quirksmode] Dialogs are invisible + * #1381 [IE] QuirksMode dialog background rendered in wrong position when panel is detached + * #1383 [IE7] Secure and Nonsecure Warning + * #1382 [IE] QuirksMode dialog background falsely non-grey with modal dialogs, grey when dragging modeless dialogs + * #1389 [IE6] selection lost when clicking toolbar button + * #1386 [Safari] Setting default checkbox settings in dialogs does not work + * #1394 fullpage puts metas/ title all on the same line + * #1390 PreserveScripts shorthand php tags + * #1392 too much recursion when setting HTML in fullPage mode using onGenerate/onGenerateOnce + * #1407 [IE8] window resize causes infinite loop + * #1408 PHP5 IIS file upload problem + * #1374 [IE8] Table insert not work + * #1379 [Firefox] no longer corrupts image data from broken images + +Translation + * [SmartReplace] Added French translation + * #1406 [FullScreen] Added Spanish translation + +Xinha 0.96beta +Bugs Fixed + * #314 Status bar should wrap + * #741 ContextMenu should not overflow window boundaries + * #961 baseHref not correctly treated when stripping + * #1160 Safari puts selected HTML near bottom if edited + * #1166 TableOperations dialogs do not resize properly in Safari 3 + * #1173 IE8 beta toolbars broken + * #1174 IE8 beta no text cursor in wysiwyg + * #1187 ExtendedFileManager "imgManager.changeDir is not a function" error + * #1193 Stylist bug when formatting selected text + * #1213 Would be nice to protect unsaved changes from accidental loss when navigating away + * #1221 Selecting heading normal on nothing throws exception alert + * #1224 sevenbitclean? / ghost cursor error with html mode toggle (Firefox) + * #1227 No CSS rules load when using @import in external stylesheet + * #1230 CSS width attribute breaks select display in IE + * #1240 Linker: trim spaces from URL + * #1247 CharCounter problems with Silva skin + * #1257 Error if url query string included '/' + * #1258 Event object is not handed over to event handlers installed on textarea + * #1261 Dutch translation for Fullscreen module + * #1280 restoreSelection doesn't always work in internet explorer + * #1281 selectNodeContents is borken in IE when the node is a text node + * #1284 _editor_url is still used in a couple of plugins. + * #1286 use callbacks as criteria for getFirstAncestor + * #1288 [DefinitionList] list items restricted to small width and one line by CSS + * #1290 Improved support for pasting from Microsoft Word + * #1291 Xinha.removeFromParent() does not return correct reference + * #1292 change naming scheme of plugin files + * #1293 [Gecko] Window scrolls to top of editing area when switching from text to WYSIWYG + * #1294 Editor higher in HTML mode + * #1295 Textarea not aligned under toolbar + * #1298 CSS styling gets inserted into table cell after viewing source (Safari only) + * #1300 create namespace for plugins within Xinha namespace + * #1301 loading should not fail if plugin omits _pluginInfo + * #1302 add Array.prototype.forEach for Browser that doesn't support it + * #1303 add getElementsByClassName() + * #1306 Toolbar actions need access to the click event + * #1309 Xinha chokes on anchors + * #1315 Xinha's _addEvent uses event capturing + * #1316 In InternetExplorer, the cursor is lost when switching into source mode + * #1317 Xinha's postback and getback should allow for failure handlers + * #1319 make event hooks like onKeyPress accesible from the config object + * #1320 make it possible to use png images as icons in IE6 + * #1321 [SaveSubmit] icon is in "changed" state initially + * #1322 [SaveSubmit] error when form action is empty + * #1332 Panel classes are very generic, and risk conflict with users embedding it in their site + * #1337 GetHTML truncates hyperlinks + * #1346 statusbar shows b, i, strike instead of strong, em, and del + * #1357 safari form submit has empty form field names in POST data, causes failure with perl CGI + + +Enhancements + * #1176 Completely revamped dialog system, which uses inline lightbox-style dialogs instead of separate popup windows + * #326 Added support for customizable icon sets + * #1318 Added icon set from the Tango Project + * #1287 New InsertNote plugin for handling footnotes, with automatic note numbering and ordering, linking, and support for repeated references + * #1289 New InsertSnippet2 plugin, with categorization of snippets, search by name, and an XML data format + * #58 Additional settings for Linker plugin (link types and targets can be configured) + * #1219 Configuration option to autofocus editor + * #1285 Configuration option to set document body class + * #1323 Allow skins to have meta information (author, etc.) + * #1338 _editor_url is now automatically detected + * #1345 Add a static function that saves the contents of all Xinhas to their respective textareas + + +Xinha 0.95 +Bugs Fixed + * fixed #1040 htmlRemoveTags doesn't work in IE + * fixed #645 IE Save as function only saves the original html + * fixed #1136 FF3 Linux select boxes in toolbar are too small + * fixed #1100 Extended File Manager - Error after opening window + * fixed #1103 [TransformInnerHTML] IE breaks singlet attributes starting with "no" + * fixed #1086 Repeated javascript insertion in onclick attributes + * fixed #1094 IE throws error in Xinha.loadStyle function + * fixed #1117 IE returns javascript error -1072896658 + * fixed #993 PageStyle to override styles in PageStylesheets + * #1112 switching between modes leaves strange characters in source + * fixed #1128 loading fails when Fullscreen tried to load as plugin + * fixed #1126 Percent (%) in URL prevent stripSelfNamedAnchors from working + * fixed #1120 HTML select overlaps color picker in IE6 + * #1115 + #1127 fixed compatibility issues with Firefox 3 + * #961 + #1130 changed behaviour of xinha_config.baseHref + * fixed #645 Save as function only saves the original html + * fixed #1040 htmlRemoveTags doesn't work in IE + * fixed #1015 Mozilla shows scrollbars on click in Stylist + * #918 removed mozParaHandler dirty as it had been broken for a long time + * fixed #1015 Mozilla shows scrollbars on click in Stylist + * fixed #1148 HTML entities break when cursor is inside when switching from HTML to WYSIWYG + * fixed #1151 form action always made absolute + * fixed #1155 InsertAnchor broken in IE 7 + * fixed #1158 [ImageManager] in Japanese environment, an error occurs by reading of lang/ja.js in IE6/7 + * fixed #1152 Plugins using surroundHTML (EditTag, LangMarks) no longer work in IE7 + * fixed #1161 permission error from ColorPicker.js + * fixed #1181 [TableOperations] Table Options dialog first entry for border style faulty + * fixed #1185 [TableOperations] IE: style float broken + * fixed #1197 [Linker] IE shows bug in line 262 + * fixed #1200 [Linker] Dialog does not show if scanned folder empty + +Enhancements + * #1143 add Safari support + * #938 add Opera support + * #1138 added API functions Xinha.getEditor(), Xinha.prototype.getPluginInstance(), Xinha.addOnloadHandler() + * #1137 [Equation] FF3 fixes & improved way of avoiding formula changes in editor + * #1150 synchronize "Remove Format" between browsers + * added plugin PreserveScripts for enhanced editing of pages containing PHP and/or JavaScript () + * Loading message facelift + * added XinhaLoader.js for enhanced user experience through early loading message + * made Xinha.makeEditors accept a DOM reference to the textarea instead of the id as part of xinha_editors array (#1105) + * #1123 Allow return of PHP array from xinha_pass_to_php_backend + * [Linker] scan.php: Allow specification of base url to use (so that a subdirectory can be used as $dir and return appropriate urls to the files (prefixing the url + * [ExtendedFileManager] new Version + * #961 + #1130 changed behaviour of xinha_config.baseHref + * #1137 [Equation] improved way of avoiding formula changes in editor + * #442 removed alert "Your Document is not well formed..." + * #1119 disabled Firefox 2 spell check when ContextMenu is enabled + * added a plugin "GenericPlugin" as a democase for plugin event handlers + * #1171 [SmartReplace] now also replaces three dots with an ellipsis + * #1119 [ContextMenu] optionally switch of Firefox Spell check + * #1172 [LangMarks] make available languages configurable + * enhanced behaviour when xinha_config.baseHref is set to another server + * #1195 Allow to specify an external url to load a plugin from + * #1201 Add inwardHtml/outwardHtml functions to Config object + +I18n + * #1109 Spanish language extended + * #1116 [ExtendedFileManager] added French translation + * #853 updated Translation for farsi + * fixed wrong encoding in Spanish language file + * fixed no bold/italic/underline button images in Spanish + * #1194 [ExtendedFileManager] updated French translation + + +Xinha 0.94 + * Ticket #1093 [InsertSmiley] remove smiley gifs from trunk + * fixed Ticket #1019 Cusor not jumping to editable part of window when clicked in IE + * [TableOperations] Add config option to not dispaly toolbar buttons + * fixed Ticket #1021 Prevent ExtendedFileManager from masking ImageManager + * fixed Ticket #1023 [ImageManager] Add config item to allow the advanced image options to be hidden from the user + * fixed Ticket #1026 fix problems with loading skins + * fixed Tickets #1030 & #1031: slow loading large pages in IE + * fixed Ticket #1034 [ExtendedFileManager] Color pickers shown when use_color_pickers is false + * fixed Ticket #1035 [TransformInnerHTML] tags corruptedunder certain circumstances + * fixed Ticket #1036 [ExtendedFileManager] window is only resized after all thumbnails have benn loaded, which can take quite some time + * fixed Ticket #1039 Firefox full page adds multiple paragraphs after view source + * fixed Ticket #1019 Cusor not jumping to editable part of window when clicked in IE7 + * fixed Ticket #1046 Error in IE 6 when switching from text to wysiwyg + * [DOMwalk] linebreaks inserted before
s + * catch error in IE when trying to restore selection on non-displayed area + * fixed Ticket #973 Error switching wysiwyg/html including javascript file on the code + * fixed Ticket #1028 - [Linker] automatically (attempt to) work around an issue with mod_security being triggered because of the charset on our POST requests + * fixed Ticket #1055 [Stylist] Inappropriate styles (for other tags) are shown + * added Dutch language files + * added new hook 'onBeforeSubmit' for firePluginEvent() + * added new hook 'onBeforeUnload' for firePluginEvent() + * fixed Ticket #1048 Full Screen plugin doesn't load if many editors on page + * fixed Ticket #1053 ListType plugin doesn't work in panel config with multiple editors + * fixed Ticket #1026 Skins referenced with -tags don't work anymore + * fixed Ticket #1059 [Equation] loosing formula onsubmit + * fixed Ticket #1060 [Equation] various updates + * [Equation] preserve formula on reload in Mozilla + * [Equation] updated ASCIIMathML.js + * [Skin:silva] padding and border on textarea make the textmode too wide + * fixed Ticket#1001 Editor loads a bunch of null urls in ie + * fixed Ticket #1068 [TranformInnerHTML] newlines added after + * fixed Ticket#1069 Editor document URL prefixed to any href that only consists of URL parameters + * added Thai translation for core + * added complete Portuguese Brazilian translation + * updated lc_parse script + * fixed Ticket #1071 [ExtendedFileManager] external image URL image inserted with width/height 0, amking it invisible + * fixed Ticket #1074 [SuperClean] throws warnings in PHP 5 + * fixed Ticket #1079 [DynamicCSS] lists Xinha internal CSS + * fixed Ticket #1080 Some plugins leave behind stylesheet links in fullpage mode + * fixed Ticket #1083 Convert URLs to links - Error + * fixed Ticket #1084 URL auto-linking (Gecko): URLs with user:password@domain.tld falsely recognized as email address + * fixed Ticket #1085 URL auto-linking (Gecko): IP numbers don't work + * fixed Ticket #1081 Control character is not being removed inside SCRIPT tags or HEAD when switching from textmode to htmlmode + * fixed Ticket #1078 [InsertImage] spacing attributes: inconsistent behaviour when editing image + * fixed Ticket #1089 [Color Picker] Localize OK Label + * fixed Ticket #1091 [SaveSubmit] does not correctly submit value of checkboxes and radio buttons + +Xinha 0.93 + - fixed Ticket #967 Font Color Picker stops working after using one of ImageManager, ExtendedFileManager, FullPage, or HorizontalRule + - fixed Ticket #965 When switching between Xinhas in the same page, in textmode toolbar stays disabled + - fixwd Ticket #963 DOMwalk IE: head tag attributes without quotes and closing slash + - Ticket #962 DOMwalk Mozilla: improved source indentation + - fixed Ticket #957 If item in in xinha_editors is not a textarea: skip gracefully + - fixed Ticket #900: catch an fatal error that occured sometimes when switching between modes in fullpage mode in Mozilla + - fixed Ticket #969 DOMwalk Gecko: line breaks rendered as
s inside
 blocks
+ - fixed Ticket #976 Loading message misplaced in IE7
+ - fixed Ticket #977 TableOperations toolbar off-place in ext_example.html
+ - fixed Ticket #978 defining a padding for s in global css affects Xinha framework
+ - Ticket #979 improve checking for non-supported browsers
+ - fixed Ticket #934 SuperClean plugin returns just quotation when executed on localhost
+ - Ticket #929 Save changes on page unload fixed for Mozilla 
+ - fixed Ticket #980 ImageManager color format bug
+ - fixed Ticket #981 No doctype in iframe content document/ editor always in quirks mode
+ - fixed Ticket #543 Stylist Panel overflow broken
+ - Ticket #983 added id for iframe
+ - fixed Ticket #984 !ExtendedFileManager produces php warning
+ - optimized icon file size
+ - fixed !JavaScript error in !ImageManager/!ExtendedFileManager image editor
+ - Ticket #908* Prompts broken in IE7: fixed for EFM, !ImageManager & !TableOperations
+ - Fixes for TableOperations, tickets #82, #908*, #912 and #947
+ - fixed Ticket #998* whitespace added before and/or after content (in non-fullpage mode)
+ - fixed slow unloading in Mozilla
+ - Fix focus problem when switching from html to wysiwyg in Gecko. See ticket #900.
+ - fixed toolbar floating issue
+ - fixed #1003 HTML length limited to 1024 characters with plugin CharCounter
+ - Ticket #1000 new public methods for getting/setting editor content
+ - fixed #735 - IE eating scripts and comments at the beginning of pages.
+ - Added new config variables to set iframe width if less than editor width (ticket:322) and set alignment of toolbar buttons.
+ - added Basque translation for XinhaCore
+ - prevent an error if server is set to parse .js files as PHP
+ - Ticket #127 plugin HtmlEntities: Entities.js  file corrupt
+
+Xinha 0.92beta
+ - fixed Ticket #831 stop empty anchors from being removed
+ - Make htmlarea.js just load XinhaCore.js instead of being a copy of it.
+ - fixed Ticket #445 Toggle TableBorder doesn't work if this.fullpage=true or using FullPage plugin
+ - fixed Ticket #551 shape and coord attributes of area element are ignored by IE
+ - fixed Ticket #650 SpellChecker is not compatible with FullPage plugin
+ - fixed Ticket #816 CharacterMap and ListType panel modes make editor jump to top in IE
+ - fixed Ticket #570 change behaviour of justify when an image is selected to make the image float left/right, 
+   click the justify button again to undo it
+ - fixed Ticket #891 noscript content got escaped
+ - fixed Ticket #857 Firefox fails to load in fullpage mode when  tag in wrong place.
+ - fixed Ticket #841 Spell Checker - Won't return to xinha.
+ - fixed Ticket #914 All buttons stay grey & this.getParentElement is not a function message when not calling
+   Xinha.loadPlugins() in xinha_init function
+ - fixed Ticket #911 Background color does not work in Firefox
+ - fixed Ticket #912 an error is thrown in Mozilla when clicking merge cells button and fewer than 2 cells are selected
+ - fixed Ticket #816 CharacterMap and ListType panel modes make editor jump to top in IE
+ - fixed Ticket #917 getHTMLWrapper in IE renders attributes like _stylist_usedtobe="[object Object]"
+ - fixed Ticket #556 stripBaseHref didn't work without baseHref defined explicitly.
+ - Update InsertPicture plugin Update
+ - fixed Ticket #921 EFM extended file manager - iframe height problem (IE)
+ - Ticket #923 colorPicker face lift & localisation
+ - fixed Ticket #924 EFM + ImageManager re-transforming of url to original image after automatic resize broken
+ - Ticket #900- retain editing position position between modes
+ - fixed Ticket #928 ImageManager fails if (another) Files.php exists in include path
+ - fixed Ticket #935 EFM demo_images php upload allowed: possible security risk
+ - Ticket #939 Japanese langage support 
+ - fixed Ticket #3 Horizontal Rule Selection
+ - Plugin ExtendedFileManager: added doc to allowed upload extensions
+ - Plugin PasteText update
+ - Plugin HtmlEntities: default preset iso-8859-1
+ - fixed Ticket #948 IE: inline styles are not rendered by DOMwalk getHTML()
+ - Plugin HorizontalRule update
+ - Plugin SaveSubmit update
+ - Plugin Linker update
+ - fixed Ticket #823 editor contents was not submitted when using JavaScript form.submit() without prior form.onsubmit()
+ - fixed Ticket #459 all body attributes removed in full page mode in FireFox
+ - _editor_url is now converted to absolute if it is relative. 
+ - fixed Ticket #594 IE: insertHTML() inserts HTML outside editor when editor is not focussed
+ - Ticket #954 FullScreen mode can now be called programmatically or on startup with or without button
+ - fixed Ticket #321 FullScreen : select elements show through in IE6 
+ - fixed Ticket #953 Statusbar has ugly white gap at the bottom when switching back from full screen in IE 
+ - fixed Ticket #952 FullScreen: scrollbars don't disappear in IE in QuirksMode
+ - fixed Ticket #603 Popop Dialog Height problems
+ - fixed Ticket #955 DOMwalk getHTML outputs empty attribute with value "true" instead of attribute name and some are skipped at all
+ 
+Xinha 0.91beta
+ - changed namespace from HTMLArea to Xinha
+ - the core file is now named XinhaCore.js instead of htmlarea.js,
+   please change your pages accordingly (the htmlarea.js will be removed!)
+ - the color picker script is now loaded on demand to reduce initial loading time
+ 
+Xinha 0.9beta
+This equals Xinha revision 635 of Jan 11 2007
+ - All JavaScript files over 2kb have been compressed using the dojo JavaScript compressor
+ - All gifs have been optimized using Trout's GIF Optimizer version 2.3
\ No newline at end of file
Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/compress.bat
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/compress.bat,v
diff -u -N
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/compress.bat	3 Jan 2016 20:46:25 -0000	1.1.2.1
@@ -0,0 +1,7 @@
+@echo off
+FOR %%V IN (%*) DO copy %%V %%V_uncompressed.js
+FOR %%V IN (%*) DO java -jar %~p0dojo_js_compressor.jar -c %%V_uncompressed.js > %%V 2>&1
+
+FOR %%V IN (%*) DO del %%V_uncompressed.js
+
+# pause
\ No newline at end of file
Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/compress.php
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/compress.php,v
diff -u -N
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/compress.php	3 Jan 2016 20:46:25 -0000	1.1.2.1
@@ -0,0 +1,99 @@
+";
+
+$prefix = "/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */";
+if ($version) $prefix .= "\n/* This file is part of version $version released $date */";
+
+$core_prefix = '
+  /*--------------------------------------------------------------------------
+    --  Xinha (is not htmlArea) - http://xinha.org
+    --
+    --  Use of Xinha is granted by the terms of the htmlArea License (based on
+    --  BSD license)  please read license.txt in this package for details.
+    --
+    --  Copyright (c) 2005-2008 Xinha Developer Team and contributors
+    --  
+    --  Xinha was originally based on work by Mihai Bazon which is:
+    --      Copyright (c) 2003-2004 dynarch.com.
+    --      Copyright (c) 2002-2003 interactivetools.com, inc.
+    --      This copyright notice MUST stay intact for use.
+    -------------------------------------------------------------------------*/
+';
+foreach ($return as $file)
+{
+	set_time_limit ( 60 ); 
+	print "Processed $file
"; + flush(); + $file_url = $repository_url.str_replace($root_dir,'',$file); + + copy($file,$file."_uncompr.js"); + + $file_prefix = $prefix."\n/* The URL of the most recent version of this file is $file_url */"; + + exec("echo \"".(preg_match('/XinhaCore.js$/',$file) ? $file_prefix.$core_prefix : $file_prefix)."\" > $file && java -jar ${cwd}/dojo_js_compressor.jar -c ${file}_uncompr.js >> $file 2>&1"); + if (preg_match('/js: ".*?", line \d+:/',file_get_contents($file)) || preg_match('/sh: java: command not found/', file_get_contents($file))) + { + unlink($file); + rename($file."_uncompr.js",$file); + } + else + { + unlink($file."_uncompr.js"); + } + +} +print "Operation complete." +?> Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/compress_yui.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/compress_yui.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/compress_yui.php 3 Jan 2016 20:46:25 -0000 1.1.2.1 @@ -0,0 +1,107 @@ +"; + +$prefix = "/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */"; +if ($version) $prefix .= "\n/* This file is part of version $version released $date */"; +$core_prefix = ' + /*-------------------------------------------------------------------------- + -- Xinha (is not htmlArea) - http://xinha.org + -- + -- Use of Xinha is granted by the terms of the htmlArea License (based on + -- BSD license) please read license.txt in this package for details. + -- + -- Copyright (c) 2005-'.date('Y').' Xinha Developer Team and contributors + -- + -- Xinha was originally based on work by Mihai Bazon which is: + -- Copyright (c) 2003-2004 dynarch.com. + -- Copyright (c) 2002-2003 interactivetools.com, inc. + -- This copyright notice MUST stay intact for use. + -------------------------------------------------------------------------*/ +'; + +foreach ($return as $file) +{ + set_time_limit ( 60 ); + print "Processing $file\n"; + flush(); + + $file_url = $repository_url.str_replace($xinha_root,'',$file); + + copy($file,$file."_uncompr.js"); + + $file_prefix = $prefix."\n/* The URL of the most recent uncompressed version of this file is $file_url */"; + $ext = preg_replace('/.*?(\.js|\.css)$/','$1',$file); + + file_put_contents($file."_uncompr${ext}", preg_replace('/(\/\/[^\n]*)?(?![*])\\\[\n]/','',file_get_contents($file))); + + passthru("echo \"".(preg_match('/XinhaCore.js$/',$file) ? $file_prefix.$core_prefix : $prefix)."\" > $file && java -jar {$xinha_root}/contrib/yuicompressor-2.4.2.jar --charset UTF-8 ${file}_uncompr${ext} >> $file 2>&1"); + if (preg_match('/\d+:\d+:syntax error/',file_get_contents($file)) || preg_match('/sh: java: command not found/', file_get_contents($file))) + { + unlink($file); + rename($file."_uncompr${ext}",$file); + } + else + { + unlink($file."_uncompr${ext}"); + } + +} +print "Operation complete." +?> Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/compression_readme.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/compression_readme.txt,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/compression_readme.txt 3 Jan 2016 20:46:25 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +You can use the compress.php to batch-convert the current Xinha snapshot. +You can use the compress.bat to compress JavaScript files by drag&drop in Windows. + +Please be aware that the language files cannot be compressed. + +If you want the original files to be kept, open compress.bat and remvove the # in the line +# FOR %%V IN (%*) DO del %%V_uncompressed.js \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/lc_merge_strings.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/lc_merge_strings.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/lc_merge_strings.php 3 Jan 2016 20:46:26 -0000 1.1.2.1 @@ -0,0 +1,178 @@ +, 2009-08-16 + +// Distributed under the same terms as Xinha itself. +// This notice MUST stay intact for use (see license.txt). + +// merge-strings.php - merge translation strings from master into +// individual language files. + + +function usage() +{ + print "merge-strings.php - merge translation strings\n"; + print "Options:\n"; + print " -l xx Process language xx. Required option\n"; + print " -m master Master file. Defaults to 'de.js'\n"; + print " -m base Base directory. Defaults to '..'\n"; + print " -v Verbose\n"; + print " -c Tell about files that must be created\n"; + print " -d Debug. Very noisy\n"; + exit(1); +} + +// This function taken from the php.net manual page for glob + +function rglob($pattern='*', $flags = 0, $path='') +{ + $paths=glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT); + $files=glob($path.$pattern, $flags); + foreach ($paths as $path) + { + $files=array_merge($files,rglob($pattern, $flags, $path)); + } + return $files; +} + +error_reporting(E_ALL); + +$opts = getopt('l:b:m:cvd'); + +if ($opts === false) usage; +// here we should check extra options, but php lacks that functionality + +$lang = 'xx'; // The language we process +$create = 0; // Tell about missing files? +$verbose = 0; // Log the details to stdout? +$debug = 0; // ? +$basedir = '..'; // Base directory to process +$mastername = 'de.js'; // The best bet on a complete translation file + +if (isset($opts['l'])) $lang = $opts['l']; +else die("Missing -l option\n"); +if (isset($opts['c'])) $create = 1; +if (isset($opts['v'])) $verbose = 1; +if (isset($opts['d'])) $debug = 1; +if (isset($opts['b'])) $basedir = $opts['b']; +if (isset($opts['m'])) $mastername = $opts['m']; + +if (!preg_match('#/$#', $basedir)) $basedir .= '/'; + +// So, find all the master files + +$files = rglob($mastername, 0, $basedir); +if (count($files) == 0) +{ + print "No master files found. Check your -b and -m options!\n"; + exit(1); +} + +// and process them + +$filenum = 0; +foreach ($files as $masterjs) +{ + $langjs = preg_replace("/$mastername/", "$lang.js", $masterjs); + $langnew = $langjs.'.new'; + + if (!file_exists($langjs)) + { + if ($create) print "Missing file: $langjs\n"; + continue; + } + + // Populate $trans with the strings that must be translated + + $filenum++; + $min = fopen($masterjs, "r"); + $trans = array(); + $strings = 0; + while ($str = fgets($min)) + { + $str = trim($str); + if (preg_match('#^ *"([^"]*)" *: *"([^"]*)"(,)? *(//.*)?$#', $str, $m)) + { + if (isset($trans[$m[1]])) + { + print "Duplicate string in $masterjs: $m[1]\n"; + continue; + } + if ($debug) print "Translate: $m[1]\n"; + $trans[$m[1]] = 1; + $strings++; + } + } + fclose($min); + + // Now copy from $lin to $lout while verifying that the strings + // are still current. + // Break out when we hit the last string in the master (no ',' + // after the translation. + + $lin = fopen($langjs, "r"); + $lout = fopen($langnew, "w"); + $obsolete = 0; + $new = 0; + $kept = 0; + while ($fstr = fgets($lin)) + { + $str = trim($fstr); + if (preg_match('#^ *"([^"]*)" *: *"([^"]*)"(,)? *(//.*)?$#', $str, $m)) + { + if (!isset($trans[$m[1]])) + { + if ($verbose) print "Obsolete: $m[1]\n"; + $obsolete++; + fprintf($lout, " // \"%s\": \"%s\" // OBSOLETE\n", $m[1], $m[2]); + } + else + { + if ($debug) print "Keep: $m[1]\n"; + unset($trans[$m[1]]); + $strings--; + $kept++; + fprintf($lout, " \"%s\": \"%s\"%s\n", $m[1], $m[2], $strings ? ',' : ''); + } + if (!isset($m[3]) || $m[3] != ',') + break; + } + else + fprintf($lout, "%s", $fstr); + } + + // Add the strings that are missing + + foreach ($trans as $tr => $v) + { + if ($verbose) print("New: $tr\n"); + $new++; + $strings--; + fprintf($lout, " \"%s\": \"%s\"%s // NEW\n", $tr, $tr, $strings ? ',' : ''); + } + + // And then the final part of $lin + + while ($str = fgets($lin)) + fprintf($lout, "%s", $str); + + // Clean up, and tell user what happened + + fclose($lin); + fclose($lout); + + if ($obsolete == 0 && $new == 0) + { + if ($verbose) print "$langjs: Unchanged\n"; + unlink($langnew); + } + else + { + print "$langnew: $new new, $obsolete obsoleted, $kept unchanged entries.\n"; + // rename($langnew, $langjs); + } +} + +print "$filenum files processed.\n"; + +?> Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/lc_parse_strings.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/lc_parse_strings.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/lc_parse_strings.php 3 Jan 2016 20:46:26 -0000 1.1.2.1 @@ -0,0 +1,325 @@ +"; + while(!feof($fp)) { + $data .= fread($fp, 1024); + } + preg_match_all('#_lc\("([^"]+)"|_lc\(\'([^\']+)\'#', $data, $m); + foreach($m[1] as $i) { + if(trim(strip_tags($i))=="") continue; + $ret[] = $i; + } + foreach($m[2] as $i) { + if(trim(strip_tags($i))=="") continue; + $ret[] = $i; + } + } + } + + if($plugin=="TableOperations") + { + preg_match_all('#options = \\[([^\\]]+)\\];#', $data, $m); + foreach($m[1] as $i) { + preg_match_all('#"([^"]+)"#', $i, $m1); + foreach($m1[1] as $i) { + $ret[] = $i; + } + } + + //["cell-delete", "td", "Delete cell"], + preg_match_all('#\\["[^"]+",[ \t]*"[^"]+",[ \t]*"([^"]+)"\\]#', $data, $m); + foreach($m[1] as $i) { + $ret[] = $i; + } + } + + + $files = getFiles("$pluginDir/", "html$"); + $files = array_merge($files, getFiles("$pluginDir/", "php$")); + foreach($files as $file) + { + $ret = array_merge($ret, parseHtmlFile($file, $plugin)); + } + + $files = getFiles("$pluginDir/popups/", "html$"); + foreach($files as $file) + { + $ret = array_merge($ret, parseHtmlFile($file, $plugin)); + } + $ret = array_unique($ret); + + $langData[$plugin] = $ret; +} + +$plugins = getFiles("../modules/"); +foreach($plugins as $pluginDir) { + $plugin = substr($pluginDir, 12); + $ret = array(); + $files = getFiles("$pluginDir/", "js$"); + foreach($files as $file) + { + $fp = fopen($file, "r"); + $data = ""; + if($fp) { + echo "$file open...
"; + while(!feof($fp)) { + $data .= fread($fp, 1024); + } + preg_match_all('#_lc\("([^"]+)"|_lc\(\'([^\']+)\'#', $data, $m); + foreach($m[1] as $i) { + if(trim(strip_tags($i))=="") continue; + $ret[] = $i; + } + foreach($m[2] as $i) { + if(trim(strip_tags($i))=="") continue; + $ret[] = $i; + } + } + } + $ret = array_unique($ret); + $langData[$plugin] = $ret; +} + + +foreach($langData as $plugin=>$strings) { + if(sizeof($strings)==0) continue; + + + $data = "// I18N constants\n"; + $data .= "//\n"; + $data .= "// LANG: \"base\", ENCODING: UTF-8\n"; + $data .= "// Author: Translator-Name, \n"; + $data .= "//\n"; + $data .= "// Last revision: 06 september 2007\n"; + $data .= "// Please don´t remove this information\n"; + $data .= "// If you modify any source, please insert a comment with your name and e-mail\n"; + $data .= "//\n"; + $data .= "// Distributed under the same terms as HTMLArea itself.\n"; + $data .= "// This notice MUST stay intact for use (see license.txt).\n"; + $data .= "//\n"; + $data .= "// (Please, remove information below)\n"; + $data .= "// FOR TRANSLATORS:\n"; + $data .= "//\n"; + $data .= "// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\n"; + $data .= "// (at least a valid email address)\n"; + $data .= "//\n"; + $data .= "// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\n"; + $data .= "// (if this is not possible, please include a comment\n"; + $data .= "// that states what encoding is necessary.)\n"; + $data .= "\n"; + $data .= "{\n"; + sort($strings); + foreach($strings as $string) { + $string = str_replace(array('\\', '"'), array('\\\\', '\\"'), $string); + $data .= " \"".$string."\": \"\",\n"; + } + $data = substr($data, 0, -2); + $data .= "\n"; + $data .= "}\n"; + + if($plugin=="HTMLArea") { + $file = "../lang/base.js"; + $fp = fopen($file, "w"); + if(!$fp) continue; + fwrite($fp, $data); + fclose($fp); + echo "$file written...
"; + } elseif (($plugin=="InternetExplorer")||($plugin=="InsertTable")||($plugin=="InsertImage")||($plugin=="GetHtml")||($plugin=="Gecko")||($plugin=="Dialogs")||($plugin=="CreateLink")||($plugin=="ColorPicker")) { + $file = "../modules/$plugin/lang/base.js"; + $fp = fopen($file, "w"); + if(!$fp) continue; + fwrite($fp, $data); + fclose($fp); + echo "$file written...
"; + } elseif ($plugin=="FullScreen") { + $file = "../modules/$plugin/lang/base.js"; + $fp = fopen($file, "w"); + if(!$fp) continue; + fwrite($fp, $data); + fclose($fp); + echo "$file written...
"; + $file = "../plugins/$plugin/lang/base.js"; + $fp = fopen($file, "w"); + if(!$fp) continue; + fwrite($fp, $data); + fclose($fp); + echo "$file written...
"; + } else { + $file = "../plugins/$plugin/lang/base.js"; + $fp = fopen($file, "w"); + if(!$fp) continue; + fwrite($fp, $data); + fclose($fp); + echo "$file written...
"; + } +} + + + + +function parseHtmlFile($file, $plugin="") +{ + $ret = array(); + + $fp = fopen($file, "r"); + if(!$fp) { + die("invalid fp"); + } + $data = ""; + while(!feof($fp)) { + $data .= fread($fp, 1024); + } + + if($plugin=="FormOperations" || $plugin=="SuperClean" || $plugin=="Linker") { + //-tags for inline-dialog or panel-dialog based dialogs + $elems = array("l10n"); + } else { + $elems = array("title", "input", "select", "legend", "span", "option", "td", "button", "div", "label"); + } + foreach($elems as $elem) { + preg_match_all("#<{$elem}[^>]*>([^<^\"]+)#i", $data, $m); + foreach($m[1] as $i) { + if(trim(strip_tags($i))=="") continue; + if($i=="/") continue; + if($plugin=="ImageManager" && preg_match('#^--+$#', $i)) continue; //skip those ------ + if($plugin=="CharacterMap" && preg_match('#&[a-z0-9]+;#i', trim($i)) || $i=="@") continue; + if($plugin=="SpellChecker" && preg_match('#^\'\\.\\$[a-z]+\\.\'$#', $i)) continue; + $ret[] = trim($i); + } + } + + if($plugin=="FormOperations" || $plugin=="SuperClean" || $plugin=="Linker") + { + //_( for inline-dialog or panel-dialog based dialogs + preg_match_all('#"_\(([^"]+)\)"#i', $data, $m); + foreach($m[1] as $i) { + if(trim($i)=="") continue; + $ret[] = $i; + } + } + else + { + preg_match_all('#title="([^"]+)"#i', $data, $m); + foreach($m[1] as $i) { + if(trim(strip_tags($i))=="") continue; + if(strip_tags($i)==" - ") continue; //skip those - (ImageManager) + $ret[] = $i; + } + } + return($ret); +} + + +function getFiles($rootdirpath, $eregi_match='') { + $array = array(); + if ($dir = @opendir($rootdirpath)) { + $array = array(); + while (($file = readdir($dir)) !== false) { + if($file=="." || $file==".." || $file==".svn") continue; + if($eregi_match=="") + $array[] = $rootdirpath."/".$file; + else if(eregi($eregi_match,$file)) + $array[] = $rootdirpath."/".$file; + + } + closedir($dir); + } + return $array; +} + + + + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/php-xinha.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/php-xinha.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/php-xinha.php 3 Jan 2016 20:46:26 -0000 1.1.2.1 @@ -0,0 +1,219 @@ + + * with (xinha_config.ImageManager) + * { + * '/home/your/directory', + * 'images_url' => '/directory' + * ) + * ) + * ?> + * } + * + * + */ + + function xinha_pass_to_php_backend($Data, $KeyLocation = 'Xinha:BackendKey', $ReturnPHP = FALSE) + { + + $bk = array(); + $bk['data'] = serialize($Data); + + @session_start(); + if(!isset($_SESSION[$KeyLocation])) + { + $_SESSION[$KeyLocation] = uniqid('Key_'); + } + + $bk['session_name'] = session_name(); + $bk['key_location'] = $KeyLocation; + $bk['hash'] = + function_exists('sha1') ? + sha1($_SESSION[$KeyLocation] . $bk['data']) + : md5($_SESSION[$KeyLocation] . $bk['data']); + + + // The data will be passed via a postback to the + // backend, we want to make sure these are going to come + // out from the PHP as an array like $bk above, so + // we need to adjust the keys. + $backend_data = array(); + foreach($bk as $k => $v) + { + $backend_data["backend_data[$k]"] = $v; + } + + // The session_start() above may have been after data was sent, so cookies + // wouldn't have worked. + $backend_data[session_name()] = session_id(); + + if($ReturnPHP) + { + return array('backend_data' => $backend_data); + } + else + { + echo 'backend_data = ' . xinha_to_js($backend_data) . "; \n"; + } + } + + /** Convert PHP data structure to Javascript */ + + function xinha_to_js($var, $tabs = 0) + { + if(is_numeric($var)) + { + return $var; + } + + if(is_string($var)) + { + return "'" . xinha_js_encode($var) . "'"; + } + + if(is_bool($var)) + { + return $var ? 'true': 'false'; + } + + if(is_array($var)) + { + $useObject = false; + foreach(array_keys($var) as $k) { + if(!is_numeric($k)) $useObject = true; + } + $js = array(); + foreach($var as $k => $v) + { + $i = ""; + if($useObject) { + if(preg_match('#^[a-zA-Z]+[a-zA-Z0-9]*$#', $k)) { + $i .= "$k: "; + } else { + $i .= "'$k': "; + } + } + $i .= xinha_to_js($v, $tabs + 1); + $js[] = $i; + } + if($useObject) { + $ret = "{\n" . xinha_tabify(implode(",\n", $js), $tabs) . "\n}"; + } else { + $ret = "[\n" . xinha_tabify(implode(",\n", $js), $tabs) . "\n]"; + } + return $ret; + } + + return 'null'; + } + + /** Like htmlspecialchars() except for javascript strings. */ + + function xinha_js_encode($string) + { + static $strings = "\\,\",',%,&,<,>,{,},@,\n,\r"; + + if(!is_array($strings)) + { + $tr = array(); + foreach(explode(',', $strings) as $chr) + { + $tr[$chr] = sprintf('\x%02X', ord($chr)); + } + $strings = $tr; + } + + return strtr($string, $strings); + } + + + /** Used by plugins to get the config passed via + * xinha_pass_to_backend() + * returns either the structure given, or NULL + * if none was passed or a security error was encountered. + */ + + function xinha_read_passed_data($KeyLocation = 'Xinha:BackendKey') + { + if(isset($_REQUEST['backend_data']) && is_array($_REQUEST['backend_data'])) + { + $bk = $_REQUEST['backend_data']; + session_name($bk['session_name']); + @session_start(); + if(!isset($_SESSION[$bk['key_location']])) return NULL; + + if($KeyLocation !== $bk['key_location']) + { + trigger_error('Programming Error - please contact the website administrator/programmer to alert them to this problem. A non-default backend key location is being used to pass backend data to Xinha, but the same key location is not being used to receive data. The special backend configuration has been ignored. To resolve this, find where you are using xinha_pass_to_php_backend and remove the non default key, or find the locations where xinha_read_passed_data is used (in Xinha) and add a parameter with the non default key location, or edit contrib/php-xinha.php and change the default key location in both these functions. See: http://trac.xinha.org/ticket/1518', E_USER_ERROR); + return NULL; + } + + if($bk['hash'] === + function_exists('sha1') ? + sha1($_SESSION[$bk['key_location']] . $bk['data']) + : md5($_SESSION[$bk['key_location']] . $bk['data'])) + { + return unserialize(ini_get('magic_quotes_gpc') ? stripslashes($bk['data']) : $bk['data']); + } + } + + return NULL; + } + + /** Used by plugins to get a query string that can be sent to the backend + * (or another part of the backend) to send the same data. + */ + + function xinha_passed_data_querystring() + { + $qs = array(); + if(isset($_REQUEST['backend_data']) && is_array($_REQUEST['backend_data'])) + { + foreach($_REQUEST['backend_data'] as $k => $v) + { + $v = ini_get('magic_quotes_gpc') ? stripslashes($v) : $v; + $qs[] = "backend_data[" . rawurlencode($k) . "]=" . rawurlencode($v); + } + } + + $qs[] = session_name() . '=' . session_id(); + return implode('&', $qs); + } + + + /** Just space-tab indent some text */ + function xinha_tabify($text, $tabs) + { + if($text) + { + return str_repeat(" ", $tabs) . preg_replace('/\n(.)/', "\n" . str_repeat(" ", $tabs) . "\$1", $text); + } + } + + /** Return upload_max_filesize value from php.ini in kilobytes (function adapted from php.net)**/ + function upload_max_filesize_kb() + { + $val = ini_get('upload_max_filesize'); + $val = trim($val); + $last = strtolower($val{strlen($val)-1}); + switch($last) + { + // The 'G' modifier is available since PHP 5.1.0 + case 'g': + $val *= 1024; + case 'm': + $val *= 1024; + } + return $val; +} +?> Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/test_server.py =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/test_server.py,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/contrib/test_server.py 3 Jan 2016 20:46:26 -0000 1.1.2.1 @@ -0,0 +1,61 @@ +#!/usr/bin/python +"""Runs a very basic file server so that we can test Xinha. By default, the +server runs on port 8080, but you can pass the -p or --port option to change +the port used.""" + +import os +import SimpleHTTPServer +import SocketServer + +# File server for testing Xinha + +def __main(): + """Use the embed_url.py program from the command-line + + The embed_url.py program downloads files and processes links in the case of + HTML files. See embed_url.py -h for more info. This procedure has the + sole purpose of reading in and verifying the command-line arguments before + passing them to the embed_url funtion.""" + + from getopt import getopt, GetoptError + from sys import argv, exit, stderr + + try: + options, arguments = getopt(argv[1:], "p:", ["port="]) + except GetoptError: + print "Invalid option" + __usage() + exit(2) + + PORT = 8080 + for option, value in options: + if option in ("-p", "--port"): + try: + PORT = int(value) + except ValueError: + print "'%s' is not a valid port number" % value + __usage() + exit(2) + + # SimpleHTTPRequestHandler serves data from the current directory, so if we + # are running from inside contrib, we have to change our current working + # directory + if os.path.split(os.getcwd())[1] == 'contrib': + os.chdir('..') + + Handler = SimpleHTTPServer.SimpleHTTPRequestHandler + + httpd = SocketServer.TCPServer(("", PORT), Handler) + + print "Serving at port %s" % PORT + print "Try viewing the example at http://localhost:%s/examples/Newbie.html" % PORT + httpd.serve_forever() + +def __usage(): + """ + Print the usage information contained in the module docstring + """ + print __doc__ + +if __name__ == '__main__': + __main() Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/Extended.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/Extended.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/Extended.html 3 Jan 2016 20:46:26 -0000 1.1.2.1 @@ -0,0 +1,317 @@ + + + + Settings + + + + + + + + +
Settings
+
+
+ Xinha options + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ CharacterMap options + + +
+ +
+ ListType options + + +
+ +
+ CharCounter options + +
+ +
+ +
+
+
+ +
+ + +
+
+ + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ExtendedDemo.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ExtendedDemo.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ExtendedDemo.html 3 Jan 2016 20:46:27 -0000 1.1.2.1 @@ -0,0 +1,16 @@ + +Xinha Extended Example + + + + + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/Newbie.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/Newbie.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/Newbie.html 3 Jan 2016 20:46:27 -0000 1.1.2.1 @@ -0,0 +1,22 @@ + + + + Xinha Newbie Guide + + + + + + + + +
+
+ +
+
+ + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/XinhaConfig.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/XinhaConfig.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/XinhaConfig.js 3 Jan 2016 20:46:27 -0000 1.1.2.1 @@ -0,0 +1,134 @@ +xinha_editors = null; +xinha_init = null; +xinha_config = null; +xinha_plugins = null; + +// This contains the names of textareas we will make into Xinha editors +xinha_init = xinha_init ? xinha_init : function() +{ + /** STEP 1 *************************************************************** + * First, specify the textareas that shall be turned into Xinhas. + * For each one add the respective id to the xinha_editors array. + * I you want add more than on textarea, keep in mind that these + * values are comma seperated BUT there is no comma after the last value. + * If you are going to use this configuration on several pages with different + * textarea ids, you can add them all. The ones that are not found on the + * current page will just be skipped. + ************************************************************************/ + + xinha_editors = xinha_editors ? xinha_editors : + [ + 'myTextArea', 'anotherOne' + ]; + + /** STEP 2 *************************************************************** + * Now, what are the plugins you will be using in the editors on this + * page. List all the plugins you will need, even if not all the editors + * will use all the plugins. + * + * The list of plugins below is a good starting point, but if you prefer + * a simpler editor to start with then you can use the following + * + * xinha_plugins = xinha_plugins ? xinha_plugins : [ ]; + * + * which will load no extra plugins at all. + ************************************************************************/ + + xinha_plugins = xinha_plugins ? xinha_plugins : + [ + 'CharacterMap', + 'ContextMenu', + 'SmartReplace', + 'Stylist', + 'ExtendedFileManager', + 'Linker', + 'SuperClean', + 'TableOperations' + ]; + + // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :) + if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return; + + + /** STEP 3 *************************************************************** + * We create a default configuration to be used by all the editors. + * If you wish to configure some of the editors differently this will be + * done in step 5. + * + * If you want to modify the default config you might do something like this. + * + * xinha_config = new Xinha.Config(); + * xinha_config.width = '640px'; + * xinha_config.height = '420px'; + * + * + * For a list of the available configuration options, see: + * http://trac.xinha.org/wiki/Documentation/ConfigVariablesList + * + *************************************************************************/ + + xinha_config = xinha_config ? xinha_config() : new Xinha.Config(); + + //this is the standard toolbar, feel free to remove buttons as you like + xinha_config.toolbar = + [ + ["popupeditor"], + ["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"], + ["separator","forecolor","hilitecolor","textindicator"], + ["separator","subscript","superscript"], + ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"], + ["separator","insertorderedlist","insertunorderedlist","outdent","indent"], + ["separator","inserthorizontalrule","createlink","insertimage","inserttable"], + ["linebreak","separator","undo","redo","selectall","print"], (Xinha.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]), + ["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright", "righttoleft"], + ["separator","htmlmode","showhelp","about"] + ]; + + // To adjust the styling inside the editor, we can load an external stylesheet like this + // NOTE : YOU MUST GIVE AN ABSOLUTE URL + xinha_config.pageStyleSheets = [ _editor_url + "examples/files/full_example.css" ]; + //if you're using Stylist, import a stylesheet like this + xinha_config.stylistLoadStylesheet(_editor_url + "examples/files/stylist.css"); + + + /** STEP 4 *************************************************************** + * We first create editors for the textareas. + * + * You can do this in two ways, either + * + * xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); + * + * if you want all the editor objects to use the same set of plugins, OR; + * + * xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config); + * xinha_editors.myTextArea.registerPlugins(['Stylist']); + * xinha_editors.anotherOne.registerPlugins(['CSS','SuperClean']); + * + * if you want to use a different set of plugins for one or more of the + * editors. + ************************************************************************/ + + xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); + + /** STEP 5 *************************************************************** + * If you want to change the configuration variables of any of the + * editors, this is the place to do that, for example you might want to + * change the width and height of one of the editors, like this... + * + * xinha_editors.myTextArea.config.width = '640px'; + * xinha_editors.myTextArea.config.height = '480px'; + * + ************************************************************************/ + + + /** STEP 6 *************************************************************** + * Finally we "start" the editors, this turns the textareas into + * Xinha editors. + ************************************************************************/ + + Xinha.startEditors(xinha_editors); +} + +Xinha.addOnloadHandler(xinha_init); // this executes the xinha_init function on page load + // and does not interfere with window.onload properties set by other scripts + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/custom.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/custom.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/custom.css 3 Jan 2016 20:46:27 -0000 1.1.2.1 @@ -0,0 +1,40 @@ + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- CSS plugin example CSS file. This file is used by full_example.js + -- when the CSS plugin is included in an auto-generated example. + -- @TODO Make this CSS more useful. + -- + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/examples/custom.css $ + -- $LastChangedDate: 2007-01-20 11:24:36 +1300 (Sat, 20 Jan 2007) $ + -- $LastChangedRevision: 677 $ + -- $LastChangedBy: ray $ + --------------------------------------------------------------------------*/ + +body { background-color: #234; color: #dd8; font-family: tahoma; font-size: 12px; } + +a:link, a:visited { color: #8cf; } +a:hover { color: #ff8; } + +h1 { background-color: #456; color: #ff8; padding: 2px 5px; border: 1px solid; border-color: #678 #012 #012 #678; } + +/* syntax highlighting (used by the first combo defined for the CSS plugin) */ + +pre { margin: 0px 1em; padding: 5px 1em; background-color: #000; border: 1px dotted #02d; border-left: 2px solid #04f; } +.code { color: #f5deb3; } +.string { color: #00ffff; } +.comment { color: #8fbc8f; } +.variable-name { color: #fa8072; } +.type { color: #90ee90; font-weight: bold; } +.reference { color: #ee82ee; } +.preprocessor { color: #faf; } +.keyword { color: #ffffff; font-weight: bold; } +.function-name { color: #ace; } +.html-tag { font-weight: bold; } +.html-helper-italic { font-style: italic; } +.warning { color: #ffa500; font-weight: bold; } +.html-helper-bold { font-weight: bold; } + +/* info combo */ + +.quote { font-style: italic; color: #ee9; } +.highlight { background-color: yellow; color: #000; } +.deprecated { text-decoration: line-through; color: #aaa; } Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/dynamic.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/dynamic.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/dynamic.css 3 Jan 2016 20:46:27 -0000 1.1.2.1 @@ -0,0 +1,56 @@ + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- DynamicCSS plugin example CSS file. Used by full_example.js + -- when the DynamicCSS plugin is included in an auto-generated example. + -- @TODO Make this CSS more useful. + -- + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/examples/dynamic.css $ + -- $LastChangedDate: 2007-01-20 11:24:36 +1300 (Sat, 20 Jan 2007) $ + -- $LastChangedRevision: 677 $ + -- $LastChangedBy: ray $ + --------------------------------------------------------------------------*/ + +p { + FONT-FAMILY: Arial, Helvetica; + FONT-SIZE: 9pt; + FONT-WEIGHT: normal; + COLOR: #000000; +} + +p.p1 { + FONT-FAMILY: Arial, Helvetica; + FONT-SIZE: 11pt; + FONT-WEIGHT: normal; + COLOR: #000000; +} + +p.p2 { + FONT-FAMILY: Arial, Helvetica; + FONT-SIZE: 13pt; + FONT-WEIGHT: normal; + COLOR: #000000; +} + +div { + FONT-FAMILY: Arial, Helvetica; + FONT-SIZE: 9pt; + FONT-WEIGHT: bold; + COLOR: #000000; +} + +div.div1 { + FONT-FAMILY: Arial, Helvetica; + FONT-SIZE: 11pt; + FONT-WEIGHT: bold; + COLOR: #000000; +} + +div.div2 { + FONT-FAMILY: Arial, Helvetica; + FONT-SIZE: 13pt; + FONT-WEIGHT: bold; + COLOR: #000000; +} + +.quote { font-style: italic; color: #ee9; } +.highlight { background-color: yellow; color: #000; } +.deprecated { text-decoration: line-through; color: #aaa; } Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example-body.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example-body.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example-body.html 3 Jan 2016 20:46:28 -0000 1.1.2.1 @@ -0,0 +1,206 @@ + + + + + + + + Example of Xinha + + + + + + + + + + + +
+
+ + +
+ + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example-dest.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example-dest.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example-dest.php 3 Jan 2016 20:46:28 -0000 1.1.2.1 @@ -0,0 +1,23 @@ + + + + Example of Xinha + + + +$value){ + if(substr($key,0,10) == 'myTextarea') { + echo '

'.$key.'(source):

'.$value.'
'; + echo '

'.$key.'(preview):

'.$value; + } + } +?> + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example-menu.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example-menu.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example-menu.php 3 Jan 2016 20:46:28 -0000 1.1.2.1 @@ -0,0 +1,357 @@ + + + + + + + + Example of Xinha + + + + + + +
+

Xinha Example

+
+ Settings + + + +
+ +
+
+ Plugins +
+read())) //not a dot file or directory + { if(substr($entry,0,1) != '.') + { $dir_array[] = $entry; + } + } + $d->close(); + sort($dir_array); + foreach ($dir_array as $entry) + { echo ''."\n"; + } + +?> +
+
+
+ + + +
+ + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example.html 3 Jan 2016 20:46:29 -0000 1.1.2.1 @@ -0,0 +1,16 @@ + +Xinha Extended Example + + + + + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/ext_example.js 3 Jan 2016 20:46:29 -0000 1.1.2.1 @@ -0,0 +1,155 @@ + + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- Xinha example logic. This javascript is used to auto-generate examples + -- as controlled by the options set in full_example-menu.html. it's called + -- from full_example-body.html. + -- + -- $HeadURL$ + -- $LastChangedDate$ + -- $LastChangedRevision$ + -- $LastChangedBy$ + --------------------------------------------------------------------------*/ + + var num = 1; + if(window.parent && window.parent != window) + { + var f = window.parent.menu.document.forms[0]; + _editor_lang = f.lang.value; + _editor_skin = f.skin.value; + num = parseInt(f.num.value); + if(isNaN(num)) + { + num = 1; + f.num.value = 1; + } + xinha_plugins = [ ]; + for(var x = 0; x < f.plugins.length; x++) + { + if(f.plugins[x].checked) xinha_plugins.push(f.plugins[x].value); + } + } + + xinha_editors = [ ] + for(var x = 0; x < num; x++) + { + var ta = 'myTextarea' + x; + xinha_editors.push(ta); + } + + xinha_config = function() + { + var config = new HTMLArea.Config(); + + if(window.parent && window.parent != window) { + var f = window.parent.menu.document.forms[0]; + if (f.width) config.width = f.width.value; + if (f.height) config.height = f.height.value; + if (f.sizeIncludesBars) config.sizeIncludesBars = f.sizeIncludesBars.value; + if (f.statusBar) config.statusBar = f.statusBar.value; + if (f.mozParaHandler) config.mozParaHandler = f.mozParaHandler.value; + if (f.undoSteps) config.undoSteps = f.undoSteps.value; + if (f.baseHref) config.baseHref = f.baseHref.value; + if (f.stripBaseHref) config.stripBaseHref = f.stripBaseHref.value; + if (f.stripSelfNamedAnchors) config.stripSelfNamedAnchors = f.stripSelfNamedAnchors.value; + if (f.only7BitPrintablesInURLs) config.only7BitPrintablesInURLs = f.only7BitPrintablesInURLs.value; + if (f.sevenBitClean) config.sevenBitClean = f.sevenBitClean.value; + if (f.killWordOnPaste) config.killWordOnPaste = f.killWordOnPaste.value; + if (f.flowToolbars) config.flowToolbars = f.flowToolbars.value; + if ((typeof CharacterMap != 'undefined') && (f.CharacterMapMode)) config.CharacterMap.mode = f.CharacterMapMode.value; + if ((typeof ListType != 'undefined') && (f.ListTypeMode)) config.ListType.mode = f.ListTypeMode.value; + } + + if(typeof CSS != 'undefined') + { + config.pageStyle = "@import url(custom.css);"; + } + + if(typeof Stylist != 'undefined') + { + // We can load an external stylesheet like this - NOTE : YOU MUST GIVE AN ABSOLUTE URL + // otherwise it won't work! + config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css')); + + // Or we can load styles directly + config.stylistLoadStyles('p.red_text { color:red }'); + + // If you want to provide "friendly" names you can do so like + // (you can do this for stylistLoadStylesheet as well) + config.stylistLoadStyles('p.pink_text { color:pink }', {'p.pink_text' : 'Pretty Pink'}); + } + + if(typeof DynamicCSS != 'undefined') + { + config.pageStyle = "@import url(dynamic.css);"; + } + + if(typeof InsertWords != 'undefined') + { + // Register the keyword/replacement list + var keywrds1 = new Object(); + var keywrds2 = new Object(); + + keywrds1['-- Dropdown Label --'] = ''; + keywrds1['onekey'] = 'onevalue'; + keywrds1['twokey'] = 'twovalue'; + keywrds1['threekey'] = 'threevalue'; + + keywrds2['-- Insert Keyword --'] = ''; + keywrds2['Username'] = '%user%'; + keywrds2['Last login date'] = '%last_login%'; + config.InsertWords = { + combos : [ { options: keywrds1, context: "body" }, + { options: keywrds2, context: "li" } ] + } + + } + // Path for InsertPicture plugin + if(typeof InsertPicture != 'undefined') { + InsertPicture.PicturePath = '/schmal/pictures/'; + } + + return config; + } + + + var f = document.forms[0]; + f.method = 'post'; + f.action = 'ext_example-dest.php'; + f.innerHTML = ''; + + var lipsum = document.getElementById('lipsum').innerHTML; + + for(var x = 0; x < num; x++) + { + var ta = 'myTextarea' + x; + + var div = document.createElement('div'); + div.className = 'area_holder'; + + var txta = document.createElement('textarea'); + txta.id = ta; + txta.name = ta; + txta.value = lipsum; + txta.style.width="100%"; + txta.style.height="420px"; + + div.appendChild(txta); + f.appendChild(div); + } + + //check submitted values + var submit = document.createElement('input'); + submit.type = "submit"; + submit.value = "Submit"; + f.appendChild(submit); + + var _oldSubmitHandler = null; + if (document.forms[0].onsubmit != null) { + _oldSubmitHandler = document.forms[0].onsubmit; + } + function frame_onSubmit(){ + if (_oldSubmitHandler != null) { + _oldSubmitHandler(); + } + } + document.forms[0].onsubmit = frame_onSubmit; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example-body.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example-body.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example-body.html 3 Jan 2016 20:46:29 -0000 1.1.2.1 @@ -0,0 +1,185 @@ + + + + + + + + Example of Xinha + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example-menu.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example-menu.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example-menu.html 3 Jan 2016 20:46:29 -0000 1.1.2.1 @@ -0,0 +1,216 @@ + + + + + +Example of Xinha + + + + + + +
+

+ Select from the options below and +

+
+ Settings + + + +
+ +
+ Plugins + + + +
+ mode : +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ mode : +
+ + + + + + + +
+ +
+ PHP Plugins +

+ These plugins require PHP in order to run. +

+ + + + + + + +
+ +
+ + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example.css 3 Jan 2016 20:46:29 -0000 1.1.2.1 @@ -0,0 +1,48 @@ + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- Xinha example CSS file. This is ripped from Trac ;) + -- + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/examples/full_example.css $ + -- $LastChangedDate: 2007-01-20 11:24:36 +1300 (Sat, 20 Jan 2007) $ + -- $LastChangedRevision: 677 $ + -- $LastChangedBy: ray $ + --------------------------------------------------------------------------*/ + + body { + background: #fff; + color: #000; + margin: 10px; + } + body, th, td { + font: normal 13px verdana,arial,'Bitstream Vera Sans',helvetica,sans-serif; + } + h1, h2, h3, h4 { + font-family: arial,verdana,'Bitstream Vera Sans',helvetica,sans-serif; + font-weight: bold; + letter-spacing: -0.018em; + } + h1 { font-size: 21px; margin: .15em 1em 0 0 } + h2 { font-size: 16px; margin: 2em 0 .5em; } + h3 { font-size: 14px; margin: 1.5em 0 .5em; } + hr { border: none; border-top: 1px solid #ccb; margin: 2em 0; } + address { font-style: normal } + img { border: none } + + :link, :visited { + text-decoration: none; + color: #b00; + border-bottom: 1px dotted #bbb; + } + :link:hover, :visited:hover { + background-color: #eee; + color: #555; + } + h1 :link, h1 :visited ,h2 :link, h2 :visited, h3 :link, h3 :visited, + h4 :link, h4 :visited, h5 :link, h5 :visited, h6 :link, h6 :visited { + color: inherit; + } + + .area_holder + { + margin:10px; + } + label {font-size: 11px;} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example.html 3 Jan 2016 20:46:30 -0000 1.1.2.1 @@ -0,0 +1,16 @@ + + + + + + + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/full_example.js 3 Jan 2016 20:46:30 -0000 1.1.2.1 @@ -0,0 +1,155 @@ + + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- Xinha example logic. This javascript is used to auto-generate examples + -- as controlled by the options set in full_example-menu.html. it's called + -- from full_example-body.html. + -- + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/examples/full_example.js $ + -- $LastChangedDate: 2007-06-14 06:34:34 +1200 (Thu, 14 Jun 2007) $ + -- $LastChangedRevision: 856 $ + -- $LastChangedBy: wymsy $ + --------------------------------------------------------------------------*/ + + var num = 1; + if(window.parent && window.parent != window) + { + var f = window.parent.menu.document.forms[0]; + _editor_lang = f.lang[f.lang.selectedIndex].value; + _editor_skin = f.skin[f.skin.selectedIndex].value; + + num = parseInt(f.num.value); + if(isNaN(num)) + { + num = 1; + f.num.value = 1; + } + xinha_plugins = [ ]; + for(var x = 0; x < f.plugins.length; x++) + { + if(f.plugins[x].checked) xinha_plugins.push(f.plugins[x].value); + } + } + + xinha_editors = [ ] + for(var x = 0; x < num; x++) + { + var ta = 'myTextarea' + x; + xinha_editors.push(ta); + } + + xinha_config = function() + { + var config = new Xinha.Config(); + + if(typeof CSS != 'undefined') + { + config.pageStyle = "@import url(custom.css);"; + } + + if(typeof Stylist != 'undefined') + { + // We can load an external stylesheet like this - NOTE : YOU MUST GIVE AN ABSOLUTE URL + // otherwise it won't work! + config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css')); + + // Or we can load styles directly + config.stylistLoadStyles('p.red_text { color:red }'); + + // If you want to provide "friendly" names you can do so like + // (you can do this for stylistLoadStylesheet as well) + config.stylistLoadStyles('p.pink_text { color:pink }', {'p.pink_text' : 'Pretty Pink'}); + } + + if(typeof DynamicCSS != 'undefined') + { + config.pageStyle = "@import url(dynamic.css);"; + } + + if(typeof InsertWords != 'undefined') + { + // Register the keyword/replacement list + var keywrds1 = new Object(); + var keywrds2 = new Object(); + + keywrds1['-- Dropdown Label --'] = ''; + keywrds1['onekey'] = 'onevalue'; + keywrds1['twokey'] = 'twovalue'; + keywrds1['threekey'] = 'threevalue'; + + keywrds2['-- Insert Keyword --'] = ''; + keywrds2['Username'] = '%user%'; + keywrds2['Last login date'] = '%last_login%'; + config.InsertWords = { + combos : [ { options: keywrds1, context: "body" }, + { options: keywrds2, context: "li" } ] + } + + } + + if (typeof ListType != 'undefined') + { + if(window.parent && window.parent != window) + { + var f = window.parent.menu.document.forms[0]; + config.ListType.mode = f.elements['ListTypeMode'].options[f.elements['ListTypeMode'].selectedIndex].value; + } + } + + if (typeof CharacterMap != 'undefined') + { + if(window.parent && window.parent != window) + { + var f = window.parent.menu.document.forms[0]; + config.CharacterMap.mode = f.elements['CharacterMapMode'].options[f.elements['CharacterMapMode'].selectedIndex].value; + } + } + + if(typeof Filter != 'undefined') { + xinha_config.Filters = ["Word", "Paragraph"] + } + + return config; + } + + + var f = document.forms[0]; + f.innerHTML = ''; + + var lipsum = document.getElementById('lipsum').innerHTML; + + for(var x = 0; x < num; x++) + { + var ta = 'myTextarea' + x; + + var div = document.createElement('div'); + div.className = 'area_holder'; + + var txta = document.createElement('textarea'); + txta.id = ta; + txta.name = ta; + txta.value = lipsum; + txta.style.width="100%"; + txta.style.height="420px"; + + div.appendChild(txta); + f.appendChild(div); + } + + //check submitted values + var submit = document.createElement('input'); + submit.type = "submit"; + submit.id = "submit"; + submit.value = "submit"; + f.appendChild(submit); + + var _oldSubmitHandler = null; + if (document.forms[0].onsubmit != null) { + _oldSubmitHandler = document.forms[0].onsubmit; + } + function frame_onSubmit(){ + alert(document.getElementById("myTextarea0").value); + if (_oldSubmitHandler != null) { + _oldSubmitHandler(); + } + } + document.forms[0].onsubmit = frame_onSubmit; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/simple_example.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/simple_example.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/simple_example.html 3 Jan 2016 20:46:30 -0000 1.1.2.1 @@ -0,0 +1,54 @@ + + + + +Simple example of Xinha + + + + + + + + + +
+ +
+ + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/stylist.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/stylist.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/stylist.css 3 Jan 2016 20:46:30 -0000 1.1.2.1 @@ -0,0 +1,31 @@ + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- Stylist plugin example CSS file. Used by full_example.js + -- when the Stylist plugin is included in an auto-generated example. + -- + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/examples/stylist.css $ + -- $LastChangedDate: 2007-01-20 11:24:36 +1300 (Sat, 20 Jan 2007) $ + -- $LastChangedRevision: 677 $ + -- $LastChangedBy: ray $ + --------------------------------------------------------------------------*/ + +.bluetext +{ + color:blue; +} + +p.blue_paragraph +{ + color:darkblue; +} + +li.green_list_item +{ + color:green; +} + +h1.webdings_lvl_1 +{ + font-family:webdings; +} + +img.polaroid { border:1px solid black; background-color:white; padding:10px; padding-bottom:30px; } \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/testbed.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/testbed.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/testbed.html 3 Jan 2016 20:46:30 -0000 1.1.2.1 @@ -0,0 +1,196 @@ + + + + + + + + + Example of Xinha + + + + + + + + + + + + +
+
+ + + +
+
+ +
+ Hide + Show +
+ + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/Extended.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/Extended.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/Extended.html 3 Jan 2016 20:46:31 -0000 1.1.2.1 @@ -0,0 +1,317 @@ + + + + Settings + + + + + + + + +
Settings
+
+
+ Xinha options + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ CharacterMap options + + +
+ +
+ ListType options + + +
+ +
+ CharCounter options + +
+ +
+ +
+
+
+ +
+ + +
+
+ + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/custom.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/custom.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/custom.css 3 Jan 2016 20:46:31 -0000 1.1.2.1 @@ -0,0 +1,40 @@ + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- CSS plugin example CSS file. This file is used by full_example.js + -- when the CSS plugin is included in an auto-generated example. + -- @TODO Make this CSS more useful. + -- + -- $HeadURL:http://svn.xinha.webfactional.com/trunk/examples/files/custom.css $ + -- $LastChangedDate:2008-02-04 01:43:21 +0100 (Mo, 04 Feb 2008) $ + -- $LastChangedRevision:962 $ + -- $LastChangedBy:ray $ + --------------------------------------------------------------------------*/ + +body { background-color: #234; color: #dd8; font-family: tahoma; font-size: 12px; } + +a:link, a:visited { color: #8cf; } +a:hover { color: #ff8; } + +h1 { background-color: #456; color: #ff8; padding: 2px 5px; border: 1px solid; border-color: #678 #012 #012 #678; } + +/* syntax highlighting (used by the first combo defined for the CSS plugin) */ + +pre { margin: 0px 1em; padding: 5px 1em; background-color: #000; border: 1px dotted #02d; border-left: 2px solid #04f; } +.code { color: #f5deb3; } +.string { color: #00ffff; } +.comment { color: #8fbc8f; } +.variable-name { color: #fa8072; } +.type { color: #90ee90; font-weight: bold; } +.reference { color: #ee82ee; } +.preprocessor { color: #faf; } +.keyword { color: #ffffff; font-weight: bold; } +.function-name { color: #ace; } +.html-tag { font-weight: bold; } +.html-helper-italic { font-style: italic; } +.warning { color: #ffa500; font-weight: bold; } +.html-helper-bold { font-weight: bold; } + +/* info combo */ + +.quote { font-style: italic; color: #ee9; } +.highlight { background-color: yellow; color: #000; } +.deprecated { text-decoration: line-through; color: #aaa; } Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/dynamic.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/dynamic.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/dynamic.css 3 Jan 2016 20:46:31 -0000 1.1.2.1 @@ -0,0 +1,56 @@ + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- DynamicCSS plugin example CSS file. Used by full_example.js + -- when the DynamicCSS plugin is included in an auto-generated example. + -- @TODO Make this CSS more useful. + -- + -- $HeadURL:http://svn.xinha.webfactional.com/trunk/examples/files/dynamic.css $ + -- $LastChangedDate:2008-02-04 01:43:21 +0100 (Mo, 04 Feb 2008) $ + -- $LastChangedRevision:962 $ + -- $LastChangedBy:ray $ + --------------------------------------------------------------------------*/ + +p { + FONT-FAMILY: Arial, Helvetica; + FONT-SIZE: 9pt; + FONT-WEIGHT: normal; + COLOR: #000000; +} + +p.p1 { + FONT-FAMILY: Arial, Helvetica; + FONT-SIZE: 11pt; + FONT-WEIGHT: normal; + COLOR: #000000; +} + +p.p2 { + FONT-FAMILY: Arial, Helvetica; + FONT-SIZE: 13pt; + FONT-WEIGHT: normal; + COLOR: #000000; +} + +div { + FONT-FAMILY: Arial, Helvetica; + FONT-SIZE: 9pt; + FONT-WEIGHT: bold; + COLOR: #000000; +} + +div.div1 { + FONT-FAMILY: Arial, Helvetica; + FONT-SIZE: 11pt; + FONT-WEIGHT: bold; + COLOR: #000000; +} + +div.div2 { + FONT-FAMILY: Arial, Helvetica; + FONT-SIZE: 13pt; + FONT-WEIGHT: bold; + COLOR: #000000; +} + +.quote { font-style: italic; color: #ee9; } +.highlight { background-color: yellow; color: #000; } +.deprecated { text-decoration: line-through; color: #aaa; } Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/ext_example-body.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/ext_example-body.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/ext_example-body.html 3 Jan 2016 20:46:31 -0000 1.1.2.1 @@ -0,0 +1,206 @@ + + + + + + + + Example of Xinha + + + + + + + + + + + +
+
+ + +
+ + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/ext_example-dest.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/ext_example-dest.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/ext_example-dest.php 3 Jan 2016 20:46:31 -0000 1.1.2.1 @@ -0,0 +1,23 @@ + + + + Example of Xinha + + + +$value){ + if(substr($key,0,10) == 'myTextarea') { + echo '

'.$key.'(source):

'.$value.'
'; + echo '

'.$key.'(preview):

'.$value; + } + } +?> + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/ext_example-menu.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/ext_example-menu.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/ext_example-menu.php 3 Jan 2016 20:46:31 -0000 1.1.2.1 @@ -0,0 +1,357 @@ + + + + + + + + Example of Xinha + + + + + + +
+

Xinha Example

+
+ Settings + + + +
+ +
+
+ Plugins +
+read())) //not a dot file or directory + { if(substr($entry,0,1) != '.') + { $dir_array[] = $entry; + } + } + $d->close(); + sort($dir_array); + foreach ($dir_array as $entry) + { echo ''."\n"; + } + +?> +
+
+
+ + + +
+ + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/full_example.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/full_example.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/full_example.css 3 Jan 2016 20:46:32 -0000 1.1.2.1 @@ -0,0 +1,78 @@ + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- Xinha example CSS file. This is ripped from Trac ;) + -- + -- $HeadURL:http://svn.xinha.webfactional.com/trunk/examples/files/full_example.css $ + -- $LastChangedDate:2008-02-04 01:43:21 +0100 (Mo, 04 Feb 2008) $ + -- $LastChangedRevision:962 $ + -- $LastChangedBy:ray $ + --------------------------------------------------------------------------*/ + + body { + background: #fff; + color: #000; + margin: 10px; + } + body, th, td { + font: normal 13px verdana,arial,'Bitstream Vera Sans',helvetica,sans-serif; + } + h1, h2, h3, h4 { + font-family: arial,verdana,'Bitstream Vera Sans',helvetica,sans-serif; + font-weight: bold; + letter-spacing: -0.018em; + } + h1 { font-size: 21px; margin: .15em 1em 0 0 } + h2 { font-size: 16px; margin: 2em 0 .5em; } + h3 { font-size: 14px; margin: 1.5em 0 .5em; } + hr { border: none; border-top: 1px solid #ccb; margin: 2em 0; } + address { font-style: normal } + img { border: none } + + :link, :visited { + text-decoration: none; + color: #b00; + border-bottom: 1px dotted #bbb; + } + :link:hover, :visited:hover { + background-color: #eee; + color: #555; + } + h1 :link, h1 :visited ,h2 :link, h2 :visited, h3 :link, h3 :visited, + h4 :link, h4 :visited, h5 :link, h5 :visited, h6 :link, h6 :visited { + color: inherit; + } + + .area_holder + { + margin:10px; + } + label {font-size: 11px;} + .navi_links { + width: 177px; + margin: 0; + padding: 0px; + list-style:none; + border: none; +} + +.navi_links li { + margin:0 0 3px 0; +} + +.navi_links li a { + font-size: 13px; + line-height: 16px; + height: 16px; + display:block; + color:#000; + text-decoration: none; + font-weight: bold; + background-color: #fff; + cursor: pointer; + border: 2px solid white; + +} + +.Link1 { +background-color: #DF1D1F !important; + +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/stylist.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/stylist.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/examples/files/stylist.css 3 Jan 2016 20:46:32 -0000 1.1.2.1 @@ -0,0 +1,31 @@ + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- Stylist plugin example CSS file. Used by full_example.js + -- when the Stylist plugin is included in an auto-generated example. + -- + -- $HeadURL:http://svn.xinha.webfactional.com/trunk/examples/files/stylist.css $ + -- $LastChangedDate:2008-02-04 01:43:21 +0100 (Mo, 04 Feb 2008) $ + -- $LastChangedRevision:962 $ + -- $LastChangedBy:ray $ + --------------------------------------------------------------------------*/ + +.bluetext +{ + color:blue; +} + +p.blue_paragraph +{ + color:darkblue; +} + +li.green_list_item +{ + color:green; +} + +h1.webdings_lvl_1 +{ + font-family:webdings; +} + +img.polaroid { border:1px solid black; background-color:white; padding:10px; padding-bottom:30px; } \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/ed_buttons_main.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/ed_buttons_main.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/ed_charmap.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/ed_charmap.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/ed_selectall.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/ed_selectall.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/iconset.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/iconset.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/iconset.xml 3 Jan 2016 20:46:33 -0000 1.1.2.1 @@ -0,0 +1,263 @@ + + + + + + + iconsets/Classic/ed_buttons_main.gif + 3 + 2 + + + iconsets/Classic/de/bold.gif + + + iconsets/Classic/fr/bold.gif + + + + + iconsets/Classic/ed_buttons_main.gif + 2 + 2 + + + iconsets/Classic/de/italic.gif + + + + + iconsets/Classic/ed_buttons_main.gif + 2 + 0 + + + iconsets/Classic/fr/underline.gif + + + iconsets/Classic/de/underline.gif + + + + + iconsets/Classic/ed_buttons_main.gif + 3 + 0 + + + iconsets/Classic/fr/strikethrough.gif + + + + + iconsets/Classic/ed_buttons_main.gif + 3 + 1 + + + + + iconsets/Classic/ed_buttons_main.gif + 2 + 1 + + + + + iconsets/Classic/ed_buttons_main.gif + 4 + 2 + + + + + iconsets/Classic/ed_buttons_main.gif + 5 + 2 + + + + + iconsets/Classic/ed_buttons_main.gif + 5 + 0 + + + + + iconsets/Classic/ed_buttons_main.gif + 4 + 0 + + + + + iconsets/Classic/ed_buttons_main.gif + 4 + 1 + + + + + iconsets/Classic/ed_buttons_main.gif + 3 + 3 + + + + + iconsets/Classic/ed_buttons_main.gif + 2 + 3 + + + + + iconsets/Classic/ed_buttons_main.gif + 0 + 2 + + + + + iconsets/Classic/ed_buttons_main.gif + 1 + 2 + + + + + iconsets/Classic/ed_buttons_main.gif + 6 + 3 + + + + + iconsets/Classic/ed_buttons_main.gif + 0 + 3 + + + + + iconsets/Classic/ed_buttons_main.gif + 1 + 3 + + + + + iconsets/Classic/ed_buttons_main.gif + 0 + 0 + + + + + iconsets/Classic/ed_buttons_main.gif + 0 + 1 + + + + + iconsets/Classic/ed_buttons_main.gif + 1 + 1 + + + + + iconsets/Classic/ed_buttons_main.gif + 1 + 0 + + + + + iconsets/Classic/ed_buttons_main.gif + 6 + 1 + + + + + iconsets/Classic/ed_buttons_main.gif + 0 + 4 + + + + + iconsets/Classic/ed_buttons_main.gif + 1 + 4 + + + + + iconsets/Classic/ed_buttons_main.gif + 8 + 1 + + + + + iconsets/Classic/ed_buttons_main.gif + 9 + 1 + + + + + iconsets/Classic/ed_buttons_main.gif + 4 + 4 + + + + + iconsets/Classic/ed_buttons_main.gif + 8 + 2 + + + + + iconsets/Classic/ed_buttons_main.gif + 9 + 2 + + + + + iconsets/Classic/ed_buttons_main.gif + 8 + 0 + + + + + iconsets/Classic/ed_buttons_main.gif + 9 + 0 + + + + + iconsets/Classic/ed_selectall.gif + + + + + iconsets/Classic/ed_charmap.gif + + + + + plugins/SmartReplace/img.gif + + + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/de/bold.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/de/bold.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/de/italic.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/de/italic.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/de/underline.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/de/underline.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/fr/bold.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/fr/bold.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/fr/strikethrough.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/fr/strikethrough.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/fr/underline.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Classic/fr/underline.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Crystal/LICENSE =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Crystal/LICENSE,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Crystal/LICENSE 3 Jan 2016 20:46:34 -0000 1.1.2.1 @@ -0,0 +1,121 @@ +License + +The Crystal Project are released under LGPL. + +GNU General Public License. + + 0. + + This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. + + Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. + 1. + + You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. + + You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + 2. + + You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + 1. The modified work must itself be a software library. + 2. You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. + 3. You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. + 4. If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. + + (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) + + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. + + In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + 3. + + You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. + + Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of the Library into a program that is not a library. + 4. + + You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. + 5. + + A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. + However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. + 6. + + As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: + 1. Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) . + 2. Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. + 3. Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. + 4. If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. + 5. Verify that the user has already received a copy of these materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + + It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. + 7. + + You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: + 1. + + Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. + 2. + + Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + 8. + + You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + 9. + + You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. + 10. + + Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. + 11. + + If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. + + If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. + + It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + + This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + 12. + + If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + 13. + + The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. + 14. + + If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +No Warranty + + 15. + + Because the library is licensed free of charge, there is no warranty for the library, to the extent permitted by applicable law. Except when otherwise stated in writing the copyright holders and/or other parties provide the library "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the library is with you. Should the library prove defective, you assume the cost of all necessary servicing, repair or correction. + 16. + + In no event unless required by applicable law or agreed to in writing will any copyright holder, or any other party who may modify and/or redistribute the library as permitted above, be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the library (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the library to operate with any other software), even if such holder or other party has been advised of the possibility of such damages. + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Crystal/README =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Crystal/README,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Crystal/README 3 Jan 2016 20:46:35 -0000 1.1.2.1 @@ -0,0 +1,3 @@ +These icons are from everaldo.com, in particular from the Open Office Crystal Icons set + +The Crystal Project are released under LGPL. \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Crystal/ed_buttons_main.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Crystal/ed_buttons_main.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Crystal/iconset.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Crystal/iconset.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Crystal/iconset.xml 3 Jan 2016 20:46:35 -0000 1.1.2.1 @@ -0,0 +1,234 @@ + + + + + + + iconsets/Crystal/ed_buttons_main.png + 3 + 2 + + + + + + iconsets/Crystal/ed_buttons_main.png + 2 + 2 + + + + + iconsets/Crystal/ed_buttons_main.png + 2 + 0 + + + + + iconsets/Crystal/ed_buttons_main.png + 3 + 0 + + + + + iconsets/Crystal/ed_buttons_main.png + 3 + 1 + + + + + iconsets/Crystal/ed_buttons_main.png + 2 + 1 + + + + + iconsets/Crystal/ed_buttons_main.png + 4 + 2 + + + + + iconsets/Crystal/ed_buttons_main.png + 5 + 2 + + + + + iconsets/Crystal/ed_buttons_main.png + 5 + 0 + + + + + iconsets/Crystal/ed_buttons_main.png + 4 + 0 + + + + + iconsets/Crystal/ed_buttons_main.png + 4 + 1 + + + + + iconsets/Crystal/ed_buttons_main.png + 3 + 3 + + + + + iconsets/Crystal/ed_buttons_main.png + 2 + 3 + + + + + iconsets/Crystal/ed_buttons_main.png + 0 + 2 + + + + + iconsets/Crystal/ed_buttons_main.png + 1 + 2 + + + + + iconsets/Crystal/ed_buttons_main.png + 6 + 3 + + + + + iconsets/Crystal/ed_buttons_main.png + 0 + 3 + + + + + iconsets/Crystal/ed_buttons_main.png + 1 + 3 + + + + + iconsets/Crystal/ed_buttons_main.png + 0 + 0 + + + + + iconsets/Crystal/ed_buttons_main.png + 0 + 1 + + + + + iconsets/Crystal/ed_buttons_main.png + 1 + 1 + + + + + iconsets/Crystal/ed_buttons_main.png + 1 + 0 + + + + + iconsets/Crystal/ed_buttons_main.png + 6 + 1 + + + + + iconsets/Crystal/ed_buttons_main.png + 0 + 4 + + + + + iconsets/Crystal/ed_buttons_main.png + 1 + 4 + + + + + iconsets/Crystal/ed_buttons_main.png + 8 + 1 + + + + + iconsets/Crystal/ed_buttons_main.png + 9 + 1 + + + + + iconsets/Crystal/ed_buttons_main.png + 4 + 4 + + + + + iconsets/Crystal/ed_buttons_main.png + 8 + 2 + + + + + iconsets/Crystal/ed_buttons_main.png + 9 + 2 + + + + + iconsets/Crystal/ed_buttons_main.png + 8 + 0 + + + + + iconsets/Crystal/ed_buttons_main.png + 9 + 0 + + + + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Tango/LICENSE =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Tango/LICENSE,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Tango/LICENSE 3 Jan 2016 20:46:35 -0000 1.1.2.1 @@ -0,0 +1,67 @@ +Creative Commons Attribution-ShareAlike 2.5 License Agreement + +CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. + +License + +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. + +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. + +1. Definitions + + 1. "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License. + 2. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License. + 3. "Licensor" means the individual or entity that offers the Work under the terms of this License. + 4. "Original Author" means the individual or entity who created the Work. + 5. "Work" means the copyrightable work of authorship offered under the terms of this License. + 6. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. + 7. "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike. + +2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws. + +3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: + + 1. to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works; + 2. to create and reproduce Derivative Works; + 3. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works; + 4. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works. + 5. + + For the avoidance of doubt, where the work is a musical composition: + 1. Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work. + 2. Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions). + 6. Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions). + +The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved. + +4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: + + 1. You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(c), as requested. + 2. You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License. + 3. If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit. + +5. Representations, Warranties and Disclaimer + +UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. + +6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. Termination + + 1. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. + 2. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. + +8. Miscellaneous + + 1. Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. + 2. Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. + 3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + 4. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. + 5. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. + +Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor. + +Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. + +Creative Commons may be contacted at http://creativecommons.org/. Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Tango/README =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Tango/README,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Tango/README 3 Jan 2016 20:46:36 -0000 1.1.2.1 @@ -0,0 +1,3 @@ +These icons are from the Tango Desktop Project. The icons are released to the Public Domain. From http://tango.freedesktop.org: + +The Tango Desktop Project exists to help create a consistent graphical user interface experience for free and Open Source software. Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Tango/ed_buttons_main.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Tango/ed_buttons_main.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Tango/iconset.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Tango/iconset.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/iconsets/Tango/iconset.xml 3 Jan 2016 20:46:36 -0000 1.1.2.1 @@ -0,0 +1,233 @@ + + + + + + + iconsets/Tango/ed_buttons_main.png + 3 + 2 + + + + + + iconsets/Tango/ed_buttons_main.png + 2 + 2 + + + + + iconsets/Tango/ed_buttons_main.png + 2 + 0 + + + + + iconsets/Tango/ed_buttons_main.png + 3 + 0 + + + + + iconsets/Tango/ed_buttons_main.png + 3 + 1 + + + + + iconsets/Tango/ed_buttons_main.png + 2 + 1 + + + + + iconsets/Tango/ed_buttons_main.png + 4 + 2 + + + + + iconsets/Tango/ed_buttons_main.png + 5 + 2 + + + + + iconsets/Tango/ed_buttons_main.png + 5 + 0 + + + + + iconsets/Tango/ed_buttons_main.png + 4 + 0 + + + + + iconsets/Tango/ed_buttons_main.png + 4 + 1 + + + + + iconsets/Tango/ed_buttons_main.png + 3 + 3 + + + + + iconsets/Tango/ed_buttons_main.png + 2 + 3 + + + + + iconsets/Tango/ed_buttons_main.png + 0 + 2 + + + + + iconsets/Tango/ed_buttons_main.png + 1 + 2 + + + + + iconsets/Tango/ed_buttons_main.png + 6 + 3 + + + + + iconsets/Tango/ed_buttons_main.png + 0 + 3 + + + + + iconsets/Tango/ed_buttons_main.png + 1 + 3 + + + + + iconsets/Tango/ed_buttons_main.png + 0 + 0 + + + + + iconsets/Tango/ed_buttons_main.png + 0 + 1 + + + + + iconsets/Tango/ed_buttons_main.png + 1 + 1 + + + + + iconsets/Tango/ed_buttons_main.png + 1 + 0 + + + + + iconsets/Tango/ed_buttons_main.png + 6 + 1 + + + + + iconsets/Tango/ed_buttons_main.png + 0 + 4 + + + + + iconsets/Tango/ed_buttons_main.png + 1 + 4 + + + + + iconsets/Tango/ed_buttons_main.png + 8 + 1 + + + + + iconsets/Tango/ed_buttons_main.png + 9 + 1 + + + + + iconsets/Tango/ed_buttons_main.png + 4 + 4 + + + + + iconsets/Tango/ed_buttons_main.png + 8 + 2 + + + + + iconsets/Tango/ed_buttons_main.png + 9 + 2 + + + + + iconsets/Tango/ed_buttons_main.png + 8 + 0 + + + + + iconsets/Tango/ed_buttons_main.png + 9 + 0 + + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_about.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_about.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_align.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_align.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_align_center.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_align_center.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_align_justify.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_align_justify.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_align_left.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_align_left.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_align_right.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_align_right.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_blank.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_blank.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_buttons_main.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_buttons_main.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_buttons_main.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_buttons_main.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_charmap.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_charmap.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_clearfonts.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_clearfonts.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_color_bg.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_color_bg.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_color_fg.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_color_fg.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_copy.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_copy.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_custom.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_custom.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_cut.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_cut.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_delete.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_delete.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_format_bold.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_format_bold.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_format_italic.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_format_italic.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_format_strike.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_format_strike.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_format_sub.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_format_sub.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_format_sup.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_format_sup.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_format_underline.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_format_underline.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_help.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_help.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_hr.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_hr.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_html.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_html.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_image.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_image.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_indent_less.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_indent_less.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_indent_more.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_indent_more.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_killword.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_killword.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_left_to_right.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_left_to_right.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_link.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_link.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_list_bullet.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_list_bullet.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_list_num.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_list_num.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_overwrite.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_overwrite.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_paste.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_paste.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_print.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_print.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_redo.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_redo.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_right_to_left.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_right_to_left.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_rmformat.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_rmformat.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_save.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_save.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_save.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_save.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_saveas.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_saveas.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_selectall.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_selectall.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_show_border.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_show_border.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_splitblock.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_splitblock.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_splitcel.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_splitcel.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_undo.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_undo.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_word_cleaner.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/ed_word_cleaner.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/fullscreen_maximize.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/fullscreen_maximize.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/fullscreen_minimize.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/fullscreen_minimize.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/insert_table.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/insert_table.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/insertfilelink.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/insertfilelink.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/insertmacro.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/insertmacro.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tidy.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tidy.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/toggle_borders.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/toggle_borders.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/xinha-small-icon.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/xinha-small-icon.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/xinha_logo.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/xinha_logo.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/de/bold.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/de/bold.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/de/italic.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/de/italic.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/de/underline.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/de/underline.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/fr/bold.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/fr/bold.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/fr/strikethrough.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/fr/strikethrough.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/fr/underline.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/fr/underline.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/COPYING =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/COPYING,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/COPYING 3 Jan 2016 20:46:49 -0000 1.1.2.1 @@ -0,0 +1,67 @@ +Creative Commons Attribution-ShareAlike 2.5 License Agreement + +CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. + +License + +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. + +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. + +1. Definitions + + 1. "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License. + 2. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License. + 3. "Licensor" means the individual or entity that offers the Work under the terms of this License. + 4. "Original Author" means the individual or entity who created the Work. + 5. "Work" means the copyrightable work of authorship offered under the terms of this License. + 6. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. + 7. "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike. + +2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws. + +3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: + + 1. to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works; + 2. to create and reproduce Derivative Works; + 3. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works; + 4. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works. + 5. + + For the avoidance of doubt, where the work is a musical composition: + 1. Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work. + 2. Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions). + 6. Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions). + +The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved. + +4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: + + 1. You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(c), as requested. + 2. You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License. + 3. If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit. + +5. Representations, Warranties and Disclaimer + +UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. + +6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. Termination + + 1. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. + 2. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. + +8. Miscellaneous + + 1. Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. + 2. Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. + 3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + 4. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. + 5. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. + +Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor. + +Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. + +Creative Commons may be contacted at http://creativecommons.org/. Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/document-new.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/document-new.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/document-open.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/document-open.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/document-print.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/document-print.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/document-save.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/document-save.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/edit-copy.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/edit-copy.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/edit-redo.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/edit-redo.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/edit-select-all.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/edit-select-all.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/edit-undo.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/edit-undo.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/folder-new.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/folder-new.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-direction-left-to-right.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-direction-left-to-right.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-direction-right-to-left.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-direction-right-to-left.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-indent-less.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-indent-less.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-indent-more.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-indent-more.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-justify-center.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-justify-center.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-justify-fill.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-justify-fill.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-justify-left.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-justify-left.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-justify-right.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-justify-right.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-background-color.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-background-color.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-bold.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-bold.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-color.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-color.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-italic.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-italic.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-strikethrough.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-strikethrough.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-subscript.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-subscript.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-superscript.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-superscript.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-underline.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/format-text-underline.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/go-up.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/go-up.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/insert-link.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/insert-link.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/insert-table.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/insert-table.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/toggle-borders.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/toggle-borders.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/view-fullscreen.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/view-fullscreen.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/view-restore.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/actions/view-restore.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/apps/accessories-character-map.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/apps/accessories-character-map.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/apps/help-browser.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/apps/help-browser.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/mimetypes/image-x-generic.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/mimetypes/image-x-generic.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/places/user-trash.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/16x16/places/user-trash.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/32x32/apps/internet-web-browser.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/32x32/apps/internet-web-browser.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/32x32/mimetypes/text-html.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/32x32/mimetypes/text-html.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/32x32/mimetypes/text-x-generic.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/32x32/mimetypes/text-x-generic.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/32x32/mimetypes/x-office-document.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/32x32/mimetypes/x-office-document.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/32x32/places/folder.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/32x32/places/folder.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/32x32/places/network-server.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/images/tango/32x32/places/network-server.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/b5.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/b5.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/b5.js 3 Jan 2016 20:46:58 -0000 1.1.2.1 @@ -0,0 +1,29 @@ +// I18N constants -- UTF-8 +// by Dave Lo -- dlo@interactivetools.com +{ + "Bold": "粗體", + "Italic": "斜體", + "Underline": "底線", + "Strikethrough": "刪除線", + "Subscript": "下標", + "Superscript": "上標", + "Justify Left": "位置靠左", + "Justify Center": "位置居中", + "Justify Right": "位置靠右", + "Justify Full": "位置左右平等", + "Ordered List": "順序清單", + "Bulleted List": "無序清單", + "Decrease Indent": "減小行前空白", + "Increase Indent": "加寬行前空白", + "Font Color": "文字顏色", + "Background Color": "背景顏色", + "Horizontal Rule": "水平線", + "Insert Web Link": "插入連結", + "Insert/Modify Image": "插入圖形", + "Insert Table": "插入表格", + "Toggle HTML Source": "切換HTML原始碼", + "Enlarge Editor": "放大", + "About this editor": "關於 Xinha", + "Help using editor": "說明", + "Current style": "字體例子" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ch.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ch.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ch.js 3 Jan 2016 20:46:58 -0000 1.1.2.1 @@ -0,0 +1,56 @@ +// I18N constants + +// LANG: "ch", ENCODING: UTF-8 +// Samuel Stone, http://stonemicro.com/ + +{ + "Bold": "粗體", + "Italic": "斜體", + "Underline": "底線", + "Strikethrough": "刪線", + "Subscript": "下標", + "Superscript": "上標", + "Justify Left": "靠左", + "Justify Center": "居中", + "Justify Right": "靠右", + "Justify Full": "整齊", + "Ordered List": "順序清單", + "Bulleted List": "無序清單", + "Decrease Indent": "伸排", + "Increase Indent": "縮排", + "Font Color": "文字顏色", + "Background Color": "背景顏色", + "Horizontal Rule": "水平線", + "Insert Web Link": "插入連結", + "Insert/Modify Image": "插入圖像", + "Insert Table": "插入表格", + "Toggle HTML Source": "切換HTML原始碼", + "Enlarge Editor": "伸出編輯系統", + "About this editor": "關於 Xinha", + "Help using editor": "說明", + "Current style": "字體例子", + "Undoes your last action": "回原", + "Redoes your last action": "重来", + "Cut selection": "剪制选项", + "Copy selection": "复制选项", + "Paste from clipboard": "贴上", + "Direction left to right": "从左到右", + "Direction right to left": "从右到左", + "OK": "好", + "Cancel": "取消", + "Path": "途徑", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "你在用純字編輯方式. 用 [<>] 按鈕轉回 所見即所得 編輯方式.", + "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "整頁式在Internet Explorer 上常出問題, 因為這是 Internet Explorer 的無名問題,我們無法解決。你可能看見一些垃圾,或遇到其他問題。我們已警告了你. 如果要轉到 正頁式 請按 好.", + "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.", + "Cancel": "取消", + "Insert/Modify Link": "插入/改寫連結", + "New window (_blank)": "新窗户(_blank)", + "None (use implicit)": "無(use implicit)", + "Other": "其他", + "Same frame (_self)": "本匡 (_self)", + "Target:": "目標匡:", + "Title (tooltip):": "主題 (tooltip):", + "Top frame (_top)": "上匡 (_top)", + "URL:": "網址:", + "You must enter the URL where this link points to": "你必須輸入你要连结的網址" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/cz.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/cz.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/cz.js 3 Jan 2016 20:46:58 -0000 1.1.2.1 @@ -0,0 +1,50 @@ +// I18N constants + +// LANG: "cz", ENCODING: UTF-8 +// Author: Jiri Löw, + +// FOR TRANSLATORS: +// +// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE +// (at least a valid email address) +// +// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; +// (if this is not possible, please include a comment +// that states what encoding is necessary.) + +{ + "Bold": "Tučně", + "Italic": "Kurzíva", + "Underline": "Podtržení", + "Strikethrough": "Přeškrtnutí", + "Subscript": "Dolní index", + "Superscript": "Horní index", + "Justify Left": "Zarovnat doleva", + "Justify Center": "Na střed", + "Justify Right": "Zarovnat doprava", + "Justify Full": "Zarovnat do stran", + "Ordered List": "Seznam", + "Bulleted List": "Odrážky", + "Decrease Indent": "Předsadit", + "Increase Indent": "Odsadit", + "Font Color": "Barva písma", + "Background Color": "Barva pozadí", + "Horizontal Rule": "Vodorovná čára", + "Insert Web Link": "Vložit odkaz", + "Insert/Modify Image": "Vložit obrázek", + "Insert Table": "Vložit tabulku", + "Toggle HTML Source": "Přepnout HTML", + "Enlarge Editor": "Nové okno editoru", + "About this editor": "O této aplikaci", + "Help using editor": "Nápověda aplikace", + "Current style": "Zvolený styl", + "Undoes your last action": "Vrátí poslední akci", + "Redoes your last action": "Opakuje poslední akci", + "Cut selection": "Vyjmout", + "Copy selection": "Kopírovat", + "Paste from clipboard": "Vložit", + "OK": "OK", + "Cancel": "Zrušit", + "Path": "Cesta", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Jste v TEXTOVÉM REŽIMU. Použijte tlačítko [<>] pro přepnutí do WYSIWIG." +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/da.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/da.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/da.js 3 Jan 2016 20:46:59 -0000 1.1.2.1 @@ -0,0 +1,172 @@ +// I18N constants +// LANG: "da", ENCODING: UTF-8 +// Author: rene, +// Niels Baggesen, , 0.95, 2009-08-15 +{ + "Bold": "Fed", + "Italic": "Kursiv", + "Underline": "Understregning", + "Strikethrough": "Gennemstregning", + "Subscript": "Sænket skrift", + "Superscript": "Hævet skrift", + "Justify Left": "Venstrejuster", + "Justify Center": "Centrer", + "Justify Right": "Højrejuster", + "Justify Full": "Lige margener", + "Ordered List": "Ordnet liste", + "Bulleted List": "Punktliste", + "Decrease Indent": "Formindsk indrykning", + "Increase Indent": "Forøg indrykning", + "Font Color": "Skriftfarve", + "Background Color": "Baggrundsfarve", + "Horizontal Rule": "Vandret streg", + "Insert Web Link": "Indsæt hyperlink", + "Insert/Modify Image": "Indsæt/udskift billede", + "Insert Table": "Indsæt tabel", + "Toggle HTML Source": "HTML visning", + "Enlarge Editor": "Vis editor i popup", + "About this editor": "Om Xinha", + "Help using editor": "Hjælp", + "Current style": "Anvendt stil", + "Undoes your last action": "Fortryd sidste ændring", + "Redoes your last action": "Gentag sidste ændring", + "Cut selection": "Klip", + "Copy selection": "Kopier", + "Paste from clipboard": "Indsæt", + "Direction left to right": "Tekst venstre mod højre", + "Direction right to left": "Tekst højre mod venstre", + "Remove formatting": "Fjern formatering", + "Select all": "Vælg alt", + "Print document": "Udskriv dokument", + "Clear MSOffice tags": "MSOffice filter", + "Clear Inline Font Specifications": "Fjern skrift valg", + "Would you like to clear font typefaces?": "Vil du fjern skriftsnit valg", + "Would you like to clear font sizes?": "Vil du fjerne skriftstørrelse valg", + "Would you like to clear font colours?": "Vil du fjerne skriftfarve valg", + "Split Block": "Del blok", + "Toggle Borders": "Tabelkanter til/fra", + "Save as": "Gem som", + "Insert/Overwrite": "Indsæt/Overskriv", + "— format —": "— Format —", + "Heading 1": "Overskrift 1", + "Heading 2": "Overskrift 2", + "Heading 3": "Overskrift 3", + "Heading 4": "Overskrift 4", + "Heading 5": "Overskrift 5", + "Heading 6": "Overskrift 6", + "Normal": "Normal", + "Address": "Adresse", + "Formatted": "Formateret", + + //dialogs + "OK": "OK", + "Cancel": "Fortryd", + "Path": "STi", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Du er i TEXT mode. Brug [<>] knappen til at skifte til visuel editering.", + "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "Indsæt-knappen virker ikke i Mozilla-baserede browsere. Brug Ctrl-V på tastaturet for at indsætte.", + + "You need to select some text before create a link": "Du skal markere noget tekst for at indsætte et hyperlink", + "Your Document is not well formed. Check JavaScript console for details.": "Dit dokument er ikke syntaktisk korrekt. Åbn Javascript konsollen for at få flere detaljer.", + + "Alignment:": "Justering:", + "Not set": "Ubestemt", + "Left": "Venstre", + "Right": "Højre", + "Texttop": "Teksttop", + "Absmiddle": "Centreret", + "Baseline": "Grundlinje", + "Absbottom": "Bund", + "Bottom": "Tekstbund", + "Middle": "Midt", + "Top": "Top", + + "Layout": "Layout", + "Spacing": "Afstand", + "Horizontal:": "vandret:", + "Horizontal padding": "Vandret fyld", + "Vertical:": "lodret:", + "Vertical padding": "Lodret fyld", + "Border thickness:": "Kantbredde:", + "Leave empty for no border": "Tom hvis ingen kant", + + //Insert Link + "Insert/Modify Link": "Indsæt/rediger hyperlink", + "None (use implicit)": "ingen (implicit)", + "New window (_blank)": "Nyt vindue (_blank)", + "Same frame (_self)": "Samme ramme (_self)", + "Top frame (_top)": "Topramme (_top)", + "Other": "Andet", + "Target:": "Placering:", + "Title (tooltip):": "Titel (Tooltip):", + "URL:": "URL:", + "You must enter the URL where this link points to": "Du skal angive en mål-URL for linket", + + // Insert Table + "Insert Table": "Indsæt tabel", + "Rows:": "Rækker:", + "Number of rows": "Antal rækker", + "Cols:": "Søjler:", + "Number of columns": "Antal søjler", + "Width:": "Bredde:", + "Width of the table": "Tabelbredde", + "Percent": "Procent", + "Pixels": "Pixel", + "Em": "Geviert (Em)", + "Width unit": "Breddeenhed", + "Fixed width columns": "Fast-bredde søjler", + "Positioning of this table": "Placering af tabel", + "Cell spacing:": "Celleafstand:", + "Space between adjacent cells": "Afstand mellem celler", + "Cell padding:": "Cellefyld:", + "Space between content and border in cell": "Luft mellem indhold og kanter", + "You must enter a number of rows": "Du skal skrive antallet af rækker", + "You must enter a number of columns": "Du skal skrive antallet af søjler", + + // Insert Image + "Insert Image": "Indsæt billede", + "Image URL:": "Billede URL:", + "Enter the image URL here": "Angiv billedets URL", + "Preview": "Smugkig", + "Preview the image in a new window": "Smugkig af billedet i et nyt vindue", + "Alternate text:": "Alternativ text:", + "For browsers that don't support images": "for browsere der ikke understøtter billeder", + "Positioning of this image": "Placering af billedet", + "Image Preview:": "Billede smugkig:", + "You must enter the URL": "Du skal angive en URL", + + // de-buttons have letters matching danish :-) + "button_bold": "de/bold.gif", + "button_italic": "de/italic.gif", + "button_underline": "de/underline.gif", + + // Editor Help + "Keyboard shortcuts": "Tastaturgenveje", + "The editor provides the following key combinations:": "Editoren kender følgende kombinationer:", + "new paragraph": "Nyt afsnit", + "insert linebreak": "Indsæt linjeskift", + "Set format to paragraph": "Formater afsnit", + "Clean content pasted from Word": "Rens indhold kopieret fra Word", + "Headings": "Overskrift 1 til 6", + "Close": "Luk", + + // Loading messages + "Loading in progress. Please wait!": "Editoren hentes ind. Vent venligst.", + "Loading plugin $plugin" : "Plugin $plugin hentes", + "Register plugin $plugin" : "Plugin $plugin registreres", + "Constructing object": "Objekt registreres", + "Generate Xinha framework": "Xinha Framework genereres", + "Init editor size":"Størrelsen beregnes", + "Create Toolbar": "Opretter værktøjslinje", + "Create Statusbar" : "Opretter statuslinje", + "Register right panel" : "Registrerer højre panel", + "Register left panel" : "Registrerer venstre panel", + "Register bottom panel" : "Registrerer nederste panel", + "Register top panel" : "Registrerer øverste panel", + "Finishing" : "Afslutter", + + // ColorPicker + "Click a color..." : "Vælg farve", + "Sample" : "Eksempel", + "Web Safe: " : "Web Safe: ", + "Color: " : "Farve: " +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/de.js 3 Jan 2016 20:46:59 -0000 1.1.2.1 @@ -0,0 +1,171 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +{ + "Bold": "Fett", + "Italic": "Kursiv", + "Underline": "Unterstrichen", + "Strikethrough": "Durchgestrichen", + "Subscript": "Tiefgestellt", + "Superscript": "Hochgestellt", + "Justify Left": "Linksbündig", + "Justify Center": "Zentriert", + "Justify Right": "Rechtsbündig", + "Justify Full": "Blocksatz", + "Ordered List": "Nummerierte Liste", + "Bulleted List": "Aufzählungsliste", + "Decrease Indent": "Einzug verkleinern", + "Increase Indent": "Einzug vergrößern", + "Font Color": "Schriftfarbe", + "Background Color": "Hindergrundfarbe", + "Horizontal Rule": "Horizontale Linie", + "Insert Web Link": "Hyperlink einfügen", + "Insert/Modify Image": "Bild einfügen/verändern", + "Insert Table": "Tabelle einfügen", + "Toggle HTML Source": "HTML Quelltext ein/ausschalten", + "Enlarge Editor": "Editor vergrößern", + "About this editor": "Über diesen Editor", + "Help using editor": "Hilfe", + "Current style": "Derzeitiger Stil", + "Undoes your last action": "Rückgängig", + "Redoes your last action": "Wiederholen", + "Cut selection": "Ausschneiden", + "Copy selection": "Kopieren", + "Paste from clipboard": "Einfügen aus der Zwischenablage", + "Direction left to right": "Textrichtung von Links nach Rechts", + "Direction right to left": "Textrichtung von Rechts nach Links", + "Remove formatting": "Formatierung entfernen", + "Select all": "Alles markieren", + "Print document": "Dokument ausdrucken", + "Clear MSOffice tags": "MSOffice filter", + "Clear Inline Font Specifications": "Zeichensatz Formatierungen entfernen", + "Would you like to clear font typefaces?": "Wollen Sie Zeichensatztypen entfernen", + "Would you like to clear font sizes?": "Wollen Sie Zeichensatzgrößen entfernen", + "Would you like to clear font colours?": "Wollen sie Zeichensatzfarben entfernen", + "Split Block": "Block teilen", + "Toggle Borders": "Tabellenränder ein/ausblenden", + "Save as": "speichern unter", + "Insert/Overwrite": "Einfügen/Überschreiben", + "— format —": "— Format —", + "Heading 1": "Überschrift 1", + "Heading 2": "Überschrift 2", + "Heading 3": "Überschrift 3", + "Heading 4": "Überschrift 4", + "Heading 5": "Überschrift 5", + "Heading 6": "Überschrift 6", + "Normal": "Normal (Absatz)", + "Address": "Adresse", + "Formatted": "Formatiert", + + //dialogs + "OK": "OK", + "Cancel": "Abbrechen", + "Path": "Pfad", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Sie sind im Text-Modus. Benutzen Sie den [<>] Button, um in den visuellen Modus (WYSIWIG) zu gelangen.", + "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "Aus Sicherheitsgründen dürfen Skripte normalerweise nicht auf Ausschneiden/Kopieren/Einfügen zugreifen. Benutzen Sie bitte die entsprechenden Tastatur-Kommandos (Strg + x/c/v).", + + "You need to select some text before create a link": "Sie müssen einen Text markieren, um einen Link zu erstellen", + "Your Document is not well formed. Check JavaScript console for details.": "Ihr Dokument ist in keinem sauberen Format. Benutzen Sie die Javascript Console für weitere Informationen.", + + "Alignment:": "Ausrichtung:", + "Not set": "nicht eingestellt", + "Left": "links", + "Right": "rechts", + "Texttop": "oben bündig", + "Absmiddle": "mittig", + "Baseline": "Grundlinie", + "Absbottom": "unten bündig", + "Bottom": "unten", + "Middle": "zentriert", + "Top": "oben", + + "Layout": "Layout", + "Spacing": "Abstand", + "Horizontal:": "horizontal:", + "Horizontal padding": "horizontaler Inhaltsabstand", + "Vertical:": "vertikal:", + "Vertical padding": "vertikaler Inhaltsabstand", + "Border thickness:": "Randstärke:", + "Leave empty for no border": "leer lassen für keinen Rand", + + //Insert Link + "Insert/Modify Link": "Verknüpfung hinzufügen/ändern", + "None (use implicit)": "k.A. (implizit)", + "New window (_blank)": "Neues Fenster (_blank)", + "Same frame (_self)": "Selber Rahmen (_self)", + "Top frame (_top)": "Oberster Rahmen (_top)", + "Other": "Anderes", + "Target:": "Ziel:", + "Title (tooltip):": "Titel (Tooltip):", + "URL:": "URL:", + "You must enter the URL where this link points to": "Sie müssen eine Ziel-URL angeben für die Verknüpfung angeben", + + // Insert Table + "Insert Table": "Tabelle einfügen", + "Rows:": "Zeilen:", + "Number of rows": "Zeilenanzahl", + "Cols:": "Spalten:", + "Number of columns": "Spaltenanzahl", + "Width:": "Breite:", + "Width of the table": "Tabellenbreite", + "Percent": "Prozent", + "Pixels": "Pixel", + "Em": "Geviert", + "Width unit": "Größeneinheit", + "Fixed width columns": "Spalten mit fester Breite", + "Positioning of this table": "Positionierung der Tabelle", + "Cell spacing:": "Zellenabstand:", + "Space between adjacent cells": "Raum zwischen angrenzenden Zellen", + "Cell padding:": "Innenabstand:", + "Space between content and border in cell": "Raum zwischen Inhalt und Rand der Zelle", + "You must enter a number of rows": "Bitte geben Sie die Anzahl der Zeilen an", + "You must enter a number of columns": "Bitte geben Sie die Anzahl der Spalten an", + + // Insert Image + "Insert Image": "Bild einfügen", + "Image URL:": "Bild URL:", + "Enter the image URL here": "Bitte geben sie hier die Bild URL ein", + "Preview": "Voransicht", + "Preview the image in a new window": "Voransicht des Bildes in einem neuen Fenster", + "Alternate text:": "Alternativer Text:", + "For browsers that don't support images": "für Browser, die keine Bilder unterstützen", + "Positioning of this image": "Positionierung dieses Bildes", + "Image Preview:": "Bild Voransicht:", + "You must enter the URL": "Bitte geben Sie die URL ein", + +/* + "button_bold": "de/bold.gif", + "button_italic": "de/italic.gif", + "button_underline": "de/underline.gif", +*/ + + // Editor Help + "Keyboard shortcuts": "Tastaturkürzel", + "The editor provides the following key combinations:": "Der Editor unterstützt die folgenden kombinationen:", + "new paragraph": "Neuer Absatz(Paragraph)", + "insert linebreak": "Harter Umbruch einfügen", + "Set format to paragraph": "Setze Formatierung auf Absatz", + "Clean content pasted from Word": "Von Word eingefügter Text bereinigen", + "Headings": "Überschrift Typ 1 bis 6", + "Close": "Schließen", + + // Loading messages + "Loading in progress. Please wait!": "Editor wird geladen. Bitte warten !", + "Loading plugin $plugin" : "Plugin $plugin wird geladen", + "Register plugin $plugin" : "Plugin $plugin wird registriert", + "Constructing object": "Objekt wird generiert", + "Generate Xinha framework": "Xinha Framework wird generiert", + "Init editor size":"Größe wird berechnet", + "Create Toolbar": "Werkzeugleiste wird generiert", + "Create Statusbar" : "Statusleiste wird generiert", + "Register right panel" : "Rechtes Panel wird generiert", + "Register left panel" : "Linkes Panel wird generiert", + "Register bottom panel" : "Unteres Panel wird generiert", + "Register top panel" : "Oberes Panel wird generiert", + "Finishing" : "Laden wird abgeschlossen", + + // ColorPicker + "Click a color..." : "Farbe wählen", + "Sample" : "Beispiel", + "Web Safe: " : "Web Safe: ", + "Color: " : "Farbe: " +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ee.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ee.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ee.js 3 Jan 2016 20:46:59 -0000 1.1.2.1 @@ -0,0 +1,50 @@ +// I18N constants + +// LANG: "ee", ENCODING: UTF-8 +// Author: Martin Raie, + +// FOR TRANSLATORS: +// +// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE +// (at least a valid email address) +// +// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; +// (if this is not possible, please include a comment +// that states what encoding is necessary.) + +{ + "Bold": "Paks", + "Italic": "Kursiiv", + "Underline": "Allakriipsutatud", + "Strikethrough": "Läbikriipsutatud", + "Subscript": "Allindeks", + "Superscript": "Ülaindeks", + "Justify Left": "Joonda vasakule", + "Justify Center": "Joonda keskele", + "Justify Right": "Joonda paremale", + "Justify Full": "Rööpjoonda", + "Ordered List": "Nummerdus", + "Bulleted List": "Täpploend", + "Decrease Indent": "Vähenda taanet", + "Increase Indent": "Suurenda taanet", + "Font Color": "Fondi värv", + "Background Color": "Tausta värv", + "Horizontal Rule": "Horisontaaljoon", + "Insert Web Link": "Lisa viit", + "Insert/Modify Image": "Lisa pilt", + "Insert Table": "Lisa tabel", + "Toggle HTML Source": "HTML/tavaline vaade", + "Enlarge Editor": "Suurenda toimeti aken", + "About this editor": "Teave toimeti kohta", + "Help using editor": "Spikker", + "Current style": "Kirjastiil", + "Undoes your last action": "Võta tagasi", + "Redoes your last action": "Tee uuesti", + "Cut selection": "Lõika", + "Copy selection": "Kopeeri", + "Paste from clipboard": "Kleebi", + "OK": "OK", + "Cancel": "Loobu", + "Path": "Path", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Sa oled tekstireziimis. Kasuta nuppu [<>] lülitamaks tagasi WYSIWIG reziimi." +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/el.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/el.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/el.js 3 Jan 2016 20:46:59 -0000 1.1.2.1 @@ -0,0 +1,55 @@ +// I18N constants + +// LANG: "el", ENCODING: UTF-8 +// Author: Dimitris Glezos, dimitris@glezos.com + +{ + "Bold": "ΞˆΞ½Ο„ΞΏΞ½Ξ±", + "Italic": "Πλάγια", + "Underline": "Ξ�πογραμμισμένα", + "Strikethrough": "Διαγραμμένα", + "Subscript": "ΔΡίκτης", + "Superscript": "ΔΡίκτης", + "Justify Left": "Στοίχιση ΑριστΡρά", + "Justify Center": "Στοίχιση ΞšΞ­Ξ½Ο„ΟΞΏ", + "Justify Right": "Στοίχιση ΔΡξιά", + "Justify Full": "Ξ Ξ»Ξ�ρης Στοίχιση", + "Ordered List": "Αρίθμηση", + "Bulleted List": "ΞšΞΏΟ…ΞΊΞΊΞ―Ξ΄Ξ΅Ο‚", + "Decrease Indent": "ΞœΞ΅Ξ―Ο‰ΟƒΞ· ΕσοχΞ�Ο‚", + "Increase Indent": "Αύξηση ΕσοχΞ�Ο‚", + "Font Color": "Χρώμα ΓραμματοσΡιράς", + "Background Color": "Χρώμα Ξ¦ΟŒΞ½Ο„ΞΏΟ…", + "Horizontal Rule": "ΞŸΟΞΉΞΆΟŒΞ½Ο„ΞΉΞ± ΓραμμΞ�", + "Insert Web Link": "ΕισαγωγΞ� Συνδέσμου", + "Insert/Modify Image": "ΕισαγωγΞ�/Ξ�ροποποίηση Ξ•ΞΉΞΊΟŒΞ½Ξ±Ο‚", + "Insert Table": "ΕισαγωγΞ� Ξ Ξ―Ξ½Ξ±ΞΊΞ±", + "Toggle HTML Source": "ΕναλλαγΞ� σΡ/Ξ±Ο€ΟŒ HTML", + "Enlarge Editor": "ΞœΞ΅Ξ³Ξ­Ξ½ΞΈΟ…Ξ½ΟƒΞ· ΡπΡξΡργαστΞ�", + "About this editor": "ΠληροφορίΡς", + "Help using editor": "Ξ’ΞΏΞ�θΡια", + "Current style": "Παρών στυλ", + "Undoes your last action": "ΑναίρΡση τΡλΡυταίας ΡνέργΡιας", + "Redoes your last action": "Επαναφορά Ξ±Ο€ΟŒ αναίρΡση", + "Cut selection": "ΑποκοπΞ�", + "Copy selection": "ΑντιγραφΞ�", + "Paste from clipboard": "Ξ•Ο€ΞΉΞΊΟŒΞ»Ξ»Ξ·ΟƒΞ·", + "Direction left to right": "ΞšΞ±Ο„Ξ΅ΟΞΈΟ…Ξ½ΟƒΞ· αριστΡρά προς δΡξιά", + "Direction right to left": "ΞšΞ±Ο„Ξ΅ΟΞΈΟ…Ξ½ΟƒΞ· Ξ±Ο€ΟŒ δΡξιά προς τα αριστΡρά", + "OK": "OK", + "Cancel": "Ακύρωση", + "Path": "ΔιαδρομΞ�", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "ΕίστΡ σΡ TEXT MODE. ΧρησιμοποιΞ�στΡ το κουμπί [<>] Ξ³ΞΉΞ± Ξ½Ξ± ΡπανέρθΡτΡ στο WYSIWIG.", + "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "Ξ— κατάσταση πλΞ�ρης ΞΏΞΈΟŒΞ½Ξ·Ο‚ έχΡι προβλΞ�ματα ΞΌΞ΅ τον Internet Explorer, Ξ»ΟŒΞ³Ο‰ σφαλμάτων στον ίδιο τον browser. Αν το σύστημα σας Ρίναι Windows 9x μπορΡί ΞΊΞ±ΞΉ Ξ½Ξ± χρΡιαστΡίτΡ reboot. Αν ΡίστΡ σίγουροι, πατΞ�στΡ ΟΚ.", + "Cancel": "Ακύρωση", + "Insert/Modify Link": "ΕισαγωγΞ�/Ξ�ροποποίηση σύνδΡσμου", + "New window (_blank)": "Νέο παράθυρο (_blank)", + "None (use implicit)": "Κανένα (χρΞ�ση Ξ±Ο€ΟŒΞ»Ο…Ο„ΞΏΟ…)", + "Other": "Αλλο", + "Same frame (_self)": "Ίδιο frame (_self)", + "Target:": "Target:", + "Title (tooltip):": "Ξ�ίτλος (tooltip):", + "Top frame (_top)": "Πάνω frame (_top)", + "URL:": "URL:", + "You must enter the URL where this link points to": "ΠρέπΡι Ξ½Ξ± ΡισάγΡτΡ το URL που οδηγΡί Ξ±Ο…Ο„ΟŒΟ‚ ΞΏ σύνδΡσμος" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/es.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/es.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/es.js 3 Jan 2016 20:46:59 -0000 1.1.2.1 @@ -0,0 +1,167 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +{ + "Bold": "Negrita", + "Italic": "Cursiva", + "Underline": "Subrayado", + "Strikethrough": "Tachado", + "Subscript": "Subíndice", + "Superscript": "Superíndice", + "Justify Left": "Alinear a la izquierda", + "Justify Center": "Alinear al centro", + "Justify Right": "Alinear a la derecha", + "Justify Full": "Justificar", + "Ordered List": "Lista numerada", + "Bulleted List": "Lista no numerada", + "Decrease Indent": "Reducir sangría", + "Increase Indent": "Aumentar sangría", + "Font Color": "Color de la fuente", + "Background Color": "Color de fondo", + "Horizontal Rule": "Regla horizontal", + "Insert Web Link": "Insertar enlace web", + "Insert/Modify Image": "Insertar/modificar imagen", + "Insert Table": "Insertar una tabla", + "Toggle HTML Source": "Ver HTML", + "Enlarge Editor": "Editor a pantalla completa", + "About this editor": "Sobre este Editor", + "Help using editor": "Ayuda", + "Current style": "Estilo actual", + "Undoes your last action": "Deshacer", + "Redoes your last action": "Rehacer", + "Cut selection": "Cortar", + "Copy selection": "Copiar", + "Paste from clipboard": "Pegar desde el portapapeles", + "Direction left to right": "Dirección de izquierda a derecha", + "Direction right to left": "Dirección de derecha a izquierda", + "Remove formatting": "Borrar formato", + "Select all": "Seleccionar todo", + "Print document": "Imprimir documento", + "Clear MSOffice tags": "Borrar etiquetas de MSOffice", + "Clear Inline Font Specifications": "Borrar las etiquetas de fuente", + "Would you like to clear font typefaces?": "¿Desea eliminar las definiciaones de tipo de fuente?", + "Would you like to clear font sizes?": "¿Desea eliminar las definiciones de tamaño de fuente?", + "Would you like to clear font colours?": "¿Desea eliminar las definiciones de color de fuente?", + "Split Block": "Dividir el bloque", + "Toggle Borders": "Añadir/Quitar bordes", + "Save as": "Guardar como", + "Insert/Overwrite": "Insertar/Sobreescribir", + "— format —": "— formato —", + "— font —": "— fuente —", + "— size —": "— tamaño —", + "Heading 1": "Cabecera 1", + "Heading 2": "Cabecera 2", + "Heading 3": "Cabecera 3", + "Heading 4": "Cabecera 4", + "Heading 5": "Cabecera 5", + "Heading 6": "Cabecera 6", + "Normal": "Normal", + "Address": "Dirección", + "Formatted": "Formateado", + + //dialogs + "OK": "Aceptar", + "Cancel": "Cancelar", + "Path": "Ruta", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Se encuentra en MODO TEXTO. Use el botón [<>] para cambiar de nuevo al modo WYSIWYG", + "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "El botón de pegar no funciona en los navegadores de Mozilla por motivos de seguridad. Presione CTRL-V en su teclado para pegarlo directamente", + + "You need to select some text before create a link": "Necesita seleccionar algún texto antes de crear un link", + "Your Document is not well formed. Check JavaScript console for details.": "Su documento no está bien formado. Compruebe la consola de JavaScript para obtener más detalles", + + "Alignment:": "Alineación:", + "Not set": "No definido", + "Left": "Izquierda", + "Right": "Derecha", + "Texttop": "Texto Superior", + "Absmiddle": "Medio Absoluto", + "Baseline": "Línea base", + "Absbottom": "Inferior absoluto", + "Bottom": "Inferior", + "Middle": "Medio", + "Top": "Superior", + + "Layout": "Distribución", + "Spacing": "Espaciado", + "Horizontal:": "horizontal:", + "Horizontal padding": "Relleno horizontal", + "Vertical:": "Vertical:", + "Vertical padding": "Relleno Vertical", + "Border thickness:": "Tamaño del borde:", + "Leave empty for no border": "Vacío si no desea ningún borde", + + //Insert Link + "Insert/Modify Link": "Insertar/Modificar un enlace", + "None (use implicit)": "Vacío ( usar implícito )", + "New window (_blank)": "Nueva ventana (_blank)", + "Same frame (_self)": "Mismo marco (_self)", + "Top frame (_top)": "Marco superior (_top)", + "Other": "Otro", + "Target:": "Destino:", + "Title (tooltip):": "Título (Tooltip):", + "URL:": "URL:", + "You must enter the URL where this link points to": "Debe introducir la URL a donde apunta este enlace", + + // Insert Table + "Insert Table": "Añadir una tabla", + "Rows:": "Filas:", + "Number of rows": "Número de filas", + "Cols:": "Columnas:", + "Number of columns": "Número de columnas", + "Width:": "Ancho:", + "Width of the table": "Ancho de la tabla", + "Percent": "Porcentaje", + "Pixels": "Pixels", + "Em": "Em", + "Width unit": "Unidad de anchura", + "Fixed width columns": "Columnas de ancho fijo", + "Positioning of this table": "Posición de esta tabla", + "Cell spacing:": "Espaciado entre celdas:", + "Space between adjacent cells": "Espaciado entre celdas adyacentes", + "Cell padding:": "Relleno de celdas:", + "Space between content and border in cell": "Escapcio entre el contenido y el borde de la celda", + "You must enter a number of rows": "Debe introducir un número de filas", + "You must enter a number of columns": "Debe introducir un número de columnas", + + // Insert Image + "Insert Image": "Insertar una imagen", + "Image URL:": "Imagen URL:", + "Enter the image URL here": "", + "Preview": "Previsualizar", + "Preview the image in a new window": "Previsualizar en una nueva ventana", + "Alternate text:": "Texto alternativo:", + "For browsers that don't support images": "Para navegadores que no soportan imágenes", + "Positioning of this image": "Posición de la imagen", + "Image Preview:": "Previsualización de la imagen:", + "You must enter the URL": "Debe introducir la URL", + + // Editor Help + "Keyboard shortcuts": "Atajos de teclado", + "The editor provides the following key combinations:": "El editor proporciona las siguientes combinaciones:", + "new paragraph": "Nuevo parrafo", + "insert linebreak": "Insertar salto de línea", + "Set format to paragraph": "EStablecer el formato a parrafo", + "Clean content pasted from Word": "Limpiar el contenido pegado desde Word", + "Headings": "Cabeceras", + "Close": "Cerrar", + + // Loading messages + "Loading in progress. Please wait!": "Carga en proceso. Por favor espere.", + "Loading plugin $plugin" : "Cargando el plugin $plugin", + "Register plugin $plugin" : "Registro de plugin $plugin", + "Constructing object": "Construyendo objeto", + "Generate Xinha framework": "Generar Xinha framework", + "Init editor size":"Iniciar el tamaño del editor", + "Create Toolbar": "Crear barra de herramientas", + "Create Statusbar" : "Crear barra de estado", + "Register right panel" : "Registrar panel derecho", + "Register left panel" : "Registrar panel izquierdo", + "Register bottom panel" : "Registar panel inferior", + "Register top panel" : "Registar panel superior", + "Finishing" : "Finalizando", + + // ColorPicker + "Click a color..." : "Seleccione un color...", + "Sample" : "Muestra", + "Web Safe: " : "Color web: ", + "Color: " : "Color: " +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/eu.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/eu.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/eu.js 3 Jan 2016 20:47:00 -0000 1.1.2.1 @@ -0,0 +1,169 @@ +// I18N constants +// LANG: "eu", ENCODING: UTF-8 +{ + "Bold": "Lodia", + "Italic": "Etzana", + "Underline": "Azpimarratua", + "Strikethrough": "Marratua", + "Subscript": "Azpindizea", + "Superscript": "Goi-indizea", + "Justify Left": "Ezkerretara lerrokatu", + "Justify Center": "Zentratu", + "Justify Right": "Eskuinetara lerrokatu", + "Justify Full": "Justifikatu", + "Ordered List": "Zerrenda ordenatua", + "Bulleted List": "Zerrenda ez ordenatua", + "Decrease Indent": "Koska handitu", + "Increase Indent": "Koska txikitu", + "Font Color": "Testu-kolorea", + "Background Color": "Atzeko kolorea", + "Horizontal Rule": "Marra horizontala", + "Insert Web Link": "Lotura txertatu", + "Insert/Modify Image": "Irudia txertatu", + "Insert Table": "Taula txertatu", + "Toggle HTML Source": "Ikusi dokumentua HTML-n", + "Enlarge Editor": "Editorea handitu", + "About this editor": "Editoreari buruz...", + "Help using editor": "Laguntza", + "Current style": "Uneko estiloa", + "Undoes your last action": "Desegin", + "Redoes your last action": "Berregin", + "Cut selection": "Ebaki hautaketa", + "Copy selection": "Kopiatu hautaketa", + "Paste from clipboard": "Itsatsi arbelean dagoena", + "Direction left to right": "Ezkerretik eskuinetarako norabidea", + "Direction right to left": "Eskuinetik ezkerretarako norabidea", + "Remove formatting": "Formatoa kendu", + "Select all": "Dena aukeratu", + "Print document": "Dokumentua inprimatu", + "Clear MSOffice tags": "MSOffice etiketak ezabatu", + "Clear Inline Font Specifications": "Ezabatu testuaren ezaugarriak", + "Would you like to clear font typefaces?": "Letra-tipoak ezabatu nahi al dituzu?", + "Would you like to clear font sizes?": "Letra-tipoen neurriak ezabatu nahi al dituzu?", + "Would you like to clear font colours?": "Letra-tipoen koloreak ezabatu nahi al dituzu?", + "Split Block": "Blokea zatitu", + "Toggle Borders": "Ertzak trukatu", + "Save as": "Gorde honela:", + "Insert/Overwrite": "Txertatu/Gainidatzi", + "— format —": "— Formatua —", + "Heading 1": "Goiburua 1", + "Heading 2": "Goiburua 2", + "Heading 3": "Goiburua 3", + "Heading 4": "Goiburua 4", + "Heading 5": "Goiburua 5", + "Heading 6": "Goiburua 6", + "Normal": "Normala", + "Address": "Helbidea", + "Formatted": "Formateatua", + + //dialogs + "OK": "Ados", + "Cancel": "Utzi", + "Path": "Bidea", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "TESTU eran ari zara. Erabil ezazu [<>] botoia WYSIWIG erara itzultzeko.", + "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "Itsatsi botoia ez dabil Mozillan oinarritutako nabigatzaileetan (arrazoi teknikoengatik). Sacatu CTRL-V zure teklatuan, zuzenean itsasteko.", + + "You need to select some text before create a link": "Testu-atal bat aukeratu behar duzu lehendabizi, lotura bat sortzeko", + "Your Document is not well formed. Check JavaScript console for details.": "Zure dokumentuak ez du formatu zuzena. Begira ezazu JavaScript kontsola xehetasunetarako.", + + "Alignment:": "Lerrokatzea:", + "Not set": "Ez gaitua", + "Left": "Ezkerretara", + "Right": "Eskuinetara", + "Texttop": "Irudiaren goialdean", + "Absmiddle": "Irudiaren erdian", + "Baseline": "Irudiaren oinean", + "Absbottom": "Irudiaren behekaldean", + "Bottom": "Behean", + "Middle": "Erdian", + "Top": "Goian", + + "Layout": "Diseinua", + "Spacing": "Tartea", + "Horizontal:": "Horizontala:", + "Horizontal padding": "Betegarri horizontala", + "Vertical:": "Bertikala:", + "Vertical padding": "Betegarri bertikala", + "Border thickness:": "Ertzaren lodiera:", + "Leave empty for no border": "Uztazu hutsik ertzik ez sortzeko", + + //Insert Link + "Insert/Modify Link": "Lotura txertatu/aldatu", + "None (use implicit)": "Bat ere ez (implizituki erabili)", + "New window (_blank)": "Lehio berrian (_blank)", + "Same frame (_self)": "Frame berean (_self)", + "Top frame (_top)": "Goiko frame-an (_top)", + "Other": "Beste bat", + "Target:": "Helburua:", + "Title (tooltip):": "Izenburua (argibidea):", + "URL:": "URL-a:", + "You must enter the URL where this link points to": "Loturaren helburu den URL-a idatzi behar duzu", + + // Insert Table + "Insert Table": "Taula txertatu", + "Rows:": "Lerroak:", + "Number of rows": "Lerro-kopurua", + "Cols:": "Zutabeak:", + "Number of columns": "Zutabe-kopurua", + "Width:": "Zabalera:", + "Width of the table": "Taularen zabalera", + "Percent": "Portzentaia", + "Pixels": "Pixelak", + "Em": "Em", + "Width unit": "Zabalera-unitatea", + "Fixed width columns": "Zabalera finkodun zutabeak", + "Positioning of this table": "Taula honen kokapena", + "Cell spacing:": "Gelaxka-tartea:", + "Space between adjacent cells": "Gelaxka auzokideen arteko tartea", + "Cell padding:": "Gelaxkaren betegarria:", + "Space between content and border in cell": "Gelaxkaren edukia eta ertzaren arteko tartea", + "You must enter a number of rows": "Lerro-kopurua idatzi behar duzu", + "You must enter a number of columns": "Zutabe-kopurua idatzi behar duzu", + + // Insert Image + "Insert Image": "Irudia txertatu", + "Image URL:": "Irudiaren URL-a:", + "Enter the image URL here": "Idatz ezazu irudiaren URL-a hemen", + "Preview": "Aurrebista", + "Preview the image in a new window": "Aurreikusi irudia beste lehio batean", + "Alternate text:": "Testu alternatiboa:", + "For browsers that don't support images": "Irudirik onartzen ez duten nabigatzaileentzat", + "Positioning of this image": "Irudiaren kokapena", + "Image Preview:": "Irudiaren aurrebista:", + "You must enter the URL": "URL-a idatzi behar duzu", + + "button_bold": "de/bold.gif", + "button_italic": "de/italic.gif", + "button_underline": "de/underline.gif", + + // Editor Help + "Keyboard shortcuts": "Laster-teklak", + "The editor provides the following key combinations:": "Editoreak ondorengo tekla-konbinazioak eskaintzen ditu:", + "new paragraph": "Paragrafo berria", + "insert linebreak": "Lerro-jauzia txertatu", + "Set format to paragraph": "Formatua ezarri paragrafoari", + "Clean content pasted from Word": "Word-etik itsatsitako edukia ezabatu", + "Headings": "Goiburuak", + "Close": "Itxi", + + // Loading messages + "Loading in progress. Please wait!": "Kargatzen. Itxaron mesedez", + "Loading plugin $plugin" : "$plugin plugina kargatzen", + "Register plugin $plugin" : "$plugin plugina erregistratu", + "Constructing object": "Objektua eraikitzen", + "Generate Xinha framework": "Xinha Framework sortzen", + "Init editor size":"Editorearen hasierako neurria", + "Create Toolbar": "Tresna-barra sortu", + "Create Statusbar" : "Egoera-barra sortu", + "Register right panel" : "Eskuin-panela erregistratu", + "Register left panel" : "Ezker-panela erregistratu", + "Register bottom panel" : "Beheko panela erregistratu", + "Register top panel" : "Goiko panela erregistratu", + "Finishing" : "Bukatzen", + + // ColorPicker + "Click a color..." : "Kolore bat aukeratu...", + "Sample" : "Lagina", + "Web Safe: " : "Web Safe: ", + "Color: " : "Kolorea: " +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/fa.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/fa.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/fa.js 3 Jan 2016 20:47:00 -0000 1.1.2.1 @@ -0,0 +1,169 @@ +// I18N constants +// LANG: "fa", ENCODING: UTF-8 +{ + "Bold": "ضخیم", + "Italic": "مورب", + "Underline": "زیر خط", + "Strikethrough": "رو خط", + "Subscript": "زیروند", + "Superscript": "بالاوند", + "Justify Left": "تراز از چپ", + "Justify Center": "تراز در وسط", + "Justify Right": "تراز در راست", + "Justify Full": "تراز از چپ و راست", + "Ordered List": "فهرست مرتب", + "Bulleted List": "فهرست گلوله ای", + "Decrease Indent": "کاهش سر خط", + "Increase Indent": "افزایش سر خط", + "Font Color": "رنگ فلم", + "Background Color": "رنگ پس زمینه", + "Horizontal Rule": "خط افقی", + "Insert Web Link": "افزودن لینک وب", + "Insert/Modify Image": "افزودن یا ویرایش تصویر", + "Insert Table": "افزودن جدول", + "Toggle HTML Source": "مشاهده یا عدم مشاهده متن در قالب HTML", + "Enlarge Editor": "بزرگ کردن ویرایش گر", + "About this editor": "درباره این ویرایش گر", + "Help using editor": "راهنمای استفاده ویرایش گر", + "Current style": "شیوه کنونی", + "Undoes your last action": "برگرداندن آخرین عمل", + "Redoes your last action": "انجام مجدد آخرین عمل", + "Cut selection": "بریدن انتخاب شده", + "Copy selection": "کپی انتخاب شده", + "Paste from clipboard": "چسباندن از تخته کار", + "Direction left to right": "جهت از چپ به راست", + "Direction right to left": "جهت از راست به چپ", + "Remove formatting": "حذف فرمت بندی", + "Select all": "انتخاب همه", + "Print document": "چاپ سند", + "Clear MSOffice tags": "پاک کردن متن از برچسب های MSOffice", + "Clear Inline Font Specifications": "پاک کردن متن از مشخصات فونت", + "Would you like to clear font typefaces?": "آیا تمایل دارید ظاهر فلم را پاک کنید؟", + "Would you like to clear font sizes?": "آیا تمایل دارید اندازه قلم را پاک کنید", + "Would you like to clear font colours?": "آیا تمایل دارید رنگ قلم را پاک کنید؟", + "Split Block": "بلاک جداسازی", + "Toggle Borders": "فعال/غیر فعال کردن لبه ها", + "Save as": "ذخیره مانند...", + "Insert/Overwrite": "افزودن/جانویسی", + "— format —": "— قالب —", + "Heading 1": "تیتر 1", + "Heading 2": "تیتر 2", + "Heading 3": "تیتر 3", + "Heading 4": "تیتر 4", + "Heading 5": "تیتر 5", + "Heading 6": "تیتر 6", + "Normal": "معمولی", + "Address": "آدرس", + "Formatted": "قالب بندی شده", + + //dialogs + "OK": "بله", + "Cancel": "انصراف", + "Path": "مسیر", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "در مد متنی هستید. از دکمه [<>] استفاده نمایید تا به مد WYSIWYG برگردید.", + "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "دکمه چسباندن در مرورگرهای سری Mozilla کار نمی کند (به دلایل فنی امنیتی).برای چسباندن مستقیم ، دکمه CTRL-V را در صفحه کلید بزنید.", + "Your Document is not well formed. Check JavaScript console for details.": "سند شما بدرستی قالب بندی نشده است. برای اطلاعات بیشتر پایانه نمایش جاوااسکریپت را بررسی کنید.", + + "Alignment:": "تراز بندی", + "Not set": "تنظیم نشده", + "Left": "چپ", + "Right": "راست", + "Texttop": "بالای متن", + "Absmiddle": "دقیقا وسط", + "Baseline": "ابتدای خط", + "Absbottom": "دقیقا پایین", + "Bottom": "پایین", + "Middle": "وسط", + "Top": "بالا", + + "Layout": "لایه", + "Spacing": "فاصله گذاری", + "Horizontal:": "افقی", + "Horizontal padding": "پرکننده افقی", + "Vertical:": "عمودی", + "Vertical padding": "پرکننده عمودی", + "Border thickness:": "ضخامت لبه", + "Leave empty for no border": "برای بدون لبه خالی رها کن", + + //Insert Link + "Insert/Modify Link": "افزودن / ویرایش لینک", + "None (use implicit)": "هیچکدام (استفاده از بدون شرط)", + "New window (_blank)": "پنجره جدید (_blank)", + "Same frame (_self)": "فریم یکسان (_self)", + "Top frame (_top)": "فریم بالایی (_top)", + "Other": "سایر", + "Target:": "هدف", + "Title (tooltip):": "عنوان (راهنمای یک خطی)", + "URL:": "URL:", + "You must enter the URL where this link points to": "باید URLی که این لینک به آن اشاره دارد را وارد کنید", + "You need to select some text before creating a link": "باید قبل از ساخت لینک ، متنی را انتخاب نمایید", + + // Insert Table + "Insert Table": "افزودن جدول", + "Rows:": "ردیف ها", + "Number of rows": "تعداد ردیف ها", + "Cols:": "ستون ها", + "Number of columns": "تعداد ستون ها", + "Width:": "طول", + "Width of the table": "طول جدول", + "Percent": "درصد", + "Pixels": "پیکسل ها", + "Em": "Em", + "Width unit": "واحد طول", + "Fixed width columns": "ستون های طول ثابت", + "Positioning of this table": "موقعیت یابی این جدول", + "Cell spacing:": "فاصله سلول ها", + "Space between adjacent cells": "فاصله بین سلول های همجوار", + "Cell padding:": "پر کننده سلول", + "Space between content and border in cell": "فاصله بین محتوا و لبه در سلول", + "You must enter a number of rows": "باید تعداد ردیف ها را وارد کنید", + "You must enter a number of columns": "باید تعداد ستون ها را وارد کنید", + + // Insert Image + "Insert Image": "افزودن تصویر", + "Image URL:": "URL تصویر", + "Enter the image URL here": "URL تصویر را اینجا وارد کنید", + "Preview": "پیش نمایش", + "Preview the image in a new window": "پیش نمایش تصویر در پنجره ای جدید", + "Alternate text:": "متن جایگزین", + "For browsers that don't support images": "برای مرورگرهایی که از تصاویر پشتیبانی نمی کنند", + "Positioning of this image": "موقعیت یابی تصویر", + "Image Preview:": "پیش نمایش تصویر", + "You must enter the URL": "شما باید URL را وارد کنید", + + // toolbar + /* + "button_bold": "fr/bold.gif", + "button_underline": "fr/underline.gif", + "button_strikethrough": "fr/strikethrough.gif", + */ + + // Editor Help + "Xinha Help": "راهنمای Xinha", + "Editor Help": "راهنمای ویرایشگر", + "Keyboard shortcuts": "میانبرهای صفحه کلید", + "The editor provides the following key combinations:": "ویرایشگر استفاده از کلید های گروهی زیر را مسیر می سازد :", + "ENTER": "ENTREE", + "new paragraph": "پاراگراف جدید", + "SHIFT-ENTER": "SHIFT+ENTREE", + "insert linebreak": "افزودن جدا کننده خط", + "Set format to paragraph": "تغییر قالب به پاراگراف", + "Clean content pasted from Word": "تمیز کردن محتوای چسبانده شده از Word", + "Headings": "عنوان گذاری", + "Close": "بستن", + + // Loading messages + "Loading in progress. Please wait !": "بارگذاری در حال انجام است. لطفا صبر کنید !", + "Constructing main object": "ساختن شیء اصلی", + "Constructing object": "ساختن شیء", + "Register panel right": "ثبت قاب راست", + "Register panel left": "ثبت قاب چپ", + "Register panel top": "ثبت قاب بالا", + "Register panel bottom": "ثبت قاب پایین", + "Create Toolbar": "ساخت نوار ابزار", + "Create StatusBar": "ساخت نوار وضعیت", + "Generate Xinha object": "تولید شیء Xinha", + "Init editor size": "مقدار دهی اندازه ویرایشگر", + "Init IFrame": "مقدار دهی IFrame", + "Register plugin $plugin": "ثبت پلاگین $plugin" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/fi.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/fi.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/fi.js 3 Jan 2016 20:47:00 -0000 1.1.2.1 @@ -0,0 +1,38 @@ +// I18N constants + +// LANG: "en", ENCODING: UTF-8 + +{ + "Bold": "Lihavoitu", + "Italic": "Kursivoitu", + "Underline": "Alleviivattu", + "Strikethrough": "Yliviivattu", + "Subscript": "Alaindeksi", + "Superscript": "Yläindeksi", + "Justify Left": "Tasaa vasemmat reunat", + "Justify Center": "Keskitä", + "Justify Right": "Tasaa oikeat reunat", + "Justify Full": "Tasaa molemmat reunat", + "Ordered List": "Numerointi", + "Bulleted List": "Luettelomerkit", + "Decrease Indent": "Pienennä sisennystä", + "Increase Indent": "Lisää sisennystä", + "Font Color": "Fontin väri", + "Background Color": "Taustaväri", + "Horizontal Rule": "Vaakaviiva", + "Insert Web Link": "Lisää linkki", + "Insert/Modify Image": "Lisää kuva", + "Insert Table": "Lisää taulukko", + "Toggle HTML Source": "HTML-lähdekoodi vs WYSIWYG", + "Enlarge Editor": "Suurenna editori", + "About this editor": "Tietoja editorista", + "Help using editor": "Näytä ohje", + "Current style": "Nykyinen tyyli", + "Undoes your last action": "Peruuta viimeinen toiminto", + "Redoes your last action": "Palauta viimeinen toiminto", + "Cut selection": "Leikkaa maalattu", + "Copy selection": "Kopioi maalattu", + "Paste from clipboard": "Liitä leikepyödältä", + "OK": "Hyväksy", + "Cancel": "Peruuta" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/fr.js 3 Jan 2016 20:47:00 -0000 1.1.2.1 @@ -0,0 +1,171 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Bold": "Gras", + "Italic": "Italique", + "Underline": "Souligné", + "Strikethrough": "Barré", + "Subscript": "Indice", + "Superscript": "Exposant", + "Justify Left": "Aligner à gauche", + "Justify Center": "Centrer", + "Justify Right": "Aligner à droite", + "Justify Full": "Justifier", + "Ordered List": "Liste numérotée", + "Bulleted List": "Liste à puces", + "Decrease Indent": "Diminuer le retrait", + "Increase Indent": "Augmenter le retrait", + "Font Color": "Couleur de police", + "Background Color": "Surlignage", + "Horizontal Rule": "Ligne horizontale", + "Insert Web Link": "Insérer un lien", + "Insert/Modify Image": "Insérer / Modifier une image", + "Insert Table": "Insérer un tableau", + "Toggle HTML Source": "Afficher / Masquer code source", + "Enlarge Editor": "Agrandir l'éditeur", + "About this editor": "A propos", + "Help using editor": "Aide", + "Current style": "Style courant", + "Undoes your last action": "Annuler la dernière action", + "Redoes your last action": "Répéter la dernière action", + "Cut selection": "Couper la sélection", + "Copy selection": "Copier la sélection", + "Paste from clipboard": "Coller depuis le presse-papier", + "Direction left to right": "Direction de gauche à droite", + "Direction right to left": "Direction de droite à gauche", + "Remove formatting": "Supprimer mise en forme", + "Select all": "Tout sélectionner", + "Print document": "Imprimer document", + "Clear MSOffice tags": "Supprimer tags MSOffice", + "Clear Inline Font Specifications": "Supprimer paramètres inline de la police", + "Would you like to clear font typefaces?": "Voulez-vous supprimer les types ?", + "Would you like to clear font sizes?": "Voulez-vous supprimer les tailles ?", + "Would you like to clear font colours?": "Voulez-vous supprimer les couleurs ?", + "Split Block": "Séparer les blocs", + "Toggle Borders": "Afficher / Masquer les bordures", + "Save as": "Enregistrer sous", + "Insert/Overwrite": "Insertion / Remplacement", + "— format —": "— Format —", + "Heading 1": "Titre 1", + "Heading 2": "Titre 2", + "Heading 3": "Titre 3", + "Heading 4": "Titre 4", + "Heading 5": "Titre 5", + "Heading 6": "Titre 6", + "Normal": "Normal", + "Address": "Adresse", + "Formatted": "Formaté", + + //dialogs + "OK": "OK", + "Cancel": "Annuler", + "Path": "Chemin", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Vous êtes en MODE TEXTE. Appuyez sur le bouton [<>] pour retourner au mode WYSIWYG.", + "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "Le bouton Coller ne fonctionne pas sur les navigateurs basés sur Mozilla (pour des raisons de sécurité). Pressez CTRL-V au clavier pour coller directement.", + "Your Document is not well formed. Check JavaScript console for details.": "Le document est mal formé. Vérifiez la console JavaScript pour plus de détails.", + + "Alignment:": "Alignement", + "Not set": "Indéfini", + "Left": "Gauche", + "Right": "Droite", + "Texttop": "Texttop", + "Absmiddle": "Absmiddle", + "Baseline": "Baseline", + "Absbottom": "Absbottom", + "Bottom": "Bas", + "Middle": "Milieu", + "Top": "Haut", + + "Layout": "Mise en page", + "Spacing": "Espacement", + "Horizontal:": "Horizontal", + "Horizontal padding": "Marge horizontale interne", + "Vertical:": "Vertical", + "Vertical padding": "Marge verticale interne", + "Border thickness:": "Epaisseur de bordure", + "Leave empty for no border": "Laisser vide pour pas de bordure", + + //Insert Link + "Insert/Modify Link": "Insérer / Modifier un lien", + "None (use implicit)": "Aucune (implicite)", + "New window (_blank)": "Nouvelle fenêtre (_blank)", + "Same frame (_self)": "Même frame (_self)", + "Top frame (_top)": "Frame principale (_top)", + "Other": "Autre", + "Target:": "Cible", + "Title (tooltip):": "Texte alternatif", + "URL:": "URL:", + "You must enter the URL where this link points to": "Vous devez entrer l'URL de ce lien", + "You need to select some text before creating a link": "Vous devez sélectionner du texte avant de créer un lien", + + // Insert Table + "Insert Table": "Insérer un tableau", + "Rows:": "Lignes", + "Number of rows": "Nombre de lignes", + "Cols:": "Colonnes", + "Number of columns": "Nombre de colonnes", + "Width:": "Largeur", + "Width of the table": "Largeur du tableau", + "Percent": "Pourcent", + "Pixels": "Pixels", + "Em": "Em", + "Width unit": "Unités de largeur", + "Fixed width columns": "Colonnes à taille fixe", + "Positioning of this table": "Position du tableau", + "Cell spacing:": "Espacement", + "Space between adjacent cells": "Espace entre les cellules adjacentes", + "Cell padding:": "Marge interne", + "Space between content and border in cell": "Espace entre le contenu et la bordure d'une cellule", + "You must enter a number of rows": "Vous devez entrer le nombre de lignes", + "You must enter a number of columns": "Vous devez entrer le nombre de colonnes", + + // Insert Image + "Insert Image": "Insérer une image", + "Image URL:": "URL image", + "Enter the image URL here": "Entrer l'URL de l'image ici", + "Preview": "Prévisualiser", + "Preview the image in a new window": "Prévisualiser l'image dans une nouvelle fenêtre", + "Alternate text:": "Texte alternatif", + "For browsers that don't support images": "Pour les navigateurs qui ne supportent pas les images", + "Positioning of this image": "Position de l'image", + "Image Preview:": "Prévisualisation", + "You must enter the URL": "Vous devez entrer l'URL", + + // toolbar +/* + "button_bold": "fr/bold.gif", + "button_underline": "fr/underline.gif", + "button_strikethrough": "fr/strikethrough.gif", +*/ + + // Editor Help + "Xinha Help": "Aide Xinha", + "Editor Help": "Aide de l'éditeur", + "Keyboard shortcuts": "Raccourcis clavier", + "The editor provides the following key combinations:": "L'éditeur fournit les combinaisons de touches suivantes :", + "ENTER": "ENTREE", + "new paragraph": "Nouveau paragraphe", + "SHIFT-ENTER": "SHIFT+ENTREE", + "insert linebreak": "Insère un saut de ligne", + "Set format to paragraph": "Applique le format paragraphe", + "Clean content pasted from Word": "Nettoyage du contenu copié depuis Word", + "Headings": "Titres", + "Close": "Fermer", + + // Loading messages + "Loading in progress. Please wait!": "Chargement en cours. Veuillez patienter!", + "Finishing" : "Chargement bientôt terminé", + "Constructing object": "Construction de l'objet", + "Create Toolbar": "Construction de la barre d'icones", + "Create Statusbar": "Construction de la barre de status", + "Register right panel" : "Enregistrement du panneau droit", + "Register left panel" : "Enregistrement du panneau gauche", + "Register bottom panel" : "Enregistrement du panneau supérieur", + "Register top panel" : "Enregistrement du panneau inférieur", + "Generate Xinha framework": "Génération de Xinha", + "Init editor size": "Initialisation de la taille d'édition", + "Init IFrame": "Initialisation de l'iframe", + "Register plugin $plugin": "Enregistrement du plugin $plugin", + "Loading plugin $plugin" : "Chargement du plugin $plugin" + +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/gb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/gb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/gb.js 3 Jan 2016 20:47:00 -0000 1.1.2.1 @@ -0,0 +1,29 @@ +// I18N constants -- Chinese GB +// by Dave Lo -- dlo@interactivetools.com +{ + "Bold": "粗体", + "Italic": "斜体", + "Underline": "底线", + "Strikethrough": "删除线", + "Subscript": "下标", + "Superscript": "上标", + "Justify Left": "位置靠左", + "Justify Center": "位置居中", + "Justify Right": "位置靠右", + "Justify Full": "位置左右平等", + "Ordered List": "顺序清单", + "Bulleted List": "无序清单", + "Decrease Indent": "减小行前空白", + "Increase Indent": "加宽行前空白", + "Font Color": "文字颜色", + "Background Color": "背景颜色", + "Horizontal Rule": "水平线", + "Insert Web Link": "插入连结", + "Insert/Modify Image": "插入图形", + "Insert Table": "插入表格", + "Toggle HTML Source": "切换HTML原始码", + "Enlarge Editor": "放大", + "About this editor": "关於 Xinha", + "Help using editor": "说明", + "Current style": "字体例子" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/he.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/he.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/he.js 3 Jan 2016 20:47:00 -0000 1.1.2.1 @@ -0,0 +1,64 @@ +// I18N constants + +// LANG: "he", ENCODING: UTF-8 +// Author: Liron Newman, http://www.eesh.net, + +// FOR TRANSLATORS: +// +// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE +// (at least a valid email address) +// +// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; +// (if this is not possible, please include a comment +// that states what encoding is necessary.) + +{ + "Bold": "מודגש", + "Italic": "נטוי", + "Underline": "קו תחתי", + "Strikethrough": "קו אמצע", + "Subscript": "כתב עילי", + "Superscript": "כתב תחתי", + "Justify Left": " ישור לשמאל", + "Justify Center": "ישור למרכז", + "Justify Right": "ישור לימין", + "Justify Full": "ישור לשורה מלאה", + "Ordered List": "רשימה ממוספרת", + "Bulleted List": "רשימה לא ממוספרת", + "Decrease Indent": "הקטן כניסה", + "Increase Indent": "הגדל כניסה", + "Font Color": "צבע גופן", + "Background Color": "צבע רקע", + "Horizontal Rule": "קו אנכי", + "Insert Web Link": "הכנס היפר-קישור", + "Insert/Modify Image": "הכנס/שנה תמונה", + "Insert Table": "הכנס טבלה", + "Toggle HTML Source": "שנה מצב קוד HTML", + "Enlarge Editor": "הגדל את העורך", + "About this editor": "אודות עורך זה", + "Help using editor": "עזרה לשימוש בעורך", + "Current style": "סגנון נוכחי", + "Undoes your last action": "מבטל את פעולתך האחרונה", + "Redoes your last action": "מבצע מחדש את הפעולה האחרונה שביטלת", + "Cut selection": "גזור בחירה", + "Copy selection": "העתק בחירה", + "Paste from clipboard": "הדבק מהלוח", + "Direction left to right": "כיוון משמאל לימין", + "Direction right to left": "כיוון מימין לשמאל", + "OK": "אישור", + "Cancel": "ביטול", + "Path": "נתיב עיצוב", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "אתה במצב טקסט נקי (קוד). השתמש בכפתור [<>] כדי לחזור למצב WYSIWYG (תצוגת עיצוב).", + "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "מצב מסך מלא יוצר בעיות בדפדפן Internet Explorer, עקב באגים בדפדפן לא יכולנו לפתור את זה. את/ה עלול/ה לחוות תצוגת זבל, בעיות בתפקוד העורך ו/או קריסה של הדפדפן. אם המערכת שלך היא Windows 9x סביר להניח שתקבל/י ", + "Cancel": "ביטול", + "Insert/Modify Link": "הוסף/שנה קישור", + "New window (_blank)": "חלון חדש (_blank)", + "None (use implicit)": "ללא (השתמש ב-frame הקיים)", + "Other": "אחר", + "Same frame (_self)": "אותו frame (_self)", + "Target:": "יעד:", + "Title (tooltip):": "כותרת (tooltip):", + "Top frame (_top)": "Frame עליון (_top)", + "URL:": "URL:", + "You must enter the URL where this link points to": "חובה לכתוב URL שאליו קישור זה מצביע" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/hu.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/hu.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/hu.js 3 Jan 2016 20:47:01 -0000 1.1.2.1 @@ -0,0 +1,64 @@ +// I18N constants + +// LANG: "hu", ENCODING: UTF-8 +// Author: Miklós Somogyi, + +// FOR TRANSLATORS: +// +// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE +// (at least a valid email address) +// +// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; +// (if this is not possible, please include a comment +// that states what encoding is necessary.) + +{ + "Bold": "Félkövér", + "Italic": "Dőlt", + "Underline": "Aláhúzott", + "Strikethrough": "Áthúzott", + "Subscript": "Alsó index", + "Superscript": "Felső index", + "Justify Left": "Balra zárt", + "Justify Center": "Középre zárt", + "Justify Right": "Jobbra zárt", + "Justify Full": "Sorkizárt", + "Ordered List": "Számozott lista", + "Bulleted List": "Számozatlan lista", + "Decrease Indent": "Behúzás csökkentése", + "Increase Indent": "Behúzás növelése", + "Font Color": "Karakterszín", + "Background Color": "Háttérszín", + "Horizontal Rule": "Elválasztó vonal", + "Insert Web Link": "Hiperhivatkozás beszúrása", + "Insert/Modify Image": "Kép beszúrása", + "Insert Table": "Táblázat beszúrása", + "Toggle HTML Source": "HTML forrás be/ki", + "Enlarge Editor": "Szerkesztő külön ablakban", + "About this editor": "Névjegy", + "Help using editor": "Súgó", + "Current style": "Aktuális stílus", + "Undoes your last action": "Visszavonás", + "Redoes your last action": "Újra végrehajtás", + "Cut selection": "Kivágás", + "Copy selection": "Másolás", + "Paste from clipboard": "Beillesztés", + "Direction left to right": "Irány balról jobbra", + "Direction right to left": "Irány jobbról balra", + "OK": "Rendben", + "Cancel": "Mégsem", + "Path": "Hierarchia", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Forrás mód. Visszaváltás [<>] gomb", + "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "A teljesképrenyős szerkesztés hibát okozhat Internet Explorer használata esetén, ez a böngésző a hibája, amit nem tudunk kikerülni. Szemetet észlelhet a képrenyőn, illetve néhány funkció hiányozhat és/vagy véletlenszerűen lefagyhat a böngésző. Windows 9x operaciós futtatása esetén elég valószínű, hogy ", + "Cancel": "Mégsem", + "Insert/Modify Link": "Hivatkozás Beszúrása/Módosítása", + "New window (_blank)": "Új ablak (_blank)", + "None (use implicit)": "Nincs (use implicit)", + "Other": "Más", + "Same frame (_self)": "Ugyanabba a keretbe (_self)", + "Target:": "Cél:", + "Title (tooltip):": "Cím (tooltip):", + "Top frame (_top)": "Felső keret (_top)", + "URL:": "URL:", + "You must enter the URL where this link points to": "Be kell írnia az URL-t, ahova a hivatkozás mutasson" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/it.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/it.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/it.js 3 Jan 2016 20:47:01 -0000 1.1.2.1 @@ -0,0 +1,55 @@ +// I18N constants + +// LANG: "it", ENCODING: UTF-8 +// Author: Mattia Landoni, http://www.webpresident.org/ + +{ + "Bold": "Grassetto", + "Italic": "Corsivo", + "Underline": "Sottolineato", + "Strikethrough": "Barrato", + "Subscript": "Pedice", + "Superscript": "Apice", + "Justify Left": "Sinistra", + "Justify Center": "Centrato", + "Justify Right": "Destra", + "Justify Full": "Giustificato", + "Ordered List": "Lista numerata", + "Bulleted List": "Lista non numerata", + "Decrease Indent": "Diminuisci indentazione", + "Increase Indent": "Aumenta indentazione", + "Font Color": "Colore font", + "Background Color": "Colore sfondo", + "Horizontal Rule": "Righello orizzontale", + "Insert Web Link": "Inserisci link", + "Insert/Modify Image": "Inserisci/modifica Immagine", + "Insert Table": "Inserisci tabella", + "Toggle HTML Source": "Visualizza/nascondi sorgente HTML", + "Enlarge Editor": "Allarga editor", + "About this editor": "Informazioni su Xinha", + "Help using editor": "Aiuto", + "Current style": "Stile corrente", + "Undoes your last action": "Annulla ultima azione", + "Redoes your last action": "Ripeti ultima azione", + "Cut selection": "Taglia", + "Copy selection": "Copia", + "Paste from clipboard": "Incolla", + "Direction left to right": "Testo da sx a dx", + "Direction right to left": "Testo da dx a sx", + "OK": "OK", + "Cancel": "Annulla", + "Path": "Percorso", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Sei in MODALITA", + "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "E", + "Cancel": "Annulla", + "Insert/Modify Link": "Inserisci/modifica link", + "New window (_blank)": "Nuova finestra (_blank)", + "None (use implicit)": "Niente (usa implicito)", + "Other": "Altro", + "Same frame (_self)": "Stessa frame (_self)", + "Target:": "Target:", + "Title (tooltip):": "Title (suggerimento):", + "Top frame (_top)": "Pagina intera (_top)", + "URL:": "URL:", + "You must enter the URL where this link points to": "Devi inserire l'indirizzo a cui punta il link" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ja.js 3 Jan 2016 20:47:01 -0000 1.1.2.1 @@ -0,0 +1,175 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8N + +{ + "Bold": "太字", + "Italic": "斜体", + "Underline": "下線", + "Strikethrough": "打ち消し線", + "Subscript": "下付き添え字", + "Superscript": "上付き添え字", + "Justify Left": "左寄せ", + "Justify Center": "中央寄せ", + "Justify Right": "右寄せ", + "Justify Full": "均等割付", + "Ordered List": "番号付き箇条書き", + "Bulleted List": "記号付き箇条書き", + "Decrease Indent": "インデント解除", + "Increase Indent": "インデント設定", + "Font Color": "文字色", + "Background Color": "背景色", + "Horizontal Rule": "水平線", + "Insert Web Link": "リンクの挿入", + "Insert/Modify Image": "画像の挿入/修正", + "Insert Table": "テーブルを挿入", + "Toggle HTML Source": "HTML編集モードを切替", + "Enlarge Editor": "エディタを最大化", + "About this editor": "バージョン情報", + "Help using editor": "ヘルプ", + "Current style": "現在のスタイル", + "Undoes your last action": "元に戻す", + "Redoes your last action": "やり直し", + "Cut selection": "切り取り", + "Copy selection": "コピー", + "Paste from clipboard": "貼り付け", + "Direction left to right": "左から右へ", + "Direction right to left": "右から左へ", + "Remove formatting": "書式削除", + "Select all": "すべて選択", + "Print document": "印刷", + "Clear MSOffice tags": "MSOfficeタグをクリア", + "Clear Inline Font Specifications": "インラインフォント指定をクリア", + "Would you like to clear font typefaces?": "フォント名をクリアしますか?", + "Would you like to clear font sizes?": "サイズをクリアしますか?", + "Would you like to clear font colours?": "色をクリアしますか?", + "Split Block": "領域分割", + "Toggle Borders": "境界線の切替", + "Save as": "名前をつけて保存", + "Insert/Overwrite": "挿入/上書き", + "— format —": "— 書式 —", + "Heading 1": "見出し1", + "Heading 2": "見出し2", + "Heading 3": "見出し3", + "Heading 4": "見出し4", + "Heading 5": "見出し5", + "Heading 6": "見出し6", + "Normal": "標準", + "Address": "アドレス", + "Formatted": "整形済み", + "— font —": "— フォント —", + "— size —": "— サイズ —", + + //dialogs + "OK": "OK", + "Cancel": "中止", + "Path": "パス", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "テキストモードで操作しています。WYSIWYG編集に戻るには[<>]ボタンを使ってください。", + "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "MozillaベースのWebブラウザでは、貼り付けボタンは機能しません(技術的なセキュリティ上の理由で)。Ctrl+Vキーを押して直接貼り付けてください。", + "Your Document is not well formed. Check JavaScript console for details.": "この文書には構文的な問題があります。詳細はJavaScriptコンソールを参照してください。", + "You need to select some text before creating a link": "リンクを作成するにはテキストを選択する必要があります", + + "Alignment:": "行揃え:", + "Not set": "なし", + "Left": "左", + "Right": "右", + "Texttop": "テキスト上部", + "Absmiddle": "中央(絶対的)", + "Baseline": "ベースライン", + "Absbottom": "下(絶対的)", + "Bottom": "下", + "Middle": "中央", + "Top": "上", + + "Layout": "レイアウト", + "Spacing": "間隔", + "Horizontal:": "水平:", + "Horizontal padding": "水平余白", + "Vertical:": "垂直:", + "Vertical padding": "垂直余白", + "Border thickness:": "境界線の太さ:", + "Leave empty for no border": "境界線がない場合は空のままにする", + + //Insert Link + "Insert/Modify Link": "リンクの挿入/修正", + "None (use implicit)": "なし (デフォルトに任せる)", + "New window (_blank)": "新しいウィンドウ (_blank)", + "Same frame (_self)": "自己フレーム内 (_self)", + "Top frame (_top)": "最上位フレーム (_top)", + "Other": "その他", + "Target:": "ターゲット:", + "Title (tooltip):": "タイトル:", + "URL:": "URL:", + "You must enter the URL where this link points to": "このリンクが指し示すURLを入力してください", + + // Insert Table + "Insert Table": "テーブルの挿入", + "Rows:": "行:", + "Number of rows": "行数", + "Cols:": "列:", + "Number of columns": "列数", + "Width:": "幅:", + "Width of the table": "テーブルの幅", + "Percent": "パーセント(%)", + "Pixels": "ピクセル(px)", + "Em": "相対値(em)", + "Width unit": "幅の単位", + "Fixed width columns": "列の幅を固定", + "Positioning of this table": "このテーブルの配置", + "Cell spacing:": "セル間隔:", + "Space between adjacent cells": "隣接するセル間の距離", + "Cell padding:": "セル余白:", + "Space between content and border in cell": "セル内における内容と境界線との距離", + "You must enter a number of rows": "行数を入力してください", + "You must enter a number of columns": "列数を入力してください", + + // Insert Image + "Insert Image": "画像の挿入", + "Image URL:": "画像URL:", + "Enter the image URL here": "画像のURLをここに入力します", + "Preview": "表示", + "Preview the image in a new window": "ウィンドウで画像を表示", + "Alternate text:": "代替テキスト:", + "For browsers that don't support images": "画像表示をサポートしないブラウザに必要です", + "Positioning of this image": "画像の配置", + "Image Preview:": "画像表示:", + "You must enter the URL": "URLを入力する必要があります", + + //"button_bold": "fr/bold.gif", + //"button_underline": "fr/underline.gif", + //"button_strikethrough": "fr/strikethrough.gif", + + // Editor Help + "Xinha Help": "ヘルプ", + "Editor Help": "エディタのヘルプ", + "Keyboard shortcuts": "キーボードショートカット", + "The editor provides the following key combinations:": "エディタは以下のキー操作を提供しています:", + "ENTER": "ENTER", + "new paragraph": "新規段落", + "SHIFT-ENTER": "SHIFT+ENTER", + "insert linebreak": "段落内改行の挿入", + "Set format to paragraph": "段落書式の設定", + "Clean content pasted from Word": "Wordから貼り付けられた内容の清書", + "Headings": "見出し", + "Close": "閉じる", + + // Loading messages + "Loading in progress. Please wait!": "ロード中です。しばらくお待ちください", + "Loading plugin $plugin" : "ロード中プラグイン $plugin", + "Register plugin $plugin" : "登録中プラグイン $plugin", + "Constructing object": "オブジェクト構築中", + "Generate Xinha framework": "Xinhaフレームワーク生成中", + "Init editor size":"エディタサイズの初期化", + "Create Toolbar": "ツールバーの作成", + "Create Statusbar" : "ステータスバーの作成", + "Register right panel" : "登録 右パネル", + "Register left panel" : "登録 左パネル", + "Register bottom panel" : "登録 下パネル", + "Register top panel" : "登録 上パネル", + "Finishing" : "完了", + + // ColorPicker + "Click a color..." : "色をクリック...", + "Sample" : "サンプル", + "Web Safe: " : "Webセーフ: ", + "Color: " : "色: " +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/lt.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/lt.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/lt.js 3 Jan 2016 20:47:01 -0000 1.1.2.1 @@ -0,0 +1,53 @@ +// I18N constants + +// LANG: "lt", ENCODING: UTF-8 +// Author: Jaroslav Šatkevič, + +{ + "Bold": "Paryškinti", + "Italic": "Kursyvas", + "Underline": "Pabraukti", + "Strikethrough": "Perbraukti", + "Subscript": "Apatinis indeksas", + "Superscript": "Viršutinis indeksas", + "Justify Left": "Lygiavimas pagal kairę", + "Justify Center": "Lygiavimas pagal centrą", + "Justify Right": "Lygiavimas pagal dešinę", + "Justify Full": "Lygiuoti pastraipą", + "Ordered List": "Numeruotas sąrašas", + "Bulleted List": "Suženklintas sąrašas", + "Decrease Indent": "Sumažinti paraštę", + "Increase Indent": "Padidinti paraštę", + "Font Color": "Šrifto spalva", + "Background Color": "Fono spalva", + "Horizontal Rule": "Horizontali linija", + "Insert Web Link": "Įterpti nuorodą", + "Insert/Modify Image": "Įterpti paveiksliuką", + "Insert Table": "Įterpti lentelę", + "Toggle HTML Source": "Perjungti į HTML/WYSIWYG", + "Enlarge Editor": "Išplėstas redagavimo ekranas/Enlarge Editor", + "About this editor": "Apie redaktorių", + "Help using editor": "Pagalba naudojant redaktorių", + "Current style": "Dabartinis stilius", + "Undoes your last action": "Atšaukia paskutini jūsų veiksmą", + "Redoes your last action": "Pakartoja paskutinį atšauktą jūsų veiksmą", + "Cut selection": "Iškirpti", + "Copy selection": "Kopijuoti", + "Paste from clipboard": "Įterpti", + "OK": "OK", + "Cancel": "Atšaukti", + "Path": "Kelias", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Jūs esete teksto režime. Naudokite [<>] mygtuką grįžimui į WYSIWYG.", + "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren", + "Cancel": "Atšaukti", + "Insert/Modify Link": "Idėti/Modifikuoti", + "New window (_blank)": "Naujas langas (_blank)", + "None (use implicit)": "None (use implicit)", + "Other": "Kitas", + "Same frame (_self)": "Same frame (_self)", + "Target:": "Target:", + "Title (tooltip):": "Pavadinimas (tooltip):", + "Top frame (_top)": "Top frame (_top)", + "URL:": "URL:", + "You must enter the URL where this link points to": "Jus privalote nurodyti URL į kuri rodo šitą nuoroda" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/lv.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/lv.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/lv.js 3 Jan 2016 20:47:01 -0000 1.1.2.1 @@ -0,0 +1,42 @@ +// I18N constants + +// LANG: "lv", ENCODING: UTF-8 +// Author: Mihai Bazon, http://dynarch.com/mishoo +// Translated by: Janis Klavins, + +{ + "Bold": "Trekniem burtiem", + "Italic": "Kurs�v�", + "Underline": "Pasv�trots", + "Strikethrough": "P�rsv�trots", + "Subscript": "Novietot zem rindas", + "Superscript": "Novietot virs rindas", + "Justify Left": "Izl�dzin�t pa kreisi", + "Justify Center": "Izl�dzin�t centr�", + "Justify Right": "Izl�dzin�t pa labi", + "Justify Full": "Izl�dzin�t pa visu lapu", + "Ordered List": "Numur�ts saraksts", + "Bulleted List": "Saraksts", + "Decrease Indent": "Samazin�t atk�pi", + "Increase Indent": "Palielin�t atk�pi", + "Font Color": "Burtu kr�sa", + "Background Color": "Fona kr�sa", + "Horizontal Rule": "Horizont�la atdal�t�jsv�tra", + "Insert Web Link": "Ievietot hipersaiti", + "Insert/Modify Image": "Ievietot att�lu", + "Insert Table": "Ievietot tabulu", + "Toggle HTML Source": "Skat�t HTML kodu", + "Enlarge Editor": "Palielin�t Redi��t�ju", + "About this editor": "Par �o redi��t�ju", + "Help using editor": "Redi��t�ja pal�gs", + "Current style": "Patreiz�jais stils", + "Undoes your last action": "Atcelt p�d�jo darb�bu", + "Redoes your last action": "Atk�rtot p�d�jo darb�bu", + "Cut selection": "Izgriezt iez�m�to", + "Copy selection": "Kop�t iez�m�to", + "Paste from clipboard": "Ievietot iez�m�to", + "OK": "Labi", + "Cancel": "Atcelt", + "Path": "Ce��", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "J�s patlaban darbojaties TEKSTA RE��M�. Lai p�rietu atpaka� uz GRAFISKO RE��MU (WYSIWIG), lietojiet [<>] pogu." +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/nb.js 3 Jan 2016 20:47:02 -0000 1.1.2.1 @@ -0,0 +1,78 @@ +// I18N constants + +// LANG: "nb", ENCODING: UTF-8 + +// - translated by ses +// Additional translations by Håvard Wigtil +// Additional translations by Kim Steinhaug + +{ + "Bold": "Fet", + "Italic": "Kursiv", + "Underline": "Understreket", + "Strikethrough": "Gjennomstreket", + "Subscript": "Nedsenket", + "Superscript": "Opphøyet", + "Justify Left": "Venstrejuster", + "Justify Center": "Midtjuster", + "Justify Right": "Høyrejuster", + "Justify Full": "Blokkjuster", + "Ordered List": "Nummerert liste", + "Bulleted List": "Punktliste", + "Decrease Indent": "Reduser innrykk", + "Increase Indent": "Øke innrykk", + "Font Color": "Tekstfarge", + "Background Color": "Bakgrundsfarge", + "Horizontal Rule": "Vannrett linje", + "Insert Web Link": "Lag lenke", + "Insert/Modify Image": "Sett inn bilde", + "Insert Table": "Sett inn tabell", + "Toggle HTML Source": "Vis kildekode", + "Enlarge Editor": "Vis i eget vindu", + "About this editor": "Om denne editor", + "Help using editor": "Hjelp", + "Current style": "Nåværende stil", + "Undoes your last action": "Angrer siste redigering", + "Redoes your last action": "Gjør om siste angring", + "Cut selection": "Klipp ut område", + "Copy selection": "Kopier område", + "Save as": "Lagre som", + "Paste from clipboard": "Lim inn", + "Remove formatting": "Fjern formattering", + "Direction left to right": "Fra venstre mot høyre", + "Direction right to left": "Fra høyre mot venstre", + "Insert/Overwrite": "Sett inn/Overskriv", + "OK": "OK", + "Cancel": "Avbryt", + "Path": "Tekstvelger", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Du er i tekstmodus Klikk på [<>] for å gå tilbake til WYSIWIG.", + "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "Visning i eget vindu har kjente problemer med Internet Explorer, på grunn av problemer med denne nettleseren. Mulige problemer er et uryddig skjermbilde, manglende editorfunksjoner og/eller at nettleseren crasher. Hvis du bruker Windows 95 eller Windows 98 er det også muligheter for at Windows will crashe.\n\nTrykk ", + "Cancel": "Avbryt", + "Insert/Modify Link": "Rediger lenke", + "New window (_blank)": "Eget vindu (_blank)", + "None (use implicit)": "Ingen (bruk standardinnstilling)", + "Other": "Annen", + "Same frame (_self)": "Samme ramme (_self)", + "Target:": "Mål:", + "Title (tooltip):": "Tittel (tooltip):", + "Top frame (_top)": "Toppramme (_top)", + "URL:": "Adresse:", + "You must enter the URL where this link points to": "Du må skrive inn en adresse som denne lenken skal peke til", + "Clear Inline Font Specifications": "Fjerne inline font spesifikasjoner", + "Would you like to clear font typefaces?": "Ønsker du å fjerne skrifttyper", + "Would you like to clear font sizes?": "Ønsker du å fjerne skrift størrelser", + "Would you like to clear font colours?": "Ønsker du å fjerne farger på skriften", + "Print document": "Skriv ut dokumentet", + "Split Block": "Seperasjonsblokk", + "Toggle Borders": "Skru av/på hjelpelinjer på tabeller", + "Select all": "Merk alt", + // Loading messages + "Loading in progress. Please wait !": "WYSIWYG laster, vennligst vent!", + "Constructing main object": "Vennligst vent", + "Create Toolbar": "Lag verktøylinje", + "Register panel right": "Registrer høyrepanel", + "Register panel left": "Registrer venstrepanel", + "Register panel top": "Registrer toppanel", + "Register panel bottom": "Registrer bunnpanel" + +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/nl.js 3 Jan 2016 20:47:02 -0000 1.1.2.1 @@ -0,0 +1,64 @@ +// I18N constants + +// LANG: "nl", ENCODING: UTF-8 +// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl + +// FOR TRANSLATORS: +// +// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE +// (at least a valid email address) +// +// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; +// (if this is not possible, please include a comment +// that states what encoding is necessary.) + +{ + "Bold": "Vet", + "Italic": "Cursief", + "Underline": "Onderstrepen", + "Strikethrough": "Doorhalen", + "Subscript": "Subscript", + "Superscript": "Superscript", + "Justify Left": "Links uitlijnen", + "Justify Center": "Centreren", + "Justify Right": "Rechts uitlijnen", + "Justify Full": "Uitvullen", + "Ordered List": "Nummering", + "Bulleted List": "Opsommingstekens", + "Decrease Indent": "Inspringing verkleinen", + "Increase Indent": "Inspringing vergroten", + "Font Color": "Tekstkleur", + "Background Color": "Achtergrondkleur", + "Horizontal Rule": "Horizontale lijn", + "Insert Web Link": "Hyperlink invoegen/aanpassen", + "Insert/Modify Image": "Afbeelding invoegen/aanpassen", + "Insert Table": "Tabel invoegen", + "Toggle HTML Source": "HTML broncode", + "Enlarge Editor": "Vergroot Editor", + "About this editor": "Over deze editor", + "Help using editor": "Xinha help", + "Current style": "Huidige stijl", + "Undoes your last action": "Ongedaan maken", + "Redoes your last action": "Herhalen", + "Cut selection": "Knippen", + "Copy selection": "Kopi?ren", + "Paste from clipboard": "Plakken", + "Direction left to right": "Tekstrichting links naar rechts", + "Direction right to left": "Tekstrichting rechts naar links", + "OK": "OK", + "Cancel": "Annuleren", + "Path": "Pad", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Je bent in TEKST-mode. Gebruik de [<>] knop om terug te keren naar WYSIWYG-mode.", + "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "Fullscreen-mode veroorzaakt problemen met Internet Explorer door bugs in de webbrowser die we niet kunnen omzeilen. Hierdoor kunnen de volgende effecten optreden: verknoeide teksten, een verlies aan editor-functionaliteit en/of willekeurig vastlopen van de webbrowser. Als u Windows 95 of 98 gebruikt, is het zeer waarschijnlijk dat u een algemene beschermingsfout (", + "Cancel": "Annuleren", + "Insert/Modify Link": "Hyperlink invoegen/aanpassen", + "New window (_blank)": "Nieuw venster (_blank)", + "None (use implicit)": "Geen", + "Other": "Ander", + "Same frame (_self)": "Zelfde frame (_self)", + "Target:": "Doel:", + "Title (tooltip):": "Titel (tooltip):", + "Top frame (_top)": "Bovenste frame (_top)", + "URL:": "URL:", + "You must enter the URL where this link points to": "Geef de URL in waar de link naar verwijst" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/no.js 3 Jan 2016 20:47:02 -0000 1.1.2.1 @@ -0,0 +1,78 @@ +// I18N constants + +// LANG: "no", ENCODING: UTF-8 + +// - translated by ses +// Additional translations by Håvard Wigtil +// Additional translations by Kim Steinhaug + +{ + "Bold": "Fet", + "Italic": "Kursiv", + "Underline": "Understreket", + "Strikethrough": "Gjennomstreket", + "Subscript": "Nedsenket", + "Superscript": "Opphøyet", + "Justify Left": "Venstrejuster", + "Justify Center": "Midtjuster", + "Justify Right": "Høyrejuster", + "Justify Full": "Blokkjuster", + "Ordered List": "Nummerert liste", + "Bulleted List": "Punktliste", + "Decrease Indent": "Reduser innrykk", + "Increase Indent": "Øke innrykk", + "Font Color": "Tekstfarge", + "Background Color": "Bakgrundsfarge", + "Horizontal Rule": "Vannrett linje", + "Insert Web Link": "Lag lenke", + "Insert/Modify Image": "Sett inn bilde", + "Insert Table": "Sett inn tabell", + "Toggle HTML Source": "Vis kildekode", + "Enlarge Editor": "Vis i eget vindu", + "About this editor": "Om denne editor", + "Help using editor": "Hjelp", + "Current style": "Nåværende stil", + "Undoes your last action": "Angrer siste redigering", + "Redoes your last action": "Gjør om siste angring", + "Cut selection": "Klipp ut område", + "Copy selection": "Kopier område", + "Save as": "Lagre som", + "Paste from clipboard": "Lim inn", + "Remove formatting": "Fjern formattering", + "Direction left to right": "Fra venstre mot høyre", + "Direction right to left": "Fra høyre mot venstre", + "Insert/Overwrite": "Sett inn/Overskriv", + "OK": "OK", + "Cancel": "Avbryt", + "Path": "Tekstvelger", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Du er i tekstmodus Klikk på [<>] for å gå tilbake til WYSIWIG.", + "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "Visning i eget vindu har kjente problemer med Internet Explorer, på grunn av problemer med denne nettleseren. Mulige problemer er et uryddig skjermbilde, manglende editorfunksjoner og/eller at nettleseren crasher. Hvis du bruker Windows 95 eller Windows 98 er det også muligheter for at Windows will crashe.\n\nTrykk ", + "Cancel": "Avbryt", + "Insert/Modify Link": "Rediger lenke", + "New window (_blank)": "Eget vindu (_blank)", + "None (use implicit)": "Ingen (bruk standardinnstilling)", + "Other": "Annen", + "Same frame (_self)": "Samme ramme (_self)", + "Target:": "Mål:", + "Title (tooltip):": "Tittel (tooltip):", + "Top frame (_top)": "Toppramme (_top)", + "URL:": "Adresse:", + "You must enter the URL where this link points to": "Du må skrive inn en adresse som denne lenken skal peke til", + "Clear Inline Font Specifications": "Fjerne inline font spesifikasjoner", + "Would you like to clear font typefaces?": "Ønsker du å fjerne skrifttyper", + "Would you like to clear font sizes?": "Ønsker du å fjerne skrift størrelser", + "Would you like to clear font colours?": "Ønsker du å fjerne farger på skriften", + "Print document": "Skriv ut dokumentet", + "Split Block": "Seperasjonsblokk", + "Toggle Borders": "Skru av/på hjelpelinjer på tabeller", + "Select all": "Merk alt" + // Loading messages + "Loading in progress. Please wait !": "WYSIWYG laster, vennligst vent!", + "Constructing main object": "Vennligst vent", + "Create Toolbar": "Lag verktøylinje", + "Register panel right": "Registrer høyrepanel", + "Register panel left": "Registrer venstrepanel", + "Register panel top": "Registrer toppanel", + "Register panel bottom": "Registrer bunnpanel" + +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/pl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/pl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/pl.js 3 Jan 2016 20:47:02 -0000 1.1.2.1 @@ -0,0 +1,125 @@ +// I18N constants +// LANG: "pl", ENCODING: UTF-8 +// translated: Krzysztof Kotowicz, http://www.eskot.krakow.pl/portfolio/, koto@webworkers.pl +{ + "Bold": "Pogrubienie", + "Italic": "Pochylenie", + "Underline": "Podkreślenie", + "Strikethrough": "Przekreślenie", + "Subscript": "Indeks dolny", + "Superscript": "Indeks górny", + "Justify Left": "Wyrównaj do lewej", + "Justify Center": "Wyśrodkuj", + "Justify Right": "Wyrównaj do prawej", + "Justify Full": "Wyjustuj", + "Ordered List": "Numerowanie", + "Bulleted List": "Wypunktowanie", + "Decrease Indent": "Zmniejsz wcięcie", + "Increase Indent": "Zwiększ wcięcie", + "Font Color": "Kolor czcionki", + "Background Color": "Kolor tła", + "Horizontal Rule": "Linia pozioma", + "Insert Web Link": "Wstaw adres sieci Web", + "Insert/Modify Image": "Wstaw obraz", + "Insert Table": "Wstaw tabelę", + "Toggle HTML Source": "Edycja WYSIWYG/w źródle strony", + "Enlarge Editor": "Pełny ekran", + "About this editor": "Informacje o tym edytorze", + "Help using editor": "Pomoc", + "Current style": "Obecny styl", + "Undoes your last action": "Cofa ostatnio wykonane polecenie", + "Redoes your last action": "Ponawia ostatnio wykonane polecenie", + "Cut selection": "Wycina zaznaczenie do schowka", + "Copy selection": "Kopiuje zaznaczenie do schowka", + "Paste from clipboard": "Wkleja zawartość schowka", + "Direction left to right": "Kierunek tekstu lewo-prawo", + "Direction right to left": "Kierunek tekstu prawo-lewo", + "Remove formatting": "Usuń formatowanie", + "Select all": "Zaznacz wszystko", + "Print document": "Drukuj dokument", + "Clear MSOffice tags": "Wyczyść tagi MSOffice", + "Clear Inline Font Specifications": "Wycisz bezpośrednie przypisania czcionek", + "Split Block": "Podziel blok", + "Toggle Borders": "Włącz / wyłącz ramki", + + "— format —": "— Format —", + "Heading 1": "Nagłówek 1", + "Heading 2": "Nagłówek 2", + "Heading 3": "Nagłówek 3", + "Heading 4": "Nagłówek 4", + "Heading 5": "Nagłówek 5", + "Heading 6": "Nagłówek 6", + "Normal": "Normalny", + "Address": "Adres", + "Formatted": "Preformatowany", + + //dialogs + "OK": "OK", + "Cancel": "Anuluj", + "Path": "Ścieżka", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Jesteś w TRYBIE TEKSTOWYM. Użyj przycisku [<>], aby przełączyć się na tryb WYSIWYG.", + "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "Przycisk Wklej nie działa w przeglądarkach Mozilla z uwagi na ustawienia bezpieczeństwa. Naciśnij CRTL-V, aby wkleić zawartość schowka.", + + "Alignment:": "Wyrównanie:", + "Not set": "Nie ustawione", + "Left": "Do lewej", + "Right": "Do prawej", + "Texttop": "Góra tekstu", + "Absmiddle": "Abs. środek", + "Baseline": "Linia bazowa", + "Absbottom": "Abs. dół", + "Bottom": "Dół", + "Middle": "Środek", + "Top": "Góra", + + "Layout": "Layout", + "Spacing": "Spacjowanie", + "Horizontal:": "Poziome:", + "Horizontal padding": "Wcięcie poziome", + "Vertical:": "Pionowe:", + "Vertical padding": "Wcięcie pionowe", + "Border thickness:": "Grubość obramowania:", + "Leave empty for no border": "Bez ramek - zostaw puste", + + //Insert Link + "Insert/Modify Link": "Wstaw/edytuj odnośnik", + "None (use implicit)": "Brak", + "New window (_blank)": "Nowe okno (_blank)", + "Same frame (_self)": "Ta sama ramka (_self)", + "Top frame (_top)": "Główna ramka (_top)", + "Other": "Inne", + "Target:": "Okno docelowe:", + "Title (tooltip):": "Tytuł (tooltip):", + "URL:": "URL:", + "You must enter the URL where this link points to": "Musisz podać URL, na jaki będzie wskazywał odnośnik", + + // Insert Table + "Insert Table": "Wstaw tabelę", + "Rows:": "Wierszy:", + "Number of rows": "Liczba wierszy", + "Cols:": "Kolumn:", + "Number of columns": "Liczba kolumn", + "Width:": "Szerokość:", + "Width of the table": "Szerokość tabeli", + "Percent": "Procent", + "Pixels": "Pikseli", + "Em": "Em", + "Width unit": "Jednostka", + "Fixed width columns": "Kolumny o stałej szerokości", + "Positioning of this table": "Pozycjonowanie tabeli", + "Cell spacing:": "Odstęp komórek:", + "Space between adjacent cells": "Przestrzeń pomiędzy komórkami", + "Cell padding:": "Wcięcie komórek:", + "Space between content and border in cell": "Przestrzeń między krawędzią a zawartością komórki", + + // Insert Image + "Insert Image": "Wstaw obrazek", + "Image URL:": "URL obrazka:", + "Enter the image URL here": "Podaj URL obrazka", + "Preview": "Podgląd", + "Preview the image in a new window": "Podgląd obrazka w nowym oknie", + "Alternate text:": "Tekst alternatywny:", + "For browsers that don't support images": "Dla przeglądarek, które nie obsługują obrazków", + "Positioning of this image": "Pozycjonowanie obrazka", + "Image Preview:": "Podgląd obrazka:" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/pt_br.js 3 Jan 2016 20:47:02 -0000 1.1.2.1 @@ -0,0 +1,184 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Initial basic work by Alex Piaz +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt) +{ + "About": "Sobre", + "About Xinha": "Sobre o Xinha", + "Absbottom": "Inferior absoluto", + "Absmiddle": "Meio absoluto", + "Alignment:": "Alinhamento", + "Alternate text:": "Texto alternativo", + "Baseline": "Linha base", + "Bold": "Negrito", + "Border thickness:": "Espessura da borda", + "Bottom": "Botão", + "CTRL-0 (zero)": "CTRL-0 (zero)", + "CTRL-1 .. CTRL-6": "CTRL-1 .. CTRL-6", + "CTRL-A": "CTRL-A", + "CTRL-B": "CTRL-B", + "CTRL-C": "CTRL-C", + "CTRL-E": "CTRL-E", + "CTRL-I": "CTRL-I", + "CTRL-J": "CTRL-J", + "CTRL-L": "CTRL-L", + "CTRL-N": "CTRL-N", + "CTRL-R": "CTRL-R", + "CTRL-S": "CTRL-S", + "CTRL-U": "CTRL-U", + "CTRL-V": "CTRL-V", + "CTRL-X": "CTRL-X", + "CTRL-Y": "CTRL-Y", + "CTRL-Z": "CTRL-Z", + "Cancel": "Cancelar", + "Cell padding:": "Espaçamento interno da célula:", + "Cell spacing:": "Espaçamento da célula:", + "Clean content pasted from Word": "Limpar conteúdo copiado do Word", + "Close": "Fechar", + "Collapse borders:": "Bordas fechadas:", + "Cols:": "Colunas:", + "Constructing object": "Construindo objeto", + "Copy selection": "Copiar seleção", + "Create Statusbar": "Criar barra de informação (statusbar)", + "Create Toolbar": "Criar Barra de Ferramentas", + "Current style": "Estilo Atual", + "Cut selection": "Recortar seleção", + "Developer": "Desenvolvedor", + "ENTER": "ENTRAR", + "Editor Help": "Ajuda do Editor", + "Em": "Em", + "Enter the image URL here": "Entre aqui com a URL da imagem", + "Finishing": "Terminando", + "Fixed width columns": "Colunas com largura fixa", + "For browsers that don't support images": "Para navegadores que não suportam imagens", + "Generate Xinha framework": "Gerar Área de Trabalho do Xinha", + "Headings": "Títulos", + "Horizontal padding": "Espaçamento interno horizontal", + "Horizontal:": "Horizontal:", + "Image Preview:": "Visualização da Imagem:", + "Image URL:": "URL da imagem:", + "Init editor size": "Iniciar tamanho do editor", + "Insert Image": "Inserir Imagem", + "Insert Table": "Inserir Tabela", + "Insert/Modify Link": "Inserir/Modificar Link", + "Italic": "Itálico", + "Justify Center": "Justificar Centralizado", + "Justify Full": "Justificar Completamente", + "Justify Left": "Justificar à Esquerda", + "Justify Right": "Justificar à Direita", + "Keyboard shortcuts": "Atalhos de Teclado", + "Layout": "Esquema", + "Leave empty for no border": "Deixe em branco para não ter bordas", + "Left": "Esquerda", + "License": "Licença", + "Loading in progress. Please wait!": "Carregamento em processo. Por favor, aguarde!", + "Middle": "Meio", + "Name": "Nome", + "New window (_blank)": "Nova janela (_blank)", + "None (use implicit)": "Nenhum (uso implicito)", + "Not set": "Não definido", + "Number of columns": "Número de colunas", + "Number of rows": "Número de linhas", + "OK": "OK", + "Paste from clipboard": "Colar da Área de Transferência", + "Path": "Caminho", + "Percent": "Porcentagem", + "Pixels": "Pixels", + "Plugins": "Plugins", + "Positioning of this image": "Posicionamento desta imagem", + "Positioning of this table": "Posicionamento desta tabela", + "Preview": "Visualização", + "Preview the image in a new window": "Visualizar a imagem em uma nova janela", + "Redoes your last action": "Refazer sua última ação", + "Right": "Direita", + "Rows:": "Linhas:", + "SHIFT-ENTER": "SHIFT-ENTER", + "Same frame (_self)": "Mesmo frame (_self)", + "Select Color": "Selecionar côr", + "Select all": "Selecionar tudo", + "Set format to paragraph": "Definir formato para o parágrafo", + "Space between adjacent cells": "Espaço entre células adjacentes", + "Space between content and border in cell": "Espaço entre conteúdo e borda na célula", + "Spacing": "Espaçamento", + "Sponsored by": "Patrocinado por", + "Strikethrough": "Tachado", + "Target:": "Destino:", + "Texttop": "Texto no topo", + "Thanks": "Agradecimentos", + "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "O botão Colar não funciona em navegadores baseado no Mozilla (por razões técnicas de segurança). Pressione CTRL-V no seu teclado para colar diretamente.", + "The editor provides the following key combinations:": "Este editor fornece a seguinte combinação de teclas:", + "Title (tooltip):": "Título (tooltip)", + "Top": "Topo", + "Top frame (_top)": "Frame no topo (_top)", + "URL:": "URL:", + "Underline": "Sublinhado", + "Undoes your last action": "Desfazer sua última ação", + "Version": "Versão", + "Vertical padding": "Espaçamento interno vertical", + "Vertical:": "Vertical:", + "Width of the table": "Larguran da tabela", + "Width unit": "Unidade de largura", + "Width:": "Largura:", + "Would you like to clear font colours?": "Deseja limpar as cores de fonte", + "Would you like to clear font sizes?": "Deseja limpar os tamanhos de fonte", + "Would you like to clear font typefaces?": "Deseja limpar os tipos de fonte", + "Xinha Help": "Ajuda do Xinha", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Você está no MODO TEXTO. Use o botão [<>] para mudar para o modo de Visualização (WYSIWYG)", + "Your Document is not well formed. Check JavaScript console for details.": "Seu Documento não está formatado corretamente. Verifique o console do JavaScript para maiores detalhes.", + "insert linebreak": "inserir quebra de linha", + "new paragraph": "novo parágrafo", + + // not find with lc_parse_strings.php + "Subscript": "Subescrito", + "Superscript": "Sobrescrito", + "Direction left to right": "Da esquerda para direita", + "Direction right to left": "Da direita para esquerda", + "Remove formatting": "Remover formatação", + "Select all": "Selecionar tudo", + "Print document": "Imprimir documento", + "Clear MSOffice tags": "Limpar tags do MS Office", + "Clear Inline Font Specifications": "Limpar especificações de fontes inline", + "Split Block": "Dividir Bloco", + "Toggle Borders": "Mudar Bordas", + "Save as": "Salvar como", + "Insert/Overwrite": "Inserir/Sobrescrever", + "— format —": "— formato —", + "Heading 1": "Título 1", + "Heading 2": "Título 2", + "Heading 3": "Título 3", + "Heading 4": "Título 4", + "Heading 5": "Título 5", + "Heading 6": "Título 6", + "Normal": "Normal", + "Address": "Endereço", + "Formatted": "Formatado", + "— font —": "— fonte —", + "— size —": "— tamanho —", + "Ordered List": "Lista Numerada", + "Bulleted List": "Lista Marcadores", + "Decrease Indent": "Diminuir Indentação", + "Increase Indent": "Aumentar Indentação", + "Font Color": "Cor da Fonte", + "Background Color": "Cor do Fundo", + "Horizontal Rule": "Linha Horizontal", + "Insert Web Link": "Inserir Link", + "Insert/Modify Image": "Inserir/Modificar Imagem", + "Insert Table": "Inserir Tabela", + "Toggle HTML Source": "Ver Código-Fonte", + "Enlarge Editor": "Expandir Editor", + "About this editor": "Sobre este editor", + "Help using editor": "Ajuda - Usando o editor" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ro.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ro.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ro.js 3 Jan 2016 20:47:03 -0000 1.1.2.1 @@ -0,0 +1,63 @@ +// I18N constants + +// LANG: "ro", ENCODING: UTF-8 +// Author: Mihai Bazon, http://dynarch.com/mishoo + +// FOR TRANSLATORS: +// +// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE +// (at least a valid email address) +// +// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; +// (if this is not possible, please include a comment +// that states what encoding is necessary.) + +{ + "Bold": "Îngroşat", + "Italic": "Italic", + "Underline": "Subliniat", + "Strikethrough": "Tăiat", + "Subscript": "Indice jos", + "Superscript": "Indice sus", + "Justify Left": "Aliniere la stânga", + "Justify Center": "Aliniere pe centru", + "Justify Right": "Aliniere la dreapta", + "Justify Full": "Aliniere în ambele părţi", + "Ordered List": "Listă ordonată", + "Bulleted List": "Listă marcată", + "Decrease Indent": "Micşorează alineatul", + "Increase Indent": "Măreşte alineatul", + "Font Color": "Culoarea textului", + "Background Color": "Culoare de fundal", + "Horizontal Rule": "Linie orizontală", + "Insert Web Link": "Inserează/modifică link", + "Insert/Modify Image": "Inserează/modifică imagine", + "Insert Table": "Inserează un tabel", + "Toggle HTML Source": "Sursa HTML / WYSIWYG", + "Enlarge Editor": "Maximizează editorul", + "About this editor": "Despre editor", + "Help using editor": "Documentaţie (devel)", + "Current style": "Stilul curent", + "Undoes your last action": "Anulează ultima acţiune", + "Redoes your last action": "Reface ultima acţiune anulată", + "Cut selection": "Taie în clipboard", + "Copy selection": "Copie în clipboard", + "Paste from clipboard": "Aduce din clipboard", + "Direction left to right": "Direcţia de scriere: stânga - dreapta", + "Direction right to left": "Direcţia de scriere: dreapta - stânga", + "OK": "OK", + "Cancel": "Anulează", + "Path": "Calea", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Eşti în modul TEXT. Apasă butonul [<>] pentru a te întoarce în modul WYSIWYG.", + "Cancel": "Renunţă", + "Insert/Modify Link": "Inserează/modifcă link", + "New window (_blank)": "Fereastră nouă (_blank)", + "None (use implicit)": "Nimic (foloseşte ce-i implicit)", + "Other": "Alt target", + "Same frame (_self)": "Aceeaşi fereastră (_self)", + "Target:": "Ţinta:", + "Title (tooltip):": "Titlul (tooltip):", + "Top frame (_top)": "Fereastra principală (_top)", + "URL:": "URL:", + "You must enter the URL where this link points to": "Trebuie să introduceţi un URL" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ru.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ru.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/ru.js 3 Jan 2016 20:47:03 -0000 1.1.2.1 @@ -0,0 +1,185 @@ +// I18N constants + +// LANG: "ru", ENCODING: UTF-8 +// Author: Yulya Shtyryakova, + +// Some additions by: Alexey Kirpichnikov, +// I took French version as a source of English phrases because French version was the most comprehensive +// (fr.js was the largest file, actually) %) + +// FOR TRANSLATORS: +// +// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE +// (at least a valid email address) +// +// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; +// (if this is not possible, please include a comment +// that states what encoding is necessary.) + +{ + "Bold": "Полужирный", + "Italic": "Наклонный", + "Underline": "Подчеркнутый", + "Strikethrough": "Перечеркнутый", + "Subscript": "Нижний индекс", + "Superscript": "Верхний индекс", + "Justify Left": "По левому краю", + "Justify Center": "По центру", + "Justify Right": "По правому краю", + "Justify Full": "По ширине", + "Ordered List": "Нумерованный список", + "Bulleted List": "Маркированный список", + "Decrease Indent": "Уменьшить отступ", + "Increase Indent": "Увеличить отступ", + "Font Color": "Цвет шрифта", + "Background Color": "Цвет фона", + "Horizontal Rule": "Горизонтальный разделитель", + "Insert Web Link": "Вставить гиперссылку", + "Insert/Modify Image": "Вставить изображение", + "Insert Table": "Вставить таблицу", + "Toggle HTML Source": "Показать Html-код", + "Enlarge Editor": "Увеличить редактор", + "About this editor": "О редакторе", + "Help using editor": "Помощь", + "Current style": "Текущий стиль", + "Undoes your last action": "Отменить", + "Redoes your last action": "Повторить", + "Cut selection": "Вырезать", + "Copy selection": "Копировать", + "Paste from clipboard": "Вставить", + "Direction left to right": "Направление слева направо", + "Direction right to left": "Направление справа налево", + "Remove formatting": "Убрать форматирование", + "Select all": "Выделить все", + "Print document": "Печать", + "Clear MSOffice tags": "Удалить разметку MSOffice", + "Clear Inline Font Specifications": "Удалить непосредственное задание шрифтов", + "Would you like to clear font typefaces?": "Удалить типы шрифтов?", + "Would you like to clear font sizes?": "Удалить размеры шрифтов ?", + "Would you like to clear font colours?": "Удалить цвета шрифтов ?", + "Split Block": "Разделить блок", + "Toggle Borders": "Включить/выключить отображение границ", + "Save as": "Сохранить как", + "Insert/Overwrite": "Вставка/замена", + "— format —": "— форматирование —", + "Heading 1": "Заголовок 1", + "Heading 2": "Заголовок 2", + "Heading 3": "Заголовок 3", + "Heading 4": "Заголовок 4", + "Heading 5": "Заголовок 5", + "Heading 6": "Заголовок 6", + "Normal": "Обычный текст", + "Address": "Адрес", + "Formatted": "Отформатированный текст", + + "— font —": "— шрифт —", + "— size —": "— размер —", + + +// Диалоги + + "OK": "OK", + "Cancel": "Отмена", + "Path": "Путь", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Вы в режиме отображения Html-кода. нажмите кнопку [<>], чтобы переключиться в визуальный режим.", + +"The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "Кнопка Вставить не работает в браузерах на основе Mozilla (по техническим причинам, связанным с безопасностью). Нажмите Ctrl-V на клавиатуре, чтобы вставить.", + + "Your Document is not well formed. Check JavaScript console for details.": "Ваш документ неправильно сформирован. Посмотрите Консоль JavaScript, чтобы узнать подробности.", + + "Alignment:": "Выравнивание", + "Not set": "Не установлено", + "Left": "По левому краю", + "Right": "По правому краю", + "Texttop": "По верхней границе текста", + "Absmiddle": "По середине текста", + "Baseline": "По нижней границе текста", + "Absbottom": "По нижней границе", + "Bottom": "По нижнему краю", + "Middle": "Посредине", + "Top": "По верхнему краю", + + "Layout": "Расположение", + "Spacing": "Поля", + "Horizontal:": "По горизонтали", + "Horizontal padding": "Горизонтальные поля", + "Vertical:": "По вертикали", + "Vertical padding": "Вертикальные поля", + "Border thickness:": "Толщина рамки", + "Leave empty for no border": "Оставьте пустым, чтобы убрать рамку", + + //Insert Link + "Insert/Modify Link": "Вставка/изменение ссылки", + "None (use implicit)": "По умолчанию", + "New window (_blank)": "Новое окно (_blank)", + "Same frame (_self)": "То же окно (_self)", + "Top frame (_top)": "Родительское окно (_top)", + "Other": "Другое", + "Target:": "Открывать в окне:", + "Title (tooltip):": "Всплывающая подсказка", + "URL:": "URL:", + "You must enter the URL where this link points to": "Вы должны указать URL, на который будет указывать ссылка", + "You need to select some text before creating a link": "Вы должны выделить текст, который будет преобразован в ссылку", + + // Insert Table + "Insert Table": "Вставка таблицы", + "Rows:": "Строки", + "Number of rows": "Количество строк", + "Cols:": "Столбцы", + "Number of columns": "Количество столбцов", + "Width:": "Ширина", + "Width of the table": "Ширина таблицы", + "Percent": "проценты", + "Pixels": "пикселы", + "Em": "em", + "Width unit": "Единицы измерения", + "Fixed width columns": "Столбцы фиксированной ширины", + "Positioning of this table": "Расположение таблицы", + "Cell spacing:": "Расстояние между ячейками", + "Space between adjacent cells": "Расстояние между соседними ячейками", + "Cell padding:": "Поля в ячейках", + "Space between content and border in cell": "Расстояние между границей ячейки и текстом", + "You must enter a number of rows": "Вы должны ввести количество строк", + "You must enter a number of columns": "Вы должны ввести количество столбцов", + + // Insert Image + "Insert Image": "Вставка изображения", + "Image URL:": "URL изображения", + "Enter the image URL here": "Вставьте адрес изображения", + "Preview": "Предварительный просмотр", + "Preview the image in a new window": "Предварительный просмотр в отдельном окне", + "Alternate text:": "Альтернативный текст", + "For browsers that don't support images": "Для браузеров, которые не отображают картинки", + "Positioning of this image": "Расположение изображения", + "Image Preview:": "Предварительный просмотр", + "You must enter the URL": "Вы должны ввести URL", + + // Editor Help + "Xinha Help": "Помощь", + "Editor Help": "Помощь", + "Keyboard shortcuts": "Горячие клавиши", + "The editor provides the following key combinations:": "Редактор поддерживает следующие комбинации клавиш:", + "ENTER": "ENTER", + "new paragraph": "новый абзац", + "SHIFT-ENTER": "SHIFT+ENTER", + "insert linebreak": "перенос строки", + "Set format to paragraph": "Отформатировать абзац", + "Clean content pasted from Word": "Очистить текст, вставленный из Word", + "Headings": "Заголовки", + "Close": "Закрыть", + + // Loading messages + "Loading in progress. Please wait !": "Загрузка... Пожалуйста, подождите.", + "Constructing main object": "Создание главного объекта", + "Constructing object": "Создание объекта", + "Register panel right": "Регистрация правой панели", + "Register panel left": "Регистрация левой панели", + "Register panel top": "Регистрация верхней панели", + "Register panel bottom": "Регистрация нижней панели", + "Create Toolbar": "Создание панели инструментов", + "Create StatusBar": "Создание панели состояния", + "Generate Xinha object": "Создание объекта Xinha", + "Init editor size": "Инициализация размера редактора", + "Init IFrame": "инициализация iframe", + "Register plugin $plugin": "Регистрация $plugin" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/se.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/se.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/se.js 3 Jan 2016 20:47:03 -0000 1.1.2.1 @@ -0,0 +1,32 @@ +// LANG: "se", ENCODING: UTF-8 + +// Swedish version for htmlArea v3.0 - Alpha Release +// - translated by pat + +{ + "Bold": "Fet", + "Italic": "Kursiv", + "Underline": "Understruken", + "Strikethrough": "Genomstruken", + "Subscript": "Nedsänkt", + "Superscript": "Upphöjd", + "Justify Left": "Vänsterjustera", + "Justify Center": "Centrera", + "Justify Right": "Högerjustera", + "Justify Full": "Marginaljustera", + "Ordered List": "Numrerad lista", + "Bulleted List": "Punktlista", + "Decrease Indent": "Minska indrag", + "Increase Indent": "Öka indrag", + "Font Color": "Textfärg", + "Background Color": "Bakgrundsfärg", + "Horizontal Rule": "Vågrät linje", + "Insert Web Link": "Infoga länk", + "Insert/Modify Image": "Infoga bild", + "Insert Table": "Infoga tabell", + "Toggle HTML Source": "Visa källkod", + "Enlarge Editor": "Visa i eget fönster", + "About this editor": "Om denna editor", + "Help using editor": "Hjälp", + "Current style": "Nuvarande stil" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/sh.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/sh.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/sh.js 3 Jan 2016 20:47:03 -0000 1.1.2.1 @@ -0,0 +1,140 @@ +// I18N constants + +// LANG: "sh", ENCODING: UTF-8 | ISO-8859-2 +// Author: Ljuba Ranković, http://www.rankovic.net/ljubar + +// FOR TRANSLATORS: +// +// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE +// (at least a valid email address) +// +// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; +// (if this is not possible, please include a comment +// that states what encoding is necessary.) + +{ + "Bold": "Masno", + "Italic": "Kurziv", + "Underline": "Podvučeno", + "Strikethrough": "Precrtano", + "Subscript": "Indeks-tekst", + "Superscript": "Eksponent-tekst", + "Justify Left":"Ravnanje ulevo", + "Justify Center": "Ravnanje po simetrali", + "Justify Right": "Ravnanje udesno", + "Justify Full": "Puno ravnanje", + "Ordered List": "Lista sa rednim brojevima", + "Bulleted List": "Lista sa simbolima", + "Decrease Indent": "smanji uvlačenje", + "Increase Indent": "Povećaj uvlačenje", + "Font Color": "Boja slova", + "Background Color": "Boja pozadine", + "Horizontal Rule": "Horizontalna linija", + "Insert Web Link": "Dodaj web link", + "Insert/Modify Image": "Dodaj/promeni sliku", + "Insert Table": "Ubaci tabelu", + "Toggle HTML Source": "Prebaci na HTML kod", + "Enlarge Editor": "Povećaj editor", + "About this editor": "O ovom editoru", + "Help using editor": "Pomoć pri korišćenju editora", + "Current style": "Važeći stil", + "Undoes your last action": "Poništava poslednju radnju", + "Redoes your last action": "Vraća poslednju radnju", + "Cut selection": "Iseci izabrano", + "Copy selection": "Kopiraj izabrano", + "Paste from clipboard": "Zalepi iz klipborda", + "Direction left to right": "Pravac s leva na desno", + "Direction right to left": "Pravac s desna na levo", + "Remove formatting": "Ukoni formatiranje", + "Select all": "Izaberi sve", + "Print document": "Štampaj dokument", + "Clear MSOffice tags": "Obriši MSOffice tagove", + "Clear Inline Font Specifications": "Obriši dodeljene osobine fonta", + "Split Block": "Podeli blok", + "Toggle Borders": "Izmeni okvire", + + "— format —": "— Format —", + "Heading 1": "Zaglavlje 1", + "Heading 2": "Zaglavlje 2", + "Heading 3": "Zaglavlje 3", + "Heading 4": "Zaglavlje 4", + "Heading 5": "Zaglavlje 5", + "Heading 6": "Zaglavlje 6", + "Normal": "Običan", + "Address": "Adresa", + "Formatted": "Formatiran", + + // dialogs + "OK": "OK", + "Cancel": "Poništi", + "Path": "Putanja", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Nalazite se u TEXT režimu. Koristite [<>] dugme za povratak na WYSIWYG.", + + "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "", + + "Alignment:": "Ravnanje", + "Not set": "Nije postavljeno", + "Left": "Levo", + "Right": "Desno", + "Texttop": "Vrh teksta", + "Absmiddle": "Apsolutna sredina", + "Baseline": "Donja linija", + "Absbottom": "Apsolutno dno", + "Bottom": "Dno", + "Middle": "Sredina", + "Top": "Vrh", + + "Layout": "Prelom", + "Spacing": "Razmak", + "Horizontal:": "Po horizontali", + "Horizontal padding": "Horizontalno odstojanje", + "Vertical:": "Po vertikali", + "Vertical padding": "Vertikalno odstojanje", + "Border thickness:": "Debljina okvira", + "Leave empty for no border": "Ostavi prazno kad nema okvira", + + // Insert Link + "Insert/Modify Link": "Dodaj/promeni Link", + "None (use implicit)": "koristi podrazumevano", + "New window (_blank)": "Novom prozoru (_blank)", + "Same frame (_self)": "Isti frejm (_self)", + "Top frame (_top)": "Glavni frejm (_top)", + "Other": "Drugo", + "Target:": "Otvori u:", + "Title (tooltip):": "Naziv (tooltip):", + "URL:": "URL:", + "You must enter the URL where this link points to": "Morate uneti URL na koji vodi ovaj link", + + // Insert Table + "Insert Table": "Ubaci tabelu", + "Rows:": "Redovi", + "Number of rows": "Broj redova", + "Cols:": "Kolone", + "Number of columns": "Broj kolona", + "Width:": "Širina", + "Width of the table": "Širina tabele", + "Percent": "Procenat", + "Pixels": "Pikseli", + "Em": "Em", + "Width unit": "Jedinica širine", + "Fixed width columns": "Fiksirana širina kolona", + "Positioning of this table": "Postavljanje ove tabele", + "Cell spacing:": "Rastojanje ćelija", + "Space between adjacent cells": "Rastojanje naspramnih ćelija", + "Cell padding:": "Unutrašnja odstojanja u ćeliji", + "Space between content and border in cell": "Rastojanje između sadržaja i okvira ćelije", + + // Insert Image + "Insert Image": "Ubaci sliku", + "Image URL:": "URL slike", + "Enter the image URL here": "Unesite URL slike ovde", + "Preview": "Pregled", + "Preview the image in a new window": "Pregledaj sliku u novom prozoru", + "Alternate text:": "Alternativni tekst", + "For browsers that don't support images": "Za pretraživače koji ne podržavaju slike", + "Positioning of this image": "Postavljanje ove slike", + "Image Preview:": "Pregled slike", + + // Select Color popup + "Select Color": "Izaberite boju" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/si.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/si.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/si.js 3 Jan 2016 20:47:03 -0000 1.1.2.1 @@ -0,0 +1,50 @@ +// I18N constants + +// LANG: "si", ENCODING: UTF-8 +// Author: Tomaz Kregar, x_tomo_x@email.si + +// FOR TRANSLATORS: +// +// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE +// (at least a valid email address) +// +// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; +// (if this is not possible, please include a comment +// that states what encoding is necessary.) + +{ + "Bold": "Krepko", + "Italic": "Ležeče", + "Underline": "Podčrtano", + "Strikethrough": "Prečrtano", + "Subscript": "Podpisano", + "Superscript": "Nadpisano", + "Justify Left": "Poravnaj levo", + "Justify Center": "Na sredino", + "Justify Right": "Poravnaj desno", + "Justify Full": "Porazdeli vsebino", + "Ordered List": "Oštevilčevanje", + "Bulleted List": "Označevanje", + "Decrease Indent": "Zmanjšaj zamik", + "Increase Indent": "Povečaj zamik", + "Font Color": "Barva pisave", + "Background Color": "Barva ozadja", + "Horizontal Rule": "Vodoravna črta", + "Insert Web Link": "Vstavi hiperpovezavo", + "Insert/Modify Image": "Vstavi sliko", + "Insert Table": "Vstavi tabelo", + "Toggle HTML Source": "Preklopi na HTML kodo", + "Enlarge Editor": "Povečaj urejevalnik", + "About this editor": "Vizitka za urejevalnik", + "Help using editor": "Pomoč za urejevalnik", + "Current style": "Trenutni slog", + "Undoes your last action": "Razveljavi zadnjo akcijo", + "Redoes your last action": "Uveljavi zadnjo akcijo", + "Cut selection": "Izreži", + "Copy selection": "Kopiraj", + "Paste from clipboard": "Prilepi", + "OK": "V redu", + "Cancel": "Prekliči", + "Path": "Pot", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Si v tekstovnem načinu. Uporabi [<>] gumb za prklop nazaj na WYSIWYG." +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/sr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/sr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/sr.js 3 Jan 2016 20:47:04 -0000 1.1.2.1 @@ -0,0 +1,140 @@ +// I18N constants + +// LANG: "sh", ENCODING: UTF-8 | ISO-8859-5 +// Author: Ljuba Ranković, http://www.rankovic.net/ljubar + +// FOR TRANSLATORS: +// +// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE +// (at least a valid email address) +// +// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; +// (if this is not possible, please include a comment +// that states what encoding is necessary.) + +{ + "Bold": "Масно", + "Italic": "Курзив", + "Underline": "Подвучено", + "Strikethrough": "Прецртано", + "Subscript": "Индекс-текст", + "Superscript": "Експонент-текст", + "Justify Left": "Равнање улево", + "Justify Center": "Равнање по симетрали", + "Justify Right": "Равнање удесно", + "Justify Full": "Пуно равнање", + "Ordered List": "Листа са редним бројевима", + "Bulleted List": "Листа са симболима", + "Decrease Indent": "Смањи увлачење", + "Increase Indent": "Повећај увлачење", + "Font Color": "Боја слова", + "Background Color": "Боја позадине", + "Horizontal Rule": "Хоризонтална линија", + "Insert Web Link": "додај веб линк", + "Insert/Modify Image": "додај/промени слику", + "Insert Table": "Убаци табелу", + "Toggle HTML Source": "Пребаци на приказ ХТМЛ кода", + "Enlarge Editor": "Повећај едитор", + "About this editor": "О овом едитору", + "Help using editor": "Помоћ при коришћењу едитора", + "Current style": "Важећи стил", + "Undoes your last action": "Поништава последњу радњу", + "Redoes your last action": "Враћа последњу радњу", + "Cut selection": "Исеци изабрано", + "Copy selection": "Копирај изабрано", + "Paste from clipboard": "Залепи из клипборда", + "Direction left to right": "Правац с лева на десно", + "Direction right to left": "Правац с десна на лево", + "Remove formatting": "Уклони форматирање", + "Select all": "Изабери све", + "Print document": "Штампај документ", + "Clear MSOffice tags": "Обриши MSOffice тагове", + "Clear Inline Font Specifications": "Обриши примењене особине фонта", + "Split Block": "Подели блок", + "Toggle Borders": "Пребаци оквирне линије", + + "— format —": "— Format —", + "Heading 1": "Заглавље 1", + "Heading 2": "Заглавље 2", + "Heading 3": "Заглавље 3", + "Heading 4": "Заглавље 4", + "Heading 5": "Заглавље 5", + "Heading 6": "Заглавље 6", + "Normal": "обичан", + "Address": "адреса", + "Formatted": "форматиран", + + // dialogs + "OK": "OK", + "Cancel": "Поништи", + "Path": "Путања", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Налазите се у ТЕКСТ режиму. Користите [<>] дугме за повратак на ШВТИД (WYSIWYG).", + + "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "Дугме 'залепи' не ради у претраживачима породице Mozilla (из разлога сигурности). Притисните CTRL-V на тастатури да директно залепите.", + + "Alignment:": "Равнање", + "Not set": "Није постављено", + "Left": "Лево", + "Right": "Десно", + "Texttop": "Врх текста", + "Absmiddle": "Апсолутна средина", + "Baseline": "Доња линија", + "Absbottom": "Апсолутно дно", + "Bottom": "Дно", + "Middle": "Средина", + "Top": "Врх", + + "Layout": "Прелом", + "Spacing": "Размак", + "Horizontal:": "По хоризонтали", + "Horizontal padding": "Хортизонтално одстојање", + "Vertical:": "По вертикали", + "Vertical padding": "Вертикално одстојање", + "Border thickness:": "Дебљина оквира", + "Leave empty for no border": "Остави празно кад нема оквира", + + // Insert Link + "Insert/Modify Link": "додај/промени линк", + "None (use implicit)": "користи подразумевано", + "New window (_blank)": "Новом прозору (_blank)", + "Same frame (_self)": "Исти фрејм (_self)", + "Top frame (_top)": "Главни фрејм (_top)", + "Other": "Друго", + "Target:": "Отвори у:", + "Title (tooltip):": "Назив (tooltip):", + "URL:": "УРЛ:", + "You must enter the URL where this link points to": "Морате унети УРЛ на који води овај линк", + + // Insert Table + "Insert Table": "Убаци табелу", + "Rows:": "Редови", + "Number of rows": "Број редова", + "Cols:": "Колоне", + "Number of columns": "Број колона", + "Width:": "Ширина", + "Width of the table": "Ширина табеле", + "Percent": "Процената", + "Pixels": "Пиксела", + "Em": "Ем", + "Width unit": "Јединица ширине", + "Fixed width columns": "Фиксирана ширина колоне", + "Positioning of this table": "Постављање ове табеле", + "Cell spacing:": "Размак између ћелија", + "Space between adjacent cells": "Размак између наспрамних ћелија", + "Cell padding:": "Унутрашња одстојања од ивица ћелије", + "Space between content and border in cell": "Растојање између садржаја у ћелији и њеног оквира", + + // Insert Image + "Insert Image": "Убаци слику", + "Image URL:": "УРЛ слике", + "Enter the image URL here": "Унесите УРЛ слике овде", + "Preview": "Преглед", + "Preview the image in a new window": "Прегледај слику у новом прозору", + "Alternate text:": "алтернативни текст", + "For browsers that don't support images": "За претраживаче који не подржавају слике", + "Positioning of this image": "Постављање ове слике", + "Image Preview:": "Преглед слике", + + // Select Color popup + "Select Color": "Изабери боју" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/sv.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/sv.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/sv.js 3 Jan 2016 20:47:04 -0000 1.1.2.1 @@ -0,0 +1,116 @@ +// I18N constants +// LANG: "sv", ENCODING: UTF-8 + +// Swedish version for htmlArea v3.0 +// Initital translation by pat +// Synced with additional contants in rev. 477 (Mar 2006) by Thomas Loo + +{ + "Bold": "Fet", + "Italic": "Kursiv", + "Underline": "Understruken", + "Strikethrough": "Genomstruken", + "Subscript": "Nedsänkt", + "Superscript": "Upphöjd", + "Justify Left": "Vänsterjustera", + "Justify Center": "Centrera", + "Justify Right": "Högerjustera", + "Justify Full": "Marginaljustera", + "Ordered List": "Numrerad lista", + "Bulleted List": "Punktlista", + "Decrease Indent": "Minska indrag", + "Increase Indent": "Öka indrag", + "Font Color": "Textfärg", + "Background Color": "Bakgrundsfärg", + "Horizontal Rule": "Vågrät linje", + "Insert Web Link": "Infoga länk", + "Insert/Modify Image": "Infoga bild", + "Toggle HTML Source": "Visa källkod", + "Enlarge Editor": "Visa i eget fönster", + "About this editor": "Om denna editor", + "Help using editor": "Hjälp", + "Current style": "Nuvarande stil", + + "Undoes your last action": "Ångra kommando", + "Redoes your last action": "Upprepa kommando", + "Select all": "Markera allt", + "Print document": "Skriv ut", + "Clear MSOffice tags": "Städa bort MS Office taggar", + "Clear Inline Font Specifications": "Rensa inbäddad typsnittsinformation", + "Remove formatting": "Rensa formattering", + "Toggle Borders": "Objektramar", + "Split Block": "Dela block", + "Direction left to right": "Vänster till höger", + "Direction right to left": "Höger till vänster", + + "Insert/Overwrite": "Infoga/Skriv över", + "OK": "OK", + "Cancel": "Avbryt", + "Path": "Objekt", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Du befinner dig i texläge. Klicka på ikonen [<>] ovan för att växla tillbaka till WYSIWIG läge", + "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "Visning i fullskärmsläga fungerar dåligt i din webläsare. Möjliga problem resulterar i en ryckig editor, saknade editorfunktioner och/eller att webläsaren kraschar. Om du använder Windows 95/98 finns också möjligheten att Windows kraschar.\n\nTryck ", + "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "Denna knapp fungerar ej i Mozillabaserad webläsare, använd istället snabbtangenterna CTRL-V på tangentbordet för att klistra in.", + + "Insert/Modify Link": "Redigera länk", + "New window (_blank)": "Nytt fönster (_blank)", + "None (use implicit)": "Ingen (använd standardinställing)", + "Other": "Annan", + "Same frame (_self)": "Samma ram (_self)", + "Target:": "Mål:", + "Title (tooltip):": "Titel (tooltip):", + "Top frame (_top)": "Toppram (_top)", + "URL:": "Sökväg:", + "You must enter the URL where this link points to": "Du måsta ange en adress till vilken länken skall peka på", + "Would you like to clear font typefaces?": "Radera alla typsnittsinformation ?", + "Would you like to clear font sizes?": "Radera alla fontstorlekar ?", + "Would you like to clear font colours?": "Ta bort all textfärger ?", + + "You need to select some text before creating a link": "Du måsta markera ett objekt att applicera länken på!", + + // Insert Table + "Insert Table": "Infoga tabell", + "Rows:": "Rader:", + "Number of rows": "Antal rader", + "Cols:": "Kolumner:", + "Number of columns": "Antal kolumner", + "Width:": "Bredd:", + "Width of the table": "Tabellbredd", + "Percent": "Procent", + "Pixels": "Pixlar", + "Em": "", + "Width unit": "Breddenheter", + "Fixed width columns": "Fixerad bredd", + "Alignment:": "Marginaljustering", + "Positioning of this table": "Tabellposition", + "Border thickness:": "Ramtjocklek", + "Leave empty for no border": "Lämna fältet tomt för att undvika ramar", + "Spacing": "Cellegenskaper", + "Cell spacing:": "Cellmarginaler:", + "Space between adjacent cells": "Utrymme mellan celler", + "Cell padding:": "Cellindrag:", + "Space between content and border in cell": "Utrymme mellan ram och cellinnehåll", + "You must enter a number of rows": "Ange ental rader", + "You must enter a number of columns": "Ange antal kolumner", + + // Editor Help + "Keyboard shortcuts": "Snabbtangenter", + "The editor provides the following key combinations:": "Editorn nyttjar följande kombinationer:", + "new paragraph": "Ny paragraf ", + "insert linebreak": "Infoga radbrytning ", + "Set format to paragraph": "Aktivera paragrafläge", + "Clean content pasted from Word": "Rensa innehåll inklistrat från MS Word", + "Headings": "Skapa standardrubrik", + "Cut selection": "Klipp ut markering", + "Copy selection": "Kopiera markering", + "Paste from clipboard": "Klistra in", + "Close": "Stäng", + + // Loading messages + "Loading in progress. Please wait !": "Editorn laddas. Vänta...", + "Constructing main object": "Skapar huvudobjekt", + "Create Toolbar": "Skapar verktygspanel", + "Register panel right": "Registerar panel höger", + "Register panel left": "Registerar panel vänster", + "Register panel top": "Registerar toppanel", + "Register panel bottom": "Registerar fotpanel" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/th.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/th.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/th.js 3 Jan 2016 20:47:04 -0000 1.1.2.1 @@ -0,0 +1,50 @@ +// I18N constants + +// LANG: "th", ENCODING: UTF-8 +// Author: Suchin Prasongbundit, + +// FOR TRANSLATORS: +// +// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE +// (at least a valid email address) +// +// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; +// (if this is not possible, please include a comment +// that states what encoding is necessary.) + +{ + "Bold": "ตัวหนา", + "Italic": "ตัวเอียง", + "Underline": "ขีดเส้นใต้", + "Strikethrough": "ขีดทับ", + "Subscript": "ตัวห้อย", + "Superscript": "ตัวยก", + "Justify Left": "จัดชิดซ้าย", + "Justify Center": "จัดกึ่งกลาง", + "Justify Right": "จัดชิดขวา", + "Justify Full": "จัดเต็มขอบ", + "Ordered List": "เลขลำดับ", + "Bulleted List": "ลำดับ", + "Decrease Indent": "ลดย่อหน้า", + "Increase Indent": "เพิ่มย่อหน้า", + "Font Color": "สีขอบแบบอักษร", + "Background Color": "สีพื้นหลัง", + "Horizontal Rule": "เส้นกึ่งกลาง", + "Insert Web Link": "ิเพิ่มลิ้งค์", + "Insert/Modify Image": "เพิ่ม/แก้ไขภาพ", + "Insert Table": "เพิ่มตาราง", + "Toggle HTML Source": "สลับการแสดงโค้ด HTML", + "Enlarge Editor": "ขยายให้เต็มจอ", + "About this editor": "เกี่ยวกับโปรแกรมนี้", + "Help using editor": "การใช้งานโปรแกรม", + "Current style": "รูปแบบปัจจุบัน", + "Undoes your last action": "ย้อนกลับ", + "Redoes your last action": "ทำซ้ำ", + "Cut selection": "ตัดส่วนที่เลือก", + "Copy selection": "สำเนาส่วนที่เลือก", + "Paste from clipboard": "วางจากคลิปบอร์ด", + "OK": "ตกลง", + "Cancel": "ยกเลิก", + "Path": "เส้นทาง", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "คุณอยู่ในโหมดธรรมดา กดที่ปุ่ม [<>] เพื่อสลับกลับไปยังโหมดพิมพ์งานแบบเวิร์ด" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/vn.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/vn.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/lang/vn.js 3 Jan 2016 20:47:04 -0000 1.1.2.1 @@ -0,0 +1,56 @@ +// I18N constants : Vietnamese +// LANG: "en", ENCODING: UTF-8 +// Author: Nguyễn Đình Nam, +// Modified 21/07/2004 by Phạm Mai Quân + +{ + "Bold": "Đậm", + "Italic": "Nghiêng", + "Underline": "Gạch Chân", + "Strikethrough": "Gạch Xóa", + "Subscript": "Viết Xuống Dưới", + "Superscript": "Viết Lên Trên", + "Justify Left": "Căn Trái", + "Justify Center": "Căn Giữa", + "Justify Right": "Căn Phải", + "Justify Full": "Căn Đều", + "Ordered List": "Danh Sách Có Thứ Tự (1, 2, 3)", + "Bulleted List": "Danh Sách Phi Thứ Tự (Chấm đầu dòng)", + "Decrease Indent": "Lùi Ra Ngoài", + "Increase Indent": "Thụt Vào Trong", + "Font Color": "Màu Chữ", + "Background Color": "Màu Nền", + "Horizontal Rule": "Dòng Kẻ Ngang", + "Insert Web Link": "Tạo Liên Kết", + "Insert/Modify Image": "Chèn Ảnh", + "Insert Table": "Chèn Bảng", + "Toggle HTML Source": "Chế Độ Mã HTML", + "Enlarge Editor": "Phóng To Ô Soạn Thảo", + "About this editor": "Tự Giới Thiệu", + "Help using editor": "Giúp Đỡ", + "Current style": "Định Dạng Hiện Thời", + "Undoes your last action": "Hủy thao tác trước", + "Redoes your last action": "Lấy lại thao tác vừa bỏ", + "Cut selection": "Cắt", + "Copy selection": "Sao chép", + "Paste from clipboard": "Dán", + "Direction left to right": "Viết từ trái sang phải", + "Direction right to left": "Viết từ phải sang trái", + "OK": "Đồng ý", + "Cancel": "Hủy", + "The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren": "Chế độ phóng to ô soạn thảo có thể gây lỗi với Internet Explorer vì một số lỗi của trình duyệt này, vì thế chế độ này có thể sẽ không chạy. Hiển thị không đúng, lộn xộn, không có đầy đủ chức năng, và cũng có thể làm trình duyệt của bạn bị tắt ngang. Nếu bạn đang sử dụng Windows 9x bạn có thể bị báo lỗi ", + "Path": "Đường Dẫn", + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Bạn đang ở chế độ text. Sử dụng nút [<>] để chuyển lại chế độ WYSIWIG.", + "Cancel": "Hủy", + "Insert/Modify Link": "Thêm/Chỉnh sửa đường dẫn", + "New window (_blank)": "Cửa sổ mới (_blank)", + "None (use implicit)": "Không (sử dụng implicit)", + "OK": "Đồng ý", + "Other": "Khác", + "Same frame (_self)": "Trên cùng khung (_self)", + "Target:": "Nơi hiện thị:", + "Title (tooltip):": "Tiêu đề (của hướng dẫn):", + "Top frame (_top)": "Khung trên cùng (_top)", + "URL:": "URL:", + "You must enter the URL where this link points to": "Bạn phải điền địa chỉ (URL) mà đường dẫn sẽ liên kết tới" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/AboutBox/AboutBox.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/AboutBox/AboutBox.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/AboutBox/AboutBox.js 3 Jan 2016 20:47:05 -0000 1.1.2.1 @@ -0,0 +1,156 @@ +// Paste Plain Text plugin for Xinha + +// Distributed under the same terms as Xinha itself. +// This notice MUST stay intact for use (see license.txt). +(function(){ +Xinha.plugins.AboutBox = AboutBox; +function AboutBox(editor) { + this.editor = editor; +} + +AboutBox._pluginInfo = { + name : "AboutBox", + developer : "The Xinha Core Developer Team" +}; + +AboutBox.prototype._lc = function(string) { + return Xinha._lc(string, 'AboutBox'); +}; + + +AboutBox.prototype._prepareDialog = function() +{ + var self = this; + var editor = this.editor; + + Xinha.loadStyle ('about.css', 'AboutBox', 'aboutCSS'); +/// Now we have everything we need, so we can build the dialog. + this.dialog = new Xinha.Dialog(editor, AboutBox.html, 'Xinha',{width:600}) + + this.dialog.getElementById('close').onclick = function() { self.dialog.hide()}; + this.dialog.getElementById('xinha_logo').src = _editor_url + 'images/xinha_logo.gif'; + + var tabs = this.dialog.getElementsByClassName('tab'); + this.currentTab = tabs[0]; + tabs.forEach(function(tab){ + //alert (tab); + tab.onclick = function() { + if (self.currentTab) + { + Xinha._removeClass(self.currentTab,'tab-current'); + self.dialog.getElementById(self.currentTab.rel).style.display = 'none'; + } + Xinha._addClass(tab, 'tab-current'); + tab.blur(); + self.currentTab = tab; + self.dialog.getElementById(tab.rel).style.display = 'block'; + } + }) + this.fillPlugins(); + this.fillVersion(); + this.dialog.onresize = function () + { + this.getElementById("content").style.height = + parseInt(this.height,10) // the actual height of the dialog + - this.getElementById('h1').offsetHeight // the title bar + - this.getElementById('buttons').offsetHeight // the buttons + - 100 // we have a padding at the bottom, gotta take this into acount + + 'px'; // don't forget this ;) + + //this.getElementById("content").style.width =(this.width - 2) + 'px'; // and the width + } +}; +AboutBox.prototype.fillPlugins = function() +{ + var e = this.editor; + var tbody = this.dialog.getElementById('plugins_table'); + var tr,td,a; + var j = 0; + for (var i in e.plugins) + { + var info = e.plugins[i]; + tr = document.createElement('tr'); + if (j%2) tr.style.backgroundColor = '#e5e5e5'; + tbody.appendChild(tr); + td = document.createElement('td'); + td.innerHTML = info.name; + if (info.version) td.innerHTML += ' v'+info.version; + tr.appendChild(td); + + td = document.createElement('td'); + if (info.developer) + { + if (info.developer_url) + { + td.innerHTML = ''+info.developer+''; + } + else + { + td.innerHTML = info.developer + } + } + tr.appendChild(td); + + td = document.createElement('td'); + if (info.sponsor) + { + if (info.sponsor_url) + { + td.innerHTML = ''+info.sponsor+''; + } + else + { + td.innerHTML = info.sponsor + } + } + tr.appendChild(td); + + td = document.createElement('td'); + if (info.license) + { + td.innerHTML = info.license; + } + else + { + td.innerHTML = 'htmlArea'; + } + tr.appendChild(td); + j++; + } +} +AboutBox.prototype.fillVersion = function() +{ + var ver = Xinha.version; + this.dialog.getElementById('version').innerHTML = '
'
+                      + '\nRelease:         ' + ver.Release + ' (' + ver.Date + ')'
+                      + '\nHead:            ' + ver.Head
+                      + '\nRevision:        ' + ver.Revision
+                      + '\nLast Changed By: ' + ver.RevisionBy
+                      + '\n' +
+                      '
'; +} +AboutBox.prototype.show = function() +{ + var self = this; + if (!AboutBox.html) + { + if (AboutBox.loading) return; + AboutBox.loading = true; + Xinha._getback(Xinha.getPluginDir("AboutBox") + '/dialog.html', function(getback) { AboutBox.html = getback; self.show()}); + return; + } + if (!this.dialog) this._prepareDialog(); + + // here we can pass values to the dialog + // each property pair consists of the "name" of the input we want to populate, and the value to be set + var inputs = + { + inputArea : '' // we want the textarea always to be empty on showing + } + // now calling the show method of the Xinha.Dialog object to set the values and show the actual dialog + this.dialog.show(inputs); + + // Init the sizes (only if we have set up the custom resize function) + //this.dialog.onresize(); +}; +})() Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/AboutBox/about.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/AboutBox/about.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/AboutBox/about.css 3 Jan 2016 20:47:05 -0000 1.1.2.1 @@ -0,0 +1,51 @@ +.dialog .about.buttons a.tab { + color: #000; + cursor: pointer; + margin-left: -5px; + float: left; position: relative; + border: 1px solid #555; + top: -3px; left: -2px; + padding: 2px 10px 3px 10px; + border-top: none; background-color: #CCC; + -moz-border-radius: 0px 0px 4px 4px; + -webkit-border-radius: 4px; + -webkit-border-top-left-radius:0; + -webkit-border-top-right-radius:0; + + z-index: 0; + text-decoration:none; +} +.dialog .about.buttons a.tab-current +{ + top: -4px; + background-color: #f5f6f6; + padding: 3px 10px 4px 10px; + z-index: 10; +} + +.dialog .about.buttons { + background-color:white; + padding:3px 3px 0 10px; +} + +.dialog .about.content .tab-content { + padding-bottom:15px; + width:95%; +} +.dialog .about.content { + height:300px; + overflow:auto; + background-color:#f5f6f6; +} +.dialog .about.content table.plugins{ + width:95%; + border: 1px solid black; + margin: 1em; +} +.dialog .about.content table.plugins th{ + font-weight: bold; + background-color: #CCC; +} +.dialog .about.content table.plugins td{ + padding:3px; +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/AboutBox/dialog.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/AboutBox/dialog.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/AboutBox/dialog.html 3 Jan 2016 20:47:05 -0000 1.1.2.1 @@ -0,0 +1,95 @@ +

+ About this editor +

+Xinha +
+
+

+ A free WYSIWYG editor replacement for + + <textarea> + + fields. +

+

+ Visit the Xinha Website + for more information. +

+

+ Use of Xinha is granted by the terms of the htmlArea License (based on BSD license) +

+
    Copyright (c) 2005-2009 Xinha Developer Team and contributors
+

+ Xinha was originally based on work by Mihai Bazon which is: +

+
+    Copyright (c) 2003-2004 dynarch.com.
+    Copyright (c) 2002-2003 interactivetools.com, inc.
+    This copyright notice MUST stay intact for use.
+  
+
+ + + + +
+
+ + +
\ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/ColorPicker/ColorPicker.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/ColorPicker/ColorPicker.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/ColorPicker/ColorPicker.js 3 Jan 2016 20:47:05 -0000 1.1.2.1 @@ -0,0 +1,906 @@ + + /** + * Gogo Internet Services Color Picker Javascript Widget + * colorPicker for short. + * + * @author James Sleeman + * @date June, 2005 + * + * The colorPicker class provides access to a color map for selecting + * colors which will be passed back to a callback (usually such a callback would + * write the RGB hex value returned into a field, but that's up to you). + * + * The color map presented is a standard rectangular pallate with 0->360 degrees of + * hue on the Y axis and 0->100% saturation on the X axis, the value (brightness) is + * selectable as a vertical column of grey values. Also present is a one row of + * white->grey->black for easy selection of these colors. + * + * A checkbox is presented, which when checked will force the palatte into "web safe" + * mode, only colours in the "web safe palatte" of 216 colors will be shown, the palatte + * is adjusted so that the normal blend of colours are "rounded" to the nearest web safe + * one. It should be noted that "web safe" colours really are a thing of the past, + * not only can pretty much every body display several million colours, but it's actually + * been found that of those 216 web safe colours only 20 to 30 are actually going to be + * displayed equally on the majority of monitors, and those are mostly yellows! + * + * =Usage Example= + * {{{ + * "; + break; + } + return html; +}; + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/GetHtml/TransformInnerHTML.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/GetHtml/TransformInnerHTML.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/GetHtml/TransformInnerHTML.js 3 Jan 2016 20:47:11 -0000 1.1.2.1 @@ -0,0 +1,231 @@ +/** + * Based on XML_Utility functions submitted by troels_kn. + * credit also to adios, who helped with reg exps: + * http://www.sitepoint.com/forums/showthread.php?t=201052 + * + * A replacement for Xinha.getHTML + * + * Features: + * - Generates XHTML code + * - Much faster than Xinha.getHTML + * - Eliminates the hacks to accomodate browser quirks + * - Returns correct code for Flash objects and scripts + * - Formats html in an indented, readable format in html mode + * - Preserves script and pre formatting + * - Preserves formatting in comments + * - Removes contenteditable from body tag in full-page mode + * - Supports only7BitPrintablesInURLs config option + * - Supports htmlRemoveTags config option + */ + +function GetHtmlImplementation(editor) { + this.editor = editor; +} + +GetHtmlImplementation._pluginInfo = { + name : "GetHtmlImplementation TransformInnerHTML", + version : "1.0", + developer : "Nelson Bright", + developer_url : "http://www.brightworkweb.com/", + sponsor : "", + sponsor_url : "", + license : "htmlArea" +}; + +Xinha.RegExpCache = [ +/*00*/ /<\s*\/?([^\s\/>]+)[\s*\/>]/gi,//lowercase tags +/*01*/ /(\s+)_moz[^=>]*=[^\s>]*/gi,//strip _moz attributes +/*02*/ /\s*=\s*(([^'"][^>\s]*)([>\s])|"([^"]+)"|'([^']+)')/g,// find attributes +/*03*/ /\/>/g,//strip singlet terminators +/*04*/ /<(br|hr|img|input|link|meta|param|embed|area)((\s*\S*="[^"]*")*)>/g,//terminate singlet tags +/*05*/ /(<\w+\s+(\w*="[^"]*"\s+)*)(checked|compact|declare|defer|disabled|ismap|multiple|no(href|resize|shade|wrap)|readonly|selected)([\s>])/gi,//expand singlet attributes +/*06*/ /(="[^']*)'([^'"]*")/,//check quote nesting +/*07*/ /&(?=(?!(#[0-9]{2,5};|[a-zA-Z0-9]{2,6};|#x[0-9a-fA-F]{2,4};))[^<]*>)/g,//expand query ampersands not in html entities +/*08*/ /<\s+/g,//strip tagstart whitespace +/*09*/ /\s+(\/)?>/g,//trim whitespace +/*10*/ /\s{2,}/g,//trim extra whitespace +/*11*/ /\s+([^=\s]+)((="[^"]+")|([\s>]))/g,// lowercase attribute names +/*12*/ /\s+contenteditable(=[^>\s\/]*)?/gi,//strip contenteditable +/*13*/ /((href|src)=")([^\s]*)"/g, //find href and src for stripBaseHref() +/*14*/ /<\/?(div|p|h[1-6]|table|tr|td|th|ul|ol|li|dl|dt|dd|blockquote|object|br|hr|img|embed|param|pre|script|html|head|body|meta|link|title|area|input|form|textarea|select|option)[^>]*>/g, +/*15*/ /<\/(div|p|h[1-6]|table|tr|ul|ol|dl|blockquote|html|head|body|script|form|select)( [^>]*)?>/g,//blocklevel closing tag +/*16*/ /<(div|p|h[1-6]|table|tr|ul|ol|dl|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g,//blocklevel opening tag +/*17*/ /<(td|th|li|dt|dd|option|br|hr|embed|param|pre|meta|link|title|area|input|textarea)[^>]*>/g,//singlet tag or output on 1 line +/*18*/ /(^|<\/(pre|script)>)(\s|[^\s])*?(<(pre|script)[^>]*>|$)/g,//find content NOT inside pre and script tags +/*19*/ /(]*>)([\s\S])*?(<\/pre>)/g,//find content inside pre tags +/*20*/ /(^|)([\s\S]*?)(?=|$)/g,//find content NOT inside comments +/*21*/ /\S*=""/g, //find empty attributes +/*22*/ /|<\?[\s\S]*?\?>|<\/?\w[^>]*>/g, //find all tags, including comments and php +/*23*/ /(^|<\/script>)[\s\S]*?(]*>|$)/g //find content NOT inside script tags +]; +// compile for performance; WebKit doesn't support this +var testRE = new RegExp().compile(Xinha.RegExpCache[3]); +if (typeof testRE != 'undefined') { + for (var i=0; i').//strip singlet terminators + replace(c[9], '$1>').//trim whitespace + replace(c[5], '$1$3="$3"$5').//expand singlet attributes + replace(c[4], '<$1$2 />').//terminate singlet tags + replace(c[6], '$1$2').//check quote nesting + replace(c[7], '&').//expand query ampersands + replace(c[8], '<').//strip tagstart whitespace + replace(c[10], ' ');//trim extra whitespace + if(Xinha.is_ie && c[13].test(sHtml)) { + sHtml = sHtml.replace(c[13],'$1'+Xinha._escapeDollars(this.stripBaseURL(RegExp.$3))+'"'); + } + + if(this.config.only7BitPrintablesInURLs) { + if (Xinha.is_ie) c[13].test(sHtml); // oddly the test below only triggers when we call this once before (IE6), in Moz it fails if tested twice + if ( c[13].test(sHtml)) { + try { //Mozilla returns an incorrectly encoded value with innerHTML + sHtml = sHtml.replace(c[13], '$1'+Xinha._escapeDollars(decodeURIComponent(RegExp.$3).replace(/([^!-~]+)/g, function(chr) + {return escape(chr);}))+'"'); + } catch (e) { // once the URL is escape()ed, you can't decodeURIComponent() it anymore + sHtml = sHtml.replace(c[13], Xinha._escapeDollars('$1'+RegExp.$3.replace(/([^!-~]+)/g,function(chr){return escape(chr);})+'"')); + } + } + } + return sHtml; +}; + +/** + * Prettyfies html by inserting linebreaks before tags, and indenting blocklevel tags + */ +Xinha.indent = function(s, sindentChar) { + Xinha.__nindent = 0; + Xinha.__sindent = ""; + Xinha.__sindentChar = (typeof sindentChar == "undefined") ? " " : sindentChar; + var c = Xinha.RegExpCache; + if(Xinha.is_gecko) { //moz changes returns into
inside
 tags
+		s = s.replace(c[19], function(str){return str.replace(/
/g,"\n")}); + } + s = s.replace(c[18], function(strn) { //skip pre and script tags + strn = strn.replace(c[20], function(st,$1,$2) { //exclude comments + string = $2.replace(/[\n\r]/gi, " ").replace(/\s+/gi," ").replace(c[14], function(str) { + if (str.match(c[16])) { + var s = "\n" + Xinha.__sindent + str; + // blocklevel openingtag - increase indent + Xinha.__sindent += Xinha.__sindentChar; + ++Xinha.__nindent; + return s; + } else if (str.match(c[15])) { + // blocklevel closingtag - decrease indent + --Xinha.__nindent; + Xinha.__sindent = ""; + for (var i=Xinha.__nindent;i>0;--i) { + Xinha.__sindent += Xinha.__sindentChar; + } + return "\n" + Xinha.__sindent + str; + } else if (str.match(c[17])) { + // singlet tag + return "\n" + Xinha.__sindent + str; + } + return str; // this won't actually happen + }); + return $1 + string; + });return strn; + }); + //final cleanup + s = s.replace(/^\s*/,'').//strip leading whitespace + replace(/ +\n/g,'\n').//strip spaces at end of lines + replace(/[\r\n]+(\s+)<\/script>/g,'\n$1');//strip returns added into scripts + return s; +}; + +Xinha.getHTML = function(root, outputRoot, editor) { + var html = ""; + var c = Xinha.RegExpCache; + + if(root.nodeType == 11) {//document fragment + //we can't get innerHTML from the root (type 11) node, so we + //copy all the child nodes into a new div and get innerHTML from the div + var div = document.createElement("div"); + var temp = root.insertBefore(div,root.firstChild); + for (j = temp.nextSibling; j; j = j.nextSibling) { + temp.appendChild(j.cloneNode(true)); + } + html += temp.innerHTML.replace(c[23], function(strn) { //skip content inside script tags + strn = strn.replace(c[22], function(tag){ + if(/^<[!\?]/.test(tag)) return tag; //skip comments and php tags + else return editor.cleanHTML(tag)}); + return strn; + }); + + } else { + + var root_tag = (root.nodeType == 1) ? root.tagName.toLowerCase() : ''; + if (outputRoot) { //only happens with tag in fullpage mode + html += "<" + root_tag; + var attrs = root.attributes; // strangely, this doesn't work in moz + for (i = 0; i < attrs.length; ++i) { + var a = attrs.item(i); + if (!a.specified) { + continue; + } + var name = a.nodeName.toLowerCase(); + var value = a.nodeValue; + html += " " + name + '="' + value + '"'; + } + html += ">"; + } + if(root_tag == "html") { + innerhtml = editor._doc.documentElement.innerHTML; + } else { + innerhtml = root.innerHTML; + } + //pass tags to cleanHTML() one at a time + //includes support for htmlRemoveTags config option + html += innerhtml.replace(c[23], function(strn) { //skip content inside script tags + strn = strn.replace(c[22], function(tag){ + if(/^<[!\?]/.test(tag)) return tag; //skip comments and php tags + else if(!(editor.config.htmlRemoveTags && editor.config.htmlRemoveTags.test(tag.replace(/<([^\s>\/]+)/,'$1')))) + return editor.cleanHTML(tag); + else return ''}); + return strn; + }); + //IE drops all ,, tags in a list except the last one + if(Xinha.is_ie) { + html = html.replace(/<(li|dd|dt)( [^>]*)?>/g,'<$1$2>'). + replace(/(<[uod]l[^>]*>[\s\S]*?)<\/(li|dd|dt)>/g, '$1'). + replace(/\s*<\/(li|dd|dt)>(\s*<\/(li|dd|dt)>)+/g, ''). + replace(/(][\s\S]*?)(<\/d[dt]>)+/g, '$1'); + } + if(Xinha.is_gecko) + html = html.replace(/
\n$/, ''); //strip trailing
added by moz + //Cleanup redundant whitespace before in IE and Mozilla + html = html.replace(/\s*(<\/(li|dd|dt)>)/g, '$1'); + if (outputRoot) { + html += ""; + } + html = Xinha.indent(html); + }; +// html = Xinha.htmlEncode(html); + + return html; +}; + +/** + * Escapes dollar signs ($) to make them safe to use in regex replacement functions by replacing each $ in the input with $$. + * + * This is advisable any time the replacement string for a call to replace() is a variable and could contain dollar signs that should not be interpreted as references to captured groups (e.g., when you want the text "$10" and not the first captured group followed by a 0). + * See http://trac.xinha.org/ticket/1337 + */ +Xinha._escapeDollars = function(str) { + return str.replace(/\$/g, "$$$$"); +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/GetHtml/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/GetHtml/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/GetHtml/lang/pt_br.js 3 Jan 2016 20:47:12 -0000 1.1.2.1 @@ -0,0 +1,18 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Your Document is not well formed. Check JavaScript console for details.": "Seu documento não está formatado corretamente. Verifique os detalhes no console do Javascript." +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InlineStyler/InlineStyler.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InlineStyler/InlineStyler.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InlineStyler/InlineStyler.js 3 Jan 2016 20:47:12 -0000 1.1.2.1 @@ -0,0 +1,505 @@ +Xinha.InlineStyler = function(element, editor, dialog, doc) +{ + this.element = element; + this.editor = editor; + this.dialog = dialog; + this.doc = doc ? doc : document; + this.inputs = { + styles : {}, + aux : {} + } + this.styles = {}; + this.auxData = {}; //units and such +} + +Xinha.InlineStyler.getLength = function(value) +{ + var len = parseInt(value); + if (isNaN(len)) + { + len = ""; + } + return len; +}; + +// Applies the style found in "params" to the given element. +Xinha.InlineStyler.prototype.applyStyle = function(params) +{ + var element = this.element; + var style = element.style; + + for (var i in params) + { + if (typeof params[i] == 'function') + continue; + if (params[i] != null) + var val = params[i].value || params[i]; + + switch (i) + { + case "backgroundImage": + if (/\S/.test(val)) + { + style.backgroundImage = "url(" + val + ")"; + } + else + { + style.backgroundImage = "none"; + } + break; + case "borderCollapse": + style.borderCollapse = params[i] == "on" ? "collapse" : "separate"; + break; + case "width": + if (/\S/.test(val)) + { + style.width = val + this.inputs.aux["widthUnit"].value; + } + else + { + style.width = ""; + } + break; + case "height": + if (/\S/.test(val)) + { + style.height = val + this.inputs.aux["heightUnit"].value; + } + else + { + style.height = ""; + } + break; + case "textAlign": + if (val == "char") + { + var ch = this.inputs.aux["textAlignChar"].value; + if (ch == '"') + { + ch = '\\"'; + } + style.textAlign = '"' + ch + '"'; + } + else + if (val == "-") + { + style.textAlign = ""; + } + else + { + style.textAlign = val; + } + break; + case "verticalAlign": + element.vAlign = ""; + if (val == "-") + { + style.verticalAlign = ""; + + } + else + { + style.verticalAlign = val; + } + break; + case "float": + if (Xinha.is_ie) { + style.styleFloat = val; + } + else { + style.cssFloat = val; + } + break; + case "borderWidth": + style[i] = val ? val + "px" : '0px'; + break; + default: + style[i] = val; + break; + // case "f_st_margin": + // style.margin = val + "px"; + // break; + // case "f_st_padding": + // style.padding = val + "px"; + // break; + } + } +}; + +Xinha.InlineStyler.prototype.createStyleLayoutFieldset = function() +{ + var self = this; + var editor = this.editor; + var doc = this.doc; + var el = this.element; + var fieldset = doc.createElement("fieldset"); + var legend = doc.createElement("legend"); + fieldset.appendChild(legend); + legend.innerHTML = Xinha._lc("Layout", "TableOperations"); + var table = doc.createElement("table"); + fieldset.appendChild(table); + table.style.width = "100%"; + var tbody = doc.createElement("tbody"); + table.appendChild(tbody); + + var tagname = el.tagName.toLowerCase(); + var tr, td, input, select, option, options, i; + + if (tagname != "td" && tagname != "tr" && tagname != "th") + { + tr = doc.createElement("tr"); + tbody.appendChild(tr); + td = doc.createElement("td"); + td.className = "label"; + tr.appendChild(td); + td.innerHTML = Xinha._lc("Float", "TableOperations") + ":"; + td = doc.createElement("td"); + tr.appendChild(td); + select = doc.createElement("select"); + select.name = this.dialog.createId("float"); + td.appendChild(select); + this.inputs.styles['float'] = select; + + options = ["None", "Left", "Right"]; + for (var i = 0; i < options.length; ++i) + { + var Val = options[i]; + var val = options[i].toLowerCase(); + option = doc.createElement("option"); + option.innerHTML = Xinha._lc(Val, "TableOperations"); + option.value = val; + if (Xinha.is_ie) { + option.selected = (("" + el.style.styleFloat).toLowerCase() == val); + } + else { + option.selected = (("" + el.style.cssFloat).toLowerCase() == val); + } + select.appendChild(option); + } + } + + tr = doc.createElement("tr"); + tbody.appendChild(tr); + td = doc.createElement("td"); + td.className = "label"; + tr.appendChild(td); + td.innerHTML = Xinha._lc("Width", "TableOperations") + ":"; + td = doc.createElement("td"); + tr.appendChild(td); + input = doc.createElement("input"); + input.name = this.dialog.createId("width"); + input.type = "text"; + input.value = Xinha.InlineStyler.getLength(el.style.width); + input.size = "5"; + this.inputs.styles['width'] = input; + input.style.marginRight = "0.5em"; + td.appendChild(input); + select = doc.createElement("select"); + select.name = this.dialog.createId("widthUnit"); + this.inputs.aux['widthUnit'] = select; + option = doc.createElement("option"); + option.innerHTML = Xinha._lc("percent", "TableOperations"); + option.value = "%"; + option.selected = /%/.test(el.style.width); + select.appendChild(option); + option = doc.createElement("option"); + option.innerHTML = Xinha._lc("pixels", "TableOperations"); + option.value = "px"; + option.selected = /px/.test(el.style.width); + select.appendChild(option); + td.appendChild(select); + + select.style.marginRight = "0.5em"; + td.appendChild(doc.createTextNode(Xinha._lc("Text align", "TableOperations") + ":")); + select = doc.createElement("select"); + select.name = this.dialog.createId("textAlign"); + select.style.marginLeft = select.style.marginRight = "0.5em"; + td.appendChild(select); + this.inputs.styles['textAlign'] = select; + options = ["Left", "Center", "Right", "Justify", "-"]; + if (tagname == "td") + { + options.push("Char"); + } + input = doc.createElement("input"); + this.inputs.aux['textAlignChar'] = input; + input.name= this.dialog.createId("textAlignChar"); + input.size = "1"; + input.style.fontFamily = "monospace"; + td.appendChild(input); + + for (var i = 0; i < options.length; ++i) + { + var Val = options[i]; + var val = Val.toLowerCase(); + option = doc.createElement("option"); + option.value = val; + option.innerHTML = Xinha._lc(Val, "TableOperations"); + option.selected = ((el.style.textAlign.toLowerCase() == val) || (el.style.textAlign == "" && Val == "-")); + select.appendChild(option); + } + var textAlignCharInput = input; + function setCharVisibility(value) + { + textAlignCharInput.style.visibility = value ? "visible" : "hidden"; + if (value) + { + textAlignCharInput.focus(); + textAlignCharInput.select(); + } + } + select.onchange = function() + { + setCharVisibility(this.value == "char"); + }; + setCharVisibility(select.value == "char"); + + tr = doc.createElement("tr"); + tbody.appendChild(tr); + td = doc.createElement("td"); + td.className = "label"; + tr.appendChild(td); + td.innerHTML = Xinha._lc("Height", "TableOperations") + ":"; + td = doc.createElement("td"); + tr.appendChild(td); + input = doc.createElement("input"); + input.name = this.dialog.createId("height"); + input.type = "text"; + input.value = Xinha.InlineStyler.getLength(el.style.height); + input.size = "5"; + this.inputs.styles['height'] = input; + input.style.marginRight = "0.5em"; + td.appendChild(input); + select = doc.createElement("select"); + select.name = this.dialog.createId("heightUnit"); + this.inputs.aux['heightUnit'] = select; + option = doc.createElement("option"); + option.innerHTML = Xinha._lc("percent", "TableOperations"); + option.value = "%"; + option.selected = /%/.test(el.style.height); + select.appendChild(option); + option = doc.createElement("option"); + option.innerHTML = Xinha._lc("pixels", "TableOperations"); + option.value = "px"; + option.selected = /px/.test(el.style.height); + select.appendChild(option); + td.appendChild(select); + + select.style.marginRight = "0.5em"; + td.appendChild(doc.createTextNode(Xinha._lc("Vertical align", "TableOperations") + ":")); + select = doc.createElement("select"); + select.name = this.dialog.createId("verticalAlign"); + this.inputs.styles['verticalAlign'] = select; + select.style.marginLeft = "0.5em"; + td.appendChild(select); + options = ["Top", "Middle", "Bottom", "Baseline", "-"]; + for (var i = 0; i < options.length; ++i) + { + var Val = options[i]; + var val = Val.toLowerCase(); + option = doc.createElement("option"); + option.value = val; + option.innerHTML = Xinha._lc(Val, "TableOperations"); + option.selected = ((el.style.verticalAlign.toLowerCase() == val) || (el.style.verticalAlign == "" && Val == "-")); + select.appendChild(option); + } + + return fieldset; +}; + +// Returns an HTML element containing the style attributes for the given +// element. This can be easily embedded into any dialog; the functionality is +// also provided. +Xinha.InlineStyler.prototype.createStyleFieldset = function() +{ + var editor = this.editor; + var doc = this.doc; + var el = this.element; + + var fieldset = doc.createElement("fieldset"); + var legend = doc.createElement("legend"); + fieldset.appendChild(legend); + legend.innerHTML = Xinha._lc("CSS Style", "TableOperations"); + var table = doc.createElement("table"); + fieldset.appendChild(table); + table.style.width = "100%"; + var tbody = doc.createElement("tbody"); + table.appendChild(tbody); + + var tr, td, input, select, option, options, i; + + tr = doc.createElement("tr"); + tbody.appendChild(tr); + td = doc.createElement("td"); + tr.appendChild(td); + td.className = "label"; + td.innerHTML = Xinha._lc("Background", "TableOperations") + ":"; + td = doc.createElement("td"); + tr.appendChild(td); + + input = doc.createElement("input"); + input.name = this.dialog.createId("backgroundColor"); + input.value = Xinha._colorToRgb( el.style.backgroundColor ); + input.type = "hidden"; + this.inputs.styles['backgroundColor'] = input; + input.style.marginRight = "0.5em"; + td.appendChild(input); + new Xinha.colorPicker.InputBinding(input) + + td.appendChild(doc.createTextNode(" " + Xinha._lc("Image URL", "TableOperations") + ": ")); + input = doc.createElement("input"); + input.name = this.dialog.createId("backgroundImage"); + input.type = "text"; + this.inputs.styles['backgroundImage'] = input; + if (el.style.backgroundImage.match(/url\(\s*(.*?)\s*\)/)) + input.value = RegExp.$1; + // input.style.width = "100%"; + td.appendChild(input); + + tr = doc.createElement("tr"); + tbody.appendChild(tr); + td = doc.createElement("td"); + tr.appendChild(td); + td.className = "label"; + td.innerHTML = Xinha._lc("FG Color", "TableOperations") + ":"; + td = doc.createElement("td"); + tr.appendChild(td); + input = doc.createElement("input"); + input.name = this.dialog.createId("color"); + input.value = Xinha._colorToRgb( el.style.color ); + input.type = "hidden"; + this.inputs.styles['color'] = input; + input.style.marginRight = "0.5em"; + td.appendChild(input); + new Xinha.colorPicker.InputBinding(input) + + // for better alignment we include an invisible field. + input = doc.createElement("input"); + input.style.visibility = "hidden"; + input.type = "text"; + td.appendChild(input); + + tr = doc.createElement("tr"); + tbody.appendChild(tr); + td = doc.createElement("td"); + tr.appendChild(td); + td.className = "label"; + td.innerHTML = Xinha._lc("Border", "TableOperations") + ":"; + td = doc.createElement("td"); + tr.appendChild(td); + input = doc.createElement("input"); + input.name = this.dialog.createId("borderColor"); + input.value = Xinha._colorToRgb( el.style.borderColor ); + input.type = "hidden"; + this.inputs.styles['borderColor'] = input; + input.style.marginRight = "0.5em"; + td.appendChild(input); + new Xinha.colorPicker.InputBinding(input) + + select = doc.createElement("select"); + select.name = this.dialog.createId("borderStyle"); + var borderFields = []; + td.appendChild(select); + this.inputs.styles['borderStyle'] = select; + options = ["none", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]; + var currentBorderStyle = el.style.borderStyle; + // Gecko reports "solid solid solid solid" for "border-style: solid". + // That is, "top right bottom left" -- we only consider the first + // value. + if (currentBorderStyle.match(/([^\s]*)\s/)) currentBorderStyle = RegExp.$1; + for (var i=0;iInsert Image + +
+ + + + + + + + + + + + + +
Image URL: + +
Alternate text:
+ +
+ +
+Layout + +
+ +
Alignment:
+ + +
+ +
Border thickness:
+ + +
+ +
+ +
+Spacing + +
+ +
Horizontal:
+ + +
+ +
Vertical:
+ + +
+ +
+
+
+Image Preview:
+ +
+ +
+ + +
\ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertImage/insert_image.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertImage/insert_image.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertImage/insert_image.html 3 Jan 2016 20:47:12 -0000 1.1.2.1 @@ -0,0 +1,173 @@ + + + + Insert Image + + + + + + + + + + +
Insert Image
+ +
+ + + + + + + + + + + + + + +
Image URL: + +
Alternate text:
+ +
+Layout + +
+ +
Alignment:
+ + +
+ +
Border thickness:
+ + +
+ +
+ +
+Spacing + +
+ +
Horizontal:
+ + +
+ +
Vertical:
+ + +
+ +
+
+
+Image Preview:
+ +
+
+ + +
+
+ + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertImage/insert_image.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertImage/insert_image.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertImage/insert_image.js 3 Jan 2016 20:47:12 -0000 1.1.2.1 @@ -0,0 +1,109 @@ + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- Xinha (is not htmlArea) - http://xinha.org + -- + -- Use of Xinha is granted by the terms of the htmlArea License (based on + -- BSD license) please read license.txt in this package for details. + -- + -- Copyright (c) 2005-2008 Xinha Developer Team and contributors + -- + -- This is the Xinha standard implementation of an image insertion plugin + -- + -- he file is loaded as a special plugin by the Xinha Core when no alternative method (plugin) is loaded. + -- + -- + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/modules/InsertImage/insert_image.js $ + -- $LastChangedDate: 2010-02-18 15:14:45 +1300 (Thu, 18 Feb 2010) $ + -- $LastChangedRevision: 1239 $ + -- $LastChangedBy: gogo $ + --------------------------------------------------------------------------*/ + +InsertImage._pluginInfo = { + name : "InsertImage", + origin : "Xinha Core", + version : "$LastChangedRevision: 1239 $".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), + developer : "The Xinha Core Developer Team", + developer_url : "$HeadURL: http://svn.xinha.webfactional.com/trunk/modules/InsertImage/insert_image.js $".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), + sponsor : "", + sponsor_url : "", + license : "htmlArea" +}; + +function InsertImage(editor) { + this.editor = editor; + var cfg = editor.config; + var self = this; + + + if(typeof editor._insertImage == 'undefined') + { + editor._insertImage = function() { self.show(); }; + // editor.config.btnList.insertimage[3] = function() { self.show(); } + } + } + +InsertImage.prototype._lc = function(string) { + return Xinha._lc(string, 'Xinha'); +}; + +InsertImage.prototype.onGenerateOnce = function() +{ + InsertImage.loadAssets(); +}; + +InsertImage.loadAssets = function() +{ + var self = InsertImage; + if (self.loading) return; + self.loading = true; + Xinha._getback(_editor_url + 'modules/InsertImage/dialog.html', function(getback) { self.html = getback; self.dialogReady = true; }); + Xinha._getback(_editor_url + 'modules/InsertImage/pluginMethods.js', function(getback) { eval(getback); self.methodsReady = true; }); +}; +InsertImage.prototype.onUpdateToolbar = function() +{ + if (!(InsertImage.dialogReady && InsertImage.methodsReady)) + { + this.editor._toolbarObjects.insertimage.state("enabled", false); + } + else this.onUpdateToolbar = null; +}; + +InsertImage.prototype.prepareDialog = function() +{ + var self = this; + var editor = this.editor; + + var dialog = this.dialog = new Xinha.Dialog(editor, InsertImage.html, 'Xinha',{width:410}) + // Connect the OK and Cancel buttons + dialog.getElementById('ok').onclick = function() {self.apply();} + + dialog.getElementById('cancel').onclick = function() { self.dialog.hide()}; + + dialog.getElementById('preview').onclick = function() { + var f_url = dialog.getElementById("f_url"); + var url = f_url.value; + + if (!url) { + alert(dialog._lc("You must enter the URL")); + f_url.focus(); + return false; + } + dialog.getElementById('ipreview').src = url; + return false; + } + this.dialog.onresize = function () + { + var newHeightForPreview = + parseInt(this.height,10) + - this.getElementById('h1').offsetHeight + - this.getElementById('buttons').offsetHeight + - this.getElementById('inputs').offsetHeight + - parseInt(this.rootElem.style.paddingBottom,10); // we have a padding at the bottom, gotta take this into acount + + + this.getElementById("ipreview").style.height = ((newHeightForPreview > 0) ? newHeightForPreview : 0) + "px"; // no-go beyond 0 + + this.getElementById("ipreview").style.width = this.width - 2 + 'px'; // and the width + + } + this.dialogReady = true; +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertImage/pluginMethods.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertImage/pluginMethods.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertImage/pluginMethods.js 3 Jan 2016 20:47:12 -0000 1.1.2.1 @@ -0,0 +1,152 @@ +InsertImage.prototype.show = function(image) +{ + if (!this.dialog) this.prepareDialog(); + + var editor = this.editor; + if ( typeof image == "undefined" ) + { + image = editor.getParentElement(); + if ( image && image.tagName.toLowerCase() != 'img' ) + { + image = null; + } + } + + if ( image ) + { + function getSpecifiedAttribute(element,attribute) + { + var a = element.attributes; + for (var i=0;iInsert Table +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ Caption: + + +
Rows:Width:
Cols:
+ +
+ +
+Layout + +
+ +
Alignment:
+ + +
+ +
Border
+ Pixels + + +
Collapse borders: + + +
+ +
+ +
+Spacing + +
+ +
Cell spacing:
+ + +
+ +
Cell padding:
+ + + +
+
+ + +
+
Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertTable/insert_table.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertTable/insert_table.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertTable/insert_table.html 3 Jan 2016 20:47:13 -0000 1.1.2.1 @@ -0,0 +1,157 @@ + + + + Insert Table + + + + + + + + + + +
Insert Table
+ +
+ + + + + + + + + + + + + + + + + +
Rows:Width:
Cols:
+ +

+ +

+Layout + +
+ +
Alignment:
+ + +

+ +

Border thickness:
+ + +
+ +
+ +
+Spacing + +
+ +
Cell spacing:
+ + +

+ +

Cell padding:
+ + +
+ +
+ +
+ + +
+ +
+ + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertTable/insert_table.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertTable/insert_table.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertTable/insert_table.js 3 Jan 2016 20:47:13 -0000 1.1.2.1 @@ -0,0 +1,94 @@ + + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- Xinha (is not htmlArea) - http://xinha.org + -- + -- Use of Xinha is granted by the terms of the htmlArea License (based on + -- BSD license) please read license.txt in this package for details. + -- + -- Copyright (c) 2005-2008 Xinha Developer Team and contributors + -- + -- Xinha was originally based on work by Mihai Bazon which is: + -- Copyright (c) 2003-2004 dynarch.com. + -- Copyright (c) 2002-2003 interactivetools.com, inc. + -- This copyright notice MUST stay intact for use. + -- + -- This is the Xinha standard implementation of a table insertion plugin + -- + -- The file is loaded by the Xinha Core when no alternative method (plugin) is loaded. + -- + -- + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/modules/InsertTable/insert_table.js $ + -- $LastChangedDate: 2010-11-17 17:08:18 +1300 (Wed, 17 Nov 2010) $ + -- $LastChangedRevision: 1272 $ + -- $LastChangedBy: ejucovy $ + --------------------------------------------------------------------------*/ +InsertTable._pluginInfo = { + name : "InsertTable", + origin : "Xinha Core", + version : "$LastChangedRevision: 1272 $".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), + developer : "The Xinha Core Developer Team", + developer_url : "$HeadURL: http://svn.xinha.webfactional.com/trunk/modules/InsertTable/insert_table.js $".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), + sponsor : "", + sponsor_url : "", + license : "htmlArea" +}; + +function InsertTable(editor) { + this.editor = editor; + var cfg = editor.config; + var self = this; + + if(typeof editor._insertTable == 'undefined') { + editor._insertTable = function() { + self.show(); + } + } +} + +InsertTable.prototype._lc = function(string) { + return Xinha._lc(string, 'Xinha'); +}; + + +InsertTable.prototype.onGenerateOnce = function() +{ + InsertTable.loadAssets(); +}; +InsertTable.loadAssets = function() +{ + var self = InsertTable; + if (self.loading) return; + self.loading = true; + Xinha._getback(_editor_url + 'modules/InsertTable/dialog.html', function(getback) { self.html = getback; self.dialogReady = true; }); + Xinha._getback(_editor_url + 'modules/InsertTable/pluginMethods.js', function(getback) { eval(getback); self.methodsReady = true; }); +}; + +InsertTable.prototype.onUpdateToolbar = function() +{ + if (!(InsertTable.dialogReady && InsertTable.methodsReady)) + { + this.editor._toolbarObjects.inserttable.state("enabled", false); + } + else this.onUpdateToolbar = null; +}; + +InsertTable.prototype.prepareDialog = function() +{ + var self = this; + var editor = this.editor; + + var dialog = this.dialog = new Xinha.Dialog(editor, InsertTable.html, 'Xinha',{width:400}) + // Connect the OK and Cancel buttons + dialog.getElementById('ok').onclick = function() {self.apply();} + dialog.getElementById('cancel').onclick = function() { self.dialog.hide()}; + + this.borderColorPicker = new Xinha.colorPicker.InputBinding(dialog.getElementById('border_color')); + + this.dialog.onresize = function () + { + this.getElementById("layout_fieldset").style.width =(this.width / 2) + 50 + 'px'; + this.getElementById("spacing_fieldset").style.width =(this.width / 2) - 120 + 'px'; + } + + this.dialogReady = true; +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertTable/pluginMethods.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertTable/pluginMethods.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InsertTable/pluginMethods.js 3 Jan 2016 20:47:13 -0000 1.1.2.1 @@ -0,0 +1,118 @@ +InsertTable.prototype.show = function(image) +{ + if (!this.dialog) this.prepareDialog(); + + var editor = this.editor; + + var values = + { + "caption" : '', + "rows" : '2', + "cols" : '4', + "width" : '100', + "unit" : '%', + "fixed" : '', + "align" : '', + "border" : '1', + "border_style" : 'dotted', + "border_color" : '#000000', + "border_collapse" : 'on', + "spacing" : '', + "padding" : '5' + } + // update the color of the picker manually + this.borderColorPicker.setColor('#000000'); + // now calling the show method of the Xinha.Dialog object to set the values and show the actual dialog + this.dialog.show(values); + this.dialog.onresize(); +}; + +InsertTable.prototype.apply = function() +{ + var editor = this.editor; + var doc = editor._doc; + var param = this.dialog.getValues(); + + if (!param.rows || !param.cols) + { + if (!param.rows) + { + this.dialog.getElementById("rows_alert").style.display = ''; + } + if (!param.cols) + { + this.dialog.getElementById("columns_alert").style.display = ''; + } + return; + } + // selection is only restored on dialog.hide() + this.dialog.hide(); + // create the table element + var table = doc.createElement("table"); + // assign the given arguments + + for ( var field in param ) + { + var value = param[field]; + if ( !value ) + { + continue; + } + switch (field) + { + case "width": + table.style.width = value + param.unit.value; + break; + case "align": + table.align = value.value; + break; + case "border": + table.style.border = value + 'px ' + param.border_style.value + ' ' + param.border_color; + break; + case "border_collapse": + table.style.borderCollapse = (value == 'on') ? 'collapse' : '' ; + break; + case "spacing": + table.cellSpacing = parseInt(value, 10); + break; + case "padding": + table.cellPadding = parseInt(value, 10); + break; + } + } + if (param.caption) + { + var caption = table.createCaption(); + caption.appendChild(doc.createTextNode(param.caption)); + } + var cellwidth = 0; + if ( param.fixed ) + { + cellwidth = Math.floor(100 / parseInt(param.cols, 10)); + } + var tbody = doc.createElement("tbody"); + table.appendChild(tbody); + for ( var i = 0; i < param.rows; ++i ) + { + var tr = doc.createElement("tr"); + tbody.appendChild(tr); + for ( var j = 0; j < param.cols; ++j ) + { + var td = doc.createElement("td"); + // @todo : check if this line doesnt stop us to use pixel width in cells + if (cellwidth && i===0) + { + td.style.width = cellwidth + "%"; + } + if (param.border) + { + td.style.border = param.border + 'px ' + param.border_style.value + ' ' + param.border_color; + } + tr.appendChild(td); + // Browsers like to see something inside the cell ( ). + td.appendChild(doc.createTextNode('\u00a0')); + } + } + // insert the table + editor.insertNodeAtSelection(table); +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InternetExplorer/InternetExplorer.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InternetExplorer/InternetExplorer.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/InternetExplorer/InternetExplorer.js 3 Jan 2016 20:47:13 -0000 1.1.2.1 @@ -0,0 +1,935 @@ + + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- Xinha (is not htmlArea) - http://xinha.gogo.co.nz/ + -- + -- Use of Xinha is granted by the terms of the htmlArea License (based on + -- BSD license) please read license.txt in this package for details. + -- + -- Xinha was originally based on work by Mihai Bazon which is: + -- Copyright (c) 2003-2004 dynarch.com. + -- Copyright (c) 2002-2003 interactivetools.com, inc. + -- This copyright notice MUST stay intact for use. + -- + -- This is the Internet Explorer compatability plugin, part of the + -- Xinha core. + -- + -- The file is loaded as a special plugin by the Xinha Core when + -- Xinha is being run under an Internet Explorer based browser. + -- + -- It provides implementation and specialisation for various methods + -- in the core where different approaches per browser are required. + -- + -- Design Notes:: + -- Most methods here will simply be overriding Xinha.prototype. + -- and should be called that, but methods specific to IE should + -- be a part of the InternetExplorer.prototype, we won't trample on + -- namespace that way. + -- + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/modules/InternetExplorer/InternetExplorer.js $ + -- $LastChangedDate: 2010-05-12 00:31:04 +1200 (Wed, 12 May 2010) $ + -- $LastChangedRevision: 1260 $ + -- $LastChangedBy: gogo $ + --------------------------------------------------------------------------*/ + +InternetExplorer._pluginInfo = { + name : "Internet Explorer", + origin : "Xinha Core", + version : "$LastChangedRevision: 1260 $".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), + developer : "The Xinha Core Developer Team", + developer_url : "$HeadURL: http://svn.xinha.webfactional.com/trunk/modules/InternetExplorer/InternetExplorer.js $".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), + sponsor : "", + sponsor_url : "", + license : "htmlArea" +}; + +function InternetExplorer(editor) { + this.editor = editor; + editor.InternetExplorer = this; // So we can do my_editor.InternetExplorer.doSomethingIESpecific(); +} + +/** Allow Internet Explorer to handle some key events in a special way. + */ + +InternetExplorer.prototype.onKeyPress = function(ev) +{ + // Shortcuts + if(this.editor.isShortCut(ev)) + { + switch(this.editor.getKey(ev).toLowerCase()) + { + case 'n': + { + this.editor.execCommand('formatblock', false, '

'); + Xinha._stopEvent(ev); + return true; + } + break; + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + { + this.editor.execCommand('formatblock', false, ''); + Xinha._stopEvent(ev); + return true; + } + break; + } + } + + switch(ev.keyCode) + { + case 8: // KEY backspace + case 46: // KEY delete + { + if(this.handleBackspace()) + { + Xinha._stopEvent(ev); + return true; + } + } + break; + + case 9: // KEY tab, see ticket #1121 + { + Xinha._stopEvent(ev); + return true; + } + + } + + return false; +} + +/** When backspace is hit, the IE onKeyPress will execute this method. + * It preserves links when you backspace over them and apparently + * deletes control elements (tables, images, form fields) in a better + * way. + * + * @returns true|false True when backspace has been handled specially + * false otherwise (should pass through). + */ + +InternetExplorer.prototype.handleBackspace = function() +{ + var editor = this.editor; + var sel = editor.getSelection(); + if ( sel.type == 'Control' ) + { + var elm = editor.activeElement(sel); + Xinha.removeFromParent(elm); + return true; + } + + // This bit of code preseves links when you backspace over the + // endpoint of the link in IE. Without it, if you have something like + // link_here | + // where | is the cursor, and backspace over the last e, then the link + // will de-link, which is a bit tedious + var range = editor.createRange(sel); + var r2 = range.duplicate(); + r2.moveStart("character", -1); + var a = r2.parentElement(); + // @fixme: why using again a regex to test a single string ??? + if ( a != range.parentElement() && ( /^a$/i.test(a.tagName) ) ) + { + r2.collapse(true); + r2.moveEnd("character", 1); + r2.pasteHTML(''); + r2.select(); + return true; + } +}; + +InternetExplorer.prototype.inwardHtml = function(html) +{ + // Both IE and Gecko use strike internally instead of del (#523) + // Xinha will present del externally (see Xinha.prototype.outwardHtml + html = html.replace(/<(\/?)del(\s|>|\/)/ig, "<$1strike$2"); + // ie eats scripts and comments at beginning of page, so + // make sure there is something before the first script on the page + html = html.replace(/(]+id="__InsertSpan_Workaround_[a-z]+".*?>([\s\S]*?)<\/span>/i,"$1"); + + return html; +} + +InternetExplorer.prototype.outwardHtml = function(html) +{ + // remove space added before first script on the page + html = html.replace(/ (\s*)(]+id="__InsertSpan_Workaround_[a-z]+".*?>([\s\S]*?)<\/span>/i,"$1"); + + return html; +} + +InternetExplorer.prototype.onExecCommand = function(cmdID, UI, param) +{ + switch(cmdID) + { + // #645 IE only saves the initial content of the iframe, so we create a temporary iframe with the current editor contents + case 'saveas': + var doc = null; + var editor = this.editor; + var iframe = document.createElement("iframe"); + iframe.src = "about:blank"; + iframe.style.display = 'none'; + document.body.appendChild(iframe); + try + { + if ( iframe.contentDocument ) + { + doc = iframe.contentDocument; + } + else + { + doc = iframe.contentWindow.document; + } + } + catch(ex) + { + //hope there's no exception + } + + doc.open("text/html","replace"); + var html = ''; + if ( editor.config.browserQuirksMode === false ) + { + var doctype = ''; + } + else if ( editor.config.browserQuirksMode === true ) + { + var doctype = ''; + } + else + { + var doctype = Xinha.getDoctype(document); + } + if ( !editor.config.fullPage ) + { + html += doctype + "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + if ( typeof editor.config.baseHref != 'undefined' && editor.config.baseHref !== null ) + { + html += "\n"; + } + + if ( typeof editor.config.pageStyleSheets !== 'undefined' ) + { + for ( var i = 0; i < editor.config.pageStyleSheets.length; i++ ) + { + if ( editor.config.pageStyleSheets[i].length > 0 ) + { + html += ""; + //html += "\n"; + } + } + } + + if ( editor.config.pageStyle ) + { + html += ""; + } + + html += "\n"; + html += "\n"; + html += editor.getEditorContent(); + html += "\n"; + html += ""; + } + else + { + html = editor.getEditorContent(); + if ( html.match(Xinha.RE_doctype) ) + { + editor.setDoctype(RegExp.$1); + } + } + doc.write(html); + doc.close(); + doc.execCommand(cmdID, UI, param); + document.body.removeChild(iframe); + return true; + break; + case 'removeformat': + var editor = this.editor; + var sel = editor.getSelection(); + var selSave = editor.saveSelection(sel); + + var i, el, els; + + function clean (el) + { + if (el.nodeType != 1) return; + el.removeAttribute('style'); + for (var j=0; jText Node

Text in Block

+ // ^ + // The problem occurs when the cursor is after the 'e' in Node. + + var solution = this.config.selectWorkaround || 'VisibleCue'; + switch (solution) + { + case 'SimulateClick': + // Try to get the bounding box of the selection and then simulate a + // mouse click in the upper right corner to return the cursor to the + // correct location. + + // No code yet, fall through to InsertSpan + case 'InsertSpan': + // This workaround inserts an empty span element so that we are no + // longer trying to select a text node, + var parentDoc = findDoc(savedParentElement); + + // A function used to generate a unique ID for our temporary span. + var randLetters = function(count) + { + // Build a list of 26 letters. + var Letters = ''; + for (var index = 0; index<26; ++index) + { + Letters += String.fromCharCode('a'.charCodeAt(0) + index); + } + + var result = ''; + for (var index=0; index'); + var tempSpan = parentDoc.getElementById(tempId); + savedSelection.moveToElementText(tempSpan); + savedSelection.select(); + break; + case 'JustificationHack': + // Setting the justification on an element causes IE to alter the + // markup so that the selection we want to make is possible. + // Unfortunately, this can force block elements to be kicked out of + // their containing element, so it is not recommended. + + // Set a non-valid character and use it to anchor our selection. + var magicString = String.fromCharCode(1); + savedSelection.pasteHTML(magicString); + savedSelection.findText(magicString,-1); + savedSelection.select(); + + // I don't know how to find out if there's an existing justification on + // this element. Hopefully, you're doing all of your styling outside, + // so I'll just clear. I already told you this was a hack. + savedSelection.execCommand('JustifyNone'); + savedSelection.pasteHTML(''); + break; + case 'VisibleCue': + default: + // This method will insert a little box character to hold our selection + // in the desired spot. We're depending on the user to see this ugly + // box and delete it themselves. + var magicString = String.fromCharCode(1); + savedSelection.pasteHTML(magicString); + savedSelection.findText(magicString,-1); + savedSelection.select(); + } + } +} + +/** + * Selects the contents of the given node. If the node is a "control" type element, (image, form input, table) + * the node itself is selected for manipulation. + * + * @param node DomNode + * @param collapseToStart A boolean that, when supplied, says to collapse the selection. True collapses to the start, and false to the end. + */ + +Xinha.prototype.selectNodeContents = function(node, collapseToStart) +{ + this.focusEditor(); + this.forceRedraw(); + var range; + var collapsed = typeof collapseToStart == "undefined" ? true : false; + // Tables and Images get selected as "objects" rather than the text contents + if ( collapsed && node.tagName && node.tagName.toLowerCase().match(/table|img|input|select|textarea/) ) + { + range = this._doc.body.createControlRange(); + range.add(node); + } + else + { + range = this._doc.body.createTextRange(); + if (3 == node.nodeType) + { + // Special handling for text nodes, since moveToElementText fails when + // attempting to select a text node + + // Since the TextRange has a quite limited API, our strategy here is to + // select (where possible) neighboring nodes, and then move our ranges + // endpoints to be just inside of neighboring selections. + if (node.parentNode) + { + range.moveToElementText(node.parentNode); + } else + { + range.moveToElementText(this._doc.body); + } + var trimmingRange = this._doc.body.createTextRange(); + + // In rare situations (mostly html that's been monkeyed about with by + // javascript, but that's what we're doing) there can be two adjacent + // text nodes. Since we won't be able to handle these, we'll have to + // hack an offset by 'move'ing the number of characters they contain. + var texthackOffset = 0; + var borderElement=node.previousSibling; + for (; borderElement && (1 != borderElement.nodeType); borderElement = borderElement.previousSibling) + { + if (3 == borderElement.nodeType) + { + // IE doesn't count '\r' as a character, so we have to adjust the offset. + texthackOffset += borderElement.nodeValue.length-borderElement.nodeValue.split('\r').length-1; + } + } + if (borderElement && (1 == borderElement.nodeType)) + { + trimmingRange.moveToElementText(borderElement); + range.setEndPoint('StartToEnd', trimmingRange); + } + if (texthackOffset) + { + // We now need to move the selection forward the number of characters + // in all text nodes in between our text node and our ranges starting + // border. + range.moveStart('character',texthackOffset); + } + + // Youpi! Now we get to repeat this trimming on the right side. + texthackOffset = 0; + borderElement=node.nextSibling; + for (; borderElement && (1 != borderElement.nodeType); borderElement = borderElement.nextSibling) + { + if (3 == borderElement.nodeType) + { + // IE doesn't count '\r' as a character, so we have to adjust the offset. + texthackOffset += borderElement.nodeValue.length-borderElement.nodeValue.split('\r').length-1; + if (!borderElement.nextSibling) + { + // When a text node is the last child, IE adds an extra selection + // "placeholder" for the newline character. We need to adjust for + // this character as well. + texthackOffset += 1; + } + } + } + if (borderElement && (1 == borderElement.nodeType)) + { + trimmingRange.moveToElementText(borderElement); + range.setEndPoint('EndToStart', trimmingRange); + } + if (texthackOffset) + { + // We now need to move the selection backward the number of characters + // in all text nodes in between our text node and our ranges ending + // border. + range.moveEnd('character',-texthackOffset); + } + if (!node.nextSibling) + { + // Above we performed a slight adjustment to the offset if the text + // node contains a selectable "newline". We need to do the same if the + // node we are trying to select contains a newline. + range.moveEnd('character',-1); + } + } + else + { + range.moveToElementText(node); + } + } + if (typeof collapseToStart != "undefined") + { + range.collapse(collapseToStart); + if (!collapseToStart) + { + range.moveStart('character',-1); + range.moveEnd('character',-1); + } + } + range.select(); +}; + +/** Insert HTML at the current position, deleting the selection if any. + * + * @param html string + */ + +Xinha.prototype.insertHTML = function(html) +{ + this.focusEditor(); + var sel = this.getSelection(); + var range = this.createRange(sel); + range.pasteHTML(html); +}; + + +/** Get the HTML of the current selection. HTML returned has not been passed through outwardHTML. + * + * @returns string + */ + +Xinha.prototype.getSelectedHTML = function() +{ + var sel = this.getSelection(); + if (this.selectionEmpty(sel)) return ''; + var range = this.createRange(sel); + + // Need to be careful of control ranges which won't have htmlText + if( range.htmlText ) + { + return range.htmlText; + } + else if(range.length >= 1) + { + return range.item(0).outerHTML; + } + + return ''; +}; + +/** Get a Selection object of the current selection. Note that selection objects are browser specific. + * + * @returns Selection + */ + +Xinha.prototype.getSelection = function() +{ + return this._doc.selection; +}; + +/** Create a Range object from the given selection. Note that range objects are browser specific. + * + * @param sel Selection object (see getSelection) + * @returns Range + */ + +Xinha.prototype.createRange = function(sel) +{ + if (!sel) sel = this.getSelection(); + + // ticket:1508 - when you do a key event within a + // absolute position div, in IE, the toolbar update + // for formatblock etc causes a getParentElement() (above) + // which produces a "None" select, then if we focusEditor() it + // defocuses the absolute div and focuses into the iframe outside of the + // div somewhere. + // + // Removing this is probably a workaround and maybe it breaks something else + // focusEditor is used in a number of spots, I woudl have thought it should + // do nothing if the editor is already focused. + // + // if(sel.type == 'None') this.focusEditor(); + + return sel.createRange(); +}; + +/** Determine if the given event object is a keydown/press event. + * + * @param event Event + * @returns true|false + */ + +Xinha.prototype.isKeyEvent = function(event) +{ + return event.type == "keydown"; +} + +/** Return the character (as a string) of a keyEvent - ie, press the 'a' key and + * this method will return 'a', press SHIFT-a and it will return 'A'. + * + * @param keyEvent + * @returns string + */ + +Xinha.prototype.getKey = function(keyEvent) +{ + return String.fromCharCode(keyEvent.keyCode); +} + + +/** Return the HTML string of the given Element, including the Element. + * + * @param element HTML Element DomNode + * @returns string + */ + +Xinha.getOuterHTML = function(element) +{ + return element.outerHTML; +}; + +// Control character for retaining edit location when switching modes +Xinha.cc = String.fromCharCode(0x2009); + +Xinha.prototype.setCC = function ( target ) +{ + var cc = Xinha.cc; + if ( target == "textarea" ) + { + var ta = this._textArea; + var pos = document.selection.createRange(); + pos.collapse(); + pos.text = cc; + var index = ta.value.indexOf( cc ); + var before = ta.value.substring( 0, index ); + var after = ta.value.substring( index + cc.length , ta.value.length ); + + if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, entities, and inside the body) + { + var tagEnd = after.indexOf(">") + 1; + ta.value = before + after.substring( 0, tagEnd ) + cc + after.substring( tagEnd, after.length ); + } + else ta.value = before + cc + after; + ta.value = ta.value.replace(new RegExp ('(&[^'+cc+']*?)('+cc+')([^'+cc+']*?;)'), "$1$3$2"); + ta.value = ta.value.replace(new RegExp ('(]*>[^'+cc+']*?)('+cc+')([^'+cc+']*?<\/script>)'), "$1$3$2"); + ta.value = ta.value.replace(new RegExp ('^([^'+cc+']*)('+cc+')([^'+cc+']*]*>)(.*?)'), "$1$3$2$4"); + } + else + { + var sel = this.getSelection(); + var r = sel.createRange(); + if ( sel.type == 'Control' ) + { + var control = r.item(0); + control.outerHTML += cc; + } + else + { + r.collapse(); + r.text = cc; + } + } +}; + +Xinha.prototype.findCC = function ( target ) +{ + var findIn = ( target == 'textarea' ) ? this._textArea : this._doc.body; + range = findIn.createTextRange(); + // in case the cursor is inside a link automatically created from a url + // the cc also appears in the url and we have to strip it out additionally + if( range.findText( escape(Xinha.cc) ) ) + { + range.select(); + range.text = ''; + range.select(); + } + if( range.findText( Xinha.cc ) ) + { + range.select(); + range.text = ''; + range.select(); + } + if ( target == 'textarea' ) this._textArea.focus(); +}; + +/** Return a doctype or empty string depending on whether the document is in Qirksmode or Standards Compliant Mode + * It's hardly possible to detect the actual doctype without unreasonable effort, so we set HTML 4.01 just to trigger the rendering mode + * + * @param doc DOM element document + * @returns string doctype || empty + */ +Xinha.getDoctype = function (doc) +{ + return (doc.compatMode == "CSS1Compat" && Xinha.ie_version < 8 ) ? '' : ''; +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/Opera/Opera.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/Opera/Opera.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/Opera/Opera.js 3 Jan 2016 20:47:13 -0000 1.1.2.1 @@ -0,0 +1,902 @@ + + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- Xinha (is not htmlArea) - http://xinha.gogo.co.nz/ + -- + -- Use of Xinha is granted by the terms of the htmlArea License (based on + -- BSD license) please read license.txt in this package for details. + -- + -- Xinha was originally based on work by Mihai Bazon which is: + -- Copyright (c) 2003-2004 dynarch.com. + -- Copyright (c) 2002-2003 interactivetools.com, inc. + -- This copyright notice MUST stay intact for use. + -- + -- This is the Opera compatability plugin, part of the Xinha core. + -- + -- The file is loaded as a special plugin by the Xinha Core when + -- Xinha is being run under an Opera based browser with the Midas + -- editing API. + -- + -- It provides implementation and specialisation for various methods + -- in the core where different approaches per browser are required. + -- + -- Design Notes:: + -- Most methods here will simply be overriding Xinha.prototype. + -- and should be called that, but methods specific to Opera should + -- be a part of the Opera.prototype, we won't trample on namespace + -- that way. + -- + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/modules/Opera/Opera.js $ + -- $LastChangedDate: 2008-10-13 06:42:42 +1300 (Mon, 13 Oct 2008) $ + -- $LastChangedRevision: 1084 $ + -- $LastChangedBy: ray $ + --------------------------------------------------------------------------*/ + +Opera._pluginInfo = { + name : "Opera", + origin : "Xinha Core", + version : "$LastChangedRevision: 1084 $".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), + developer : "The Xinha Core Developer Team", + developer_url : "$HeadURL: http://svn.xinha.webfactional.com/trunk/modules/Opera/Opera.js $".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), + sponsor : "Gogo Internet Services Limited", + sponsor_url : "http://www.gogo.co.nz/", + license : "htmlArea" +}; + +function Opera(editor) { + this.editor = editor; + editor.Opera = this; +} + +/** Allow Opera to handle some key events in a special way. + */ + +Opera.prototype.onKeyPress = function(ev) +{ + var editor = this.editor; + var s = editor.getSelection(); + + // Handle shortcuts + if(editor.isShortCut(ev)) + { + switch(editor.getKey(ev).toLowerCase()) + { + case 'z': + { + if(editor._unLink && editor._unlinkOnUndo) + { + Xinha._stopEvent(ev); + editor._unLink(); + editor.updateToolbar(); + return true; + } + } + break; + + case 'a': + { + // KEY select all + sel = editor.getSelection(); + sel.removeAllRanges(); + range = editor.createRange(); + range.selectNodeContents(editor._doc.body); + sel.addRange(range); + Xinha._stopEvent(ev); + return true; + } + break; + + case 'v': + { + // If we are not using htmlareaPaste, don't let Xinha try and be fancy but let the + // event be handled normally by the browser (don't stopEvent it) + if(!editor.config.htmlareaPaste) + { + return true; + } + } + break; + } + } + + // Handle normal characters + switch(editor.getKey(ev)) + { + // Space, see if the text just typed looks like a URL, or email address + // and link it appropriatly + case ' ': + { + var autoWrap = function (textNode, tag) + { + var rightText = textNode.nextSibling; + if ( typeof tag == 'string') + { + tag = editor._doc.createElement(tag); + } + var a = textNode.parentNode.insertBefore(tag, rightText); + Xinha.removeFromParent(textNode); + a.appendChild(textNode); + rightText.data = ' ' + rightText.data; + + s.collapse(rightText, 1); + + editor._unLink = function() + { + var t = a.firstChild; + a.removeChild(t); + a.parentNode.insertBefore(t, a); + Xinha.removeFromParent(a); + editor._unLink = null; + editor._unlinkOnUndo = false; + }; + editor._unlinkOnUndo = true; + + return a; + }; + + if ( editor.config.convertUrlsToLinks && s && s.isCollapsed && s.anchorNode.nodeType == 3 && s.anchorNode.data.length > 3 && s.anchorNode.data.indexOf('.') >= 0 ) + { + var midStart = s.anchorNode.data.substring(0,s.anchorOffset).search(/\S{4,}$/); + if ( midStart == -1 ) + { + break; + } + + if ( editor._getFirstAncestor(s, 'a') ) + { + break; // already in an anchor + } + + var matchData = s.anchorNode.data.substring(0,s.anchorOffset).replace(/^.*?(\S*)$/, '$1'); + + var mEmail = matchData.match(Xinha.RE_email); + if ( mEmail ) + { + var leftTextEmail = s.anchorNode; + var rightTextEmail = leftTextEmail.splitText(s.anchorOffset); + var midTextEmail = leftTextEmail.splitText(midStart); + + autoWrap(midTextEmail, 'a').href = 'mailto:' + mEmail[0]; + break; + } + + RE_date = /([0-9]+\.)+/; //could be date or ip or something else ... + RE_ip = /(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/; + var mUrl = matchData.match(Xinha.RE_url); + if ( mUrl ) + { + if (RE_date.test(matchData)) + { + break; //ray: disabling linking of IP numbers because of general bugginess (see Ticket #1085) + /*if (!RE_ip.test(matchData)) + { + break; + }*/ + } + var leftTextUrl = s.anchorNode; + var rightTextUrl = leftTextUrl.splitText(s.anchorOffset); + var midTextUrl = leftTextUrl.splitText(midStart); + autoWrap(midTextUrl, 'a').href = (mUrl[1] ? mUrl[1] : 'http://') + mUrl[2]; + break; + } + } + } + break; + } + + // Handle special keys + switch ( ev.keyCode ) + { +/* This is now handled by a plugin + case 13: // ENTER + + break;*/ + + case 27: // ESCAPE + { + if ( editor._unLink ) + { + editor._unLink(); + Xinha._stopEvent(ev); + } + break; + } + break; + + case 8: // KEY backspace + case 46: // KEY delete + { + // We handle the mozilla backspace directly?? + if ( !ev.shiftKey && this.handleBackspace() ) + { + Xinha._stopEvent(ev); + } + } + + default: + { + editor._unlinkOnUndo = false; + + // Handle the "auto-linking", specifically this bit of code sets up a handler on + // an self-titled anchor (eg www.gogo.co.nz) + // when the text content is edited, such that it will update the href on the anchor + + if ( s.anchorNode && s.anchorNode.nodeType == 3 ) + { + // See if we might be changing a link + var a = editor._getFirstAncestor(s, 'a'); + // @todo: we probably need here to inform the setTimeout below that we not changing a link and not start another setTimeout + if ( !a ) + { + break; // not an anchor + } + + if ( !a._updateAnchTimeout ) + { + if ( s.anchorNode.data.match(Xinha.RE_email) && a.href.match('mailto:' + s.anchorNode.data.trim()) ) + { + var textNode = s.anchorNode; + var fnAnchor = function() + { + a.href = 'mailto:' + textNode.data.trim(); + // @fixme: why the hell do another timeout is started ? + // This lead to never ending timer if we dont remove this line + // But when removed, the email is not correctly updated + // + // - to fix this we should make fnAnchor check to see if textNode.data has + // stopped changing for say 5 seconds and if so we do not make this setTimeout + a._updateAnchTimeout = setTimeout(fnAnchor, 250); + }; + a._updateAnchTimeout = setTimeout(fnAnchor, 1000); + break; + } + + var m = s.anchorNode.data.match(Xinha.RE_url); + + if ( m && a.href.match(new RegExp( 'http(s)?://' + Xinha.escapeStringForRegExp( s.anchorNode.data.trim() ) ) ) ) + { + var txtNode = s.anchorNode; + var fnUrl = function() + { + // Sometimes m is undefined becase the url is not an url anymore (was www.url.com and become for example www.url) + // ray: shouldn't the link be un-linked then? + m = txtNode.data.match(Xinha.RE_url); + if(m) + { + a.href = (m[1] ? m[1] : 'http://') + m[2]; + } + + // @fixme: why the hell do another timeout is started ? + // This lead to never ending timer if we dont remove this line + // But when removed, the url is not correctly updated + // + // - to fix this we should make fnUrl check to see if textNode.data has + // stopped changing for say 5 seconds and if so we do not make this setTimeout + a._updateAnchTimeout = setTimeout(fnUrl, 250); + }; + a._updateAnchTimeout = setTimeout(fnUrl, 1000); + } + } + } + } + break; + } + + return false; // Let other plugins etc continue from here. +} + +/** When backspace is hit, the Opera onKeyPress will execute this method. + * I don't remember what the exact purpose of this is though :-( + */ + +Opera.prototype.handleBackspace = function() +{ + var editor = this.editor; + setTimeout( + function() + { + var sel = editor.getSelection(); + var range = editor.createRange(sel); + var SC = range.startContainer; + var SO = range.startOffset; + var EC = range.endContainer; + var EO = range.endOffset; + var newr = SC.nextSibling; + if ( SC.nodeType == 3 ) + { + SC = SC.parentNode; + } + if ( ! ( /\S/.test(SC.tagName) ) ) + { + var p = document.createElement("p"); + while ( SC.firstChild ) + { + p.appendChild(SC.firstChild); + } + SC.parentNode.insertBefore(p, SC); + Xinha.removeFromParent(SC); + var r = range.cloneRange(); + r.setStartBefore(newr); + r.setEndAfter(newr); + r.extractContents(); + sel.removeAllRanges(); + sel.addRange(r); + } + }, + 10); +}; + +Opera.prototype.inwardHtml = function(html) +{ + // Both IE and Opera use strike internally instead of del (#523) + // Xinha will present del externally (see Xinha.prototype.outwardHtml + html = html.replace(/<(\/?)del(\s|>|\/)/ig, "<$1strike$2"); + + return html; +} + +Opera.prototype.outwardHtml = function(html) +{ + + return html; +} + +Opera.prototype.onExecCommand = function(cmdID, UI, param) +{ + + switch(cmdID) + { + + /*case 'paste': + { + alert(Xinha._lc("The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.")); + return true; // Indicate paste is done, stop command being issued to browser by Xinha.prototype.execCommand + } + break;*/ + + case 'removeformat': + var editor = this.editor; + var sel = editor.getSelection(); + var selSave = editor.saveSelection(sel); + var range = editor.createRange(sel); + + var els = editor._doc.body.getElementsByTagName('*'); + + var start = ( range.startContainer.nodeType == 1 ) ? range.startContainer : range.startContainer.parentNode; + var i, el; + if (sel.isCollapsed) range.selectNodeContents(editor._doc.body); + + for (i=0; i sel.anchorOffset && sel.anchorNode.childNodes[sel.anchorOffset].nodeType == 1 ) + { + return sel.anchorNode.childNodes[sel.anchorOffset]; + } + else if ( sel.anchorNode.nodeType == 1 ) + { + return sel.anchorNode; + } + else + { + return null; // return sel.anchorNode.parentNode; + } + } + return null; +}; + +/** + * Determines if the given selection is empty (collapsed). + * @param selection Selection object as returned by getSelection + * @returns true|false + */ + +Xinha.prototype.selectionEmpty = function(sel) +{ + if ( !sel ) + { + return true; + } + + if ( typeof sel.isCollapsed != 'undefined' ) + { + return sel.isCollapsed; + } + + return true; +}; + +/** + * Returns a range object to be stored + * and later restored with Xinha.prototype.restoreSelection() + * + * @returns Range + */ +Xinha.prototype.saveSelection = function() +{ + return this.createRange(this.getSelection()).cloneRange(); +} +/** + * Restores a selection previously stored + * @param savedSelection Range object as returned by Xinha.prototype.restoreSelection() + */ +Xinha.prototype.restoreSelection = function(savedSelection) +{ + var sel = this.getSelection(); + sel.removeAllRanges(); + sel.addRange(savedSelection); +} +/** + * Selects the contents of the given node. If the node is a "control" type element, (image, form input, table) + * the node itself is selected for manipulation. + * + * @param node DomNode + * @param collapseToStart A boolean that, when supplied, says to collapse the selection. True collapses to the start, and false to the end. + */ + +Xinha.prototype.selectNodeContents = function(node, collapseToStart) +{ + this.focusEditor(); + this.forceRedraw(); + var range; + var collapsed = typeof collapseToStart == "undefined" ? true : false; + var sel = this.getSelection(); + range = this._doc.createRange(); + // Tables and Images get selected as "objects" rather than the text contents + if ( collapsed && node.tagName && node.tagName.toLowerCase().match(/table|img|input|textarea|select/) ) + { + range.selectNode(node); + } + else + { + range.selectNodeContents(node); + } + sel.removeAllRanges(); + sel.addRange(range); + if (typeof collapseToStart != "undefined") + { + if (collapseToStart) + { + sel.collapse(range.startContainer, range.startOffset); + } else + { + sel.collapse(range.endContainer, range.endOffset); + } + } +}; + +/** Insert HTML at the current position, deleting the selection if any. + * + * @param html string + */ + +Xinha.prototype.insertHTML = function(html) +{ + var sel = this.getSelection(); + var range = this.createRange(sel); + this.focusEditor(); + // construct a new document fragment with the given HTML + var fragment = this._doc.createDocumentFragment(); + var div = this._doc.createElement("div"); + div.innerHTML = html; + while ( div.firstChild ) + { + // the following call also removes the node from div + fragment.appendChild(div.firstChild); + } + // this also removes the selection + var node = this.insertNodeAtSelection(fragment); +}; + +/** Get the HTML of the current selection. HTML returned has not been passed through outwardHTML. + * + * @returns string + */ + +Xinha.prototype.getSelectedHTML = function() +{ + var sel = this.getSelection(); + if (sel.isCollapsed) return ''; + var range = this.createRange(sel); + return Xinha.getHTML(range.cloneContents(), false, this); +}; + + +/** Get a Selection object of the current selection. Note that selection objects are browser specific. + * + * @returns Selection + */ + +Xinha.prototype.getSelection = function() +{ + var sel = this._iframe.contentWindow.getSelection(); + if(sel && sel.focusNode && sel.focusNode.tagName && sel.focusNode.tagName == 'HTML') + { // Bad news batman, this selection is wonky + var bod = this._doc.getElementsByTagName('body')[0]; + var rng = this.createRange(); + rng.selectNodeContents(bod); + sel.removeAllRanges(); + sel.addRange(rng); + sel.collapseToEnd(); + } + return sel; +}; + +/** Create a Range object from the given selection. Note that range objects are browser specific. + * + * @param sel Selection object (see getSelection) + * @returns Range + */ + +Xinha.prototype.createRange = function(sel) +{ + this.activateEditor(); + if ( typeof sel != "undefined" ) + { + try + { + return sel.getRangeAt(0); + } + catch(ex) + { + return this._doc.createRange(); + } + } + else + { + return this._doc.createRange(); + } +}; + +/** Determine if the given event object is a keydown/press event. + * + * @param event Event + * @returns true|false + */ + +Xinha.prototype.isKeyEvent = function(event) +{ + return event.type == "keypress"; +} + +/** Return the character (as a string) of a keyEvent - ie, press the 'a' key and + * this method will return 'a', press SHIFT-a and it will return 'A'. + * + * @param keyEvent + * @returns string + */ + +Xinha.prototype.getKey = function(keyEvent) +{ + return String.fromCharCode(keyEvent.charCode); +} + +/** Return the HTML string of the given Element, including the Element. + * + * @param element HTML Element DomNode + * @returns string + */ + +Xinha.getOuterHTML = function(element) +{ + return (new XMLSerializer()).serializeToString(element); +}; + + +/* Caret position remembering when switch between text and html mode. + * Largely this is the same as for Gecko except: + * + * Opera does not have window.find() so we use instead an element with known + * id (MARK) so that we can + * do _doc.getElementById() on it. + * + * Opera for some reason will not set the insert point (flashing caret) + * anyway though, in theory, the iframe is focused (in findCC below) and then + * the selection (containing the span above) is collapsed, it should show + * caret. I don't know why not. Seems to require user to actually + * click to get the caret to show (or type anything without it acting wierd)? + * Very annoying. + * + */ +Xinha.cc = String.fromCharCode(8286); +Xinha.prototype.setCC = function ( target ) +{ + // Do a two step caret insertion, first a single char, then we'll replace that with the + // id'd span. + var cc = Xinha.cc; + + try + { + if ( target == "textarea" ) + { + var ta = this._textArea; + var index = ta.selectionStart; + var before = ta.value.substring( 0, index ) + var after = ta.value.substring( index, ta.value.length ); + + if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, entities, and inside the body) + { + var tagEnd = after.indexOf(">") + 1; + ta.value = before + after.substring( 0, tagEnd ) + cc + after.substring( tagEnd, after.length ); + } + else ta.value = before + cc + after; + ta.value = ta.value.replace(new RegExp ('(&[^'+cc+']*?)('+cc+')([^'+cc+']*?;)'), "$1$3$2"); + ta.value = ta.value.replace(new RegExp ('(]*>[^'+cc+']*?)('+cc+')([^'+cc+']*?<\/script>)'), "$1$3$2"); + ta.value = ta.value.replace(new RegExp ('^([^'+cc+']*)('+cc+')([^'+cc+']*]*>)(.*?)'), "$1$3$2$4"); + + ta.value = ta.value.replace(cc, 'MARK'); + } + else + { + var sel = this.getSelection(); + + var mark = this._doc.createElement('span'); + mark.id = 'XinhaOperaCaretMarker'; + sel.getRangeAt(0).insertNode( mark ); + + } + } catch (e) {} +}; + +Xinha.prototype.findCC = function ( target ) +{ + if ( target == 'textarea' ) + { + var ta = this._textArea; + var pos = ta.value.search( /(((\s|(MARK))*<\/span>)?)/ ); + if ( pos == -1 ) return; + var cc = RegExp.$1; + var end = pos + cc.length; + var before = ta.value.substring( 0, pos ); + var after = ta.value.substring( end, ta.value.length ); + ta.value = before ; + + ta.scrollTop = ta.scrollHeight; + var scrollPos = ta.scrollTop; + + ta.value += after; + ta.setSelectionRange(pos,pos); + + ta.focus(); + + ta.scrollTop = scrollPos; + + } + else + { + var marker = this._doc.getElementById('XinhaOperaCaretMarker'); + if(marker) + { + this.focusEditor();// this._iframe.contentWindow.focus(); + + var rng = this.createRange(); + rng.selectNode(marker); + + var sel = this.getSelection(); + sel.addRange(rng); + sel.collapseToStart(); + + this.scrollToElement(marker); + + marker.parentNode.removeChild(marker); + return; + } + } +}; + +/*--------------------------------------------------------------------------*/ +/*------------ EXTEND SOME STANDARD "Xinha.prototype" METHODS --------------*/ +/*--------------------------------------------------------------------------*/ + +/* +Xinha.prototype._standardToggleBorders = Xinha.prototype._toggleBorders; +Xinha.prototype._toggleBorders = function() +{ + var result = this._standardToggleBorders(); + + // flashing the display forces moz to listen (JB:18-04-2005) - #102 + var tables = this._doc.getElementsByTagName('TABLE'); + for(var i = 0; i < tables.length; i++) + { + tables[i].style.display="none"; + tables[i].style.display="table"; + } + + return result; +}; +*/ + +/** Return the doctype of a document, if set + * + * @param doc DOM element document + * @returns string the actual doctype + */ +Xinha.getDoctype = function (doc) +{ + var d = ''; + if (doc.doctype) + { + d += '"; + } + return d; +}; + +Xinha.prototype._standardInitIframe = Xinha.prototype.initIframe; +Xinha.prototype.initIframe = function() +{ + if(!this._iframeLoadDone) + { + if(this._iframe.contentWindow && this._iframe.contentWindow.xinhaReadyToRoll) + { + this._iframeLoadDone = true; + this._standardInitIframe(); + } + else + { + // Timeout a little (Opera is a bit dodgy about using an event) + var editor = this; + setTimeout( function() { editor.initIframe() }, 5); + } + } +} + +// For some reason, Opera doesn't listen to addEventListener for at least select elements with event = change +// so we will have to intercept those and use a Dom0 event, these are used eg for the fontname/size/format +// dropdowns in the toolbar +Xinha._addEventOperaOrig = Xinha._addEvent; +Xinha._addEvent = function(el, evname, func) +{ + if(el.tagName && el.tagName.toLowerCase() == 'select' && evname == 'change') + { + return Xinha.addDom0Event(el,evname,func); + } + + return Xinha._addEventOperaOrig(el,evname,func); +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/WebKit/WebKit.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/WebKit/WebKit.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/modules/WebKit/WebKit.js 3 Jan 2016 20:47:14 -0000 1.1.2.1 @@ -0,0 +1,834 @@ + + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- Xinha (is not htmlArea) - http://xinha.gogo.co.nz/ + -- + -- Use of Xinha is granted by the terms of the htmlArea License (based on + -- BSD license) please read license.txt in this package for details. + -- + -- Xinha was originally based on work by Mihai Bazon which is: + -- Copyright (c) 2003-2004 dynarch.com. + -- Copyright (c) 2002-2003 interactivetools.com, inc. + -- This copyright notice MUST stay intact for use. + -- + -- This is the WebKit (Safari) compatability plugin, part of the Xinha core. + -- + -- The file is loaded as a special plugin by the Xinha Core when + -- Xinha is being run under a Webkit based browser such as Safari + -- + -- It provides implementation and specialisation for various methods + -- in the core where different approaches per browser are required. + -- + -- Design Notes:: + -- Most methods here will simply be overriding Xinha.prototype. + -- and should be called that, but methods specific to Webkit should + -- be a part of the WebKit.prototype, we won't trample on namespace + -- that way. + -- + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/modules/WebKit/WebKit.js $ + -- $LastChangedDate: 2008-12-31 08:18:54 +1300 (Wed, 31 Dec 2008) $ + -- $LastChangedRevision: 1146 $ + -- $LastChangedBy: nicholasbs $ + --------------------------------------------------------------------------*/ + +WebKit._pluginInfo = { + name : "WebKit", + origin : "Xinha Core", + version : "$LastChangedRevision: 1146 $".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), + developer : "The Xinha Core Developer Team", + developer_url : "$HeadURL: http://svn.xinha.webfactional.com/trunk/modules/WebKit/WebKit.js $".replace(/^[^:]*:\s*(.*)\s*\$$/, '$1'), + sponsor : "", + sponsor_url : "", + license : "htmlArea" +}; + +function WebKit(editor) { + this.editor = editor; + editor.WebKit = this; +} + +/** Allow Webkit to handle some key events in a special way. + */ + +WebKit.prototype.onKeyPress = function(ev) +{ + var editor = this.editor; + var s = editor.getSelection(); + + // Handle shortcuts + if(editor.isShortCut(ev)) + { + switch(editor.getKey(ev).toLowerCase()) + { + case 'z': + if(editor._unLink && editor._unlinkOnUndo) + { + Xinha._stopEvent(ev); + editor._unLink(); + editor.updateToolbar(); + return true; + } + break; + + case 'a': + // ctrl-a selects all, but + break; + + case 'v': + // If we are not using htmlareaPaste, don't let Xinha try and be fancy but let the + // event be handled normally by the browser (don't stopEvent it) + if(!editor.config.htmlareaPaste) + { + return true; + } + break; + } + } + + // Handle normal characters + switch(editor.getKey(ev)) + { + // Space, see if the text just typed looks like a URL, or email address + // and link it appropriatly + case ' ': + var autoWrap = function (textNode, tag) + { + var rightText = textNode.nextSibling; + if ( typeof tag == 'string') + { + tag = editor._doc.createElement(tag); + } + var a = textNode.parentNode.insertBefore(tag, rightText); + Xinha.removeFromParent(textNode); + a.appendChild(textNode); + rightText.data = ' ' + rightText.data; + + s.collapse(rightText, 1); + + editor._unLink = function() + { + var t = a.firstChild; + a.removeChild(t); + a.parentNode.insertBefore(t, a); + Xinha.removeFromParent(a); + editor._unLink = null; + editor._unlinkOnUndo = false; + }; + editor._unlinkOnUndo = true; + + return a; + }; + + if ( editor.config.convertUrlsToLinks && s && s.isCollapsed && s.anchorNode.nodeType == 3 && s.anchorNode.data.length > 3 && s.anchorNode.data.indexOf('.') >= 0 ) + { + var midStart = s.anchorNode.data.substring(0,s.anchorOffset).search(/\S{4,}$/); + if ( midStart == -1 ) + { + break; + } + + if ( editor._getFirstAncestor(s, 'a') ) + { + break; // already in an anchor + } + + var matchData = s.anchorNode.data.substring(0,s.anchorOffset).replace(/^.*?(\S*)$/, '$1'); + + var mEmail = matchData.match(Xinha.RE_email); + if ( mEmail ) + { + var leftTextEmail = s.anchorNode; + var rightTextEmail = leftTextEmail.splitText(s.anchorOffset); + var midTextEmail = leftTextEmail.splitText(midStart); + + autoWrap(midTextEmail, 'a').href = 'mailto:' + mEmail[0]; + break; + } + + RE_date = /([0-9]+\.)+/; //could be date or ip or something else ... + RE_ip = /(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/; + var mUrl = matchData.match(Xinha.RE_url); + if ( mUrl ) + { + if (RE_date.test(matchData)) + { + break; //ray: disabling linking of IP numbers because of general bugginess (see Ticket #1085) + /*if (!RE_ip.test(matchData)) + { + break; + }*/ + } + var leftTextUrl = s.anchorNode; + var rightTextUrl = leftTextUrl.splitText(s.anchorOffset); + var midTextUrl = leftTextUrl.splitText(midStart); + autoWrap(midTextUrl, 'a').href = (mUrl[1] ? mUrl[1] : 'http://') + mUrl[2]; + break; + } + } + break; + } + + // Handle special keys + switch ( ev.keyCode ) + { + case 13: // ENTER + if( ev.shiftKey ) + { + //TODO: here we need to add insert new line + } + break; + + case 27: // ESCAPE + if ( editor._unLink ) + { + editor._unLink(); + Xinha._stopEvent(ev); + } + + break; + + case 8: // KEY backspace + case 46: // KEY delete + // We handle the mozilla backspace directly?? + if ( !ev.shiftKey && this.handleBackspace() ) + { + Xinha._stopEvent(ev); + } + break; + default: + editor._unlinkOnUndo = false; + + // Handle the "auto-linking", specifically this bit of code sets up a handler on + // an self-titled anchor (eg www.gogo.co.nz) + // when the text content is edited, such that it will update the href on the anchor + + if ( s.anchorNode && s.anchorNode.nodeType == 3 ) + { + // See if we might be changing a link + var a = editor._getFirstAncestor(s, 'a'); + // @todo: we probably need here to inform the setTimeout below that we not changing a link and not start another setTimeout + if ( !a ) + { + break; // not an anchor + } + + if ( !a._updateAnchTimeout ) + { + if ( s.anchorNode.data.match(Xinha.RE_email) && a.href.match('mailto:' + s.anchorNode.data.trim()) ) + { + var textNode = s.anchorNode; + var fnAnchor = function() + { + a.href = 'mailto:' + textNode.data.trim(); + // @fixme: why the hell do another timeout is started ? + // This lead to never ending timer if we dont remove this line + // But when removed, the email is not correctly updated + // + // - to fix this we should make fnAnchor check to see if textNode.data has + // stopped changing for say 5 seconds and if so we do not make this setTimeout + a._updateAnchTimeout = setTimeout(fnAnchor, 250); + }; + a._updateAnchTimeout = setTimeout(fnAnchor, 1000); + break; + } + + var m = s.anchorNode.data.match(Xinha.RE_url); + + if ( m && a.href.match(new RegExp( 'http(s)?://' + Xinha.escapeStringForRegExp( s.anchorNode.data.trim() ) ) ) ) + { + var txtNode = s.anchorNode; + var fnUrl = function() + { + // Sometimes m is undefined becase the url is not an url anymore (was www.url.com and become for example www.url) + // ray: shouldn't the link be un-linked then? + m = txtNode.data.match(Xinha.RE_url); + if(m) + { + a.href = (m[1] ? m[1] : 'http://') + m[2]; + } + + // @fixme: why the hell do another timeout is started ? + // This lead to never ending timer if we dont remove this line + // But when removed, the url is not correctly updated + // + // - to fix this we should make fnUrl check to see if textNode.data has + // stopped changing for say 5 seconds and if so we do not make this setTimeout + a._updateAnchTimeout = setTimeout(fnUrl, 250); + }; + a._updateAnchTimeout = setTimeout(fnUrl, 1000); + } + } + } + break; + } + + return false; // Let other plugins etc continue from here. +} + +/** When backspace is hit, the Gecko onKeyPress will execute this method. + * I don't remember what the exact purpose of this is though :-( + * + */ + +WebKit.prototype.handleBackspace = function() +{ + var editor = this.editor; + setTimeout( + function() + { + var sel = editor.getSelection(); + var range = editor.createRange(sel); + var SC = range.startContainer; + var SO = range.startOffset; + var EC = range.endContainer; + var EO = range.endOffset; + var newr = SC.nextSibling; + if ( SC.nodeType == 3 ) + { + SC = SC.parentNode; + } + if ( ! ( /\S/.test(SC.tagName) ) ) + { + var p = document.createElement("p"); + while ( SC.firstChild ) + { + p.appendChild(SC.firstChild); + } + SC.parentNode.insertBefore(p, SC); + Xinha.removeFromParent(SC); + var r = range.cloneRange(); + r.setStartBefore(newr); + r.setEndAfter(newr); + r.extractContents(); + sel.removeAllRanges(); + sel.addRange(r); + } + }, + 10); +}; + +WebKit.prototype.inwardHtml = function(html) +{ + return html; +} + +WebKit.prototype.outwardHtml = function(html) +{ + return html; +} + +WebKit.prototype.onExecCommand = function(cmdID, UI, param) +{ + this.editor._doc.execCommand('styleWithCSS', false, false); //switch styleWithCSS off; seems to make no difference though + + switch(cmdID) + { + case 'paste': + alert(Xinha._lc("The Paste button does not work in the Safari browser for security reasons. Press CTRL-V on your keyboard to paste directly.")); + return true; // Indicate paste is done, stop command being issued to browser by Xinha.prototype.execCommand + break; + case 'removeformat': + var editor = this.editor; + var sel = editor.getSelection(); + var selSave = editor.saveSelection(sel); + var range = editor.createRange(sel); + + var els = editor._doc.getElementsByTagName('*'); + els = Xinha.collectionToArray(els); + var start = ( range.startContainer.nodeType == 1 ) ? range.startContainer : range.startContainer.parentNode; + var i,el,newNode, fragment, child,r2 = editor._doc.createRange(); + + function clean (el) + { + if (el.nodeType != 1) return; + el.removeAttribute('style'); + for (var j=0; j sel.anchorOffset && sel.anchorNode.childNodes[sel.anchorOffset].nodeType == 1 ) + { + return sel.anchorNode.childNodes[sel.anchorOffset]; + } + else if ( sel.anchorNode.nodeType == 1 ) + { + return sel.anchorNode; + } + else + { + return null; // return sel.anchorNode.parentNode; + } + } + return null; +}; + +/** + * Determines if the given selection is empty (collapsed). + * @param selection Selection object as returned by getSelection + * @returns true|false + */ + +Xinha.prototype.selectionEmpty = function(sel) +{ + if ( !sel ) + { + return true; + } + + if ( typeof sel.isCollapsed != 'undefined' ) + { + return sel.isCollapsed; + } + + return true; +}; + +/** + * Returns a range object to be stored + * and later restored with Xinha.prototype.restoreSelection() + * + * @returns Range + */ +Xinha.prototype.saveSelection = function() +{ + return this.createRange(this.getSelection()).cloneRange(); +} +/** + * Restores a selection previously stored + * @param savedSelection Range object as returned by Xinha.prototype.restoreSelection() + */ +Xinha.prototype.restoreSelection = function(savedSelection) +{ + var sel = this.getSelection(); + sel.removeAllRanges(); + sel.addRange(savedSelection); +} +/** + * Selects the contents of the given node. If the node is a "control" type element, (image, form input, table) + * the node itself is selected for manipulation. + * + * @param node DomNode + * @param collapseToStart A boolean that, when supplied, says to collapse the selection. True collapses to the start, and false to the end. + */ + +Xinha.prototype.selectNodeContents = function(node, collapseToStart) +{ + this.focusEditor(); + this.forceRedraw(); + var range; + var collapsed = typeof collapseToStart == "undefined" ? true : false; + var sel = this.getSelection(); + range = this._doc.createRange(); + // Tables and Images get selected as "objects" rather than the text contents + if ( collapsed && node.tagName && node.tagName.toLowerCase().match(/table|img|input|textarea|select/) ) + { + range.selectNode(node); + } + else + { + range.selectNodeContents(node); + } + sel.removeAllRanges(); + sel.addRange(range); + if (typeof collapseToStart != "undefined") + { + if (collapseToStart) + { + sel.collapse(range.startContainer, range.startOffset); + } else + { + sel.collapse(range.endContainer, range.endOffset); + } + } +}; + +/** Insert HTML at the current position, deleting the selection if any. + * + * @param html string + */ + +Xinha.prototype.insertHTML = function(html) +{ + var sel = this.getSelection(); + var range = this.createRange(sel); + this.focusEditor(); + // construct a new document fragment with the given HTML + var fragment = this._doc.createDocumentFragment(); + var div = this._doc.createElement("div"); + div.innerHTML = html; + while ( div.firstChild ) + { + // the following call also removes the node from div + fragment.appendChild(div.firstChild); + } + // this also removes the selection + var node = this.insertNodeAtSelection(fragment); +}; + +/** Get the HTML of the current selection. HTML returned has not been passed through outwardHTML. + * + * @returns string + */ + +Xinha.prototype.getSelectedHTML = function() +{ + var sel = this.getSelection(); + if (sel.isCollapsed) return ''; + var range = this.createRange(sel); + + if ( range ) + { + return Xinha.getHTML(range.cloneContents(), false, this); + } + else return ''; +}; + + +/** Get a Selection object of the current selection. Note that selection objects are browser specific. + * + * @returns Selection + */ + +Xinha.prototype.getSelection = function() +{ + return this._iframe.contentWindow.getSelection(); +}; + +/** Create a Range object from the given selection. Note that range objects are browser specific. + * + * @param sel Selection object (see getSelection) + * @returns Range + */ + +Xinha.prototype.createRange = function(sel) +{ + this.activateEditor(); + if ( typeof sel != "undefined" ) + { + try + { + return sel.getRangeAt(0); + } + catch(ex) + { + return this._doc.createRange(); + } + } + else + { + return this._doc.createRange(); + } +}; + +/** Determine if the given event object is a keydown/press event. + * + * @param event Event + * @returns true|false + */ + +Xinha.prototype.isKeyEvent = function(event) +{ + return event.type == "keydown"; +} + +/** Return the character (as a string) of a keyEvent - ie, press the 'a' key and + * this method will return 'a', press SHIFT-a and it will return 'A'. + * + * @param keyEvent + * @returns string + */ + +Xinha.prototype.getKey = function(keyEvent) +{ + // with ctrl pressed Safari does not give the charCode, unfortunately this (shortcuts) is about the only thing this function is for + var key = String.fromCharCode(parseInt(keyEvent.keyIdentifier.replace(/^U\+/,''),16)); + if (keyEvent.shiftKey) return key; + else return key.toLowerCase(); +} + +/** Return the HTML string of the given Element, including the Element. + * + * @param element HTML Element DomNode + * @returns string + */ + +Xinha.getOuterHTML = function(element) +{ + return (new XMLSerializer()).serializeToString(element); +}; + +Xinha.cc = String.fromCharCode(8286); + +Xinha.prototype.setCC = function ( target ) +{ + var cc = Xinha.cc; + try + { + if ( target == "textarea" ) + { + var ta = this._textArea; + var index = ta.selectionStart; + var before = ta.value.substring( 0, index ) + var after = ta.value.substring( index, ta.value.length ); + + if ( after.match(/^[^<]*>/) ) // make sure cursor is in an editable area (outside tags, script blocks, enities and inside the body) + { + var tagEnd = after.indexOf(">") + 1; + ta.value = before + after.substring( 0, tagEnd ) + cc + after.substring( tagEnd, after.length ); + } + else ta.value = before + cc + after; + ta.value = ta.value.replace(new RegExp ('(&[^'+cc+';]*?)('+cc+')([^'+cc+']*?;)'), "$1$3$2"); + ta.value = ta.value.replace(new RegExp ('(]*>[^'+cc+']*?)('+cc+')([^'+cc+']*?<\/script>)'), "$1$3$2"); + ta.value = ta.value.replace(new RegExp ('^([^'+cc+']*)('+cc+')([^'+cc+']*]*>)(.*?)'), "$1$3$2$4"); + } + else + { + var sel = this.getSelection(); + sel.getRangeAt(0).insertNode( this._doc.createTextNode( cc ) ); + } + } catch (e) {} +}; + +Xinha.prototype.findCC = function ( target ) +{ + var cc = Xinha.cc; + + if ( target == 'textarea' ) + { + var ta = this._textArea; + var pos = ta.value.indexOf( cc ); + if ( pos == -1 ) return; + var end = pos + cc.length; + var before = ta.value.substring( 0, pos ); + var after = ta.value.substring( end, ta.value.length ); + ta.value = before ; + + ta.scrollTop = ta.scrollHeight; + var scrollPos = ta.scrollTop; + + ta.value += after; + ta.setSelectionRange(pos,pos); + + ta.focus(); + + ta.scrollTop = scrollPos; + + } + else + { + var self = this; + try + { + var doc = this._doc; + doc.body.innerHTML = doc.body.innerHTML.replace(new RegExp(cc),''); + var posEl = doc.getElementById('XinhaEditingPostion'); + this.selectNodeContents(posEl); + this.scrollToElement(posEl); + posEl.parentNode.removeChild(posEl); + + this._iframe.contentWindow.focus(); + } catch (e) {} + } +}; +/*--------------------------------------------------------------------------*/ +/*------------ EXTEND SOME STANDARD "Xinha.prototype" METHODS --------------*/ +/*--------------------------------------------------------------------------*/ + +Xinha.prototype._standardToggleBorders = Xinha.prototype._toggleBorders; +Xinha.prototype._toggleBorders = function() +{ + var result = this._standardToggleBorders(); + + // flashing the display forces moz to listen (JB:18-04-2005) - #102 + var tables = this._doc.getElementsByTagName('TABLE'); + for(var i = 0; i < tables.length; i++) + { + tables[i].style.display="none"; + tables[i].style.display="table"; + } + + return result; +}; + +/** Return the doctype of a document, if set + * + * @param doc DOM element document + * @returns string the actual doctype + */ +Xinha.getDoctype = function (doc) +{ + var d = ''; + if (doc.doctype) + { + d += '"; + } + return d; +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/Abbreviation.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/Abbreviation.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/Abbreviation.js 3 Jan 2016 20:47:14 -0000 1.1.2.1 @@ -0,0 +1,153 @@ +// Abbreviation plugin for Xinha +// Implementation by Udo Schmal & Schaffrath NeueMedien +// Original Author - Udo Schmal +// +// (c) Udo Schmal & Schaffrath NeueMedien 2004 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +function Abbreviation(editor) { + this.editor = editor; + var cfg = editor.config; + var self = this; + + // register the toolbar buttons provided by this plugin + cfg.registerButton({ + id : "abbreviation", + tooltip : Xinha._lc("Abbreviation", "Abbreviation"), + image : editor.imgURL("ed_abbreviation.gif", "Abbreviation"), + textMode : false, + action : function(editor) { + self.show(); + } + }); + cfg.addToolbarElement("abbreviation", "inserthorizontalrule", 1); +} + +Abbreviation._pluginInfo = { + name : "Abbreviation", + version : "1.0", + developer : "Udo Schmal", + developer_url : "", + sponsor : "L.N.Schaffrath NeueMedien", + sponsor_url : "http://www.schaffrath-neuemedien.de/", + c_owner : "Udo Schmal & Schaffrath-NeueMedien", + license : "htmlArea" +}; + +// Fills in the text field if the acronym is either known (i.e., in the [lang].js file) +// or if we're editing an existing abbreviation. +Abbreviation.prototype.fillText = function() { + var editor = this.editor; + var text = this.html.toUpperCase(); + var abbr = Xinha.getPluginDir(this.constructor.name) + "/abbr/" + _editor_lang + ".js"; + var abbrData = Xinha._geturlcontent(abbr); + + if (abbrData) { + eval('abbrObj = ' + abbrData); + if (abbrObj != "") { + var dest = this.dialog.getElementById("title"); + dest.value = this.title || ""; + for (var i in abbrObj) { + same = (i.toUpperCase()==text); + if (same) + dest.value = abbrObj[i]; + } + } + } +} + +Abbreviation.prototype.onGenerateOnce = function(editor) { + this.editor.addEditorStylesheet(Xinha.getPluginDir('Abbreviation') + '/abbreviation.css'); + this.methodsReady = true; //remove this? + var self = Abbreviation; + Xinha._getback(Xinha.getPluginDir('Abbreviation') + '/dialog.html', function(getback) { self.html = getback; self.dialogReady = true; }); +}; + +Abbreviation.prototype.OnUpdateToolbar = function(editor) { + if (!(Abbreviation.dialogReady && Abbreviation.methodsReady)) + { + this.editor._toolbarObjects.Abbreviation.state("enabled", false); + } + else this.onUpdateToolbar = null; +} + +Abbreviation.prototype.prepareDialog = function(html) { + var self = this; + var editor = this.editor; + var dialog = this.dialog = new Xinha.Dialog(editor, Abbreviation.html, 'Xinha', {width: 260, height:140}); + + dialog.getElementById('ok').onclick = function() { self.apply(); }; + dialog.getElementById('delete').onclick = function() { self.ondelete(); }; + dialog.getElementById('cancel').onclick = function() { self.dialog.hide(); }; + + this.dialogReady = true; +} + +Abbreviation.prototype.show = function(editor) { + var editor = this.editor; + this.html = editor.getSelectedHTML(); + if (!this.dialog) this.prepareDialog(); + var self = this; + var doc = editor._doc; + var sel = editor._getSelection(); + var range = editor._createRange(sel); + var abbr = editor._activeElement(sel); + + if(!(abbr != null && abbr.tagName.toLowerCase() == "abbr")) { + abbr = editor._getFirstAncestor(sel, 'abbr'); + } + this.abbr = abbr; + + if (abbr) this.title = abbr.title; + this.fillText(); + + this.dialog.getElementById("inputs").onsubmit = function() { + self.apply(); + return false; + } + + this.dialog.show(); + this.dialog.getElementById("title").select(); +} + +Abbreviation.prototype.apply = function() { + var editor = this.editor; + var doc = editor._doc; + var abbr = this.abbr; + var html = this.html; + var param = this.dialog.hide(); + + if ( param ) { + var title = param["title"]; + if (title == "" || title == null) { + if (abbr) { + var child = abbr.innerHTML; + abbr.parentNode.removeChild(abbr); + editor.insertHTML(child); // FIX: This doesn't work in Safari 3 + } + return; + } + try { + if (!abbr) { + abbr = doc.createElement("abbr"); + abbr.title = title; + abbr.innerHTML = html; + if (Xinha.is_ie) { + range.pasteHTML(abbr.outerHTML); + } else { + editor.insertNodeAtSelection(abbr); + } + } else { + abbr.title = title; + } + } + catch (e) { } + } +} + + +Abbreviation.prototype.ondelete = function() { + this.dialog.getElementById('title').value = ""; + this.apply(); +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/abbreviation.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/abbreviation.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/abbreviation.css 3 Jan 2016 20:47:14 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +abbr, acronym, span.abbr { + width: 18px; + height: 18px; + background-image: url(img/ed_abbreviation.gif); + background-repeat: no-repeat; + background-position: left top; + white-space : nowrap; + cursor: help; + border-bottom: 1px dashed #000; + padding-left: 19px; +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/dialog.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/dialog.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/dialog.html 3 Jan 2016 20:47:14 -0000 1.1.2.1 @@ -0,0 +1,16 @@ +

Abbreviation

+ +
+
+ Expansion: + +
+

+ +

+ + + +
+
+ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/abbr/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/abbr/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/abbr/de.js 3 Jan 2016 20:47:15 -0000 1.1.2.1 @@ -0,0 +1,40 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// Author: Udo Schmal, +// +// (c) Udo Schmal & Schaffrath NeueMedien 2004 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +{ + "Abs.": "Absatz", + "bspw.": "Beispielsweise", + "bzw.": "beziehungsweise", + "c/o": "care of / bei, zu Händen von", + "ca.": "circa", + "d.h.": "das heißt", + "d.J.": "des Jahres", + "Dr.": "Doktor", + "e.V.": "Eingetragener Verein", + "eG.": "Eingetragene Genossenschaft", + "ehem.": "ehemals", + "einschl.": "einschließlich", + "etc.": "et cetera / und so weiter", + "evtl.": "eventuell", + "ff.": "(fort) folgende", + "gem.": "gemäß", + "inkl.": "inklusive", + "max.": "maximal / maximum", + "min.": "mindestens / minimum / minimal", + "o.g.": "oben genannt", + "rd.": "rund", + "S.": "Seite", + "u.a.": "unter anderem", + "u.ä.": "und ähnlich", + "usw.": "und so weiter", + "vgl.": "vergleiche", + "z.B.": "zum Beispiel", + "z.T.": "zum Teil", + "z.Z.": "zur Zeit", + "zzgl.": "zuzüglich" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/abbr/en.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/abbr/en.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/abbr/en.js 3 Jan 2016 20:47:15 -0000 1.1.2.1 @@ -0,0 +1,16 @@ +// I18N constants +// LANG: "en", ENCODING: UTF-8 +// Author: Udo Schmal, +// +// (c) Udo Schmal & Schaffrath NeueMedien 2004 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +{ + "ANSI": "American National Standards Institute", + "ASA": "American Standards Association", + "ISO": "International Organisation for Standardization", + "mime": "Multipurpose Internet Mail Extensions", + "UTF": "Unicode Transformation Format", + "W3C": "World Wide Web Consortium" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/img/ed_abbreviation.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/img/ed_abbreviation.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/de.js 3 Jan 2016 20:47:15 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "Abbreviation": "Abkürzung", + "Expansion:": "Erklärung:", + "Delete": "Löschen" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/es.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/es.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/es.js 3 Jan 2016 20:47:15 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "en", ENCODING: UTF-8 +// translated: Derick Leony +{ + "Abbreviation": "Abreviatura", + "Expansion:": "Explicación", + "Delete": "Suprimir" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/fr.js 3 Jan 2016 20:47:15 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Abbreviation": "Abréviation", + "Expansion:": "Explication", + "Delete": "Supprimer" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/ja.js 3 Jan 2016 20:47:16 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Abbreviation": "略語", + "Expansion:": "展開される語:", + "Delete": "削除" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/nb.js 3 Jan 2016 20:47:16 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Abbreviation": "Beskrive forkortelse", + "Expansion:": "Betydning:", + "Delete": "Fjerne" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/nl.js 3 Jan 2016 20:47:16 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Abbreviation": "Afkorting", + "Expansion:": "Uitbreiding:", + "Delete": "Verwijderen" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/no.js 3 Jan 2016 20:47:16 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Abbreviation": "Beskrive forkortelse", + "Expansion:": "Betydning:", + "Delete": "Fjerne" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/lang/pt_br.js 3 Jan 2016 20:47:16 -0000 1.1.2.1 @@ -0,0 +1,22 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Abbreviation": "Abreviação", + "Cancel": "Cancelar", + "Delete": "Apagar", + "Expansion:": "Expandir:", + "OK": "OK" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/popups/abbreviation.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/popups/abbreviation.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Abbreviation/popups/abbreviation.html 3 Jan 2016 20:47:17 -0000 1.1.2.1 @@ -0,0 +1,92 @@ + + + Abbreviation + + + + + + + +
Abbreviation
+
+ + + + + +
Expansion: + + + +
+ +
+ + + +
+
+ + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/background-image.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/background-image.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/background-image.js 3 Jan 2016 20:47:17 -0000 1.1.2.1 @@ -0,0 +1,31 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/BackgroundImage/background-image.js */ +function BackgroundImage(_1){ +this.editor=_1; +var _2=_1.config; +var _3=this; +_2.registerButton({id:"bgImage",tooltip:this._lc("Set page background image"),image:_1.imgURL("ed_bgimage.gif","BackgroundImage"),textMode:false,action:function(_4){ +_3.buttonPress(_4); +}}); +_2.addToolbarElement("bgImage","inserthorizontalrule",1); +} +BackgroundImage._pluginInfo={name:"BackgroundImage",version:"1.0",developer:"Udo Schmal",developer_url:"http://www.schaffrath-neuemedien.de/",c_owner:"Udo Schmal & Schaffrath NeueMedien",sponsor:"L.N.Schaffrath NeueMedien",sponsor_url:"http://www.schaffrath-neuemedien.de.de/",license:"htmlArea"}; +BackgroundImage.prototype._lc=function(_5){ +return Xinha._lc(_5,"BackgroundImage"); +}; +BackgroundImage.prototype.buttonPress=function(_6){ +_6._popupDialog("plugin://BackgroundImage/bgimage",function(_7){ +if(_7){ +if(Xinha.is_ie){ +_6.focusEditor(); +} +if(_7=="*"){ +_6._doc.body.background=""; +}else{ +_6._doc.body.background=_7; +} +} +},null); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/blufur.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/blufur.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/palecnvs.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/palecnvs.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/ppplcnvs.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/ppplcnvs.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/ylwsand.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/ylwsand.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/thumbnails/blufur.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/thumbnails/blufur.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/thumbnails/palecnvs.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/thumbnails/palecnvs.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/thumbnails/ppplcnvs.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/thumbnails/ppplcnvs.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/thumbnails/ylwsand.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/backgrounds/thumbnails/ylwsand.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/img/ed_bgimage.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/img/ed_bgimage.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/de.js 3 Jan 2016 20:47:18 -0000 1.1.2.1 @@ -0,0 +1,9 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "Set page background image": "Seiten-Hintergrundbild setzen", + "Set Page Background Image": "Seiten-Hintergrundbild setzen", + "Remove Current Background": "Aktuellen Hintergrund entfernen", + "Cancel": "Abbrechen" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/fr.js 3 Jan 2016 20:47:19 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Set page background image": "Définir l'image de fond", + "Set Page Background Image": "Définir l'Image de Fond", + "Remove Current Background": "Supprimer le fond actuel", + "Cancel": "Annuler" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/ja.js 3 Jan 2016 20:47:19 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Set page background image": "ページの背景画像を設定", + "Set Page Background Image": "ページの背景画像を設定", + "Remove Current Background": "現在の背景画像を除去", + "Cancel": "中止" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/nb.js 3 Jan 2016 20:47:19 -0000 1.1.2.1 @@ -0,0 +1,9 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Set page background image": "Velg bakgrunnsbilde på siden", + "Set Page Background Image": "Velg bakgrunnsbilde på Siden", + "Remove Current Background": "Fjern gjeldende bakgrunn", + "Cancel": "Avbryt" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/nl.js 3 Jan 2016 20:47:19 -0000 1.1.2.1 @@ -0,0 +1,9 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Set page background image": "Pagina achtergrond afbeelding instellen", + "Set Page Background Image": "Pagina Achtergrond Afbeelding Instellen", + "Remove Current Background": "Huidige Achtergrond Afbeelding Verwijderen", + "Cancel": "Annuleren" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/no.js 3 Jan 2016 20:47:19 -0000 1.1.2.1 @@ -0,0 +1,9 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Set page background image": "Velg bakgrunnsbilde på siden", + "Set Page Background Image": "Velg Bakgrunnsbilde På Siden", + "Remove Current Background": "Fjern gjeldende bakgrunn", + "Cancel": "Avbryt" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/lang/pt_br.js 3 Jan 2016 20:47:20 -0000 1.1.2.1 @@ -0,0 +1,21 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Cancel": "Cancelar", + "Remove Current Background": "Remover fundo atual", + "Set Page Background Image": "Definir Imagem de Fundo", + "Set page background image": "Definir imagem de fundo" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/popups/bgimage.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/popups/bgimage.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/BackgroundImage/popups/bgimage.html 3 Jan 2016 20:47:20 -0000 1.1.2.1 @@ -0,0 +1,49 @@ + + + +Set Page Background Image + + + + + +
+
Set Page Background Image
+ + + + + + + +
+
+
+ + +
+
+ + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CSS/CSS.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CSS/CSS.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CSS/CSS.js 3 Jan 2016 20:47:20 -0000 1.1.2.1 @@ -0,0 +1,149 @@ +// Simple CSS (className) plugin for the editor +// Sponsored by http://www.miro.com.au +// Implementation by Mihai Bazon, http://dynarch.com/mishoo. +// +// (c) dynarch.com 2003 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +// +// $Id: CSS.js,v 1.1.2.1 2016/01/03 20:47:20 gustafn Exp $ +// @TODO This is the default and won't be very useful to others. +// We should make this better. +Xinha.Config.prototype.cssPluginConfig = + { + combos : [ + { label: "Syntax", + // menu text // CSS class + options: { "None" : "", + "Code" : "code", + "String" : "string", + "Comment" : "comment", + "Variable name" : "variable-name", + "Type" : "type", + "Reference" : "reference", + "Preprocessor" : "preprocessor", + "Keyword" : "keyword", + "Function name" : "function-name", + "Html tag" : "html-tag", + "Html italic" : "html-helper-italic", + "Warning" : "warning", + "Html bold" : "html-helper-bold" + }, + context: "pre" + }, + { label: "Info", + options: { "None" : "", + "Quote" : "quote", + "Highlight" : "highlight", + "Deprecated" : "deprecated" + } + } + ] + }; + +function CSS(editor, params) { + this.editor = editor; + var cfg = editor.config; + var self = this; + var plugin_config; + if(params && params.length) + { + plugin_config = params[0]; + } + else + { + plugin_config = editor.config.cssPluginConfig; + } + + var combos = plugin_config.combos; + + for (var i = 0; i < combos.length; i++) { + var combo = combos[i]; + var id = "CSS-class" + i; + var css_class = { + id : id, + options : combo.options, + action : function(editor) { self.onSelect(editor, this, combo.context, combo.updatecontextclass); }, + refresh : function(editor) { self.updateValue(editor, this); }, + context : combo.context + }; + cfg.registerDropdown(css_class); + cfg.addToolbarElement(["T[" + combo.label + "]", id, "separator"] , "formatblock", -1); + } +} + +CSS._pluginInfo = { + name : "CSS", + version : "1.0", + developer : "Mihai Bazon", + developer_url : "http://dynarch.com/mishoo/", + c_owner : "Mihai Bazon", + sponsor : "Miro International", + sponsor_url : "http://www.miro.com.au", + license : "htmlArea" +}; + +CSS.prototype.onSelect = function(editor, obj, context, updatecontextclass) { + var tbobj = editor._toolbarObjects[obj.id]; + var index = tbobj.element.selectedIndex; + var className = tbobj.element.value; + + // retrieve parent element of the selection + var parent = editor.getParentElement(); + var surround = true; + + var is_span = (parent && parent.tagName.toLowerCase() == "span"); + var update_parent = (context && updatecontextclass && parent && parent.tagName.toLowerCase() == context); + + if (update_parent) { + parent.className = className; + editor.updateToolbar(); + return; + } + + if (is_span && index == 0 && !/\S/.test(parent.style.cssText)) { + while (parent.firstChild) { + parent.parentNode.insertBefore(parent.firstChild, parent); + } + parent.parentNode.removeChild(parent); + editor.updateToolbar(); + return; + } + + if (is_span) { + // maybe we could simply change the class of the parent node? + if (parent.childNodes.length == 1) { + parent.className = className; + surround = false; + // in this case we should handle the toolbar updation + // ourselves. + editor.updateToolbar(); + } + } + + // Other possibilities could be checked but require a lot of code. We + // can't afford to do that now. + if (surround) { + // shit happens ;-) most of the time. this method works, but + // it's dangerous when selection spans multiple block-level + // elements. + editor.surroundHTML("", ""); + } +}; + +CSS.prototype.updateValue = function(editor, obj) { + var select = editor._toolbarObjects[obj.id].element; + var parent = editor.getParentElement(); + if (typeof parent.className != "undefined" && /\S/.test(parent.className)) { + var options = select.options; + var value = parent.className; + for (var i = options.length; --i >= 0;) { + var option = options[i]; + if (value == option.value) { + select.selectedIndex = i; + return; + } + } + } + select.selectedIndex = 0; +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CSSDropdowns/CSSDropdowns.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CSSDropdowns/CSSDropdowns.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CSSDropdowns/CSSDropdowns.js 3 Jan 2016 20:47:20 -0000 1.1.2.1 @@ -0,0 +1,149 @@ +// Simple CSS (className) plugin for the editor +// Sponsored by http://www.miro.com.au +// Implementation by Mihai Bazon, http://dynarch.com/mishoo. +// +// (c) dynarch.com 2003 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +// +// $Id: CSSDropdowns.js,v 1.1.2.1 2016/01/03 20:47:20 gustafn Exp $ +// @TODO This is the default and won't be very useful to others. +// We should make this better. +Xinha.Config.prototype.cssPluginConfig = + { + combos : [ + { label: "Syntax", + // menu text // CSS class + options: { "None" : "", + "Code" : "code", + "String" : "string", + "Comment" : "comment", + "Variable name" : "variable-name", + "Type" : "type", + "Reference" : "reference", + "Preprocessor" : "preprocessor", + "Keyword" : "keyword", + "Function name" : "function-name", + "Html tag" : "html-tag", + "Html italic" : "html-helper-italic", + "Warning" : "warning", + "Html bold" : "html-helper-bold" + }, + context: "pre" + }, + { label: "Info", + options: { "None" : "", + "Quote" : "quote", + "Highlight" : "highlight", + "Deprecated" : "deprecated" + } + } + ] + }; + +function CSSDropdowns(editor, params) { + this.editor = editor; + var cfg = editor.config; + var self = this; + var plugin_config; + if(params && params.length) + { + plugin_config = params[0]; + } + else + { + plugin_config = editor.config.cssPluginConfig; + } + + var combos = plugin_config.combos; + + for (var i = 0; i < combos.length; i++) { + var combo = combos[i]; + var id = "CSS-class" + i; + var css_class = { + id : id, + options : combo.options, + action : function(editor) { self.onSelect(editor, this, combo.context, combo.updatecontextclass); }, + refresh : function(editor) { self.updateValue(editor, this); }, + context : combo.context + }; + cfg.registerDropdown(css_class); + cfg.addToolbarElement(["T[" + combo.label + "]", id, "separator"] , "formatblock", -1); + } +} + +CSSDropdowns._pluginInfo = { + name : "CSSDropdowns", + version : "1.0", + developer : "Mihai Bazon", + developer_url : "http://dynarch.com/mishoo/", + c_owner : "Mihai Bazon", + sponsor : "Miro International", + sponsor_url : "http://www.miro.com.au", + license : "htmlArea" +}; + +CSSDropdowns.prototype.onSelect = function(editor, obj, context, updatecontextclass) { + var tbobj = editor._toolbarObjects[obj.id]; + var index = tbobj.element.selectedIndex; + var className = tbobj.element.value; + + // retrieve parent element of the selection + var parent = editor.getParentElement(); + var surround = true; + + var is_span = (parent && parent.tagName.toLowerCase() == "span"); + var update_parent = (context && updatecontextclass && parent && parent.tagName.toLowerCase() == context); + + if (update_parent) { + parent.className = className; + editor.updateToolbar(); + return; + } + + if (is_span && index == 0 && !/\S/.test(parent.style.cssText)) { + while (parent.firstChild) { + parent.parentNode.insertBefore(parent.firstChild, parent); + } + parent.parentNode.removeChild(parent); + editor.updateToolbar(); + return; + } + + if (is_span) { + // maybe we could simply change the class of the parent node? + if (parent.childNodes.length == 1) { + parent.className = className; + surround = false; + // in this case we should handle the toolbar updation + // ourselves. + editor.updateToolbar(); + } + } + + // Other possibilities could be checked but require a lot of code. We + // can't afford to do that now. + if (surround) { + // shit happens ;-) most of the time. this method works, but + // it's dangerous when selection spans multiple block-level + // elements. + editor.surroundHTML("", ""); + } +}; + +CSSDropdowns.prototype.updateValue = function(editor, obj) { + var select = editor._toolbarObjects[obj.id].element; + var parent = editor.getParentElement(); + if (typeof parent.className != "undefined" && /\S/.test(parent.className)) { + var options = select.options; + var value = parent.className; + for (var i = options.length; --i >= 0;) { + var option = options[i]; + if (value == option.value) { + select.selectedIndex = i; + return; + } + } + } + select.selectedIndex = 0; +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CSSPicker/CSSPicker.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CSSPicker/CSSPicker.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CSSPicker/CSSPicker.js 3 Jan 2016 20:47:20 -0000 1.1.2.1 @@ -0,0 +1,167 @@ +/** CSS Picker Plugin by Justin Rovang + * + * For full documentation, please see + * http://bitbucket.org/rovangju/xinha_csspicker/wiki/Home + * + * SAMPLE CONFIG: + * + * You can configure the appearance of the item/style list using the following CSS classes: + * .CSSPickerOption (Normal state) + * .CSSPickerOptionOver (Mouse-over state, typically border change) + * .CSSPickerOptionActive (Indicator for active classes under the selection/carat) + * + * Keys are CSS Class names + * wrapper: tag to wrap selected text with + * name: friendly name to display in panel with that class style applied to it. + * + * Sample config: + * CSSPicker.cssList = { + * 'xinhaDashedBox' : { 'wrapper':'div', 'name':'Breakout box' } + * 'xinhaMiniHeadline' : { 'wrapper':'div', 'name':'Sub-headline' } + * } + * + */ + +function CSSPicker(editor, args) { + this.editor = editor; + var CSSPicker = this; +} + +CSSPicker._pluginInfo = { + name : "CSSPicker", + version : "2008-12-01", + author : "Justin Rovang" +} + +CSSPicker.prototype.onGenerateOnce = function() { + var editor = this.editor; + var CSSPicker = this; + editor._cssPicker = editor.addPanel("right"); + + this.main = document.createElement("div"); + editor._cssPicker.style.backgroundColor='#dee5f8'; + editor._cssPicker.appendChild(this.main); + + Xinha.freeLater(this,"main"); + editor.showPanel(editor._cssPicker); +} + + +CSSPicker.prototype.onUpdateToolbar = function() { + if(this.editor._cssPicker) { + if(this._timeoutID) window.clearTimeout(this._timeoutID); + var e = this.editor; + this._timeoutID = window.setTimeout(function() { e._gen(); }, 250); //1000 = 1sec / 500=.5sec / 250=.25sec + } +} + +Xinha.prototype.listStyles = function(s) { + var editor = this; + var mySel = this.getSelection(); + var myRange; + if(Xinha.is_ie) { + myRange = this.saveSelection();//mySel; + mySel = this.createRange(mySel).text; + } + + var d = document.createElement("div"); + + d.className='CSSPickerOption'; + + /* If our carat is within an active class, highlight it */ + var toggleState = editor.getStyleInfo(s); + if(toggleState) Xinha._addClass(d, 'CSSPickerOptionActive'); + + d.align='center'; + d.innerHTML='
'+CSSPicker.cssList[s].name+'
'; + d.onclick = function() { + editor.wrapStyle(s, mySel, myRange, CSSPicker.cssList[s].wrapper); + return false; + }; + + Xinha._addEvent(d, 'mouseover', function(ev) { + Xinha._addClass(d, 'CSSPickerOptionOver'); + }); + + Xinha._addEvent(d, 'mouseout', function(ev) { + Xinha._removeClass(d, 'CSSPickerOptionOver'); + }); + + return d; +} + +Xinha.prototype._gen = function() { + this.plugins.CSSPicker.instance.main.innerHTML=''; + for(var s in CSSPicker.cssList) { + this.plugins.CSSPicker.instance.main.appendChild(this.listStyles(s)); + } + return true; +} + +/* + (string) s: style name + (string) sel: selection text + (object) myRange: selection object + (string) sWrapper: wrapper tag (e.g.: div, span) +*/ +Xinha.prototype.wrapStyle = function(s, sel, myRange, sWrapper) { + if(!sWrapper) sWrapper="div"; + sWrapper=sWrapper.toLowerCase(); + + /* The reason for these next lines is that we want the user to be able to place + * their cursor below the new div element. Otherwise they can't which makes + * placing anything after a div wrapper difficult/almost impossible. */ + var divBreak=''; + if(sWrapper=="div") divBreak='
'; + + var editor=this; + this.focusEditor(); + if(Xinha.is_ie) this.restoreSelection(myRange); + + /* + * First - Get parent elements and see if the style is already applied. + */ + var toggleState = editor.getStyleInfo(s); + if(!toggleState) { + /* Create a new wrapper when: + * 1. Selected text has no 'snug' wrapper around it already. + * 2. If it does have a 'snug' wrapper, only append to the className if it's of the same type (span or div) + */ + if(sel == '') sel = ' '; //We insert this if the selection is empty, making it easier for carat placement via click + + this.insertHTML("<"+sWrapper+" class='"+s+"'>"+sel+""+divBreak); + /* Modify the 'snug' wrapper if the above conditions are not met for a new element: */ + } + else { + /* 1. If the current ancestor has -just- this classname. It should be removed. + * 2. If it has more than one class, it should be removed from the list of the parents + */ + Xinha._removeClass(toggleState, s); + } + + return true; +} + +Xinha.prototype.getStyleInfo = function(sClassToProbe) { + var editor = this; + var aList = this.getAllAncestors(); + var a,s; + + if(aList) aList.pop(); //We don't want the body element to show up in this list. + if(aList.length > 0) { + for(var o in aList){ + a = aList[o]; + /* Instead of break down and rebuild the array for this search, we're going + * to do some string trickery... + * // NOTE: THIS MAY BE PRONE TO PARTIAL MATCHES. SOLUTION IS TO ADD A SPACE PREPEND + */ + if(a.className) { + s = a.className.trim()+' '; + if(s.toLowerCase().match(sClassToProbe.toLowerCase()+' ')) { + return a; + } + } + } + } + return false; +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/CharCounter.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/CharCounter.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/CharCounter.js 3 Jan 2016 20:47:20 -0000 1.1.2.1 @@ -0,0 +1,101 @@ +// Charcounter for Xinha +// (c) Udo Schmal & L.N.Schaffrath NeueMedien +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +function CharCounter(editor) { + this.editor = editor; + this._Chars = 0; + this._Words = 0; + this._HTML = 0; + this.onKeyPress = this.__onKeyPress; +} + +Xinha.Config.prototype.CharCounter = +{ + 'showChar': true, // show the characters count, + 'showWord': true, // show the words count, + 'showHtml': true, // show the exact html count + 'separator': ' | ', // separator used to join informations + 'maxHTML' : -1 // -1 for unlimited length, other number for limiting the length of the edited HTML +}; + +CharCounter._pluginInfo = { + name : "CharCounter", + version : "1.31", + developer : "Udo Schmal", + developer_url : "http://www.schaffrath-neuemedien.de", + sponsor : "L.N.Schaffrath NeueMedien", + sponsor_url : "http://www.schaffrath-neuemedien.de", + c_owner : "Udo Schmal & L.N.Schaffrath NeueMedien", + license : "htmlArea" +}; + +CharCounter.prototype._lc = function(string) { + return Xinha._lc(string, "CharCounter"); +}; + + +CharCounter.prototype.onGenerateOnce = function() { + var self = this; + if (this.charCount==null) { + var charCount = self.editor.registerStatusWidget('CharCounter', ['wysiwyg']); + this.charCount = charCount; + } +}; + +CharCounter.prototype.__onKeyPress= function(ev) { + if ((ev.keyCode != 8) && (ev.keyCode !=46)) { // not backspace & delete + if (this.editor.config.CharCounter.maxHTML!=-1) { + var contents = this.editor.getHTML(); + if (contents.length >= this.editor.config.CharCounter.maxHTML) { + Xinha._stopEvent(ev); + return true; + } + } + } +} + +CharCounter.prototype._updateCharCount= function() { + var editor = this.editor; + var cfg = editor.config; + var contents = editor.getHTML(); + var string = new Array(); + if (cfg.CharCounter.showHtml) { + string[string.length] = this._lc("HTML") + ": " + contents.length; + } + this._HTML = contents.length; + if (cfg.CharCounter.showWord || cfg.CharCounter.showChar) { + contents = contents.replace(/<\/?\s*!--[^-->]*-->/gi, "" ); + contents = contents.replace(/<(.+?)>/g, '');//Don't count HTML tags + contents = contents.replace(/ /gi, ' '); + contents = contents.replace(/([\n\r\t])/g, ' ');//convert newlines and tabs into space + contents = contents.replace(/( +)/g, ' ');//count spaces only once + contents = contents.replace(/&(.*);/g, ' ');//Count htmlentities as one keystroke + contents = contents.replace(/^\s*|\s*$/g, '');//trim + } + if (cfg.CharCounter.showWord) { + this._Words = 0; + for (var x=0;x=1) { this._Words++; } + string[string.length] = this._lc("Words") + ": " + this._Words ; + } + if (cfg.CharCounter.showChar) { + string[string.length] = this._lc("Chars") + ": " + contents.length; + this._Chars = contents.length; + } + this.charCount.innerHTML = string.join(cfg.CharCounter.separator); +}; + +CharCounter.prototype.onUpdateToolbar = function() { + this.charCount.innerHTML = this._lc("... in progress"); + if(this._timeoutID) { + window.clearTimeout(this._timeoutID); + } + var e = this; + this._timeoutID = window.setTimeout(function() {e._updateCharCount();}, 1000); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/char-counter.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/char-counter.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/char-counter.js 3 Jan 2016 20:47:21 -0000 1.1.2.1 @@ -0,0 +1,109 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/CharCounter/char-counter.js */ +function CharCounter(_1){ +this.editor=_1; +this._Chars=0; +this._Words=0; +this._HTML=0; +this.onKeyPress=this.__onKeyPress; +} +Xinha.Config.prototype.CharCounter={"showChar":true,"showWord":true,"showHtml":true,"separator":" | ","maxHTML":-1}; +CharCounter._pluginInfo={name:"CharCounter",version:"1.31",developer:"Udo Schmal",developer_url:"http://www.schaffrath-neuemedien.de",sponsor:"L.N.Schaffrath NeueMedien",sponsor_url:"http://www.schaffrath-neuemedien.de",c_owner:"Udo Schmal & L.N.Schaffrath NeueMedien",license:"htmlArea"}; +CharCounter.prototype._lc=function(_2){ +return Xinha._lc(_2,"CharCounter"); +}; +CharCounter.prototype.onGenerateOnce=function(){ +var _3=this; +if(this.charCount==null){ +var _4=document.createElement("span"); +_4.style.padding="2px 5px"; +if(Xinha.is_ie){ +_4.style.styleFloat="right"; +}else{ +_4.style.cssFloat="right"; +} +var _5=document.createElement("div"); +_5.style.height=_5.style.width=_5.style.lineHeight=_5.style.fontSize="1px"; +_5.style.clear="both"; +if(Xinha.is_ie){ +this.editor._statusBarTree.style.styleFloat="left"; +}else{ +this.editor._statusBarTree.style.cssFloat="left"; +} +this.editor._statusBar.appendChild(_4); +this.editor._statusBar.appendChild(_5); +this.charCount=_4; +} +}; +CharCounter.prototype.__onKeyPress=function(ev){ +if((ev.keyCode!=8)&&(ev.keyCode!=46)){ +if(this.editor.config.CharCounter.maxHTML!=-1){ +var _7=this.editor.getHTML(); +if(_7.length>=this.editor.config.CharCounter.maxHTML){ +Xinha._stopEvent(ev); +return true; +} +} +} +}; +CharCounter.prototype._updateCharCount=function(){ +var _8=this.editor; +var _9=_8.config; +var _a=_8.getHTML(); +var _b=new Array(); +if(_9.CharCounter.showHtml){ +_b[_b.length]=this._lc("HTML")+": "+_a.length; +} +this._HTML=_a.length; +if(_9.CharCounter.showWord||_9.CharCounter.showChar){ +_a=_a.replace(/<\/?\s*!--[^-->]*-->/gi,""); +_a=_a.replace(/<(.+?)>/g,""); +_a=_a.replace(/ /gi," "); +_a=_a.replace(/([\n\r\t])/g," "); +_a=_a.replace(/( +)/g," "); +_a=_a.replace(/&(.*);/g," "); +_a=_a.replace(/^\s*|\s*$/g,""); +} +if(_9.CharCounter.showWord){ +this._Words=0; +for(var x=0;x<_a.length;x++){ +if(_a.charAt(x)==" "){ +this._Words++; +} +} +if(this._Words>=1){ +this._Words++; +} +_b[_b.length]=this._lc("Words")+": "+this._Words; +} +if(_9.CharCounter.showChar){ +_b[_b.length]=this._lc("Chars")+": "+_a.length; +this._Chars=_a.length; +} +this.charCount.innerHTML=_b.join(_9.CharCounter.separator); +}; +CharCounter.prototype.onUpdateToolbar=function(){ +this.charCount.innerHTML=this._lc("... in progress"); +if(this._timeoutID){ +window.clearTimeout(this._timeoutID); +} +var e=this; +this._timeoutID=window.setTimeout(function(){ +e._updateCharCount(); +},1000); +}; +CharCounter.prototype.onMode=function(_e){ +switch(_e){ +case "textmode": +this.charCount.style.display="none"; +break; +case "wysiwyg": +this.charCount.style.display=""; +break; +default: +alert("Mode <"+_e+"> not defined!"); +return false; +} +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/de.js 3 Jan 2016 20:47:21 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "Chars": "Zeichen", + "Words": "Worte", + "... in progress": "... in Bearbeitung" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/fr.js 3 Jan 2016 20:47:22 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Chars": "Caractères", + "Words": "Mots" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/ja.js 3 Jan 2016 20:47:22 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Chars": "文字数", + "Words": "単語数", + "... in progress": "... 処理中" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/nb.js 3 Jan 2016 20:47:22 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Chars": "Tegn" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/nl.js 3 Jan 2016 20:47:22 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Chars": "Tekens", + "Words": "Woorden", + "... in progress": "... wordt verwerkt" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/no.js 3 Jan 2016 20:47:22 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Chars": "Tegn" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharCounter/lang/pt_br.js 3 Jan 2016 20:47:23 -0000 1.1.2.1 @@ -0,0 +1,21 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "... in progress": "... em processo", + "Chars": "Caracteres", + "HTML": "HTML", + "Words": "Palavras" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/CharacterMap.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/CharacterMap.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/CharacterMap.css 3 Jan 2016 20:47:23 -0000 1.1.2.1 @@ -0,0 +1,43 @@ +.CharacterMap { +background-color:white; +} +.CharacterMap a.entity { + font-size:12px; + width:18px; + display:block; + float:left; + padding:2px; + text-decoration:none; + color:#000; + text-align:center; + +} +.CharacterMap a.light { + background-color:#ffffff; +} +.CharacterMap a.dark { + background-color:#f7f8fd; +} +.CharacterMap a.entity:hover { + background-color:#ffd760; + color:#000; +} +.popup td.character { + font-family:Verdana,Arial,Helvetica,sans-serif; + font-size:14px; + font-weight:bold; + text-align:center; + background:#fff; + padding:4px; +} +.popup td.character-hilite { + background:#ffd760; +} +.popup form { + text-align:center; +} +.popup table { + cursor:pointer; + background-color:#ADAD9C; + border:1px inset; +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/CharacterMap.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/CharacterMap.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/CharacterMap.js 3 Jan 2016 20:47:23 -0000 1.1.2.1 @@ -0,0 +1,124 @@ +// Character Map plugin for Xinha +// Original Author - Bernhard Pfeifer novocaine@gmx.net +Xinha.loadStyle( 'CharacterMap.css', 'CharacterMap' ); + +function CharacterMap( editor ) +{ + this.editor = editor; + var cfg = editor.config; + var self = this; + cfg.registerButton( + { + id : 'insertcharacter', + tooltip : Xinha._lc( 'Insert special character', 'CharacterMap' ), + image : editor.imgURL('images/tango/16x16/apps/accessories-character-map.png'), + textMode : false, + action : function() { self.show(); } + } + ); + cfg.addToolbarElement('insertcharacter', 'createlink', -1); + +} + +// configuration mode : panel or popup +Xinha.Config.prototype.CharacterMap = +{ + 'mode': 'popup' // configuration mode : panel or popup +}; + +CharacterMap._pluginInfo = +{ + name : "CharacterMap", + version : "2.0", + developer : "Laurent Vilday", + developer_url : "http://www.mokhet.com/", + c_owner : "Xinha community", + sponsor : "", + sponsor_url : "", + license : "HTMLArea" +}; + +CharacterMap._isActive = false; + + +CharacterMap.prototype.addEntity = function ( entite, pos ) +{ + var editor = this.editor; + var self = this; + var a = document.createElement( 'a' ); + Xinha._addClass( a, 'entity' ); + a.innerHTML = entite; + a.href = 'javascript:void(0)'; + Xinha._addClass(a, (pos%2)? 'light':'dark'); + a.onclick = function() + { + if (Xinha.is_ie) editor.focusEditor(); + editor.insertHTML( entite ); + //self._isActive = false; + //editor.hidePanel( editor._CharacterMap ); + return false; + }; + this.dialog.main.appendChild( a ); + a = null; +}; + +CharacterMap.prototype.onGenerateOnce = function() +{ + this._prepareDialog(); +}; + +CharacterMap.prototype._prepareDialog = function() +{ + var self = this; + var editor = this.editor; + + var html = '

Insert special character

'; + + // Now we have everything we need, so we can build the dialog. + this.dialog = new Xinha.Dialog(editor, html, 'CharacterMap',{width:300},{modal:false}); + Xinha._addClass( this.dialog.rootElem, 'CharacterMap' ); + + if (editor.config.CharacterMap && editor.config.CharacterMap.mode == 'panel') this.dialog.attachToPanel('right'); + + var entites = + [ + 'Ÿ', 'š', '@', '"', '¡', '¢', '£', '¤', '¥', '¦', + '§', '¨', '©', 'ª', '«', '¬', '¯', '°', '±', '²', + '³', '´', 'µ', '¶', '·', '¸', '¹', 'º', '»', '¼', + '½', '¾', '¿', '×', 'Ø', '÷', 'ø', 'ƒ', 'ˆ', + '˜', '–', '—', '‘', '’', '‚', '“', '”', '„', + '†', '‡', '•', '…', '‰', '‹', '›', '€', '™', + 'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', + 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', + 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '®', '×', 'Ù', 'Ú', + 'Û', 'Ü', 'Ý', 'Þ', 'ß', 'à', 'á', 'â', 'ã', + 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', + 'í', 'î', 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', + 'ö', '÷', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', + 'ÿ', 'Œ', 'œ', 'Š' + ]; + + for ( var i=0; i +// (c) systemconcept.de 2004 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Insert special character": "Sonderzeichen einfügen", + "Cancel": "Abbrechen" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/es.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/es.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/es.js 3 Jan 2016 20:47:24 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "es", ENCODING: UTF-8 +// translated: Derick Leony +{ + "Edit HTML for selected text": "Editar código HTML del texto seleccionado", + "Tag Editor": "Editor de Etiquetas" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/fr.js 3 Jan 2016 20:47:24 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Insert special character": "Insérer un caractère spécial", + "Cancel": "Annuler" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/it.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/it.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/it.js 3 Jan 2016 20:47:24 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "it", ENCODING: UTF-8 +{ + "Insert special character": "Inserisca il carattere speciale", + "Cancel": "Annullamento" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/ja.js 3 Jan 2016 20:47:25 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Insert special character": "特殊文字を挿入", + "Cancel": "中止" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/nb.js 3 Jan 2016 20:47:25 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Insert special character": "Sett inn tegn", + "Cancel": "Avbryt" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/nl.js 3 Jan 2016 20:47:25 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Sponsored by http://www.systemconcept.de +// Author: Holger Hees, +// (c) systemconcept.de 2004 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Insert special character": "Speciaal character invoegen", + "Cancel": "Annuleer" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/no.js 3 Jan 2016 20:47:25 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Insert special character": "Sett inn tegn", + "Cancel": "Avbryt" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/pt_br.js 3 Jan 2016 20:47:25 -0000 1.1.2.1 @@ -0,0 +1,19 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Cancel": "Cancelar", + "Insert special character": "Inserir caracter especial" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/ru.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/ru.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/ru.js 3 Jan 2016 20:47:26 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "ru", ENCODING: UTF-8 +// Author: Andrei Blagorazumov, a@fnr.ru +{ + "Insert special character": "Вставить специальный символ", + "Cancel": "Отменить" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/sv.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/sv.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/lang/sv.js 3 Jan 2016 20:47:26 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "sv" (Swedish), ENCODING: UTF-8 +// translated: Erik Dalén +{ + "Insert special character": "Infoga tecken", + "Cancel": "Avbryt" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/popups/select_character.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/popups/select_character.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/CharacterMap/popups/select_character.html 3 Jan 2016 20:47:26 -0000 1.1.2.1 @@ -0,0 +1,184 @@ + + + +Insert special character + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Ÿš@"¡¢£¤¥¦§¨©ª«¬
¯°±²³´µ·¸¹º»¼½¾
¿×Ø÷øƒˆ˜
ÀÁÂÃÄÅÆ
ÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ
®×ÙÚÛÜÝÞßàáâãäåæ
çèéêëìíîïðñòóôõö
÷øùúûüýþÿŒœŠ 

+
+ + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/clientside-spellcheck.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/clientside-spellcheck.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/clientside-spellcheck.js 3 Jan 2016 20:47:26 -0000 1.1.2.1 @@ -0,0 +1,36 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/ClientsideSpellcheck/clientside-spellcheck.js */ +function ClientsideSpellcheck(_1){ +this.editor=_1; +var _2=_1.config; +var bl=ClientsideSpellcheck.btnList; +var _4=this; +var id="clientsidespellcheck"; +_2.registerButton(id,this._lc("Spell Check using ieSpell"),_1.imgURL("clientside-spellcheck.gif","ClientsideSpellcheck"),false,function(_6,id){ +_4.buttonPress(_6,id); +}); +if(Xinha.is_ie){ +_2.addToolbarElement("clientsidespellcheck","print",1); +} +} +ClientsideSpellcheck._pluginInfo={name:"ClientsideSpellcheck",version:"1.0",developer:"Michael Harris",developer_url:"http://www.jonesinternational.edu",c_owner:"Red Egg Software",sponsor:"Jones International University",sponsor_url:"http://www.jonesinternational.edu",license:"htmlArea"}; +ClientsideSpellcheck.prototype._lc=function(_8){ +return Xinha._lc(_8,"ClientsideSpellcheck"); +}; +ClientsideSpellcheck.prototype.buttonPress=function(_9){ +try{ +var _a=new ActiveXObject("ieSpell.ieSpellExtension"); +_a.CheckAllLinkedDocuments(document); +} +catch(exception){ +if(exception.number==-2146827859){ +if(confirm(this.lc("ieSpell not detected. Click Ok to go to download page."))){ +window.open("http://www.iespell.com/download.php","DownLoad"); +} +}else{ +alert(this.lc("ieSpell can only be used in Internet Explorer")); +} +} +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/img/clientside-spellcheck.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/img/clientside-spellcheck.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/img/he-spell-check.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/img/he-spell-check.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/de.js 3 Jan 2016 20:47:27 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// translated: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "Spell Check using ieSpell": "Englische Rechtschreibkontrolle mit ieSpell", + "ieSpell can only be used in Internet Explorer": "ieSpell kann nur mit dem Internet Explorer benutzt werden", + "ieSpell not detected. Click Ok to go to download page.": "ieSpell wurde nicht gefunden. Drücken sie Ok um ieSpeck herunter zu laden." +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/ja.js 3 Jan 2016 20:47:27 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Spell Check using ieSpell": "スペルチェックに ieSpell を使う", + "ieSpell can only be used in Internet Explorer": "ieSpell は Internet Explorer でのみ使用できます", + "ieSpell not detected. Click Ok to go to download page.": "ieSpell が検知されませんでした。OK をクリックしてダウンロードページを開いてください。" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/nb.js 3 Jan 2016 20:47:27 -0000 1.1.2.1 @@ -0,0 +1,3 @@ +// Dummy file + +{}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/nl.js 3 Jan 2016 20:47:28 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Spell Check using ieSpell": "Engelse spellingscontrole met ieSpell", + "ieSpell can only be used in Internet Explorer": "ieSpell kan alleen worden gebruikt in Internet Explorer", + "ieSpell not detected. Click Ok to go to download page.": "ieSpell werd niet gevonden. Klik op Ok om ieSpell te downloaden" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/lang/pt_br.js 3 Jan 2016 20:47:28 -0000 1.1.2.1 @@ -0,0 +1,18 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Spell Check using ieSpell": "Verificação Ortográfica utilizando ieSpell" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/1.pl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/1.pl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/1.pl 3 Jan 2016 20:47:28 -0000 1.1.2.1 @@ -0,0 +1,38 @@ +#! /usr/bin/perl -w + +use strict; + +my $file = 'context-menu.js'; +my $outfile = $file.'-i18n'; +my $langfile = 'en.js'; + +open FILE, "<$file"; +#open OUTFILE, ">$outfile"; +#open LANGFILE, ">$langfile"; +my %texts = (); +while () { + if (/"(.*?)"/) { + my $inline = $_; + chomp $inline; + my $key = $1; + my $val = $1; + print "Key: [$key]: "; + my $line = ; + if (defined $line) { + chomp $line; + if ($line =~ /(\S+)/) { + $key = $1; + print "-- using $key\n"; + } + $texts{$val} = $key; + } else { + print " -- skipped...\n"; + } + } +} +#close LANGFILE; +#close OUTFILE; +close FILE; + +print "\n\n\n"; +print '"', join("\"\n\"", sort keys %texts), '"', "\n"; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/ContextMenu.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/ContextMenu.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/ContextMenu.js 3 Jan 2016 20:47:28 -0000 1.1.2.1 @@ -0,0 +1,501 @@ +// Context Menu Plugin for HTMLArea-3.0 +// Sponsored by www.americanbible.org +// Implementation by Mihai Bazon, http://dynarch.com/mishoo/ +// +// (c) dynarch.com 2003. +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +// +// $Id: ContextMenu.js,v 1.1.2.1 2016/01/03 20:47:28 gustafn Exp $ + +Xinha.loadStyle("menu.css", "ContextMenu"); + +function ContextMenu(editor) { + this.editor = editor; +} + +ContextMenu._pluginInfo = { + name : "ContextMenu", + version : "1.0", + developer : "Mihai Bazon", + developer_url : "http://dynarch.com/mishoo/", + c_owner : "dynarch.com", + sponsor : "American Bible Society", + sponsor_url : "http://www.americanbible.org", + license : "htmlArea" +}; + +Xinha.Config.prototype.ContextMenu = { + disableMozillaSpellCheck : false, + customHooks : { } // 'a': [ ['Label', function() { alert('Action'); }, 'Tooltip', '/icon.jpg' ] ] +} + +ContextMenu.prototype.onGenerate = function() { + var self = this; + var doc = this.editordoc = this.editor._iframe.contentWindow.document; + Xinha._addEvents(doc, ["contextmenu"], + function (event) { + return self.popupMenu(Xinha.is_ie ? self.editor._iframe.contentWindow.event : event); + }); + this.currentMenu = null; + + if (this.editor.config.ContextMenu.disableMozillaSpellCheck) { + this.editordoc.body.spellcheck = false; // Firefox spellchecking is quite confusing for the user when they don't get the browser context menu + } +}; + +ContextMenu.prototype.getContextMenu = function(target) { + var self = this; + var editor = this.editor; + var config = editor.config; + var menu = []; + var tbo = this.editor.plugins.TableOperations; + if (tbo) tbo = tbo.instance; + + var selection = editor.hasSelectedText(); + if (!Xinha.is_gecko) { + if (selection) { + menu.push([ Xinha._lc("Cut", "ContextMenu"), function() { editor.execCommand("cut"); }, null, config.btnList["cut"][1] ], + [ Xinha._lc("Copy", "ContextMenu"), function() { editor.execCommand("copy"); }, null, config.btnList["copy"][1] ]); + menu.push([ Xinha._lc("Paste", "ContextMenu"), function() { editor.execCommand("paste"); }, null, config.btnList["paste"][1] ]); + } + } + var currentTarget = target; + var elmenus = []; + + var link = null; + var table = null; + var tr = null; + var td = null; + var img = null; + + function tableOperation(opcode) { + tbo.buttonPress(editor, opcode); + } + + function insertPara(after) { + var el = currentTarget; + var par = el.parentNode; + var p = editor._doc.createElement("p"); + p.appendChild(editor._doc.createElement("br")); + par.insertBefore(p, after ? el.nextSibling : el); + var sel = editor._getSelection(); + var range = editor._createRange(sel); + if (!Xinha.is_ie) { + sel.removeAllRanges(); + range.selectNodeContents(p); + range.collapse(true); + sel.addRange(range); + } else { + range.moveToElementText(p); + range.collapse(true); + range.select(); + } + } + + for (; target; target = target.parentNode) { + var tag = target.tagName; + if (!tag) + continue; + tag = tag.toLowerCase(); + switch (tag) { + case "img": + img = target; + elmenus.push(null, + [ Xinha._lc("_Image Properties...", "ContextMenu"), + function() { + editor._insertImage(img); + }, + Xinha._lc("Show the image properties dialog", "ContextMenu"), + config.btnList["insertimage"][1] ] + ); + break; + case "a": + link = target; + elmenus.push(null, + [ Xinha._lc("_Modify Link...", "ContextMenu"), + function() { editor.config.btnList['createlink'][3](editor); }, + Xinha._lc("Current URL is", "ContextMenu") + ': ' + link.href, + config.btnList["createlink"][1] ], + + [ Xinha._lc("Chec_k Link...", "ContextMenu"), + function() { window.open(link.href); }, + Xinha._lc("Opens this link in a new window", "ContextMenu") ], + + [ Xinha._lc("_Remove Link...", "ContextMenu"), + function() { + if (confirm(Xinha._lc("Please confirm that you want to unlink this element.", "ContextMenu") + "\n" + + Xinha._lc("Link points to:", "ContextMenu") + " " + link.href)) { + while (link.firstChild) + link.parentNode.insertBefore(link.firstChild, link); + link.parentNode.removeChild(link); + } + }, + Xinha._lc("Unlink the current element", "ContextMenu") ] + ); + break; + case "td": + td = target; + if (!tbo) break; + elmenus.push(null, + [ Xinha._lc("C_ell Properties...", "ContextMenu"), + function() { tableOperation("TO-cell-prop"); }, + Xinha._lc("Show the Table Cell Properties dialog", "ContextMenu"), + config.btnList["TO-cell-prop"][1] ], + + [ Xinha._lc("Insert Cell After", "ContextMenu"), + function() { tableOperation("TO-cell-insert-after"); }, + Xinha._lc("Insert Cell After", "ContextMenu"), + config.btnList["TO-cell-insert-after"][1] ], + + [ Xinha._lc("Insert Cell Before", "ContextMenu"), + function() { tableOperation("TO-cell-insert-before"); }, + Xinha._lc("Insert Cell After", "ContextMenu"), + config.btnList["TO-cell-insert-before"][1] ], + + [ Xinha._lc("Delete Cell", "ContextMenu"), + function() { tableOperation("TO-cell-delete"); }, + Xinha._lc("Delete Cell", "ContextMenu"), + config.btnList["TO-cell-delete"][1] ], + + [ Xinha._lc("Merge Cells", "ContextMenu"), + function() { tableOperation("TO-cell-merge"); }, + Xinha._lc("Merge Cells", "ContextMenu"), + config.btnList["TO-cell-merge"][1] ] + ); + break; + case "tr": + tr = target; + if (!tbo) break; + elmenus.push(null, + [ Xinha._lc("Ro_w Properties...", "ContextMenu"), + function() { tableOperation("TO-row-prop"); }, + Xinha._lc("Show the Table Row Properties dialog", "ContextMenu"), + config.btnList["TO-row-prop"][1] ], + + [ Xinha._lc("I_nsert Row Before", "ContextMenu"), + function() { tableOperation("TO-row-insert-above"); }, + Xinha._lc("Insert a new row before the current one", "ContextMenu"), + config.btnList["TO-row-insert-above"][1] ], + + [ Xinha._lc("In_sert Row After", "ContextMenu"), + function() { tableOperation("TO-row-insert-under"); }, + Xinha._lc("Insert a new row after the current one", "ContextMenu"), + config.btnList["TO-row-insert-under"][1] ], + + [ Xinha._lc("_Delete Row", "ContextMenu"), + function() { tableOperation("TO-row-delete"); }, + Xinha._lc("Delete the current row", "ContextMenu"), + config.btnList["TO-row-delete"][1] ] + ); + break; + case "table": + table = target; + if (!tbo) break; + elmenus.push(null, + [ Xinha._lc("_Table Properties...", "ContextMenu"), + function() { tableOperation("TO-table-prop"); }, + Xinha._lc("Show the Table Properties dialog", "ContextMenu"), + config.btnList["TO-table-prop"][1] ], + + [ Xinha._lc("Insert _Column Before", "ContextMenu"), + function() { tableOperation("TO-col-insert-before"); }, + Xinha._lc("Insert a new column before the current one", "ContextMenu"), + config.btnList["TO-col-insert-before"][1] ], + + [ Xinha._lc("Insert C_olumn After", "ContextMenu"), + function() { tableOperation("TO-col-insert-after"); }, + Xinha._lc("Insert a new column after the current one", "ContextMenu"), + config.btnList["TO-col-insert-after"][1] ], + + [ Xinha._lc("De_lete Column", "ContextMenu"), + function() { tableOperation("TO-col-delete"); }, + Xinha._lc("Delete the current column", "ContextMenu"), + config.btnList["TO-col-delete"][1] ] + ); + break; + case "body": + elmenus.push(null, + [ Xinha._lc("Justify Left", "ContextMenu"), + function() { editor.execCommand("justifyleft"); }, null, + config.btnList["justifyleft"][1] ], + [ Xinha._lc("Justify Center", "ContextMenu"), + function() { editor.execCommand("justifycenter"); }, null, + config.btnList["justifycenter"][1] ], + [ Xinha._lc("Justify Right", "ContextMenu"), + function() { editor.execCommand("justifyright"); }, null, + config.btnList["justifyright"][1] ], + [ Xinha._lc("Justify Full", "ContextMenu"), + function() { editor.execCommand("justifyfull"); }, null, + config.btnList["justifyfull"][1] ] + ); + break; + } + } + + if (selection && !link) + menu.push(null, [ Xinha._lc("Make lin_k...", "ContextMenu"), + function() { editor.config.btnList['createlink'][3](editor); }, + Xinha._lc("Create a link", "ContextMenu"), + config.btnList["createlink"][1] ]); + + if(editor.config.ContextMenu.customHooks[currentTarget.tagName.toLowerCase()]) + { + var items = editor.config.ContextMenu.customHooks[currentTarget.tagName.toLowerCase()]; + + for (var i = 0; i < items.length; ++i) + { + menu.push(items[i]); + } + } + + for (var i = 0; i < elmenus.length; ++i) + menu.push(elmenus[i]); + + if (!/html|body/i.test(currentTarget.tagName)) + menu.push(null, + [ Xinha._lc({string: "Remove the $elem Element...", replace: {elem: "<" + currentTarget.tagName + ">"}}, "ContextMenu"), + function() { + if (confirm(Xinha._lc("Please confirm that you want to remove this element:", "ContextMenu") + " " + + currentTarget.tagName)) { + var el = currentTarget; + var p = el.parentNode; + p.removeChild(el); + if (Xinha.is_gecko) { + if (p.tagName.toLowerCase() == "td" && !p.hasChildNodes()) + p.appendChild(editor._doc.createElement("br")); + editor.forceRedraw(); + editor.focusEditor(); + editor.updateToolbar(); + if (table) { + var save_collapse = table.style.borderCollapse; + table.style.borderCollapse = "collapse"; + table.style.borderCollapse = "separate"; + table.style.borderCollapse = save_collapse; + } + } + } + }, + Xinha._lc("Remove this node from the document", "ContextMenu") ], + [ Xinha._lc("Insert paragraph before", "ContextMenu"), + function() { insertPara(false); }, + Xinha._lc("Insert a paragraph before the current node", "ContextMenu") ], + [ Xinha._lc("Insert paragraph after", "ContextMenu"), + function() { insertPara(true); }, + Xinha._lc("Insert a paragraph after the current node", "ContextMenu") ] + ); + if (!menu[0]) menu.shift(); //If the menu begins with a separator, remove it for cosmetical reasons + return menu; +}; + +ContextMenu.prototype.popupMenu = function(ev) { + var self = this; + if (this.currentMenu) + { + this.closeMenu(); + } + function getPos(el) { + var r = { x: el.offsetLeft, y: el.offsetTop }; + if (el.offsetParent) { + var tmp = getPos(el.offsetParent); + r.x += tmp.x; + r.y += tmp.y; + } + return r; + } + function documentClick(ev) { + ev || (ev = window.event); + if (!self.currentMenu) { + alert(Xinha._lc("How did you get here? (Please report!)", "ContextMenu")); + return false; + } + var el = Xinha.is_ie ? ev.srcElement : ev.target; + for (; el != null && el != self.currentMenu; el = el.parentNode); + if (el == null) + self.closeMenu(); + //Xinha._stopEvent(ev); + //return false; + } + var keys = []; + function keyPress(ev) { + ev || (ev = window.event); + Xinha._stopEvent(ev); + if (ev.keyCode == 27) { + self.closeMenu(); + return false; + } + var key = String.fromCharCode(Xinha.is_ie ? ev.keyCode : ev.charCode).toLowerCase(); + for (var i = keys.length; --i >= 0;) { + var k = keys[i]; + if (k[0].toLowerCase() == key) + k[1].__msh.activate(); + } + } + self.closeMenu = function() { + self.currentMenu.parentNode.removeChild(self.currentMenu); + self.currentMenu = null; + Xinha._removeEvent(document, "mousedown", documentClick); + Xinha._removeEvent(self.editordoc, "mousedown", documentClick); + if (keys.length > 0) + Xinha._removeEvent(self.editordoc, "keypress", keyPress); + if (Xinha.is_ie) + self.iePopup.hide(); + } + var target = Xinha.is_ie ? ev.srcElement : ev.target; + var ifpos = getPos(self.editor._htmlArea);//_iframe); + var x = ev.clientX + ifpos.x; + var y = ev.clientY + ifpos.y; + + var div; + var doc; + if (!Xinha.is_ie) { + doc = document; + } else { + // IE stinks + var popup = this.iePopup = window.createPopup(); + doc = popup.document; + doc.open(); + doc.write(""); + doc.close(); + } + div = doc.createElement("div"); + if (Xinha.is_ie) + div.unselectable = "on"; + div.oncontextmenu = function() { return false; }; + div.className = "htmlarea-context-menu"; + if (!Xinha.is_ie) { + div.style.visibility = "hidden"; + div.style.left = div.style.top = "-200px"; + } + doc.body.appendChild(div); + + var table = doc.createElement("table"); + div.appendChild(table); + table.cellSpacing = 0; + table.cellPadding = 0; + var parent = doc.createElement("tbody"); + table.appendChild(parent); + + var options = this.getContextMenu(target); + for (var i = 0; i < options.length; ++i) { + var option = options[i]; + var item = doc.createElement("tr"); + parent.appendChild(item); + if (Xinha.is_ie) + item.unselectable = "on"; + else item.onmousedown = function(ev) { + Xinha._stopEvent(ev); + return false; + }; + if (!option) { + item.className = "separator"; + var td = doc.createElement("td"); + td.className = "icon"; + var IE_IS_A_FUCKING_SHIT = '>'; + if (Xinha.is_ie) { + td.unselectable = "on"; + IE_IS_A_FUCKING_SHIT = " unselectable='on' style='height=1px'> "; + } + td.innerHTML = ""; + var td1 = td.cloneNode(true); + td1.className = "label"; + item.appendChild(td); + item.appendChild(td1); + } else { + var label = option[0]; + item.className = "item"; + item.__msh = { + item: item, + label: label, + action: option[1], + tooltip: option[2] || null, + icon: option[3] || null, + activate: function() { + self.closeMenu(); + self.editor.focusEditor(); + this.action(); + } + }; + label = label.replace(/_([a-zA-Z0-9])/, "$1"); + if (label != option[0]) + keys.push([ RegExp.$1, item ]); + label = label.replace(/__/, "_"); + var td1 = doc.createElement("td"); + if (Xinha.is_ie) + td1.unselectable = "on"; + item.appendChild(td1); + td1.className = "icon"; + if (item.__msh.icon) + { + var t = Xinha.makeBtnImg(item.__msh.icon, doc); + td1.appendChild(t); + } + var td2 = doc.createElement("td"); + if (Xinha.is_ie) + td2.unselectable = "on"; + item.appendChild(td2); + td2.className = "label"; + td2.innerHTML = label; + item.onmouseover = function() { + this.className += " hover"; + self.editor._statusBarTree.innerHTML = this.__msh.tooltip || ' '; + }; + item.onmouseout = function() { this.className = "item"; }; + item.oncontextmenu = function(ev) { + this.__msh.activate(); + if (!Xinha.is_ie) + Xinha._stopEvent(ev); + return false; + }; + item.onmouseup = function(ev) { + var timeStamp = (new Date()).getTime(); + if (timeStamp - self.timeStamp > 500) + this.__msh.activate(); + if (!Xinha.is_ie) + Xinha._stopEvent(ev); + return false; + }; + //if (typeof option[2] == "string") + //item.title = option[2]; + } + } + + if (!Xinha.is_ie) { + /* keep then menu from overflowing the client window boundaries */ + + /* provide a virtual margin to leave a swoosh of air between the + meny and the window edge. This should probably go into the menu + container css as margin 10px instead... + */ + var margin = 10; + + if (y + div.offsetHeight + margin > window.innerHeight) + y = window.innerHeight - div.offsetHeight - margin; + if (x + div.offsetWidth + margin > window.innerWidth) + x = window.innerWidth - div.offsetWidth - margin; + + div.style.left = x + "px"; + div.style.top = y + "px"; + div.style.visibility = "visible"; + + } else { + // To get the size we need to display the popup with some width/height + // then we can get the actual size of the div and redisplay the popup at the + // correct dimensions. + this.iePopup.show(ev.screenX, ev.screenY, 300,50); + var w = div.offsetWidth; + var h = div.offsetHeight; + this.iePopup.show(ev.screenX, ev.screenY, w, h); + } + + this.currentMenu = div; + this.timeStamp = (new Date()).getTime(); + + Xinha._addEvent(document, "mousedown", documentClick); + Xinha._addEvent(this.editordoc, "mousedown", documentClick); + if (keys.length > 0) + Xinha._addEvent(this.editordoc, "keypress", keyPress); + + Xinha._stopEvent(ev); + return false; +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/context-menu.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/context-menu.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/context-menu.js 3 Jan 2016 20:47:28 -0000 1.1.2.1 @@ -0,0 +1,390 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/ContextMenu/context-menu.js */ +Xinha.loadStyle("menu.css","ContextMenu"); +function ContextMenu(_1){ +this.editor=_1; +} +ContextMenu._pluginInfo={name:"ContextMenu",version:"1.0",developer:"Mihai Bazon",developer_url:"http://dynarch.com/mishoo/",c_owner:"dynarch.com",sponsor:"American Bible Society",sponsor_url:"http://www.americanbible.org",license:"htmlArea"}; +Xinha.Config.prototype.ContextMenu={disableMozillaSpellCheck:false}; +ContextMenu.prototype.onGenerate=function(){ +var _2=this; +var _3=this.editordoc=this.editor._iframe.contentWindow.document; +Xinha._addEvents(_3,["contextmenu"],function(_4){ +return _2.popupMenu(Xinha.is_ie?_2.editor._iframe.contentWindow.event:_4); +}); +this.currentMenu=null; +if(this.editor.config.ContextMenu.disableMozillaSpellCheck){ +this.editordoc.body.spellcheck=false; +} +}; +ContextMenu.prototype.getContextMenu=function(_5){ +var _6=this; +var _7=this.editor; +var _8=_7.config; +var _9=[]; +var _a=this.editor.plugins.TableOperations; +if(_a){ +_a=_a.instance; +} +var _b=_7.hasSelectedText(); +if(!Xinha.is_gecko){ +if(_b){ +_9.push([Xinha._lc("Cut","ContextMenu"),function(){ +_7.execCommand("cut"); +},null,_8.btnList["cut"][1]],[Xinha._lc("Copy","ContextMenu"),function(){ +_7.execCommand("copy"); +},null,_8.btnList["copy"][1]]); +_9.push([Xinha._lc("Paste","ContextMenu"),function(){ +_7.execCommand("paste"); +},null,_8.btnList["paste"][1]]); +} +} +var _c=_5; +var _d=[]; +var _e=null; +var _f=null; +var tr=null; +var td=null; +var img=null; +function tableOperation(_13){ +_a.buttonPress(_7,_13); +} +function insertPara(_14){ +var el=_c; +var par=el.parentNode; +var p=_7._doc.createElement("p"); +p.appendChild(_7._doc.createElement("br")); +par.insertBefore(p,_14?el.nextSibling:el); +var sel=_7._getSelection(); +var _19=_7._createRange(sel); +if(!Xinha.is_ie){ +sel.removeAllRanges(); +_19.selectNodeContents(p); +_19.collapse(true); +sel.addRange(_19); +}else{ +_19.moveToElementText(p); +_19.collapse(true); +_19.select(); +} +} +for(;_5;_5=_5.parentNode){ +var tag=_5.tagName; +if(!tag){ +continue; +} +tag=tag.toLowerCase(); +switch(tag){ +case "img": +img=_5; +_d.push(null,[Xinha._lc("_Image Properties...","ContextMenu"),function(){ +_7._insertImage(img); +},Xinha._lc("Show the image properties dialog","ContextMenu"),_8.btnList["insertimage"][1]]); +break; +case "a": +_e=_5; +_d.push(null,[Xinha._lc("_Modify Link...","ContextMenu"),function(){ +_7.config.btnList["createlink"][3](_7); +},Xinha._lc("Current URL is","ContextMenu")+": "+_e.href,_8.btnList["createlink"][1]],[Xinha._lc("Chec_k Link...","ContextMenu"),function(){ +window.open(_e.href); +},Xinha._lc("Opens this link in a new window","ContextMenu")],[Xinha._lc("_Remove Link...","ContextMenu"),function(){ +if(confirm(Xinha._lc("Please confirm that you want to unlink this element.","ContextMenu")+"\n"+Xinha._lc("Link points to:","ContextMenu")+" "+_e.href)){ +while(_e.firstChild){ +_e.parentNode.insertBefore(_e.firstChild,_e); +} +_e.parentNode.removeChild(_e); +} +},Xinha._lc("Unlink the current element","ContextMenu")]); +break; +case "td": +td=_5; +if(!_a){ +break; +} +_d.push(null,[Xinha._lc("C_ell Properties...","ContextMenu"),function(){ +tableOperation("TO-cell-prop"); +},Xinha._lc("Show the Table Cell Properties dialog","ContextMenu"),_8.btnList["TO-cell-prop"][1]],[Xinha._lc("Insert Cell After","ContextMenu"),function(){ +tableOperation("TO-cell-insert-after"); +},Xinha._lc("Insert Cell After","ContextMenu"),_8.btnList["TO-cell-insert-after"][1]],[Xinha._lc("Insert Cell Before","ContextMenu"),function(){ +tableOperation("TO-cell-insert-before"); +},Xinha._lc("Insert Cell After","ContextMenu"),_8.btnList["TO-cell-insert-before"][1]],[Xinha._lc("Delete Cell","ContextMenu"),function(){ +tableOperation("TO-cell-delete"); +},Xinha._lc("Delete Cell","ContextMenu"),_8.btnList["TO-cell-delete"][1]],[Xinha._lc("Merge Cells","ContextMenu"),function(){ +tableOperation("TO-cell-merge"); +},Xinha._lc("Merge Cells","ContextMenu"),_8.btnList["TO-cell-merge"][1]]); +break; +case "tr": +tr=_5; +if(!_a){ +break; +} +_d.push(null,[Xinha._lc("Ro_w Properties...","ContextMenu"),function(){ +tableOperation("TO-row-prop"); +},Xinha._lc("Show the Table Row Properties dialog","ContextMenu"),_8.btnList["TO-row-prop"][1]],[Xinha._lc("I_nsert Row Before","ContextMenu"),function(){ +tableOperation("TO-row-insert-above"); +},Xinha._lc("Insert a new row before the current one","ContextMenu"),_8.btnList["TO-row-insert-above"][1]],[Xinha._lc("In_sert Row After","ContextMenu"),function(){ +tableOperation("TO-row-insert-under"); +},Xinha._lc("Insert a new row after the current one","ContextMenu"),_8.btnList["TO-row-insert-under"][1]],[Xinha._lc("_Delete Row","ContextMenu"),function(){ +tableOperation("TO-row-delete"); +},Xinha._lc("Delete the current row","ContextMenu"),_8.btnList["TO-row-delete"][1]]); +break; +case "table": +_f=_5; +if(!_a){ +break; +} +_d.push(null,[Xinha._lc("_Table Properties...","ContextMenu"),function(){ +tableOperation("TO-table-prop"); +},Xinha._lc("Show the Table Properties dialog","ContextMenu"),_8.btnList["TO-table-prop"][1]],[Xinha._lc("Insert _Column Before","ContextMenu"),function(){ +tableOperation("TO-col-insert-before"); +},Xinha._lc("Insert a new column before the current one","ContextMenu"),_8.btnList["TO-col-insert-before"][1]],[Xinha._lc("Insert C_olumn After","ContextMenu"),function(){ +tableOperation("TO-col-insert-after"); +},Xinha._lc("Insert a new column after the current one","ContextMenu"),_8.btnList["TO-col-insert-after"][1]],[Xinha._lc("De_lete Column","ContextMenu"),function(){ +tableOperation("TO-col-delete"); +},Xinha._lc("Delete the current column","ContextMenu"),_8.btnList["TO-col-delete"][1]]); +break; +case "body": +_d.push(null,[Xinha._lc("Justify Left","ContextMenu"),function(){ +_7.execCommand("justifyleft"); +},null,_8.btnList["justifyleft"][1]],[Xinha._lc("Justify Center","ContextMenu"),function(){ +_7.execCommand("justifycenter"); +},null,_8.btnList["justifycenter"][1]],[Xinha._lc("Justify Right","ContextMenu"),function(){ +_7.execCommand("justifyright"); +},null,_8.btnList["justifyright"][1]],[Xinha._lc("Justify Full","ContextMenu"),function(){ +_7.execCommand("justifyfull"); +},null,_8.btnList["justifyfull"][1]]); +break; +} +} +if(_b&&!_e){ +_9.push(null,[Xinha._lc("Make lin_k...","ContextMenu"),function(){ +_7.config.btnList["createlink"][3](_7); +},Xinha._lc("Create a link","ContextMenu"),_8.btnList["createlink"][1]]); +} +for(var i=0;i<_d.length;++i){ +_9.push(_d[i]); +} +if(!/html|body/i.test(_c.tagName)){ +_9.push(null,[Xinha._lc({string:"Remove the $elem Element...",replace:{elem:"<"+_c.tagName+">"}},"ContextMenu"),function(){ +if(confirm(Xinha._lc("Please confirm that you want to remove this element:","ContextMenu")+" "+_c.tagName)){ +var el=_c; +var p=el.parentNode; +p.removeChild(el); +if(Xinha.is_gecko){ +if(p.tagName.toLowerCase()=="td"&&!p.hasChildNodes()){ +p.appendChild(_7._doc.createElement("br")); +} +_7.forceRedraw(); +_7.focusEditor(); +_7.updateToolbar(); +if(_f){ +var _1e=_f.style.borderCollapse; +_f.style.borderCollapse="collapse"; +_f.style.borderCollapse="separate"; +_f.style.borderCollapse=_1e; +} +} +} +},Xinha._lc("Remove this node from the document","ContextMenu")],[Xinha._lc("Insert paragraph before","ContextMenu"),function(){ +insertPara(false); +},Xinha._lc("Insert a paragraph before the current node","ContextMenu")],[Xinha._lc("Insert paragraph after","ContextMenu"),function(){ +insertPara(true); +},Xinha._lc("Insert a paragraph after the current node","ContextMenu")]); +} +if(!_9[0]){ +_9.shift(); +} +return _9; +}; +ContextMenu.prototype.popupMenu=function(ev){ +var _20=this; +if(this.currentMenu){ +this.closeMenu(); +} +function getPos(el){ +var r={x:el.offsetLeft,y:el.offsetTop}; +if(el.offsetParent){ +var tmp=getPos(el.offsetParent); +r.x+=tmp.x; +r.y+=tmp.y; +} +return r; +} +function documentClick(ev){ +ev||(ev=window.event); +if(!_20.currentMenu){ +alert(Xinha._lc("How did you get here? (Please report!)","ContextMenu")); +return false; +} +var el=Xinha.is_ie?ev.srcElement:ev.target; +for(;el!=null&&el!=_20.currentMenu;el=el.parentNode){ +} +if(el==null){ +_20.closeMenu(); +} +} +var _26=[]; +function keyPress(ev){ +ev||(ev=window.event); +Xinha._stopEvent(ev); +if(ev.keyCode==27){ +_20.closeMenu(); +return false; +} +var key=String.fromCharCode(Xinha.is_ie?ev.keyCode:ev.charCode).toLowerCase(); +for(var i=_26.length;--i>=0;){ +var k=_26[i]; +if(k[0].toLowerCase()==key){ +k[1].__msh.activate(); +} +} +} +_20.closeMenu=function(){ +_20.currentMenu.parentNode.removeChild(_20.currentMenu); +_20.currentMenu=null; +Xinha._removeEvent(document,"mousedown",documentClick); +Xinha._removeEvent(_20.editordoc,"mousedown",documentClick); +if(_26.length>0){ +Xinha._removeEvent(_20.editordoc,"keypress",keyPress); +} +if(Xinha.is_ie){ +_20.iePopup.hide(); +} +}; +var _2b=Xinha.is_ie?ev.srcElement:ev.target; +var _2c=getPos(_20.editor._htmlArea); +var x=ev.clientX+_2c.x; +var y=ev.clientY+_2c.y; +var div; +var doc; +if(!Xinha.is_ie){ +doc=document; +}else{ +var _31=this.iePopup=window.createPopup(); +doc=_31.document; +doc.open(); +doc.write(""); +doc.close(); +} +div=doc.createElement("div"); +if(Xinha.is_ie){ +div.unselectable="on"; +} +div.oncontextmenu=function(){ +return false; +}; +div.className="htmlarea-context-menu"; +if(!Xinha.is_ie){ +div.style.left=div.style.top="0px"; +} +doc.body.appendChild(div); +var _32=doc.createElement("table"); +div.appendChild(_32); +_32.cellSpacing=0; +_32.cellPadding=0; +var _33=doc.createElement("tbody"); +_32.appendChild(_33); +var _34=this.getContextMenu(_2b); +for(var i=0;i<_34.length;++i){ +var _36=_34[i]; +var _37=doc.createElement("tr"); +_33.appendChild(_37); +if(Xinha.is_ie){ +_37.unselectable="on"; +}else{ +_37.onmousedown=function(ev){ +Xinha._stopEvent(ev); +return false; +}; +} +if(!_36){ +_37.className="separator"; +var td=doc.createElement("td"); +td.className="icon"; +var _3a=">"; +if(Xinha.is_ie){ +td.unselectable="on"; +_3a=" unselectable='on' style='height=1px'> "; +} +td.innerHTML=""; +var td1=td.cloneNode(true); +td1.className="label"; +_37.appendChild(td); +_37.appendChild(td1); +}else{ +var _3c=_36[0]; +_37.className="item"; +_37.__msh={item:_37,label:_3c,action:_36[1],tooltip:_36[2]||null,icon:_36[3]||null,activate:function(){ +_20.closeMenu(); +_20.editor.focusEditor(); +this.action(); +}}; +_3c=_3c.replace(/_([a-zA-Z0-9])/,"$1"); +if(_3c!=_36[0]){ +_26.push([RegExp.$1,_37]); +} +_3c=_3c.replace(/__/,"_"); +var td1=doc.createElement("td"); +if(Xinha.is_ie){ +td1.unselectable="on"; +} +_37.appendChild(td1); +td1.className="icon"; +if(_37.__msh.icon){ +var t=Xinha.makeBtnImg(_37.__msh.icon,doc); +td1.appendChild(t); +} +var td2=doc.createElement("td"); +if(Xinha.is_ie){ +td2.unselectable="on"; +} +_37.appendChild(td2); +td2.className="label"; +td2.innerHTML=_3c; +_37.onmouseover=function(){ +this.className+=" hover"; +_20.editor._statusBarTree.innerHTML=this.__msh.tooltip||" "; +}; +_37.onmouseout=function(){ +this.className="item"; +}; +_37.oncontextmenu=function(ev){ +this.__msh.activate(); +if(!Xinha.is_ie){ +Xinha._stopEvent(ev); +} +return false; +}; +_37.onmouseup=function(ev){ +var _41=(new Date()).getTime(); +if(_41-_20.timeStamp>500){ +this.__msh.activate(); +} +if(!Xinha.is_ie){ +Xinha._stopEvent(ev); +} +return false; +}; +} +} +if(!Xinha.is_ie){ +div.style.left=x+"px"; +div.style.top=y+"px"; +}else{ +this.iePopup.show(ev.screenX,ev.screenY,300,50); +var w=div.offsetWidth; +var h=div.offsetHeight; +this.iePopup.show(ev.screenX,ev.screenY,w,h); +} +this.currentMenu=div; +this.timeStamp=(new Date()).getTime(); +Xinha._addEvent(document,"mousedown",documentClick); +Xinha._addEvent(this.editordoc,"mousedown",documentClick); +if(_26.length>0){ +Xinha._addEvent(this.editordoc,"keypress",keyPress); +} +Xinha._stopEvent(ev); +return false; +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/menu.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/menu.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/menu.css 3 Jan 2016 20:47:28 -0000 1.1.2.1 @@ -0,0 +1,67 @@ +/* styles for the ContextMenu /HTMLArea */ +/* The ContextMenu plugin is (c) dynarch.com 2003. */ +/* Distributed under the same terms as HTMLArea itself */ + +div.htmlarea-context-menu { + position: absolute; + border: 1px solid #aca899; + padding: 2px; + background-color: #fff; + color: #000; + cursor: default; + z-index: 1000; +} + +div.htmlarea-context-menu table { + font: 11px tahoma,verdana,sans-serif; + border-collapse: collapse; +} + +div.htmlarea-context-menu tr.item td.icon img { +/* taken care of by xinha.makeBtnImg() */ +/* width: 18px; */ +/* height: 18px; */ +} + +div.htmlarea-context-menu tr.item td.icon { + padding: 0px 3px; + width: 18px; + height: 18px; + background-color: #cdf; +} + +div.htmlarea-context-menu tr.item td.label { + padding: 1px 10px 1px 3px; +} + +div.htmlarea-context-menu tr.separator td { + padding: 2px 0px; +} + +div.htmlarea-context-menu tr.separator td div { + border-top: 1px solid #aca899; + overflow: hidden; + position: relative; +} + +div.htmlarea-context-menu tr.separator td.icon { + background-color: #cdf; +} + +div.htmlarea-context-menu tr.separator td.icon div { +/* margin-left: 3px; */ + border-color: #fff; +} + +div.htmlarea-context-menu tr.separator td.label div { + margin-right: 3px; +} + +div.htmlarea-context-menu tr.item.hover { + background-color: #316ac5; + color: #fff; +} + +div.htmlarea-context-menu tr.item.hover td.icon { + background-color: #619af5; +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/de.js 3 Jan 2016 20:47:29 -0000 1.1.2.1 @@ -0,0 +1,50 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// translated: Raimund Meyer xinha@ray-of-light.org +{ + "Cut": "Ausschneiden", + "Copy": "Kopieren", + "Paste": "Einfügen", + "_Image Properties...": "Eigenschaften", + "Show the image properties dialog": "Fenster für die Bildoptionen anzeigen", + "_Modify Link...": "Link ändern", + "Current URL is": "Aktuelle URL ist", + "Chec_k Link...": "Link testen", + "Opens this link in a new window": "Diesen Link in neuem Fenster öffnen", + "_Remove Link...": "Link entfernen", + "Please confirm that you want to unlink this element.": "Wollen sie diesen Link wirklich entfernen?", + "Link points to:": "Link zeigt auf:", + "Unlink the current element": "Link auf Element entfernen", + "C_ell Properties...": "Zellenoptionen", + "Show the Table Cell Properties dialog": "Zellenoptionen anzeigen", + "Ro_w Properties...": "Zeilenoptionen", + "Show the Table Row Properties dialog": "Zeilenoptionen anzeigen", + "I_nsert Row Before": "Zeile einfügen vor Position", + "Insert a new row before the current one": "Zeile einfügen vor der aktuellen Position", + "In_sert Row After": "Zeile einügen nach Position", + "Insert a new row after the current one": "Zeile einfügen nach der aktuellen Position", + "_Delete Row": "Zeile löschen", + "Delete the current row": "Zeile löschen", + "_Table Properties...": "Tabellenoptionen", + "Show the Table Properties dialog": "Tabellenoptionen anzeigen", + "Insert _Column Before": "Spalte einfügen vor Position", + "Insert a new column before the current one": "Spalte einfügen vor der aktuellen Position", + "Insert C_olumn After": "Spalte einfügen nach Position", + "Insert a new column after the current one": "Spalte einfügen nach der aktuellen Position", + "De_lete Column": "Spalte löschen", + "Delete the current column": "Spalte löschen", + "Justify Left": "Linksbündig", + "Justify Center": "Zentriert", + "Justify Right": "Rechtsbündig", + "Justify Full": "Blocksatz", + "Make lin_k...": "Link erstellen", + "Create a link": "Link erstellen", + "Remove the $elem Element...": "Element $elem entfernen...", + "Please confirm that you want to remove this element:": "Wollen sie dieses Element wirklich entfernen?", + "Remove this node from the document": "Dieses Element aus dem Dokument entfernen", + "Insert paragraph before": "Absatz einfügen vor Position", + "Insert a paragraph before the current node": "Absatz einfügen vor der aktuellen Position", + "Insert paragraph after": "Absatz einfügen hinter Position", + "Insert a paragraph after the current node": "Absatz einfügen hinter der aktuellen Position", + "How did you get here? (Please report!)": "Wie sind Sie denn hier hin gekommen? (Please report!)" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/el.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/el.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/el.js 3 Jan 2016 20:47:29 -0000 1.1.2.1 @@ -0,0 +1,47 @@ +// I18N constants +// LANG: "el", ENCODING: UTF-8 +// Author: Dimitris Glezos, dimitris@glezos.com +{ + "Cut": "ΑποκοπΞ�", + "Copy": "ΑντιγραφΞ�", + "Paste": "Ξ•Ο€ΞΉΞΊΟŒΞ»Ξ»Ξ·ΟƒΞ·", + "_Image Properties...": "Ξ™Ξ΄ΞΉΟŒΟ„Ξ·Ο„Ξ΅Ο‚ Ξ•ΞΉΞΊΟŒΞ½Ξ±Ο‚...", + "_Modify Link...": "Ξ�ροποποίηση συνδέσμου...", + "Chec_k Link...": "ΞˆΞ»Ξ΅Ξ³Ο‡ΞΏΟ‚ συνδέσμων...", + "_Remove Link...": "ΔιαγραφΞ� συνδέσμου...", + "C_ell Properties...": "Ξ™Ξ΄ΞΉΟŒΟ„Ξ·Ο„Ξ΅Ο‚ κΡλιού...", + "Ro_w Properties...": "Ξ™Ξ΄ΞΉΟŒΟ„Ξ·Ο„Ξ΅Ο‚ γραμμΞ�Ο‚...", + "I_nsert Row Before": "ΕισαγωγΞ� γραμμΞ�Ο‚ πριν", + "In_sert Row After": "ΕισαγωγΞ� γραμμΞ�Ο‚ μΡτά", + "_Delete Row": "ΔιαγραφΞ� γραμμΞ�Ο‚", + "_Table Properties...": "Ξ™Ξ΄ΞΉΟŒΟ„Ξ·Ο„Ξ΅Ο‚ πίνακα...", + "Insert _Column Before": "ΕισαγωγΞ� στΞ�λης πριν", + "Insert C_olumn After": "ΕισαγωγΞ� στΞ�λης μΡτά", + "De_lete Column": "ΔιαγραφΞ� στΞ�λης", + "Justify Left": "Στοίχηση ΑριστΡρά", + "Justify Center": "Στοίχηση ΞšΞ­Ξ½Ο„ΟΞΏ", + "Justify Right": "Στοίχηση ΔΡξιά", + "Justify Full": "Ξ Ξ»Ξ�ρης Στοίχηση", + "Make lin_k...": "Δημιουργία συνδέσμου...", + "Remove the $elem Element...": "ΑφαίρΡση $elem στοιχΡίου...", + "Please confirm that you want to remove this element:": "ΕίστΡ Ξ²Ξ­Ξ²Ξ±ΞΉΞΏΟ‚ πως θέλΡτΡ Ξ½Ξ± αφαιρέσΡτΡ το στοιχΡίο ", + "Remove this node from the document": "ΑφαίρΡση αυτού του ΞΊΟŒΞΌΞ²ΞΏΟ… Ξ±Ο€ΟŒ το έγγραφο", + "How did you get here? (Please report!)": "Ξ ΟŽΟ‚ Ξ�ρθατΡ μέχρι Ρδώ; (ΠαρακαλούμΡ αναφέρΡτΡ το!)", + "Show the image properties dialog": "Εμφάνιση Ξ΄ΞΉΞ±Ξ»ΟŒΞ³ΞΏΟ… ΞΌΞ΅ τις Ξ™Ξ΄ΞΉΟŒΟ„Ξ·Ο„Ξ΅Ο‚ Ξ΅ΞΉΞΊΟŒΞ½Ξ±Ο‚", + "Modify URL": "Ξ�ροποποίηση URL", + "Current URL is": "Ξ�ΞΏ τρέχων URL Ρίναι", + "Opens this link in a new window": "ΑνοίγΡι Ξ±Ο…Ο„ΟŒ τον σύνδΡσμο σΡ Ξ­Ξ½Ξ± Ξ½Ξ­ΞΏ παράθυρο", + "Please confirm that you want to unlink this element.": "ΕίστΡ Ξ²Ξ­Ξ²Ξ±ΞΉΞΏΟ‚ πως θέλΡτΡ Ξ½Ξ± αφαιρέσΡτΡ τον σύνδΡσμο Ξ±Ο€ΟŒ Ξ±Ο…Ο„ΟŒ το στοιχΡίο:", + "Link points to:": "Ο σύνδΡμος οδηγΡί Ρδώ:", + "Unlink the current element": "ΑφαίρΡση συνδέσμου Ξ±Ο€ΟŒ το Ο€Ξ±ΟΟŽΞ½ στοιχΡίο", + "Show the Table Cell Properties dialog": "Εμφάνιση Ξ΄ΞΉΞ±Ξ»ΟŒΞ³ΞΏΟ… ΞΌΞ΅ τις Ξ™Ξ΄ΞΉΟŒΟ„Ξ·Ο„Ξ΅Ο‚ κΡλιού Ξ Ξ―Ξ½Ξ±ΞΊΞ±", + "Show the Table Row Properties dialog": "Εμφάνιση Ξ΄ΞΉΞ±Ξ»ΟŒΞ³ΞΏΟ… ΞΌΞ΅ τις Ξ™Ξ΄ΞΉΟŒΟ„Ξ·Ο„Ξ΅Ο‚ γραμμΞ�Ο‚ Ξ Ξ―Ξ½Ξ±ΞΊΞ±", + "Insert a new row before the current one": "ΕισαγωγΞ� ΞΌΞΉΞ±Ο‚ Ξ½Ξ­Ξ±Ο‚ γραμμΞ�Ο‚ πριν την ΡπιλΡγμένη", + "Insert a new row after the current one": "ΕισαγωγΞ� ΞΌΞΉΞ±Ο‚ Ξ½Ξ­Ξ±Ο‚ γραμμΞ�Ο‚ μΡτά την ΡπιλΡγμένη", + "Delete the current row": "ΔιαγραφΞ� ΡπιλΡγμένης γραμμΞ�Ο‚", + "Show the Table Properties dialog": "Εμφάνιση Ξ΄ΞΉΞ±Ξ»ΟŒΞ³ΞΏΟ… ΞΌΞ΅ τις Ξ™Ξ΄ΞΉΟŒΟ„Ξ·Ο„Ξ΅Ο‚ Ξ Ξ―Ξ½Ξ±ΞΊΞ±", + "Insert a new column before the current one": "ΕισαγωγΞ� Ξ½Ξ­Ξ±Ο‚ στΞ�λης πριν την ΡπιλΡγμένη", + "Insert a new column after the current one": "ΕισαγωγΞ� Ξ½Ξ­Ξ±Ο‚ στΞ�λης μΡτά την ΡπιλΡγμένη", + "Delete the current column": "ΔιαγραφΞ� ΡπιλΡγμένης στΞ�λης", + "Create a link": "Δημιουργία συνδέσμου" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/es.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/es.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/es.js 3 Jan 2016 20:47:29 -0000 1.1.2.1 @@ -0,0 +1,51 @@ +// I18N constants +// LANG: "es", ENCODING: UTF-8 +// translated: Derick Leony +{ + "Cut": "Cortar", + "Copy": "Copiar", + "Paste": "Pegar", + "_Image Properties...": "_Propiedades de imagen...", + "_Modify Link...": "_Modificar hipervínculo...", + "Chec_k Link...": "_Verificar hipervínculo...", + "_Remove Link...": "_Suprimir hipervínculo...", + "C_ell Properties...": "P_ropiedades de celda...", + "Ro_w Properties...": "Pr_opiedades de la fila...", + "I_nsert Row Before": "_Insertar fila delante", + "In_sert Row After": "I_nsertar fila detrás", + "_Delete Row": "S_uprimir fila", + "_Table Properties...": "Propi_edades de la tabla...", + "Insert _Column Before": "Insert_ar columna delante", + "Insert C_olumn After": "Insertar _columna detrás", + "De_lete Column": "_Suprimir columna", + "Justify Left": "Alinear a la izquierda", + "Justify Center": "Centrar", + "Justify Right": "Alinear a la derecha", + "Justify Full": "Justificar", + "Make lin_k...": "Convertir en _hipervínculo...", + "Remove the $elem Element...": "Suprimir el elemento $elem...", + "Insert paragraph before": "Insertar párrafo delante", + "Insert paragraph after": "Insertar párrafo detrás", + "Please confirm that you want to remove this element:": "Por favor, confirme que desea suprimir este elemento:", + "Remove this node from the document": "Suprimir este nodo del documento", + "How did you get here? (Please report!)": "¿Cómo ha llegado aquí? (¡Por favor reporte el error!)", + "Show the image properties dialog": "Mostrar el diálogo de propiedades de imagen", + "Modify URL": "Modificar URL", + "Current URL is": "La URL actual es", + "Opens this link in a new window": "Abre este hipervínculo en una ventana nueva", + "Please confirm that you want to unlink this element.": "Por favor, confirme que desea suprimir el hipervínculo de este elemento.", + "Link points to:": "El hipervínculo apunta a:", + "Unlink the current element": "Suprimir el hipervínculo del elemento actual", + "Show the Table Cell Properties dialog": "Mostrar el diálogo Propiedades de la Celda", + "Show the Table Row Properties dialog": "Mostrar el diálogo Propiedades de la Fila", + "Insert a new row before the current one": "Insertar una fila nueva antes de la actual", + "Insert a new row after the current one": "Insertar una fila nueva después de la actual", + "Delete the current row": "Suprimir la fila actual", + "Show the Table Properties dialog": "Mostrar el diálogo Propiedades de la Tabla", + "Insert a new column before the current one": "Insertar una columna nueva antes de la actual", + "Insert a new column after the current one": "Insertar una columna nueva después de la actual", + "Delete the current column": "Suprimir la columna actual", + "Create a link": "Crear un hipervínculo", + "Insert a paragraph before the current node": "Insertar un párrafo antes del nodo actual", + "Insert a paragraph after the current node": "Insertar un párrafo después del nodo actual" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/fr.js 3 Jan 2016 20:47:29 -0000 1.1.2.1 @@ -0,0 +1,50 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Cut": "Couper", + "Copy": "Copier", + "Paste": "Coller", + "_Image Properties...": "_Propriétés de l'image...", + "_Modify Link...": "_Modifier le lien...", + "Chec_k Link...": "_Vérifier le lien...", + "_Remove Link...": "_Supprimer le lien...", + "C_ell Properties...": "P_ropriétés de la cellule...", + "Ro_w Properties...": "Pr_opriétés de la rangée...", + "I_nsert Row Before": "Insérer une rangée a_vant", + "In_sert Row After": "Insér_er une rangée après", + "_Delete Row": "Suppr_imer une rangée", + "_Table Properties...": "Proprié_tés de la table...", + "Insert _Column Before": "I_nsérer une colonne avant", + "Insert C_olumn After": "Insérer une colonne après", + "De_lete Column": "_Supprimer la colonne", + "Justify Left": "Aligner à gauche", + "Justify Center": "Aligner au centre", + "Justify Right": "Aligner à droite", + "Justify Full": "Justifier", + "Make lin_k...": "Convertir en lien...", + "Remove the $elem Element...": "Supprimer Élément $elem...", + "Insert paragraph before": "Insérer un paragraphe avant", + "Insert paragraph after": "Insérer un paragraphe après", + "Please confirm that you want to remove this element:": "Confirmer la suppression de cet élément:", + "Remove this node from the document": "Supprimer ce noeud du document", + "How did you get here? (Please report!)": "Comment êtes-vous arrivé ici ? (Reportez le bug SVP !)", + "Show the image properties dialog": "Afficher le dialogue des propriétés d'image", + "Modify URL": "Modifier l'URL", + "Current URL is": "L'URL courante est", + "Opens this link in a new window": "Ouvrir ce lien dans une nouvelle fenêtre", + "Please confirm that you want to unlink this element.": "Voulez-vous vraiment enlever le lien présent sur cet élément.", + "Link points to:": "Le lien pointe sur:", + "Unlink the current element": "Enlever le lien sur cet élément", + "Show the Table Cell Properties dialog": "Afficher la boite de propriété des cellules", + "Show the Table Row Properties dialog": "Afficher la boite de propriété des rangées", + "Insert a new row before the current one": "Insérer une nouvelle rangée avant celle-ci", + "Insert a new row after the current one": "Insérer une nouvelle rangée après celle-ci", + "Delete the current row": "Supprimer la rangée courante", + "Show the Table Properties dialog": "Afficher la boite de propriété de tableau", + "Insert a new column before the current one": "Insérer une nouvelle rangée avant celle-ci", + "Insert a new column after the current one": "Insérer une nouvelle colonne après celle-ci", + "Delete the current column": "Supprimer cette colonne", + "Create a link": "Créer un lien", + "Insert a paragraph before the current node": "Insérer un paragraphe avant le noeud courant", + "Insert a paragraph after the current node": "Insérer un paragraphe après le noeud courant" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/he.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/he.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/he.js 3 Jan 2016 20:47:30 -0000 1.1.2.1 @@ -0,0 +1,47 @@ +// I18N constants +// LANG: "he", ENCODING: UTF-8 +// Author: Liron Newman, http://www.eesh.net, +{ + "Cut": "גזור", + "Copy": "העתק", + "Paste": "הדבק", + "_Image Properties...": "_מאפייני תמונה...", + "_Modify Link...": "_שנה קישור...", + "Chec_k Link...": "בדו_ק קישור...", + "_Remove Link...": "_הסר קישור...", + "C_ell Properties...": "מאפייני ת_א...", + "Ro_w Properties...": "מאפייני _טור...", + "I_nsert Row Before": "ה_כנס שורה לפני", + "In_sert Row After": "הכנ_ס שורה אחרי", + "_Delete Row": "_מחק שורה", + "_Table Properties...": "מאפייני ט_בלה...", + "Insert _Column Before": "הכנס _טור לפני", + "Insert C_olumn After": "הכנס ט_ור אחרי", + "De_lete Column": "מח_ק טור", + "Justify Left": "ישור לשמאל", + "Justify Center": "ישור למרכז", + "Justify Right": "ישור לימין", + "Justify Full": "ישור לשורה מלאה", + "Make lin_k...": "צור קי_שור...", + "Remove the $elem Element...": "הסר את אלמנט ה- $elem...", + "Please confirm that you want to remove this element:": "אנא אשר שברצונך להסיר את האלמנט הזה:", + "Remove this node from the document": "הסרה של node זה מהמסמך", + "How did you get here? (Please report!)": "איך הגעת הנה? (אנא דווח!)", + "Show the image properties dialog": "מציג את חלון הדו-שיח של מאפייני תמונה", + "Modify URL": "שינוי URL", + "Current URL is": "URL נוכחי הוא", + "Opens this link in a new window": "פתיחת קישור זה בחלון חדש", + "Please confirm that you want to unlink this element.": "אנא אשר שאתה רוצה לנתק את אלמנט זה.", + "Link points to:": "הקישור מצביע אל:", + "Unlink the current element": "ניתוק את האלמנט הנוכחי", + "Show the Table Cell Properties dialog": "מציג את חלון הדו-שיח של מאפייני תא בטבלה", + "Show the Table Row Properties dialog": "מציג את חלון הדו-שיח של מאפייני שורה בטבלה", + "Insert a new row before the current one": "הוספת שורה חדשה לפני הנוכחית", + "Insert a new row after the current one": "הוספת שורה חדשה אחרי הנוכחית", + "Delete the current row": "מחיקת את השורה הנוכחית", + "Show the Table Properties dialog": "מציג את חלון הדו-שיח של מאפייני טבלה", + "Insert a new column before the current one": "הוספת טור חדש לפני הנוכחי", + "Insert a new column after the current one": "הוספת טור חדש אחרי הנוכחי", + "Delete the current column": "מחיקת את הטור הנוכחי", + "Create a link": "יצירת קישור" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/ja.js 3 Jan 2016 20:47:30 -0000 1.1.2.1 @@ -0,0 +1,53 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Cut": "切り取り", + "Copy": "コピー", + "Paste": "貼り付け", + "_Image Properties...": "画像のプロパティ(_I)...", + "Show the image properties dialog": "この画像のプロパティダイアログを表示します", + "_Modify Link...": "リンクの修正(_M)...", + "Current URL is": "現在のURL", + "Chec_k Link...": "リンクを確認(_K)...", + "Opens this link in a new window": "このリンクを新しいウィンドウで開きます", + "_Remove Link...": "リンクの削除(_R)", + "Please confirm that you want to unlink this element.": "この要素のリンクを削除します。よろしいですか。", + "Link points to:": "リンク先:", + "Unlink the current element": "この要素のリンクを解除", + "C_ell Properties...": "セルのプロパティ(_E)...", + "Ro_w Properties...": "行のプロパティ(_W)...", + "Show the Table Row Properties dialog": "テーブル行のプロパティダイアログを表示します", + "I_nsert Row Before": "上に行を挿入(_N)", + "Insert a new row before the current one": "選択中の行の上に一行挿入します", + "In_sert Row After": "下に行を挿入(_S)", + "Insert a new row after the current one": "選択中の行の下に一行挿入します", + "_Delete Row": "行の削除(_D)", + "Delete the current row": "選択中の行を削除します", + "_Table Properties...": "テーブルのプロパティ(_T)...", + "Show the Table Properties dialog": "テーブルのプロパティダイアログを表示します", + "Insert _Column Before": "左に列を挿入(_C)", + "Insert a new column before the current one": "選択中の列の左に一列挿入します", + "Insert C_olumn After": "右に列を挿入(_O)", + "Insert a new column after the current one": "選択中の列の右に一列挿入します", + "De_lete Column": "列の削除(_L)", + "Delete the current column": "選択中の列を削除します", + "Justify Left": "左寄せ", + "Justify Center": "中央寄せ", + "Justify Right": "右寄せ", + "Justify Full": "均等割付", + "Make lin_k...": "リンクの作成(_K)...", + "Create a link": "新たなリンクを作成します", + "Remove the $elem Element...": "$elem 要素を削除 ...", + "Please confirm that you want to remove this element:": "この要素を削除します。よろしいですか。:", + "Remove this node from the document": "ドキュメントからこのノードを削除します", + "Insert paragraph before": "前に段落を挿入", + "Insert a paragraph before the current node": "選択中のノードの手前に段落を挿入します", + "Insert paragraph after": "後に段落を挿入", + "Insert a paragraph after the current node": "選択中のノードの後に段落を挿入します", + "How did you get here? (Please report!)": "どうやってここに来ましたか?(どうか報告を!)", + "Show the Table Cell Properties dialog": "テーブルセルのプロパティダイアログを表示します", + "Insert Cell Before": "前にセルを挿入", + "Insert Cell After": "後にセルを挿入", + "Delete Cell": "セルの削除", + "Merge Cells": "セルの結合" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/nb.js 3 Jan 2016 20:47:30 -0000 1.1.2.1 @@ -0,0 +1,53 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +// Used key commands +// C,D,e, ,I, ,k,k,l,M, ,n,o,R, ,s,T, ,w : English +// H B j R m F v : Norwegian +{ + "Cut": "Klipp ut", + "Copy": "Kopier", + "Paste": "Lim inn", + "_Image Properties...": "_Bildeegenskaper...", + "Show the image properties dialog": "Vis bildeegenskaper", + "_Modify Link...": "_Rediger Link...", + "Current URL is": "Gjeldende URL er", + "Chec_k Link...": "Sje_kk Link...", + "Opens this link in a new window": "Åpner denne link i nytt vindu", + "_Remove Link...": "_Fjerne Link...", + "Please confirm that you want to unlink this element.": "Vennligst bekreft at du ønsker å fjerne link på elementet", + "Link points to:": "Link peker til:", + "Unlink the current element": "Fjerne link på gjeldende element", + "C_ell Properties...": "C_elleegenskaper...", + "Show the Table Cell Properties dialog": "Vis egenskaper for celle", + "Ro_w Properties...": "Rad Egenskaper... (_w)", + "Show the Table Row Properties dialog": "Vis egenskaper for rad", + "I_nsert Row Before": "Sett I_nn rad før", + "Insert a new row before the current one": "Sett inn ny rad før gjeldende", + "In_sert Row After": "_Sett inn rad etter", + "Insert a new row after the current one": "Sett inn ny rad etter gjeldende", + "_Delete Row": "Slett rad (_d)", + "Delete the current row": "Slett gjeldende rad", + "_Table Properties...": "_Tabellegenskaper...", + "Show the Table Properties dialog": "Vis egenskaper for tabellen", + "Insert _Column Before": "Sett inn kolonne etter (_c)", + "Insert a new column before the current one": "Sett inn kolonne før gjeldende", + "Insert C_olumn After": "Sett inn k_olonne etter", + "Insert a new column after the current one": "Sett inn kolonne etter gjeldende", + "De_lete Column": "S_lett kolonne", + "Delete the current column": "Slett gjeldende kolonne", + "Justify Left": "_Venstrejuster", + "Justify Center": "_Midtjuster", + "Justify Right": "_Høyrejuster", + "Justify Full": "Blokk_juster", + "Make lin_k...": "Lag len_ke...", + "Create a link": "Lag ny link", + "Remove the $elem Element...": "Fjerne $elem elementet...", + "Please confirm that you want to remove this element:": "Vennligst bekreft at du ønsker å fjerne elementet:", + "Remove this node from the document": "Fjerne denne node fra dokumentet", + "Insert paragraph before": "Sett inn paragraf før", + "Insert a paragraph before the current node": "Sett inn paragraf før gjeldende node", + "Insert paragraph after": "Sett inn paragraf etter", + "Insert a paragraph after the current node": "Sett inn paragraf etter gjeldende node", + "How did you get here? (Please report!)": "Hva skjedde? (Vennligst beskriv)" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/nl.js 3 Jan 2016 20:47:30 -0000 1.1.2.1 @@ -0,0 +1,47 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl +{ + "Cut": "Knippen", + "Copy": "Kopiëren", + "Paste": "Plakken", + "_Image Properties...": "Eigenschappen afbeelding...", + "_Modify Link...": "Hyperlin_k aanpassen...", + "Chec_k Link...": "Controleer hyperlin_k...", + "_Remove Link...": "Ve_rwijder hyperlink...", + "C_ell Properties...": "C_eleigenschappen...", + "Ro_w Properties...": "Rijeigenscha_ppen...", + "I_nsert Row Before": "Rij invoegen boven", + "In_sert Row After": "Rij invoegen onder", + "_Delete Row": "Rij _verwijderen", + "_Table Properties...": "_Tabeleigenschappen...", + "Insert _Column Before": "Kolom invoegen voor", + "Insert C_olumn After": "Kolom invoegen na", + "De_lete Column": "Kolom verwijderen", + "Justify Left": "Links uitlijnen", + "Justify Center": "Centreren", + "Justify Right": "Rechts uitlijnen", + "Justify Full": "Uitvullen", + "Make lin_k...": "Maak hyperlin_k...", + "Remove the $elem Element...": "Verwijder het $elem element...", + "Please confirm that you want to remove this element:": "Is het werkelijk de bedoeling dit element te verwijderen:", + "Remove this node from the document": "Verwijder dit punt van het document", + "How did you get here? (Please report!)": "Hoe kwam je hier? (A.U.B. doorgeven!)", + "Show the image properties dialog": "Laat het afbeeldingseigenschappen dialog zien", + "Modify URL": "Aanpassen URL", + "Current URL is": "Huidig URL is", + "Opens this link in a new window": "Opend deze hyperlink in een nieuw venster", + "Please confirm that you want to unlink this element.": "Is het werkelijk de bedoeling dit element te unlinken.", + "Link points to:": "Hyperlink verwijst naar:", + "Unlink the current element": "Unlink het huidige element", + "Show the Table Cell Properties dialog": "Laat de tabel celeigenschappen dialog zien", + "Show the Table Row Properties dialog": "Laat de tabel rijeigenschappen dialog zien", + "Insert a new row before the current one": "Voeg een nieuwe rij in boven de huidige", + "Insert a new row after the current one": "Voeg een nieuwe rij in onder de huidige", + "Delete the current row": "Verwijder de huidige rij", + "Show the Table Properties dialog": "Laat de tabel eigenschappen dialog zien", + "Insert a new column before the current one": "Voeg een nieuwe kolom in voor de huidige", + "Insert a new column after the current one": "Voeg een nieuwe kolom in na de huidige", + "Delete the current column": "Verwijder de huidige kolom", + "Create a link": "Maak een hyperlink" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/no.js 3 Jan 2016 20:47:30 -0000 1.1.2.1 @@ -0,0 +1,53 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +// Used key commands +// C,D,e, ,I, ,k,k,l,M, ,n,o,R, ,s,T, ,w : English +// H B j R m F v : Norwegian +{ + "Cut": "Klipp ut", + "Copy": "Kopier", + "Paste": "Lim inn", + "_Image Properties...": "_Bildeegenskaper...", + "Show the image properties dialog": "Vis bildeegenskaper", + "_Modify Link...": "_Rediger Link...", + "Current URL is": "Gjeldende URL er", + "Chec_k Link...": "Sje_kk Link...", + "Opens this link in a new window": "Åpner denne link i nytt vindu", + "_Remove Link...": "_Fjerne Link...", + "Please confirm that you want to unlink this element.": "Vennligst bekreft at du ønsker å fjerne link på elementet", + "Link points to:": "Link peker til:", + "Unlink the current element": "Fjerne link på gjeldende element", + "C_ell Properties...": "C_elleegenskaper...", + "Show the Table Cell Properties dialog": "Vis egenskaper for celle", + "Ro_w Properties...": "Rad Egenskaper... (_w)", + "Show the Table Row Properties dialog": "Vis egenskaper for rad", + "I_nsert Row Before": "Sett I_nn rad før", + "Insert a new row before the current one": "Sett inn ny rad før gjeldende", + "In_sert Row After": "_Sett inn rad etter", + "Insert a new row after the current one": "Sett inn ny rad etter gjeldende", + "_Delete Row": "Slett rad (_d)", + "Delete the current row": "Slett gjeldende rad", + "_Table Properties...": "_Tabellegenskaper...", + "Show the Table Properties dialog": "Vis egenskaper for tabellen", + "Insert _Column Before": "Sett inn kolonne etter (_c)", + "Insert a new column before the current one": "Sett inn kolonne før gjeldende", + "Insert C_olumn After": "Sett inn k_olonne etter", + "Insert a new column after the current one": "Sett inn kolonne etter gjeldende", + "De_lete Column": "S_lett kolonne", + "Delete the current column": "Slett gjeldende kolonne", + "Justify Left": "_Venstrejuster", + "Justify Center": "_Midtjuster", + "Justify Right": "_Høyrejuster", + "Justify Full": "Blokk_juster", + "Make lin_k...": "Lag len_ke...", + "Create a link": "Lag ny link", + "Remove the $elem Element...": "Fjerne $elem elementet...", + "Please confirm that you want to remove this element:": "Vennligst bekreft at du ønsker å fjerne elementet:", + "Remove this node from the document": "Fjerne denne node fra dokumentet", + "Insert paragraph before": "Sett inn paragraf før", + "Insert a paragraph before the current node": "Sett inn paragraf før gjeldende node", + "Insert paragraph after": "Sett inn paragraf etter", + "Insert a paragraph after the current node": "Sett inn paragraf etter gjeldende node", + "How did you get here? (Please report!)": "Hva skjedde? (Vennligst beskriv)" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/pl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/pl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/pl.js 3 Jan 2016 20:47:31 -0000 1.1.2.1 @@ -0,0 +1,50 @@ +// I18N constants +// LANG: "pl", ENCODING: UTF-8 +// translated: Krzysztof Kotowicz, http://www.eskot.krakow.pl/portfolio/, koto@webworkers.pl +{ + "Cut": "Wytnij", + "Copy": "Kopiuj", + "Paste": "Wklej", + "_Image Properties...": "Właściwości obrazka", + "Show the image properties dialog": "Pokaż okienko właściwości obrazka", + "_Modify Link...": "Zmień odnośnik", + "Current URL is": "Bieżący URL odnośnika", + "Chec_k Link...": "Sprawdź odnośnik", + "Opens this link in a new window": "Otwiera ten odnośnik w nowym oknie", + "_Remove Link...": "Usuń odnośnik", + "Please confirm that you want to unlink this element.": "Na pewno chcesz usunąć odnośnik?", + "Link points to:": "Odnośnik wskazuje na:", + "Unlink the current element": "Usuń odnośnik z zaznaczonego elementu", + "C_ell Properties...": "Właściwości komórki", + "Show the Table Cell Properties dialog": "Pokaż okno właściwości komórki", + "Ro_w Properties...": "Właściwości wiersza", + "Show the Table Row Properties dialog": "Pokaż okno właściwości wiersza", + "I_nsert Row Before": "Wstaw wiersz przed", + "Insert a new row before the current one": "Wstaw nowy wiersz przed bieżącym", + "In_sert Row After": "Wstaw wiersz po", + "Insert a new row after the current one": "Wstaw nowy wiersz po bieżącym", + "_Delete Row": "Usuń wiersz", + "Delete the current row": "Usuń bieżący wiersz", + "_Table Properties...": "Właściwości tabeli", + "Show the Table Properties dialog": "Pokaż okienko właściwości tabeli", + "Insert _Column Before": "Wstaw kolumnę przed", + "Insert a new column before the current one": "Wstaw nową kolumnę przed bieżącą", + "Insert C_olumn After": "Wstaw kolumnę po", + "Insert a new column after the current one": "Wstaw nową kolumnę po bieżącej", + "De_lete Column": "Usuń kolumnę", + "Delete the current column": "Usuwa bieżącą kolumnę", + "Justify Left": "Wyrównaj do lewej", + "Justify Center": "Wycentruj", + "Justify Right": "Wyrównaj do prawej", + "Justify Full": "Wyjustuj", + "Make lin_k...": "Utwórz odnośnik", + "Create a link": "Utwórz odnośnik", + "Remove the $elem Element...": "Usuń $elem...", + "Please confirm that you want to remove this element:": "Na pewno chcesz usunąć ten element?", + "Remove this node from the document": "Usuń ten element z dokumentu", + "Insert paragraph before": "Wstaw akapit przed", + "Insert a paragraph before the current node": "Wstaw akapit przed bieżącym elementem", + "Insert paragraph after": "Wstaw akapit po", + "Insert a paragraph after the current node": "Wstaw akapit po bieżącym elemencie", + "How did you get here? (Please report!)": "Jak tu trafiłeś (Proszę, podaj okoliczności!)" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/pt_br.js 3 Jan 2016 20:47:31 -0000 1.1.2.1 @@ -0,0 +1,65 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Brazilian Portuguese Translation +// Author: Marcio Barbosa, +// Site: www.mpg.com.br +// Please don´t remove this information - Por favor, não remova esta informação +// If you modify this source, please insert a comment with your name and e-mail +// Se modificar esta fonte, insira um comentário com seu nome e e-mail + +// Last revision: September 2007 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Cut": "Recortar", + "Copy": "Copiar", + "Paste": "Colar", + "_Image Properties...": "Propriedades da imagem...", + "Show the image properties dialog": "Mostrar a caixa de diálogo das Propriedades da imagem", + "_Modify Link...": "Modificar link", + "Current URL is": "A URL corrente é", + "Chec_k Link...": "Verificar Link...", + "Opens this link in a new window": "Abrir este link em uma nova janela", + "_Remove Link...": "Remover Link", + "Please confirm that you want to unlink this element.": "Por favor, confirme que deseja retirar o link do elemento.", + "Link points to:": "Link para:", + "Unlink the current element": "Remover link do elemento atual", + "C_ell Properties...": "Propriedades da célula", + "Show the Table Cell Properties dialog": "Mostrar caixa de diálogo de Propriedades da Célula", + "Ro_w Properties...": "Propriedades da Linha", + "Show the Table Row Properties dialog": "Mostrar caixa de diálogo de Propriedades da Linha", + "I_nsert Row Before": "Inserir linha antes deste ponto", + "Insert a new row before the current one": "Inserir uma nova linha antes desta", + "In_sert Row After": "Inserir linha depois deste ponto", + "Insert a new row after the current one": "Inserir uma linha após esta", + "_Delete Row": "Apagar linha", + "Delete the current row": "Apagar a linha atual", + "_Table Properties...": "Propriedades da Tabela", + "Show the Table Properties dialog": "Mostrar caixa de diálogo de Propriedades da Tabela", + "Insert _Column Before": "Inserir coluna antes deste ponto", + "Insert a new column before the current one": "Inserir uma nova coluna antes desta", + "Insert C_olumn After": "Inserir coluna após este ponto", + "Insert a new column after the current one": "Inserir uma nova coluna após esta", + "De_lete Column": "Apagar Coluna", + "Delete the current column": "Apagar a coluna atual", + "Justify Left": "Justificar à esquerda", + "Justify Center": "Justificar centralizado", + "Justify Right": "Justificar à direita", + "Justify Full": "Justificação completa", + "Make lin_k...": "Criar link...", + "Create a link": "Criar um novo link", + "Remove the $elem Element...": "Remover o elemento $elem...", + "Please confirm that you want to remove this element:": "Por favor, confirme que deseja remover este elemento:", + "Remove this node from the document": "Remover este nó do documento", + "Insert paragraph before": "Inserir um parágrafo antes", + "Insert a paragraph before the current node": "Inserir um parágrafo antes do nó atual", + "Insert paragraph after": "Inserir um parágrafo após", + "Insert a paragraph after the current node": "Inserir um parágrafo após o nó atual", + "How did you get here? (Please report!)": "Como você começou aqui? (Por favor, informe!)", + "Show the Table Cell Properties dialog": "Mostrar Propriedades da Tabelas", + "Insert Cell Before": "Inserir Célula Antes", + "Insert Cell After": "Inserir Célula Depois", + "Delete Cell": "Apagar Célula", + "Merge Cells": "Mesclar Células" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/sv.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/sv.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ContextMenu/lang/sv.js 3 Jan 2016 20:47:31 -0000 1.1.2.1 @@ -0,0 +1,54 @@ +// I18N constants +// LANG: "sv", ENCODING: UTF-8 +// Swedish version for rev. 477 (Mar 2006) by Thomas Loo + +// TODO: Proper keybindings +// C,D,e, ,I, ,k,k,l,M, ,n,o,R, ,s,T, ,w : English +// H B j R m F v : Swedish +{ + "Cut": "Klipp ut", + "Copy": "Kopiera", + "Paste": "Klistra in", + "_Image Properties...": "_Bildegenskaper...", + "Show the image properties dialog": "Visa bildegenskaper", + "_Modify Link...": "_Redigera Länk...", + "Current URL is": "Aktuellt URL är", + "Chec_k Link...": "Kontrollera länk...", + "Opens this link in a new window": "Öppna länk i nytt fönster", + "_Remove Link...": "_Ta bort länk...", + "Please confirm that you want to unlink this element.": "Bekräfta borttagning av länk", + "Link points to:": "Länken pekar mot:", + "Unlink the current element": "Ta bort länk kopplad till elementet", + "C_ell Properties...": "C_ellegenskaper...", + "Show the Table Cell Properties dialog": "Visa egenskaper for cellen", + "Ro_w Properties...": "Radegenskaper... (_w)", + "Show the Table Row Properties dialog": "Visa egenskaper för rad", + "I_nsert Row Before": "I_nfoga rad före", + "Insert a new row before the current one": "Infoga ny rad före aktuell", + "In_sert Row After": "Infoga rad efter aktuell rad", + "Insert a new row after the current one": "Infoga ny rad efter aktuell", + "_Delete Row": "Radera rad (_d)", + "Delete the current row": "T bort aktuell rad", + "_Table Properties...": "_Tabellegenskaper...", + "Show the Table Properties dialog": "Visa tabellegenskaper", + "Insert _Column Before": "Infoga kolumn efter (_c)", + "Insert a new column before the current one": "Infoga kolumn före aktuell", + "Insert C_olumn After": "Infoga k_olumn efter", + "Insert a new column after the current one": "Infoga kolumn efter aktuell", + "De_lete Column": "_Radera kolumn", + "Delete the current column": "Radera aktuell kolumn", + "Justify Left": "_Vänsterjustera", + "Justify Center": "_Centerjustera", + "Justify Right": "_Högerjustera", + "Justify Full": "Block_justera", + "Make lin_k...": "Skapa län_k...", + "Create a link": "SKapa ny länk", + "Remove the $elem Element...": "Radera elementet $elem...", + "Please confirm that you want to remove this element:": "Bekräfta borttagning av element:", + "Remove this node from the document": "Radera nod från dokumentet", + "Insert paragraph before": "Infoga paragraf före", + "Insert a paragraph before the current node": "Infoga paragraf före aktuell nod", + "Insert paragraph after": "Infoga paragraf efter", + "Insert a paragraph after the current node": "Infoga paragraf efter aktuell nod", + "How did you get here? (Please report!)": "Hur hamnade du här? (Beskriv förloppet)" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DefinitionList/DefinitionList.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DefinitionList/DefinitionList.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DefinitionList/DefinitionList.js 3 Jan 2016 20:47:31 -0000 1.1.2.1 @@ -0,0 +1,99 @@ +// DefinitionList plugin for Xinha +// Distributed under the same terms as Xinha itself. +// This notice MUST stay intact for use (see license.txt). + + +function DefinitionList(editor) { + this.editor = editor; + var cfg = editor.config; + var bl = DefinitionList.btnList; + var self = this; + // register the toolbar buttons provided by this plugin + for (var i = 0; i < bl.length; ++i) { + var btn = bl[i]; + if (!btn) { + continue; + } + var id = btn[0]; + cfg.registerButton(id, this._lc(btn[1]), editor.imgURL("ed_" + btn[0] + ".gif", "DefinitionList"), false, + function(editor, id) { + // dispatch button press event + self.buttonPress(editor, id); + }); + } + + // We'll insert the buttons next to the UL/OL buttons, if they exist. + // If neither of those buttons exists, addToolbarElement puts our buttons + // at the beginning of the toolbar, which is good enough. + cfg.addToolbarElement("dl", ["insertunorderedlist", "insertorderedlist"], 1); + cfg.addToolbarElement("dt", "dl", 1); + cfg.addToolbarElement("dd", "dt", 1); +} + +DefinitionList._pluginInfo = { + name : "DefinitionList", + version : "1.1", + developer : "Udo Schmal", + developer_url : "", + c_owner : "Udo Schmal", + license : "htmlArea" +}; + +// the list of buttons added by this plugin +DefinitionList.btnList = [ + ["dl", "definition list"], + ["dt", "definition term"], + ["dd", "definition description"] + ]; + +DefinitionList.prototype._lc = function(string) { + return Xinha._lc(string, 'DefinitionList'); +}; + +DefinitionList.prototype.onGenerate = function() { + this.editor.addEditorStylesheet(Xinha.getPluginDir('DefinitionList') + '/definition-list.css'); +}; + +DefinitionList.prototype.buttonPress = function(editor,button_id) { + var pe; + var dx; + if (button_id=='dl') { //definition list + pe = editor.getParentElement(); + if( pe.tagName.toLowerCase() != 'body' ) { + while (pe.parentNode.tagName.toLowerCase() != 'body') { + pe = pe.parentNode; + } + } + dx = editor._doc.createElement(button_id); + dx.innerHTML = ' '; + if( pe.tagName.toLowerCase() == 'body' ) { + pe.appendChild(dx); + }else if(pe.parentNode.lastChild==pe) { + pe.parentNode.appendChild(dx); + }else{ + pe.parentNode.insertBefore(dx,pe.nextSibling); + } + } else if ((button_id=='dt')||(button_id=='dd')) { //definition term or description + pe = editor.getParentElement(); + while (pe && (pe.nodeType == 1) && (pe.tagName.toLowerCase() != 'body')) { + if(pe.tagName.toLowerCase() == 'dl') { + dx = editor._doc.createElement(button_id); + dx.innerHTML = ' '; + pe.appendChild(dx); + break; + }else if((pe.tagName.toLowerCase() == 'dt')||(pe.tagName.toLowerCase() == 'dd')){ + dx = editor._doc.createElement(button_id); + dx.innerHTML = ' '; + if(pe.parentNode.lastChild==pe) { + pe.parentNode.appendChild(dx); + }else{ + pe.parentNode.insertBefore(dx,pe.nextSibling); + } + break; + } + pe = pe.parentNode; + } + if(pe.tagName.toLowerCase() == 'body') + alert('You can insert a definition term or description only in a definition list!'); + } +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DefinitionList/definition-list.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DefinitionList/definition-list.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DefinitionList/definition-list.css 3 Jan 2016 20:47:31 -0000 1.1.2.1 @@ -0,0 +1,15 @@ +dl { border: 1px dotted #800000; } +dt { + background-image: url(img/ed_dt.gif); + background-repeat: no-repeat; + background-position: left top; + padding-left: 19px; + color: #800000; +} +dd { + background-image: url(img/ed_dd.gif); + background-repeat: no-repeat; + background-position: left top; + padding-left: 19px; + color: #800000; +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DefinitionList/definition-list.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DefinitionList/definition-list.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DefinitionList/definition-list.js 3 Jan 2016 20:47:31 -0000 1.1.2.1 @@ -0,0 +1,74 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/DefinitionList/definition-list.js */ +function DefinitionList(_1){ +this.editor=_1; +var _2=_1.config; +var bl=DefinitionList.btnList; +var _4=this; +var _5=["linebreak"]; +for(var i=0;i +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "definition list": "Lista de definição", + "definition term": "Termo de definição", + "definition description": "Descrição de definição" +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DefinitionList/lang/ru.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DefinitionList/lang/ru.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DefinitionList/lang/ru.js 3 Jan 2016 20:47:33 -0000 1.1.2.1 @@ -0,0 +1,10 @@ +// I18N constants + +// LANG: "ru", ENCODING: UTF-8 + +// Author: Helen Mitkina (zerok) +{ + "definition list": "Список с определением", + "definition term": "Заголовок", + "definition description": "Пояснение" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DoubleClick/DoubleClick.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DoubleClick/DoubleClick.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DoubleClick/DoubleClick.js 3 Jan 2016 20:47:33 -0000 1.1.2.1 @@ -0,0 +1,66 @@ +// Double Click Plugin for Xinha +// Implementation by Marijn Kampf http://www.marijn.org +// Sponsored by http://www.smiling-faces.com +// +// (c) Marijn Kampf 2004. +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +// +// Cut-n-paste version of double click plugin. +// Almost no original code used. Based on +// Luis HTMLarea and Mihai Bazon Context Menu +// +// +// + +DoubleClick._pluginInfo = { + name : "DoubleClick", + version : "1.0", + developer : "Marijn Kampf", + developer_url : "http://www.marijn.org", + c_owner : "Marijn Kampf", + sponsor : "smiling-faces.com", + sponsor_url : "http://www.smiling-faces.com", + license : "htmlArea" +}; + +function DoubleClick(editor) { + this.editor = editor; + + // ADDING CUSTOM DOUBLE CLICK ACTIONS + // format of the dblClickList elements is "TAGNAME: [ ACTION ]" + // - TAGNAME: tagname of the tag that is double clicked + // - ACTION: function that gets called when the button is clicked. + // it has the following prototype: + // function(editor, event) + // - editor is the Xinha object that triggered the call + // - target is the selected object + this.editor.dblClickList = { + // Edit Link dialog + a: [ function(e) {e.config.btnList['createlink'][3](e); } ], + // Follow link + //a: [ function(editor, target) { window.location = target.href; properties(target); } ], + + img: [ function(e) {e.execCommand("insertimage");} ], + td: [ function(e) {e.execCommand("inserttable");} ] + }; +} + +DoubleClick.prototype.onGenerate = function() { + var self = this; + var doc = this.editordoc = this.editor._iframe.contentWindow.document; + Xinha._addEvents(doc, ["dblclick"], + function (event) { + return self.onDoubleClick(Xinha.is_ie ? self.editor._iframe.contentWindow.event : event); + }); + this.currentClick = null; +}; + +DoubleClick.prototype.onDoubleClick = function(ev) { + var target = Xinha.is_ie ? ev.srcElement : ev.target; + var tagName = target.tagName.toLowerCase(); + + if (this.editor.dblClickList[tagName] != undefined) { + this.editor.dblClickList[tagName][0](this.editor, target); + } +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DoubleClick/double-click.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DoubleClick/double-click.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DoubleClick/double-click.js 3 Jan 2016 20:47:33 -0000 1.1.2.1 @@ -0,0 +1,30 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/DoubleClick/double-click.js */ +DoubleClick._pluginInfo={name:"DoubleClick",version:"1.0",developer:"Marijn Kampf",developer_url:"http://www.marijn.org",c_owner:"Marijn Kampf",sponsor:"smiling-faces.com",sponsor_url:"http://www.smiling-faces.com",license:"htmlArea"}; +function DoubleClick(_1){ +this.editor=_1; +this.editor.dblClickList={a:[function(e){ +e.config.btnList["createlink"][3](e); +}],img:[function(e){ +e.execCommand("insertimage"); +}],td:[function(e){ +e.execCommand("inserttable"); +}]}; +} +DoubleClick.prototype.onGenerate=function(){ +var _5=this; +var _6=this.editordoc=this.editor._iframe.contentWindow.document; +Xinha._addEvents(_6,["dblclick"],function(_7){ +return _5.onDoubleClick(Xinha.is_ie?_5.editor._iframe.contentWindow.event:_7); +}); +this.currentClick=null; +}; +DoubleClick.prototype.onDoubleClick=function(ev){ +var _9=Xinha.is_ie?ev.srcElement:ev.target; +var _a=_9.tagName.toLowerCase(); +if(this.editor.dblClickList[_a]!=undefined){ +this.editor.dblClickList[_a][0](this.editor,_9); +} +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/DynamicCSS.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/DynamicCSS.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/DynamicCSS.js 3 Jan 2016 20:47:33 -0000 1.1.2.1 @@ -0,0 +1,237 @@ +// Dynamic CSS (className) plugin for HTMLArea +// Sponsored by http://www.systemconcept.de +// Implementation by Holger Hees +// +// (c) systemconcept.de 2004 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +function DynamicCSS(editor, args) { + this.editor = editor; + var cfg = editor.config; + var self = this; + +/*var cssArray=null; + var cssLength=0;*/ + var lastTag=null; + var lastClass=null; + + var css_class = { + id : "DynamicCSS-class", + tooltip : this._lc("Choose stylesheet"), + options : {"":""}, + action : function(editor) { self.onSelect(editor, this); }, + refresh : function(editor) { self.updateValue(editor, this); } + }; + cfg.registerDropdown(css_class); + cfg.addToolbarElement(["T[CSS]", "DynamicCSS-class", "separator"] , "formatblock", -1); +} + +DynamicCSS.parseStyleSheet=function(editor){ + iframe = editor._iframe.contentWindow.document; + + cssArray=DynamicCSS.cssArray; + if(!cssArray) cssArray=new Array(); + + for(i=0;i'; + } + else{ + className='none'; + if(tagName=='all') cssName=Xinha._lc("Default", 'DynamicCSS'); + else cssName='<'+Xinha._lc("Default", 'DynamicCSS')+'>'; + } + cssArray[tagName][className]=cssName; + DynamicCSS.cssLength++; + } + } + } + // ImportRule (Mozilla) + else if(cssRules[rule].styleSheet){ + cssArray=DynamicCSS.applyCSSRule(cssRules[rule].styleSheet.cssRules,cssArray); + } + } + return cssArray; +}; + +DynamicCSS._pluginInfo = { + name : "DynamicCSS", + version : "1.5.2", + developer : "Holger Hees", + developer_url : "http://www.systemconcept.de/", + c_owner : "Holger Hees", + sponsor : "System Concept GmbH", + sponsor_url : "http://www.systemconcept.de/", + license : "htmlArea" +}; + +DynamicCSS.prototype._lc = function(string) { + return Xinha._lc(string, 'DynamicCSS'); +}; + +DynamicCSS.prototype.onSelect = function(editor, obj) { + var tbobj = editor._toolbarObjects[obj.id]; + var index = tbobj.element.selectedIndex; + var className = tbobj.element.value; + + var parent = editor.getParentElement(); + + if(className!='none'){ + parent.className=className; + DynamicCSS.lastClass=className; + } + else{ + if(Xinha.is_gecko) parent.removeAttribute('class'); + else parent.removeAttribute('className'); + } + editor.updateToolbar(); +}; + +/*DynamicCSS.prototype.onMode = function(mode) { + if(mode=='wysiwyg'){ + // reparse possible changed css files + DynamicCSS.cssArray=null; + this.updateValue(this.editor,this.editor.config.customSelects["DynamicCSS-class"]); + } +}*/ + +DynamicCSS.prototype.reparseTimer = function(editor, obj, instance) { + // new attempt of rescan stylesheets in 1,2,4 and 8 second (e.g. for external css-files with longer initialisation) + if(DynamicCSS.parseCount<9){ + setTimeout(function () { + DynamicCSS.cssLength=0; + DynamicCSS.parseStyleSheet(editor); + if(DynamicCSS.cssOldLength!=DynamicCSS.cssLength){ + DynamicCSS.cssOldLength=DynamicCSS.cssLength; + DynamicCSS.lastClass=null; + instance.updateValue(editor, obj); + } + instance.reparseTimer(editor, obj, instance); + },DynamicCSS.parseCount*1000); + DynamicCSS.parseCount=DynamicCSS.parseCount*2; + } +}; + +DynamicCSS.prototype.updateValue = function(editor, obj) { + cssArray=DynamicCSS.cssArray; + // initial style init + if(!cssArray){ + DynamicCSS.cssLength=0; + DynamicCSS.parseStyleSheet(editor); + cssArray=DynamicCSS.cssArray; + DynamicCSS.cssOldLength=DynamicCSS.cssLength; + DynamicCSS.parseCount=1; + this.reparseTimer(editor,obj,this); + } + + var parent = editor.getParentElement(); + var tagName = parent.tagName.toLowerCase(); + var className = parent.className; + + if(this.lastTag!=tagName || this.lastClass!=className){ + this.lastTag=tagName; + this.lastClass=className; + + var select = editor._toolbarObjects[obj.id].element; + + while(select.length>0){ + select.options[select.length-1] = null; + } + + select.options[0]=new Option(this._lc("Default"),'none'); + if(cssArray){ + // style class only allowed if parent tag is not body or editor is in fullpage mode + if(tagName!='body' || editor.config.fullPage){ + if(cssArray[tagName]){ + for(cssClass in cssArray[tagName]){ + if(typeof cssArray[tagName][cssClass] != 'string') continue; + if(cssClass=='none') select.options[0]=new Option(cssArray[tagName][cssClass],cssClass); + else select.options[select.length]=new Option(cssArray[tagName][cssClass],cssClass); + } + } + + if(cssArray['all']){ + for(cssClass in cssArray['all']){ + if(typeof cssArray['all'][cssClass] != 'string') continue; + select.options[select.length]=new Option(cssArray['all'][cssClass],cssClass); + } + } + } + else if(cssArray[tagName] && cssArray[tagName]['none']) select.options[0]=new Option(cssArray[tagName]['none'],'none'); + } + + select.selectedIndex = 0; + + if (typeof className != "undefined" && /\S/.test(className)) { + var options = select.options; + for (var i = options.length; --i >= 0;) { + var option = options[i]; + if (className == option.value) { + select.selectedIndex = i; + break; + } + } + if(select.selectedIndex == 0){ + select.options[select.length]=new Option(this._lc("Undefined"),className); + select.selectedIndex=select.length-1; + } + } + + if(select.length>1) select.disabled=false; + else select.disabled=true; + } +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/de.js 3 Jan 2016 20:47:33 -0000 1.1.2.1 @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// Sponsored by http://www.systemconcept.de +// Author: Holger Hees, +// (c) systemconcept.de 2004 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Default": "Standard", + "Undefined": "Nicht definiert", + "Choose stylesheet": "Wählen Sie einen StyleSheet aus" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/fr.js 3 Jan 2016 20:47:34 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Default": "Défaut", + "Undefined": "Non défini", + "Choose stylesheet": "Choisir feuille de style" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/ja.js 3 Jan 2016 20:47:34 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Default": "なし", + "Undefined": "未定義", + "Choose stylesheet": "スタイルシートの選択" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/nb.js 3 Jan 2016 20:47:34 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Default": "Standard", + "Undefined": "Udefinert", + "Choose stylesheet": "Velg stilsett" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/nl.js 3 Jan 2016 20:47:34 -0000 1.1.2.1 @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Sponsored by http://www.systemconcept.de +// Author: Holger Hees, +// (c) systemconcept.de 2004 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Default": "Default", + "Undefined": "Ungedefinieerd", + "Choose stylesheet": "Kies stylesheet" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/no.js 3 Jan 2016 20:47:34 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Default": "Standard", + "Undefined": "Udefinert", + "Choose stylesheet": "Velg stilsett" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/DynamicCSS/lang/pt_br.js 3 Jan 2016 20:47:34 -0000 1.1.2.1 @@ -0,0 +1,21 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +{ + "Choose stylesheet": "Escolher estilo", + "Default": "Padrão", + "Undefined": "Indefinido" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/EditTag.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/EditTag.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/EditTag.js 3 Jan 2016 20:47:35 -0000 1.1.2.1 @@ -0,0 +1,56 @@ +// Character Map plugin for Xinha +// Sponsored by http://www.systemconcept.de +// Implementation by Holger Hees based on HTMLArea XTD 1.5 (http://mosforge.net/projects/htmlarea3xtd/) +// Original Author - Bernhard Pfeifer novocaine@gmx.net +// +// (c) systemconcept.de 2004 +// Distributed under the same terms as Xinha itself. +// This notice MUST stay intact for use (see license.txt). + +function EditTag(editor) { + this.editor = editor; + var cfg = editor.config; + var self = this; + + cfg.registerButton({ + id : "edittag", + tooltip : this._lc("Edit HTML for selected text"), + image : editor.imgURL("ed_edit_tag.gif", "EditTag"), + textMode : false, + action : function(editor) { + self.buttonPress(editor); + } + }); + + cfg.addToolbarElement("edittag", "htmlmode",1); + +} + +EditTag._pluginInfo = { + name : "EditTag", + version : "1.0", + developer : "Pegoraro Marco", + developer_url : "http://www.sin-italia.com/", + c_owner : "Marco Pegoraro", + sponsor : "Sin Italia", + sponsor_url : "http://www.sin-italia.com/", + license : "htmlArea" +}; + +EditTag.prototype._lc = function(string) { + return Xinha._lc(string, 'EditTag'); +}; + +EditTag.prototype.buttonPress = function(editor) { + // Costruzione dell'oggetto parametri da passare alla dialog. + outparam = { + content : editor.getSelectedHTML() + }; // Fine costruzione parametri per il passaggio alla dialog. + editor._popupDialog( "plugin://EditTag/edit_tag", function( html ) { + if ( !html ) { + //user must have pressed Cancel + return false; + } + editor.insertHTML( html ); + }, outparam); +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/edit-tag.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/edit-tag.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/edit-tag.js 3 Jan 2016 20:47:35 -0000 1.1.2.1 @@ -0,0 +1,26 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/EditTag/edit-tag.js */ +function EditTag(_1){ +this.editor=_1; +var _2=_1.config; +var _3=this; +_2.registerButton({id:"edittag",tooltip:this._lc("Edit HTML for selected text"),image:_1.imgURL("ed_edit_tag.gif","EditTag"),textMode:false,action:function(_4){ +_3.buttonPress(_4); +}}); +_2.addToolbarElement("edittag","htmlmode",1); +} +EditTag._pluginInfo={name:"EditTag",version:"1.0",developer:"Pegoraro Marco",developer_url:"http://www.sin-italia.com/",c_owner:"Marco Pegoraro",sponsor:"Sin Italia",sponsor_url:"http://www.sin-italia.com/",license:"htmlArea"}; +EditTag.prototype._lc=function(_5){ +return Xinha._lc(_5,"EditTag"); +}; +EditTag.prototype.buttonPress=function(_6){ +outparam={content:_6.getSelectedHTML()}; +_6._popupDialog("plugin://EditTag/edit_tag",function(_7){ +if(!_7){ +return false; +} +_6.insertHTML(_7); +},outparam); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/img/ed_edit_tag.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/img/ed_edit_tag.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/de.js 3 Jan 2016 20:47:35 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// translated: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "Edit HTML for selected text": "HTML im ausgewählten Bereich bearbeiten", + "Tag Editor": "HTML tag Editor" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/fr.js 3 Jan 2016 20:47:35 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Edit HTML for selected text": "Editer le code HTML du texte sélectionné", + "Tag Editor": "Editeur de tag HTML" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/ja.js 3 Jan 2016 20:47:36 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Edit HTML for selected text": "選択中テキストのHTMLを編集します", + "Tag Editor": "タグエディタ" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/nb.js 3 Jan 2016 20:47:36 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Edit HTML for selected text": "Rediger HTML for den valgte teksten" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/nl.js 3 Jan 2016 20:47:36 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Edit HTML for selected text": "HTML bewerken voor geselecteerde tekst", + "Tag Editor": "HTML tag Editor" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/no.js 3 Jan 2016 20:47:36 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Edit HTML for selected text": "Rediger HTML for den valgte teksten" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/lang/pt_br.js 3 Jan 2016 20:47:36 -0000 1.1.2.1 @@ -0,0 +1,22 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Cancel": "Cancelar", + "Edit HTML for selected text": "Editar HTML para texto selecionado", + "Edit Tag By Peg": "Editar Tag por Peg", + "OK": "OK", + "Tag Editor": "Editor de Tag" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/popups/edit_tag.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/popups/edit_tag.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EditTag/popups/edit_tag.html 3 Jan 2016 20:47:36 -0000 1.1.2.1 @@ -0,0 +1,38 @@ + + + + Edit Tag By Peg + + + + + + +
Tag Editor
+ +
+ + +
+ + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EnterParagraphs/enter-paragraphs.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EnterParagraphs/enter-paragraphs.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/EnterParagraphs/enter-paragraphs.js 3 Jan 2016 20:47:37 -0000 1.1.2.1 @@ -0,0 +1,1090 @@ +// tabs 2 + +/** +* @fileoverview By Adam Wright, for The University of Western Australia +* +* Distributed under the same terms as Xinha itself. +* This notice MUST stay intact for use (see license.txt). +* +* Heavily modified by Yermo Lamers of DTLink, LLC, College Park, Md., USA. +* For more info see http://www.areaedit.com +*/ + +/** +* plugin Info +*/ + +EnterParagraphs._pluginInfo = + { + name : "EnterParagraphs", + version : "1.0", + developer : "Adam Wright", + developer_url : "http://www.hipikat.org/", + sponsor : "The University of Western Australia", + sponsor_url : "http://www.uwa.edu.au/", + license : "htmlArea" + }; + +// ------------------------------------------------------------------ + +// "constants" + +/** +* Whitespace Regex +*/ + +EnterParagraphs.prototype._whiteSpace = /^\s*$/; + +/** +* The pragmatic list of which elements a paragraph may not contain +*/ + +EnterParagraphs.prototype._pExclusions = /^(address|blockquote|body|dd|div|dl|dt|fieldset|form|h1|h2|h3|h4|h5|h6|hr|li|noscript|ol|p|pre|table|ul)$/i; + +/** +* elements which may contain a paragraph +*/ + +EnterParagraphs.prototype._pContainers = /^(body|del|div|fieldset|form|ins|map|noscript|object|td|th)$/i; + +/** +* Elements which may not contain paragraphs, and would prefer a break to being split +*/ + +EnterParagraphs.prototype._pBreak = /^(address|pre|blockquote)$/i; + +/** +* Elements which may not contain children +*/ + +EnterParagraphs.prototype._permEmpty = /^(area|base|basefont|br|col|frame|hr|img|input|isindex|link|meta|param)$/i; + +/** +* Elements which count as content, as distinct from whitespace or containers +*/ + +EnterParagraphs.prototype._elemSolid = /^(applet|br|button|hr|img|input|table)$/i; + +/** +* Elements which should get a new P, before or after, when enter is pressed at either end +*/ + +EnterParagraphs.prototype._pifySibling = /^(address|blockquote|del|div|dl|fieldset|form|h1|h2|h3|h4|h5|h6|hr|ins|map|noscript|object|ol|p|pre|table|ul|)$/i; +EnterParagraphs.prototype._pifyForced = /^(ul|ol|dl|table)$/i; + +/** +* Elements which should get a new P, before or after a close parent, when enter is pressed at either end +*/ + +EnterParagraphs.prototype._pifyParent = /^(dd|dt|li|td|th|tr)$/i; + +// --------------------------------------------------------------------- + +/** +* EnterParagraphs Constructor +*/ + +function EnterParagraphs(editor) + { + + this.editor = editor; + + // [STRIP + // create a ddt debug trace object. There may be multiple editors on + // the page each EnterParagraphs .. to distinguish which instance + // is generating the message we tack on the name of the textarea. + + //this.ddt = new DDT( editor._textArea + ":EnterParagraphs Plugin" ); + + // uncomment to turn on debugging messages. + + //this.ddt._ddtOn(); + + //this.ddt._ddt( "enter-paragraphs.js","23", "EnterParagraphs(): constructor" ); + + // STRIP] + + // hook into the event handler to intercept key presses if we are using + // gecko (Mozilla/FireFox) + + if (Xinha.is_gecko) + { + //this.ddt._ddt( "enter-paragraphs.js","23", "EnterParagraphs(): we are gecko. Setting event handler." ); + this.onKeyPress = this.__onKeyPress; + } + + } // end of constructor. + +// ------------------------------------------------------------------ + +/** +* name member for debugging +* +* This member is used to identify objects of this class in debugging +* messages. +*/ + +EnterParagraphs.prototype.name = "EnterParagraphs"; + +/** +* Gecko's a bit lacking in some odd ways... +*/ + +EnterParagraphs.prototype.insertAdjacentElement = function(ref,pos,el) + { + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "122", "insertAdjacentElement(): top with pos '" + pos + "' ref:", ref ); + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "122", "insertAdjacentElement(): top with el:", el ); + + if ( pos == 'BeforeBegin' ) + { + ref.parentNode.insertBefore(el,ref); + } + else if ( pos == 'AfterEnd' ) + { + ref.nextSibling ? ref.parentNode.insertBefore(el,ref.nextSibling) : ref.parentNode.appendChild(el); + } + else if ( pos == 'AfterBegin' && ref.firstChild ) + { + ref.insertBefore(el,ref.firstChild); + } + else if ( pos == 'BeforeEnd' || pos == 'AfterBegin' ) + { + ref.appendChild(el); + } + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "122", "insertAdjacentElement(): bottom with ref:", ref ); + + }; // end of insertAdjacentElement() + +// ---------------------------------------------------------------- + +/** +* Passes a global parent node or document fragment to forEachNode +* +* @param root node root node to start search from. +* @param mode string function to apply to each node. +* @param direction string traversal direction "ltr" (left to right) or "rtl" (right_to_left) +* @param init boolean +*/ + +EnterParagraphs.prototype.forEachNodeUnder = function ( root, mode, direction, init ) + { + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "144", "forEachNodeUnder(): top mode is '" + mode + "' direction is '" + direction + "' starting with root node:", root ); + + // Identify the first and last nodes to deal with + + var start, end; + + // nodeType 11 is DOCUMENT_FRAGMENT_NODE which is a container. + + if ( root.nodeType == 11 && root.firstChild ) + { + start = root.firstChild; + end = root.lastChild; + } + else + { + start = end = root; + } + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "144", "forEachNodeUnder(): start node is:", start ); + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "144", "forEachNodeUnder(): initial end node is:", end ); + + // traverse down the right hand side of the tree getting the last child of the last + // child in each level until we reach bottom. + while ( end.lastChild ) + end = end.lastChild; + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "144", "forEachNodeUnder(): end node after descent is:", end ); + + return this.forEachNode( start, end, mode, direction, init); + + }; // end of forEachNodeUnder() + +// ----------------------------------------------------------------------- + +/** +* perform a depth first descent in the direction requested. +* +* @param left_node node "start node" +* @param right_node node "end node" +* @param mode string function to apply to each node. cullids or emptyset. +* @param direction string traversal direction "ltr" (left to right) or "rtl" (right_to_left) +* @param init boolean or object. +*/ + +EnterParagraphs.prototype.forEachNode = function (left_node, right_node, mode, direction, init) + { + + //this.ddt._ddt( "enter-paragraphs.js", "175", "forEachNode(): top - mode is:" + mode + "' direction '" + direction + "'" ); + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "175", "forEachNode(): top - left node is:", left_node ); + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "175", "forEachNode(): top - right node is:", right_node ); + + // returns "Brother" node either left or right. + + var getSibling = function(elem, direction) + { + return ( direction == "ltr" ? elem.nextSibling : elem.previousSibling ); + }; + + var getChild = function(elem, direction) + { + return ( direction == "ltr" ? elem.firstChild : elem.lastChild ); + }; + + var walk, lookup, fnReturnVal; + + // FIXME: init is a boolean in the emptyset case and an object in + // the cullids case. Used inconsistently. + + var next_node = init; + + // used to flag having reached the last node. + + var done_flag = false; + + // loop ntil we've hit the last node in the given direction. + // if we're going left to right that's the right_node and visa-versa. + + while ( walk != direction == "ltr" ? right_node : left_node ) + { + + // on first entry, walk here is null. So this is how + // we prime the loop with the first node. + + if ( !walk ) + { + walk = direction == "ltr" ? left_node : right_node; + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "175", "forEachNode(): !walk - current node is:", walk ); + } + else + { + + // is there a child node? + + if ( getChild(walk,direction) ) + { + + // descend down into the child. + + walk = getChild(walk,direction); + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "175", "forEachNode():descending to child node:", walk ); + + } + else + { + + // is there a sibling node on this level? + + if ( getSibling(walk,direction) ) + { + + // move to the sibling. + + walk = getSibling(walk,direction); + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "175", "forEachNode(): moving to sibling node:", walk ); + + } + else + { + lookup = walk; + + // climb back up the tree until we find a level where we are not the end + // node on the level (i.e. that we have a sibling in the direction + // we are searching) or until we reach the end. + + while ( !getSibling(lookup,direction) && lookup != (direction == "ltr" ? right_node : left_node) ) + { + lookup = lookup.parentNode; + } + + // did we find a level with a sibling? + + // walk = ( lookup.nextSibling ? lookup.nextSibling : lookup ) ; + + walk = ( getSibling(lookup,direction) ? getSibling(lookup,direction) : lookup ) ; + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "175", "forEachNode(): climbed back up (or found right node):", walk ); + + } + } + + } // end of else walk. + + // have we reached the end? either as a result of the top while loop or climbing + // back out above. + + done_flag = (walk==( direction == "ltr" ? right_node : left_node)); + + // call the requested function on the current node. Functions + // return an array. + // + // Possible functions are _fenCullIds, _fenEmptySet + // + // The situation is complicated by the fact that sometimes we want to + // return the base node and sometimes we do not. + // + // next_node can be an object (this.takenIds), a node (text, el, etc) or false. + + //this.ddt._ddt( "enter-paragraphs.js", "175", "forEachNode(): calling function" ); + + switch( mode ) + { + + case "cullids": + + fnReturnVal = this._fenCullIds(walk, next_node ); + break; + + case "find_fill": + + fnReturnVal = this._fenEmptySet(walk, next_node, mode, done_flag); + break; + + case "find_cursorpoint": + + fnReturnVal = this._fenEmptySet(walk, next_node, mode, done_flag); + break; + + } + + // If this node wants us to return, return next_node + + if ( fnReturnVal[0] ) + { + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "175", "forEachNode(): returning node:", fnReturnVal[1] ); + + return fnReturnVal[1]; + } + + // are we done with the loop? + + if ( done_flag ) + { + break; + } + + // Otherwise, pass to the next node + + if ( fnReturnVal[1] ) + { + next_node = fnReturnVal[1]; + } + + } // end of while loop + + //this.ddt._ddt( "enter-paragraphs.js", "175", "forEachNode(): returning false." ); + + return false; + + }; // end of forEachNode() + +// ------------------------------------------------------------------- + +/** +* Find a post-insertion node, only if all nodes are empty, or the first content +* +* @param node node current node beinge examined. +* @param next_node node next node to be examined. +* @param node string "find_fill" or "find_cursorpoint" +* @param last_flag boolean is this the last node? +*/ + +EnterParagraphs.prototype._fenEmptySet = function( node, next_node, mode, last_flag) + { + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "263", "_fenEmptySet() : top with mode '" + mode + "' and last_flag '" + last_flag + "' and node:", node ); + + // Mark this if it's the first base + + if ( !next_node && !node.firstChild ) + { + next_node = node; + } + + // Is it an element node and is it considered content? (br, hr, etc) + // or is it a text node that is not just whitespace? + // or is it not an element node and not a text node? + + if ( (node.nodeType == 1 && this._elemSolid.test(node.nodeName)) || + (node.nodeType == 3 && !this._whiteSpace.test(node.nodeValue)) || + (node.nodeType != 1 && node.nodeType != 3) ) + { + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "263", "_fenEmptySet() : found content in node:", node ); + + switch( mode ) + { + + case "find_fill": + + // does not return content. + + return new Array(true, false ); + break; + + case "find_cursorpoint": + + // returns content + + return new Array(true, node ); + break; + + } + + } + + // In either case (fill or findcursor) we return the base node. The avoids + // problems in terminal cases (beginning or end of document or container tags) + + if ( last_flag ) + { + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "263", "_fenEmptySet() : return 'base' node:", next_node ); + + return new Array( true, next_node ); + } + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "263", "_fenEmptySet() : bottom returning false and :", next_node ); + + return new Array( false, next_node ); + + }; // end of _fenEmptySet() + +// ------------------------------------------------------------------------------ + +/** +* remove duplicate Id's. +* +* @param ep_ref enterparagraphs reference to enterparagraphs object +*/ + +EnterParagraphs.prototype._fenCullIds = function ( ep_ref, node, pong ) + { + + //this.ddt._ddt( "enter-paragraphs.js", "299", "_fenCullIds(): top" ); + + // Check for an id, blast it if it's in the store, otherwise add it + + if ( node.id ) + { + + //this.ddt._ddt( "enter-paragraphs.js", "299", "_fenCullIds(): node '" + node.nodeName + "' has an id '" + node.id + "'" ); + + pong[node.id] ? node.id = '' : pong[node.id] = true; + } + + return new Array(false,pong); + + }; + +// --------------------------------------------------------------------------------- + +/** +* Grabs a range suitable for paragraph stuffing +* +* @param rng Range +* @param search_direction string "left" or "right" +* +* @todo check blank node issue in roaming loop. +*/ + +EnterParagraphs.prototype.processSide = function( rng, search_direction) + { + + //this.ddt._ddt( "enter-paragraphs.js", "329", "processSide(): top search_direction == '" + search_direction + "'" ); + + var next = function(element, search_direction) + { + return ( search_direction == "left" ? element.previousSibling : element.nextSibling ); + }; + + var node = search_direction == "left" ? rng.startContainer : rng.endContainer; + var offset = search_direction == "left" ? rng.startOffset : rng.endOffset; + var roam, start = node; + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "337", "processSide(): starting with node:", node ); + + // Never start with an element, because then the first roaming node might + // be on the exclusion list and we wouldn't know until it was too late + + while ( start.nodeType == 1 && !this._permEmpty.test(start.nodeName) ) + { + start = ( offset ? start.lastChild : start.firstChild ); + } + + // Climb the tree, left or right, until our course of action presents itself + // + // if roam is NULL try start. + // if roam is NOT NULL, try next node in our search_direction + // If that node is NULL, get our parent node. + // + // If all the above turns out NULL end the loop. + // + // FIXME: gecko (firefox 1.0.3) - enter "test" into an empty document and press enter. + // sometimes this loop finds a blank text node, sometimes it doesn't. + + while ( roam = roam ? ( next(roam,search_direction) ? next(roam,search_direction) : roam.parentNode ) : start ) + { + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "357", "processSide(): roaming loop, search_direction is '" + search_direction + "' current node is: ", roam ); + + // next() is an inline function defined above that returns the next node depending + // on the direction we're searching. + + if ( next(roam,search_direction) ) + { + + //this.ddt._ddt( "enter-paragraphs.js", "371", "processSide(): Checking next node '" + next(roam,search_direction).NodeName + "' for _pExclusions list." ); + + // If the next sibling's on the exclusion list, stop before it + + if ( this._pExclusions.test(next(roam,search_direction).nodeName) ) + { + + //this.ddt._ddt( "enter-paragraphs.js", "371", "processSide(): Node '" + next(roam,search_direction).NodeName + "' is on the _pExclusions list. Stopping before it." ); + + return this.processRng(rng, search_direction, roam, next(roam,search_direction), (search_direction == "left"?'AfterEnd':'BeforeBegin'), true, false); + } + } + else + { + + //this.ddt._ddt( "enter-paragraphs.js", "371", "processSide(): No next node, examing parent node '" + roam.parentNode.nodeName + "' for containers or exclusions." ); + + // If our parent's on the container list, stop inside it + + if (this._pContainers.test(roam.parentNode.nodeName)) + { + + //this.ddt._ddt( "enter-paragraphs.js", "371", "processSide(): Parent Node '" + roam.parentNode.nodeName + "' is on the _pContainer list. Stopping inside it." ); + + return this.processRng(rng, search_direction, roam, roam.parentNode, (search_direction == "left"?'AfterBegin':'BeforeEnd'), true, false); + } + else if (this._pExclusions.test(roam.parentNode.nodeName)) + { + + //this.ddt._ddt( "enter-paragraphs.js", "371", "processSide(): Parent Node '" + roam.parentNode.nodeName + "' is on the _pExclusion list." ); + + // chop without wrapping + + if (this._pBreak.test(roam.parentNode.nodeName)) + { + + //this.ddt._ddt( "enter-paragraphs.js", "371", "processSide(): Parent Node '" + roam.parentNode.nodeName + "' is on the _pBreak list." ); + + return this.processRng(rng, search_direction, roam, roam.parentNode, + (search_direction == "left"?'AfterBegin':'BeforeEnd'), false, (search_direction == "left" ?true:false)); + } + else + { + + //this.ddt._ddt( "enter-paragraphs.js", "371", "processSide(): Parent Node '" + roam.parentNode.nodeName + "' is not on the _pBreak list." ); + + // the next(roam,search_direction) in this call is redundant since we know it's false + // because of the "if next(roam,search_direction)" above. + // + // the final false prevents this range from being wrapped in

's most likely + // because it's already wrapped. + + return this.processRng(rng, + search_direction, + (roam = roam.parentNode), + (next(roam,search_direction) ? next(roam,search_direction) : roam.parentNode), + (next(roam,search_direction) ? (search_direction == "left"?'AfterEnd':'BeforeBegin') : (search_direction == "left"?'AfterBegin':'BeforeEnd')), + false, + false); + } + } + } + } + + //this.ddt._ddt( "enter-paragraphs.js", "424", "processSide(): bottom" ); + + }; // end of processSide() + +// ------------------------------------------------------------------------------ + +/** +* processRng - process Range. +* +* Neighbour and insertion identify where the new node, roam, needs to enter +* the document; landmarks in our selection will be deleted before insertion +* +* @param rn Range original selected range +* @param search_direction string Direction to search in. +* @param roam node +* @param insertion string may be AfterBegin of BeforeEnd +* @return array +*/ + +EnterParagraphs.prototype.processRng = function(rng, search_direction, roam, neighbour, insertion, pWrap, preBr) + { + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "398", "processRng(): top - roam arg is:", roam ); + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "398", "processRng(): top - neighbor arg is:", neighbour ); + + //this.ddt._ddt( "enter-paragraphs.js", "398", "processRng(): top - insertion arg is: '" + insertion + "'" ); + + var node = search_direction == "left" ? rng.startContainer : rng.endContainer; + var offset = search_direction == "left" ? rng.startOffset : rng.endOffset; + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "447", "processRng(): range start (or end) is at offset '" + offset + "' is node :", node ); + + // Define the range to cut, and extend the selection range to the same boundary + + var editor = this.editor; + var newRng = editor._doc.createRange(); + + newRng.selectNode(roam); + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "522", "processRng(): selecting newRng is:", newRng ); + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "522", "processRng(): selecting original rng is:", rng ); + + // extend the range in the given direction. + + if ( search_direction == "left") + { + newRng.setEnd(node, offset); + rng.setStart(newRng.startContainer, newRng.startOffset); + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "522", "processRng(): extending direction left - newRng is:", newRng ); + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "522", "processRng(): extending direction left - rng is:", rng ); + + } + else if ( search_direction == "right" ) + { + + newRng.setStart(node, offset); + rng.setEnd(newRng.endContainer, newRng.endOffset); + + //this.ddt._ddt( "enter-paragraphs.js", "522", "processRng(): right - new range start is '" + offset + "' end offset is '" + newRng.endOffset + "'" ); + } + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "522", "processRng(): rng is:", rng ); + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "522", "processRng(): newRng is:", newRng ); + + // Clone the range and remove duplicate ids it would otherwise produce + + var cnt = newRng.cloneContents(); + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "509", "processRng(): culling duplicate ids from:", cnt ); + + // in this case "init" is an object not a boolen. + + this.forEachNodeUnder( cnt, "cullids", "ltr", this.takenIds, false, false); + + // Special case, for inserting paragraphs before some blocks when caret is at + // their zero offset. + // + // Used to "open up space" in front of a list, table. Usefull if the list is at + // the top of the document. (otherwise you'd have no way of "moving it down"). + + var pify, pifyOffset, fill; + pify = search_direction == "left" ? (newRng.endContainer.nodeType == 3 ? true:false) : (newRng.startContainer.nodeType == 3 ? false:true); + pifyOffset = pify ? newRng.startOffset : newRng.endOffset; + pify = pify ? newRng.startContainer : newRng.endContainer; + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "521", "processRng(): pify is '" + pify.nodeName + "' pifyOffset is '" + pifyOffset + "':", pify ); + + if ( this._pifyParent.test(pify.nodeName) && pify.parentNode.childNodes.item(0) == pify ) + { + while ( !this._pifySibling.test(pify.nodeName) ) + { + pify = pify.parentNode; + } + } + + // NODE TYPE 11 is DOCUMENT_FRAGMENT NODE + // I do not profess to understand any of this, simply applying a patch that others say is good - ticket:446 + if ( cnt.nodeType == 11 && !cnt.firstChild) + { + if (pify.nodeName != "BODY" || (pify.nodeName == "BODY" && pifyOffset != 0)) + { //WKR: prevent body tag in empty doc + cnt.appendChild(editor._doc.createElement(pify.nodeName)); + } + } + + // YmL: Added additional last parameter for fill case to work around logic + // error in forEachNode() + + //this.ddt._ddt( "enter-paragraphs.js", "612", "processRng(): find_fill in cnt." ); + + fill = this.forEachNodeUnder(cnt, "find_fill", "ltr", false ); + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "612", "processRng(): fill node:" , fill ); + + if ( fill && + this._pifySibling.test(pify.nodeName) && + ( (pifyOffset == 0) || ( pifyOffset == 1 && this._pifyForced.test(pify.nodeName) ) ) ) + { + + //this.ddt._ddt( "enter-paragraphs.js", "544", "processRng(): pify handling. Creating p tag followed by nbsp tag" ); + + roam = editor._doc.createElement( 'p' ); + roam.innerHTML = " "; + + // roam = editor._doc.createElement('p'); + // roam.appendChild(editor._doc.createElement('br')); + + // for these cases, if we are processing the left hand side we want it to halt + // processing instead of doing the right hand side. (Avoids adding another

 

+ // after the list etc. + + if ((search_direction == "left" ) && pify.previousSibling) + { + + //this.ddt._ddt( "enter-paragraphs.js", "682", "processRng(): returning created roam AfterEnd" ); + + return new Array(pify.previousSibling, 'AfterEnd', roam); + } + else if (( search_direction == "right") && pify.nextSibling) + { + + //this.ddt._ddt( "enter-paragraphs.js", "682", "processRng(): returning created roam BeforeBegin" ); + + return new Array(pify.nextSibling, 'BeforeBegin', roam); + } + else + { + + //this.ddt._ddt( "enter-paragraphs.js", "682", "processRng(): returning created roam for direction '" + search_direction + "'" ); + + return new Array(pify.parentNode, (search_direction == "left"?'AfterBegin':'BeforeEnd'), roam); + } + + } + + // If our cloned contents are 'content'-less, shove a break in them + + if ( fill ) + { + + // Ill-concieved? + // + // 3 is a TEXT node and it should be empty. + // + + if ( fill.nodeType == 3 ) + { + // fill = fill.parentNode; + + fill = editor._doc.createDocumentFragment(); + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "575", "processRng(): fill.nodeType is 3. Moving up to parent:", fill ); + } + + if ( (fill.nodeType == 1 && !this._elemSolid.test()) || fill.nodeType == 11 ) + { + + // FIXME:/CHECKME: When Xinha is switched from WYSIWYG to text mode + // Xinha.getHTMLWrapper() will strip out the trailing br. Not sure why. + + // fill.appendChild(editor._doc.createElement('br')); + + var pterminator = editor._doc.createElement( 'p' ); + pterminator.innerHTML = " "; + + fill.appendChild( pterminator ); + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "583", "processRng(): fill type is 1 and !elemsolid or it's type 11. Appending an nbsp tag:", fill ); + + } + else + { + + //this.ddt._ddt( "enter-paragraphs.js", "583", "processRng(): inserting a br tag before." ); + + // fill.parentNode.insertBefore(editor._doc.createElement('br'),fill); + + var pterminator = editor._doc.createElement( 'p' ); + pterminator.innerHTML = " "; + + fill.parentNode.insertBefore(parentNode,fill); + + } + } + + // YmL: If there was no content replace with fill + // (previous code did not use fill and we ended up with the + //

test

because Gecko was finding two empty text nodes + // when traversing on the right hand side of an empty document. + + if ( fill ) + { + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "606", "processRng(): no content. Using fill.", fill ); + + roam = fill; + } + else + { + // And stuff a shiny new object with whatever contents we have + + //this.ddt._ddt( "enter-paragraphs.js", "606", "processRng(): creating p tag or document fragment - pWrap is '" + pWrap + "' " ); + + roam = (pWrap || (cnt.nodeType == 11 && !cnt.firstChild)) ? editor._doc.createElement('p') : editor._doc.createDocumentFragment(); + roam.appendChild(cnt); + } + + if (preBr) + { + //this.ddt._ddt( "enter-paragraphs.js", "767", "processRng(): appending a br based on preBr flag" ); + + roam.appendChild(editor._doc.createElement('br')); + } + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "606", "processRng(): bottom with roam:", roam ); + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "606", "processRng(): bottom with neighbour:", neighbour ); + + // Return the nearest relative, relative insertion point and fragment to insert + + return new Array(neighbour, insertion, roam); + + }; // end of processRng() + +// ---------------------------------------------------------------------------------- + +/** +* are we an
  • that should be handled by the browser? +* +* there is no good way to "get out of" ordered or unordered lists from Javascript. +* We have to pass the onKeyPress 13 event to the browser so it can take care of +* getting us "out of" the list. +* +* The Gecko engine does a good job of handling all the normal
  • cases except the "press +* enter at the first position" where we want a

     

    inserted before the list. The +* built-in behavior is to open up a
  • before the current entry (not good). +* +* @param rng Range range. +*/ + +EnterParagraphs.prototype.isNormalListItem = function(rng) + { + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "863", "isNormaListItem(): checking rng for list end:", rng ); + + var node, listNode; + + node = rng.startContainer; + + if (( typeof node.nodeName != 'undefined') && + ( node.nodeName.toLowerCase() == 'li' )) + { + + //this.ddt._ddt( "enter-paragraphs.js", "863", "isNormaListItem(): node is a list item"); + + // are we a list item? + + listNode = node; + } + else if (( typeof node.parentNode != 'undefined' ) && + ( typeof node.parentNode.nodeName != 'undefined' ) && + ( node.parentNode.nodeName.toLowerCase() == 'li' )) + { + + //this.ddt._ddt( "enter-paragraphs.js", "863", "isNormaListItem(): parent is a list item"); + + // our parent is a list item. + + listNode = node.parentNode; + + } + else + { + //this.ddt._ddt( "enter-paragraphs.js", "863", "isNormaListItem(): not list item"); + + // neither we nor our parent are a list item. this is not a normal + // li case. + + return false; + } + + // at this point we have a listNode. Is it the first list item? + + if ( ! listNode.previousSibling ) + { + //this.ddt._ddt( "enter-paragraphs.js", "839", "isNormaListItem(): we are the first li." ); + + // are we on the first character of the first li? + + if ( rng.startOffset == 0 ) + { + //this.ddt._ddt( "enter-paragraphs.js", "839", "isNormaListItem(): we are on the first character." ); + + return false; + } + } + + //this.ddt._ddt( "enter-paragraphs.js", "839", "isNormaListItem(): this is a normal list item case." ); + return true; + + }; // end of isNormalListItem() + +// ---------------------------------------------------------------------------------- +/** +* Called when a key is pressed in the editor +*/ + +EnterParagraphs.prototype.__onKeyPress = function(ev) + { + + //this.ddt._ddt( "enter-paragraphs.js", "517", "__onKeyPress(): top with keyCode '" + ev.keyCode + "'" ); + + // If they've hit enter and shift is not pressed, handle it + + if (ev.keyCode == 13 && !ev.shiftKey && this.editor._iframe.contentWindow.getSelection) + { + //this.ddt._ddt( "enter-paragraphs.js", "517", "__onKeyPress(): calling handleEnter" ); + + return this.handleEnter(ev); + } + + //this.ddt._ddt( "enter-paragraphs.js", "517", "__onKeyPress(): bottom" ); + + }; // end of _onKeyPress() + +// ----------------------------------------------------------------------------------- + +/** +* Handles the pressing of an unshifted enter for Gecko +*/ + +EnterParagraphs.prototype.handleEnter = function(ev) + { + + //this.ddt._ddt( "enter-paragraphs.js", "537", "handleEnter(): top" ); + + var cursorNode; + + // Grab the selection and associated range + + var sel = this.editor.getSelection(); + var rng = this.editor.createRange(sel); + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "757", "handleEnter(): initial range is: ", rng ); + + // if we are at the end of a list and the node is empty let the browser handle + // it to get us out of the list. + + if ( this.isNormalListItem(rng) ) + { + //this.ddt._ddt( "enter-paragraphs.js", "757", "handleEnter(): we are at the end of a list with a blank item. Letting the browser handle it." ); + return true; + } + + // as far as I can tell this isn't actually used. + + this.takenIds = new Object(); + + // Grab ranges for document re-stuffing, if appropriate + // + // pStart and pEnd are arrays consisting of + // [0] neighbor node + // [1] insertion type + // [2] roam + + //this.ddt._ddt( "enter-paragraphs.js", "537", "handleEnter(): calling processSide on left side." ); + + var pStart = this.processSide(rng, "left"); + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "757", "handleEnter(): after processing left side range is: ", rng ); + + //this.ddt._ddt( "enter-paragraphs.js", "537", "handleEnter(): calling processSide on right side." ); + + var pEnd = this.processSide(rng, "right"); + + // used to position the cursor after insertion. + + cursorNode = pEnd[2]; + + // Get rid of everything local to the selection + + sel.removeAllRanges(); + rng.deleteContents(); + + // Grab a node we'll have after insertion, since fragments will be lost + // + // we'll use this to position the cursor. + + //this.ddt._ddt( "enter-paragraphs.js", "712", "handleEnter(): looking for cursor position" ); + + var holdEnd = this.forEachNodeUnder( cursorNode, "find_cursorpoint", "ltr", false, true); + + if ( ! holdEnd ) + { + alert( "INTERNAL ERROR - could not find place to put cursor after ENTER" ); + } + + // Insert our carefully chosen document fragments + + if ( pStart ) + { + + //this.ddt._ddt( "enter-paragraphs.js", "712", "handleEnter(): inserting pEnd" ); + + this.insertAdjacentElement(pStart[0], pStart[1], pStart[2]); + } + + if ( pEnd && pEnd.nodeType != 1) + { + + //this.ddt._ddt( "enter-paragraphs.js", "712", "handleEnter(): inserting pEnd" ); + + this.insertAdjacentElement(pEnd[0], pEnd[1], pEnd[2]); + } + + // Move the caret in front of the first good text element + + if ((holdEnd) && (this._permEmpty.test(holdEnd.nodeName) )) + { + + //this.ddt._ddt( "enter-paragraphs.js", "712", "handleEnter(): looping to find cursor element." ); + + var prodigal = 0; + while ( holdEnd.parentNode.childNodes.item(prodigal) != holdEnd ) + { + prodigal++; + } + + sel.collapse( holdEnd.parentNode, prodigal); + } + else + { + + // holdEnd might be false. + + try + { + sel.collapse(holdEnd, 0); + + //this.ddt._ddtDumpNode( "enter-paragraphs.js", "1057", "handleEnter(): scrolling to element:", holdEnd ); + + // interestingly, scrollToElement() scroll so the top if holdEnd is a text node. + + if ( holdEnd.nodeType == 3 ) + { + holdEnd = holdEnd.parentNode; + } + + this.editor.scrollToElement(holdEnd); + } + catch (e) + { + // we could try to place the cursor at the end of the document. + } + } + + this.editor.updateToolbar(); + + Xinha._stopEvent(ev); + + return true; + + }; // end of handleEnter() + +// END \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/ASCIIMathML.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/ASCIIMathML.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/ASCIIMathML.js 3 Jan 2016 20:47:37 -0000 1.1.2.1 @@ -0,0 +1,3365 @@ +/* +ASCIIMathML.js +============== +This file contains JavaScript functions to convert ASCII math notation +and LaTeX to Presentation MathML. Simple graphics commands are also +translated to SVG images. The conversion is done while the (X)HTML +page loads, and should work with Firefox/Mozilla/Netscape 7+ and Internet +Explorer 6/7 + MathPlayer (http://www.dessci.com/en/products/mathplayer/) + +Adobe SVGview 3.03 (http://www.adobe.com/svg/viewer/install/). + +Just add the next line to your (X)HTML page with this file in the same folder: + + + +(using the graphics in IE also requires the file "d.svg" in the same folder). +This is a convenient and inexpensive solution for authoring MathML and SVG. + +Version 2.1 Oct 8, 2008, (c) Peter Jipsen http://www.chapman.edu/~jipsen +This version extends ASCIIMathML.js with LaTeXMathML.js and ASCIIsvg.js. +Latest version at http://www.chapman.edu/~jipsen/mathml/ASCIIMathML.js +If you use it on a webpage, please send the URL to jipsen@chapman.edu + +The LaTeXMathML modifications were made by Douglas Woodall, June 2006. +(for details see header on the LaTeXMathML part in middle of file) +Extensive clean-up and improvements by Paulo Soares, Oct 2007. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License +(at http://www.gnu.org/licences/lgpl.html) for more details. +*/ + +var mathcolor = "blue"; // change it to "" (to inherit) or another color +var mathfontsize = "1em"; // change to e.g. 1.2em for larger math +var mathfontfamily = "serif"; // change to "" to inherit (works in IE) + // or another family (e.g. "arial") +var automathrecognize = false; // writing "amath" on page makes this true +var checkForMathML = true; // check if browser can display MathML +var notifyIfNoMathML = true; // display note at top if no MathML capability +var alertIfNoMathML = false; // show alert box if no MathML capability +var translateOnLoad = true; // set to false to do call translators from js +var translateLaTeX = true; // false to preserve $..$, $$..$$ +var translateLaTeXformatting = true; // false to preserve \emph,\begin{},\end{} +var translateASCIIMath = true; // false to preserve `..` +var translateASCIIsvg = true; // false to preserve agraph.., \begin{graph}.. +var avoidinnerHTML = false; // set true if assigning to innerHTML gives error +var displaystyle = true; // puts limits above and below large operators +var showasciiformulaonhover = true; // helps students learn ASCIIMath +var decimalsign = "."; // change to "," if you like, beware of `(1,2)`! +var AMdelimiter1 = "`", AMescape1 = "\\\\`"; // can use other characters +var AMdocumentId = "wikitext" // PmWiki element containing math (default=body) +var checkforprocessasciimathinmoodle = false; // true for systems like Moodle +var dsvglocation = ""; // path to d.svg (blank if same as ASCIIMathML.js loc) + +/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ + +var isIE = document.createElementNS==null; +var noMathML = false, translated = false; + +if (isIE) { // avoid adding MathPlayer info explicitly to each webpage + document.write(""); + document.write(""); +} + +// Add a stylesheet, replacing any previous custom stylesheet (adapted from TW) +function setStylesheet(s) { + var id = "AMMLcustomStyleSheet"; + var n = document.getElementById(id); + if(document.createStyleSheet) { + // Test for IE's non-standard createStyleSheet method + if(n) + n.parentNode.removeChild(n); + // This failed without the   + document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeEnd"," "); + } else { + if(n) { + n.replaceChild(document.createTextNode(s),n.firstChild); + } else { + n = document.createElement("style"); + n.type = "text/css"; + n.id = id; + n.appendChild(document.createTextNode(s)); + document.getElementsByTagName("head")[0].appendChild(n); + } + } +} + +setStylesheet("#AMMLcloseDiv \{font-size:0.8em; padding-top:1em; color:#014\}\n#AMMLwarningBox \{position:absolute; width:100%; top:0; left:0; z-index:200; text-align:center; font-size:1em; font-weight:bold; padding:0.5em 0 0.5em 0; color:#ffc; background:#c30\}"); + +function init(){ + var msg, warnings = new Array(); + if (document.getElementById==null){ + alert("This webpage requires a recent browser such as Mozilla Firefox/Netscape 7+ or Internet Explorer 6+ with MathPlayer and Adobe SVGviewer"); + return null; + } + if (checkForMathML && (msg = checkMathML())) warnings.push(msg); + if (checkIfSVGavailable && (msg = checkSVG())) warnings.push(msg); + if (warnings.length>0) displayWarnings(warnings); + if (!noMathML) initSymbols(); + return true; +} + +function checkMathML(){ + if (navigator.appName.slice(0,8)=="Netscape") + if (navigator.appVersion.slice(0,1)>="5") noMathML = null; + else noMathML = true; + else if (navigator.appName.slice(0,9)=="Microsoft") + try { + var ActiveX = new ActiveXObject("MathPlayer.Factory.1"); + noMathML = null; + } catch (e) { + noMathML = true; + } + else if (navigator.appName.slice(0,5)=="Opera") + if (navigator.appVersion.slice(0,3)>="9.5") noMathML = null; + else noMathML = true; +//noMathML = true; //uncomment to check + if (noMathML && notifyIfNoMathML) { + var msg = "To view the ASCIIMathML notation use Internet Explorer + MathPlayer or Mozilla Firefox 2.0 or later."; + if (alertIfNoMathML) + alert(msg); + else return msg; + } +} + +function hideWarning(){ + var body = document.getElementsByTagName("body")[0]; + body.removeChild(document.getElementById('AMMLwarningBox')); + body.onclick = null; +} + +function displayWarnings(warnings) { + var i, frag, nd = createElementXHTML("div"); + var body = document.getElementsByTagName("body")[0]; + body.onclick=hideWarning; + nd.id = 'AMMLwarningBox'; + for (i=0; i=", tag:"mo", output:"\u2265", tex:"ge", ttype:CONST}, +{input:"geq", tag:"mo", output:"\u2265", tex:null, ttype:CONST}, +{input:"-<", tag:"mo", output:"\u227A", tex:"prec", ttype:CONST}, +{input:"-lt", tag:"mo", output:"\u227A", tex:null, ttype:CONST}, +{input:">-", tag:"mo", output:"\u227B", tex:"succ", ttype:CONST}, +{input:"-<=", tag:"mo", output:"\u2AAF", tex:"preceq", ttype:CONST}, +{input:">-=", tag:"mo", output:"\u2AB0", tex:"succeq", ttype:CONST}, +{input:"in", tag:"mo", output:"\u2208", tex:null, ttype:CONST}, +{input:"!in", tag:"mo", output:"\u2209", tex:"notin", ttype:CONST}, +{input:"sub", tag:"mo", output:"\u2282", tex:"subset", ttype:CONST}, +{input:"sup", tag:"mo", output:"\u2283", tex:"supset", ttype:CONST}, +{input:"sube", tag:"mo", output:"\u2286", tex:"subseteq", ttype:CONST}, +{input:"supe", tag:"mo", output:"\u2287", tex:"supseteq", ttype:CONST}, +{input:"-=", tag:"mo", output:"\u2261", tex:"equiv", ttype:CONST}, +{input:"~=", tag:"mo", output:"\u2245", tex:"cong", ttype:CONST}, +{input:"~~", tag:"mo", output:"\u2248", tex:"approx", ttype:CONST}, +{input:"prop", tag:"mo", output:"\u221D", tex:"propto", ttype:CONST}, + +//logical symbols +{input:"and", tag:"mtext", output:"and", tex:null, ttype:SPACE}, +{input:"or", tag:"mtext", output:"or", tex:null, ttype:SPACE}, +{input:"not", tag:"mo", output:"\u00AC", tex:"neg", ttype:CONST}, +{input:"=>", tag:"mo", output:"\u21D2", tex:"implies", ttype:CONST}, +{input:"if", tag:"mo", output:"if", tex:null, ttype:SPACE}, +{input:"<=>", tag:"mo", output:"\u21D4", tex:"iff", ttype:CONST}, +{input:"AA", tag:"mo", output:"\u2200", tex:"forall", ttype:CONST}, +{input:"EE", tag:"mo", output:"\u2203", tex:"exists", ttype:CONST}, +{input:"_|_", tag:"mo", output:"\u22A5", tex:"bot", ttype:CONST}, +{input:"TT", tag:"mo", output:"\u22A4", tex:"top", ttype:CONST}, +{input:"|--", tag:"mo", output:"\u22A2", tex:"vdash", ttype:CONST}, +{input:"|==", tag:"mo", output:"\u22A8", tex:"models", ttype:CONST}, + +//grouping brackets +{input:"(", tag:"mo", output:"(", tex:null, ttype:LEFTBRACKET}, +{input:")", tag:"mo", output:")", tex:null, ttype:RIGHTBRACKET}, +{input:"[", tag:"mo", output:"[", tex:null, ttype:LEFTBRACKET}, +{input:"]", tag:"mo", output:"]", tex:null, ttype:RIGHTBRACKET}, +{input:"{", tag:"mo", output:"{", tex:null, ttype:LEFTBRACKET}, +{input:"}", tag:"mo", output:"}", tex:null, ttype:RIGHTBRACKET}, +{input:"|", tag:"mo", output:"|", tex:null, ttype:LEFTRIGHT}, +//{input:"||", tag:"mo", output:"||", tex:null, ttype:LEFTRIGHT}, +{input:"(:", tag:"mo", output:"\u2329", tex:"langle", ttype:LEFTBRACKET}, +{input:":)", tag:"mo", output:"\u232A", tex:"rangle", ttype:RIGHTBRACKET}, +{input:"<<", tag:"mo", output:"\u2329", tex:null, ttype:LEFTBRACKET}, +{input:">>", tag:"mo", output:"\u232A", tex:null, ttype:RIGHTBRACKET}, +{input:"{:", tag:"mo", output:"{:", tex:null, ttype:LEFTBRACKET, invisible:true}, +{input:":}", tag:"mo", output:":}", tex:null, ttype:RIGHTBRACKET, invisible:true}, + +//miscellaneous symbols +{input:"int", tag:"mo", output:"\u222B", tex:null, ttype:CONST}, +{input:"dx", tag:"mi", output:"{:d x:}", tex:null, ttype:DEFINITION}, +{input:"dy", tag:"mi", output:"{:d y:}", tex:null, ttype:DEFINITION}, +{input:"dz", tag:"mi", output:"{:d z:}", tex:null, ttype:DEFINITION}, +{input:"dt", tag:"mi", output:"{:d t:}", tex:null, ttype:DEFINITION}, +{input:"oint", tag:"mo", output:"\u222E", tex:null, ttype:CONST}, +{input:"del", tag:"mo", output:"\u2202", tex:"partial", ttype:CONST}, +{input:"grad", tag:"mo", output:"\u2207", tex:"nabla", ttype:CONST}, +{input:"+-", tag:"mo", output:"\u00B1", tex:"pm", ttype:CONST}, +{input:"O/", tag:"mo", output:"\u2205", tex:"emptyset", ttype:CONST}, +{input:"oo", tag:"mo", output:"\u221E", tex:"infty", ttype:CONST}, +{input:"aleph", tag:"mo", output:"\u2135", tex:null, ttype:CONST}, +{input:"...", tag:"mo", output:"...", tex:"ldots", ttype:CONST}, +{input:":.", tag:"mo", output:"\u2234", tex:"therefore", ttype:CONST}, +{input:"/_", tag:"mo", output:"\u2220", tex:"angle", ttype:CONST}, +{input:"\\ ", tag:"mo", output:"\u00A0", tex:null, ttype:CONST}, +{input:"quad", tag:"mo", output:"\u00A0\u00A0", tex:null, ttype:CONST}, +{input:"qquad", tag:"mo", output:"\u00A0\u00A0\u00A0\u00A0", tex:null, ttype:CONST}, +{input:"cdots", tag:"mo", output:"\u22EF", tex:null, ttype:CONST}, +{input:"vdots", tag:"mo", output:"\u22EE", tex:null, ttype:CONST}, +{input:"ddots", tag:"mo", output:"\u22F1", tex:null, ttype:CONST}, +{input:"diamond", tag:"mo", output:"\u22C4", tex:null, ttype:CONST}, +{input:"square", tag:"mo", output:"\u25A1", tex:null, ttype:CONST}, +{input:"|__", tag:"mo", output:"\u230A", tex:"lfloor", ttype:CONST}, +{input:"__|", tag:"mo", output:"\u230B", tex:"rfloor", ttype:CONST}, +{input:"|~", tag:"mo", output:"\u2308", tex:"lceiling", ttype:CONST}, +{input:"~|", tag:"mo", output:"\u2309", tex:"rceiling", ttype:CONST}, +{input:"CC", tag:"mo", output:"\u2102", tex:null, ttype:CONST}, +{input:"NN", tag:"mo", output:"\u2115", tex:null, ttype:CONST}, +{input:"QQ", tag:"mo", output:"\u211A", tex:null, ttype:CONST}, +{input:"RR", tag:"mo", output:"\u211D", tex:null, ttype:CONST}, +{input:"ZZ", tag:"mo", output:"\u2124", tex:null, ttype:CONST}, +{input:"f", tag:"mi", output:"f", tex:null, ttype:UNARY, func:true}, +{input:"g", tag:"mi", output:"g", tex:null, ttype:UNARY, func:true}, + +//standard functions +{input:"lim", tag:"mo", output:"lim", tex:null, ttype:UNDEROVER}, +{input:"Lim", tag:"mo", output:"Lim", tex:null, ttype:UNDEROVER}, +{input:"sin", tag:"mo", output:"sin", tex:null, ttype:UNARY, func:true}, +{input:"cos", tag:"mo", output:"cos", tex:null, ttype:UNARY, func:true}, +{input:"tan", tag:"mo", output:"tan", tex:null, ttype:UNARY, func:true}, +{input:"sinh", tag:"mo", output:"sinh", tex:null, ttype:UNARY, func:true}, +{input:"cosh", tag:"mo", output:"cosh", tex:null, ttype:UNARY, func:true}, +{input:"tanh", tag:"mo", output:"tanh", tex:null, ttype:UNARY, func:true}, +{input:"cot", tag:"mo", output:"cot", tex:null, ttype:UNARY, func:true}, +{input:"sec", tag:"mo", output:"sec", tex:null, ttype:UNARY, func:true}, +{input:"csc", tag:"mo", output:"csc", tex:null, ttype:UNARY, func:true}, +{input:"log", tag:"mo", output:"log", tex:null, ttype:UNARY, func:true}, +{input:"ln", tag:"mo", output:"ln", tex:null, ttype:UNARY, func:true}, +{input:"det", tag:"mo", output:"det", tex:null, ttype:UNARY, func:true}, +{input:"dim", tag:"mo", output:"dim", tex:null, ttype:CONST}, +{input:"mod", tag:"mo", output:"mod", tex:null, ttype:CONST}, +{input:"gcd", tag:"mo", output:"gcd", tex:null, ttype:UNARY, func:true}, +{input:"lcm", tag:"mo", output:"lcm", tex:null, ttype:UNARY, func:true}, +{input:"lub", tag:"mo", output:"lub", tex:null, ttype:CONST}, +{input:"glb", tag:"mo", output:"glb", tex:null, ttype:CONST}, +{input:"min", tag:"mo", output:"min", tex:null, ttype:UNDEROVER}, +{input:"max", tag:"mo", output:"max", tex:null, ttype:UNDEROVER}, + +//arrows +{input:"uarr", tag:"mo", output:"\u2191", tex:"uparrow", ttype:CONST}, +{input:"darr", tag:"mo", output:"\u2193", tex:"downarrow", ttype:CONST}, +{input:"rarr", tag:"mo", output:"\u2192", tex:"rightarrow", ttype:CONST}, +{input:"->", tag:"mo", output:"\u2192", tex:"to", ttype:CONST}, +{input:">->", tag:"mo", output:"\u21A3", tex:"rightarrowtail", ttype:CONST}, +{input:"->>", tag:"mo", output:"\u21A0", tex:"twoheadrightarrow", ttype:CONST}, +{input:">->>", tag:"mo", output:"\u2916", tex:"twoheadrightarrowtail", ttype:CONST}, +{input:"|->", tag:"mo", output:"\u21A6", tex:"mapsto", ttype:CONST}, +{input:"larr", tag:"mo", output:"\u2190", tex:"leftarrow", ttype:CONST}, +{input:"harr", tag:"mo", output:"\u2194", tex:"leftrightarrow", ttype:CONST}, +{input:"rArr", tag:"mo", output:"\u21D2", tex:"Rightarrow", ttype:CONST}, +{input:"lArr", tag:"mo", output:"\u21D0", tex:"Leftarrow", ttype:CONST}, +{input:"hArr", tag:"mo", output:"\u21D4", tex:"Leftrightarrow", ttype:CONST}, +//commands with argument +{input:"sqrt", tag:"msqrt", output:"sqrt", tex:null, ttype:UNARY}, +{input:"root", tag:"mroot", output:"root", tex:null, ttype:BINARY}, +{input:"frac", tag:"mfrac", output:"/", tex:null, ttype:BINARY}, +{input:"/", tag:"mfrac", output:"/", tex:null, ttype:INFIX}, +{input:"stackrel", tag:"mover", output:"stackrel", tex:null, ttype:BINARY}, +{input:"_", tag:"msub", output:"_", tex:null, ttype:INFIX}, +{input:"^", tag:"msup", output:"^", tex:null, ttype:INFIX}, +{input:"hat", tag:"mover", output:"\u005E", tex:null, ttype:UNARY, acc:true}, +{input:"bar", tag:"mover", output:"\u00AF", tex:"overline", ttype:UNARY, acc:true}, +{input:"vec", tag:"mover", output:"\u2192", tex:null, ttype:UNARY, acc:true}, +{input:"dot", tag:"mover", output:".", tex:null, ttype:UNARY, acc:true}, +{input:"ddot", tag:"mover", output:"..", tex:null, ttype:UNARY, acc:true}, +{input:"ul", tag:"munder", output:"\u0332", tex:"underline", ttype:UNARY, acc:true}, +{input:"text", tag:"mtext", output:"text", tex:null, ttype:TEXT}, +{input:"mbox", tag:"mtext", output:"mbox", tex:null, ttype:TEXT}, +AMquote, +{input:"bb", tag:"mstyle", atname:"fontweight", atval:"bold", output:"bb", tex:null, ttype:UNARY}, +{input:"mathbf", tag:"mstyle", atname:"fontweight", atval:"bold", output:"mathbf", tex:null, ttype:UNARY}, +{input:"sf", tag:"mstyle", atname:"fontfamily", atval:"sans-serif", output:"sf", tex:null, ttype:UNARY}, +{input:"mathsf", tag:"mstyle", atname:"fontfamily", atval:"sans-serif", output:"mathsf", tex:null, ttype:UNARY}, +{input:"bbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", output:"bbb", tex:null, ttype:UNARY, codes:AMbbb}, +{input:"mathbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", output:"mathbb", tex:null, ttype:UNARY, codes:AMbbb}, +{input:"cc", tag:"mstyle", atname:"mathvariant", atval:"script", output:"cc", tex:null, ttype:UNARY, codes:AMcal}, +{input:"mathcal", tag:"mstyle", atname:"mathvariant", atval:"script", output:"mathcal", tex:null, ttype:UNARY, codes:AMcal}, +{input:"tt", tag:"mstyle", atname:"fontfamily", atval:"monospace", output:"tt", tex:null, ttype:UNARY}, +{input:"mathtt", tag:"mstyle", atname:"fontfamily", atval:"monospace", output:"mathtt", tex:null, ttype:UNARY}, +{input:"fr", tag:"mstyle", atname:"mathvariant", atval:"fraktur", output:"fr", tex:null, ttype:UNARY, codes:AMfrk}, +{input:"mathfrak", tag:"mstyle", atname:"mathvariant", atval:"fraktur", output:"mathfrak", tex:null, ttype:UNARY, codes:AMfrk} +]; + +function compareNames(s1,s2) { + if (s1.input > s2.input) return 1 + else return -1; +} + +var AMnames = []; //list of input symbols + +function initSymbols() { + var texsymbols = [], i; + for (i=0; i=n where str appears or would be inserted +// assumes arr is sorted + if (n==0) { + var h,m; + n = -1; + h = arr.length; + while (n+1> 1; + if (arr[m]=str +} + +function AMgetSymbol(str) { +//return maximal initial substring of str that appears in names +//return null if there is none + var k = 0; //new pos + var j = 0; //old pos + var mk; //match pos + var st; + var tagst; + var match = ""; + var more = true; + for (var i=1; i<=str.length && more; i++) { + st = str.slice(0,i); //initial substring of length i + j = k; + k = position(AMnames, st, j); + if (k=AMnames[k]; + } + AMpreviousSymbol=AMcurrentSymbol; + if (match!=""){ + AMcurrentSymbol=AMsymbols[mk].ttype; + return AMsymbols[mk]; + } +// if str[0] is a digit or - return maxsubstring of digits.digits + AMcurrentSymbol=CONST; + k = 1; + st = str.slice(0,1); + var integ = true; + while ("0"<=st && st<="9" && k<=str.length) { + st = str.slice(k,k+1); + k++; + } + if (st == decimalsign) { + st = str.slice(k,k+1); + if ("0"<=st && st<="9") { + integ = false; + k++; + while ("0"<=st && st<="9" && k<=str.length) { + st = str.slice(k,k+1); + k++; + } + } + } + if ((integ && k>1) || k>2) { + st = str.slice(0,k-1); + tagst = "mn"; + } else { + k = 2; + st = str.slice(0,1); //take 1 character + tagst = (("A">st || st>"Z") && ("a">st || st>"z")?"mo":"mi"); + } + if (st=="-" && AMpreviousSymbol==INFIX) { + AMcurrentSymbol = INFIX; //trick "/" into recognizing "-" on second parse + return {input:st, tag:tagst, output:st, ttype:UNARY, func:true}; + } + return {input:st, tag:tagst, output:st, ttype:CONST}; +} + +function AMremoveBrackets(node) { + var st; + if (node.nodeName=="mrow") { + st = node.firstChild.firstChild.nodeValue; + if (st=="(" || st=="[" || st=="{") node.removeChild(node.firstChild); + } + if (node.nodeName=="mrow") { + st = node.lastChild.firstChild.nodeValue; + if (st==")" || st=="]" || st=="}") node.removeChild(node.lastChild); + } +} + +/*Parsing ASCII math expressions with the following grammar +v ::= [A-Za-z] | greek letters | numbers | other constant symbols +u ::= sqrt | text | bb | other unary symbols for font commands +b ::= frac | root | stackrel binary symbols +l ::= ( | [ | { | (: | {: left brackets +r ::= ) | ] | } | :) | :} right brackets +S ::= v | lEr | uS | bSS Simple expression +I ::= S_S | S^S | S_S^S | S Intermediate expression +E ::= IE | I/I Expression +Each terminal symbol is translated into a corresponding mathml node.*/ + +var AMnestingDepth,AMpreviousSymbol,AMcurrentSymbol; + +function AMparseSexpr(str) { //parses str and returns [node,tailstr] + var symbol, node, result, i, st,// rightvert = false, + newFrag = document.createDocumentFragment(); + str = AMremoveCharsAndBlanks(str,0); + symbol = AMgetSymbol(str); //either a token or a bracket or empty + if (symbol == null || symbol.ttype == RIGHTBRACKET && AMnestingDepth > 0) { + return [null,str]; + } + if (symbol.ttype == DEFINITION) { + str = symbol.output+AMremoveCharsAndBlanks(str,symbol.input.length); + symbol = AMgetSymbol(str); + } + switch (symbol.ttype) { case UNDEROVER: + case CONST: + str = AMremoveCharsAndBlanks(str,symbol.input.length); + return [createMmlNode(symbol.tag, //its a constant + document.createTextNode(symbol.output)),str]; + case LEFTBRACKET: //read (expr+) + AMnestingDepth++; + str = AMremoveCharsAndBlanks(str,symbol.input.length); + result = AMparseExpr(str,true); + AMnestingDepth--; + if (typeof symbol.invisible == "boolean" && symbol.invisible) + node = createMmlNode("mrow",result[0]); + else { + node = createMmlNode("mo",document.createTextNode(symbol.output)); + node = createMmlNode("mrow",node); + node.appendChild(result[0]); + } + return [node,result[1]]; + case TEXT: + if (symbol!=AMquote) str = AMremoveCharsAndBlanks(str,symbol.input.length); + if (str.charAt(0)=="{") i=str.indexOf("}"); + else if (str.charAt(0)=="(") i=str.indexOf(")"); + else if (str.charAt(0)=="[") i=str.indexOf("]"); + else if (symbol==AMquote) i=str.slice(1).indexOf("\"")+1; + else i = 0; + if (i==-1) i = str.length; + st = str.slice(1,i); + if (st.charAt(0) == " ") { + node = createMmlNode("mspace"); + node.setAttribute("width","1ex"); + newFrag.appendChild(node); + } + newFrag.appendChild( + createMmlNode(symbol.tag,document.createTextNode(st))); + if (st.charAt(st.length-1) == " ") { + node = createMmlNode("mspace"); + node.setAttribute("width","1ex"); + newFrag.appendChild(node); + } + str = AMremoveCharsAndBlanks(str,i+1); + return [createMmlNode("mrow",newFrag),str]; + case UNARY: + str = AMremoveCharsAndBlanks(str,symbol.input.length); + result = AMparseSexpr(str); + if (result[0]==null) return [createMmlNode(symbol.tag, + document.createTextNode(symbol.output)),str]; + if (typeof symbol.func == "boolean" && symbol.func) { // functions hack + st = str.charAt(0); + if (st=="^" || st=="_" || st=="/" || st=="|" || st==",") { + return [createMmlNode(symbol.tag, + document.createTextNode(symbol.output)),str]; + } else { + node = createMmlNode("mrow", + createMmlNode(symbol.tag,document.createTextNode(symbol.output))); + node.appendChild(result[0]); + return [node,result[1]]; + } + } + AMremoveBrackets(result[0]); + if (symbol.input == "sqrt") { // sqrt + return [createMmlNode(symbol.tag,result[0]),result[1]]; + } else if (typeof symbol.acc == "boolean" && symbol.acc) { // accent + node = createMmlNode(symbol.tag,result[0]); + node.appendChild(createMmlNode("mo",document.createTextNode(symbol.output))); + return [node,result[1]]; + } else { // font change command + if (!isIE && typeof symbol.codes != "undefined") { + for (i=0; i64 && st.charCodeAt(j)<91) newst = newst + + String.fromCharCode(symbol.codes[st.charCodeAt(j)-65]); + else newst = newst + st.charAt(j); + if (result[0].nodeName=="mi") + result[0]=createMmlNode("mo"). + appendChild(document.createTextNode(newst)); + else result[0].replaceChild(createMmlNode("mo"). + appendChild(document.createTextNode(newst)), + result[0].childNodes[i]); + } + } + node = createMmlNode(symbol.tag,result[0]); + node.setAttribute(symbol.atname,symbol.atval); + return [node,result[1]]; + } + case BINARY: + str = AMremoveCharsAndBlanks(str,symbol.input.length); + result = AMparseSexpr(str); + if (result[0]==null) return [createMmlNode("mo", + document.createTextNode(symbol.input)),str]; + AMremoveBrackets(result[0]); + var result2 = AMparseSexpr(result[1]); + if (result2[0]==null) return [createMmlNode("mo", + document.createTextNode(symbol.input)),str]; + AMremoveBrackets(result2[0]); + if (symbol.input=="root" || symbol.input=="stackrel") + newFrag.appendChild(result2[0]); + newFrag.appendChild(result[0]); + if (symbol.input=="frac") newFrag.appendChild(result2[0]); + return [createMmlNode(symbol.tag,newFrag),result2[1]]; + case INFIX: + str = AMremoveCharsAndBlanks(str,symbol.input.length); + return [createMmlNode("mo",document.createTextNode(symbol.output)),str]; + case SPACE: + str = AMremoveCharsAndBlanks(str,symbol.input.length); + node = createMmlNode("mspace"); + node.setAttribute("width","1ex"); + newFrag.appendChild(node); + newFrag.appendChild( + createMmlNode(symbol.tag,document.createTextNode(symbol.output))); + node = createMmlNode("mspace"); + node.setAttribute("width","1ex"); + newFrag.appendChild(node); + return [createMmlNode("mrow",newFrag),str]; + case LEFTRIGHT: +// if (rightvert) return [null,str]; else rightvert = true; + AMnestingDepth++; + str = AMremoveCharsAndBlanks(str,symbol.input.length); + result = AMparseExpr(str,false); + AMnestingDepth--; + var st = ""; + if (result[0].lastChild!=null) + st = result[0].lastChild.firstChild.nodeValue; + if (st == "|") { // its an absolute value subterm + node = createMmlNode("mo",document.createTextNode(symbol.output)); + node = createMmlNode("mrow",node); + node.appendChild(result[0]); + return [node,result[1]]; + } else { // the "|" is a \mid so use unicode 2223 (divides) for spacing + node = createMmlNode("mo",document.createTextNode("\u2223")); + node = createMmlNode("mrow",node); + return [node,str]; + } + default: +//alert("default"); + str = AMremoveCharsAndBlanks(str,symbol.input.length); + return [createMmlNode(symbol.tag, //its a constant + document.createTextNode(symbol.output)),str]; + } +} + +function AMparseIexpr(str) { + var symbol, sym1, sym2, node, result, underover; + str = AMremoveCharsAndBlanks(str,0); + sym1 = AMgetSymbol(str); + result = AMparseSexpr(str); + node = result[0]; + str = result[1]; + symbol = AMgetSymbol(str); + if (symbol.ttype == INFIX && symbol.input != "/") { + str = AMremoveCharsAndBlanks(str,symbol.input.length); +// if (symbol.input == "/") result = AMparseIexpr(str); else ... + result = AMparseSexpr(str); + if (result[0] == null) // show box in place of missing argument + result[0] = createMmlNode("mo",document.createTextNode("\u25A1")); + else AMremoveBrackets(result[0]); + str = result[1]; +// if (symbol.input == "/") AMremoveBrackets(node); + if (symbol.input == "_") { + sym2 = AMgetSymbol(str); + underover = (sym1.ttype == UNDEROVER); + if (sym2.input == "^") { + str = AMremoveCharsAndBlanks(str,sym2.input.length); + var res2 = AMparseSexpr(str); + AMremoveBrackets(res2[0]); + str = res2[1]; + node = createMmlNode((underover?"munderover":"msubsup"),node); + node.appendChild(result[0]); + node.appendChild(res2[0]); + node = createMmlNode("mrow",node); // so sum does not stretch + } else { + node = createMmlNode((underover?"munder":"msub"),node); + node.appendChild(result[0]); + } + } else { + node = createMmlNode(symbol.tag,node); + node.appendChild(result[0]); + } + } + return [node,str]; +} + +function AMparseExpr(str,rightbracket) { + var symbol, node, result, i, nodeList = [], + newFrag = document.createDocumentFragment(); + do { + str = AMremoveCharsAndBlanks(str,0); + result = AMparseIexpr(str); + node = result[0]; + str = result[1]; + symbol = AMgetSymbol(str); + if (symbol.ttype == INFIX && symbol.input == "/") { + str = AMremoveCharsAndBlanks(str,symbol.input.length); + result = AMparseIexpr(str); + if (result[0] == null) // show box in place of missing argument + result[0] = createMmlNode("mo",document.createTextNode("\u25A1")); + else AMremoveBrackets(result[0]); + str = result[1]; + AMremoveBrackets(node); + node = createMmlNode(symbol.tag,node); + node.appendChild(result[0]); + newFrag.appendChild(node); + symbol = AMgetSymbol(str); + } + else if (node!=undefined) newFrag.appendChild(node); + } while ((symbol.ttype != RIGHTBRACKET && + (symbol.ttype != LEFTRIGHT || rightbracket) + || AMnestingDepth == 0) && symbol!=null && symbol.output!=""); + if (symbol.ttype == RIGHTBRACKET || symbol.ttype == LEFTRIGHT) { +// if (AMnestingDepth > 0) AMnestingDepth--; + var len = newFrag.childNodes.length; + if (len>0 && newFrag.childNodes[len-1].nodeName == "mrow" && len>1 && + newFrag.childNodes[len-2].nodeName == "mo" && + newFrag.childNodes[len-2].firstChild.nodeValue == ",") { //matrix + var right = newFrag.childNodes[len-1].lastChild.firstChild.nodeValue; + if (right==")" || right=="]") { + var left = newFrag.childNodes[len-1].firstChild.firstChild.nodeValue; + if (left=="(" && right==")" && symbol.output != "}" || + left=="[" && right=="]") { + var pos = []; // positions of commas + var matrix = true; + var m = newFrag.childNodes.length; + for (i=0; matrix && i1) matrix = pos[i].length == pos[i-2].length; + } + if (matrix) { + var row, frag, n, k, table = document.createDocumentFragment(); + for (i=0; i(-,-,...,-,-) + n = node.childNodes.length; + k = 0; + node.removeChild(node.firstChild); //remove ( + for (j=1; j2) { + newFrag.removeChild(newFrag.firstChild); //remove ) + newFrag.removeChild(newFrag.firstChild); //remove , + } + table.appendChild(createMmlNode("mtr",row)); + } + node = createMmlNode("mtable",table); + if (typeof symbol.invisible == "boolean" && symbol.invisible) node.setAttribute("columnalign","left"); + newFrag.replaceChild(node,newFrag.firstChild); + } + } + } + } + str = AMremoveCharsAndBlanks(str,symbol.input.length); + if (typeof symbol.invisible != "boolean" || !symbol.invisible) { + node = createMmlNode("mo",document.createTextNode(symbol.output)); + newFrag.appendChild(node); + } + } + return [newFrag,str]; +} + +function parseMath(str,latex) { + var frag, node; + AMnestingDepth = 0; + frag = latex ? LMparseExpr(str.replace(/^\s+/g,""),false,false)[0] : AMparseExpr(str.replace(/^\s+/g,""),false)[0]; + node = createMmlNode("mstyle",frag); + node.setAttribute("mathcolor",mathcolor); + node.setAttribute("fontfamily",mathfontfamily); + node.setAttribute("mathsize",mathfontsize); + if (displaystyle) node.setAttribute("displaystyle","true"); + node = createMmlNode("math",node); + if (showasciiformulaonhover) //fixed by djhsu so newline + node.setAttribute("title",str.replace(/\s+/g," "));//does not show in Gecko + return node; +} + +function strarr2docFrag(arr, linebreaks, latex) { + var newFrag=document.createDocumentFragment(); + var expr = false; + for (var i=0; i,\\|!:;'~]|\\.(?!(?:\x20|$))|"+ambigAMtoken+englishAMtoken+simpleAMtoken; + var re = new RegExp("(^|\\s)((("+token+")\\s?)(("+token+secondenglishAMtoken+")\\s?)+)([,.?]?(?=\\s|$))","g"); + str = str.replace(re," `$2`$7"); + var arr = str.split(AMdelimiter1); + var re1 = new RegExp("(^|\\s)([b-zB-HJ-Z+*<>]|"+texcommand+ambigAMtoken+simpleAMtoken+")(\\s|\\n|$)","g"); + var re2 = new RegExp("(^|\\s)([a-z]|"+texcommand+ambigAMtoken+simpleAMtoken+")([,.])","g"); // removed |\d+ for now + for (i=0; i1 || mtch) { + if (!noMathML) { + frg = strarr2docFrag(arr,n.nodeType==8,latex); + var len = frg.childNodes.length; + n.parentNode.replaceChild(frg,n); + return len-1; + } else return 0; + } + } + } else return 0; + } else if (n.nodeName!="math") { + for (i=0; i +This is a convenient and inexpensive solution for authoring MathML. + +Version 1.4.7 Dec 15, 2005, (c) Peter Jipsen http://www.chapman.edu/~jipsen +Latest version at http://www.chapman.edu/~jipsen/mathml/ASCIIMathML.js +For changes see http://www.chapman.edu/~jipsen/mathml/asciimathchanges.txt +If you use it on a webpage, please send the URL to jipsen@chapman.edu + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License (at http://www.gnu.org/license/lgpl.html) +for more details. + +LaTeXMathML.js (ctd) +============== + +Content between $...$ and $$...$$ is converted by this part of the file +*/ + +// all further global variables start with "LM" + +// Commented out by DRW to prevent 1/2 turning into a 2-line fraction +// LMdiv = {input:"/", tag:"mfrac", output:"/", ttype:INFIX}, +// Commented out by DRW so that " prints literally in equations +// LMquote = {input:"\"", tag:"mtext", output:"mbox", ttype:TEXT}; + +var LMsymbols = [ +//Greek letters +{input:"\\alpha", tag:"mi", output:"\u03B1", ttype:CONST}, +{input:"\\beta", tag:"mi", output:"\u03B2", ttype:CONST}, +{input:"\\gamma", tag:"mi", output:"\u03B3", ttype:CONST}, +{input:"\\delta", tag:"mi", output:"\u03B4", ttype:CONST}, +{input:"\\epsilon", tag:"mi", output:"\u03B5", ttype:CONST}, +{input:"\\varepsilon", tag:"mi", output:"\u025B", ttype:CONST}, +{input:"\\zeta", tag:"mi", output:"\u03B6", ttype:CONST}, +{input:"\\eta", tag:"mi", output:"\u03B7", ttype:CONST}, +{input:"\\theta", tag:"mi", output:"\u03B8", ttype:CONST}, +{input:"\\vartheta", tag:"mi", output:"\u03D1", ttype:CONST}, +{input:"\\iota", tag:"mi", output:"\u03B9", ttype:CONST}, +{input:"\\kappa", tag:"mi", output:"\u03BA", ttype:CONST}, +{input:"\\lambda", tag:"mi", output:"\u03BB", ttype:CONST}, +{input:"\\mu", tag:"mi", output:"\u03BC", ttype:CONST}, +{input:"\\nu", tag:"mi", output:"\u03BD", ttype:CONST}, +{input:"\\xi", tag:"mi", output:"\u03BE", ttype:CONST}, +{input:"\\pi", tag:"mi", output:"\u03C0", ttype:CONST}, +{input:"\\varpi", tag:"mi", output:"\u03D6", ttype:CONST}, +{input:"\\rho", tag:"mi", output:"\u03C1", ttype:CONST}, +{input:"\\varrho", tag:"mi", output:"\u03F1", ttype:CONST}, +{input:"\\varsigma", tag:"mi", output:"\u03C2", ttype:CONST}, +{input:"\\sigma", tag:"mi", output:"\u03C3", ttype:CONST}, +{input:"\\tau", tag:"mi", output:"\u03C4", ttype:CONST}, +{input:"\\upsilon", tag:"mi", output:"\u03C5", ttype:CONST}, +{input:"\\phi", tag:"mi", output:"\u03C6", ttype:CONST}, +{input:"\\varphi", tag:"mi", output:"\u03D5", ttype:CONST}, +{input:"\\chi", tag:"mi", output:"\u03C7", ttype:CONST}, +{input:"\\psi", tag:"mi", output:"\u03C8", ttype:CONST}, +{input:"\\omega", tag:"mi", output:"\u03C9", ttype:CONST}, +{input:"\\Gamma", tag:"mo", output:"\u0393", ttype:CONST}, +{input:"\\Delta", tag:"mo", output:"\u0394", ttype:CONST}, +{input:"\\Theta", tag:"mo", output:"\u0398", ttype:CONST}, +{input:"\\Lambda", tag:"mo", output:"\u039B", ttype:CONST}, +{input:"\\Xi", tag:"mo", output:"\u039E", ttype:CONST}, +{input:"\\Pi", tag:"mo", output:"\u03A0", ttype:CONST}, +{input:"\\Sigma", tag:"mo", output:"\u03A3", ttype:CONST}, +{input:"\\Upsilon", tag:"mo", output:"\u03A5", ttype:CONST}, +{input:"\\Phi", tag:"mo", output:"\u03A6", ttype:CONST}, +{input:"\\Psi", tag:"mo", output:"\u03A8", ttype:CONST}, +{input:"\\Omega", tag:"mo", output:"\u03A9", ttype:CONST}, + +//fractions +{input:"\\frac12", tag:"mo", output:"\u00BD", ttype:CONST}, +{input:"\\frac14", tag:"mo", output:"\u00BC", ttype:CONST}, +{input:"\\frac34", tag:"mo", output:"\u00BE", ttype:CONST}, +{input:"\\frac13", tag:"mo", output:"\u2153", ttype:CONST}, +{input:"\\frac23", tag:"mo", output:"\u2154", ttype:CONST}, +{input:"\\frac15", tag:"mo", output:"\u2155", ttype:CONST}, +{input:"\\frac25", tag:"mo", output:"\u2156", ttype:CONST}, +{input:"\\frac35", tag:"mo", output:"\u2157", ttype:CONST}, +{input:"\\frac45", tag:"mo", output:"\u2158", ttype:CONST}, +{input:"\\frac16", tag:"mo", output:"\u2159", ttype:CONST}, +{input:"\\frac56", tag:"mo", output:"\u215A", ttype:CONST}, +{input:"\\frac18", tag:"mo", output:"\u215B", ttype:CONST}, +{input:"\\frac38", tag:"mo", output:"\u215C", ttype:CONST}, +{input:"\\frac58", tag:"mo", output:"\u215D", ttype:CONST}, +{input:"\\frac78", tag:"mo", output:"\u215E", ttype:CONST}, + +//binary operation symbols +{input:"\\pm", tag:"mo", output:"\u00B1", ttype:CONST}, +{input:"\\mp", tag:"mo", output:"\u2213", ttype:CONST}, +{input:"\\triangleleft",tag:"mo", output:"\u22B2", ttype:CONST}, +{input:"\\triangleright",tag:"mo",output:"\u22B3", ttype:CONST}, +{input:"\\cdot", tag:"mo", output:"\u22C5", ttype:CONST}, +{input:"\\star", tag:"mo", output:"\u22C6", ttype:CONST}, +{input:"\\ast", tag:"mo", output:"\u002A", ttype:CONST}, +{input:"\\times", tag:"mo", output:"\u00D7", ttype:CONST}, +{input:"\\div", tag:"mo", output:"\u00F7", ttype:CONST}, +{input:"\\circ", tag:"mo", output:"\u2218", ttype:CONST}, +//{input:"\\bullet", tag:"mo", output:"\u2219", ttype:CONST}, +{input:"\\bullet", tag:"mo", output:"\u2022", ttype:CONST}, +{input:"\\oplus", tag:"mo", output:"\u2295", ttype:CONST}, +{input:"\\ominus", tag:"mo", output:"\u2296", ttype:CONST}, +{input:"\\otimes", tag:"mo", output:"\u2297", ttype:CONST}, +{input:"\\bigcirc", tag:"mo", output:"\u25CB", ttype:CONST}, +{input:"\\oslash", tag:"mo", output:"\u2298", ttype:CONST}, +{input:"\\odot", tag:"mo", output:"\u2299", ttype:CONST}, +{input:"\\land", tag:"mo", output:"\u2227", ttype:CONST}, +{input:"\\wedge", tag:"mo", output:"\u2227", ttype:CONST}, +{input:"\\lor", tag:"mo", output:"\u2228", ttype:CONST}, +{input:"\\vee", tag:"mo", output:"\u2228", ttype:CONST}, +{input:"\\cap", tag:"mo", output:"\u2229", ttype:CONST}, +{input:"\\cup", tag:"mo", output:"\u222A", ttype:CONST}, +{input:"\\sqcap", tag:"mo", output:"\u2293", ttype:CONST}, +{input:"\\sqcup", tag:"mo", output:"\u2294", ttype:CONST}, +{input:"\\uplus", tag:"mo", output:"\u228E", ttype:CONST}, +{input:"\\amalg", tag:"mo", output:"\u2210", ttype:CONST}, +{input:"\\bigtriangleup",tag:"mo",output:"\u25B3", ttype:CONST}, +{input:"\\bigtriangledown",tag:"mo",output:"\u25BD", ttype:CONST}, +{input:"\\dag", tag:"mo", output:"\u2020", ttype:CONST}, +{input:"\\dagger", tag:"mo", output:"\u2020", ttype:CONST}, +{input:"\\ddag", tag:"mo", output:"\u2021", ttype:CONST}, +{input:"\\ddagger", tag:"mo", output:"\u2021", ttype:CONST}, +{input:"\\lhd", tag:"mo", output:"\u22B2", ttype:CONST}, +{input:"\\rhd", tag:"mo", output:"\u22B3", ttype:CONST}, +{input:"\\unlhd", tag:"mo", output:"\u22B4", ttype:CONST}, +{input:"\\unrhd", tag:"mo", output:"\u22B5", ttype:CONST}, + + +//BIG Operators +{input:"\\sum", tag:"mo", output:"\u2211", ttype:UNDEROVER}, +{input:"\\prod", tag:"mo", output:"\u220F", ttype:UNDEROVER}, +{input:"\\bigcap", tag:"mo", output:"\u22C2", ttype:UNDEROVER}, +{input:"\\bigcup", tag:"mo", output:"\u22C3", ttype:UNDEROVER}, +{input:"\\bigwedge", tag:"mo", output:"\u22C0", ttype:UNDEROVER}, +{input:"\\bigvee", tag:"mo", output:"\u22C1", ttype:UNDEROVER}, +{input:"\\bigsqcap", tag:"mo", output:"\u2A05", ttype:UNDEROVER}, +{input:"\\bigsqcup", tag:"mo", output:"\u2A06", ttype:UNDEROVER}, +{input:"\\coprod", tag:"mo", output:"\u2210", ttype:UNDEROVER}, +{input:"\\bigoplus", tag:"mo", output:"\u2A01", ttype:UNDEROVER}, +{input:"\\bigotimes", tag:"mo", output:"\u2A02", ttype:UNDEROVER}, +{input:"\\bigodot", tag:"mo", output:"\u2A00", ttype:UNDEROVER}, +{input:"\\biguplus", tag:"mo", output:"\u2A04", ttype:UNDEROVER}, +{input:"\\int", tag:"mo", output:"\u222B", ttype:CONST}, +{input:"\\oint", tag:"mo", output:"\u222E", ttype:CONST}, + +//binary relation symbols +{input:":=", tag:"mo", output:":=", ttype:CONST}, +{input:"\\lt", tag:"mo", output:"<", ttype:CONST}, +{input:"\\gt", tag:"mo", output:">", ttype:CONST}, +{input:"\\ne", tag:"mo", output:"\u2260", ttype:CONST}, +{input:"\\neq", tag:"mo", output:"\u2260", ttype:CONST}, +{input:"\\le", tag:"mo", output:"\u2264", ttype:CONST}, +{input:"\\leq", tag:"mo", output:"\u2264", ttype:CONST}, +{input:"\\leqslant", tag:"mo", output:"\u2264", ttype:CONST}, +{input:"\\ge", tag:"mo", output:"\u2265", ttype:CONST}, +{input:"\\geq", tag:"mo", output:"\u2265", ttype:CONST}, +{input:"\\geqslant", tag:"mo", output:"\u2265", ttype:CONST}, +{input:"\\equiv", tag:"mo", output:"\u2261", ttype:CONST}, +{input:"\\ll", tag:"mo", output:"\u226A", ttype:CONST}, +{input:"\\gg", tag:"mo", output:"\u226B", ttype:CONST}, +{input:"\\doteq", tag:"mo", output:"\u2250", ttype:CONST}, +{input:"\\prec", tag:"mo", output:"\u227A", ttype:CONST}, +{input:"\\succ", tag:"mo", output:"\u227B", ttype:CONST}, +{input:"\\preceq", tag:"mo", output:"\u227C", ttype:CONST}, +{input:"\\succeq", tag:"mo", output:"\u227D", ttype:CONST}, +{input:"\\subset", tag:"mo", output:"\u2282", ttype:CONST}, +{input:"\\supset", tag:"mo", output:"\u2283", ttype:CONST}, +{input:"\\subseteq", tag:"mo", output:"\u2286", ttype:CONST}, +{input:"\\supseteq", tag:"mo", output:"\u2287", ttype:CONST}, +{input:"\\sqsubset", tag:"mo", output:"\u228F", ttype:CONST}, +{input:"\\sqsupset", tag:"mo", output:"\u2290", ttype:CONST}, +{input:"\\sqsubseteq", tag:"mo", output:"\u2291", ttype:CONST}, +{input:"\\sqsupseteq", tag:"mo", output:"\u2292", ttype:CONST}, +{input:"\\sim", tag:"mo", output:"\u223C", ttype:CONST}, +{input:"\\simeq", tag:"mo", output:"\u2243", ttype:CONST}, +{input:"\\approx", tag:"mo", output:"\u2248", ttype:CONST}, +{input:"\\cong", tag:"mo", output:"\u2245", ttype:CONST}, +{input:"\\Join", tag:"mo", output:"\u22C8", ttype:CONST}, +{input:"\\bowtie", tag:"mo", output:"\u22C8", ttype:CONST}, +{input:"\\in", tag:"mo", output:"\u2208", ttype:CONST}, +{input:"\\ni", tag:"mo", output:"\u220B", ttype:CONST}, +{input:"\\owns", tag:"mo", output:"\u220B", ttype:CONST}, +{input:"\\propto", tag:"mo", output:"\u221D", ttype:CONST}, +{input:"\\vdash", tag:"mo", output:"\u22A2", ttype:CONST}, +{input:"\\dashv", tag:"mo", output:"\u22A3", ttype:CONST}, +{input:"\\models", tag:"mo", output:"\u22A8", ttype:CONST}, +{input:"\\perp", tag:"mo", output:"\u22A5", ttype:CONST}, +{input:"\\smile", tag:"mo", output:"\u2323", ttype:CONST}, +{input:"\\frown", tag:"mo", output:"\u2322", ttype:CONST}, +{input:"\\asymp", tag:"mo", output:"\u224D", ttype:CONST}, +{input:"\\notin", tag:"mo", output:"\u2209", ttype:CONST}, + +//matrices +{input:"\\begin{eqnarray}", output:"X", ttype:MATRIX, invisible:true}, +{input:"\\begin{array}", output:"X", ttype:MATRIX, invisible:true}, +{input:"\\\\", output:"}&{", ttype:DEFINITION}, +{input:"\\end{eqnarray}", output:"}}", ttype:DEFINITION}, +{input:"\\end{array}", output:"}}", ttype:DEFINITION}, + +//grouping and literal brackets -- ieval is for IE +{input:"\\big", tag:"mo", output:"X", atval:"1.2", ieval:"2.2", ttype:BIG}, +{input:"\\Big", tag:"mo", output:"X", atval:"1.6", ieval:"2.6", ttype:BIG}, +{input:"\\bigg", tag:"mo", output:"X", atval:"2.2", ieval:"3.2", ttype:BIG}, +{input:"\\Bigg", tag:"mo", output:"X", atval:"2.9", ieval:"3.9", ttype:BIG}, +{input:"\\left", tag:"mo", output:"X", ttype:LEFTBRACKET}, +{input:"\\right", tag:"mo", output:"X", ttype:RIGHTBRACKET}, +{input:"{", output:"{", ttype:LEFTBRACKET, invisible:true}, +{input:"}", output:"}", ttype:RIGHTBRACKET, invisible:true}, + +{input:"(", tag:"mo", output:"(", atval:"1", ttype:STRETCHY}, +{input:"[", tag:"mo", output:"[", atval:"1", ttype:STRETCHY}, +{input:"\\lbrack", tag:"mo", output:"[", atval:"1", ttype:STRETCHY}, +{input:"\\{", tag:"mo", output:"{", atval:"1", ttype:STRETCHY}, +{input:"\\lbrace", tag:"mo", output:"{", atval:"1", ttype:STRETCHY}, +{input:"\\langle", tag:"mo", output:"\u2329", atval:"1", ttype:STRETCHY}, +{input:"\\lfloor", tag:"mo", output:"\u230A", atval:"1", ttype:STRETCHY}, +{input:"\\lceil", tag:"mo", output:"\u2308", atval:"1", ttype:STRETCHY}, + +// rtag:"mi" causes space to be inserted before a following sin, cos, etc. +// (see function LMparseExpr() ) +{input:")", tag:"mo",output:")", rtag:"mi",atval:"1",ttype:STRETCHY}, +{input:"]", tag:"mo",output:"]", rtag:"mi",atval:"1",ttype:STRETCHY}, +{input:"\\rbrack",tag:"mo",output:"]", rtag:"mi",atval:"1",ttype:STRETCHY}, +{input:"\\}", tag:"mo",output:"}", rtag:"mi",atval:"1",ttype:STRETCHY}, +{input:"\\rbrace",tag:"mo",output:"}", rtag:"mi",atval:"1",ttype:STRETCHY}, +{input:"\\rangle",tag:"mo",output:"\u232A", rtag:"mi",atval:"1",ttype:STRETCHY}, +{input:"\\rfloor",tag:"mo",output:"\u230B", rtag:"mi",atval:"1",ttype:STRETCHY}, +{input:"\\rceil", tag:"mo",output:"\u2309", rtag:"mi",atval:"1",ttype:STRETCHY}, + +// "|", "\\|", "\\vert" and "\\Vert" modified later: lspace = rspace = 0em +{input:"|", tag:"mo", output:"\u2223", atval:"1", ttype:STRETCHY}, +{input:"\\|", tag:"mo", output:"\u2225", atval:"1", ttype:STRETCHY}, +{input:"\\vert", tag:"mo", output:"\u2223", atval:"1", ttype:STRETCHY}, +{input:"\\Vert", tag:"mo", output:"\u2225", atval:"1", ttype:STRETCHY}, +{input:"\\mid", tag:"mo", output:"\u2223", atval:"1", ttype:STRETCHY}, +{input:"\\parallel", tag:"mo", output:"\u2225", atval:"1", ttype:STRETCHY}, +{input:"/", tag:"mo", output:"/", atval:"1.01", ttype:STRETCHY}, +{input:"\\backslash", tag:"mo", output:"\u2216", atval:"1", ttype:STRETCHY}, +{input:"\\setminus", tag:"mo", output:"\\", ttype:CONST}, + +//miscellaneous symbols +{input:"\\!", tag:"mspace", atname:"width", atval:"-0.167em", ttype:SPACE}, +{input:"\\,", tag:"mspace", atname:"width", atval:"0.167em", ttype:SPACE}, +{input:"\\>", tag:"mspace", atname:"width", atval:"0.222em", ttype:SPACE}, +{input:"\\:", tag:"mspace", atname:"width", atval:"0.222em", ttype:SPACE}, +{input:"\\;", tag:"mspace", atname:"width", atval:"0.278em", ttype:SPACE}, +{input:"~", tag:"mspace", atname:"width", atval:"0.333em", ttype:SPACE}, +{input:"\\quad", tag:"mspace", atname:"width", atval:"1em", ttype:SPACE}, +{input:"\\qquad", tag:"mspace", atname:"width", atval:"2em", ttype:SPACE}, +//{input:"{}", tag:"mo", output:"\u200B", ttype:CONST}, // zero-width +{input:"\\prime", tag:"mo", output:"\u2032", ttype:CONST}, +{input:"'", tag:"mo", output:"\u02B9", ttype:CONST}, +{input:"''", tag:"mo", output:"\u02BA", ttype:CONST}, +{input:"'''", tag:"mo", output:"\u2034", ttype:CONST}, +{input:"''''", tag:"mo", output:"\u2057", ttype:CONST}, +{input:"\\ldots", tag:"mo", output:"\u2026", ttype:CONST}, +{input:"\\cdots", tag:"mo", output:"\u22EF", ttype:CONST}, +{input:"\\vdots", tag:"mo", output:"\u22EE", ttype:CONST}, +{input:"\\ddots", tag:"mo", output:"\u22F1", ttype:CONST}, +{input:"\\forall", tag:"mo", output:"\u2200", ttype:CONST}, +{input:"\\exists", tag:"mo", output:"\u2203", ttype:CONST}, +{input:"\\Re", tag:"mo", output:"\u211C", ttype:CONST}, +{input:"\\Im", tag:"mo", output:"\u2111", ttype:CONST}, +{input:"\\aleph", tag:"mo", output:"\u2135", ttype:CONST}, +{input:"\\hbar", tag:"mo", output:"\u210F", ttype:CONST}, +{input:"\\ell", tag:"mo", output:"\u2113", ttype:CONST}, +{input:"\\wp", tag:"mo", output:"\u2118", ttype:CONST}, +{input:"\\emptyset", tag:"mo", output:"\u2205", ttype:CONST}, +{input:"\\infty", tag:"mo", output:"\u221E", ttype:CONST}, +{input:"\\surd", tag:"mo", output:"\\sqrt{}", ttype:DEFINITION}, +{input:"\\partial", tag:"mo", output:"\u2202", ttype:CONST}, +{input:"\\nabla", tag:"mo", output:"\u2207", ttype:CONST}, +{input:"\\triangle", tag:"mo", output:"\u25B3", ttype:CONST}, +{input:"\\therefore", tag:"mo", output:"\u2234", ttype:CONST}, +{input:"\\angle", tag:"mo", output:"\u2220", ttype:CONST}, +//{input:"\\\\ ", tag:"mo", output:"\u00A0", ttype:CONST}, +{input:"\\diamond", tag:"mo", output:"\u22C4", ttype:CONST}, +//{input:"\\Diamond", tag:"mo", output:"\u25CA", ttype:CONST}, +{input:"\\Diamond", tag:"mo", output:"\u25C7", ttype:CONST}, +{input:"\\neg", tag:"mo", output:"\u00AC", ttype:CONST}, +{input:"\\lnot", tag:"mo", output:"\u00AC", ttype:CONST}, +{input:"\\bot", tag:"mo", output:"\u22A5", ttype:CONST}, +{input:"\\top", tag:"mo", output:"\u22A4", ttype:CONST}, +{input:"\\square", tag:"mo", output:"\u25AB", ttype:CONST}, +{input:"\\Box", tag:"mo", output:"\u25A1", ttype:CONST}, +{input:"\\wr", tag:"mo", output:"\u2240", ttype:CONST}, + +//standard functions +//Note UNDEROVER *must* have tag:"mo" to work properly +{input:"\\arccos", tag:"mi", output:"arccos", ttype:UNARY, func:true}, +{input:"\\arcsin", tag:"mi", output:"arcsin", ttype:UNARY, func:true}, +{input:"\\arctan", tag:"mi", output:"arctan", ttype:UNARY, func:true}, +{input:"\\arg", tag:"mi", output:"arg", ttype:UNARY, func:true}, +{input:"\\cos", tag:"mi", output:"cos", ttype:UNARY, func:true}, +{input:"\\cosh", tag:"mi", output:"cosh", ttype:UNARY, func:true}, +{input:"\\cot", tag:"mi", output:"cot", ttype:UNARY, func:true}, +{input:"\\coth", tag:"mi", output:"coth", ttype:UNARY, func:true}, +{input:"\\csc", tag:"mi", output:"csc", ttype:UNARY, func:true}, +{input:"\\deg", tag:"mi", output:"deg", ttype:UNARY, func:true}, +{input:"\\det", tag:"mi", output:"det", ttype:UNARY, func:true}, +{input:"\\dim", tag:"mi", output:"dim", ttype:UNARY, func:true}, //CONST? +{input:"\\exp", tag:"mi", output:"exp", ttype:UNARY, func:true}, +{input:"\\gcd", tag:"mi", output:"gcd", ttype:UNARY, func:true}, //CONST? +{input:"\\hom", tag:"mi", output:"hom", ttype:UNARY, func:true}, +{input:"\\inf", tag:"mo", output:"inf", ttype:UNDEROVER}, +{input:"\\ker", tag:"mi", output:"ker", ttype:UNARY, func:true}, +{input:"\\lg", tag:"mi", output:"lg", ttype:UNARY, func:true}, +{input:"\\lim", tag:"mo", output:"lim", ttype:UNDEROVER}, +{input:"\\liminf", tag:"mo", output:"liminf", ttype:UNDEROVER}, +{input:"\\limsup", tag:"mo", output:"limsup", ttype:UNDEROVER}, +{input:"\\ln", tag:"mi", output:"ln", ttype:UNARY, func:true}, +{input:"\\log", tag:"mi", output:"log", ttype:UNARY, func:true}, +{input:"\\max", tag:"mo", output:"max", ttype:UNDEROVER}, +{input:"\\min", tag:"mo", output:"min", ttype:UNDEROVER}, +{input:"\\Pr", tag:"mi", output:"Pr", ttype:UNARY, func:true}, +{input:"\\sec", tag:"mi", output:"sec", ttype:UNARY, func:true}, +{input:"\\sin", tag:"mi", output:"sin", ttype:UNARY, func:true}, +{input:"\\sinh", tag:"mi", output:"sinh", ttype:UNARY, func:true}, +{input:"\\sup", tag:"mo", output:"sup", ttype:UNDEROVER}, +{input:"\\tan", tag:"mi", output:"tan", ttype:UNARY, func:true}, +{input:"\\tanh", tag:"mi", output:"tanh", ttype:UNARY, func:true}, + +//arrows +{input:"\\gets", tag:"mo", output:"\u2190", ttype:CONST}, +{input:"\\leftarrow", tag:"mo", output:"\u2190", ttype:CONST}, +{input:"\\to", tag:"mo", output:"\u2192", ttype:CONST}, +{input:"\\rightarrow", tag:"mo", output:"\u2192", ttype:CONST}, +{input:"\\leftrightarrow", tag:"mo", output:"\u2194", ttype:CONST}, +{input:"\\uparrow", tag:"mo", output:"\u2191", ttype:CONST}, +{input:"\\downarrow", tag:"mo", output:"\u2193", ttype:CONST}, +{input:"\\updownarrow", tag:"mo", output:"\u2195", ttype:CONST}, +{input:"\\Leftarrow", tag:"mo", output:"\u21D0", ttype:CONST}, +{input:"\\Rightarrow", tag:"mo", output:"\u21D2", ttype:CONST}, +{input:"\\Leftrightarrow", tag:"mo", output:"\u21D4", ttype:CONST}, +{input:"\\iff", tag:"mo", output:"~\\Longleftrightarrow~", ttype:DEFINITION}, +{input:"\\Uparrow", tag:"mo", output:"\u21D1", ttype:CONST}, +{input:"\\Downarrow", tag:"mo", output:"\u21D3", ttype:CONST}, +{input:"\\Updownarrow", tag:"mo", output:"\u21D5", ttype:CONST}, +{input:"\\mapsto", tag:"mo", output:"\u21A6", ttype:CONST}, +{input:"\\longleftarrow", tag:"mo", output:"\u2190", ttype:LONG}, +{input:"\\longrightarrow", tag:"mo", output:"\u2192", ttype:LONG}, +{input:"\\longleftrightarrow", tag:"mo", output:"\u2194", ttype:LONG}, +{input:"\\Longleftarrow", tag:"mo", output:"\u21D0", ttype:LONG}, +{input:"\\Longrightarrow", tag:"mo", output:"\u21D2", ttype:LONG}, +{input:"\\implies", tag:"mo", output:"\u21D2", ttype:LONG}, +{input:"\\Longleftrightarrow", tag:"mo", output:"\u21D4", ttype:LONG}, +{input:"\\longmapsto", tag:"mo", output:"\u21A6", ttype:CONST}, + // disaster if LONG + +//commands with argument + +{input:"\\sqrt", tag:"msqrt", output:"sqrt", ttype:UNARY}, +{input:"\\root", tag:"mroot", output:"root", ttype:BINARY}, +{input:"\\frac", tag:"mfrac", output:"/", ttype:BINARY}, +{input:"\\stackrel", tag:"mover", output:"stackrel", ttype:BINARY}, +{input:"\\atop", tag:"mfrac", output:"", ttype:INFIX}, +{input:"\\choose", tag:"mfrac", output:"", ttype:INFIX}, +{input:"_", tag:"msub", output:"_", ttype:INFIX}, +{input:"^", tag:"msup", output:"^", ttype:INFIX}, +{input:"\\mathrm", tag:"mtext", output:"text", ttype:TEXT}, +{input:"\\mbox", tag:"mtext", output:"mbox", ttype:TEXT}, + +//diacritical marks +{input:"\\acute", tag:"mover", output:"\u00B4", ttype:UNARY, acc:true}, +//{input:"\\acute", tag:"mover", output:"\u0317", ttype:UNARY, acc:true}, +//{input:"\\acute", tag:"mover", output:"\u0301", ttype:UNARY, acc:true}, +//{input:"\\grave", tag:"mover", output:"\u0300", ttype:UNARY, acc:true}, +//{input:"\\grave", tag:"mover", output:"\u0316", ttype:UNARY, acc:true}, +{input:"\\grave", tag:"mover", output:"\u0060", ttype:UNARY, acc:true}, +{input:"\\breve", tag:"mover", output:"\u02D8", ttype:UNARY, acc:true}, +{input:"\\check", tag:"mover", output:"\u02C7", ttype:UNARY, acc:true}, +{input:"\\dot", tag:"mover", output:".", ttype:UNARY, acc:true}, +{input:"\\ddot", tag:"mover", output:"..", ttype:UNARY, acc:true}, +//{input:"\\ddot", tag:"mover", output:"\u00A8", ttype:UNARY, acc:true}, +{input:"\\mathring", tag:"mover", output:"\u00B0", ttype:UNARY, acc:true}, +{input:"\\vec", tag:"mover", output:"\u20D7", ttype:UNARY, acc:true}, +{input:"\\overrightarrow",tag:"mover",output:"\u20D7", ttype:UNARY, acc:true}, +{input:"\\overleftarrow",tag:"mover", output:"\u20D6", ttype:UNARY, acc:true}, +{input:"\\hat", tag:"mover", output:"\u005E", ttype:UNARY, acc:true}, +{input:"\\widehat", tag:"mover", output:"\u0302", ttype:UNARY, acc:true}, +{input:"\\tilde", tag:"mover", output:"~", ttype:UNARY, acc:true}, +//{input:"\\tilde", tag:"mover", output:"\u0303", ttype:UNARY, acc:true}, +{input:"\\widetilde", tag:"mover", output:"\u02DC", ttype:UNARY, acc:true}, +{input:"\\bar", tag:"mover", output:"\u203E", ttype:UNARY, acc:true}, +{input:"\\overbrace", tag:"mover", output:"\u23B4", ttype:UNARY, acc:true}, +{input:"\\overline", tag:"mover", output:"\u00AF", ttype:UNARY, acc:true}, +{input:"\\underbrace", tag:"munder", output:"\u23B5", ttype:UNARY, acc:true}, +{input:"\\underline", tag:"munder", output:"\u00AF", ttype:UNARY, acc:true}, +//{input:"underline", tag:"munder", output:"\u0332", ttype:UNARY, acc:true}, + +//typestyles and fonts +{input:"\\displaystyle",tag:"mstyle",atname:"displaystyle",atval:"true", ttype:UNARY}, +{input:"\\textstyle",tag:"mstyle",atname:"displaystyle",atval:"false", ttype:UNARY}, +{input:"\\scriptstyle",tag:"mstyle",atname:"scriptlevel",atval:"1", ttype:UNARY}, +{input:"\\scriptscriptstyle",tag:"mstyle",atname:"scriptlevel",atval:"2", ttype:UNARY}, +{input:"\\textrm", tag:"mstyle", output:"\\mathrm", ttype: DEFINITION}, +{input:"\\mathbf", tag:"mstyle", atname:"mathvariant", atval:"bold", ttype:UNARY}, +{input:"\\textbf", tag:"mstyle", atname:"mathvariant", atval:"bold", ttype:UNARY}, +{input:"\\mathit", tag:"mstyle", atname:"mathvariant", atval:"italic", ttype:UNARY}, +{input:"\\textit", tag:"mstyle", atname:"mathvariant", atval:"italic", ttype:UNARY}, +{input:"\\mathtt", tag:"mstyle", atname:"mathvariant", atval:"monospace", ttype:UNARY}, +{input:"\\texttt", tag:"mstyle", atname:"mathvariant", atval:"monospace", ttype:UNARY}, +{input:"\\mathsf", tag:"mstyle", atname:"mathvariant", atval:"sans-serif", ttype:UNARY}, +{input:"\\mathbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", ttype:UNARY, codes:AMbbb}, +{input:"\\mathcal",tag:"mstyle", atname:"mathvariant", atval:"script", ttype:UNARY, codes:AMcal}, +{input:"\\mathfrak",tag:"mstyle",atname:"mathvariant", atval:"fraktur",ttype:UNARY, codes:AMfrk} +]; + +var LMnames = []; //list of input symbols + +function LMremoveCharsAndBlanks(str,n) { +//remove n characters and any following blanks + var st; + st = str.slice(n); + for (var i=0; i=LMnames[k]; + } + LMpreviousSymbol=LMcurrentSymbol; + if (match!=""){ + LMcurrentSymbol=LMsymbols[mk].ttype; + return LMsymbols[mk]; + } + LMcurrentSymbol=CONST; + k = 1; + st = str.slice(0,1); //take 1 character + if ("0"<=st && st<="9") tagst = "mn"; + else tagst = (("A">st || st>"Z") && ("a">st || st>"z")?"mo":"mi"); +/* +// Commented out by DRW (not fully understood, but probably to do with +// use of "/" as an INFIX version of "\\frac", which we don't want): +//} +//if (st=="-" && LMpreviousSymbol==INFIX) { +// LMcurrentSymbol = INFIX; //trick "/" into recognizing "-" on second parse +// return {input:st, tag:tagst, output:st, ttype:UNARY, func:true}; +//} +*/ + return {input:st, tag:tagst, output:st, ttype:CONST}; +} + + +/*Parsing ASCII math expressions with the following grammar +v ::= [A-Za-z] | greek letters | numbers | other constant symbols +u ::= sqrt | text | bb | other unary symbols for font commands +b ::= frac | root | stackrel binary symbols +l ::= { | \left left brackets +r ::= } | \right right brackets +S ::= v | lEr | uS | bSS Simple expression +I ::= S_S | S^S | S_S^S | S Intermediate expression +E ::= IE | I/I Expression +Each terminal symbol is translated into a corresponding mathml node.*/ + +var LMpreviousSymbol,LMcurrentSymbol; + +function LMparseSexpr(str) { //parses str and returns [node,tailstr,(node)tag] + var symbol, node, result, result2, i, st,// rightvert = false, + newFrag = document.createDocumentFragment(); + str = LMremoveCharsAndBlanks(str,0); + symbol = LMgetSymbol(str); //either a token or a bracket or empty + if (symbol == null || symbol.ttype == RIGHTBRACKET) + return [null,str,null]; + if (symbol.ttype == DEFINITION) { + str = symbol.output+LMremoveCharsAndBlanks(str,symbol.input.length); + symbol = LMgetSymbol(str); + if (symbol == null || symbol.ttype == RIGHTBRACKET) + return [null,str,null]; + } + str = LMremoveCharsAndBlanks(str,symbol.input.length); + switch (symbol.ttype) { + case SPACE: + node = createMmlNode(symbol.tag); + node.setAttribute(symbol.atname,symbol.atval); + return [node,str,symbol.tag]; + case UNDEROVER: + if (isIE) { + if (symbol.input.substr(0,4) == "\\big") { // botch for missing symbols + str = "\\"+symbol.input.substr(4)+str; // make \bigcup = \cup etc. + symbol = LMgetSymbol(str); + symbol.ttype = UNDEROVER; + str = LMremoveCharsAndBlanks(str,symbol.input.length); + } + } + return [createMmlNode(symbol.tag, + document.createTextNode(symbol.output)),str,symbol.tag]; + case CONST: + var output = symbol.output; + if (isIE) { + if (symbol.input == "'") + output = "\u2032"; + else if (symbol.input == "''") + output = "\u2033"; + else if (symbol.input == "'''") + output = "\u2033\u2032"; + else if (symbol.input == "''''") + output = "\u2033\u2033"; + else if (symbol.input == "\\square") + output = "\u25A1"; // same as \Box + else if (symbol.input.substr(0,5) == "\\frac") { + // botch for missing fractions + var denom = symbol.input.substr(6,1); + if (denom == "5" || denom == "6") { + str = symbol.input.replace(/\\frac/,"\\frac ")+str; + return [node,str,symbol.tag]; + } + } + } + node = createMmlNode(symbol.tag,document.createTextNode(output)); + return [node,str,symbol.tag]; + case LONG: // added by DRW + node = createMmlNode(symbol.tag,document.createTextNode(symbol.output)); + node.setAttribute("minsize","1.5"); + node.setAttribute("maxsize","1.5"); + node = createMmlNode("mover",node); + node.appendChild(createMmlNode("mspace")); + return [node,str,symbol.tag]; + case STRETCHY: // added by DRW + if (isIE && symbol.input == "\\backslash") + symbol.output = "\\"; // doesn't expand, but then nor does "\u2216" + node = createMmlNode(symbol.tag,document.createTextNode(symbol.output)); + if (symbol.input == "|" || symbol.input == "\\vert" || + symbol.input == "\\|" || symbol.input == "\\Vert") { + node.setAttribute("lspace","0em"); + node.setAttribute("rspace","0em"); + } + node.setAttribute("maxsize",symbol.atval); // don't allow to stretch here + if (symbol.rtag != null) + return [node,str,symbol.rtag]; + else + return [node,str,symbol.tag]; + case BIG: // added by DRW + var atval = symbol.atval; + if (isIE) + atval = symbol.ieval; + symbol = LMgetSymbol(str); + if (symbol == null) + return [null,str,null]; + str = LMremoveCharsAndBlanks(str,symbol.input.length); + node = createMmlNode(symbol.tag,document.createTextNode(symbol.output)); + if (isIE) { // to get brackets to expand + var space = createMmlNode("mspace"); + space.setAttribute("height",atval+"ex"); + node = createMmlNode("mrow",node); + node.appendChild(space); + } else { // ignored in IE + node.setAttribute("minsize",atval); + node.setAttribute("maxsize",atval); + } + return [node,str,symbol.tag]; + case LEFTBRACKET: //read (expr+) + if (symbol.input == "\\left") { // left what? + symbol = LMgetSymbol(str); + if (symbol != null) { + if (symbol.input == ".") + symbol.invisible = true; + str = LMremoveCharsAndBlanks(str,symbol.input.length); + } + } + result = LMparseExpr(str,true,false); + if (symbol==null || + (typeof symbol.invisible == "boolean" && symbol.invisible)) + node = createMmlNode("mrow",result[0]); + else { + node = createMmlNode("mo",document.createTextNode(symbol.output)); + node = createMmlNode("mrow",node); + node.appendChild(result[0]); + } + return [node,result[1],result[2]]; + case MATRIX: //read (expr+) + if (symbol.input == "\\begin{array}") { + var mask = ""; + symbol = LMgetSymbol(str); + str = LMremoveCharsAndBlanks(str,0); + if (symbol == null) + mask = "l"; + else { + str = LMremoveCharsAndBlanks(str,symbol.input.length); + if (symbol.input != "{") + mask = "l"; + else do { + symbol = LMgetSymbol(str); + if (symbol != null) { + str = LMremoveCharsAndBlanks(str,symbol.input.length); + if (symbol.input != "}") + mask = mask+symbol.input; + } + } while (symbol != null && symbol.input != "" && symbol.input != "}"); + } + result = LMparseExpr("{"+str,true,true); +// if (result[0]==null) return [createMmlNode("mo", +// document.createTextNode(symbol.input)),str]; + node = createMmlNode("mtable",result[0]); + mask = mask.replace(/l/g,"left "); + mask = mask.replace(/r/g,"right "); + mask = mask.replace(/c/g,"center "); + node.setAttribute("columnalign",mask); + node.setAttribute("displaystyle","false"); + if (isIE) + return [node,result[1],null]; +// trying to get a *little* bit of space around the array +// (IE already includes it) + var lspace = createMmlNode("mspace"); + lspace.setAttribute("width","0.167em"); + var rspace = createMmlNode("mspace"); + rspace.setAttribute("width","0.167em"); + var node1 = createMmlNode("mrow",lspace); + node1.appendChild(node); + node1.appendChild(rspace); + return [node1,result[1],null]; + } else { // eqnarray + result = LMparseExpr("{"+str,true,true); + node = createMmlNode("mtable",result[0]); + if (isIE) + node.setAttribute("columnspacing","0.25em"); // best in practice? + else + node.setAttribute("columnspacing","0.167em"); // correct (but ignored?) + node.setAttribute("columnalign","right center left"); + node.setAttribute("displaystyle","true"); + node = createMmlNode("mrow",node); + return [node,result[1],null]; + } + case TEXT: + if (str.charAt(0)=="{") i=str.indexOf("}"); + else i = 0; + if (i==-1) + i = str.length; + st = str.slice(1,i); + if (st.charAt(0) == " ") { + node = createMmlNode("mspace"); + node.setAttribute("width","0.33em"); // was 1ex + newFrag.appendChild(node); + } + newFrag.appendChild( + createMmlNode(symbol.tag,document.createTextNode(st))); + if (st.charAt(st.length-1) == " ") { + node = createMmlNode("mspace"); + node.setAttribute("width","0.33em"); // was 1ex + newFrag.appendChild(node); + } + str = LMremoveCharsAndBlanks(str,i+1); + return [createMmlNode("mrow",newFrag),str,null]; + case UNARY: + result = LMparseSexpr(str); + if (result[0]==null) return [createMmlNode(symbol.tag, + document.createTextNode(symbol.output)),str]; + if (typeof symbol.func == "boolean" && symbol.func) { // functions hack + st = str.charAt(0); +// if (st=="^" || st=="_" || st=="/" || st=="|" || st==",") { + if (st=="^" || st=="_" || st==",") { + return [createMmlNode(symbol.tag, + document.createTextNode(symbol.output)),str,symbol.tag]; + } else { + node = createMmlNode("mrow", + createMmlNode(symbol.tag,document.createTextNode(symbol.output))); + if (isIE) { + var space = createMmlNode("mspace"); + space.setAttribute("width","0.167em"); + node.appendChild(space); + } + node.appendChild(result[0]); + return [node,result[1],symbol.tag]; + } + } + if (symbol.input == "\\sqrt") { // sqrt + if (isIE) { // set minsize, for \surd + var space = createMmlNode("mspace"); + space.setAttribute("height","1.2ex"); + space.setAttribute("width","0em"); // probably no effect + node = createMmlNode(symbol.tag,result[0]) +// node.setAttribute("minsize","1"); // ignored +// node = createMmlNode("mrow",node); // hopefully unnecessary + node.appendChild(space); + return [node,result[1],symbol.tag]; + } else + return [createMmlNode(symbol.tag,result[0]),result[1],symbol.tag]; + } else if (typeof symbol.acc == "boolean" && symbol.acc) { // accent + node = createMmlNode(symbol.tag,result[0]); + var output = symbol.output; + if (isIE) { + if (symbol.input == "\\hat") + output = "\u0302"; + else if (symbol.input == "\\widehat") + output = "\u005E"; + else if (symbol.input == "\\bar") + output = "\u00AF"; + else if (symbol.input == "\\grave") + output = "\u0300"; + else if (symbol.input == "\\tilde") + output = "\u0303"; + } + var node1 = createMmlNode("mo",document.createTextNode(output)); + if (symbol.input == "\\vec" || symbol.input == "\\check") + // don't allow to stretch + node1.setAttribute("maxsize","1.2"); + // why doesn't "1" work? \vec nearly disappears in firefox + if (isIE && symbol.input == "\\bar") + node1.setAttribute("maxsize","0.5"); + if (symbol.input == "\\underbrace" || symbol.input == "\\underline") + node1.setAttribute("accentunder","true"); + else + node1.setAttribute("accent","true"); + node.appendChild(node1); + if (symbol.input == "\\overbrace" || symbol.input == "\\underbrace") + node.ttype = UNDEROVER; + return [node,result[1],symbol.tag]; + } else { // font change or displaystyle command + if (!isIE && typeof symbol.codes != "undefined") { + for (i=0; i64 && st.charCodeAt(j)<91) newst = newst + + String.fromCharCode(symbol.codes[st.charCodeAt(j)-65]); + else newst = newst + st.charAt(j); + if (result[0].nodeName=="mi") + result[0]=createMmlNode("mo"). + appendChild(document.createTextNode(newst)); + else result[0].replaceChild(createMmlNode("mo"). + appendChild(document.createTextNode(newst)),result[0].childNodes[i]); + } + } + node = createMmlNode(symbol.tag,result[0]); + node.setAttribute(symbol.atname,symbol.atval); + if (symbol.input == "\\scriptstyle" || + symbol.input == "\\scriptscriptstyle") + node.setAttribute("displaystyle","false"); + return [node,result[1],symbol.tag]; + } + case BINARY: + result = LMparseSexpr(str); + if (result[0]==null) return [createMmlNode("mo", + document.createTextNode(symbol.input)),str,null]; + result2 = LMparseSexpr(result[1]); + if (result2[0]==null) return [createMmlNode("mo", + document.createTextNode(symbol.input)),str,null]; + if (symbol.input=="\\root" || symbol.input=="\\stackrel") + newFrag.appendChild(result2[0]); + newFrag.appendChild(result[0]); + if (symbol.input=="\\frac") newFrag.appendChild(result2[0]); + return [createMmlNode(symbol.tag,newFrag),result2[1],symbol.tag]; + case INFIX: + str = LMremoveCharsAndBlanks(str,symbol.input.length); + return [createMmlNode("mo",document.createTextNode(symbol.output)), + str,symbol.tag]; + default: + return [createMmlNode(symbol.tag, //its a constant + document.createTextNode(symbol.output)),str,symbol.tag]; + } +} + +function LMparseIexpr(str) { + var symbol, sym1, sym2, node, result, tag, underover; + str = LMremoveCharsAndBlanks(str,0); + sym1 = LMgetSymbol(str); + result = LMparseSexpr(str); + node = result[0]; + str = result[1]; + tag = result[2]; + symbol = LMgetSymbol(str); + if (symbol.ttype == INFIX) { + str = LMremoveCharsAndBlanks(str,symbol.input.length); + result = LMparseSexpr(str); + if (result[0] == null) // show box in place of missing argument + result[0] = createMmlNode("mo",document.createTextNode("\u25A1")); + str = result[1]; + tag = result[2]; + if (symbol.input == "_" || symbol.input == "^") { + sym2 = LMgetSymbol(str); + tag = null; // no space between x^2 and a following sin, cos, etc. +// This is for \underbrace and \overbrace + underover = ((sym1.ttype == UNDEROVER) || (node.ttype == UNDEROVER)); +// underover = (sym1.ttype == UNDEROVER); + if (symbol.input == "_" && sym2.input == "^") { + str = LMremoveCharsAndBlanks(str,sym2.input.length); + var res2 = LMparseSexpr(str); + str = res2[1]; + tag = res2[2]; // leave space between x_1^2 and a following sin etc. + node = createMmlNode((underover?"munderover":"msubsup"),node); + node.appendChild(result[0]); + node.appendChild(res2[0]); + } else if (symbol.input == "_") { + node = createMmlNode((underover?"munder":"msub"),node); + node.appendChild(result[0]); + } else { + node = createMmlNode((underover?"mover":"msup"),node); + node.appendChild(result[0]); + } + node = createMmlNode("mrow",node); // so sum does not stretch + } else { + node = createMmlNode(symbol.tag,node); + if (symbol.input == "\\atop" || symbol.input == "\\choose") + node.setAttribute("linethickness","0ex"); + node.appendChild(result[0]); + if (symbol.input == "\\choose") + node = createMmlNode("mfenced",node); + } + } + return [node,str,tag]; +} + +function LMparseExpr(str,rightbracket,matrix) { + var symbol, node, result, i, tag, + newFrag = document.createDocumentFragment(); + do { + str = LMremoveCharsAndBlanks(str,0); + result = LMparseIexpr(str); + node = result[0]; + str = result[1]; + tag = result[2]; + symbol = LMgetSymbol(str); + if (node!=undefined) { + if ((tag == "mn" || tag == "mi") && symbol!=null && + typeof symbol.func == "boolean" && symbol.func) { + // Add space before \sin in 2\sin x or x\sin x + var space = createMmlNode("mspace"); + space.setAttribute("width","0.167em"); + node = createMmlNode("mrow",node); + node.appendChild(space); + } + newFrag.appendChild(node); + } + } while ((symbol.ttype != RIGHTBRACKET) + && symbol!=null && symbol.output!=""); + tag = null; + if (symbol.ttype == RIGHTBRACKET) { + if (symbol.input == "\\right") { // right what? + str = LMremoveCharsAndBlanks(str,symbol.input.length); + symbol = LMgetSymbol(str); + if (symbol != null && symbol.input == ".") + symbol.invisible = true; + if (symbol != null) + tag = symbol.rtag; + } + if (symbol!=null) + str = LMremoveCharsAndBlanks(str,symbol.input.length); // ready to return + var len = newFrag.childNodes.length; + if (matrix && + len>0 && newFrag.childNodes[len-1].nodeName == "mrow" && len>1 && + newFrag.childNodes[len-2].nodeName == "mo" && + newFrag.childNodes[len-2].firstChild.nodeValue == "&") { //matrix + var pos = []; // positions of ampersands + var m = newFrag.childNodes.length; + for (i=0; matrix && i -&-&...&-&- + n = node.childNodes.length; + k = 0; + for (j=0; j2) { + newFrag.removeChild(newFrag.firstChild); //remove + newFrag.removeChild(newFrag.firstChild); //remove & + } + table.appendChild(createMmlNode("mtr",row)); + } + return [table,str]; + } + if (typeof symbol.invisible != "boolean" || !symbol.invisible) { + node = createMmlNode("mo",document.createTextNode(symbol.output)); + newFrag.appendChild(node); + } + } + return [newFrag,str,tag]; +} + +var tcnt = 0, dcnt = 0; //theorem and definition counters + +function simpleLaTeXformatting(st) { + st = st.replace(/\$\$((.|\n)*?)\$\$/g,"

    $\\displaystyle{$1}$

    "); + st = st.replace(/\\begin{(theorem|lemma|proposition|corollary)}((.|\n)*?)\\end{\1}/g,function(r,s,t){tcnt++; return ""+s.charAt(0).toUpperCase()+s.slice(1)+" "+tcnt+". "+t.replace(/^\s*<\/?\w+\/?>|\s*<\/?\w+\/?>$/g,"")+""}); + st = st.replace(/\\begin{(definition|example|remark|problem|exercise|conjecture|solution)}((.|\n)*?)\\end{\1}/g,function(r,s,t){dcnt++; return ""+s.charAt(0).toUpperCase()+s.slice(1)+" "+dcnt+". "+t.replace(/^\s*<\/?\w+\/?>|\s*<\/?\w+\/?>$/g,"")}); + st = st.replace(/\\begin{proof}((.|\n)*?)\\end{proof}/g,function(s,t){return "Proof: "+t.replace(/^\s*<\/?\w+\/?>|\s*<\/?\w+\/?>$/g,"")+" □"}); + st = st.replace(/\\emph{(.*?)}/g,"$1"); + st = st.replace(/\\textbf{(.*?)}/g,"$1"); + st = st.replace(/\\cite{(.*?)}/g,"[$1]"); + st = st.replace(/\\chapter{(.*?)}/g,"

    $1

    "); + st = st.replace(/\\section{(.*?)}(\s*<\/?(br|p)\s?\/?>)?/g,"

    $1

    "); + st = st.replace(/\\subsection{((.|\n)*?)}/g,"

    $1

    "); + st = st.replace(/\\begin{itemize}(\s*<\/?(br|p)\s?\/?>)?/g,"
      "); + st = st.replace(/\\item\s((.|\n)*?)(?=(\\item|\\end))/g,"
    • $1
    • "); + st = st.replace(/\\end{itemize}(\s*<\/?(br|p)\s?\/?>)?/g,"
    "); + st = st.replace(/\\begin{enumerate}(\s*<\/?(br|p)\s?\/?>)?/g,"
      "); + st = st.replace(/\\end{enumerate}(\s*<\/?(br|p)\s?\/?>)?/g,"
    "); + st = st.replace(/\\item\[(.*?)]{(.*?)}/g,"
    $1
    $2
    "); + st = st.replace(/\\begin{description}/g,"
    "); + st = st.replace(/\\end{description}/g,"
    "); + st = st.replace(/\\newline\b/g,"
    "); + st = st.replace(/\\newpage\b/g,"
    "); + st = st.replace(/\\par\b/g,"

     

    "); + st = st.replace(/\\bigskip/g,"

     

    "); + st = st.replace(/\\medskip/g,"

     

    "); + st = st.replace(/\\smallskip/g,"

     

    "); + st = st.replace(/\\begin{center}((.|\n)*?)\\end{center}/g,"
    $1
    "); + return st +} + +function ASCIIandgraphformatting(st) { + st = st.replace(/(.*?)<\/sup>(\s|(\S))/gi,"^{$1} $3"); +//st = st.replace(/<\/?font.*?>/gi,""); // do this only in amath...endamath + st = st.replace(/(Proof:)/g,"$1"); + st = st.replace(/QED/g,"    □"); + st = st.replace(/(\\?end{?a?math}?)/ig,"$1"); + st = st.replace(/(\bamath\b|\\begin{a?math})/ig,"$1"); + st = st.replace(/([>\n])(Theorem|Lemma|Proposition|Corollary|Definition|Example|Remark|Problem|Exercise|Conjecture|Solution)(:|\W\W?(\w|\s|-|\.)*?\W?:)/g,"$1$2$3"); + st = st.replace(/
    /gi,"\n")+"\'/>
    "}); + st = st.replace(/insertASCIIMathCalculator/g,"
    "); +//alert(dsvglocation) + return st +} + +function LMprocessNode(n) { + var frag,st; + try { + st = n.innerHTML; + } catch(err) {} + var am = /amath\b|graph/i.test(st); + if ((st==null || st.indexOf("\$ ")!=-1 || st.indexOf("\$<")!=-1 || + st.indexOf("\\begin")!=-1 || am || st.slice(-1)=="$" || + st.indexOf("\$\n")!=-1)&& !/edit-content|HTMLArea|wikiedit|wpTextbox1/.test(st)){ + if (!avoidinnerHTML && translateLaTeXformatting) + st = simpleLaTeXformatting(st); + if (st!=null && am && !avoidinnerHTML) { + st = ASCIIandgraphformatting(st); + } + st = st.replace(/%7E/g,"~"); // else PmWiki has url issues +//alert(st) + if (!avoidinnerHTML) n.innerHTML = st; + processNodeR(n,false,true); + } +/* if (isIE) { //needed to match size and font of formula to surrounding text + frag = document.getElementsByTagName('math'); + for (var i=0;i|o|* + +// global values used for all pictures (you can change these) +var showcoordinates = true; +var markerstrokewidth = "1"; +var markerstroke = "black"; +var markerfill = "yellow"; +var markersize = 4; +var arrowfill = stroke; +var dotradius = 4; +var ticklength = 4; +var axesstroke = "black"; +var gridstroke = "grey"; +var backgroundstyle = "fill-opacity:1; fill:white"; +var singlelettersitalic = true; + +// internal variables (probably no need to change these) +var picturepos = null; // position of picture relative to top of HTML page +var xunitlength; // in pixels, used to convert to user coordinates +var yunitlength; // in pixels +var origin = [0,0]; // in pixels (default is bottom left corner) +var above = "above"; // shorthands (to avoid typing quotes) +var below = "below"; +var left = "left"; +var right = "right"; +var aboveleft = "aboveleft"; +var aboveright = "aboveright"; +var belowleft = "belowleft"; +var belowright = "belowright"; +var xmin, xmax, ymin, ymax, xscl, yscl, + xgrid, ygrid, xtick, ytick, initialized; +var strokewidth, strokedasharray, stroke, fill, strokeopacity, fillopacity; +var fontstyle, fontfamily, fontsize, fontweight, fontstroke, fontfill; +var marker, endpoints, dynamic = {}; +var picture, svgpicture, doc, width, height; +var isIE = document.createElementNS==null; + +var cpi = "\u03C0", ctheta = "\u03B8"; // character for pi, theta +var log = function(x) { return ln(x)/ln(10) }; +var pi = Math.PI, e = Math.E, ln = Math.log, sqrt = Math.sqrt; +var floor = Math.floor, ceil = Math.ceil, abs = Math.abs; +var sin = Math.sin, cos = Math.cos, tan = Math.tan; +var arcsin = Math.asin, arccos = Math.acos, arctan = Math.atan; +var sec = function(x) { return 1/Math.cos(x) }; +var csc = function(x) { return 1/Math.sin(x) }; +var cot = function(x) { return 1/Math.tan(x) }; +var arcsec = function(x) { return arccos(1/x) }; +var arccsc = function(x) { return arcsin(1/x) }; +var arccot = function(x) { return arctan(1/x) }; +var sinh = function(x) { return (Math.exp(x)-Math.exp(-x))/2 }; +var cosh = function(x) { return (Math.exp(x)+Math.exp(-x))/2 }; +var tanh = + function(x) { return (Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x)) }; +var sech = function(x) { return 1/cosh(x) }; +var csch = function(x) { return 1/sinh(x) }; +var coth = function(x) { return 1/tanh(x) }; +var arcsinh = function(x) { return ln(x+Math.sqrt(x*x+1)) }; +var arccosh = function(x) { return ln(x+Math.sqrt(x*x-1)) }; +var arctanh = function(x) { return ln((1+x)/(1-x))/2 }; +var sech = function(x) { return 1/cosh(x) }; +var csch = function(x) { return 1/sinh(x) }; +var coth = function(x) { return 1/tanh(x) }; +var arcsech = function(x) { return arccosh(1/x) }; +var arccsch = function(x) { return arcsinh(1/x) }; +var arccoth = function(x) { return arctanh(1/x) }; +var sign = function(x) { return (x==0?0:(x<0?-1:1)) }; + +function factorial(x,n) { // Factorial function + if (n==null) n=1; + if (Math.abs(x-Math.round(x*1000000)/1000000)<1e-15) + x = Math.round(x*1000000)/1000000; + if (x-Math.floor(x)!=0) return NaN; + for (var i=x-n; i>0; i-=n) x*=i; + return (x<0?NaN:(x==0?1:x)); +} + +function C(x,k) { // Binomial coefficient function + var res=1; + for (var i=0; i 2*x + src = src.replace(/([0-9])([a-df-zA-Z]|e^)/g,"$1*$2"); + src = src.replace(/\)([\(0-9a-zA-Z])/g,"\)*$1"); + + try { + with (Math) eval(src); // here the svgpicture object is created + } catch(err) { + if (err!="wait") { +//alert(dsvglocation) + if (typeof err=="object") + errstr = err.name+" "+err.message+" "+err.number+" "+err.description; + else errstr = err; + alert(errstr+"\n"+src) + } + } +} + +var lastSlot = 0; + +function drawPictures() { // main routine; called after webpage has loaded + var src, id, dsvg, nd, node, ht, index, cols, arr, i, node2; + var ASbody = document.getElementsByTagName("body")[0]; + pictures = getElementsByClass(ASbody,"embed","ASCIIsvg"); + var len = pictures.length; + if(len==0) return; + for (index = lastSlot; index < len+lastSlot; index++) { + width = null; height = null; + xmin = null; xmax = null; ymin = null; ymax = null; + xscl = null; xgrid = null; yscl = null; ygrid = null; + initialized = false; + picture = pictures[index-lastSlot]; // current picture object + src = picture.getAttribute("script"); // get the ASCIIsvg code + if (src==null) src = ""; + // insert "axes()" if not present ******** experimental + if (!/axes\b|initPicture/.test(src)) { + var i = 0; + while (/((yscl|ymax|ymin|xscl|xmax|xmin|\bwidth|\bheight)\s*=\s*-?\d*(\d\.|\.\d|\d)\d*\s*;?)/.test(src.slice(i))) i++; + src = (i==0?"axes(); "+src: src.slice(0,i)+src.slice(i).replace(/((scl|max|min|idth|eight)\s*=\s*-?\d*(\d\.|\.\d|\d)\d*\s*;?)/,"$1\naxes();")); + } + ht = picture.getAttribute("height"); + if (isIE) { + picture.setAttribute("wmode","transparent"); +//alert("*"+picture.getAttribute("src")+dsvglocation); +//adding d.svg dynamically greates problems in IE... +// if (picture.getAttribute("src")=="") picture.setAttribute("src",dsvglocation+"d.svg"); + } + if (document.getElementById("picture"+(index+1)+"mml")==null) { + picture.parentNode.style.position = "relative"; + node = createElementXHTML("div"); + node.style.position = "absolute"; + node.style.top = "0px"; + node.style.left = "0px"; + node.setAttribute("id","picture"+(index+1)+"mml"); + picture.parentNode.insertBefore(node,picture.nextSibling); + } + if (ht==null) ht =""; +// if (ht!="") defaultborder = 25; + if (ht=="" || src=="") + if (document.getElementById("picture"+(index+1)+"input")==null) { + node = createElementXHTML("textarea"); + arr = src.split("\n"); + cols = 0; + for (i=0;i= xmax) + alert("Picture requires at least two numbers: xmin < xmax"); + else if (y_max != null && (typeof y_min != "number" || + typeof y_max != "number" || y_min >= y_max)) + alert("initPicture(xmin,xmax,ymin,ymax) requires numbers ymin < ymax"); + else { + if (width==null) { + width = picture.getAttribute("width"); + if (width==null || width=="") width=defaultwidth; + } + picture.setAttribute("width",width); + if (height==null) { + height = picture.getAttribute("height"); + if (height==null || height=="") height=defaultheight; + } + picture.setAttribute("height",height); + xunitlength = (width-2*border)/(xmax-xmin); + yunitlength = xunitlength; +//alert(xmin+" "+xmax+" "+ymin+" "+ymax) + if (ymin==null) { + origin = [-xmin*xunitlength+border,height/2]; + ymin = -(height-2*border)/(2*yunitlength); + ymax = -ymin; + } else { + if (ymax!=null) yunitlength = (height-2*border)/(ymax-ymin); + else ymax = (height-2*border)/yunitlength + ymin; + origin = [-xmin*xunitlength+border,-ymin*yunitlength+border]; + } + if (isIE) { + if (picture.FULLSCREEN==undefined) { + setTimeout('drawPictures()',50); + throw "wait"; + } + svgpicture = picture.getSVGDocument().getElementById("root"); + if (svgpicture==null) { + setTimeout('drawPictures()',50); + throw "wait"; + } + svgpicture = picture.getSVGDocument().getElementById("root"); + while (svgpicture.childNodes.length>0) + svgpicture.removeChild(svgpicture.lastChild); + svgpicture.setAttribute("width",width); + svgpicture.setAttribute("height",height); + svgpicture.setAttribute("name",picture.getAttribute("id")); + doc = picture.getSVGDocument(); + } else { + var qnode = document.createElementNS("http://www.w3.org/2000/svg","svg"); + qnode.setAttribute("id",picture.getAttribute("id")); + qnode.setAttribute("name",picture.getAttribute("id")); +// qnode.setAttribute("style","display:inline"); + qnode.setAttribute("width",picture.getAttribute("width")); + qnode.setAttribute("height",picture.getAttribute("height")); + picturepos = findPos(picture); +// qnode.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"); + if (picture.parentNode!=null) { + picture.parentNode.replaceChild(qnode,picture); + } else { + svgpicture.parentNode.replaceChild(qnode,svgpicture); + } + svgpicture = qnode; + doc = document; + } + var nd = document.getElementById(picture.getAttribute("id")+"mml"); + if (nd!=null) // clear out MathML layer + while (nd.childNodes.length>0) nd.removeChild(nd.lastChild); + svgpicture.setAttribute("xunitlength",xunitlength); + svgpicture.setAttribute("yunitlength",yunitlength); + svgpicture.setAttribute("xmin",xmin); + svgpicture.setAttribute("xmax",xmax); + svgpicture.setAttribute("ymin",ymin); + svgpicture.setAttribute("ymax",ymax); + svgpicture.setAttribute("ox",origin[0]); + svgpicture.setAttribute("oy",origin[1]); + var node = myCreateElementSVG("rect"); + node.setAttribute("x","0"); + node.setAttribute("y","0"); + node.setAttribute("width",width); + node.setAttribute("height",height); + node.setAttribute("style",backgroundstyle); + svgpicture.appendChild(node); + svgpicture.setAttribute("onmousemove","displayCoord(evt)"); + svgpicture.setAttribute("onmouseout","removeCoord(evt)"); + svgpicture.setAttribute("onclick","mClick(evt)"); + node = myCreateElementSVG("text"); // used for displayCoord + node.appendChild(doc.createTextNode(" ")); + node.setAttribute("id","coords"); + svgpicture.appendChild(node); + node = myCreateElementSVG("text"); // used for text display + node.appendChild(doc.createTextNode(" ")); + node.setAttribute("id","coords"); + svgpicture.appendChild(node); + border = defaultborder; + } + } +} + +//////////////////////////user graphics commands start///////////////////////// + +function line(p,q,id,endpts) { // segment connecting points p,q (coordinates in units) + var node; + if (id!=null) node = doc.getElementById(id); + if (node==null) { + node = myCreateElementSVG("path"); + node.setAttribute("id", id); + svgpicture.appendChild(node); + } + node.setAttribute("d","M"+(p[0]*xunitlength+origin[0])+","+ + (height-p[1]*yunitlength-origin[1])+" "+ + (q[0]*xunitlength+origin[0])+","+(height-q[1]*yunitlength-origin[1])); + node.setAttribute("stroke-width", strokewidth); + if (strokedasharray!=null) + node.setAttribute("stroke-dasharray", strokedasharray); + node.setAttribute("stroke", stroke); + node.setAttribute("fill", fill); + node.setAttribute("stroke-opacity", strokeopacity); + node.setAttribute("fill-opacity", fillopacity); + if (marker=="dot" || marker=="arrowdot") { + ASdot(p,markersize,markerstroke,markerfill); + if (marker=="arrowdot") arrowhead(p,q); + ASdot(q,markersize,markerstroke,markerfill); + } else if (marker=="arrow") arrowhead(p,q); + if (endpts==null && endpoints!="") endpts = endpoints; + if (endpts!=null) { + if (endpts.indexOf("<-") != -1) arrowhead(q,p); + if (endpts.indexOf("o-") != -1) dot(p, "open"); + if (endpts.indexOf("*-") != -1) dot(p, "closed"); + if (endpts.indexOf("->") != -1) arrowhead(p,q); + if (endpts.indexOf("-o") != -1) dot(q, "open"); + if (endpts.indexOf("-*") != -1) dot(q, "closed"); + } +} + +function path(plist,id,c,endpts) { + if (c==null) c=""; + var node, st, i; + if (id!=null) node = doc.getElementById(id); + if (node==null) { + node = myCreateElementSVG("path"); + node.setAttribute("id", id); + svgpicture.appendChild(node); + } + if (typeof plist == "string") st = plist; + else { + st = "M"; + st += (plist[0][0]*xunitlength+origin[0])+","+ + (height-plist[0][1]*yunitlength-origin[1])+" "+c; + for (i=1; i") != -1) arrowhead(plist[plist.length-2],plist[plist.length-1]); + if (endpts.indexOf("-o") != -1) dot(plist[plist.length-1], "open"); + if (endpts.indexOf("-*") != -1) dot(plist[plist.length-1], "closed"); + } +} + +function curve(plist,id,endpts) { + path(plist,id,"T",endpts); +} + +function vector(p,q,id) { + line(p,q,id,"","->"); +} + +function circle(center,radius,id) { // coordinates in units + var node; + if (id!=null) node = doc.getElementById(id); + if (node==null) { + node = myCreateElementSVG("circle"); + node.setAttribute("id", id); + svgpicture.appendChild(node); + } + node.setAttribute("cx",center[0]*xunitlength+origin[0]); + node.setAttribute("cy",height-center[1]*yunitlength-origin[1]); + node.setAttribute("r",radius*xunitlength); + node.setAttribute("stroke-width", strokewidth); + node.setAttribute("stroke", stroke); + node.setAttribute("fill", fill); + node.setAttribute("stroke-opacity", strokeopacity); + node.setAttribute("fill-opacity", fillopacity); +} + +function loop(p,d,id) { +// d is a direction vector e.g. [1,0] means loop starts in that direction + if (d==null) d=[1,0]; + path([p,[p[0]+d[0],p[1]+d[1]],[p[0]-d[1],p[1]+d[0]],p],id,"C"); + if (marker=="arrow" || marker=="arrowdot") + arrowhead([p[0]+Math.cos(1.4)*d[0]-Math.sin(1.4)*d[1], + p[1]+Math.sin(1.4)*d[0]+Math.cos(1.4)*d[1]],p); +} + +function arc(start,end,radius,id,largearc) { // coordinates in units + var node, v; +//alert([fill, stroke, origin, xunitlength, yunitlength, height]) + if (id!=null) node = doc.getElementById(id); + if (largearc==null) largearc=0; + if (radius==null) { + v=[end[0]-start[0],end[1]-start[1]]; + radius = Math.sqrt(v[0]*v[0]+v[1]*v[1]); + } + if (node==null) { + node = myCreateElementSVG("path"); + node.setAttribute("id", id); + svgpicture.appendChild(node); + } + node.setAttribute("d","M"+(start[0]*xunitlength+origin[0])+","+ + (height-start[1]*yunitlength-origin[1])+" A"+radius*xunitlength+","+ + radius*yunitlength+" 0 "+largearc+",0 "+(end[0]*xunitlength+origin[0])+","+ + (height-end[1]*yunitlength-origin[1])); + node.setAttribute("stroke-width", strokewidth); + node.setAttribute("stroke", stroke); + node.setAttribute("fill", fill); + node.setAttribute("stroke-opacity", strokeopacity); + node.setAttribute("fill-opacity", fillopacity); + if (marker=="arrow" || marker=="arrowdot") { + u = [(end[1]-start[1])/4,(start[0]-end[0])/4]; + v = [(end[0]-start[0])/2,(end[1]-start[1])/2]; +//alert([u,v]) + v = [start[0]+v[0]+u[0],start[1]+v[1]+u[1]]; + } else v=[start[0],start[1]]; + if (marker=="dot" || marker=="arrowdot") { + ASdot(start,markersize,markerstroke,markerfill); + if (marker=="arrowdot") arrowhead(v,end); + ASdot(end,markersize,markerstroke,markerfill); + } else if (marker=="arrow") arrowhead(v,end); +} + +function sector(center,start,end,id) { // center,start,end should be isoceles + var rx = start[0]-center[0], ry = start[1]-center[1]; + arc(start,end,Math.sqrt(rx*rx+ry*ry),id+"arc"); + path([end,center,start],id+"path"); +} + +function ellipse(center,rx,ry,id) { // coordinates in units + var node; + if (id!=null) node = doc.getElementById(id); + if (node==null) { + node = myCreateElementSVG("ellipse"); + node.setAttribute("id", id); + svgpicture.appendChild(node); + } + node.setAttribute("cx",center[0]*xunitlength+origin[0]); + node.setAttribute("cy",height-center[1]*yunitlength-origin[1]); + node.setAttribute("rx",rx*xunitlength); + node.setAttribute("ry",ry*yunitlength); + node.setAttribute("stroke-width", strokewidth); + node.setAttribute("stroke", stroke); + node.setAttribute("fill", fill); + node.setAttribute("stroke-opacity", strokeopacity); + node.setAttribute("fill-opacity", fillopacity); +} + +function triangle(p,q,r,id) { + path([p,q,r,p],id) +} + +function rect(p,q,id,rx,ry) { // opposite corners in units, rounded by radii + var node; + if (id!=null) node = doc.getElementById(id); + if (node==null) { + node = myCreateElementSVG("rect"); + node.setAttribute("id", id); + svgpicture.appendChild(node); + } + node.setAttribute("x",p[0]*xunitlength+origin[0]); + node.setAttribute("y",height-q[1]*yunitlength-origin[1]); + node.setAttribute("width",(q[0]-p[0])*xunitlength); + node.setAttribute("height",(q[1]-p[1])*yunitlength); + if (rx!=null) node.setAttribute("rx",rx*xunitlength); + if (ry!=null) node.setAttribute("ry",ry*yunitlength); + node.setAttribute("stroke-width", strokewidth); + node.setAttribute("stroke", stroke); + node.setAttribute("fill", fill); + node.setAttribute("stroke-opacity", strokeopacity); + node.setAttribute("fill-opacity", fillopacity); +} + +function text(p,st,pos,id,fontsty) { + var dnode, node, dx = 0, dy = fontsize/3, str = st.toString(); + if (/(`|\$)/.test(str)) { // layer for ASCIIMathML and LaTeXMathML + dnode = document.getElementById(svgpicture.getAttribute("name")+"mml"); + if (dnode!=null) { + if (id!=null) node = document.getElementById(id); + if (node==null) { +//alert(dnode.childNodes.length) + node = createElementXHTML("div"); + node.setAttribute("id", id); + node.style.position = "absolute"; + dnode.appendChild(node); + } + while (node.childNodes.length>0) node.removeChild(node.lastChild); + node.appendChild(document.createTextNode(str)); + if (/`/.test(str)) AMprocessNode(node); else LMprocessNode(node); + dx = -node.offsetWidth/2; + dy = -node.offsetHeight/2; + if (pos!=null) { + if (/above/.test(pos)) dy = -node.offsetHeight; + if (/below/.test(pos)) dy = 0; + if (/right/.test(pos)) dx = 0; + if ( /left/.test(pos)) dx = -node.offsetWidth; + } + node.style.left = ""+(p[0]*xunitlength+origin[0]+dx)+"px"; + node.style.top = ""+(height-p[1]*yunitlength-origin[1]+dy)+"px"; + } + return p; + } + var textanchor = "middle"; // regular text goes into SVG + if (pos!=null) { + if (/above/.test(pos)) dy = -fontsize/2; + if (/below/.test(pos)) dy = fontsize-0; + if (/right/.test(pos)) {textanchor = "start"; dx = fontsize/4;} + if ( /left/.test(pos)) {textanchor = "end"; dx = -fontsize/4;} + } + if (id!=null) node = doc.getElementById(id); + if (node==null) { + node = myCreateElementSVG("text"); + node.setAttribute("id", id); + svgpicture.appendChild(node); + node.appendChild(doc.createTextNode(str)); + } + while (node.childNodes.length>1) node.removeChild(node.lastChild); + node.lastChild.nodeValue = "\xA0"+str+"\xA0"; + node.setAttribute("x",p[0]*xunitlength+origin[0]+dx); + node.setAttribute("y",height-p[1]*yunitlength-origin[1]+dy); + node.setAttribute("font-style",(fontsty!=null?fontsty: + (str.search(/^[a-zA-Z]$/)!=-1?"italic":fontstyle))); + node.setAttribute("font-family",fontfamily); + node.setAttribute("font-size",fontsize); + node.setAttribute("font-weight",fontweight); + node.setAttribute("text-anchor",textanchor); + if (fontstroke!="none") node.setAttribute("stroke",fontstroke); + if (fontfill!="none") node.setAttribute("fill",fontfill); + return p; +} + +function mtext(p,st,pos,fontsty,fontsz) { // method for updating text on an svg +// "this" is the text object or the svgpicture object + var textanchor = "middle"; + var dx = 0; var dy = fontsize/3; + if (pos!=null) { + if (pos.slice(0,5)=="above") dy = -fontsize/2; + if (pos.slice(0,5)=="below") dy = fontsize-0; + if (pos.slice(0,5)=="right" || pos.slice(5,10)=="right") { + textanchor = "start"; + dx = fontsize/2; + } + if (pos.slice(0,4)=="left" || pos.slice(5,9)=="left") { + textanchor = "end"; + dx = -fontsize/2; + } + } + var node = this; + if (this.nodeName=="svg") { + node = myCreateElementSVG("text"); + this.appendChild(node); + node.appendChild(doc.createTextNode(st)); + } + node.lastChild.nodeValue = st; + node.setAttribute("x",p[0]+dx); + node.setAttribute("y",p[1]+dy); + node.setAttribute("font-style",(fontsty!=null?fontsty:fontstyle)); + node.setAttribute("font-family",fontfamily); + node.setAttribute("font-size",(fontsz!=null?fontsz:fontsize)); + node.setAttribute("font-weight",fontweight); + node.setAttribute("text-anchor",textanchor); + if (fontstroke!="none") node.setAttribute("stroke",fontstroke); + if (fontfill!="none") node.setAttribute("fill",fontfill); +} + +function image(imgurl,p,w,h,id) { // not working yet + var node; + if (id!=null) node = doc.getElementById(id); + if (node==null) { + node = myCreateElementSVG("image"); + node.setAttribute("id", id); + svgpicture.appendChild(node); + } + node.setAttribute("x",p[0]*xunitlength+origin[0]); + node.setAttribute("y",height-p[1]*yunitlength-origin[1]); + node.setAttribute("width",w); + node.setAttribute("height",h); + node.setAttribute("xlink:href", imgurl); +} + +function ASdot(center,radius,s,f) { // coordinates in units, radius in pixel + if (s==null) s = stroke; if (f==null) f = fill; + var node = myCreateElementSVG("circle"); + node.setAttribute("cx",center[0]*xunitlength+origin[0]); + node.setAttribute("cy",height-center[1]*yunitlength-origin[1]); + node.setAttribute("r",radius); + node.setAttribute("stroke-width", strokewidth); + node.setAttribute("stroke", s); + node.setAttribute("fill", f); + svgpicture.appendChild(node); +} + +function dot(center, typ, label, pos, id) { + var node; + var cx = center[0]*xunitlength+origin[0]; + var cy = height-center[1]*yunitlength-origin[1]; + if (id!=null) node = doc.getElementById(id); + if (typ=="+" || typ=="-" || typ=="|") { + if (node==null) { + node = myCreateElementSVG("path"); + node.setAttribute("id", id); + svgpicture.appendChild(node); + } + if (typ=="+") { + node.setAttribute("d", + " M "+(cx-ticklength)+" "+cy+" L "+(cx+ticklength)+" "+cy+ + " M "+cx+" "+(cy-ticklength)+" L "+cx+" "+(cy+ticklength)); + node.setAttribute("stroke-width", .5); + node.setAttribute("stroke", axesstroke); + } else { + if (typ=="-") node.setAttribute("d", + " M "+(cx-ticklength)+" "+cy+" L "+(cx+ticklength)+" "+cy); + else node.setAttribute("d", + " M "+cx+" "+(cy-ticklength)+" L "+cx+" "+(cy+ticklength)); + node.setAttribute("stroke-width", strokewidth); + node.setAttribute("stroke", stroke); + } + } else { + if (node==null) { + node = myCreateElementSVG("circle"); + node.setAttribute("id", id); + svgpicture.appendChild(node); + } + node.setAttribute("cx",cx); + node.setAttribute("cy",cy); + node.setAttribute("r",dotradius); + node.setAttribute("stroke-width", strokewidth); + node.setAttribute("stroke", stroke); + node.setAttribute("fill", (typ=="open"?"white": + (typ=="closed"?stroke:markerfill))); + } + if (label!=null) + text(center,label,(pos==null?"below":pos),(id==null?id:id+"label")) +} + +point = dot; //alternative name + +function arrowhead(p,q) { // draw arrowhead at q (in units) add size param + var up; + var v = [p[0]*xunitlength+origin[0],height-p[1]*yunitlength-origin[1]]; + var w = [q[0]*xunitlength+origin[0],height-q[1]*yunitlength-origin[1]]; + var u = [w[0]-v[0],w[1]-v[1]]; + var d = Math.sqrt(u[0]*u[0]+u[1]*u[1]); + if (d > 0.00000001) { + u = [u[0]/d, u[1]/d]; + up = [-u[1],u[0]]; + var node = myCreateElementSVG("path"); + node.setAttribute("d","M "+(w[0]-15*u[0]-4*up[0])+" "+ + (w[1]-15*u[1]-4*up[1])+" L "+(w[0]-3*u[0])+" "+(w[1]-3*u[1])+" L "+ + (w[0]-15*u[0]+4*up[0])+" "+(w[1]-15*u[1]+4*up[1])+" z"); + node.setAttribute("stroke-width", markerstrokewidth); + node.setAttribute("stroke", stroke); /*was markerstroke*/ + node.setAttribute("fill", stroke); /*was arrowfill*/ + node.setAttribute("stroke-opacity", strokeopacity); + node.setAttribute("fill-opacity", fillopacity); + svgpicture.appendChild(node); + } +} + +function chopZ(st) { + var k = st.indexOf("."); + if (k==-1) return st; + for (var i=st.length-1; i>k && st.charAt(i)=="0"; i--); + if (i==k) i--; + return st.slice(0,i+1); +} + +function grid(dx,dy) { // for backward compatibility + axes(dx,dy,null,dx,dy) +} + +function noaxes() { + if (!initialized) initPicture(); +} + +function axes(dx,dy,labels,gdx,gdy) { +//xscl=x is equivalent to xtick=x; xgrid=x; labels=true; + var x, y, ldx, ldy, lx, ly, lxp, lyp, pnode, st; + if (!initialized) initPicture(); + if (typeof dx=="string") { labels = dx; dx = null; } + if (typeof dy=="string") { gdx = dy; dy = null; } + if (xscl!=null) {dx = xscl; gdx = xscl; labels = dx} + if (yscl!=null) {dy = yscl; gdy = yscl} + if (xtick!=null) {dx = xtick} + if (ytick!=null) {dy = ytick} + dx = (dx==null?xunitlength:dx*xunitlength); + dy = (dy==null?dx:dy*yunitlength); + fontsize = Math.min(dx/2,dy/2,16); //alert(fontsize) + ticklength = fontsize/4; + if (xgrid!=null) gdx = xgrid; + if (ygrid!=null) gdy = ygrid; + if (gdx!=null) { + gdx = (typeof gdx=="string"?dx:gdx*xunitlength); + gdy = (gdy==null?dy:gdy*yunitlength); + pnode = myCreateElementSVG("path"); + st=""; + for (x = origin[0]; x0; x = x-gdx) + st += " M"+x+",0"+" "+x+","+height; + for (y = height-origin[1]; y0; y = y-gdy) + st += " M0,"+y+" "+width+","+y; + pnode.setAttribute("d",st); + pnode.setAttribute("stroke-width", .5); + pnode.setAttribute("stroke", gridstroke); + pnode.setAttribute("fill", fill); + svgpicture.appendChild(pnode); + } + pnode = myCreateElementSVG("path"); + st="M0,"+(height-origin[1])+" "+width+","+ + (height-origin[1])+" M"+origin[0]+",0 "+origin[0]+","+height; + for (x = origin[0]+dx; x0; x = x-dx) + st += " M"+x+","+(height-origin[1]+ticklength)+" "+x+","+ + (height-origin[1]-ticklength); + for (y = height-origin[1]+dy; y0; y = y-dy) + st += " M"+(origin[0]+ticklength)+","+y+" "+(origin[0]-ticklength)+","+y; + if (labels!=null) with (Math) { + ldx = dx/xunitlength; + ldy = dy/yunitlength; + lx = (xmin>0 || xmax<0?xmin:0); + ly = (ymin>0 || ymax<0?ymin:0); + lxp = (ly==0?"below":"above"); + lyp = (lx==0?"left":"right"); + var ddx = floor(1.1-log(ldx)/log(10))+1; + var ddy = floor(1.1-log(ldy)/log(10))+1; + for (x = ldx; x<=xmax; x = x+ldx) + text([x,ly],chopZ(x.toFixed(ddx)),lxp); + for (x = -ldx; xmin<=x; x = x-ldx) + text([x,ly],chopZ(x.toFixed(ddx)),lxp); + for (y = ldy; y<=ymax; y = y+ldy) + text([lx,y],chopZ(y.toFixed(ddy)),lyp); + for (y = -ldy; ymin<=y; y = y-ldy) + text([lx,y],chopZ(y.toFixed(ddy)),lyp); + } + fontsize = defaultfontsize; + pnode.setAttribute("d",st); + pnode.setAttribute("stroke-width", .5); + pnode.setAttribute("stroke", axesstroke); + pnode.setAttribute("fill", fill); + pnode.setAttribute("stroke-opacity", strokeopacity); + pnode.setAttribute("fill-opacity", fillopacity); + svgpicture.appendChild(pnode); +} + +function mathjs(st) { + //translate a math formula to js function notation + // a^b --> pow(a,b) + // na --> n*a + // (...)d --> (...)*d + // n! --> factorial(n) + // sin^-1 --> arcsin etc. + //while ^ in string, find term on left and right + //slice and concat new formula string + st = st.replace(/\s/g,""); + if (st.indexOf("^-1")!=-1) { + st = st.replace(/sin\^-1/g,"arcsin"); + st = st.replace(/cos\^-1/g,"arccos"); + st = st.replace(/tan\^-1/g,"arctan"); + st = st.replace(/sec\^-1/g,"arcsec"); + st = st.replace(/csc\^-1/g,"arccsc"); + st = st.replace(/cot\^-1/g,"arccot"); + st = st.replace(/sinh\^-1/g,"arcsinh"); + st = st.replace(/cosh\^-1/g,"arccosh"); + st = st.replace(/tanh\^-1/g,"arctanh"); + st = st.replace(/sech\^-1/g,"arcsech"); + st = st.replace(/csch\^-1/g,"arccsch"); + st = st.replace(/coth\^-1/g,"arccoth"); + } + st = st.replace(/^e$/g,"(Math.E)"); + st = st.replace(/^e([^a-zA-Z])/g,"(Math.E)$1"); + st = st.replace(/([^a-zA-Z])e/g,"$1(Math.E)"); +// st = st.replace(/([^a-zA-Z])e([^a-zA-Z])/g,"$1(Math.E)$2"); + st = st.replace(/([0-9])([\(a-zA-Z])/g,"$1*$2"); + st = st.replace(/\)([\(0-9a-zA-Z])/g,"\)*$1"); + var i,j,k, ch, nested; + while ((i=st.indexOf("^"))!=-1) { + //find left argument + if (i==0) return "Error: missing argument"; + j = i-1; + ch = st.charAt(j); + if (ch>="0" && ch<="9") {// look for (decimal) number + j--; + while (j>=0 && (ch=st.charAt(j))>="0" && ch<="9") j--; + if (ch==".") { + j--; + while (j>=0 && (ch=st.charAt(j))>="0" && ch<="9") j--; + } + } else if (ch==")") {// look for matching opening bracket and function name + nested = 1; + j--; + while (j>=0 && nested>0) { + ch = st.charAt(j); + if (ch=="(") nested--; + else if (ch==")") nested++; + j--; + } + while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z") + j--; + } else if (ch>="a" && ch<="z" || ch>="A" && ch<="Z") {// look for variable + j--; + while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z") + j--; + } else { + return "Error: incorrect syntax in "+st+" at position "+j; + } + //find right argument + if (i==st.length-1) return "Error: missing argument"; + k = i+1; + ch = st.charAt(k); + if (ch>="0" && ch<="9" || ch=="-") {// look for signed (decimal) number + k++; + while (k="0" && ch<="9") k++; + if (ch==".") { + k++; + while (k="0" && ch<="9") k++; + } + } else if (ch=="(") {// look for matching closing bracket and function name + nested = 1; + k++; + while (k0) { + ch = st.charAt(k); + if (ch=="(") nested++; + else if (ch==")") nested--; + k++; + } + } else if (ch>="a" && ch<="z" || ch>="A" && ch<="Z") {// look for variable + k++; + while (k="a" && ch<="z" || + ch>="A" && ch<="Z") k++; + } else { + return "Error: incorrect syntax in "+st+" at position "+k; + } + st = st.slice(0,j+1)+"Math.pow("+st.slice(j+1,i)+","+st.slice(i+1,k)+")"+ + st.slice(k); + } + while ((i=st.indexOf("!"))!=-1) { + //find left argument + if (i==0) return "Error: missing argument"; + j = i-1; + ch = st.charAt(j); + if (ch>="0" && ch<="9") {// look for (decimal) number + j--; + while (j>=0 && (ch=st.charAt(j))>="0" && ch<="9") j--; + if (ch==".") { + j--; + while (j>=0 && (ch=st.charAt(j))>="0" && ch<="9") j--; + } + } else if (ch==")") {// look for matching opening bracket and function name + nested = 1; + j--; + while (j>=0 && nested>0) { + ch = st.charAt(j); + if (ch=="(") nested--; + else if (ch==")") nested++; + j--; + } + while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z") + j--; + } else if (ch>="a" && ch<="z" || ch>="A" && ch<="Z") {// look for variable + j--; + while (j>=0 && (ch=st.charAt(j))>="a" && ch<="z" || ch>="A" && ch<="Z") + j--; + } else { + return "Error: incorrect syntax in "+st+" at position "+j; + } + st = st.slice(0,j+1)+"factorial("+st.slice(j+1,i)+")"+st.slice(i+1); + } + return st; +} + +function plot(fun,x_min,x_max,points,id,endpts) { + var pth = []; + var f = function(x) { return x }, g = fun; + var name = null; + if (typeof fun=="string") + eval("g = function(x){ with(Math) return "+mathjs(fun)+" }"); + else if (typeof fun=="object") { + eval("f = function(t){ with(Math) return "+mathjs(fun[0])+" }"); + eval("g = function(t){ with(Math) return "+mathjs(fun[1])+" }"); + } + if (typeof x_min=="string") { name = x_min; x_min = xmin } + else name = id; + var min = (x_min==null?xmin:x_min); + var max = (x_max==null?xmax:x_max); + var inc = max-min-0.000001*(max-min); + inc = (points==null?inc/200:inc/points); + var gt; +//alert(typeof g(min)) + for (var t = min; t <= max; t += inc) { + gt = g(t); + if (!(isNaN(gt)||Math.abs(gt)=="Infinity")) pth[pth.length] = [f(t), gt]; + } + path(pth,name,null,endpts); + return pth; +} + +// make polar plot + +// make Riemann sums + +function slopefield(fun,dx,dy) { + var g = fun; + if (typeof fun=="string") + eval("g = function(x,y){ with(Math) return "+mathjs(fun)+" }"); + var gxy,x,y,u,v,dz; + if (dx==null) dx=1; + if (dy==null) dy=1; + dz = Math.sqrt(dx*dx+dy*dy)/6; + var x_min = Math.ceil(xmin/dx); + var y_min = Math.ceil(ymin/dy); + for (x = x_min; x <= xmax; x += dx) + for (y = y_min; y <= ymax; y += dy) { + gxy = g(x,y); + if (!isNaN(gxy)) { + if (Math.abs(gxy)=="Infinity") {u = 0; v = dz;} + else {u = dz/Math.sqrt(1+gxy*gxy); v = gxy*u;} + line([x-u,y-v],[x+u,y+v]); + } + } +} + +///////////////////////user graphics commands end here///////////////////////// + +function show_props(obj) { + var result = ""; + for (var i=0; i< obj.childNodes.length; i++) + result += obj.childNodes.item(i) + "\n"; + return result; +} + +function displayCoord(evt) { + if (showcoordinates) { + var svgroot = evt.target.parentNode; + var nl = svgroot.childNodes; + for (var i=0; i\n\nASCIIMath Scientific Calculator\n\n\nClick in the box to use your keyboard or use the buttons\n\n\n\nResult:     \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    \n
    "; + +// GO1.1 Generic onload by Brothercake +// http://www.brothercake.com/ +//onload function (replaces the onload="translate()" in the tag) +function generic() +{ + if(!init()) return; + if (translateOnLoad) { + var nd = document.getElementById("processasciimathinmoodle"); + if (nd!=null) dsvglocation = nd.className; + if (nd!=null || !checkforprocessasciimathinmoodle) { + translate(); + if (!noSVG && translateASCIIsvg) drawPictures(); + } + var li = getElementsByClass(document,"div","ASCIIMathCalculator"); + if (!noMathML && li.length>0) initASCIIMathCalculators(li); + } +}; +//setup onload function +if(typeof window.addEventListener != 'undefined') +{ + //.. gecko, safari, konqueror and standard + window.addEventListener('load', generic, false); +} +else if(typeof document.addEventListener != 'undefined') +{ + //.. opera 7 + document.addEventListener('load', generic, false); +} +else if(typeof window.attachEvent != 'undefined') +{ + //.. win/ie + window.attachEvent('onload', generic); +} +//** remove this condition to degrade older browsers +else +{ + //.. mac/ie5 and anything else that gets this far + //if there's an existing onload function + if(typeof window.onload == 'function') + { + //store it + var existing = onload; + //add new onload handler + window.onload = function() + { + //call existing onload function + existing(); + //call generic onload function + generic(); + }; + } + else + { + //setup onload function + window.onload = generic; + } +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/Equation.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/Equation.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/Equation.js 3 Jan 2016 20:47:37 -0000 1.1.2.1 @@ -0,0 +1,232 @@ +/*------------------------------------------*\ + AsciiMathML Formula Editor for Xinha + _______________________ + + Based on AsciiMathML by Peter Jipsen http://www.chapman.edu/~jipsen + + Including a table with math symbols for easy input modified from CharacterMap for ASCIIMathML by Peter Jipsen + HTMLSource based on HTMLArea XTD 1.5 (http://mosforge.net/projects/htmlarea3xtd/) modified by Holger Hees + Original Author - Bernhard Pfeifer novocaine@gmx.net + + See readme.txt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License (at http://www.gnu.org/licenses/lgpl.html) + for more details. + + Raimund Meyer 11/23/2006 + +\*------------------------------------------*/ +function Equation(editor) { + this.editor = editor; + + var cfg = editor.config; + var self = this; + + + // register the toolbar buttons provided by this plugin + cfg.registerButton({ + id : "equation", + tooltip : this._lc("Formula Editor"), + image : editor.imgURL("equation.gif", "Equation"), + textMode : false, + action : function(editor, id) { + self.buttonPress(editor, id); + } + }); + cfg.addToolbarElement("equation", "inserthorizontalrule", -1); + + mathcolor = cfg.Equation.mathcolor; // change it to "" (to inherit) or any other color + mathfontfamily = cfg.Equation.mathfontfamily; + + this.enabled = !Xinha.is_ie; + + if (this.enabled) + { + this.onBeforeSubmit = this.onBeforeUnload = function () {self.unParse();}; + } + + if (typeof AMprocessNode != "function") + { + Xinha._loadback(Xinha.getPluginDir('Equation') + "/ASCIIMathML.js", function () { translate(); }); + } +} + +Xinha.Config.prototype.Equation = +{ + "mathcolor" : "black", // change it to "" (to inherit) or any other color + "mathfontfamily" : "serif" // change to "" to inherit (works in IE) + // or another family (e.g. "arial") +} + +Equation._pluginInfo = { + name : "ASCIIMathML Formula Editor", + version : "2.3 (2008-01-26)", + developer : "Raimund Meyer", + developer_url : "http://x-webservice.net", + c_owner : "", + sponsor : "", + sponsor_url : "", + license : "GNU/LGPL" +}; + +Equation.prototype._lc = function(string) +{ + return Xinha._lc(string, 'Equation'); +}; +Equation.prototype.onGenerate = function() +{ + this.parse(); +}; + +// avoid changing the formula in the editor +Equation.prototype.onKeyPress = function(ev) +{ + if (this.enabled) + { + e = this.editor; + var span = e._getFirstAncestor(e.getSelection(),['span']); + if ( span && span.className == "AM" ) + { + if ( + ev.keyCode == 8 || // delete + ev.keyCode == 46 ||// backspace + ev.charCode // all character keys + ) + { // stop event + Xinha._stopEvent(ev); + return true; + } + } + } + return false; +} +Equation.prototype.onBeforeMode = function( mode ) +{ + if (this.enabled && mode == 'textmode') + { + this.unParse(); + } +} +Equation.prototype.onMode = function( mode ) +{ + if (this.enabled && mode == 'wysiwyg') + { + this.parse(); + } +} + +Equation.prototype.parse = function () +{ + if (this.enabled) + { + var doc = this.editor._doc; + var spans = doc.getElementsByTagName("span"); + for (var i = 0;i'+formula+''); + } + } + + if (this.enabled) this.parse();//AMprocessNode(this.editor._doc.body, false); + } +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/example.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/example.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/example.html 3 Jan 2016 20:47:37 -0000 1.1.2.1 @@ -0,0 +1,45 @@ + + + + + AsciiMathML Example + + + + + + +

    AsciiMathML Example

    +

    This shows how to set up your page to display MathML using AsciiMathML

    +

    Add this to the head section of your document:

    +
    +
    +  <!-- This block is optional configuration -->
    +  <script type="text/javascript">
    +    var mathcolor = "black"; // You may change the color of the formulae (default: red)
    +    var showasciiformulaonhover = false; // helps students learn ASCIIMath, set to false if you like  (default:true)
    +    var mathfontfamily = "Arial"; //and the font (default: serif, which is good I think)
    +  </script>
    +  <!-- THIS LOADS THE ACTUAL SCRIPT, PLEASE ADJUST THE URL --<
    +  <script type="text/javascript" src="/xinha/plugins/Equation/ASCIIMathML.js"></script>
    +
    +
    +
    +

    `int_a^bf(x)dx`

    +

    `[[a,b],[c,d]]`

    +

    + ASCIIMathML by Peter Jipsen, +Chapman University
    + For more information on AsciiMathML visit this page: http://www1.chapman.edu/~jipsen/mathml/asciimath.html + +

    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/readme.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/readme.txt,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/readme.txt 3 Jan 2016 20:47:37 -0000 1.1.2.1 @@ -0,0 +1,38 @@ +AsciiMathML Formula Editor for Xinha + _______________________ + +Based on AsciiMathML by Peter Jipsen (http://www.chapman.edu/~jipsen). +Plugin by Raimund Meyer (ray) xinha@raimundmeyer.de + +AsciiMathML is a JavaScript library for translating ASCII math notation to Presentation MathML. + +Usage + The formmulae are stored in their ASCII representation, so you have to include the + ASCIIMathML library which can be found in the plugin folder in order to render the MathML output in your pages. + + Example (also see example.html): + var mathcolor = "black"; // You may change the color of the formulae (default: red) + var mathfontfamily = "Arial"; //and the font (default: serif, which is good I think) + var showasciiformulaonhover = false; // if true helps students learn ASCIIMath (default:true) + + + The recommended browser for using this plugin is Mozilla/Firefox. At the moment showing the MathML output + inside the editor is not supported in Internet Explorer. + + +License information + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License (at http://www.gnu.org/licenses/lgpl.html) + for more details. + + NOTE: I have changed the license of AsciiMathML from GPL to LGPL according to a permission + from the author (see http://xinha.gogo.co.nz/punbb/viewtopic.php?pid=4150#p4150) + Raimund Meyer 11-29-2006 \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/abs_value.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/abs_value.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/diag_fraction.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/diag_fraction.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/divide.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/divide.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/dsp_greater_equal.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/dsp_greater_equal.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/dsp_less_equal.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/dsp_less_equal.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/dsp_notequal.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/dsp_notequal.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/equation.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/equation.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/equation.old.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/equation.old.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/greater_equal_than.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/greater_equal_than.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/hor_fraction.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/hor_fraction.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/less_equal_than.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/less_equal_than.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/mul.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/mul.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/notequal.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/notequal.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/parenthesis.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/parenthesis.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/root.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/root.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/square_root.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/img/square_root.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/de.js 3 Jan 2016 20:47:41 -0000 1.1.2.1 @@ -0,0 +1,23 @@ +// I18N constants +// +//LANG: "base", ENCODING: UTF-8 +//Author: Translator-Name, +// FOR TRANSLATORS: +// +// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE +// (at least a valid email address) +// +// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; +// (if this is not possible, please include a comment +// that states what encoding is necessary.) + +{ + "AsciiMath Formula Input": "AsciiMath Formeleditor", + "Formula Editor": "Formeleditor", + "Input":"Eingabe", + "Preview":"Vorschau", + "Based on ASCIIMathML by ": "Basiert auf ASCIIMathML von ", + "For more information on AsciiMathML visit this page: ":"Für weitere Informationen besuchen Sie bitte diese Seite: ", + 'Attention Internet Explorer users: Please note that there is no WYSIWYG representation of the formula in the editor!
    You might wish to use Mozilla Firefox instead.' : 'Achtung Internet Explorer-Benutzer: Die Formel wird im Editor nicht als WYSIWYG dargestellt.
    Benutzen Sie Mozilla Firefox als Alternative.', + "Show MathML" : "Zeige MathML" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/fr.js 3 Jan 2016 20:47:41 -0000 1.1.2.1 @@ -0,0 +1,5 @@ +// I18N for the Equation plugin +// LANG: "fr", ENCODING: UTF-8 +{ + "Equation Editor": "Editeur d'équation" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/ja.js 3 Jan 2016 20:47:41 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "AsciiMath Formula Input": "AsciiMath 数式入力", + "Formula Editor": "数式エディタ", + "Input":"入力", + "Preview":"表示", + "Based on ASCIIMathML by ": "Based on ASCIIMathML by ", + "For more information on AsciiMathML visit this page: ":"AsciiMathの詳細はこのページにあります: ", + "Attention: Editing the formula in the editor is not possible, please use this dialog!" : "注意: エディタで数式を編集することはできません。必ず、このダイアログを使用してください" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/nb.js 3 Jan 2016 20:47:41 -0000 1.1.2.1 @@ -0,0 +1,9 @@ +// I18N for the Equation plugin +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Equation Editor": "Formeleditor", + "Select operation": "Velg formel", + "Insert": "Sett inn", + "Cancel": "Avbryt" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/nl.js 3 Jan 2016 20:47:42 -0000 1.1.2.1 @@ -0,0 +1,13 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl + +{ + "AsciiMath Formula Input": "AsciiMath Formule Invoeren", + "Formula Editor": "Formule Invoeren", + "Input":"Invoer", + "Preview":"Voorbeeld", + "Based on ASCIIMathML by ": "Gebasseerd op ASCIIMathML van ", + "For more information on AsciiMathML visit this page: ":"Voor meer informatie over AsciiMathML ga je naar: ", + "Attention: Editing the formula in the editor is not possible, please use this dialog!" : "Let op! het bewerken van de formule in de editor is niet mogelijk, gebruik dit dialoog!" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/no.js 3 Jan 2016 20:47:42 -0000 1.1.2.1 @@ -0,0 +1,9 @@ +// I18N for the Equation plugin +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Equation Editor": "Formeleditor", + "Select operation": "Velg formel", + "Insert": "Sett inn", + "Cancel": "Avbryt" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/lang/pt_br.js 3 Jan 2016 20:47:42 -0000 1.1.2.1 @@ -0,0 +1,36 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + ""text"": ""text"", + "AsciiMath Formula Input": "Inserir Fórmula AsciiMath", + "AsciiMathML Example": "Exemplo AsciiMathML", + "Based on ASCIIMathML by": "Baseado no ASCIIMathML por", + "Cancel": "Cancelar", + "Equation": "Equação", + "For more information on AsciiMathML visit this page:": "Para maiores informações do AsciiMathML visite este site:", + "Formula Editor": "Editor de Fórmula", + "Input": "Entrada", + "Insert": "Inserir", + "Preview": "Visualizar", + "Select operation": "Selecionar operação", + "`"text"`": "`"texto"`", + + // new messages - see: http://xinha.webfactional.com/wiki/TranslationChanges + "Attention Internet Explorer users: Please note that there is no WYSIWYG representation of the formula in the editor! You might wish to use Mozilla Firefox instead.": "Atenção usuários do Internet Explorer: Observe que não é possível representar fórmulas no editor no modo de visualização! É preferivelmente que você utilize o Mozilla Firefox.", + "Show MathML": "Mostrar MathML", + // removed old messages - see: http://xinha.webfactional.com/wiki/TranslationChanges + "Attention: Editing the formula in the editor is not possible, please use this dialog!": "Atenção: Não é possível editar a fórmula no editor. Ppor favor, utilize este caixa de diálogo!" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/popups/dialog.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/popups/dialog.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/popups/dialog.html 3 Jan 2016 20:47:42 -0000 1.1.2.1 @@ -0,0 +1,377 @@ + + + + + AsciiMath Formula Input + + + + + + + + + + +
    AsciiMath Formula Input
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    `(x+1)/(x-1)``x^(m+n)``x_(mn)``sqrt(x)``root(n)(x)``"text"`
    `dy/dx``lim_(x->oo)``sum_(n=1)^oo``int_a^bf(x)dx``[[a,b],[c,d]]``((n),(k))`
    `*``**``//``\\``xx``-:``@``o+``ox``o.``sum``prod``^^``∧``vv``∨`
    `!=``<=``>=``-<``>-``in``!in``sub``sup``sube``supe``O/``nn``∩``uu``∪`
    `and``or``not``=>``if``<=>``AA``EE``_|_``TT``|--``|==``-=``~=``~~``prop`
    `int``oint``del``grad``+-``oo``aleph``quad``diamond``square``|__``__|``|~``~|``<x>``/_`
    `uarr``darr``larr``->``|->``harr``lArr``rArr``hArr``hata``ula``dota``ddota``veca``bara``:.`
    `NN``ZZ``QQ``RR``CC``bba``bbba``cca``fra``sfa``tta``stackrel(->)(+)``upsilon`
    `alpha``beta``gamma``Gamma``delta``Delta``epsi``zeta``eta``theta``Theta``iota``kappa``lambda``Lambda``mu`
    `nu``pi``Pi``rho``sigma``Sigma``tau``xi``Xi``phi``Phi``chi``psi``Psi``omega``Omega`
    +
    + + + + + + + + + +
    InputPreview
    + + +
    + +
    + Based on ASCIIMathML by Peter Jipsen, +Chapman University
    + For more information on AsciiMathML visit this page: http://www1.chapman.edu/~jipsen/mathml/asciimath.html
    + +
    + + + +
    +
    + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/popups/operations.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/popups/operations.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Equation/popups/operations.html 3 Jan 2016 20:47:42 -0000 1.1.2.1 @@ -0,0 +1,89 @@ + + + + + Equation + + + + + + + +
    Select operation
    + + + + + + + + + + + + + + + + + + + + + +
     
    +
    + + +
    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/ExtendedFileManager.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/ExtendedFileManager.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/ExtendedFileManager.js 3 Jan 2016 20:47:42 -0000 1.1.2.1 @@ -0,0 +1,329 @@ +/** + * ExtendedFileManager extended-file-manager.js file. + * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz, Raimund Meyer + * Modified by: Krzysztof Kotowicz + * Version: Updated on 08-01-2005 by Afru + * Version: Modified on 20-06-2006 by Krzysztof Kotowicz + * Version: Updated on 29-10-2006 by Raimund Meyer + * Version: Updated on 20-01-2008 by Raimund Meyer + * Package: ExtendedFileManager (EFM 1.4) + */ + +/** + * For installation details see Readme.txt in the plugin folder + * + */ + +function ExtendedFileManager(editor) +{ + + this.editor = editor; + + var cfg = editor.config; + var toolbar = cfg.toolbar; + var self = this; + + if (cfg.ExtendedFileManager.use_linker) { + cfg.registerButton({ + id : "linkfile", + tooltip : Xinha._lc("Insert File Link",'ExtendedFileManager'), + image : Xinha.getPluginDir('ExtendedFileManager') + '/img/ed_linkfile.gif', + textMode : false, + action : function(editor) { + editor._linkFile(); + } + }); + cfg.addToolbarElement("linkfile", "createlink", 1); + }; + + var manager = editor.config.ExtendedFileManager.backend + '__function=manager'; + if(cfg.ExtendedFileManager.backend_config != null) + { + manager += '&backend_config=' + + encodeURIComponent(cfg.ExtendedFileManager.backend_config); + manager += '&backend_config_hash=' + + encodeURIComponent(cfg.ExtendedFileManager.backend_config_hash); + manager += '&backend_config_secret_key_location=' + + encodeURIComponent(cfg.ExtendedFileManager.backend_config_secret_key_location); + } + + if(cfg.ExtendedFileManager.backend_data != null) + { + for ( var i in cfg.ExtendedFileManager.backend_data ) + { + manager += '&' + i + '=' + encodeURIComponent(cfg.ExtendedFileManager.backend_data[i]); + } + } + cfg.ExtendedFileManager.manager = manager; +} + +ExtendedFileManager._pluginInfo = { + name : "ExtendedFileManager", + version : "1.4", + developer : "Afru, Krzysztof Kotowicz, Raimund Meyer", + developer_url : "http://xinha.org", + license : "htmlArea" +}; + +Xinha.Config.prototype.ExtendedFileManager = +{ + 'use_linker': true, + 'backend' : Xinha.getPluginDir('ExtendedFileManager') + '/backend.php?__plugin=ExtendedFileManager&', + 'backend_data' : null, + // deprecated keys, use passing data through e.g. xinha_pass_to_php_backend() + 'backend_config' : null, + 'backend_config_hash': null, + 'backend_config_secret_key_location': 'Xinha:ExtendedFileManager' +}; + +// Over ride the _insertImage function in htmlarea.js. +// Open up the ExtendedFileManger script instead. +if(typeof ImageManager == 'undefined') +{ +Xinha.prototype._insertImage = function(image) { + + var editor = this; // for nested functions + var outparam = {"editor" : this, param : null}; + + if (typeof image == "undefined") { + image = this.getParentElement(); + if (image && !/^img$/i.test(image.tagName)) + image = null; + } + + if (image) { + outparam.param = { + f_url : Xinha.is_ie ? image.src : image.getAttribute("src"), + f_alt : image.alt, + f_title : image.title, + f_border : image.style.borderWidth ? image.style.borderWidth : image.border, + f_align : image.align, + f_width : image.width, + f_height : image.height, + f_padding: image.style.padding, + f_margin : image.style.margin, + f_backgroundColor: image.style.backgroundColor, + f_borderColor: image.style.borderColor, + baseHref: editor.config.baseHref + }; + + // compress 'top right bottom left' syntax into one value if possible + outparam.param.f_border = shortSize(outparam.param.f_border); + outparam.param.f_padding = shortSize(outparam.param.f_padding); + outparam.param.f_margin = shortSize(outparam.param.f_margin); + + // convert rgb() calls to rgb hex + outparam.param.f_backgroundColor = convertToHex(outparam.param.f_backgroundColor); + outparam.param.f_borderColor = convertToHex(outparam.param.f_borderColor); + + } + Dialog(this.config.ExtendedFileManager.manager, function(param){ + if (!param) + { // user must have pressed Cancel + return false; + } + + var img = image; + if (!img) { + if ( !param.f_url ) return false; + if (Xinha.is_ie) { + var sel = editor.getSelection(); + var range = editor.createRange(sel); + editor._doc.execCommand("insertimage", false, param.f_url); + img = range.parentElement(); + // wonder if this works... + if (img.tagName.toLowerCase() != "img") { + img = img.previousSibling; + } + + } else { + img = document.createElement('img'); + img.src = param.f_url; + editor.insertNodeAtSelection(img); + } + + } else { + if ( !param.f_url ) { // delete the image if empty url passed + img.parentNode.removeChild(img); + editor.updateToolbar(); + return false; + } else { + img.src = param.f_url; + } + } + + img.alt = img.alt ? img.alt : ''; + + for (field in param) + { + var value = param[field]; + switch (field) + { + case "f_alt" : img.alt = value; break; + case "f_title" : img.title = value; break; + case "f_border" : + if (value) + { + img.style.borderWidth = /[^0-9]/.test(value) ? value : (value != '') ? (parseInt(value) + 'px') : ''; + if(img.style.borderWidth && !img.style.borderStyle) + { + img.style.borderStyle = 'solid'; + } + else if (!img.style.borderWidth) + { + img.style.border = ''; + } + } + break; + case "f_borderColor": img.style.borderColor = value; break; + case "f_backgroundColor": img.style.backgroundColor = value; break; + case "f_align" : img.align = value; break; + case "f_width" : + if ( parseInt( value ) > 0 ) + { + img.width = parseInt(value); + } + break; + case "f_height" : + if ( parseInt( value ) > 0 ) + { + img.height = parseInt(value); + } + break; + case "f_padding": img.style.padding = + /[^0-9]/.test(value) ? value : (value != '') ? (parseInt(value) + 'px') :''; break; + case "f_margin": img.style.margin = + /[^0-9]/.test(value) ? value : (value != '') ? (parseInt(value) + 'px') :''; break; + } + } + + }, outparam); + +}; +} + +Xinha.prototype._linkFile = function(link) { + + var editor = this; + var outparam = {"editor" : this, param : null}; + if (typeof link == "undefined") { + link = this.getParentElement(); + if (link) { + if (/^img$/i.test(link.tagName)) + link = link.parentNode; + if (!/^a$/i.test(link.tagName)) + link = null; + } + } + if (!link) { + var sel = editor.getSelection(); + var range = editor.createRange(sel); + var compare = 0; + if (Xinha.is_ie) { + if ( sel.type == "Control" ) + compare = range.length; + else + compare = range.compareEndPoints("StartToEnd", range); + } else { + compare = range.compareBoundaryPoints(range.START_TO_END, range); + } + if (compare == 0) { + alert(Xinha._lc("You must select some text before making a new link.", 'ExtendedFileManager')); + return; + } + outparam.param = { + f_href : '', + f_title : '', + f_target : '', + f_usetarget : editor.config.makeLinkShowsTarget, + baseHref: editor.config.baseHref + }; + } + else + { + outparam.param = { + f_href : Xinha.is_ie ? link.href : link.getAttribute("href"), + f_title : link.title, + f_target : link.target, + f_usetarget : editor.config.makeLinkShowsTarget, + baseHref: editor.config.baseHref + }; + } + + Dialog(this.config.ExtendedFileManager.manager+'&mode=link', function(param){ + if (!param) + return false; + var a = link; + if (!a) try { + editor._doc.execCommand("createlink", false, param.f_href); + a = editor.getParentElement(); + var sel = editor.getSelection(); + var range = editor.createRange(sel); + if (!Xinha.is_ie) { + a = range.startContainer; + if (!/^a$/i.test(a.tagName)) { + a = a.nextSibling; + if (a == null) + a = range.startContainer.parentNode; + } + } + } catch(e) {} + else { + var href = param.f_href.trim(); + editor.selectNodeContents(a); + if (href == "") { + editor._doc.execCommand("unlink", false, null); + editor.updateToolbar(); + return false; + } + else { + a.href = href; + } + } + if (!(a && /^a$/i.test(a.tagName))) + return false; + a.target = param.f_target.trim(); + a.title = param.f_title.trim(); + editor.selectNodeContents(a); + editor.updateToolbar(); + }, outparam); +}; + +function shortSize(cssSize) +{ + if(/ /.test(cssSize)) + { + var sizes = cssSize.split(' '); + var useFirstSize = true; + for(var i = 1; i < sizes.length; i++) + { + if(sizes[0] != sizes[i]) + { + useFirstSize = false; + break; + } + } + if(useFirstSize) cssSize = sizes[0]; + } + + return cssSize; +} + +function convertToHex(color) { + + if (typeof color == "string" && /, /.test.color) + color = color.replace(/, /, ','); // rgb(a, b) => rgb(a,b) + + if (typeof color == "string" && / /.test.color) { // multiple values + var colors = color.split(' '); + var colorstring = ''; + for (var i = 0; i < colors.length; i++) { + colorstring += Xinha._colorToRgb(colors[i]); + if (i + 1 < colors.length) + colorstring += " "; + } + return colorstring; + } + + return Xinha._colorToRgb(color); +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/Readme.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/Readme.txt,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/Readme.txt 3 Jan 2016 20:47:43 -0000 1.1.2.1 @@ -0,0 +1,111 @@ +Package : Extended File Manager EFM 1.1.1 + +Version 1.1 created from 1.0 beta by Krzysztof Kotowicz + +Overview : +---------- + +Extended File Manager is an advanced plugin for Xinha + +It works in two different modes. +1). Insert Image Mode and +2). Insert File Link Mode. + +In Insert Image Mode, it replaces the basic insert image functionality of Xinha with its advanced image manager. + +If Insert File Link Mode is enabled, a new icon will be added to the toolbar with advanced file linking capability. + + + +Complete Features : +------------------- +* Easy config.inc file that enables individual options for both modes. +* Thumnail View +* List View +* Nice icons for both views +* Create Folders +* Vertical Scrolling +* Allowed extensions to view or upload. +* File Uploads +* Max File upload limit +* Max Upload Folder size (Including all subfolders and files. A must see option.) +* Dynamic display of available free space in the Upload Folder +* Dynamic Thumbnails using Image libraries or browser resize +* Image Editor (Actually done by Wei...a great addon) +* Can be used to insert images along with properties. +* Can be used to insert link to non-image files like pdf or zip. +* You can specify image margin / padding / background and border colors +* You may edit Alt/title tags for inserted images + +(Most of the features can be enabled/disabled as needed) + +Installation : +-------------- + +Installing involves extracting the archive to 'plugins' subdirectory of Xinha +and selecting the plugin in appropriate xinha_plugins list. + +Plugin may be configured via xinha_config.ExtendedFileManager object. +Look into ImageManager plugin documentation as this plugin uses almost identical +settings. All available options can be found in the file config.inc.php. + +// only snippets of code from initializing file shown below + + + xinha_plugins = xinha_plugins ? xinha_plugins : + [ + 'ContextMenu', + 'SuperClean', + 'CharacterMap', + 'GetHtml', + 'ExtendedFileManager', + /*'ImageManager',*/ // replace image manager with EFM + 'Linker' + ]; + +... + +//If you don't want to add a button for linking files and use only the advanced ImageManager +xinha_config.ExtendedFileManager.use_linker = false; +// pass the configuration to plugin +if (xinha_config.ExtendedFileManager) { + with (xinha_config.ExtendedFileManager) + { + '; + $IMConfig['images_url'] = ''; + $IMConfig['files_dir'] = ''; + $IMConfig['files_url'] = ''; + $IMConfig['thumbnail_prefix'] = 't_'; + $IMConfig['thumbnail_dir'] = 't'; + $IMConfig['resized_prefix'] = 'resized_'; + $IMConfig['resized_dir'] = ''; + $IMConfig['tmp_prefix'] = '_tmp'; + $IMConfig['max_filesize_kb_image'] = 2000; + // maximum size for uploading files in 'insert image' mode (2000 kB here) + + $IMConfig['max_filesize_kb_link'] = 5000; + // maximum size for uploading files in 'insert link' mode (5000 kB here) + + // Maximum upload folder size in Megabytes. + // Use 0 to disable limit + $IMConfig['max_foldersize_mb'] = 0; + + $IMConfig['allowed_image_extensions'] = array("jpg","gif","png"); + $IMConfig['allowed_link_extensions'] = array("jpg","gif","pdf","ip","txt", + "psd","png","html","swf", + "xml","xls"); + + require_once '/path/to/xinha/contrib/php-xinha.php'; + xinha_pass_to_php_backend($IMConfig); + + ?> + } +} + +===== +afrusoft@gmail.com - author of EFM 1.0 beta +koto@webworkers.pl - EFM 1.1 (most of the code taken from Xinha codebase) \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/backend.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/backend.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/backend.php 3 Jan 2016 20:47:43 -0000 1.1.2.1 @@ -0,0 +1,110 @@ + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/config.inc.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/config.inc.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/config.inc.php 3 Jan 2016 20:47:43 -0000 1.1.2.1 @@ -0,0 +1,412 @@ + + * Package: ExtendedFileManager + * http://www.afrusoft.com/htmlarea + */ + +/* Configuration file usage: + * There are two insertModes for this filemanager. + * One is "image" and another is "link". + * So you can assign config values as below + * + * if($insertMode=="image") $IMConfig['property']=somevalueforimagemode; + * else if($insertMode=="link") $IMConfig['property']=somevalueforlinkmode; + * + * (or) you can directly as $IMConfig['property']=somevalueforbothmodes; + * + * Best of Luck :) Afru. + */ + +/* + * Getting the mode for further differentiation + */ + +if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; + if(!isset($insertMode)) $insertMode="image"; + +/** +* Default backend URL +* +* URL to use for unified backend. +* +* The ?__plugin=ExtendedFileManager& is required. +*/ + +$IMConfig['backend_url'] = "backend.php?__plugin=ExtendedFileManager&"; + +/** +* Backend Installation Directory +* +* location of backend install; these are used to link to css and js +* assets because we may have the front end installed in a different +* directory than the backend. (i.e. nothing assumes that the frontend +* and the backend are in the same directory) +*/ +$IMConfig['base_dir'] = getcwd(); +$IMConfig['base_url'] = ''; + + +/* + File system path to the directory you want to manage the images + for multiple user systems, set it dynamically. + + NOTE: This directory requires write access by PHP. That is, + PHP must be able to create files in this directory. + Able to create directories is nice, but not necessary. +*/ +$IMConfig['images_dir'] = 'demo_images'; +//You may set a different directory for the link mode; if you don't, the above setting will be used for both modes +//$IMConfig['files_dir'] = 'demo_files'; + +/* + The URL to the above path, the web browser needs to be able to see it. + Please remove scripting capabilities in this directory + for this directory (i.e. disable PHP, Perl, CGI; see .htaccess file in demo_images folder). +*/ +$IMConfig['images_url'] = str_replace( array("backend.php","manager.php"), "", $_SERVER["PHP_SELF"] ) . $IMConfig['images_dir']; +//$IMConfig['files_url'] = 'url/to/files_dir'; + +/* + Format of the Date Modified in list view. + It has to be a string understood by the PHP date() function (for possible values see http://http://php.net/manual/en/function.date.php) +*/ +$IMConfig['date_format'] = "d.m.y H:i"; +/* + Possible values: true, false + + TRUE - If PHP on the web server is in safe mode, set this to true. + SAFE MODE restrictions: directory creation will not be possible, + only the GD library can be used, other libraries require + Safe Mode to be off. + + FALSE - Set to false if PHP on the web server is not in safe mode. +*/ +$IMConfig['safe_mode'] = false; + +/* +This specifies whether any image library is available to resize and edit images.TRUE - Thumbnails will be resized by image libraries and if there is no library, default thumbnail will be shown. +FALSE - Thumbnails will be resized by browser ignoring image libraries. +*/ +$IMConfig['img_library'] = true; + + +/* +View type when the File manager is in insert image mode. +Valid values are "thumbview" and "listview". +*/ + + +if ($insertMode == 'image') + $IMConfig['view_type'] = "thumbview"; + +else if($insertMode == "link") + $IMConfig['view_type'] = "listview"; + +$IMConfig['insert_mode'] = $insertMode; + +/* + Possible values: 'GD', 'IM', or 'NetPBM' + + The image manipulation library to use, either GD or ImageMagick or NetPBM. + If you have safe mode ON, or don't have the binaries to other packages, + your choice is 'GD' only. Other packages require Safe Mode to be off. +*/ +define('IMAGE_CLASS', 'GD'); + + +/* + After defining which library to use, if it is NetPBM or IM, you need to + specify where the binary for the selected library are. And of course + your server and PHP must be able to execute them (i.e. safe mode is OFF). + GD does not require the following definition. +*/ +define('IMAGE_TRANSFORM_LIB_PATH', '/usr/bin/'); +//define('IMAGE_TRANSFORM_LIB_PATH', 'C:/"Program Files"/ImageMagick-5.5.7-Q16/'); + + +/* + The prefix for thumbnail files, something like .thumb will do. The + thumbnails files will be named as "prefix_imagefile.ext", that is, + prefix + orginal filename. +*/ +$IMConfig['thumbnail_prefix'] = 't_'; + + +/* + Thumbnail can also be stored in a directory, this directory + will be created by PHP. If PHP is in safe mode, this parameter + is ignored, you can not create directories. + + If you do not want to store thumbnails in a directory, set this + to false or empty string ''; +*/ +$IMConfig['thumbnail_dir'] = 't'; + +/** + * Resize files, or not. If the dimensions for an image are changed + * this will control if the image is actually resized. + * + * Usually you want this true, unless you are very disk space concious. + */ + +$IMConfig['resize_files'] = true; + +/** +* Resized prefix +* +* The prefix for resized files, something like .resized will do. The +* resized files will be named _x_ +* resized files are created when one changes the dimensions of an image +* in the image manager selection dialog - the image is scaled when the +* user clicks the ok button. +*/ + +$IMConfig['resized_prefix'] = '.resized'; + +// ------------------------------------------------------------------------- + +/** +* Resized Directory +* +* Resized images may also be stored in a directory, except in safe mode. +*/ + +$IMConfig['resized_dir'] = ''; + +/* + Possible values: true, false + + TRUE - Allow the user to create new sub-directories in the + $IMConfig['images_dir']/$IMConfig['files_dir']. + + FALSE - No directory creation. + + NOTE: If $IMConfig['safe_mode'] = true, this parameter + is ignored, you can not create directories +*/ +$IMConfig['allow_new_dir'] = true; + +/* + Possible values: true, false + + TRUE - Allow the user to edit image by image editor. + + FALSE - No edit icon will be displayed. + + NOTE: If $IMConfig['img_library'] = false, this parameter + is ignored, you can not edit images. +*/ +$IMConfig['allow_edit_image'] = true; + +/* + Possible values: true, false + + TRUE - Allow the user to rename files and folders. + + FALSE - No rename icon will be displayed. + +*/ +$IMConfig['allow_rename'] = true; + +/* + Possible values: true, false + + TRUE - Allow the user to perform cut/copy/paste actions. + + FALSE - No cut/copy/paste icons will be displayed. + +*/ +$IMConfig['allow_cut_copy_paste'] = true; + +/* + Possible values: true, false + + TRUE - Allow the user to delete files and folders. + + FALSE - No delete icon will be displayed. + +*/ +$IMConfig['allow_delete'] = true; + +/* + Possible values: true, false + + TRUE - Display color pickers for image background / border colors + + FALSE - Don't display color pickers +*/ +$IMConfig['use_color_pickers'] = true; + +/* + Possible values: true, false + + TRUE - Allow the user to set alt (alternative text) attribute. + + FALSE - No input field for alt attribute will be displayed. + + NOTE: The alt attribute is _obligatory_ for images, so will be inserted + if 'images_enable_alt' is set to false +*/ +$IMConfig['images_enable_alt'] = true; + +/* + Possible values: true, false + + TRUE - Allow the user to set title attribute (usually displayed when mouse is over element). + + FALSE - No input field for title attribute will be displayed. + +*/ +$IMConfig['images_enable_title'] = false; + +/* + Possible values: true, false + + TRUE - Allow the user to set align attribute. + + FALSE - No selection box for align attribute will be displayed. + +*/ +$IMConfig['images_enable_align'] = true; + +/* + Possible values: true, false + + TRUE - Allow the user to set margin, padding, and border styles for the image + + FALSE - No styling input fields will be displayed. + +*/ +$IMConfig['images_enable_styling'] = true; + +/* + Possible values: true, false + + TRUE - Allow the user to set target attribute for link (the window in which the link will be opened). + + FALSE - No selection box for target attribute will be displayed. + +*/ +$IMConfig['link_enable_target'] = true; +/* + Possible values: true, false + + TRUE - Allow the user to upload files. + + FALSE - No uploading allowed. +*/ +$IMConfig['allow_upload'] = false; + +/* Maximum upload file size + + Possible values: number, "max" + + number - maximum size in Kilobytes. + + "max" - the maximum allowed by the server (the value is retrieved from the server configuration). +*/ +$IMConfig['max_filesize_kb_image'] = 200; + +$IMConfig['max_filesize_kb_link'] = 5000; + +/* Maximum upload folder size in Megabytes. Use 0 to disable limit */ +$IMConfig['max_foldersize_mb'] = 0; + +/* +Allowed extensions that can be shown and allowed to upload. +Available icons are for "doc,fla,gif,gz,html,jpg,js,mov,pdf,php,png,ppt,rar,txt,xls,zip" +-Changed by AFRU. +*/ + +$IMConfig['allowed_image_extensions'] = array("jpg","gif","png","bmp"); +$IMConfig['allowed_link_extensions'] = array("jpg","gif","js","php","pdf","zip","txt","psd","png","html","swf","xml","xls","doc"); + + +/* + The default thumbnail and list view icon in case thumbnails are not created and the files are of unknown. +*/ +$IMConfig['default_thumbnail'] = 'icons/def.gif'; +$IMConfig['default_listicon'] = 'icons/def_small.gif'; + + +/* +Only files with these extensions will be shown as thumbnails. All other files will be shown as icons. +*/ +$IMConfig['thumbnail_extensions'] = array("jpg", "gif", "png", "bmp"); + +/* + Thumbnail dimensions. +*/ +$IMConfig['thumbnail_width'] = 84; +$IMConfig['thumbnail_height'] = 84; + +/* + Image Editor temporary filename prefix. +*/ +$IMConfig['tmp_prefix'] = '.editor_'; + + +// Standard PHP Backend Data Passing +// if data was passed using xinha_pass_to_php_backend() we merge the items +// provided into the Config +require_once(realpath(dirname(__FILE__) . '/../../contrib/php-xinha.php')); +if($passed_data = xinha_read_passed_data()) +{ + $IMConfig = array_merge($IMConfig, $passed_data); + $IMConfig['backend_url'] .= xinha_passed_data_querystring() . '&'; +} +// Deprecated config passing, don't use this way any more! +elseif(isset($_REQUEST['backend_config'])) +{ + if(get_magic_quotes_gpc()) { + $_REQUEST['backend_config'] = stripslashes($_REQUEST['backend_config']); + } + + if($_REQUEST['backend_config_secret_key_location'] !== 'Xinha:ExtendedFileManager') + { + trigger_error('Programming Error - please contact the website administrator/programmer to alert them to this problem. A non-default backend key location is being used to pass backend data to Xinha, but the same key location is not being used to receive data. The special backend configuration has been ignored. To resolve this, you should edit plugins/ExtendedFileManager/config.php and change the default key location from "Xinha:ExtendedFileManager" to your desired non default. See: http://trac.xinha.org/ticket/1518', E_USER_ERROR); + } + else + { + // Config specified from front end, check that it's valid + session_start(); + if (!array_key_exists($_REQUEST['backend_config_secret_key_location'], $_SESSION)) + die("Backend security error."); + + $secret = $_SESSION[$_REQUEST['backend_config_secret_key_location']]; + + if($_REQUEST['backend_config_hash'] !== sha1($_REQUEST['backend_config'] . $secret)) + { + die("Backend security error."); + } + + $to_merge = unserialize($_REQUEST['backend_config']); + if(!is_array($to_merge)) + { + die("Backend config syntax error."); + } + + $IMConfig = array_merge($IMConfig, $to_merge); + + // changed config settings keys in relation to ImageManager + $IMConfig['backend_url'] .= "backend_config=" . rawurlencode($_REQUEST['backend_config']) . '&'; + $IMConfig['backend_url'] .= "backend_config_hash=" . rawurlencode($_REQUEST['backend_config_hash']) . '&'; + $IMConfig['backend_url'] .= "backend_config_secret_key_location=" . rawurlencode($_REQUEST['backend_config_secret_key_location']) . '&'; + } +} +if ($IMConfig['max_filesize_kb_link'] == "max") +{ + $IMConfig['max_filesize_kb_link'] = upload_max_filesize_kb(); +} + +if ($IMConfig['max_filesize_kb_image'] == "max") +{ + $IMConfig['max_filesize_kb_image'] = upload_max_filesize_kb(); +} +// END + +?> Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/editor.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/editor.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/editor.php 3 Jan 2016 20:47:43 -0000 1.1.2.1 @@ -0,0 +1,172 @@ + + + + + + Xinha Image Editor + + + + + + + + + + + + + + + + + + +
    + + + + + + + +
    + CropCrop + ResizeResize + RotateRotate + MeasureMeasure + MarkerMarker + SaveSave +
    Zoom
    + +
    + + +
    + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/editorFrame.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/editorFrame.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/editorFrame.php 3 Jan 2016 20:47:44 -0000 1.1.2.1 @@ -0,0 +1,84 @@ +processImage(); + +?> + + + + + + + + + + + + +
    + +isGDEditable() == -1) { ?> +
    GIF format is not supported, image editing not supported.
    + + + + + +
    + 0 && is_file($imageInfo['fullpath'])) { ?> + alt="" id="theImage" name="theImage"> + + No Image Available + +
    + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/extended-file-manager.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/extended-file-manager.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/extended-file-manager.js 3 Jan 2016 20:47:44 -0000 1.1.2.1 @@ -0,0 +1,242 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/ExtendedFileManager/extended-file-manager.js */ +function ExtendedFileManager(_1){ +this.editor=_1; +var _2=_1.config; +var _3=_2.toolbar; +var _4=this; +if(_2.ExtendedFileManager.use_linker){ +_2.registerButton({id:"linkfile",tooltip:Xinha._lc("Insert File Link","ExtendedFileManager"),image:Xinha.getPluginDir("ExtendedFileManager")+"/img/ed_linkfile.gif",textMode:false,action:function(_5){ +_5._linkFile(); +}}); +_2.addToolbarElement("linkfile","createlink",1); +} +var _6=_1.config.ExtendedFileManager.backend+"__function=manager"; +if(_2.ExtendedFileManager.backend_config!=null){ +_6+="&backend_config="+encodeURIComponent(_2.ExtendedFileManager.backend_config); +_6+="&backend_config_hash="+encodeURIComponent(_2.ExtendedFileManager.backend_config_hash); +_6+="&backend_config_secret_key_location="+encodeURIComponent(_2.ExtendedFileManager.backend_config_secret_key_location); +} +if(_2.ExtendedFileManager.backend_data!=null){ +for(var i in _2.ExtendedFileManager.backend_data){ +_6+="&"+i+"="+encodeURIComponent(_2.ExtendedFileManager.backend_data[i]); +} +} +_2.ExtendedFileManager.manager=_6; +} +ExtendedFileManager._pluginInfo={name:"ExtendedFileManager",version:"1.4",developer:"Afru, Krzysztof Kotowicz, Raimund Meyer",developer_url:"http://xinha.org",license:"htmlArea"}; +Xinha.Config.prototype.ExtendedFileManager={"use_linker":true,"backend":Xinha.getPluginDir("ExtendedFileManager")+"/backend.php?__plugin=ExtendedFileManager&","backend_data":null,"backend_config":null,"backend_config_hash":null,"backend_config_secret_key_location":"Xinha:ImageManager"}; +if(typeof ImageManager=="undefined"){ +Xinha.prototype._insertImage=function(_8){ +var _9=this; +var _a={"editor":this,param:null}; +if(typeof _8=="undefined"){ +_8=this.getParentElement(); +if(_8&&!/^img$/i.test(_8.tagName)){ +_8=null; +} +} +if(_8){ +_a.param={f_url:Xinha.is_ie?_8.src:_8.getAttribute("src"),f_alt:_8.alt,f_title:_8.title,f_border:_8.style.borderWidth?_8.style.borderWidth:_8.border,f_align:_8.align,f_width:_8.width,f_height:_8.height,f_padding:_8.style.padding,f_margin:_8.style.margin,f_backgroundColor:_8.style.backgroundColor,f_borderColor:_8.style.borderColor,baseHref:_9.config.baseHref}; +_a.param.f_border=shortSize(_a.param.f_border); +_a.param.f_padding=shortSize(_a.param.f_padding); +_a.param.f_margin=shortSize(_a.param.f_margin); +_a.param.f_backgroundColor=convertToHex(_a.param.f_backgroundColor); +_a.param.f_borderColor=convertToHex(_a.param.f_borderColor); +} +Dialog(this.config.ExtendedFileManager.manager,function(_b){ +if(!_b){ +return false; +} +var _c=_8; +if(!_c){ +if(!_b.f_url){ +return false; +} +if(Xinha.is_ie){ +var _d=_9.getSelection(); +var _e=_9.createRange(_d); +_9._doc.execCommand("insertimage",false,_b.f_url); +_c=_e.parentElement(); +if(_c.tagName.toLowerCase()!="img"){ +_c=_c.previousSibling; +} +}else{ +_c=document.createElement("img"); +_c.src=_b.f_url; +_9.insertNodeAtSelection(_c); +} +}else{ +if(!_b.f_url){ +_c.parentNode.removeChild(_c); +_9.updateToolbar(); +return false; +}else{ +_c.src=_b.f_url; +} +} +_c.alt=_c.alt?_c.alt:""; +for(field in _b){ +var _f=_b[field]; +switch(field){ +case "f_alt": +_c.alt=_f; +break; +case "f_title": +_c.title=_f; +break; +case "f_border": +if(_f){ +_c.style.borderWidth=/[^0-9]/.test(_f)?_f:(_f!="")?(parseInt(_f)+"px"):""; +if(_c.style.borderWidth&&!_c.style.borderStyle){ +_c.style.borderStyle="solid"; +}else{ +if(!_c.style.borderWidth){ +_c.style.border=""; +} +} +} +break; +case "f_borderColor": +_c.style.borderColor=_f; +break; +case "f_backgroundColor": +_c.style.backgroundColor=_f; +break; +case "f_align": +_c.align=_f; +break; +case "f_width": +if(parseInt(_f)>0){ +_c.width=parseInt(_f); +} +break; +case "f_height": +if(parseInt(_f)>0){ +_c.height=parseInt(_f); +} +break; +case "f_padding": +_c.style.padding=/[^0-9]/.test(_f)?_f:(_f!="")?(parseInt(_f)+"px"):""; +break; +case "f_margin": +_c.style.margin=/[^0-9]/.test(_f)?_f:(_f!="")?(parseInt(_f)+"px"):""; +break; +} +} +},_a); +}; +} +Xinha.prototype._linkFile=function(_10){ +var _11=this; +var _12={"editor":this,param:null}; +if(typeof _10=="undefined"){ +_10=this.getParentElement(); +if(_10){ +if(/^img$/i.test(_10.tagName)){ +_10=_10.parentNode; +} +if(!/^a$/i.test(_10.tagName)){ +_10=null; +} +} +} +if(!_10){ +var sel=_11.getSelection(); +var _14=_11.createRange(sel); +var _15=0; +if(Xinha.is_ie){ +if(sel.type=="Control"){ +_15=_14.length; +}else{ +_15=_14.compareEndPoints("StartToEnd",_14); +} +}else{ +_15=_14.compareBoundaryPoints(_14.START_TO_END,_14); +} +if(_15==0){ +alert(Xinha._lc("You must select some text before making a new link.","ExtendedFileManager")); +return; +} +_12.param={f_href:"",f_title:"",f_target:"",f_usetarget:_11.config.makeLinkShowsTarget,baseHref:_11.config.baseHref}; +}else{ +_12.param={f_href:Xinha.is_ie?_10.href:_10.getAttribute("href"),f_title:_10.title,f_target:_10.target,f_usetarget:_11.config.makeLinkShowsTarget,baseHref:_11.config.baseHref}; +} +Dialog(this.config.ExtendedFileManager.manager+"&mode=link",function(_16){ +if(!_16){ +return false; +} +var a=_10; +if(!a){ +try{ +_11._doc.execCommand("createlink",false,_16.f_href); +a=_11.getParentElement(); +var sel=_11.getSelection(); +var _19=_11.createRange(sel); +if(!Xinha.is_ie){ +a=_19.startContainer; +if(!/^a$/i.test(a.tagName)){ +a=a.nextSibling; +if(a==null){ +a=_19.startContainer.parentNode; +} +} +} +} +catch(e){ +} +}else{ +var _1a=_16.f_href.trim(); +_11.selectNodeContents(a); +if(_1a==""){ +_11._doc.execCommand("unlink",false,null); +_11.updateToolbar(); +return false; +}else{ +a.href=_1a; +} +} +if(!(a&&/^a$/i.test(a.tagName))){ +return false; +} +a.target=_16.f_target.trim(); +a.title=_16.f_title.trim(); +_11.selectNodeContents(a); +_11.updateToolbar(); +},_12); +}; +function shortSize(_1b){ +if(/ /.test(_1b)){ +var _1c=_1b.split(" "); +var _1d=true; +for(var i=1;i<_1c.length;i++){ +if(_1c[0]!=_1c[i]){ +_1d=false; +break; +} +} +if(_1d){ +_1b=_1c[0]; +} +} +return _1b; +} +function convertToHex(_1f){ +if(typeof _1f=="string"&&/, /.test.color){ +_1f=_1f.replace(/, /,","); +} +if(typeof _1f=="string"&&/ /.test.color){ +var _20=_1f.split(" "); +var _21=""; +for(var i=0;i<_20.length;i++){ +_21+=Xinha._colorToRgb(_20[i]); +if(i+1<_20.length){ +_21+=" "; +} +} +return _21; +} +return Xinha._colorToRgb(_1f); +} + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/file-picker.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/file-picker.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ExtendedFileManager/file-picker.js 3 Jan 2016 20:47:44 -0000 1.1.2.1 @@ -0,0 +1,164 @@ +/** + * An input field File Picker utilising the Xinha ExtendedFileManager. + * + * Hijack the Xinha ExtendedFileManager plugin to provide a file URL picker + * for any form input field in the form of a "Browse" button to the + * right of the field, in the same manner as a file type input field + * except it opens the familiar ExtendedFileManager dialog to upload/select + * a file and returns the URL of the file to the field's value. + * + * Example Usage: + * + * + * + * + * + * @author $Author: gustafn $ + * @version $Id: file-picker.js,v 1.1.2.1 2016/01/03 20:47:44 gustafn Exp $ + * @package ImageManager + */ + + +function FilePicker(field) +{ + this.field = field; + var picker = this; + + var but = document.createElement('input'); + but.type = 'button'; + but.value = 'Browse'; + but.onclick = function() { picker.popup_picker(); } + + field.parentNode.insertBefore(but,field.nextSibling); + field.size = '20'; + field.style.textAlign = 'right'; +}; + +FilePicker.prototype.backend = _editor_url + 'plugins/ExtendedFileManager/backend.php?__plugin=ExtendedFileManager&'; +FilePicker.prototype.backend_data = null; + +FilePicker.prototype.append_query_string = true; + +FilePicker.prototype.popup_picker = function() +{ + var picker = this; // closure for later + var outparam = null; + if(picker.field.value) + { + outparam = + { + f_href : picker.field.value, + f_title : '', + f_target : '', + f_usetarget : false, + baseHref: null + }; + + } + + var manager = this.backend + '__function=manager&mode=link'; + if(this.backend_config != null) + { + manager += '&backend_config=' + + encodeURIComponent(this.backend_config); + manager += '&backend_config_hash=' + + encodeURIComponent(this.backend_config_hash); + manager += '&backend_config_secret_key_location=' + + encodeURIComponent(this.backend_config_secret_key_location); + } + + if(this.backend_data != null) + { + for ( var i in this.backend_data ) + { + manager += '&' + i + '=' + encodeURIComponent(this.backend_data[i]); + } + } + + Dialog(manager, function(param) { + if (!param) { // user must have pressed Cancel + return false; + } + + picker.field.value = param.f_href; + + }, outparam); +} + +// Dialog is part of Xinha, but we'll provide it here incase Xinha's not being +// loaded. +if(typeof Dialog == 'undefined') +{ + // htmlArea v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc. + // This copyright notice MUST stay intact for use (see license.txt). + // + // Portions (c) dynarch.com, 2003-2004 + // + // A free WYSIWYG editor replacement for '); + }, + 'form' + ]; + + this.editor.config.btnList.insert_select_field = + [ this._lc("Insert a select field."), + [buttonsImage, 3, 0], + false, + function() + { + pasteAndSelect(''); + }, + 'form' + ]; + + this.editor.config.btnList.insert_cb_field = + [ this._lc("Insert a check box."), + [buttonsImage, 4, 0], + false, + function() + { + pasteAndSelect(''); + }, + 'form' + ]; + + this.editor.config.btnList.insert_rb_field = + [ this._lc("Insert a radio button."), + [buttonsImage, 5, 0], + false, + function() + { + pasteAndSelect(''); + }, + 'form' + ]; + + this.editor.config.btnList.insert_button = + [ this._lc("Insert a submit/reset button."), + [buttonsImage, 6, 0], + false, + function() + { + pasteAndSelect(''); + }, + 'form' + ]; +} + +FormOperations.prototype.onGenerate = function() +{ + // Gecko does not register click events on select lists inside the iframe + // so the only way of detecting that is to do an event on mouse move. + if( Xinha.is_gecko) + { + var editor = this.editor; + var doc = this.editor._doc; + Xinha._addEvents + (doc, ["mousemove"], + function (event) { + return editor._editorEvent(event); + }); + } +}; + +FormOperations.prototype._preparePanel = function () +{ + var fo = this; + if(this.html == false) + { + + Xinha._getback(Xinha.getPluginDir('FormOperations') + '/panel.html', + function(txt) + { + fo.html = txt; + fo._preparePanel(); + } + ); + return false; + } + + if(typeof Xinha.Dialog == 'undefined') + { + Xinha._loadback + (_editor_url + 'modules/Dialogs/XinhaDialog.js', function() { fo._preparePanel(); } ); + return false; + } + + if(typeof Xinha.PanelDialog == 'undefined') + { + Xinha._loadback + (_editor_url + 'modules/Dialogs/panel-dialog.js', function() { fo._preparePanel(); } ); + return false; + } + + + + this.panel = new Xinha.PanelDialog(this.editor,'bottom',this.html,'FormOperations'); + this.panel.hide(); + this.ready = true; +}; + +FormOperations.prototype.onUpdateToolbar = function() +{ + if(!this.ready) return true; + var activeElement = this.editor._activeElement(this.editor._getSelection()); + if(activeElement != null) + { + if(activeElement == this.activeElement) return true; + + var tag = activeElement.tagName.toLowerCase(); + + this.hideAll(); + if(tag === 'form') + { + if(this.editor.config.FormOperations.allow_edit_form) + { + this.showForm(activeElement); + } + else + { + this.panel.hide(); + this.activeElement = null; + this.panel.hide(); + return true; + } + } + else + { + + if(this.editor.config.FormOperations.allow_edit_form && typeof activeElement.form != 'undefined' && activeElement.form) + { + this.showForm(activeElement.form); + } + + switch(tag) + { + case 'form': + { + this.showForm(activeElement); + } + break; + + case 'input': + { + switch(activeElement.getAttribute('type').toLowerCase()) + { + case 'text' : + case 'password': + case 'hidden' : + { + this.showText(activeElement); + } + break; + + case 'radio' : + case 'checkbox': + { + this.showCbRd(activeElement); + } + break; + + case 'submit' : + case 'reset' : + case 'button' : + { + this.showButton(activeElement); + } + break; + } + } + break; + + case 'textarea': + { + this.showTextarea(activeElement); + } + break; + + case 'select': + { + this.showSelect(activeElement); + } + break; + + default: + { + this.activeElement = null; + this.panel.hide(); + return true; + } + } + } + + this.panel.show(); + + //this.editor.scrollToElement(activeElement); + this.activeElement = activeElement; + return true; + } + else + { + this.activeElement = null; + this.panel.hide(); + return true; + } +}; + + +FormOperations.prototype.hideAll = function() +{ + this.panel.getElementById('fs_form').style.display = 'none'; + this.panel.getElementById('fs_text').style.display = 'none'; + this.panel.getElementById('fs_textarea').style.display = 'none'; + this.panel.getElementById('fs_select').style.display = 'none'; + this.panel.getElementById('fs_cbrd').style.display = 'none'; + this.panel.getElementById('fs_button').style.display = 'none'; +}; + +FormOperations.prototype.showForm = function(form) +{ + this.panel.getElementById('fs_form').style.display = ''; + var vals = + { + 'action' : form.action, + 'method' : form.method.toUpperCase() + } + this.panel.setValues(vals); + var f = form; + this.panel.getElementById('action').onkeyup = function () { f.action = this.value; }; + this.panel.getElementById('method').onchange = function () { f.method = this.options[this.selectedIndex].value; }; +}; + +FormOperations.prototype.showText = function (input) +{ + this.panel.getElementById('fs_text').style.display = ''; + + var vals = + { + 'text_name' : this.deformatName(input, input.name), + 'text_value' : input.value, + 'text_type' : input.type.toLowerCase(), + 'text_width' : input.style.width ? parseFloat(input.style.width.replace(/[^0-9.]/, '')) : '', + 'text_width_units': input.style.width ? input.style.width.replace(/[0-9.]/, '').toLowerCase() : 'ex', + 'text_maxlength' : input.maxlength ? input.maxlength : '' + } + this.panel.setValues(vals); + + var i = input; + var fo = this; + + this.panel.getElementById('text_name').onkeyup = function () { i.name = fo.formatName(i, this.value); } + this.panel.getElementById('text_value').onkeyup = function () { i.value = this.value; } + this.panel.getElementById('text_type').onchange = function () + { + if(!Xinha.is_ie) + { + i.type = this.options[this.selectedIndex].value; + } + else + { + // IE does not permit modifications of the type of a form field once it is set + // We therefor have to destroy and recreate it. I swear, if I ever + // meet any of the Internet Explorer development team I'm gonna + // kick them in the nuts! + var tmpContainer = fo.editor._doc.createElement('div'); + if(!/type=/.test(i.outerHTML)) + { + tmpContainer.innerHTML = i.outerHTML.replace(/ 0 ? input.size : 1), + 'select_height_units': input.style.height ? input.style.height.replace(/[0-9.]/, '').toLowerCase() : 'items' + }; + + this.panel.setValues(vals); + + var i = input; + var fo = this; + this.panel.getElementById('select_name').onkeyup = function () { i.name = fo.formatName(i, this.value); }; + this.panel.getElementById('select_multiple').onclick = function () { i.multiple = this.checked; }; + + var w = this.panel.getElementById('select_width'); + var wu = this.panel.getElementById('select_width_units'); + + this.panel.getElementById('select_width').onkeyup = + this.panel.getElementById('select_width_units').onchange = + function () + { + if(!w.value || isNaN(parseFloat(w.value))) + { + i.style.width = ''; + } + i.style.width = parseFloat(w.value) + wu.options[wu.selectedIndex].value; + }; + + var h = this.panel.getElementById('select_height'); + var hu = this.panel.getElementById('select_height_units'); + + this.panel.getElementById('select_height').onkeyup = + this.panel.getElementById('select_height_units').onchange = + function () + { + if(!h.value || isNaN(parseFloat(h.value))) + { + i.style.height = ''; + return; + } + + if(hu.selectedIndex == 0) + { + i.style.height = ''; + i.size = parseInt(h.value); + } + else + { + i.style.height = parseFloat(h.value) + hu.options[hu.selectedIndex].value; + } + }; + + + var fo_sel = this.panel.getElementById('select_options'); + this.arrayToOpts(this.optsToArray(input.options), fo_sel.options); + + this.panel.getElementById('add_option').onclick = + function() + { + var txt = prompt(Xinha._lc("Enter the name for new option.", 'FormOperations')); + if(txt == null) return; + var newOpt = new Option(txt); + var opts = fo.optsToArray(fo_sel.options); + if(fo_sel.selectedIndex >= 0) + { + opts.splice(fo_sel.selectedIndex, 0, newOpt); + } + else + { + opts.push(newOpt); + } + fo.arrayToOpts(opts, input.options); + fo.arrayToOpts(opts, fo_sel.options); + }; + + this.panel.getElementById('del_option').onclick = + function() + { + var opts = fo.optsToArray(fo_sel.options); + var newOpts = [ ]; + for(var i = 0; i < opts.length; i++) + { + if(opts[i].selected) continue; + newOpts.push(opts[i]); + } + fo.arrayToOpts(newOpts, input.options); + fo.arrayToOpts(newOpts, fo_sel.options); + }; + + this.panel.getElementById('up_option').onclick = + function() + { + if(!(fo_sel.selectedIndex > 0)) return; + var opts = fo.optsToArray(fo_sel.options); + var move = opts.splice(fo_sel.selectedIndex, 1).pop(); + opts.splice(fo_sel.selectedIndex - 1, 0, move); + fo.arrayToOpts(opts, input.options); + fo.arrayToOpts(opts, fo_sel.options); + }; + + this.panel.getElementById('down_option').onclick = + function() + { + if(fo_sel.selectedIndex == fo_sel.options.length - 1) return; + var opts = fo.optsToArray(fo_sel.options); + var move = opts.splice(fo_sel.selectedIndex, 1).pop(); + opts.splice(fo_sel.selectedIndex+1, 0, move); + fo.arrayToOpts(opts, input.options); + fo.arrayToOpts(opts, fo_sel.options); + }; + + this.panel.getElementById('select_options').onchange = + function() + { + fo.arrayToOpts(fo.optsToArray(fo_sel.options), input.options); + }; +}; + +FormOperations.prototype.optsToArray = function(o) +{ + var a = [ ]; + for(var i = 0; i < o.length; i++) + { + a.push( + { + 'text' : o[i].text, + 'value' : o[i].value, + 'defaultSelected' : o[i].defaultSelected, + 'selected' : o[i].selected + } + ); + } + return a; +}; + +FormOperations.prototype.arrayToOpts = function(a, o) +{ + for(var i = o.length -1; i >= 0; i--) + { + o[i] = null; + } + + for(var i = 0; i < a.length; i++) + { + o[i] = new Option(a[i].text, a[i].value, a[i].defaultSelected, a[i].selected); + } +}; + +FormOperations.prototype.formatName = function(input, name) +{ + + // Multiple name + var mname = name; + switch(this.editor.config.FormOperations.multiple_field_format) + { + case 'php': + { + mname += '[]'; + } + break; + + case 'unmodified': + { + // Leave as is. + } + break; + + default: + { + throw("Unknown multiple field format " + this.editor.config.FormOperations.multiple_field_format); + } + } + + if + ( + (input.tagName.toLowerCase() == 'select' && input.multiple) + || (input.tagName.toLowerCase() == 'input' && input.type.toLowerCase() == 'checkbox') + ) + { + name = mname; + } + + return name; +}; + +FormOperations.prototype.deformatName = function(input, name) +{ + if(this.editor.config.FormOperations.multiple_field_format == 'php') + { + name = name.replace(/\[\]$/, ''); + } + + return name; +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/README =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/README,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/README 3 Jan 2016 20:48:12 -0000 1.1.2.1 @@ -0,0 +1,32 @@ +Form Operations Plugin +---------------------- + +Usage: + 1. Follow the standard procedure for loading a plugin. + 2. You may configure the plugin by setting the following configuration variables, or leave them as the defaults. + + xinha_config.FormOperations.multiple_field_format + = 'php' + this will cause checkbox and "multiple" select fields to have [] + appended to thier field names silently + = 'unmodified' + field names will not be silently modified + + xinha_config.FormOperations.allow_edit_form + = true + the user will be able to edit the action, and method of forms + = false + neither action, nor method is editable + + xinha_config.FormOperations.default_form_action + = 'whatever you want' + the default form action to set when inserting a form. The standard one is a php file in the Form Operations directory which will email the form post to enquiries@ + + xinha_config.FormOperations.default_form_html + = '
    whatever you want here
    ' + the default html to insert when inserting a form. The standard one is a basic contact form. If you would like to specify an external file which contains the HTML for the form, you may do so via + = HTMLArea._geturlcontent('http://absolute/url/to/file.html') + see default_form.html for a suitable example, pay attention to the form tag. + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/default_form.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/default_form.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/default_form.html 3 Jan 2016 20:48:13 -0000 1.1.2.1 @@ -0,0 +1,36 @@ +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Contact Us
    Your name:
    Your email:
    Message Subject:
    What are your hobbies? + Marbles
    + Conkers
    + Jacks +
    Message Body:
    + +
    +    +
    \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/form-operations.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/form-operations.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/form-operations.js 3 Jan 2016 20:48:13 -0000 1.1.2.1 @@ -0,0 +1,435 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/FormOperations/form-operations.js */ +Xinha.Config.prototype.FormOperations={"multiple_field_format":"php","allow_edit_form":false,"default_form_action":Xinha.getPluginDir("FormOperations")+"/formmail.php","default_form_html":Xinha._geturlcontent(Xinha.getPluginDir("FormOperations")+"/default_form.html")}; +FormOperations._pluginInfo={name:"FormOperations",version:"1.0",developer:"James Sleeman",developer_url:"http://www.gogo.co.nz/",c_owner:"Gogo Internet Services",license:"htmlArea",sponsor:"Gogo Internet Services",sponsor_url:"http://www.gogo.co.nz/"}; +function FormOperations(_1){ +this.editor=_1; +this.panel=false; +this.html=false; +this.ready=false; +this.activeElement=null; +this._preparePanel(); +_1.config.pageStyleSheets.push(Xinha.getPluginDir("FormOperations")+"/iframe.css"); +var _2=["separator","insert_form","insert_text_field","insert_textarea_field","insert_select_field","insert_cb_field","insert_rb_field","insert_button"]; +this.editor.config.toolbar.push(_2); +function pasteAndSelect(_3){ +var id=Xinha.uniq("fo"); +_3=_3.replace(/^<([^ \/>]+)/i,"<$1 id=\""+id+"\""); +_1.insertHTML(_3); +var el=_1._doc.getElementById(id); +el.setAttribute("id",""); +_1.selectNodeContents(el); +_1.updateToolbar(); +return el; +} +var _6=_1.imgURL("buttons.gif","FormOperations"); +FormOperations.prototype._lc=function(_7){ +return Xinha._lc(_7,"FormOperations"); +}; +this.editor.config.btnList.insert_form=[this._lc("Insert a Form."),[_6,0,0],false,function(){ +var _8=null; +if(_1.config.FormOperations.default_form_html){ +_8=pasteAndSelect(_1.config.FormOperations.default_form_html); +}else{ +_8=pasteAndSelect("
     
    "); +} +if(_1.config.FormOperations.default_form_action&&!_8.action){ +_8.action=_1.config.FormOperations.default_form_action; +} +}]; +this.editor.config.btnList.insert_text_field=[this._lc("Insert a text, password or hidden field."),[_6,1,0],false,function(){ +pasteAndSelect(""); +},"form"]; +this.editor.config.btnList.insert_textarea_field=[this._lc("Insert a multi-line text field."),[_6,2,0],false,function(){ +pasteAndSelect(""); +},"form"]; +this.editor.config.btnList.insert_select_field=[this._lc("Insert a select field."),[_6,3,0],false,function(){ +pasteAndSelect(""); +},"form"]; +this.editor.config.btnList.insert_cb_field=[this._lc("Insert a check box."),[_6,4,0],false,function(){ +pasteAndSelect(""); +},"form"]; +this.editor.config.btnList.insert_rb_field=[this._lc("Insert a radio button."),[_6,5,0],false,function(){ +pasteAndSelect(""); +},"form"]; +this.editor.config.btnList.insert_button=[this._lc("Insert a submit/reset button."),[_6,6,0],false,function(){ +pasteAndSelect(""); +},"form"]; +} +FormOperations.prototype.onGenerate=function(){ +if(Xinha.is_gecko){ +var _9=this.editor; +var _a=this.editor._doc; +Xinha._addEvents(_a,["mousemove"],function(_b){ +return _9._editorEvent(_b); +}); +} +}; +FormOperations.prototype._preparePanel=function(){ +var fo=this; +if(this.html==false){ +Xinha._getback(Xinha.getPluginDir("FormOperations")+"/panel.html",function(_d){ +fo.html=_d; +fo._preparePanel(); +}); +return false; +} +if(typeof Xinha.Dialog=="undefined"){ +Xinha._loadback(_editor_url+"modules/Dialogs/inline-dialog.js",function(){ +fo._preparePanel(); +}); +return false; +} +if(typeof Xinha.PanelDialog=="undefined"){ +Xinha._loadback(_editor_url+"modules/Dialogs/panel-dialog.js",function(){ +fo._preparePanel(); +}); +return false; +} +this.panel=new Xinha.PanelDialog(this.editor,"bottom",this.html,"FormOperations"); +this.panel.hide(); +this.ready=true; +}; +FormOperations.prototype.onUpdateToolbar=function(){ +if(!this.ready){ +return true; +} +var _e=this.editor._activeElement(this.editor._getSelection()); +if(_e!=null){ +if(_e==this.activeElement){ +return true; +} +var _f=_e.tagName.toLowerCase(); +this.hideAll(); +if(_f==="form"){ +if(this.editor.config.FormOperations.allow_edit_form){ +this.showForm(_e); +}else{ +this.panel.hide(); +this.activeElement=null; +this.panel.hide(); +return true; +} +}else{ +if(this.editor.config.FormOperations.allow_edit_form&&typeof _e.form!="undefined"&&_e.form){ +this.showForm(_e.form); +} +switch(_f){ +case "form": +this.showForm(_e); +break; +case "input": +switch(_e.getAttribute("type").toLowerCase()){ +case "text": +case "password": +case "hidden": +this.showText(_e); +break; +case "radio": +case "checkbox": +this.showCbRd(_e); +break; +case "submit": +case "reset": +case "button": +this.showButton(_e); +break; +} +break; +case "textarea": +this.showTextarea(_e); +break; +case "select": +this.showSelect(_e); +break; +default: +this.activeElement=null; +this.panel.hide(); +return true; +} +} +this.panel.show(); +this.activeElement=_e; +return true; +}else{ +this.activeElement=null; +this.panel.hide(); +return true; +} +}; +FormOperations.prototype.hideAll=function(){ +this.panel.getElementById("fs_form").style.display="none"; +this.panel.getElementById("fs_text").style.display="none"; +this.panel.getElementById("fs_textarea").style.display="none"; +this.panel.getElementById("fs_select").style.display="none"; +this.panel.getElementById("fs_cbrd").style.display="none"; +this.panel.getElementById("fs_button").style.display="none"; +}; +FormOperations.prototype.showForm=function(_10){ +this.panel.getElementById("fs_form").style.display=""; +var _11={"action":_10.action,"method":_10.method.toUpperCase()}; +this.panel.setValues(_11); +var f=_10; +this.panel.getElementById("action").onkeyup=function(){ +f.action=this.value; +}; +this.panel.getElementById("method").onchange=function(){ +f.method=this.options[this.selectedIndex].value; +}; +}; +FormOperations.prototype.showText=function(_13){ +this.panel.getElementById("fs_text").style.display=""; +var _14={"text_name":this.deformatName(_13,_13.name),"text_value":_13.value,"text_type":_13.type.toLowerCase(),"text_width":_13.style.width?parseFloat(_13.style.width.replace(/[^0-9.]/,"")):"","text_width_units":_13.style.width?_13.style.width.replace(/[0-9.]/,"").toLowerCase():"ex","text_maxlength":_13.maxlength?_13.maxlength:""}; +this.panel.setValues(_14); +var i=_13; +var fo=this; +this.panel.getElementById("text_name").onkeyup=function(){ +i.name=fo.formatName(i,this.value); +}; +this.panel.getElementById("text_value").onkeyup=function(){ +i.value=this.value; +}; +this.panel.getElementById("text_type").onchange=function(){ +if(!Xinha.is_ie){ +i.type=this.options[this.selectedIndex].value; +}else{ +var _17=fo.editor._doc.createElement("div"); +if(!/type=/.test(i.outerHTML)){ +_17.innerHTML=i.outerHTML.replace(/0?_2f.size:1),"select_height_units":_2f.style.height?_2f.style.height.replace(/[0-9.]/,"").toLowerCase():"items"}; +this.panel.setValues(_30); +var i=_2f; +var fo=this; +this.panel.getElementById("select_name").onkeyup=function(){ +i.name=fo.formatName(i,this.value); +}; +this.panel.getElementById("select_multiple").onclick=function(){ +i.multiple=this.checked; +}; +var w=this.panel.getElementById("select_width"); +var wu=this.panel.getElementById("select_width_units"); +this.panel.getElementById("select_width").onkeyup=this.panel.getElementById("select_width_units").onchange=function(){ +if(!w.value||isNaN(parseFloat(w.value))){ +i.style.width=""; +} +i.style.width=parseFloat(w.value)+wu.options[wu.selectedIndex].value; +}; +var h=this.panel.getElementById("select_height"); +var hu=this.panel.getElementById("select_height_units"); +this.panel.getElementById("select_height").onkeyup=this.panel.getElementById("select_height_units").onchange=function(){ +if(!h.value||isNaN(parseFloat(h.value))){ +i.style.height=""; +return; +} +if(hu.selectedIndex==0){ +i.style.height=""; +i.size=parseInt(h.value); +}else{ +i.style.height=parseFloat(h.value)+hu.options[hu.selectedIndex].value; +} +}; +var _37=this.panel.getElementById("select_options"); +this.arrayToOpts(this.optsToArray(_2f.options),_37.options); +this.panel.getElementById("add_option").onclick=function(){ +var txt=prompt(Xinha._lc("Enter the name for new option.","FormOperations")); +if(txt==null){ +return; +} +var _39=new Option(txt); +var _3a=fo.optsToArray(_37.options); +if(_37.selectedIndex>=0){ +_3a.splice(_37.selectedIndex,0,_39); +}else{ +_3a.push(_39); +} +fo.arrayToOpts(_3a,_2f.options); +fo.arrayToOpts(_3a,_37.options); +}; +this.panel.getElementById("del_option").onclick=function(){ +var _3b=fo.optsToArray(_37.options); +var _3c=[]; +for(var i=0;i<_3b.length;i++){ +if(_3b[i].selected){ +continue; +} +_3c.push(_3b[i]); +} +fo.arrayToOpts(_3c,_2f.options); +fo.arrayToOpts(_3c,_37.options); +}; +this.panel.getElementById("up_option").onclick=function(){ +if(!(_37.selectedIndex>0)){ +return; +} +var _3e=fo.optsToArray(_37.options); +var _3f=_3e.splice(_37.selectedIndex,1).pop(); +_3e.splice(_37.selectedIndex-1,0,_3f); +fo.arrayToOpts(_3e,_2f.options); +fo.arrayToOpts(_3e,_37.options); +}; +this.panel.getElementById("down_option").onclick=function(){ +if(_37.selectedIndex==_37.options.length-1){ +return; +} +var _40=fo.optsToArray(_37.options); +var _41=_40.splice(_37.selectedIndex,1).pop(); +_40.splice(_37.selectedIndex+1,0,_41); +fo.arrayToOpts(_40,_2f.options); +fo.arrayToOpts(_40,_37.options); +}; +this.panel.getElementById("select_options").onchange=function(){ +fo.arrayToOpts(fo.optsToArray(_37.options),_2f.options); +}; +}; +FormOperations.prototype.optsToArray=function(o){ +var a=[]; +for(var i=0;i=0;i--){ +o[i]=null; +} +for(var i=0;i'; + + $emailfield = NULL; + $subjectfield = NULL; + $namefield = NULL; + + $when_done_goto = isset($_REQUEST['when_done_goto']) ? $_REQUEST['when_done_goto'] : NULL; + + if($_POST) + { + unset($_POST['when_done_goto']); + $message = ''; + $longestKey = 0; + foreach(array_keys($_POST) as $key) + { + $longestKey = max(strlen($key), $longestKey); + } + $longestKey = max($longestKey, 15); + + foreach($_POST as $Var => $Val) + { + if(!$emailfield) + { + if(preg_match('/(^|\s)e-?mail(\s|$)/i', $Var)) + { + $emailfield = $Var; + } + } + + if(!$subjectfield) + { + if(preg_match('/(^|\s)subject(\s|$)/i', $Var)) + { + $subjectfield = $Var; + } + } + + if(!$namefield) + { + if(preg_match('/(^|\s)from(\s|$)/i', $Var) || preg_match('/(^|\s)name(\s|$)/i', $Var)) + { + $namefield = $Var; + } + } + + if(is_array($Val)) + { + $Val = implode(', ', $Val); + } + + $message .= $Var; + if(strlen($Var) < $longestKey) + { + $message .= str_repeat('.', $longestKey - strlen($Var)); + } + $message .= ':'; + if((64 - max(strlen($Var), $longestKey) < strlen($Val)) || preg_match('/\r?\n/', $Val)) + { + $message .= "\r\n "; + $message .= preg_replace('/\r?\n/', "\r\n ", wordwrap($Val, 62)); + } + else + { + $message .= ' ' . $Val . "\r\n"; + } + } + + $subject = $subjectfield ? $_POST[$subjectfield] : 'Enquiry'; + $email = $emailfield ? $_POST[$emailfield] : $send_to; + if($namefield) + { + $from = $_POST[$namefield] . ' <' . $email . '>'; + } + else + { + $from = 'Website Visitor' . ' <' . $email . '>'; + } + + mail($send_to, $subject, $message, "From: $from"); + + if(!$when_done_goto) + { + ?> + Message Sent

    Message Sent

    + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/iframe.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/iframe.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/iframe.css 3 Jan 2016 20:48:13 -0000 1.1.2.1 @@ -0,0 +1 @@ +form { border: 1px red dotted; } \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/panel.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/panel.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/panel.html 3 Jan 2016 20:48:13 -0000 1.1.2.1 @@ -0,0 +1,213 @@ +
    +

    Form Editor

    +
    + Form + + + + + + + + +
    +
    + +
    + Text Field + + + + + + + + + + + + + + + + + + + + +
    Name: + +   
    Type: + + Initial Value: + +
    Width: + + + Max Length: + +
    +
    + +
    + Check Box/Radio Button + + + + + + + + + + + + + + + + +
    Name: + + Value: + +
    Type: + + Selected by default:
    +

    + Tip: Check boxes (select many) and radio buttons (select one only) that are choices for a single question should have the same Name to work correctly. +

    +
    +
    + +
    + Button + + + + + + + + + + + + + +
    Name: + + Label: + +
    Type: + +   
    +
    + + +
    + Multi-line Field + + + + + + + + + + + + + + + + + + + +
    Name:Initial Value
    Width: + + +
    Height: + + +
    +
    + +
    + Drop-Down/List Field + + + + + + + + + + + + + + + + + + + + + +
    Name: + + Options
    May Choose Multiple: + + + + + +
    + +
    + +
    + +
    Width: + + +
    Height: + + +
    +
    +
    \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/img/buttons.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/img/buttons.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/de.js 3 Jan 2016 20:48:14 -0000 1.1.2.1 @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// translated: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "Insert a Form.": "Email Form einfügen.", + "Insert a text, password or hidden field.": "Passwort oder unsichtbares Feld einfügen.", + "Insert a multi-line text field.": "Mehrzeiliges Textfeld einfügen.", + "Insert a select field.": "Auswahlfeld einfügen.", + "Insert a check box.": "Häkchenfeld einfügen", + "Insert a radio button.": "Optionsfeld einfügen", + "Insert a submit/reset button.": "Senden/zurücksetzen Schaltfläche" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/fr.js 3 Jan 2016 20:48:14 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Insert a Form.": "Insérer un formulaire", + "Insert a text, password or hidden field.": "Insérer un texte, un mot de passe ou un champ invisible", + "Insert a multi-line text field.": "Insérer un champ texte à lignes multiples", + "Insert a select field.": "Insérer une boite de sélection", + "Insert a check box.": "Insérer une case à cocher", + "Insert a radio button.": "Insérer un bouton radio", + "Insert a submit/reset button.": "Insérer un bouton de soumission/annulation" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/ja.js 3 Jan 2016 20:48:15 -0000 1.1.2.1 @@ -0,0 +1,51 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Insert a Form.": "フォームを挿入", + "Insert a text, password or hidden field.": "テキスト/パスワード/非表示フィールドを挿入", + "Insert a multi-line text field.": "複数行テキストフィールドを挿入", + "Insert a select field.": "選択リストを挿入", + "Insert a check box.": "チェックボックスを挿入", + "Insert a radio button.": "ラジオボタンを挿入", + "Insert a submit/reset button.": "送信/リセットボタンを挿入", + "Form Editor": "フォームエディタ", + "Form": "フォーム", + "Text Field": "テキストフィールド", + "Check Box/Radio Button": "チェックボックス/ラジオボタン", + "Button": "ボタン", + "Multi-line Field": "複数行フィールド", + "Drop-Down/List Field": "ドロップダウン/リスト", + "Action:": "アクション:", + "Method:": "メソッド:", + "Name:": "名前:", + "Type:": "タイプ:", + "Label:": "ラベル:", + "Value:": "値:", + "Width:": "幅:", + "Height:": "高さ:", + "Initial Value:": "初期値:", + "Initial Value": "初期値", + "Max Length:": "最大長:", + "Selected by default:": "デフォルト選択:", + "May Choose Multiple:": "複数選択可能:", + "Options": "選択肢", + "POST": "POST", + "GET": "GET", + 'Check Box ("Select Many")': "チェックボックス(複数選択)", + 'Radio Button ("Select One")': "ラジオボタン(単一選択)", + "normal text field": "標準テキストフィールド", + "password": "パスワード", + "hidden field": "非表示フィールド", + "Submit": "送信", + "Reset": "リセット", + "chars": "文字", + "px": "ピクセル", + "%": "%", + "items": "項目", + "Add": "追加", + "Delete": "削除", + "Move Up": "上へ", + "Move Down": "下へ", + "Tip: Check boxes (select many) and radio buttons (select one only) that are choices for a single question should have the same Name to work correctly.": "ヒント:ひとつの質問について、複数のチェックボックス(複数選択)、または複数のラジオボタン(単一選択)がある場合、すべてに同じ名前を付けなければ正しく機能しません。", + "Enter the name for new option.": "新しい選択肢に名前をつけてください。" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/nb.js 3 Jan 2016 20:48:15 -0000 1.1.2.1 @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Insert a Form.": "Sett inn skjema", + "Insert a text, password or hidden field.": "Sett inn formfelt", + "Insert a multi-line text field.": "Sett inn tekstfelt med flere linjer", + "Insert a select field.": "Sett inn valgboks/ netrekksboks", + "Insert a check box.": "Hakeboks", + "Insert a radio button.": "Sett inn en radioknapp", + "Insert a submit/reset button.": "Sett inn send-/nullstill knapp for skjemaet" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/nl.js 3 Jan 2016 20:48:15 -0000 1.1.2.1 @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Insert a Form.": "Formulier invoegen", + "Insert a text, password or hidden field.": "Tekst, wachtwoord of verborgen veld invoegen", + "Insert a multi-line text field.": "Een tekstveld met meerdere lijnen invoegen", + "Insert a select field.": "Een selectielijst invoegen", + "Insert a check box.": "Een checkbox invoegen", + "Insert a radio button.": "Een radio knop invoegen", + "Insert a submit/reset button.": "Een verzend/wis knop invoegen" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/no.js 3 Jan 2016 20:48:15 -0000 1.1.2.1 @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Insert a Form.": "Sett inn skjema", + "Insert a text, password or hidden field.": "Sett inn formfelt", + "Insert a multi-line text field.": "Sett inn tekstfelt med flere linjer", + "Insert a select field.": "Sett inn valgboks/ netrekksboks", + "Insert a check box.": "Hakeboks", + "Insert a radio button.": "Sett inn en radioknapp", + "Insert a submit/reset button.": "Sett inn send-/nullstill knapp for skjemaet" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FormOperations/lang/pt_br.js 3 Jan 2016 20:48:15 -0000 1.1.2.1 @@ -0,0 +1,26 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Enter the name for new option.": "Entre com o nome para nova opção", + "Form Editor": "Editor de Formulários", + "Insert a Form.": "Inserir um Formulário.", + "Insert a check box.": "Inserir uma caixa de opção", + "Insert a multi-line text field.": "Inserir um texto multi-linha.", + "Insert a radio button.": "Inserir um campo de escolha", + "Insert a select field.": "Inserir seleção.", + "Insert a submit/reset button.": "Inserir um botão de envio/reset", + "Insert a text, password or hidden field.": "Inserir um texto, senha ou campo escondido." +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/Forms.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/Forms.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/Forms.js 3 Jan 2016 20:48:16 -0000 1.1.2.1 @@ -0,0 +1,353 @@ +// Form plugin for Xinha +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + + +function Forms(editor) { + this.editor = editor; + var cfg = editor.config; + var bl = Forms.btnList; + var self = this; + // register the toolbar buttons provided by this plugin + var toolbar = ["linebreak"]; + for (var i = 0; i < bl.length; ++i) { + var btn = bl[i]; + if (!btn) { + toolbar.push("separator"); + } else { + var id = btn[0]; + if (i<3) + cfg.registerButton(id, this._lc(btn[1]), editor.imgURL("ed_" + btn[0] + ".gif", "Forms"), false, + function(editor, id) { + // dispatch button press event + self.buttonPress(editor, id); + }); + else + cfg.registerButton(id, this._lc(btn[1]), editor.imgURL("ed_" + btn[0] + ".gif", "Forms"), false, + function(editor, id) { + // dispatch button press event + self.buttonPress(editor, id); + },"form"); + toolbar.push(id); + } + } + // add a new line in the toolbar + cfg.toolbar.push(toolbar); +} + +Forms._pluginInfo = { + name : "Forms", + origin : "version: 1.0, by Nelson Bright, BrightWork, Inc., http://www.brightworkweb.com", + version : "2.0", + developer : "Udo Schmal", + developer_url : "", + sponsor : "L.N.Schaffrath NeueMedien", + sponsor_url : "http://www.schaffrath-neuemedien.de/", + c_owner : "Udo Schmal & Schaffrath-NeueMedien", + license : "htmlArea" +}; + +// the list of buttons added by this plugin +Forms.btnList = [ + // form properties button + null, // separator + ["form", "Form"], + null, // separator + // form elements + ["textarea", "Textarea"], + ["select", "Selection Field"], + ["checkbox", "Checkbox"], + ["radio", "Radio Button"], + ["text", "Text Field"], + ["password", "Password Field"], + ["file", "File Field"], + ["button", "Button"], + ["submit", "Submit Button"], + ["reset", "Reset Button"], + ["image", "Image Button"], + ["hidden", "Hidden Field"], + ["label", "Label"], + ["fieldset", "Field Set"] + ]; + +Forms.prototype._lc = function(string) { + return Xinha._lc(string, 'Forms'); +}; + +Forms.prototype.onGenerate = function() { + this.editor.addEditorStylesheet(Xinha.getPluginDir("Forms") + '/forms.css'); +}; + +Forms.prototype.buttonPress = function(editor,button_id, node) { + function optionValues(text,value) { + this.text = text; + this.value = value; + } + var outparam = new Object(); + var type = button_id; + var sel = editor._getSelection(); + var range = editor._createRange(sel); + if (button_id=="form") { //Form + // see if selection is inside an existing 'form' tag + var pe = editor.getParentElement(); + var frm = null; + while (pe && (pe.nodeType == 1) && (pe.tagName.toLowerCase() != 'body')) { + if(pe.tagName.toLowerCase() == "form") { + frm = pe; + break; + } else + pe = pe.parentNode; + } + if (frm) { + outparam.f_name = frm.name; + outparam.f_action = frm.action; + outparam.f_method = frm.method; + outparam.f_enctype = frm.enctype; + outparam.f_target = frm.target; + } else {; + outparam.f_name = ""; + outparam.f_action = ""; + outparam.f_method = ""; + outparam.f_enctype = ""; + outparam.f_target = ""; + } + editor._popupDialog("plugin://Forms/form", function(param) { + if (param) { + if(frm) { + frm.name = param["f_name"]; + frm.setAttribute("action", param["f_action"]); + frm.setAttribute("method", param["f_method"]); + frm.setAttribute("enctype",param["f_enctype"]); + frm.setAttribute("target", param["f_target"]); + } else { + frm = '
    '); + } + } + }, outparam); + + } else { // form element (checkbox, radio, text, password, textarea, select, button, submit, reset, image, hidden) + var tagName = ""; + // see if selection is an form element + if (typeof node == "undefined") { + node = editor.getParentElement(); + var tag = node.tagName.toLowerCase() + if (node && (tag == "legend")) { + node = node.parentElement; + tag = node.tagName.toLowerCase(); + } + if (node && !(tag == "textarea" || tag == "select" || tag == "input" || tag == "label" || tag == "fieldset")) + node = null; + } + + if(node) { + type = node.tagName.toLowerCase(); + outparam.f_name = node.name; + tagName = node.tagName; + if (type == "input") { + outparam.f_type = node.type; + type = node.type; + } + switch (type) { + case "textarea": + outparam.f_cols = node.cols; + outparam.f_rows = node.rows; + outparam.f_text = node.innerHTML; + outparam.f_wrap = node.getAttribute("wrap"); + outparam.f_readOnly = node.getAttribute("readOnly"); + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "select": + outparam.f_size = parseInt(node.size); + outparam.f_multiple = node.getAttribute("multiple"); + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + var a_options = new Array(); + for (var i=0; i<=node.options.length-1; i++) { + a_options[i] = new optionValues(node.options[i].text, node.options[i].value); + } + outparam.f_options = a_options; + break; + case "text": + case "password": + outparam.f_value = node.value; + outparam.f_size = node.size; + outparam.f_maxLength = node.maxLength; + outparam.f_readOnly = node.getAttribute("readOnly"); + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "hidden": + outparam.f_value = node.value; + break; + case "submit": + case "reset": + outparam.f_value = node.value; + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "checkbox": + case "radio": + outparam.f_value = node.value; + outparam.f_checked = node.checked; + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "button": + outparam.f_value = node.value; + outparam.f_onclick = node.getAttribute("onclick"); + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "image": + outparam.f_value = node.value; + outparam.f_src = node.src; + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "file": + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "label": + outparam.f_text = node.innerHTML; + outparam.f_for = node.getAttribute("for"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "fieldset": + if(node.firstChild.tagName.toLowerCase()=="legend") + outparam.f_text = node.firstChild.innerHTML; + else + outparam.f_text = ""; + break; + } + } else { + outparam.f_name = ""; + switch (button_id) { + case "textarea": + case "select": + case "label": + case "fieldset": + tagName = button_id; + break; + default: + tagName = "input"; + outparam.f_type = button_id; + break; + } + outparam.f_options = ""; + outparam.f_cols = "20"; + outparam.f_rows = "4"; + outparam.f_multiple = "false"; + outparam.f_value = ""; + outparam.f_size = ""; + outparam.f_maxLength = ""; + outparam.f_checked = ""; + outparam.f_src = ""; + outparam.f_onclick = ""; + outparam.f_wrap = ""; + outparam.f_readOnly = "false"; + outparam.f_disabled = "false"; + outparam.f_tabindex = ""; + outparam.f_accesskey = ""; + outparam.f_for = ""; + outparam.f_text = ""; + outparam.f_legend = ""; + } + editor._popupDialog("plugin://Forms/" + tagName + ".html", function(param) { + if (param) { + if(param["f_cols"]) + if (isNaN(parseInt(param["f_cols"],10)) || parseInt(param["f_cols"],10) <= 0) + param["f_cols"] = ""; + if(param["f_rows"]) + if(isNaN(parseInt(param["f_rows"],10)) || parseInt(param["f_rows"],10) <= 0) + param["f_rows"] = ""; + if(param["f_size"]) + if(isNaN(parseInt(param["f_size"],10)) || parseInt(param["f_size"],10) <= 0) + param["f_size"] = ""; + if(param["f_maxlength"]) + if(isNaN(parseInt(param["f_maxLength"],10)) || parseInt(param["f_maxLength"],10) <= 0) + param["f_maxLength"] = ""; + if(node) { + //prepare existing Element + for (field in param) { + //alert(field.substring(2,20) + '=' + param[field]); //to be silent! by htanaka + if ((field=="f_text") || (field=="f_options") || (field=="f_onclick") || (field=="f_checked"))continue; + if (param[field] != "") + node.setAttribute(field.substring(2,20), param[field]); + else + node.removeAttribute(field.substring(2,20)); + } + if (type == "textarea") { + node.innerHTML = param["f_text"]; + } else if(type == "select") { + node.options.length = 0; + var optionsList = param["f_options"]; + for (i=0; i<= optionsList.length-1; i++) { + node.options[i] = new Option(optionsList[i].text, optionsList[i].value) + } + } else if(type == "label") { + node.innerHTML = param["f_text"]; + } else if(type == "fieldset") { + if(outparam.f_text != "") { + if(node.firstChild.tagName.toLowerCase()=="legend") + node.firstChild.innerHTML = param["f_text"]; + } else {}// not implemented jet + } else if((type == "checkbox") || (type == "radio")) { //input + if(param["f_checked"]!="") + node.checked = true; + else + node.checked = false; + } else { + if(param["f_onclick"]){ + node.onclick = ""; + if(param["f_onclick"]!="") + node.onclick = param["f_onclick"]; + } + } + } else { + //create Element + var text = ""; + for (field in param) { + if (!param[field]) continue; + if ((param[field]=="") || (field=="f_text")|| (field=="f_options"))continue; + text += " " + field.substring(2,20) + '="' + param[field] + '"'; + } + + if(type == "textarea") { + text = '' + param["f_text"] + ''; + } else if(type == "select") { + text = ''; + var optionsList = param["f_options"]; + for (i=0; i<= optionsList.length-1; i++) { + text += ''; + } + text += ''; + } else if(type == "label") { + text = '' + param["f_text"] + ''; + } else if(type == "fieldset") { + text = ''; + if (param["f_legend"] != "") text += '' + param["f_text"] + ''; + text += ''; + } else { + text = ''; + } + editor.insertHTML(text); + } + } + }, outparam); + } +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/forms.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/forms.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/forms.css 3 Jan 2016 20:48:16 -0000 1.1.2.1 @@ -0,0 +1,3 @@ +form { + border: 1px dotted red; +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_button.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_button.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_checkbox.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_checkbox.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_fieldset.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_fieldset.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_file.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_file.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_form.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_form.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_hidden.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_hidden.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_image.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_image.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_label.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_label.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_password.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_password.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_radio.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_radio.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_reset.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_reset.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_select.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_select.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_submit.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_submit.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_text.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_text.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_textarea.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/img/ed_textarea.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/lang/ja.js 3 Jan 2016 20:48:19 -0000 1.1.2.1 @@ -0,0 +1,86 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Form": "フォーム", + "Textarea": "テキストエリア", + "Selection Field": "選択肢フィールド", + "Checkbox": "チェックボックス", + "Radio Button": "ラジオボタン", + "Text Field": "テキストフィールド", + "Password Field": "パスワードフィールド", + "File Field": "ファイルフィールド", + "Submit Button": "送信ボタン", + "Reset Button": "リセットボタン", + "Image Button": "画像ボタン", + "Button": "ボタン", + "Hidden Field": "非表示フィールド", + "Label": "ラベル", + "Field Set": "フィールドセット", + "Form Element: INPUT": "フォーム要素: INPUT", + "Form Element: SELECT": "フォーム要素: SELECT", + "Form Element: TEXTAREA": "フォーム要素: TEXTAREA", + "Form Element: LABEL": "フォーム要素: LABEL", + "Form Element: FIELDSET": "フォーム要素: FIELDSET", + "Form Name:": "フォーム名:", + "Form handler script": "フォーム処理スクリプト", + "Action URL:": "アクションURL:", + "Method:": "メソッド:", + "Post": "POST", + "Get": "GET", + "Encoding:": "エンコード:", + "HTML-Form to CGI (default)": "HTMLフォームからCGIへ(デフォルト)", + "multipart Form Data (File-Upload)": "マルチパート(ファイルアップロード用)", + "Target Frame:": "ターゲット:", + "Name/ID:": "名前/ID:", + "Value:": "値:", + "Disabled": "無効", + "Checked": "チェック済み", + "Tab Index:": "タブ順序:", + "Access Key:": "アクセスキー:", + "Read Only": "読み取り専用", + "Dimensions": "大きさ", + "Size:": "サイズ:", + "Max length:": "最大長:", + "Button Script": "ボタンスクリプト", + "'onClick'=": "'onClick'=", + "Image source": "画像ソース", + "Image URL:": "画像URL:", + "Multiple Select": "複数選択", + "Options": "選択肢", + "Lable:": "ラベル:", + "Move Up": "上へ", + "Move Down": "下へ", + "Delete": "削除", + "Add": "追加", + "Columns:": "列数:", + "Rows:": "行数:", + "Wrap Mode:": "折り返し:", + "Off": "オフ", + "Soft": "ソフト", + "Hard": "ハード", + "Physical": "物理的", + "Virtual": "仮想", + "normal": "標準", + "nowrap": "折り返しなし", + "pre": "フォーマット済み", + "Initial Text:": "初期テキスト:", + "Text:": "テキスト:", + "For Control:": "制御対象:", + "Legend:": "グループ名:", + "Cancel": "中止", + "Name": "名前", + "Name of the form input": "フォーム入力の名前", + "Value of the form input": "フォーム入力の値", + "Size of text box in characters": "文字数によるテキストボックスの大きさ", + "Maximum number of characters accepted": "入力可能な最大文字数", + "Javascript for button click": "ボタンクリック時のJavaScritp", + "URL of image": "画像のURL", + "Name of the form select": "", + "name of the textarea": "テキストエリアの名前", + "Width in number of characters": "文字数による幅", + "Height in number of rows": "行数による高さ", + "Default text (optional)": "テキスト初期値(オプション)", + "You must enter the form name": "フォーム名が必要です", + "You must enter a Name": "名前が必要です", + "Please enter a Label": "ラベルを入力してください" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/lang/nl.js 3 Jan 2016 20:48:19 -0000 1.1.2.1 @@ -0,0 +1,87 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Form": "Formulier", + "Textarea": "Tekstgebied", + "Selection Field": "Selectielijst", + "Checkbox": "Checkbox", + "Radio Button": "Radio knop", + "Text Field": "Tekstveld", + "Password Field": "Wachtwoordveld", + "File Field": "Bestandsveld", + "Submit Button": "Verzend knop", + "Reset Button": "Wis knop", + "Image Button": "Afbeelding knop", + "Button": "Knop", + "Hidden Field": "Verborgen veld", + "Label": "Label", + "Field Set": "Veldset", + "Form Element: INPUT": "Formulier element: INPUT", + "Form Element: SELECT": "Formulier element: SELECT", + "Form Element: TEXTAREA": "Formulier element: TEXTAREA", + "Form Element: LABEL": "Formulier element: LABEL", + "Form Element: FIELDSET": "Formulier element: FIELDSET", + "Form Name:": "Formulier naame:", + "Form handler script": "Formulier script", + "Action URL:": "Actie URL:", + "Method:": "Methode:", + "Post": "POST", + "Get": "GET", + "Encoding:": "Encodering:", + "HTML-Form to CGI (default)": "HTML formulier naar CGI (standaard)", + "multipart Form Data (File-Upload)": "Multipart formulier data(Bestands upload)", + "Target Frame:": "Doel venster:", + "Name/ID:": "Naam/ID:", + "Value:": "Waarde:", + "Disabled": "Uitgeschakeld", + "Checked": "Checked", + "Tab Index:": "Tab volgorde:", + "Access Key:": "Toegangs toets:", + "Read Only": "Alleen lezen", + "Dimensions": "Dimenties", + "Size:": "Grootte:", + "Max length:": "Maximale lengte:", + "Button Script": "Knop script", + "'onClick'=": "'onClick'=", + "Image source": "Afbeelding bron", + "Image URL:": "Afbeelding URL:", + "Multiple Select": "Meerdere selectie mogelijkheden", + "Options": "Opties", + "Lable:": "Label:", + "Move Up": "Omhoog", + "Move Down": "Omlaag", + "Delete": "Verwijderen", + "Add": "Toevoegen", + "Columns:": "Kolommen:", + "Rows:": "Rijen:", + "Wrap Mode:": "Terugloop:", + "Off": "Uit", + "Soft": "Zacht", + "Hard": "Hard", + "Physical": "Fysiek", + "Virtual": "Virtueel", + "normal": "normaal", + "nowrap": "geen terugloop", + "pre": "pre", + "Initial Text:": "Start tekst:", + "Text:": "Tekst:", + "For Control:": "Voor controle:", + "Legend:": "Legend:", + "Cancel": "Annuleren", + "Name": "Naame", + "Name of the form input": "Naam van formulier invoer", + "Value of the form input": "Waarde van formulier invoer", + "Size of text box in characters": "Grootte van tekstveld in tekens", + "Maximum number of characters accepted": "Maximaal aantal tekens toegestaan", + "Javascript for button click": "Knop klik met JavaScript", + "URL of image": "Afbeelding URL", + "Name of the form select": "Naam van formulier select", + "name of the textarea": "Naam van tekst gebied", + "Width in number of characters": "Breedte in aantal tekens", + "Height in number of rows": "Hoogte in aantal tekens", + "Default text (optional)": "Standaard tekst (optioneel)", + "You must enter the form name": "Voer een formulier Naam in", + "You must enter a Name": "Voer een Naam in", + "Please enter a Label": "Voer een Label in" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/lang/pt_br.js 3 Jan 2016 20:48:19 -0000 1.1.2.1 @@ -0,0 +1,83 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Access Key:": "Tecla de Acesso:", + "Action URL:": "Ação - URL:", + "Button Script": "Script de Botão", + "Cancel": "Cancelar", + "Checked": "Definido", + "Columns:": "Colunas:", + "Default text (optional)": "Texto padrão (opcional)", + "Dimensions": "Dimensões", + "Disabled": "Desativado", + "Encoding:": "Codificação:", + "For Control:": "Para Controle:", + "Form": "Formulário", + "Form Element: FIELDSET": "Elemento do formulário: FIELDSET", + "Form Element: INPUT": "Elemento do formulário: INPUT", + "Form Element: LABEL": "Elemento do formulário: LABEL", + "Form Element: SELECT": "Elemento do formulário: SELECT", + "Form Element: TEXTAREA": "Elemento do formulário: TEXTAREA", + "Form Name:": "Nome do Formulário:", + "Form handler script": "Script do Formulário", + "HTML-Form to CGI (default)": "Formulário para CGI (padrão)", + "Hard": "Difícil", + "Height in number of rows": "Altura em número de linhas", + "Image URL:": "URL da imagem:", + "Image source": "Imagem de Origem", + "Initial Text:": "Texto Inicial:", + "Insert/Edit Form": "Inserir/Editar Formulário", + "Insert/Edit Form Element FIELDSET": "Inserir/Editar Elemento FIELDSET", + "Insert/Edit Form Element INPUT": "Inserir/Editar Elemento INPUT", + "Insert/Edit Form Element LABEL": "Inserir/Editar Elemento LABEL", + "Insert/Edit Form Element SELECT": "Inserir/Editar Elemento SELECT", + "Insert/Edit Form Element TEXTAREA": "Inserir/Editar Elemento TEXTAREA", + "Javascript for button click": "Javascript para botão de clicar", + "Label:": "Etiqueta:", + "Legend:": "Legenda:", + "Max length:": "Comprimento Máx.:", + "Maximum number of characters accepted": "Máximo número de caracteres aceitos", + "Method:": "Método:", + "Name": "Nome", + "Name of the form input": "Nome do formulário de entrada", + "Name of the form select": "Nome do formulário de seleção", + "Name/ID:": "Nome/ID:", + "OK": "OK", + "Off": "Desligado", + "Options": "Opções", + "Physical": "Físico", + "Please enter a Label": "Por favor, entre uma Etiqueta", + "Post": "Post", + "Read Only": "Somente Leitura", + "Rows:": "Linhas:", + "Size of text box in characters": "Tamanho da caixa de texto em caracteres", + "Size:": "Tamanho:", + "Soft": "Fácil", + "Tab Index:": "Ordem de Tabulação:", + "Target Frame:": "Frame de destino:", + "Text:": "Texto:", + "URL of image": "URL da imagem", + "Value of the form input": "Valor do formulário de entrada", + "Value:": "Valor:", + "Virtual": "Virtual", + "Width in number of characters": "Largura em número de caracteres", + "Wrap Mode:": "Modo de quebras:", + "You must enter a Name": "Você precisa entrar com um Nome", + "multipart Form Data (File-Upload)": "Formulário de dados multipart (Enviar arquivo)", + "name of the textarea": "nome da área de texto", + "normal": "normal", + "nowrap": "sem quebras" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/fieldset.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/fieldset.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/fieldset.html 3 Jan 2016 20:48:20 -0000 1.1.2.1 @@ -0,0 +1,45 @@ + + + + Insert/Edit Form Element FIELDSET + + + + + + + +
    Form Element: FIELDSET
    + +
    Legend:
    + +

    +

    + + +
    + + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/form.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/form.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/form.html 3 Jan 2016 20:48:20 -0000 1.1.2.1 @@ -0,0 +1,89 @@ + + + + Insert/Edit Form + + + + + + + +
    Form
    +
    +
    Form Name:
    + +

    + +

    + Form handler script +
    +
    Action URL:
    + +

    +

    Method:
    + +
    +
    Encoding:
    + +

    +

    Target Frame:
    + +

    +

    + +
    + + +
    +
    + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/input.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/input.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/input.html 3 Jan 2016 20:48:20 -0000 1.1.2.1 @@ -0,0 +1,179 @@ + + + + Insert/Edit Form Element INPUT + + + + + + + + +
    +
    +
    Name/ID:
    + +

    +

    Value:
    + +

    +

    Disabled
    + +

    + +

    +
    Checked
    + +

    +

    + +
    Tab Index:
    + +

    +

    Access Key:
    + +

    + +

    +
    Read Only
    + +

    + +

    + Dimensions +
    +
    Size:
    + +
    +
    Max length:
    + +
    +
    +
    +
    +
    + Button Script +
    +
    'onClick'=
    + +
    +
    +
    +
    +
    + Image source +
    +
    Image URL:
    + +
    +
    +
    +
    + + +
    +
    + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/label.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/label.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/label.html 3 Jan 2016 20:48:21 -0000 1.1.2.1 @@ -0,0 +1,58 @@ + + + + Insert/Edit Form Element LABEL + + + + + + + +
    Form Element: LABEL
    +
    +
    Text:
    + +

    +

    For Control:
    + +

    +

    Access Key:
    + +

    +

    + + +
    +
    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/select.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/select.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/select.html 3 Jan 2016 20:48:21 -0000 1.1.2.1 @@ -0,0 +1,208 @@ + + + + Insert/Edit Form Element SELECT + + + + + + + +
    Form Element: SELECT
    +
    +
    Name/ID:
    + +

    +

    Size:
    + +

    +

    Multiple Select
    + +

    +

    Disabled
    + +

    +

    Tab Index:
    + +

    +

    +
    + Options + + + + + +
    + + +
    +
    + +
    +
    + + + + + + + + +
    Label:Value:
    +
    +
    + + +
    +
    + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/textarea.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/textarea.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Forms/popups/textarea.html 3 Jan 2016 20:48:21 -0000 1.1.2.1 @@ -0,0 +1,112 @@ + + + + Insert/Edit Form Element TEXTAREA + + + + + + + +
    Form Element: TEXTAREA
    +
    +
    Name/ID:
    + +

    +

    + Dimensions +
    Columns:
    + +

    +

    Rows:
    + +

    +

    +
    +
    Wrap Mode:
    + +

    +

    Read Only
    + +

    +

    Disabled
    + +

    +

    Tab Index:
    + +

    +

    Access Key:
    + +

    + +

    Initial Text:
    + +
    + + +
    +
    + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/FullPage.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/FullPage.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/FullPage.js 3 Jan 2016 20:48:21 -0000 1.1.2.1 @@ -0,0 +1,209 @@ +// FullPage Plugin for HTMLArea-3.0 +// Implementation by Mihai Bazon. Sponsored by http://thycotic.com +// +// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc. +// This notice MUST stay intact for use (see license.txt). +// +// A free WYSIWYG editor replacement for + +
    +
    Mihai Bazon
    + + +Last modified on Sat Oct 25 01:06:59 2003 + + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/img/docprop.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/img/docprop.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/de.js 3 Jan 2016 20:48:22 -0000 1.1.2.1 @@ -0,0 +1,18 @@ +// I18N for the FullPage plugin +// LANG: "de", ENCODING: UTF-8 +// Author: Holger Hees, http://www.systemconcept.de +{ + "Alternate style-sheet:": "Alternativer Stylesheet:", + "Background color:": "Hintergrundfarbe:", + "Cancel": "Abbrechen", + "DOCTYPE:": "DOCTYPE:", + "Document properties": "Dokumenteigenschaften", + "Document title:": "Dokumenttitel:", + "OK": "OK", + "Primary style-sheet:": "Stylesheet:", + "Text color:": "Textfarbe:", + "Character set:": "Zeichensatz", + "Description:": "Beschreibung", + "Keywords:": "Schlüsselworte", + "UTF-8 (recommended)": "UTF-8 (empfohlen)" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/fr.js 3 Jan 2016 20:48:22 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +// I18N for the FullPage plugin +// LANG: "fr", ENCODING: UTF-8 +{ + "Alternate style-sheet:": "Feuille CSS alternative", + "Background color:": "Couleur d'arrière plan", + "Cancel": "Annuler", + "DOCTYPE:": "DOCTYPE", + "Document properties": "Propriétés du document", + "Document title:": "Titre du document", + "OK": "OK", + "Primary style-sheet:": "Feuille CSS primaire", + "Text color:": "Couleur de texte", + "Character set:": "Jeu de caractères", + "Description:": "Description", + "Keywords:": "Mots clés", + "UTF-8 (recommended)": "UTF-8 (recommandé)" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/he.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/he.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/he.js 3 Jan 2016 20:48:23 -0000 1.1.2.1 @@ -0,0 +1,14 @@ +// I18N for the FullPage plugin +// LANG: "he", ENCODING: UTF-8 +// Author: Liron Newman, http://www.eesh.net, +{ + "Alternate style-sheet:": "גיליון סגנון אחר:", + "Background color:": "צבע רקע:", + "Cancel": "ביטול", + "DOCTYPE:": "DOCTYPE:", + "Document properties": "מאפייני מסמך", + "Document title:": "כותרת מסמך:", + "OK": "אישור", + "Primary style-sheet:": "גיליון סגנון ראשי:", + "Text color:": "צבע טקסט:" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/ja.js 3 Jan 2016 20:48:23 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Alternate style-sheet:": "代替スタイルシート:", + "Background color:": "背景色:", + "Cancel": "中止", + "DOCTYPE:": "DOCTYPE:", + "Document properties": "文書のプロパティ", + "Document title:": "文書の表題:", + "OK": "OK", + "Primary style-sheet:": "優先スタイルシート:", + "Text color:": "文字色:", + "Character set:": "文字セット:", + "Description:": "説明:", + "Keywords:": "キーワード:", + "UTF-8 (recommended)": "UTF-8 (推奨)" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/nb.js 3 Jan 2016 20:48:23 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Alternate style-sheet:": "Alternativt stilsett:", + "Background color:": "Bakgrunnsfarge:", + "Cancel": "Avbryt", + "DOCTYPE:": "DOCTYPE:", + "Keywords:": "Nøkkelord", + "Description:": "Beskrivelse", + "Character set:": "Tegnsett", + "Document properties": "Egenskaper for dokument", + "Document title:": "Tittel på dokument:", + "OK": "OK", + "Primary style-sheet:": "Stilsett:", + "Text color:": "Tekstfarge:" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/nl.js 3 Jan 2016 20:48:23 -0000 1.1.2.1 @@ -0,0 +1,13 @@ +// I18N for the FullPage plugin +// LANG: "nl", ENCODING: UTF-8 +{ + "Alternate style-sheet:": "Wisselen van style-sheet:", + "Background color:": "Achtergrondkleur:", + "Cancel": "Annuleren", + "DOCTYPE:": "DOCTYPE:", + "Document properties": "Documenteigenschappen", + "Document title:": "Documenttitel:", + "OK": "OK", + "Primary style-sheet:": "Primaire style-sheet:", + "Text color:": "Tekstkleur:" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/no.js 3 Jan 2016 20:48:23 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Alternate style-sheet:": "Alternativt stilsett:", + "Background color:": "Bakgrunnsfarge:", + "Cancel": "Avbryt", + "DOCTYPE:": "DOCTYPE:", + "Keywords:": "Nøkkelord", + "Description:": "Beskrivelse", + "Character set:": "Tegnsett", + "Document properties": "Egenskaper for dokument", + "Document title:": "Tittel på dokument:", + "OK": "OK", + "Primary style-sheet:": "Stilsett:", + "Text color:": "Tekstfarge:" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/pl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/pl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/pl.js 3 Jan 2016 20:48:24 -0000 1.1.2.1 @@ -0,0 +1,18 @@ +// I18N for the FullPage plugin +// LANG: "pl", ENCODING: UTF-8 +// translated: Krzysztof Kotowicz, koto1sa@o2.pl, http://www.eskot.krakow.pl/portfolio +{ + "Alternate style-sheet:": "Alternatywny arkusz stylów:", + "Background color:": "Kolor tła:", + "Cancel": "Anuluj", + "DOCTYPE:": "DOCTYPE:", + "Document properties": "Właściwości dokumentu", + "Document title:": "Tytuł dokumentu:", + "OK": "OK", + "Primary style-sheet:": "Arkusz stylów:", + "Text color:": "Kolor tekstu:", + "Character set:": "Zestaw znaków", + "Description:": "Opis", + "Keywords:": "Słowa kluczowe", + "UTF-8 (recommended)": "UTF-8 (zalecany)" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/pt_br.js 3 Jan 2016 20:48:24 -0000 1.1.2.1 @@ -0,0 +1,35 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Alternate style-sheet:": "Estilo alternativo:", + "Background color:": "Côr de Fundo:", + "Cancel": "Cancelar", + "Character set:": "Conjunto de Caracteres:", + "DOCTYPE:": "DOCTYPE:", + "Description:": "Descrição:", + "Document properties": "Propriedades do Documento", + "Document title:": "Título do Documento:", + "Keywords:": "Palavras chave:", + "OK": "OK", + "Primary style-sheet:": "Estilo Primário:", + "Test of FullPage plugin": "Teste do Plugin FullPage", + "Text color:": "Côr do Texto:", + "UTF-8 (recommended)": "UTF-8 (recomendado)", + "cyrillic (ISO-8859-5)": "Cirílico (ISO-8859-5)", + "cyrillic (KOI8-R)": "Cirílico (KOI8-R)", + "cyrillic (WINDOWS-1251)": "Círilico (WINDOWS-1251)", + "western (ISO-8859-1)": "Ocidental (ISO-8859-1)" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/ro.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/ro.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/lang/ro.js 3 Jan 2016 20:48:24 -0000 1.1.2.1 @@ -0,0 +1,14 @@ +// I18N for the FullPage plugin +// LANG: "en", ENCODING: UTF-8 +// Author: Mihai Bazon, http://dynarch.com/mishoo +{ + "Alternate style-sheet:": "Template CSS alternativ:", + "Background color:": "Culoare de fundal:", + "Cancel": "Renunţă", + "DOCTYPE:": "DOCTYPE:", + "Document properties": "Proprietăţile documentului", + "Document title:": "Titlul documentului:", + "OK": "Acceptă", + "Primary style-sheet:": "Template CSS principal:", + "Text color:": "Culoare text:" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/popups/docprop.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/popups/docprop.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullPage/popups/docprop.html 3 Jan 2016 20:48:25 -0000 1.1.2.1 @@ -0,0 +1,142 @@ + + +Document properties + + + + + + + + + +
    Document properties
    + +
    + + +
    +
    + + +
    +
    + + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + + +
    +
    + + + +
    + +
    + + + +
    + + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/full-screen.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/full-screen.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/full-screen.js 3 Jan 2016 20:48:25 -0000 1.1.2.1 @@ -0,0 +1,187 @@ +function FullScreen(editor, args) +{ + this.editor = editor; + editor._superclean_on = false; + cfg = editor.config; + + cfg.registerButton + ( 'fullscreen', + this._lc("Maximize/Minimize Editor"), + [_editor_url + cfg.imgURL + 'ed_buttons_main.gif',8,0], true, + function(e, objname, obj) + { + e._fullScreen(); + if(e._isFullScreen) + { + obj.swapImage([_editor_url + cfg.imgURL + 'ed_buttons_main.gif',9,0]); + } + else + { + obj.swapImage([_editor_url + cfg.imgURL + 'ed_buttons_main.gif',8,0]); + } + } + ); + + // See if we can find 'popupeditor' and replace it with fullscreen + cfg.addToolbarElement("fullscreen", "popupeditor", 0); +} + +FullScreen._pluginInfo = +{ + name : "FullScreen", + version : "1.0", + developer: "James Sleeman", + developer_url: "http://www.gogo.co.nz/", + c_owner : "Gogo Internet Services", + license : "htmlArea", + sponsor : "Gogo Internet Services", + sponsor_url : "http://www.gogo.co.nz/" +}; + +FullScreen.prototype._lc = function(string) { + return HTMLArea._lc(string, 'FullScreen'); +}; + +/** fullScreen makes an editor take up the full window space (and resizes when the browser is resized) + * the principle is the same as the "popupwindow" functionality in the original htmlArea, except + * this one doesn't popup a window (it just uses to positioning hackery) so it's much more reliable + * and much faster to switch between + */ + +HTMLArea.prototype._fullScreen = function() +{ + var e = this; + function sizeItUp() + { + if(!e._isFullScreen || e._sizing) return false; + e._sizing = true; + // Width & Height of window + var dim = HTMLArea.viewportSize(); + + e.sizeEditor(dim.x + 'px',dim.y + 'px',true,true); + e._sizing = false; + } + + function sizeItDown() + { + if(e._isFullScreen || e._sizing) return false; + e._sizing = true; + e.initSize(); + e._sizing = false; + } + + /** It's not possible to reliably get scroll events, particularly when we are hiding the scrollbars + * so we just reset the scroll ever so often while in fullscreen mode + */ + function resetScroll() + { + if(e._isFullScreen) + { + window.scroll(0,0); + window.setTimeout(resetScroll,150); + } + } + + if(typeof this._isFullScreen == 'undefined') + { + this._isFullScreen = false; + if(e.target != e._iframe) + { + HTMLArea._addEvent(window, 'resize', sizeItUp); + } + } + + // Gecko has a bug where if you change position/display on a + // designMode iframe that designMode dies. + if(HTMLArea.is_gecko) + { + this.deactivateEditor(); + } + + if(this._isFullScreen) + { + // Unmaximize + this._htmlArea.style.position = ''; + try + { + if(HTMLArea.is_ie) + { + var bod = document.getElementsByTagName('html'); + } + else + { + var bod = document.getElementsByTagName('body'); + } + bod[0].style.overflow=''; + } + catch(e) + { + // Nutthin + } + this._isFullScreen = false; + sizeItDown(); + + // Restore all ancestor positions + var ancestor = this._htmlArea; + while((ancestor = ancestor.parentNode) && ancestor.style) + { + ancestor.style.position = ancestor._xinha_fullScreenOldPosition; + ancestor._xinha_fullScreenOldPosition = null; + } + + window.scroll(this._unScroll.x, this._unScroll.y); + } + else + { + + // Get the current Scroll Positions + this._unScroll = + { + x:(window.pageXOffset)?(window.pageXOffset):(document.documentElement)?document.documentElement.scrollLeft:document.body.scrollLeft, + y:(window.pageYOffset)?(window.pageYOffset):(document.documentElement)?document.documentElement.scrollTop:document.body.scrollTop + }; + + + // Make all ancestors position = static + var ancestor = this._htmlArea; + while((ancestor = ancestor.parentNode) && ancestor.style) + { + ancestor._xinha_fullScreenOldPosition = ancestor.style.position; + ancestor.style.position = 'static'; + } + + // Maximize + window.scroll(0,0); + this._htmlArea.style.position = 'absolute'; + this._htmlArea.style.zIndex = 999; + this._htmlArea.style.left = 0; + this._htmlArea.style.top = 0; + this._isFullScreen = true; + resetScroll(); + + try + { + if(HTMLArea.is_ie) + { + var bod = document.getElementsByTagName('html'); + } + else + { + var bod = document.getElementsByTagName('body'); + } + bod[0].style.overflow='hidden'; + } + catch(e) + { + // Nutthin + } + + sizeItUp(); + } + + if(HTMLArea.is_gecko) + { + this.activateEditor(); + } + this.focusEditor(); +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/de.js 3 Jan 2016 20:48:25 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// translated: Raimund Meyer xinha@ray-of-light.org +{ + "Maximize/Minimize Editor": "Editor maximieren/verkleinern" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/fr.js 3 Jan 2016 20:48:25 -0000 1.1.2.1 @@ -0,0 +1,5 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Maximize/Minimize Editor": "Agrandir/Réduire l'éditeur" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/ja.js 3 Jan 2016 20:48:25 -0000 1.1.2.1 @@ -0,0 +1,5 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Maximize/Minimize Editor": "エディタの最大化/最小化" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/nb.js 3 Jan 2016 20:48:26 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Maximize/Minimize Editor": "Maksimer/Minimer WYSIWYG vindu" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/no.js 3 Jan 2016 20:48:26 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Maximize/Minimize Editor": "Maksimer/Minimer WYSIWYG vindu" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/pl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/pl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/pl.js 3 Jan 2016 20:48:26 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "pl", ENCODING: UTF-8 +// translated: Krzysztof Kotowicz, koto1sa@o2.pl, http://www.eskot.krakow.pl/portfolio +{ + "Maximize/Minimize Editor": "Maksymalizuj/minimalizuj edytor" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/pt_br.js 3 Jan 2016 20:48:27 -0000 1.1.2.1 @@ -0,0 +1,18 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Maximize/Minimize Editor": "Maximizar/Minimizar Editor" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/ru.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/ru.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/ru.js 3 Jan 2016 20:48:27 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "ru", ENCODING: UTF-8 +// Author: Andrei Blagorazumov, a@fnr.ru +{ + "Maximize/Minimize Editor": "Развернуть/Свернуть редактор" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/sv.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/sv.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/FullScreen/lang/sv.js 3 Jan 2016 20:48:27 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "sv" (Swedish), ENCODING: UTF-8 +// translated: Erik Dalén, +{ + "Maximize/Minimize Editor": "Maximera/Minimera WYSIWYG fönster" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/GenericPlugin/GenericPlugin.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/GenericPlugin/GenericPlugin.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/GenericPlugin/GenericPlugin.js 3 Jan 2016 20:48:27 -0000 1.1.2.1 @@ -0,0 +1,100 @@ +/*------------------------------------------*\ + GenericPlugin for Xinha + _______________________ + + Democase for plugin event handlers +\*------------------------------------------*/ + +GenericPlugin._pluginInfo = { + name : "GenericPlugin", + version : "1.0", + developer : "Xinha Developer Team", + developer_url : "http://xinha.org", + sponsor : "", + sponsor_url : "", + license : "htmlArea" +} +function GenericPlugin(editor) +{ + this.editor = editor; +} + +GenericPlugin.prototype.onGenerate = function () +{ + +} +GenericPlugin.prototype.onGenerateOnce = function () +{ + +} +GenericPlugin.prototype.inwardHtml = function(html) +{ + return html; +} +GenericPlugin.prototype.outwardHtml = function(html) +{ + return html; +} +GenericPlugin.prototype.onUpdateToolbar = function () +{ + return false; +} + +GenericPlugin.prototype.onExecCommand = function ( cmdID, UI, param ) +{ + return false; +} + +GenericPlugin.prototype.onKeyPress = function ( event ) +{ + return false; +} + +GenericPlugin.prototype.onMouseDown = function ( event ) +{ + return false; +} + +GenericPlugin.prototype.onBeforeSubmit = function () +{ + return false; +} + +GenericPlugin.prototype.onBeforeUnload = function () +{ + return false; +} + +GenericPlugin.prototype.onBeforeResize = function (width, height) +{ + return false; +} +GenericPlugin.prototype.onResize = function (width, height) +{ + return false; +} +/** + * + * @param {String} action one of 'add', 'remove', 'hide', 'show', 'multi_hide', 'multi_show' + * @param {DOMNode|Array} panel either the panel itself or an array like ['left','right','top','bottom'] + */ +GenericPlugin.prototype.onPanelChange = function (action, panel) +{ + return false; +} +/** + * + * @param {String} mode either 'textmode' or 'wysiwyg' + */ +GenericPlugin.prototype.onMode = function (mode) +{ + return false; +} +/** + * + * @param {String} mode either 'textmode' or 'wysiwyg' + */ +GenericPlugin.prototype.onBeforeMode = function (mode) +{ + return false; +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/GenericPlugin/generic-plugin.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/GenericPlugin/generic-plugin.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/GenericPlugin/generic-plugin.js 3 Jan 2016 20:48:27 -0000 1.1.2.1 @@ -0,0 +1,51 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/GenericPlugin/generic-plugin.js */ +GenericPlugin._pluginInfo={name:"GenericPlugin",version:"1.0",developer:"Xinha Developer Team",developer_url:"http://xinha.org",sponsor:"",sponsor_url:"",license:"htmlArea"}; +function GenericPlugin(_1){ +this.editor=_1; +} +GenericPlugin.prototype.onGenerate=function(){ +}; +GenericPlugin.prototype.onGenerateOnce=function(){ +}; +GenericPlugin.prototype.inwardHtml=function(_2){ +return _2; +}; +GenericPlugin.prototype.outwardHtml=function(_3){ +return _3; +}; +GenericPlugin.prototype.onUpdateToolbar=function(){ +return false; +}; +GenericPlugin.prototype.onExecCommand=function(_4,UI,_6){ +return false; +}; +GenericPlugin.prototype.onKeyPress=function(_7){ +return false; +}; +GenericPlugin.prototype.onMouseDown=function(_8){ +return false; +}; +GenericPlugin.prototype.onBeforeSubmit=function(){ +return false; +}; +GenericPlugin.prototype.onBeforeUnload=function(){ +return false; +}; +GenericPlugin.prototype.onBeforeResize=function(_9,_a){ +return false; +}; +GenericPlugin.prototype.onResize=function(_b,_c){ +return false; +}; +GenericPlugin.prototype.onPanelChange=function(_d,_e){ +return false; +}; +GenericPlugin.prototype.onMode=function(_f){ +return false; +}; +GenericPlugin.prototype.onBeforeMode=function(_10){ +return false; +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/GetHtml/GetHtml.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/GetHtml/GetHtml.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/GetHtml/GetHtml.js 3 Jan 2016 20:48:27 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +/** + Implemented now as GetHtmlImplementation plugin in modules/GetHtml/TransformInnerHTML.js + */ + +function GetHtml(editor) { + editor.config.getHtmlMethod = "TransformInnerHTML"; +} + +GetHtml._pluginInfo = { + name : "GetHtml", + version : "1.0", + developer : "Nelson Bright", + developer_url : "http://www.brightworkweb.com/", + sponsor : "", + sponsor_url : "", + license : "htmlArea" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/GetHtml/get-html.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/GetHtml/get-html.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/GetHtml/get-html.js 3 Jan 2016 20:48:28 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/GetHtml/get-html.js */ +function GetHtml(_1){ +_1.config.getHtmlMethod="TransformInnerHTML"; +} +GetHtml._pluginInfo={name:"GetHtml",version:"1.0",developer:"Nelson Bright",developer_url:"http://www.brightworkweb.com/",sponsor:"",sponsor_url:"",license:"htmlArea"}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/HorizontalRule.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/HorizontalRule.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/HorizontalRule.js 3 Jan 2016 20:48:28 -0000 1.1.2.1 @@ -0,0 +1,163 @@ + +HorizontalRule._pluginInfo = { + name : "HorizontalRule", + version : "1.0", + developer : "Nelson Bright", + developer_url : "http://www.brightworkweb.com/", + c_owner : "Nelson Bright", + sponsor : "BrightWork, Inc.", + sponsor_url : "http://www.brightworkweb.com/", + license : "htmlArea" +}; + +function HorizontalRule(editor) { + this.editor = editor; + + var cfg = editor.config; + var toolbar = cfg.toolbar; + var self = this; + + cfg.registerButton({ + id : "edithorizontalrule", + tooltip : this._lc("Insert/edit horizontal rule"), + // image : editor.imgURL("ed_hr.gif", "HorizontalRule"), + image : [_editor_url + "images/ed_buttons_main.gif",6,0], + textMode : false, + action : function(editor) { + self.buttonPress(editor); + } + }); + + cfg.addToolbarElement("edithorizontalrule","inserthorizontalrule",0); +} + +HorizontalRule.prototype._lc = function(string) { + return Xinha._lc(string, 'HorizontalRule'); +}; + +HorizontalRule.prototype.buttonPress = function(editor) { + this.editor = editor; + this._editHorizontalRule(); +}; + +HorizontalRule.prototype._editHorizontalRule = function(rule) { + editor = this.editor; + var sel = editor._getSelection(); + var range = editor._createRange(sel); + var outparam = null; + if (typeof rule == "undefined") { + rule = editor.getParentElement(); + if (rule && !/^hr$/i.test(rule.tagName)) + rule = null; + } + if (rule) { + var f_widthValue = rule.style.width || rule.width; + outparam = { + f_size : parseInt(rule.style.height,10) || rule.size, + f_widthUnit : (/(%|px)$/.test(f_widthValue)) ? RegExp.$1 : 'px', + f_width : parseInt (f_widthValue,10), + f_color : Xinha._colorToRgb(rule.style.backgroundColor) || rule.color, + f_align : rule.style.textAlign || rule.align, + f_noshade : (parseInt(rule.style.borderWidth,10) == 0) || rule.noShade + }; + } + editor._popupDialog("plugin://HorizontalRule/edit_horizontal_rule.html", function(param) { + if (!param) { // user pressed Cancel + return false; + } + var hr = rule; + if (!hr) { + var hrule = editor._doc.createElement("hr"); + for (var field in param) { + var value = param[field]; + if(value == "") continue; + switch (field) { + case "f_width" : + if(param["f_widthUnit"]=="%") + { + hrule.style.width = value + "%"; + } + else + { + hrule.style.width = value + "px"; + } + break; + case "f_size" : + hrule.style.height = value + "px"; + break; + case "f_align" : // Gecko needs the margins for alignment + hrule.style.textAlign = value; + switch (value) { + case 'left': + hrule.style.marginLeft = "0"; + break; + case 'right': + hrule.style.marginRight = "0"; + break; + case 'center': + hrule.style.marginLeft = "auto"; + hrule.style.marginRight = "auto"; + break; + } + break; + case "f_color" : + hrule.style.backgroundColor = value; + break; + case "f_noshade" : + hrule.style.border = "0"; + break; + } + } + if ( Xinha.is_gecko ) + { // If I use editor.insertNodeAtSelection(hrule) here I get get a closing tag + editor.execCommand("inserthtml",false,Xinha.getOuterHTML(hrule)); + } + else editor.insertNodeAtSelection(hrule); + + } else { + for (var field in param) { + var value = param[field]; + switch (field) { + case "f_width" : + if(param["f_widthUnit"]=="%") + { + hr.style.width = value + "%"; + } + else + { + hr.style.width = value + "px"; + } + break; + case "f_size" : + hr.style.height = value + "px"; + break; + case "f_align" : + hr.style.textAlign = value; + switch (value) { + case 'left': + hr.style.marginLeft = "0"; + hr.style.marginRight = null; + break; + case 'right': + hr.style.marginRight = "0"; + hr.style.marginLeft = null; + break; + case 'center': + hr.style.marginLeft = "auto"; + hr.style.marginRight = "auto"; + break; + } + break; + case "f_color" : + hr.style.backgroundColor = value; + break; + case "f_noshade" : + + break; + } + hr.style.border = (param["f_noshade"]) ? "0" : null; + } + } + }, outparam); +}; + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/horizontal-rule.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/horizontal-rule.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/horizontal-rule.js 3 Jan 2016 20:48:28 -0000 1.1.2.1 @@ -0,0 +1,130 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/HorizontalRule/horizontal-rule.js */ +HorizontalRule._pluginInfo={name:"HorizontalRule",version:"1.0",developer:"Nelson Bright",developer_url:"http://www.brightworkweb.com/",c_owner:"Nelson Bright",sponsor:"BrightWork, Inc.",sponsor_url:"http://www.brightworkweb.com/",license:"htmlArea"}; +function HorizontalRule(_1){ +this.editor=_1; +var _2=_1.config; +var _3=_2.toolbar; +var _4=this; +_2.registerButton({id:"edithorizontalrule",tooltip:this._lc("Insert/edit horizontal rule"),image:[_editor_url+"images/ed_buttons_main.gif",6,0],textMode:false,action:function(_5){ +_4.buttonPress(_5); +}}); +_2.addToolbarElement("edithorizontalrule","inserthorizontalrule",0); +} +HorizontalRule.prototype._lc=function(_6){ +return Xinha._lc(_6,"HorizontalRule"); +}; +HorizontalRule.prototype.buttonPress=function(_7){ +this.editor=_7; +this._editHorizontalRule(); +}; +HorizontalRule.prototype._editHorizontalRule=function(_8){ +editor=this.editor; +var _9=editor._getSelection(); +var _a=editor._createRange(_9); +var _b=null; +if(typeof _8=="undefined"){ +_8=editor.getParentElement(); +if(_8&&!/^hr$/i.test(_8.tagName)){ +_8=null; +} +} +if(_8){ +var _c=_8.style.width||_8.width; +_b={f_size:parseInt(_8.style.height,10)||_8.size,f_widthUnit:(/(%|px)$/.test(_c))?RegExp.$1:"px",f_width:parseInt(_c,10),f_color:Xinha._colorToRgb(_8.style.backgroundColor)||_8.color,f_align:_8.style.textAlign||_8.align,f_noshade:(parseInt(_8.style.borderWidth,10)==0)||_8.noShade}; +} +editor._popupDialog("plugin://HorizontalRule/edit_horizontal_rule.html",function(_d){ +if(!_d){ +return false; +} +var hr=_8; +if(!hr){ +var _f=editor._doc.createElement("hr"); +for(var _10 in _d){ +var _11=_d[_10]; +if(_11==""){ +continue; +} +switch(_10){ +case "f_width": +if(_d["f_widthUnit"]=="%"){ +_f.style.width=_11+"%"; +}else{ +_f.style.width=_11+"px"; +} +break; +case "f_size": +_f.style.height=_11+"px"; +break; +case "f_align": +_f.style.textAlign=_11; +switch(_11){ +case "left": +_f.style.marginLeft="0"; +break; +case "right": +_f.style.marginRight="0"; +break; +case "center": +_f.style.marginLeft="auto"; +_f.style.marginRight="auto"; +break; +} +break; +case "f_color": +_f.style.backgroundColor=_11; +break; +case "f_noshade": +_f.style.border="0"; +break; +} +} +if(Xinha.is_gecko){ +editor.execCommand("inserthtml",false,Xinha.getOuterHTML(_f)); +}else{ +editor.insertNodeAtSelection(_f); +} +}else{ +for(var _10 in _d){ +var _11=_d[_10]; +switch(_10){ +case "f_width": +if(_d["f_widthUnit"]=="%"){ +hr.style.width=_11+"%"; +}else{ +hr.style.width=_11+"px"; +} +break; +case "f_size": +hr.style.height=_11+"px"; +break; +case "f_align": +hr.style.textAlign=_11; +switch(_11){ +case "left": +hr.style.marginLeft="0"; +hr.style.marginRight=null; +break; +case "right": +hr.style.marginRight="0"; +hr.style.marginLeft=null; +break; +case "center": +hr.style.marginLeft="auto"; +hr.style.marginRight="auto"; +break; +} +break; +case "f_color": +hr.style.backgroundColor=_11; +break; +case "f_noshade": +break; +} +hr.style.border=(_d["f_noshade"])?"0":null; +} +} +},_b); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/de.js 3 Jan 2016 20:48:28 -0000 1.1.2.1 @@ -0,0 +1,21 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// translated: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "Insert/edit horizontal rule": "horizontale Linie einfügen/bearbeiten", + "Horizontal Rule": "Horizontale Linie", + "Layout": "Gestaltung", + "Width:": "Breite:", + "percent": "Prozent", + "pixels": "Pixel", + "Height:": "Höhe:", + "Alignment:": "Ausrichtung:", + "Left": "links", + "Center": "zentriert", + "Right": "rechts", + "Style": "Stil", + "Color:": "Farbe", + "No shading": "keine Schattierung", + "Note:": "Anmerkung", + "To select an existing horizontal rule, a double-click may be needed.": "Um eine horizontale Linie auszuwählen kann ein Doppelklick erforderlich sein." +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/fr.js 3 Jan 2016 20:48:29 -0000 1.1.2.1 @@ -0,0 +1,20 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Insert/edit horizontal rule": "Insérer une règle horizontale", + "Horizontal Rule": "Règle horizontale", + "Layout": "Layout", + "Width:": "Largeur", + "percent": "pourcent", + "pixels": "pixels", + "Height:": "Hauteur", + "Alignment:": "Alignement", + "Left": "Gauche", + "Center": "Centre", + "Right": "Droite", + "Style": "Style", + "Color:": "Couleur", + "No shading": "Pas d'ombre", + "Note:": "Note", + "To select an existing horizontal rule, a double-click may be needed.": "Pour sélectionner une règle horizontale, un double-clic peut être nécessaire." +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/ja.js 3 Jan 2016 20:48:29 -0000 1.1.2.1 @@ -0,0 +1,21 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +// This string is for auto detection of multi-encoding editor : 国際化文字検出用文字列 +{ + "Insert/edit horizontal rule": "水平線の挿入/修正", + "Horizontal Rule": "水平線", + "Layout": "レイアウト", + "Width:": "幅:", + "percent": "パーセント", + "pixels": "ピクセル", + "Height:": "高さ:", + "Alignment:": "行揃え:", + "Left": "左", + "Center": "中央", + "Right": "右", + "Style": "スタイル", + "Color:": "色:", + "No shading": "影付けなし", + "Note:": "備考", + "To select an existing horizontal rule, a double-click may be needed.":"既存の水平線を選択するにはDoubleClickが必要。" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/nb.js 3 Jan 2016 20:48:29 -0000 1.1.2.1 @@ -0,0 +1,21 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Insert/edit horizontal rule": "Sett inn/ rediger horisontal linje", + "Horizontal Rule": "Horisontal linje", + "Layout": "Oppsett", + "Width:": "Bredde:", + "percent": "prosent", + "pixels": "Piksel", + "Height:": "Høyde:", + "Alignment:": "Justering:", + "Left": "Venstre", + "Center": "Sentrert", + "Right": "Høyre", + "Style": "Stil", + "Color:": "Farge", + "No shading": "Ingen skygge", + "Note:": "Notat", + "To select an existing horizontal rule, a double-click may be needed.": "For å velge en horisontal linje kan det hende du må dobbeltklikke." +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/nl.js 3 Jan 2016 20:48:29 -0000 1.1.2.1 @@ -0,0 +1,21 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Insert/edit horizontal rule": "Horizontale lijn invoegen/bewerken", + "Horizontal Rule": "Horizontale lijn", + "Layout": "Weergave", + "Width:": "Breedte:", + "percent": "procent", + "pixels": "pixels", + "Height:": "Hoogte:", + "Alignment:": "Uitvulling:", + "Left": "Links", + "Center": "Midden", + "Right": "Rechts", + "Style": "Style", + "Color:": "kleur", + "No shading": "Geen schaduw", + "Note:": "Notitie", + "To select an existing horizontal rule, a double-click may be needed.": "Om een bestaande horizontale lijn te selecteren moet je mogelijk dubbel klikken." +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/no.js 3 Jan 2016 20:48:29 -0000 1.1.2.1 @@ -0,0 +1,21 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Insert/edit horizontal rule": "Sett inn/ rediger horisontal linje", + "Horizontal Rule": "Horisontal linje", + "Layout": "Oppsett", + "Width:": "Bredde:", + "percent": "prosent", + "pixels": "Piksel", + "Height:": "Høyde:", + "Alignment:": "Justering:", + "Left": "Venstre", + "Center": "Sentrert", + "Right": "Høyre", + "Style": "Stil", + "Color:": "Farge", + "No shading": "Ingen skygge", + "Note:": "Notat", + "To select an existing horizontal rule, a double-click may be needed.": "For å velge en horisontal linje kan det hende du må dobbeltklikke." +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/lang/pt_br.js 3 Jan 2016 20:48:30 -0000 1.1.2.1 @@ -0,0 +1,34 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Alignment:": "Alinhamento:", + "Cancel": "Cancelar", + "Center": "Centralizar", + "Color:": "Côr:", + "Height:": "Alturar:", + "Horizontal Rule": "Linha Horizontal", + "Insert/Edit Horizontal Rule": "Inserir/Editar Linha Horizontal", + "Insert/edit horizontal rule": "Inserir/editar linha horizontal", + "Layout": "Esquema", + "Left": "Esquerda", + "No shading": "Sem sombra", + "OK": "OK", + "Right": "Direita", + "Style": "Estilo", + "Width:": "Largura:", + "percent": "porcentagem", + "pixels": "pixels" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/popups/edit_horizontal_rule.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/popups/edit_horizontal_rule.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HorizontalRule/popups/edit_horizontal_rule.html 3 Jan 2016 20:48:30 -0000 1.1.2.1 @@ -0,0 +1,141 @@ + + + + + Insert/Edit Horizontal Rule + + + + + + + + + + +
    Horizontal Rule
    +
    +
    + Layout +
    Width:
    + + +
    +
    Height:
    + pixels +
    +
    Alignment:
    + + +
    +
    + Style +
    Color:
    + + + + + +
     ×
    +
    +
    + + + No shading +
    +
    +
    + + +
    +
    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlEntities/Entities.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlEntities/Entities.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlEntities/Entities.js 3 Jan 2016 20:48:30 -0000 1.1.2.1 @@ -0,0 +1,204 @@ +{ +"¡" : "¡", +"¢" : "¢", +"£" : "£", +"¤" : "¤", +"¥" : "¥", +"¦" : "¦", +"§" : "§", +"¨" : "¨", +"©" : "©", +"ª" : "ª", +"«" : "«", +"¬" : "¬", +"®" : "®", +"¯" : "¯", +"°" : "°", +"±" : "±", +"²" : "²", +"³" : "³", +"´" : "´", +"µ" : "µ", +"¶" : "¶", +"·" : "·", +"¸" : "¸", +"¹" : "¹", +"º" : "º", +"»" : "»", +"¼" : "¼", +"½" : "½", +"¾" : "¾", +"¿" : "¿", +"À" : "À", +"Á" : "Á", +"Â" : "Â", +"Ã" : "Ã", +"Ä" : "Ä", +"Å" : "Å", +"Æ" : "Æ", +"Ç" : "Ç", +"È" : "È", +"É" : "É", +"Ê" : "Ê", +"Ë" : "Ë", +"Ì" : "Ì", +"Í" : "Í", +"Î" : "Î", +"Ï" : "Ï", +"Ð" : "Ð", +"Ñ" : "Ñ", +"Ò" : "Ò", +"Ó" : "Ó", +"Ô" : "Ô", +"Õ" : "Õ", +"Ö" : "Ö", +"×" : "×", +"Ø" : "Ø", +"Ù" : "Ù", +"Ú" : "Ú", +"Û" : "Û", +"Ü" : "Ü", +"Ý" : "Ý", +"Þ" : "Þ", +"ß" : "ß", +"à" : "à", +"á" : "á", +"â" : "â", +"ã" : "ã", +"ä" : "ä", +"å" : "å", +"æ" : "æ", +"ç" : "ç", +"è" : "è", +"é" : "é", +"ê" : "ê", +"ë" : "ë", +"ì" : "ì", +"í" : "í", +"î" : "î", +"ï" : "ï", +"ð" : "ð", +"ñ" : "ñ", +"ò" : "ò", +"ó" : "ó", +"ó" : "ó", +"ô" : "ô", +"õ" : "õ", +"ö" : "ö", +"÷" : "÷", +"ø" : "ø", +"ù" : "ù", +"ú" : "ú", +"û" : "û", +"ü" : "ü", +"ý" : "ý", +"þ" : "þ", +"ÿ" : "ÿ", +"ƒ" : "ƒ", +"Α" : "Α", +"Β" : "Β", +"Γ" : "Γ", +"Δ" : "Δ", +"Ε" : "Ε", +"Ζ" : "Ζ", +"Η" : "Η", +"Θ" : "Θ", +"Ι" : "Ι", +"Κ" : "Κ", +"Λ" : "Λ", +"Μ" : "Μ", +"Ν" : "Ν", +"Ξ" : "Ξ", +"Ο" : "Ο ", +"Π" : "Π", +"Ρ" : "Ρ", +"Σ" : "Σ", +"Τ" : "Τ", +"Υ" : "Υ", +"Φ" : "Φ", +"Χ" : "Χ", +"Ψ" : "Ψ", +"Ω" : "Ω", +"α" : "α", +"β" : "β", +"γ" : "γ", +"δ" : "δ", +"ε" : "ε", +"ζ" : "ζ", +"η" : "η", +"θ" : "θ", +"ι" : "ι", +"κ" : "κ", +"λ" : "λ", +"μ" : "μ", +"ν" : "ν", +"ξ" : "ξ", +"ο" : "ο", +"π" : "π", +"ρ" : "ρ", +"ς" : "ς", +"σ" : "σ", +"τ" : "τ", +"υ" : "υ", +"φ" : "φ", +"ω" : "ω", +"•" : "•", +"…" : "…", +"′" : "′", +"″" : "″", +"‾" : "‾", +"⁄" : "⁄", +"™" : "™", +"←" : "←", +"↑" : "↑", +"→" : "→", +"↓" : "↓", +"↔" : "↔", +"⇒" : "⇒", +"∂" : "∂", +"∏" : "∏", +"∑" : "∑", +"−" : "−", +"√" : "√", +"∞" : "∞", +"∩" : "∩", +"∫" : "∫", +"≈" : "≈", +"≠" : "≠", +"≡" : "≡", +"≤" : "≤", +"≥" : "≥", +"◊" : "◊", +"♠" : "♠", +"♣" : "♣", +"♥" : "♥", +"♦" : "♦", +"Œ" : "Œ", +"œ" : "œ", +"Š" : "Š", +"š" : "š", +"Ÿ" : "Ÿ", +"ˆ" : "ˆ", +"˜" : "˜", +"–" : "–", +"—" : "—", +"‘" : "‘", +"’" : "’", +"‚" : "‚", +"“" : "“", +"”" : "”", +"„" : "„", +"†" : "†", +"‡" : "‡", +"‰" : "‰", +"‹" : "‹", +"›" : "›", +"€" : "€", + + // \x22 means '"' -- we use hex reprezentation so that we don't disturb + // JS compressors (well, at least mine fails.. ;) + + " " : "\xA0", + "≤" : String.fromCharCode(0x2264), + "≥" : String.fromCharCode(0x2265) +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlEntities/HtmlEntities.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlEntities/HtmlEntities.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlEntities/HtmlEntities.js 3 Jan 2016 20:48:30 -0000 1.1.2.1 @@ -0,0 +1,51 @@ +/*------------------------------------------*\ +HtmlEntities for Xinha +____________________ + +Intended to faciliate the use of special characters with ISO 8 bit encodings. + +Using the conversion map provided by mharrisonline in ticket #127 + +If you want to adjust the list, e.g. to except the characters that are available in the used charset, +edit Entities.js. +You may save it under a different name using the xinha_config.HtmlEntities.EntitiesFile variable + +ISO-8859-1 preset is default, set + + xinha_config.HtmlEntities.Encoding = null; + +if you want all special characters to be converted or want to load a custom file +\*------------------------------------------*/ + +function HtmlEntities(editor) { + this.editor = editor; +} + +HtmlEntities._pluginInfo = { + name : "HtmlEntities", + version : "1.0", + developer : "Raimund Meyer", + developer_url : "http://x-webservice.net", + c_owner : "Xinha community", + sponsor : "", + sponsor_url : "", + license : "HTMLArea" +} +Xinha.Config.prototype.HtmlEntities = +{ + Encoding : 'iso-8859-1', + EntitiesFile : Xinha.getPluginDir("HtmlEntities") + "/Entities.js" +} +HtmlEntities.prototype.onGenerate = function() { + var e = this.editor; + var url = (e.config.HtmlEntities.Encoding) ? Xinha.getPluginDir("HtmlEntities") + "/"+e.config.HtmlEntities.Encoding+".js" : e.config.HtmlEntities.EntitiesFile; + var callback = function (getback) { + var specialReplacements = e.config.specialReplacements; + eval("var replacements =" + getback); + for (var i in replacements) + { + specialReplacements[i] = replacements[i]; + } + } + Xinha._getback(url,callback); +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlEntities/html-entities.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlEntities/html-entities.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlEntities/html-entities.js 3 Jan 2016 20:48:31 -0000 1.1.2.1 @@ -0,0 +1,21 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/HtmlEntities/html-entities.js */ +function HtmlEntities(_1){ +this.editor=_1; +} +HtmlEntities._pluginInfo={name:"HtmlEntities",version:"1.0",developer:"Raimund Meyer",developer_url:"http://rheinauf.de",c_owner:"Xinha community",sponsor:"",sponsor_url:"",license:"Creative Commons Attribution-ShareAlike License"}; +Xinha.Config.prototype.HtmlEntities={Encoding:"iso-8859-1",EntitiesFile:Xinha.getPluginDir("HtmlEntities")+"/Entities.js"}; +HtmlEntities.prototype.onGenerate=function(){ +var e=this.editor; +var _3=(e.config.HtmlEntities.Encoding)?Xinha.getPluginDir("HtmlEntities")+"/"+e.config.HtmlEntities.Encoding+".js":e.config.HtmlEntities.EntitiesFile; +var _4=function(_5){ +var _6=e.config.specialReplacements; +eval("var replacements ="+_5); +for(var i in replacements){ +_6[i]=replacements[i]; +} +}; +Xinha._getback(_3,_4); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlEntities/iso-8859-1.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlEntities/iso-8859-1.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlEntities/iso-8859-1.js 3 Jan 2016 20:48:31 -0000 1.1.2.1 @@ -0,0 +1,109 @@ +{ +"ƒ" : "ƒ", +"Α" : "Α", +"Β" : "Β", +"Γ" : "Γ", +"Δ" : "Δ", +"Ε" : "Ε", +"Ζ" : "Ζ", +"Η" : "Η", +"Θ" : "Θ", +"Ι" : "Ι", +"Κ" : "Κ", +"Λ" : "Λ", +"Μ" : "Μ", +"Ν" : "Ν", +"Ξ" : "Ξ", +"Ο" : "Ο ", +"Π" : "Π", +"Ρ" : "Ρ", +"Σ" : "Σ", +"Τ" : "Τ", +"Υ" : "Υ", +"Φ" : "Φ", +"Χ" : "Χ", +"Ψ" : "Ψ", +"Ω" : "Ω", +"α" : "α", +"β" : "β", +"γ" : "γ", +"δ" : "δ", +"ε" : "ε", +"ζ" : "ζ", +"η" : "η", +"θ" : "θ", +"ι" : "ι", +"κ" : "κ", +"λ" : "λ", +"μ" : "μ", +"ν" : "ν", +"ξ" : "ξ", +"ο" : "ο", +"π" : "π", +"ρ" : "ρ", +"ς" : "ς", +"σ" : "σ", +"τ" : "τ", +"υ" : "υ", +"φ" : "φ", +"ω" : "ω", +"•" : "•", +"…" : "…", +"′" : "′", +"″" : "″", +"‾" : "‾", +"⁄" : "⁄", +"™" : "™", +"←" : "←", +"↑" : "↑", +"→" : "→", +"↓" : "↓", +"↔" : "↔", +"⇒" : "⇒", +"∂" : "∂", +"∏" : "∏", +"∑" : "∑", +"−" : "−", +"√" : "√", +"∞" : "∞", +"∩" : "∩", +"∫" : "∫", +"≈" : "≈", +"≠" : "≠", +"≡" : "≡", +"≤" : "≤", +"≥" : "≥", +"◊" : "◊", +"♠" : "♠", +"♣" : "♣", +"♥" : "♥", +"♦" : "♦", +"Œ" : "Œ", +"œ" : "œ", +"Š" : "Š", +"š" : "š", +"Ÿ" : "Ÿ", +"ˆ" : "ˆ", +"˜" : "˜", +"–" : "–", +"—" : "—", +"‘" : "‘", +"’" : "’", +"‚" : "‚", +"“" : "“", +"”" : "”", +"„" : "„", +"†" : "†", +"‡" : "‡", +"‰" : "‰", +"‹" : "‹", +"›" : "›", +"€" : "€", + + // \x22 means '"' -- we use hex reprezentation so that we don't disturb + // JS compressors (well, at least mine fails.. ;) + + " " : "\xA0", + "≤" : String.fromCharCode(0x2264), + "≥" : String.fromCharCode(0x2265) +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlTidy/README =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlTidy/README,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlTidy/README 3 Jan 2016 20:48:31 -0000 1.1.2.1 @@ -0,0 +1,104 @@ +// Plugin for htmlArea to run code through the server's HTML Tidy +// By Adam Wright, for The University of Western Australia +// +// Email: zeno@ucc.gu.uwa.edu.au +// Homepage: http://blog.hipikat.org/ +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +// +// Version: 0.5 +// Released to the outside world: 04/03/04 + + +HtmlTidy is a plugin for the popular cross-browser TTY WYSIWYG editor, +htmlArea (http://www.interactivetools.com/products/htmlarea/). HtmlTidy +basically queries HTML Tidy (http://tidy.sourceforge.net/) on the +server side, getting it to make-html-nice, instead of relying on masses +of javascript, which the client would have to download. + +Hi, this is a quick explanation of how to install HtmlTidy. Much better +documentation is probably required, and you're welcome to write it :) + + +* The HtmlTidy directory you should have found this file in should + include the following: + + - README + This file, providing help installing the plugin. + + - html-tidy-config.cfg + This file contains the configuration options HTML Tidy uses to + clean html, and can be modified to suit your organizations + requirements. + + - html-tidy-logic.php + This is the php script, which is queried with dirty html and is + responsible for invoking HTML Tidy, getting nice new html and + returning it to the client. + + - html-tidy.js + The main htmlArea plugin, providing functionality to tidy html + through the htmlArea interface. + + - htmlarea.js.onmode_event.diff + At the time of publishing, an extra event handler was required + inside the main htmlarea.js file. htmlarea.js may be patched + against this file to make the changes reuquired, but be aware + that the event handler may either now be in the core or + htmlarea.js may have changed enough to invalidate the patch. + + UPDATE: now it exists in the official htmlarea.js; applying + this patch is thus no longer necessary. + + - img/html-tidy.gif + The HtmlTidy icon, for the htmlArea toolbar. Created by Dan + Petty for The University of Western Australia. + + - lang/en.js + English language file. Add your own language files here and + please contribute back into the htmlArea community! + + The HtmlArea directory should be extracted to your htmlarea/plugins/ + directory. + + +* Make sure the onMode event handler mentioned above, regarding + htmlarea.js.onmode_event.diff, exists in your htmlarea.js + + +* html-tidy-logic.php should be executable, and your web server should + be configured to execute php scripts in the directory + html-tidy-logic.php exists in. + + +* HTML Tidy needs to be installed on your server, and 'tidy' should be + an alias to it, lying in the PATH known to the user executing such + web scripts. + + +* In your htmlArea configuration, do something like this: + + HTMLArea.loadPlugin("HtmlTidy"); + + editor = new HTMLArea("doc"); + editor.registerPlugin("HtmlTidy"); + + +* Then, in your htmlArea toolbar configuration, use: + + - "HT-html-tidy" + This will create the 'tidy broom' icon on the toolbar, which + will attempt to tidy html source when clicked, and; + + - "HT-auto-tidy" + This will create an "Auto Tidy" / "Don't Tidy" dropdown, to + select whether the source should be tidied automatically when + entering source view. On by default, if you'd like it otherwise + you can do so programatically after generating the toolbar :) + (Or just hack it to be otherwise...) + + +Thank you. + +Any bugs you find can be emailed to zeno@ucc.gu.uwa.edu.au Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlTidy/html-tidy-config.cfg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlTidy/html-tidy-config.cfg,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlTidy/html-tidy-config.cfg 3 Jan 2016 20:48:31 -0000 1.1.2.1 @@ -0,0 +1,29 @@ +// Default configuration file for the htmlArea, HtmlTidy plugin +// By Adam Wright, for The University of Western Australia +// +// Evertything you always wanted to know about HTML Tidy * +// can be found at http://tidy.sourceforge.net/, and a +// quick reference to the configuration options exists at +// http://tidy.sourceforge.net/docs/quickref.html +// +// * But were afraid to ask +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +word-2000: yes +clean: yes +drop-font-tags: no +doctype: auto +drop-empty-paras: yes +drop-proprietary-attributes: yes +enclose-block-text: yes +enclose-text: yes +escape-cdata: yes +logical-emphasis: yes +indent: auto +indent-spaces: 2 +break-before-br: yes +output-xhtml: yes + +force-output: yes Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlTidy/html-tidy-logic.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlTidy/html-tidy-logic.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlTidy/html-tidy-logic.php 3 Jan 2016 20:48:31 -0000 1.1.2.1 @@ -0,0 +1,79 @@ + array("pipe", "r"), + 1 => array("pipe", "w") + ); + $process = @proc_open("tidy -utf8 -config {$cwd}html-tidy-config.cfg", $descriptorspec, $pipes); + + + // Make sure the program started and we got the hooks... + // Either way, get some source code into $source + if (is_resource($process)) { + + // Feed untidy source into the stdin + fwrite($pipes[0], $source); + fclose($pipes[0]); + + // Read clean source out to the browser + while (!feof($pipes[1])) { + //echo fgets($pipes[1], 1024); + $newsrc .= fgets($pipes[1], 1024); + } + fclose($pipes[1]); + + // Clean up after ourselves + proc_close($process); + + } else { + /* Use tidy if it's available from PECL */ + if( function_exists('tidy_parse_string') ) + { + $tempsrc = tidy_parse_string($source); + tidy_clean_repair(); + $newsrc = tidy_get_output(); + } + else + { + // Better give them back what they came with, so they don't lose it all... + $newsrc = "\n" .$source. "\n"; + } + } + + // Split our source into an array by lines + $srcLines = preg_split("/\n/",$newsrc,-1,PREG_SPLIT_NO_EMPTY); + + // Get only the lines between the body tags + $startLn = 0; + while ( strpos( $srcLines[$startLn++], ' +var ns=""; + +editor.setHTML(ns); + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlTidy/html-tidy.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlTidy/html-tidy.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/HtmlTidy/html-tidy.js 3 Jan 2016 20:48:31 -0000 1.1.2.1 @@ -0,0 +1,72 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/HtmlTidy/html-tidy.js */ +function HtmlTidy(_1){ +this.editor=_1; +var _2=_1.config; +var bl=HtmlTidy.btnList; +var _4=this; +this.onMode=this.__onMode; +var _5=[]; +for(var i=0;i +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Auto-Tidy": "Auto-Tidy", + "Don't Tidy": "Sem Tidy", + "HTML Tidy": "HTML Tidy", + "Tidy failed. Check your HTML for syntax errors.": "Tidy falhou. Verifique erros de sintaxe em seu HTML." +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/ImageManager.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/ImageManager.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/ImageManager.js 3 Jan 2016 20:48:33 -0000 1.1.2.1 @@ -0,0 +1,291 @@ +/** + * The ImageManager plugin javascript. + * @author $Author: gustafn $ + * @version $Id: ImageManager.js,v 1.1.2.1 2016/01/03 20:48:33 gustafn Exp $ + * @package ImageManager + */ + +/** + * To Enable the plug-in add the following line before Xinha is initialised. + * + * Xinha.loadPlugin("ImageManager"); + * + * Then configure the config.inc.php file, that is all. + * For up-to-date documentation, please visit http://www.zhuo.org/htmlarea/ + */ + +/** + * It is pretty simple, this file over rides the Xinha.prototype._insertImage + * function with our own, only difference is the popupDialog url + * point that to the php script. + */ + +function ImageManager(editor) +{ + +} + +ImageManager._pluginInfo = { + name : "ImageManager", + version : "1.0", + developer : "Xiang Wei Zhuo", + developer_url : "http://www.zhuo.org/htmlarea/", + license : "htmlArea" +}; + + +// CONFIGURATION README: +// +// It's useful to pass the configuration to the backend through javascript +// (this saves editing the backend config itself), this needs to be done +// in a trusted/secure manner... here is how to do it.. +// +// 1. You need to be able to put PHP in your xinha_config setup +// 2. In step 3 write something like +// -------------------------------------------------------------- +// with (xinha_config.ImageManager) +// { +// '/home/your/directory', +// 'images_url' => '/directory' +// ) +// ) +// ?> +// } +// -------------------------------------------------------------- +// +// this will work provided you are using normal file-based PHP sessions +// (most likely), if not, you may need to modify the php-xinha.php +// file to suit your setup. + +Xinha.Config.prototype.ImageManager = +{ + 'backend' : Xinha.getPluginDir("ImageManager") + '/backend.php?__plugin=ImageManager&', + 'backend_data' : null, + + // Deprecated method for passing config, use above instead! + //--------------------------------------------------------- + 'backend_config' : null, + 'backend_config_hash': null, + 'backend_config_secret_key_location': 'Xinha:ImageManager' + //--------------------------------------------------------- +}; + +// Over ride the _insertImage function in htmlarea.js. +// Open up the ImageManger script instead. + +Xinha.prototype._insertImage = function(image) { + + var editor = this; // for nested functions + var outparam = null; + if (typeof image == "undefined") { + image = this.getParentElement(); + if (image && !/^img$/i.test(image.tagName)) + image = null; + } + + // the selection will have the absolute url to the image. + // coerce it to be relative to the images directory. + // + // FIXME: we have the correct URL, but how to get it to select? + // FIXME: need to do the same for MSIE. + + if ( image ) + { + + outparam = + { + f_url : Xinha.is_ie ? image.src : image.src, + f_alt : image.alt, + f_border : image.style.borderWidth ? image.style.borderWidth : image.border, + f_align : image.align, + f_padding: image.style.padding, + f_margin : image.style.margin, + f_width : image.width, + f_height : image.height, + f_backgroundColor: image.style.backgroundColor, + f_borderColor: image.style.borderColor, + f_hspace: image.hspace && image.hspace != '-1' ? parseInt(image.hspace) : '', + f_vspace: image.vspace && image.vspace != '-1' ? parseInt(image.vspace) : '' + }; + + function shortSize(cssSize) + { + if(/ /.test(cssSize)) + { + var sizes = cssSize.split(' '); + var useFirstSize = true; + for(var i = 1; i < sizes.length; i++) + { + if(sizes[0] != sizes[i]) + { + useFirstSize = false; + break; + } + } + if(useFirstSize) cssSize = sizes[0]; + } + return cssSize; + } + outparam.f_border = shortSize(outparam.f_border); + outparam.f_padding = shortSize(outparam.f_padding); + outparam.f_margin = shortSize(outparam.f_margin); + + function convertToHex(color) { + + if (typeof color == "string" && /, /.test.color) + color = color.replace(/, /, ','); // rgb(a, b) => rgb(a,b) + + if (typeof color == "string" && / /.test.color) { // multiple values + var colors = color.split(' '); + var colorstring = ''; + for (var i = 0; i < colors.length; i++) { + colorstring += Xinha._colorToRgb(colors[i]); + if (i + 1 < colors.length) + colorstring += " "; + } + return colorstring; + } + + return Xinha._colorToRgb(color); + } + + outparam.f_backgroundColor = convertToHex(outparam.f_backgroundColor); + outparam.f_borderColor = convertToHex(outparam.f_borderColor); + + } // end of if we selected an image before raising the dialog. + + // the "manager" var is legacy code. Should probably reference the + // actual config variable in each place .. for now this is good enough. + + // alert( "backend is '" + editor.config.ImageManager.backend + "'" ); + + var manager = editor.config.ImageManager.backend + '__function=manager'; + if(editor.config.ImageManager.backend_config != null) + { + manager += '&backend_config=' + + encodeURIComponent(editor.config.ImageManager.backend_config); + manager += '&backend_config_hash=' + + encodeURIComponent(editor.config.ImageManager.backend_config_hash); + manager += '&backend_config_secret_key_location=' + + encodeURIComponent(editor.config.ImageManager.backend_config_secret_key_location); + } + + if(editor.config.ImageManager.backend_data != null) + { + for ( var i in editor.config.ImageManager.backend_data ) + { + manager += '&' + i + '=' + encodeURIComponent(editor.config.ImageManager.backend_data[i]); + } + } + + Dialog(manager, function(param) { + if (!param) { // user must have pressed Cancel + return false; + } + var img = image; + if (!img) { + if (Xinha.is_ie) { + var sel = editor._getSelection(); + var range = editor._createRange(sel); + editor._doc.execCommand("insertimage", false, param.f_url); + img = range.parentElement(); + // wonder if this works... + if (img.tagName.toLowerCase() != "img") { + img = img.previousSibling; + } + } else { + img = document.createElement('img'); + img.src = param.f_url; + editor.insertNodeAtSelection(img); + } + } else { + img.src = param.f_url; + } + + for (field in param) { + var value = param[field]; + switch (field) { + case "f_alt" : img.alt = value; break; + case "f_border" : + if(value.length) + { + img.style.borderWidth = /[^0-9]/.test(value) ? value : (parseInt(value) + 'px'); + if(img.style.borderWidth && !img.style.borderStyle) + { + img.style.borderStyle = 'solid'; + } + } + else + { + img.style.borderWidth = ''; + img.style.borderStyle = ''; + } + break; + + case "f_borderColor": img.style.borderColor = value; break; + case "f_backgroundColor": img.style.backgroundColor = value; break; + + case "f_padding": + { + if(value.length) + { + img.style.padding = /[^0-9]/.test(value) ? value : (parseInt(value) + 'px'); + } + else + { + img.style.padding = ''; + } + } + break; + + case "f_margin": + { + if(value.length) + { + img.style.margin = /[^0-9]/.test(value) ? value : (parseInt(value) + 'px'); + } + else + { + img.style.margin = ''; + } + } + break; + + case "f_align" : img.align = value; break; + + case "f_width" : + { + if(!isNaN(parseInt(value))) { img.width = parseInt(value); } else { img.width = ''; } + } + break; + + case "f_height": + { + if(!isNaN(parseInt(value))) { img.height = parseInt(value); } else { img.height = ''; } + } + break; + + case "f_hspace" : + { + if(!isNaN(parseInt(value))) { img.hspace = parseInt(value); } else { img.hspace = ''; } + } + break; + + case "f_vspace" : + { + if(!isNaN(parseInt(value))) { img.vspace = parseInt(value); } else { img.vspace = ''; } + } + break; + } + + } + + + }, outparam); +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/README.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/README.txt,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/README.txt 3 Jan 2016 20:48:33 -0000 1.1.2.1 @@ -0,0 +1,150 @@ +Originally Developed by: http://www.zhuo.org/htmlarea/ + +> This is a plug-in for HTMLArea 3.0 +> +> The PHP ImageManager + Editor provides an interface to +> browser for image files on your web server. The Editor +> allows some basic image manipulations such as, cropping, +> rotation, flip, and scaling. +> +> Further and up-to-date documentation can be found at +> http://www.zhuo.org/htmlarea/docs/index.html +> +> Cheer, +> Wei + +2005-03-20 + by Yermo Lamers of DTLink, LLC (http://www.formvista.com/contact.html) + +Please post questions/comments/flames about this plugin in the Xinha forums +at + + http://xinha.gogo.co.nz/punbb/viewforum.php?id=1 + +------------------------------------------------------------------------------ +If you have GD installed and configured in PHP this should work out of the +box. + +For production use see config.inc.php for configuration values. You will +want to adjust images_dir and images_url for your application. + +For demo purposes ImageManager is set up to view images in the + + /xinha/plugins/ImageManager/demo_images + +directory. This is governed by the images_dir and images_url config options. + +The permissions on the demo_images directory may not be correct. The directory +should be owned by the user your webserver runs as and should have 755 +permissions. + +-------------------------------------------------------------------------------- + +By default this ImageManager is set up to browse some graphics +in plugins/ImageManager/demo_images. + +For security reasons image uploading is turned off by default. +You can enable it by editing config.inc.php. + +--------------------------------- +For Developers +--------------------------------- + +CHANGES FROM Wei's Original Code: + +Single Backend: +--------------- + +All requests from the javascript code back to the server now +are routed through a single configurable backend script, +backend.php. + +Request URLs are of the form: + + (?|&)__plugin=ImageManager&__function=&arg=value&arg=value + +The default URL is plugins/xinha/backend.php. + +This approach makes it possible to completely replace the +backend with a perl or ASP implementation without having to +change any of the client side code. + +You can override the location and name of the backend.php +script by setting the config.ImageManager.backend property from +the calling page. Make sure the URL ends in an "&". The code, +for now, assumes it can just tack on variables. + +For the moment the javascript files in the assets directory do +not have access to the main editor object and as a result have +not access to the config. For the moment we use a _backend_url +variable output from PHP to communicate the location of the +backend to these assets. It's a kludge. Ideally all these +config values should be set from the calling page and be +available through the editor.config.ImageManager object. + +Debug Messages +--------------- + +The php files include a simple debugging library, ddt.php. See +config.inc.php for how to turn it on. It can display trace +messages to the browser or dump them to a log file. + +I'll try to package up the client-side tracing-to-textarea +_ddt() functions I've put together. Having a trace message +infrastructure has always served me well. + +------------- +Flakey Editor +------------- + +The editor I use is flakey (but very very fast). It has +problems with tab to space conversion so if the indenting looks +weird that's why. + +---- +TODO +---- + +ImageManager really needs a complete rewrite. + +. ImageManager should appear in a pane instead of a popup + window using Sleeman's windowpane support. + +. html and php code are intermixed. It would be very nice to +use some kind of templating for the dialogs; this templating +should be done long hand so it can be re-used regardless of the +backend implementation language. + +. the config should probably be some format that would be +easily read by multiple implementations of the back end. It +would be nice to have a single configuration system regardless +of whether the backend is PHP, Perl or ASP. + +. javascript assets are not objects. Passing config options to +the assets functions requires intermediate variables which is +really ugly. Everything should be cleanly integrated into the +object heirarchy akin to the way Linker is done. + +. if an image is selected from the document editor window it +should be focused and highlighted in the image selection +window. + +. fix fully-qualified url in image selection box under MSIE. + +. per-image permissions. We should include some kind of backend +permissions management so users can only +delete/edit/move/rename images that they have uploaded. + +. add a CANCEL button and a SAVE AS button to the editor. + +. add a list view akin to EFM. (and include image properties +width/height/depth/etc.) + +. figure out a way for ImageManager to work "out of the box" +regardless of install. + +. client-side tracing. + +. fancy stuff like adding a UI to define rollovers, animations, +etc. + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/backend.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/backend.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/backend.php 3 Jan 2016 20:48:33 -0000 1.1.2.1 @@ -0,0 +1,171 @@ + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/config.inc.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/config.inc.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/config.inc.php 3 Jan 2016 20:48:33 -0000 1.1.2.1 @@ -0,0 +1,459 @@ +_x_ +* resized files are created when one changes the dimensions of an image +* in the image manager selection dialog - the image is scaled when the +* user clicks the ok button. +*/ + +$IMConfig['resized_prefix'] = '.resized'; + +// ------------------------------------------------------------------------- + +/** +* Resized Directory +* +* Resized images may also be stored in a directory, except in safe mode. +*/ + +$IMConfig['resized_dir'] = '.resized'; + +/** + * Full options + * + * Determines whether the user is given options for padding, + * background/padding colour, margin, border and border colour. + */ + +$IMConfig['show_full_options'] = true; + +// ------------------------------------------------------------------------- + +/** +* Allow New Directories +* +* +* Possible values: true, false +* +* TRUE - Allow the user to create new sub-directories in the +* $IMConfig['base_dir']. +* +* FALSE - No directory creation. +* +* NOTE: If $IMConfig['safe_mode'] = true, this parameter +* is ignored, you can not create directories +* +* DEFAULT: for demo purposes we turn this off. +*/ + +$IMConfig['allow_new_dir'] = true; + +// ------------------------------------------------------------------------- + +/** +* Allow Uploads +* +* Possible values: true, false +* +* TRUE - Allow the user to upload files. +* +* FALSE - No uploading allowed. +* +* DEFAULT: for demo purposes we turn this off. +*/ + +$IMConfig['allow_upload'] = false; + +// ------------------------------------------------------------------------- + +/** +* Allow Delete +* +* Possible values: true, false +* +* TRUE - Allow the user to delete files/dirs +* +* FALSE - No deleting allowed. +* +*/ + +$IMConfig['allow_delete'] = true; + +// ------------------------------------------------------------------------- + +/** +* Allow Edit +* +* Possible values: true, false +* +* TRUE - Allow the user to edit files +* +* FALSE - No editing allowed. +* +*/ + +$IMConfig['allow_edit'] = true; + + +// ------------------------------------------------------------------------- + +/** +* Validate Images +* +* Possible values: true, false +* +* TRUE - If set to true, uploaded files will be validated based on the +* function getImageSize, if we can get the image dimensions then +* I guess this should be a valid image. Otherwise the file will be rejected. +* +* FALSE - All uploaded files will be processed. +* +* NOTE: If uploading is not allowed, this parameter is ignored. +*/ + +$IMConfig['validate_images'] = true; + +$IMConfig['allowed_image_extensions'] = array("jpg","gif","png","jpeg"); + +// ------------------------------------------------------------------------- + +/** +* Default Thumnail. +* +* The default thumbnail if the thumbnails can not be created, either +* due to error or bad image file. +*/ + +$IMConfig['default_thumbnail'] = 'img/default.gif'; + +// ------------------------------------------------------------------------- + +/** +* Thumbnail dimensions. +*/ + +$IMConfig['thumbnail_width'] = 96; +$IMConfig['thumbnail_height'] = 96; + +// ------------------------------------------------------------------------- + +/** +* Editor Temporary File Prefix. +* +* Image Editor temporary filename prefix. +*/ + +$IMConfig['tmp_prefix'] = '.editor_'; + + +$IMConfig['ViewMode'] = 'thumbs'; + +// ------------------------------------------------------------------------- + +/** Margin Types + * If your HTML will be used in an email, then using CSS type "margin" + * is not so reliable and you should set UseHSpaceVSpace to be true + * to go back to the old fashioned hspace="" and vspace="" attributes on + * images. + */ +$IMConfig['UseHSpaceVSpace'] = false; + +// ------------------------------------------------------------------------- + +/** + * ImageManager/Picker can provide selection interfaces for more than just + * images on the server ("Pictures"). + * + * Local - the classical ImageManager for images stored on this server. + * + * YouTube - provides selection (but not upload etc) of videos on YouTube + * see smart-image.js for how to make the videos work as videos instead of + * static images. + * + * Flickr - provides selection (but not upload etc) of public images on Flickr + * Set + * $IMConfig['Flickr'] = array('Key' => 'yourkeyhere'); + * to turn on Flickr support. + * + * To get a key: http://www.flickr.com/services/api/keys/ + * + * WARNING: Flickr restricts commercial use of the API. If your site is in any way even + * remotely commercial you need to ask for a commercial key from flickr. + * + * ADDITIONAL WARNING: Flickr requires that you provide a link back to them, preferably + * on the image itself (linking to the image) - you can use smart-image.js to do + * something like this. + * + * ADDITIONAL ADDITIONAL WARNING: It's up to you to comply with the image's license!! + */ + +$IMConfig['Local'] = TRUE; +$IMConfig['YouTube'] = FALSE; +$IMConfig['Flickr'] = FALSE; + +// These are some configurable defaults for Flickr, to override +// $IMConfig['Flickr'] = array('Whatever' => 'You Want'); +$FlickrDefaults = array +( + // This is the URL as flickr provides it for the licence which you wish + // to search on by default. The default here is the least restrictive one. + 'Default License' => 'http://creativecommons.org/licenses/by/2.0/', + +); + + +//////////////////////////////////////////////////////////////////////////////// +// ================== END OF CONFIGURATION ======================= // +//////////////////////////////////////////////////////////////////////////////// + + +// Standard PHP Backend Data Passing +// if data was passed using xinha_pass_to_php_backend() we merge the items +// provided into the Config +require_once(realpath(dirname(__FILE__) . '/../../contrib/php-xinha.php')); +if($passed_data = xinha_read_passed_data()) +{ + $IMConfig = array_merge($IMConfig, $passed_data); + $IMConfig['backend_url'] .= xinha_passed_data_querystring() . '&'; + + if($IMConfig['Flickr']) + { + foreach($FlickrDefaults as $k => $v) + { + if(!isset($IMConfig['Flickr'][$k])) + { + $IMConfig['Flickr'][$k] = $v; + } + } + } +} +// Deprecated config passing, don't use this way any more! +elseif(isset($_REQUEST['backend_config'])) +{ + if(get_magic_quotes_gpc()) { + $_REQUEST['backend_config'] = stripslashes($_REQUEST['backend_config']); + } + + if($_REQUEST['backend_config_secret_key_location'] !== 'Xinha:ImageManager') + { + trigger_error('Programming Error - please contact the website administrator/programmer to alert them to this problem. A non-default backend key location is being used to pass backend data to Xinha, but the same key location is not being used to receive data. The special backend configuration has been ignored. To resolve this, you should edit plugins/ImageManager/config.php and change the default key location from "Xinha:ImageManager" to your desired non default. See: http://trac.xinha.org/ticket/1518', E_USER_ERROR); + } + else + { + + // Config specified from front end, check that it's valid + session_start(); + $secret = $_SESSION[$_REQUEST['backend_config_secret_key_location']]; + + if($_REQUEST['backend_config_hash'] !== sha1($_REQUEST['backend_config'] . $secret)) + { + die("Backend security error."); + } + + $to_merge = unserialize($_REQUEST['backend_config']); + if(!is_array($to_merge)) + { + die("Backend config syntax error."); + } + + $IMConfig = array_merge($IMConfig, $to_merge); + $IMConfig['backend_url'] .= "backend_config=" . rawurlencode($_REQUEST['backend_config']) . '&'; + $IMConfig['backend_url'] .= "backend_config_hash=" . rawurlencode($_REQUEST['backend_config_hash']) . '&'; + $IMConfig['backend_url'] .= "backend_config_secret_key_location=" . rawurlencode($_REQUEST['backend_config_secret_key_location']) . '&'; + } +} + +define('IMAGE_CLASS', $IMConfig['IMAGE_CLASS']); +define('IMAGE_TRANSFORM_LIB_PATH', $IMConfig['IMAGE_TRANSFORM_LIB_PATH']); +define( "IM_CONFIG_LOADED", "yes" ); + +// bring in the debugging library + +include_once( "ddt.php" ); + +// uncomment to send debug messages to a local file +// _setDebugLog( "/tmp/debug_log.txt" ); + +// turn debugging on everywhere. +// _ddtOn(); + +// END + +?> Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/ddt.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/ddt.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/ddt.php 3 Jan 2016 20:48:33 -0000 1.1.2.1 @@ -0,0 +1,288 @@ +$basename:$line: $msg

    \n" ); + } + } + +} // end of _ddt + +/** +* displays a formatted dump of an associative array. +* +* If ddtOn() was called, outputs a formatted debugging message showing +* contents of array. +* +* @param string $file filename, usually __FILE__ +* @param string $line line number in file, usually __LINE__ +* @param string $msg debugging message to display +* @param array $array_var array to dump. +*/ + +function _ddtArray( $file, $line, $msg, $array_var ) +{ + +global $_DDT; + +if ( $_DDT == "yes" ) + { + + dumpmsg( "

    $file:$line: $msg

    " ); + + foreach ( $array_var as $name => $value ) + { + dumpmsg( "

    $name => $value\n" ); + } + } + +} // end of _ddtArray + +// ----------------------------------------------------------------- + +/** +* Central Error Function. +* +* Displays a formatted error message to the user. +* If the global _DDT_ERROR_LOG is set the error message is dumped +* to that file instead of being displayed to the user. +*/ + +function _error( $file, $line, $msg ) +{ + +global $_DDT_ERROR_LOG; +global $_DDT_CMDLINE; + +if ( @$_DDT_ERROR_LOG == NULL ) + { + + if ( @$_DDT_CMDLINE == "yes" ) + { + echo basename($file) . ":$line: $msg\n"; + } + else + { + echo "

    $file:$line: $msg

    "; + } + } +else + { + + if (( $fp = fopen( $_DDT_ERROR_LOG, "a" )) != NULL ) + { + fputs( $fp, date("D M j G:i:s T Y") . " - $file:$line: $msg\n" ); + fclose( $fp ); + } + + } + +} // end of _error + +// ---------------------------------------------------------------------- + +function errorEcho( $title, $field ) +{ + +global $error_msg; + +if ( $error_msg[ $field ] != "" ) + { + + echo "$title"; + + } +else + { + + echo $title; + + } + +} // end of errorEcho + +/** +* turns on procedural debugging. +* +* Causes _ddt() calls to display debugging messages. +*/ + +function _ddtOn() +{ + +global $_DDT; + +$_DDT = "yes"; + +} + +/** +* set error message destination. +* +* sets the destination for error messages. +* +* @param string $file full path to errorlog. +*/ + +function _setErrorLog( $errorLog ) +{ + +global $_DDT_ERROR_LOG; + +$_DDT_ERROR_LOG = $errorLog; + +} + +/** +* set output file for debugging messages. +* +* sets the destination file for debugging messages. +* +* @param string $file full path to debuglog. +*/ + +function _setDebugLog( $debugLog ) +{ + +global $fvDEBUG; + +$fvDEBUG[ "logfile" ] = $debugLog; + +} + +/** +* set debugging output style to command line. +* +* tells ddt to format debugging messages for a +* command line program. +*/ + +function _ddtSetCmdLine() +{ + +global $_DDT_CMDLINE; + +$_DDT_CMDLINE = "yes"; + +} + +// END + +?> Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/editor.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/editor.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/editor.php 3 Jan 2016 20:48:34 -0000 1.1.2.1 @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + +
    + +
    +
    + + + + + +
    + +
    + +
    +
    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/editorFrame.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/editorFrame.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/editorFrame.php 3 Jan 2016 20:48:34 -0000 1.1.2.1 @@ -0,0 +1,79 @@ +processImage(); + +?> + + + + + + + + + + + + + + +
    + +isGDEditable() == -1) { ?> +
    GIF format is not supported, image editing not supported.
    + + + + + +
    + 0 && is_file($imageInfo['fullpath'])) { ?> + alt="" id="theImage" name="theImage"> + + No Image Available + +
    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/flickr.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/flickr.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/flickr.php 3 Jan 2016 20:48:34 -0000 1.1.2.1 @@ -0,0 +1,263 @@ + 20, + 'sort' => 'relevance', + 'extras' => 'license,owner_name,tags', + 'license' => @$_REQUEST['flkLicense'] ? $_REQUEST['flkLicense'] : flickr_get_default_usage_id(), + ); + +if(@$_REQUEST['flkSearch']) +{ + $opts['text'] = $_REQUEST['flkSearch']; +} + +if(@$_REQUEST['flkUsername']) +{ + $user_id = flickr_get_user_id($_REQUEST['flkUsername']); + if($user_id) + { + $opts['user_id'] = $user_id; + } +} + +$data = flickr_request('flickr.photos.search', $opts); + + +$records = $data['photos']['photo']; + +// For future purposes, we may want an image manager +$relative = '/'; +$manager = new ImageManager($IMConfig); + +/* ================= OUTPUT/DRAW FUNCTIONS ======================= */ + + +function rip_flickr_data($record) +{ + $lics = flickr_get_licenses(); + // echo '
    '; print_r($lics);  die();
    +  
    +  $title = $record['title'];
    +  $license = $lics[$record['license']];
    +  
    +  // echo '
    ';print_r($license); die();
    +  
    +  $description = '';
    +  $sizes = flickr_request('flickr.photos.getSizes', array('photo_id' => $record['id']));
    +  $sizes = $sizes['sizes'];
    +  $thumbs = array(); // w:h => array( file, file, file)
    +  $largest = array(0,'', 0, 0);   
    +  $smallest = array(3000*3000,'', 3000, 3000); // Ok, hacky, sosumi
    +  
    +  foreach($sizes['size'] as $thumb) 
    +  {
    +    if($thumb['label'] == 'Square') continue; // These are a little smaller than default
    +    if(!isset($thumbs["{$thumb['width']}x{$thumb['height']}"]))
    +    {
    +      $thumbs["{$thumb['width']}x{$thumb['height']}"]  = array();
    +      
    +      if(($thumb['width'] * $thumb['height']) > $largest[0])
    +        $largest = array($thumb['width'] * $thumb['height'], $thumb['width'] . 'x' . $thumb['height'], $thumb['width'] , $thumb['height']);
    +      
    +      if(($thumb['width'] * $thumb['height']) < $smallest[0])
    +        $smallest = array($thumb['width'] * $thumb['height'], $thumb['width'] . 'x' . $thumb['height'], $thumb['width'] , $thumb['height']);
    +    }
    +    $thumbs["{$thumb['width']}x{$thumb['height']}"][] = $thumb;
    +    
    +  }
    +
    +  // Find the main image link
    +  $mainImage = $thumbs[$largest[1]];
    +  $mainImage = array_pop($mainImage);
    +  
    +  // Find the thumb image link
    +  $thumbImage = $thumbs[$smallest[1]];
    +  $thumbImage = array_pop($thumbImage);
    +  
    +  // Final image to pass to manager (use query param to record the embed url)
    +  $combinedImage = $mainImage['source'] . 
    +  '?x-flickr-photo='.rawurlencode($record['id']) .
    +  '&x-lic='.rawurlencode($license['x-id'])   .
    +  '&x-uid='.rawurlencode($record['owner'])       .  
    +  '&x-by='.rawurlencode($record['ownername'])    .   
    +  '&x-tn='.rawurlencode($thumbImage['source']);
    +  
    +  
    +  return array
    +  (
    +   'title'         => $title,
    +   'description'   => $description,
    +   'dimensions'    => "{$mainImage['width']}x{$mainImage['height']}",
    +   'license'       => $license,
    +   'mainImage'     => $mainImage['source'],
    +   'thumbImage'    => $thumbImage['source'],
    +   'combinedImage' => $combinedImage,
    +   
    +   'smallest' => $smallest,
    +   'largest'  => $largest,
    +   'thumbs'   => $thumbs,   
    +  );
    +}
    +                           
    +function drawFiles($list, &$manager)
    +{
    +	global $relative;
    +	global $IMConfig;
    +$IMConfig['ViewMode'] = 'thumbs';
    +    switch($IMConfig['ViewMode'])
    +    {
    +      case 'details':
    +      {
    +        
    +        ?>
    +        
    +        
    +        
    +        
    +        
    +          
    +            
    +              
    +              
    +              
    +            
    +        
    +        
    TitleDescriptionDimensions
    +
    + +
    + + <?php echo $title; ?> - <?php echo htmlspecialchars($dimensions); ?> + +
    +
    + +
    No Photos Found
    + +
    Invalid base directory: config['images_dir']; ?>
    + + + + + + Flickr Picture List + + + + + + + + + + + + + +isValidBase() == false) { drawErrorBase($manager); } + elseif(count($records)) { ?> + + + + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/image-manager.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/image-manager.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/image-manager.js 3 Jan 2016 20:48:34 -0000 1.1.2.1 @@ -0,0 +1,149 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/ImageManager/image-manager.js */ +function ImageManager(_1){ +} +ImageManager._pluginInfo={name:"ImageManager",version:"1.0",developer:"Xiang Wei Zhuo",developer_url:"http://www.zhuo.org/htmlarea/",license:"htmlArea"}; +Xinha.Config.prototype.ImageManager={"backend":Xinha.getPluginDir("ImageManager")+"/backend.php?__plugin=ImageManager&","backend_data":null,"backend_config":null,"backend_config_hash":null,"backend_config_secret_key_location":"Xinha:ImageManager"}; +Xinha.prototype._insertImage=function(_2){ +var _3=this; +var _4=null; +if(typeof _2=="undefined"){ +_2=this.getParentElement(); +if(_2&&!/^img$/i.test(_2.tagName)){ +_2=null; +} +} +if(_2){ +_4={f_url:Xinha.is_ie?_2.src:_2.src,f_alt:_2.alt,f_border:_2.style.borderWidth?_2.style.borderWidth:_2.border,f_align:_2.align,f_padding:_2.style.padding,f_margin:_2.style.margin,f_width:_2.width,f_height:_2.height,f_backgroundColor:_2.style.backgroundColor,f_borderColor:_2.style.borderColor}; +function shortSize(_5){ +if(/ /.test(_5)){ +var _6=_5.split(" "); +var _7=true; +for(var i=1;i<_6.length;i++){ +if(_6[0]!=_6[i]){ +_7=false; +break; +} +} +if(_7){ +_5=_6[0]; +} +} +return _5; +} +_4.f_border=shortSize(_4.f_border); +_4.f_padding=shortSize(_4.f_padding); +_4.f_margin=shortSize(_4.f_margin); +function convertToHex(_9){ +if(typeof _9=="string"&&/, /.test.color){ +_9=_9.replace(/, /,","); +} +if(typeof _9=="string"&&/ /.test.color){ +var _a=_9.split(" "); +var _b=""; +for(var i=0;i<_a.length;i++){ +_b+=Xinha._colorToRgb(_a[i]); +if(i+1<_a.length){ +_b+=" "; +} +} +return _b; +} +return Xinha._colorToRgb(_9); +} +_4.f_backgroundColor=convertToHex(_4.f_backgroundColor); +_4.f_borderColor=convertToHex(_4.f_borderColor); +} +var _d=_3.config.ImageManager.backend+"__function=manager"; +if(_3.config.ImageManager.backend_config!=null){ +_d+="&backend_config="+encodeURIComponent(_3.config.ImageManager.backend_config); +_d+="&backend_config_hash="+encodeURIComponent(_3.config.ImageManager.backend_config_hash); +_d+="&backend_config_secret_key_location="+encodeURIComponent(_3.config.ImageManager.backend_config_secret_key_location); +} +if(_3.config.ImageManager.backend_data!=null){ +for(var i in _3.config.ImageManager.backend_data){ +_d+="&"+i+"="+encodeURIComponent(_3.config.ImageManager.backend_data[i]); +} +} +Dialog(_d,function(_f){ +if(!_f){ +return false; +} +var img=_2; +if(!img){ +if(Xinha.is_ie){ +var sel=_3._getSelection(); +var _12=_3._createRange(sel); +_3._doc.execCommand("insertimage",false,_f.f_url); +img=_12.parentElement(); +if(img.tagName.toLowerCase()!="img"){ +img=img.previousSibling; +} +}else{ +img=document.createElement("img"); +img.src=_f.f_url; +_3.insertNodeAtSelection(img); +} +}else{ +img.src=_f.f_url; +} +for(field in _f){ +var _13=_f[field]; +switch(field){ +case "f_alt": +img.alt=_13; +break; +case "f_border": +if(_13.length){ +img.style.borderWidth=/[^0-9]/.test(_13)?_13:(parseInt(_13)+"px"); +if(img.style.borderWidth&&!img.style.borderStyle){ +img.style.borderStyle="solid"; +} +}else{ +img.style.borderWidth=""; +img.style.borderStyle=""; +} +break; +case "f_borderColor": +img.style.borderColor=_13; +break; +case "f_backgroundColor": +img.style.backgroundColor=_13; +break; +case "f_padding": +if(_13.length){ +img.style.padding=/[^0-9]/.test(_13)?_13:(parseInt(_13)+"px"); +}else{ +img.style.padding=""; +} +break; +case "f_margin": +if(_13.length){ +img.style.margin=/[^0-9]/.test(_13)?_13:(parseInt(_13)+"px"); +}else{ +img.style.margin=""; +} +break; +case "f_align": +img.align=_13; +break; +case "f_width": +if(!isNaN(parseInt(_13))){ +img.width=parseInt(_13); +}else{ +img.width=""; +} +break; +case "f_height": +if(!isNaN(parseInt(_13))){ +img.height=parseInt(_13); +}else{ +img.height=""; +} +break; +} +} +},_4); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/image-picker.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/image-picker.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ImageManager/image-picker.js 3 Jan 2016 20:48:34 -0000 1.1.2.1 @@ -0,0 +1,205 @@ +/** + * An input field Image Picker utilising the Xinha ImageManager. + * + * Hijack the Xinha ImageManager plugin to provide an image URL picker + * for any form input field in the form of a "Browse" button to the + * right of the field, in the same manner as a file type input field + * except it opens the familiar ImageManager dialog to upload/select/edit + * an image and returns the URL of the image to the field's value. + * + * Example Usage: + * + * + * + * + * + * @author $Author: gustafn $ + * @version $Id: image-picker.js,v 1.1.2.1 2016/01/03 20:48:34 gustafn Exp $ + * @package ImageManager + */ + + +function ImagePicker(field) +{ + this.field = field; + var picker = this; + + var but = document.createElement('input'); + but.type = 'button'; + but.value = 'Browse'; + but.onclick = function() { picker.popup_picker(); } + + field.parentNode.insertBefore(but,field.nextSibling); + field.size = '20'; + field.style.textAlign = 'right'; +}; + +ImagePicker.prototype.backend = Xinha.getPluginDir('ImageManager') + '/backend.php?__plugin=ImageManager&'; +ImagePicker.prototype.backend_data = null; + +ImagePicker.prototype.append_query_string = true; + +ImagePicker.prototype.popup_picker = function() +{ + var picker = this; // closure for later + var outparam = null; + if(picker.field.value) + { + outparam = + { + f_url : picker.field.value, + f_width : null, + f_height : null, + + // None of this stuff is useful to us, we return only a URL. + f_alt : picker.field.value, + f_border : null, + f_align : null, + f_padding: null, + f_margin : null, + f_backgroundColor: null, + f_borderColor: null, + f_border : null, + f_padding: null, + f_margin: null + }; + + while(outparam.f_url.match(/[?&]((f_[a-z0-9]+)=([^&#]+))/i)) + { + outparam[RegExp.$2] = decodeURIComponent(RegExp.$3); + outparam.f_url = outparam.f_url.replace(RegExp.$1, ''); + } + + outparam.f_url = outparam.f_url.replace(/&{2,}/g, '&'); + outparam.f_url = outparam.f_url.replace(/\?&*(#.*)?$/, ''); + } + + var manager = this.backend + '__function=manager'; + if(this.backend_config != null) + { + manager += '&backend_config=' + + encodeURIComponent(this.backend_config); + manager += '&backend_config_hash=' + + encodeURIComponent(this.backend_config_hash); + manager += '&backend_config_secret_key_location=' + + encodeURIComponent(this.backend_config_secret_key_location); + } + + if(this.backend_data != null) + { + for ( var i in this.backend_data ) + { + manager += '&' + i + '=' + encodeURIComponent(this.backend_data[i]); + } + } + + Dialog(manager, function(param) { + if (!param) { // user must have pressed Cancel + return false; + } + + picker.field.value = param.f_url; + if(picker.append_query_string) + { + if(picker.field.value.match(/[?&](.*)$/)) + { + if(RegExp.$1.length) + { + picker.field.value += '&'; + } + } + else + { + picker.field.value += '?'; + } + + for(var i in param) + { + if(i == 'f_url' || param[i] == null || param[i] == 'null' || param[i] == '') continue; + if(typeof param[i] == 'function') continue; + if(param[i].length = 0) continue; + + picker.field.value += i + '=' + encodeURIComponent(param[i]) + '&'; + } + } + + }, outparam); +} + +// Dialog is part of Xinha, but we'll provide it here incase Xinha's not being +// loaded. +if(typeof Dialog == 'undefined') +{ + // htmlArea v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc. + // This copyright notice MUST stay intact for use (see license.txt). + // + // Portions (c) dynarch.com, 2003-2004 + // + // A free WYSIWYG editor replacement for + +
    + + +
    Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertNote/img/insert-note.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertNote/img/insert-note.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/InsertPagebreak.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/InsertPagebreak.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/InsertPagebreak.js 3 Jan 2016 20:48:56 -0000 1.1.2.1 @@ -0,0 +1,43 @@ +// InsertPagebreak plugin for HTMLArea/Xinha +// Implementation by Udo Schmal & Schaffrath NeueMedien +// Original Author - Udo Schmal +// +// (c) Udo Schmal & Schaffrath NeueMedien 2004 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +function InsertPagebreak(editor, args) { + this.editor = editor; + var cfg = editor.config; + var self = this; + + cfg.registerButton({ + id : "pagebreak", + tooltip : this._lc("Page break"), + image : editor.imgURL("pagebreak.gif", "InsertPagebreak"), + textMode : false, + action : function(editor) { + self.buttonPress(editor); + } + }); + cfg.addToolbarElement("pagebreak", "inserthorizontalrule", 1); +} + +InsertPagebreak._pluginInfo = { + name : "InsertPagebreak", + version : "1.0", + developer : "Udo Schmal", + developer_url : "", + sponsor : "L.N.Schaffrath NeueMedien", + sponsor_url : "http://www.schaffrath-neuemedien.de/", + c_owner : "Udo Schmal & Schaffrath NeueMedien", + license : "htmlArea" +}; + +InsertPagebreak.prototype._lc = function(string) { + return Xinha._lc(string, 'InsertPagebreak'); +}; + +InsertPagebreak.prototype.buttonPress = function(editor, context, updatecontextclass) { + editor.insertHTML('
    '); +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/insert-pagebreak.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/insert-pagebreak.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/insert-pagebreak.js 3 Jan 2016 20:48:56 -0000 1.1.2.1 @@ -0,0 +1,20 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/InsertPagebreak/insert-pagebreak.js */ +function InsertPagebreak(_1,_2){ +this.editor=_1; +var _3=_1.config; +var _4=this; +_3.registerButton({id:"pagebreak",tooltip:this._lc("Page break"),image:_1.imgURL("pagebreak.gif","InsertPagebreak"),textMode:false,action:function(_5){ +_4.buttonPress(_5); +}}); +_3.addToolbarElement("pagebreak","inserthorizontalrule",1); +} +InsertPagebreak._pluginInfo={name:"InsertPagebreak",version:"1.0",developer:"Udo Schmal",developer_url:"",sponsor:"L.N.Schaffrath NeueMedien",sponsor_url:"http://www.schaffrath-neuemedien.de/",c_owner:"Udo Schmal & Schaffrath NeueMedien",license:"htmlArea"}; +InsertPagebreak.prototype._lc=function(_6){ +return Xinha._lc(_6,"InsertPagebreak"); +}; +InsertPagebreak.prototype.buttonPress=function(_7,_8,_9){ +_7.insertHTML("
    "); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/img/pagebreak.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/img/pagebreak.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/de.js 3 Jan 2016 20:48:57 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 | ISO-8859-1 +// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "Page break": "Neue Seite" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/fr.js 3 Jan 2016 20:48:57 -0000 1.1.2.1 @@ -0,0 +1,5 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Page break": "Séparateur de page" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/ja.js 3 Jan 2016 20:48:57 -0000 1.1.2.1 @@ -0,0 +1,5 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Page break": "改ページ" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/nb.js 3 Jan 2016 20:48:57 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Page break": "Sett inn sideskift" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/nl.js 3 Jan 2016 20:48:58 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Page break": "Pagina einde" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/no.js 3 Jan 2016 20:48:58 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Page break": "Sett inn sideskift" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPagebreak/lang/pt_br.js 3 Jan 2016 20:48:58 -0000 1.1.2.1 @@ -0,0 +1,18 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Page break": "Quebra de página" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/InsertPicture.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/InsertPicture.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/InsertPicture.php 3 Jan 2016 20:48:58 -0000 1.1.2.1 @@ -0,0 +1,301 @@ += 1024 && $size < 1024*1024) + return sprintf('%01.2f',$size/1024.0).' Kb'; + else + return sprintf('%01.2f',$size/(1024.0*1024)).' Mb'; + } + $DestFileName = ""; + if (isset($_FILES['file'])) { + $file = $_FILES['file']; + $ext = strrchr($file['name'],'.'); + if (!in_array($ext,$limitedext)) + $message = "The file you are uploading doesn't have the correct extension."; + else if (file_exists($LocalPicturePath.$file['name'])) + $message = "The file you are uploading already exists."; + else if ($file['size'] > $limitedsize) + $message = "The file you are uploading is to big. The max Filesize is ".formatSize($limitedsize)."."; + else + copy($file['tmp_name'], $LocalPicturePath.$file['name']); + $DestFileName = $file['name']; + } +?> + + + Insert Image + + + + + + +
    Insert Image
    + + + + + + + +
    Images on the Server:
    + + +
    + + +
    +
    + +
    + +
    + Image Preview: +
    + +
    + +
    + + + + + + + + + + + + + + + +
    Image URL: + +
    Alternate text:
    + +

    + +

    +Layout + +
    + +
    Alignment:
    + + +

    + +

    Border thickness:
    + +
    + +
    + +
    +Size + +
    + +
    Width:
    + +

    + +

    Height:
    + +
    + +
    + +
    +Spacing + +
    + +
    Horizontal:
    + +

    + +

    Vertical:
    + + +
    + +
    +
    + +
    + + +
    +
    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/insert-picture.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/insert-picture.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/insert-picture.js 3 Jan 2016 20:48:58 -0000 1.1.2.1 @@ -0,0 +1,12 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/InsertPicture/insert-picture.js */ +function InsertPicture(_1){ +if(typeof _editor_picturePath!=="string"){ +_editor_picturePath=Xinha.getPluginDir("InsertPicture")+"/demo_pictures/"; +} +InsertPicture.Scripting="php"; +_1.config.URIs.insert_image="../plugins/InsertPicture/InsertPicture."+InsertPicture.Scripting+"?picturepath="+_editor_picturePath; +} +InsertPicture._pluginInfo={name:"InsertPicture",version:"1.0.2",developer:"Udo Schmal",developer_url:"http://www.Schaffrath-NeueMedien.de/",sponsor:"L.N.Schaffrath NeueMedien",sponsor_url:"http://www.schaffrath-neuemedien.de/",c_owner:"Udo Schmal",license:"htmlArea"}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/viewpicture.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/viewpicture.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/viewpicture.html 3 Jan 2016 20:48:59 -0000 1.1.2.1 @@ -0,0 +1,46 @@ + + + + Preview + + + + + + + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/demo_pictures/bikerpeep.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/demo_pictures/bikerpeep.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/demo_pictures/wesnoth078.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/demo_pictures/wesnoth078.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/img/btn_open.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/img/btn_open.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/img/nopic.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/img/nopic.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/de.js 3 Jan 2016 20:49:00 -0000 1.1.2.1 @@ -0,0 +1,15 @@ +// LANG: "de", ENCODING: UTF-8 | ISO-8859-1 +// Sponsored by http://www.schaffrath-neuemedien.de +// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "The file you are uploading doesn't have the correct extension.": "Die hochgeladene Datei ist im falschen Format.", + "The file you are uploading already exists.": "Eine Datei mit diesem Namen existiert schon.", + "The file you are uploading is to big. The max Filesize is": "Die hochgeladene Datei ist zu groß. Die maximakle Dateigröße beträgt", + "Images on the Server:": "Bilder auf dem Server:", + "Please select a file to upload.": "Wählen Sie eine Datei zum hochladen aus.", + "Upload file": "Datei hochladen", + "Open file in new window": "Datei in neuen Fenster anzeigen", + "Size": "Größe", + "Width:": "Breite", + "Height:": "Höhe" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/fr.js 3 Jan 2016 20:49:00 -0000 1.1.2.1 @@ -0,0 +1,22 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Insert Image": "Insérer une image", + "Image Preview:": "Prévisualisation", + "Image URL:": "URL", + "Preview": "Prévisualisation", + "Alternate text:": "Texte alternatif", + "Layout": "Layout", + "Alignment:": "Alignement", + "Border thickness:": "Epaisseur bordure", + "Spacing": "Espacement", + "Horizontal:": "Horizontal", + "Vertical:": "Vertical", + "The file you are uploading doesn't have the correct extension.": "Le fichier que vous téléchargez ne possède pas la bonne extension.", + "The file you are uploading already exists.": "Le fichier que vous téléchargez existe déjà.", + "The file you are uploading is to big. The max Filesize is": "Le fichier que vous uploadez est trop gros. La taille maximum est", + "Images on the Server:": "Images sur le serveur", + "Please select a file to upload.": "Veuillez sélectionner un fichier a télécharger", + "Upload file": "Télécharger", + "Open file in new window": "Ouvrir le fichier dans une nouvelle fenêtre" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/ja.js 3 Jan 2016 20:49:00 -0000 1.1.2.1 @@ -0,0 +1,25 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Insert Image": "画像の挿入", + "Image Preview:": "画像プレビュー:", + "Image URL:": "画像URL:", + "Preview": "表示", + "Alternate text:": "代替テキスト:", + "Layout": "レイアウト", + "Alignment:": "行揃え:", + "Border thickness:": "境界線の幅:", + "Spacing": "間隔", + "Horizontal:": "水平:", + "Vertical:": "垂直:", + "The file you are uploading doesn't have the correct extension.": "アップロード対象ファイルに正しい拡張子がありません。", + "The file you are uploading already exists.": "アップロード対象ファイルはすでに存在します。", + "The file you are uploading is to big. The max Filesize is": "アップロード対象ファイルは大きすぎます。ファイルサイズの上限:", + "Images on the Server:": "サーバ上の画像:", + "Please select a file to upload.": "アップロードするファイルを選択してください。", + "Upload file": "UPLOAD FILE", + "Open file in new window": "新しいウィンドウでファイルを開く", + "Size": "サイズ", + "Width:": "幅:", + "Height:": "高さ:" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/nb.js 3 Jan 2016 20:49:00 -0000 1.1.2.1 @@ -0,0 +1,22 @@ +// LANG: "nb", ENCODING: UTF-8 | ISO-8859-1 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Insert Image": "Sett inn bilde", + "Image Preview:": "Forhåndsvisning:", + "Image URL:": "Bildets URL:", + "Preview": "Forhåndsvisning", + "Alternate text:": "Alternativ tekst", + "Layout": "Oppsett", + "Alignment:": "Plassering", + "Border thickness:": "Rammetykkelse:", + "Spacing": "Luft rundt bildet", + "Horizontal:": "Horisontal:", + "Vertical:": "Vertikal:", + "The file you are uploading doesn't have the correct extension.": "Bildet du laster opp har et ugyldig format, opplastning avbrutt", + "The file you are uploading already exists.": "Bildet du prøver å laste opp eksisterer allerede på serveren", + "The file you are uploading is to big. The max Filesize is": "Bildet du laster opp er for stort, maks tillatt størrelse er", + "Images on the Server:": "Bilder på serveren:", + "Please select a file to upload.": "Velg bilde du skal laste opp", + "Upload file": "Last opp bilde", + "Open file in new window": "Åpne bilde i nytt vindu" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/nl.js 3 Jan 2016 20:49:01 -0000 1.1.2.1 @@ -0,0 +1,35 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl + +{ + "Insert Image": "Afbeelding invoegen", + "Image Preview:": "Afbeeldingsvoorbeeld:", + "Image URL:": "Afbeelding URL:", + "Preview": "Voorbeeld", + "Alternate text:": "Alternatieve tekst:", + "Layout": "Weergave", + "Alignment:": "Positie:", + "Border thickness:": "Rand dikte:", + "Spacing": "Marge", + "Horizontal:": "Horizontaal:", + "Vertical:": "Verticaal:", + "The file you are uploading doesn't have the correct extension.": "Het bestand dat is geupload heeft niet de juiste extentie.", + "The file you are uploading already exists.": "Het bestand dat is geupload bestaat al.", + "The file you are uploading is to big. The max Filesize is": "Het bestand dat is geupload is te groot. De maximaal toegestane grootte is:", + "Images on the Server:": "Afbeeldingen op de server:", + "Please select a file to upload.": "Selecteer een bestand om te uploaden", + "Upload file": "Upload bestand", + "Size": "Grootte", + "Width:": "Breedte:", + "Height:": "Hoogte:", + // tooltips + "Enter the image URL here":"Afbeeldingslocatie (URL)", + "Preview the image in a new window": "Afbeelding bekijken in nieuw venster", + "For browsers that don't support images":"Voor browsers welke geen afbeeldingen ondersteunen", + "Positioning of this image": "Positie van de afbeelding", + "Leave empty for no border": "Leeg voor geen rand", + "Leave empty for not defined": "Leeg voor niet gedefinieerd", + "Horizontal padding": "Horizontale ruimte", + "Vertical padding": "Verticale ruimte" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/no.js 3 Jan 2016 20:49:01 -0000 1.1.2.1 @@ -0,0 +1,23 @@ +// LANG: "de", ENCODING: UTF-8 | ISO-8859-1 +// Sponsored by http://www.schaffrath-neuemedien.de +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Insert Image": "Sett inn bilde", + "Image Preview:": "Forhåndsvisning:", + "Image URL:": "Bildets URL:", + "Preview": "Forhåndsvisning", + "Alternate text:": "Alternativ tekst", + "Layout": "Oppsett", + "Alignment:": "Plassering", + "Border thickness:": "Rammetykkelse:", + "Spacing": "Luft rundt bildet", + "Horizontal:": "Horisontal:", + "Vertical:": "Vertikal:", + "The file you are uploading doesn't have the correct extension.": "Bildet du laster opp har et ugyldig format, opplastning avbrutt", + "The file you are uploading already exists.": "Bildet du prøver å laste opp eksisterer allerede på serveren", + "The file you are uploading is to big. The max Filesize is": "Bildet du laster opp er for stort, maks tillatt størrelse er", + "Images on the Server:": "Bilder på serveren:", + "Please select a file to upload.": "Velg bilde du skal laste opp", + "Upload file": "Last opp bilde", + "Open file in new window": "Åpne bilde i nytt vindu" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/pt_br.js 3 Jan 2016 20:49:01 -0000 1.1.2.1 @@ -0,0 +1,61 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + " Open file in new window": " Abrir arquivo em um nova janela", + "Absbottom": "Inferior Absoluto", + "Absmiddle": "Meio Absoluto", + "Alignment:": "Alinhamento:", + "Alternate text:": "Texto Alternativo:", + "Baseline": "Linha de Base", + "Border thickness:": "Espessura da Borda", + "Bottom": "Inferior", + "Cancel": "Cancelar", + "Enter the image URL here": "Entre aqui com a URL da imagem", + "For browsers that don't support images": "Para navegadores que não suportam imagens", + "Height:": "Altura:", + "Horizontal padding": "Espaço horizontal", + "Horizontal:": "Horizontal:", + "Image Preview:": "Visualização da Imagem:", + "Image URL:": "URL da Imagem:", + "Insert Image": "Inserir Imagem", + "Layout": "Esquema", + "Leave empty for no border": "Deixe em branco para sem bordas", + "Leave empty for not defined": "Deixe em branco para não definido", + "Left": "Esquerda", + "Middle": "Meio", + "Not set": "Não definido", + "OK": "OK", + "Open file in new window": "Abrir arquivo em uma nova janela", + "Positioning of this image": "Posicionamento desta imagem", + "Preview": "Visualização", + "Preview the image in a new window": "Visualizar imagem em uma nova janela", + "Right": "Direita", + "Size": "Tamanho", + "Spacing": "Espaço", + "Texttop": "Texto no topo", + "Top": "Topo", + "Upload file": "Enviar arquivo", + "Vertical padding": "Espaço vertical", + "Vertical:": "Vertical:", + "Width:": "Largura:", + + // not find with lc_parse_strings.php + "The file you are uploading doesn't have the correct extension.": "O arquivo que você está enviando não possuia a extensão correta.", + "The file you are uploading already exists.": "Já existe o arquivo que você está enviando.", + "The file you are uploading is to big. The max Filesize is": "O arquivo que você está enviando é muito grande. O tamanho máximo é", + "Images on the Server:": "Imagens no Servidor:", + "Please select a file to upload.": "Por favor, selecione um arquivo para enviar." +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/sv.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/sv.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertPicture/lang/sv.js 3 Jan 2016 20:49:01 -0000 1.1.2.1 @@ -0,0 +1,35 @@ +// I18N constants +// LANG: "sv", ENCODING: UTF-8 +// Swedish version for rev. 477 (Mar 2006) by Thomas Loo + +{ + "Insert Image": "Infoga bild", + "Image Preview:": "Förhandsgranskning:", + "Image URL:": "Bildens URL:", + "Preview": "Förhandsgranska", + "Alternate text:": "Alternativ text:", + "Layout": "Layout", + "Alignment:": "Placering:", + "Border thickness:": "Ramtjocklek:", + "Spacing": "Marginal", + "Horizontal:": "Horisontell:", + "Vertical:": "Vertikal:", + "The file you are uploading doesn't have the correct extension.": "Uppladdat bild har en ogiltig filändelse, uppladdning avbruten", + "The file you are uploading already exists.": "En fil med detta namn finns redan", + "The file you are uploading is to big. The max Filesize is": "Filen är för stor, maximal filstorlek är", + "Images on the Server:": "Bilder på servern:", + "Please select a file to upload.": "Välj bild att ladda upp", + "Upload file": "Ladda upp bild", + "Size": "Storlek", + "Width:": "Bredd:", + "Height:": "Höjd:", + // tooltips + "Enter the image URL here":"Bildens sökväg (URL)", + "Preview the image in a new window": "Öppna bild i nytt fönster", + "For browsers that don't support images":"Beskrivande text för webläsare som inte stödjer inbäddade bilder", + "Positioning of this image": "Bildens positionering", + "Leave empty for no border": "Lämna tomt för att undvika ram", + "Leave empty for not defined": "Lämna tomt för att låta webläsaren bestämma", + "Horizontal padding": "Horizontellt indrag på bild", + "Vertical padding": "Vertikalt indrag på bild" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/InsertSmiley.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/InsertSmiley.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/InsertSmiley.js 3 Jan 2016 20:49:01 -0000 1.1.2.1 @@ -0,0 +1,191 @@ +/*---------------------------------------*\ + Insert Smiley Plugin for Xinha + ----------------------------------------- + original author: Ki Master George (kimastergeorge@gmail.com) + rewritten: James Sleeman (james@gogo.co.nz) +\*---------------------------------------*/ + +InsertSmiley._pluginInfo = { + name : "InsertSmiley", + version : "2.0", + developer : "V 1.0 Ki Master George, V2.0 James Sleeman", + developer_url : "http://www.gogo.co.nz/", + c_owner : "Ki Master George, James Sleeman", + sponsor : "Gogo Internet Services", + sponsor_url : "http://www.gogo.co.nz/", + license : "htmlArea" +}; + +/** To configure the InsertSmiley plugin. + * + * Set xinha_config.InsertSmiley.smileys to EITHER + * + * * A URL to a file called smileys.js, which follows the format + * you can view in smileys/smileys.js + * + * * A URL to a file called smileys.php (or whatever other language) + * which outputs a file in the same way as smileys/smileys.php + * + * * A javascript the same as you will find in smileys/smileys.js + * + * By defaut the static smileys/smileys.js file is used, you may + * wish to set this like so + * + * xinha_config.InsertSmiley.smileys = _editor_url+'/plugins/InsertSmiley/smileys/smileys.php'; + * + * And then you can add new smileys just by dumping all the images into the + * /xinha/plugins/InsertSmiley/smileys/ + * folder and they will automatically be made available. + * + */ + +Xinha.Config.prototype.InsertSmiley= { + smileys : '' +}; + +Xinha.loadStyle('dialog.css', 'InsertSmiley'); + +function InsertSmiley(editor) { + this.editor = editor; + this.smileys = false; + this.dialog = false; + + var cfg = editor.config; + var self = this; + + // register the toolbar buttons provided by this plugin + cfg.registerButton({ + id : "insertsmiley", + tooltip : this._lc("Insert Smiley"), + image : editor.imgURL("ed_smiley.gif", "InsertSmiley"), + textMode : false, + action : function(editor) { + self.buttonPress(editor); + } + }); + + cfg.addToolbarElement("insertsmiley", "inserthorizontalrule", 1); +} + +InsertSmiley.prototype.onGenerateOnce = function() +{ + // Back compat for ray's smiley config in changeset:904 ( ticket:1093 ) + if(this.editor.config.InsertSmiley.smileyURL) + { + var smileys = [ ]; + var smileylist = Xinha._geturlcontent(Xinha.getPluginDir("InsertSmiley") + '/smileys.txt'); + var smileyURL = this.editor.config.InsertSmiley.smileyURL; + + smileylist = smileylist.match(/^.+$/mg); + for(var i = 0; i < smileylist.length; i++) + { + smileys[smileys.length] = { title: smileylist[i], src: smileyURL + encodeURIComponent(smileylist[i]) }; + } + this.editor.config.InsertSmiley.smileys = smileys; + } + + + this.loadAssets(); +}; + +InsertSmiley.prototype._lc = function(string) { + return Xinha._lc(string, 'InsertSmiley'); +}; + +/** Load the dialog and js files. + * + */ + +InsertSmiley.prototype.loadAssets = function() +{ + var self = this; + if (self.loading) return; + + if(typeof this.editor.config.InsertSmiley.smileys != 'string') + { + // Must be a smiley definition itself + this.smileys = this.editor.config.InsertSmiley.smileys; + this.smiley_base = _editor_url; // Doesn't make a lot of sense, we assume the smileys will have absolute paths anyway + } + else + { + var smileys_def = + this.editor.config.InsertSmiley.smileys + ? this.editor.config.InsertSmiley.smileys // URL to the smileys.js file, or somethign that creates it + : (Xinha.getPluginDir("InsertSmiley") + '/smileys/smileys.js'); // our own default one + + Xinha._getback( + smileys_def, + function(sm) { self.smileys = eval(sm); self.smileys_base = smileys_def.replace(/\/[^\/]+(\?.*)?$/, '/'); } + ); + } + + Xinha._getback( Xinha.getPluginDir("InsertSmiley") + '/dialog.html', function(html) { self.makeDialog(html); } ); +} + +/** Make the dialog + * + * @note It is really important that this happens throuh the onGenerateOnce event + * (in this case it goes onGenerateOnce -> loadAssets -> makeDialog) + * because otherwise creating the dialog can fail in mysterious ways (silent + * javascript exceptions in Gecko etc). + */ + +InsertSmiley.prototype.makeDialog = function(html) +{ + var self = this; + + // We can not make the dialog until the smileys are loaded, so wait a bit. + if(!this.smileys) + { + window.setTimeout(function() { self.makeDialog(html); }, 1000); + return; + } + + var dialog = new Xinha.Dialog(this.editor, html, 'InsertSmiley', {width:155, height:100}, {modal:false}); + + var src; + var s; + var a; + + for(var i = 0; i < this.smileys.length; i++) + { + src = this.smileys[i].src.match(/^(([a-zA-Z]+:\/\/)|\/)/) ? + this.smileys[i].src : this.smileys_base + this.smileys[i].src; + s = document.createElement('img'); + s.src = src; + s.alt = dialog._lc(this.smileys[i].title); + s.style.border = 'none'; + + a = document.createElement('a'); + a.href= 'javascript:void(0);'; + a.smiley_src = src; + a.title = dialog._lc(this.smileys[i].title); + + // This is where we insert the smiley into the HTML + Xinha.addDom0Event(a, 'click', function(ev) { self.editor.insertHTML(''+this.title+''); Xinha._stopEvent(window.event ? event : ev); return false; }); + + a.appendChild(s); + dialog.getElementById('smileys').appendChild(a); + + a = null; s = null; src = null; + } + + this.dialog = dialog; + return true; +} + +/** Show the dialog. + */ + +InsertSmiley.prototype.buttonPress = function(editor) { + if(this.dialog) + { + this.dialog.show(); + } + else + { + // Should put something here! + } + return; +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/README.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/README.txt,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/README.txt 3 Jan 2016 20:49:02 -0000 1.1.2.1 @@ -0,0 +1,13 @@ +A small number of smileys are included in this release. + +To add more smileys, + + 1. Dump as many as you would like as image files into the smileys folder (gif, jpg, png). + 2. EITHER: + a. Edit smileys/smileys.js as appropriate, or; + b. Set this Xinha configuration (if your server handles PHP ok) + + xinha_config.InsertSmiley.smileys = _editor_url+'/plugins/InsertSmiley/smileys/smileys.php'; + + it will automatically pickup the new smileys without you needing to edit the js file. + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/dialog.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/dialog.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/dialog.css 3 Jan 2016 20:49:02 -0000 1.1.2.1 @@ -0,0 +1,3 @@ +.insert-smiley a { + display:block; float:left; margin:2px; border:none !important; text-decoration:none !important; +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/dialog.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/dialog.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/dialog.html 3 Jan 2016 20:49:02 -0000 1.1.2.1 @@ -0,0 +1,4 @@ +

    Insert Smiley

    +
    + +
    \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/insert-smiley.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/insert-smiley.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/insert-smiley.js 3 Jan 2016 20:49:02 -0000 1.1.2.1 @@ -0,0 +1,27 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/InsertSmiley/insert-smiley.js */ +function InsertSmiley(_1){ +this.editor=_1; +var _2=_1.config; +var _3=this; +_2.registerButton({id:"insertsmiley",tooltip:this._lc("Insert Smiley"),image:_1.imgURL("ed_smiley.gif","InsertSmiley"),textMode:false,action:function(_4){ +_3.buttonPress(_4); +}}); +_2.addToolbarElement("insertsmiley","inserthorizontalrule",1); +} +InsertSmiley._pluginInfo={name:"InsertSmiley",version:"1.0",developer:"Ki Master George",developer_url:"http://kimastergeorge.i4host.com/",c_owner:"Ki Master George",sponsor:"Ki Master George",sponsor_url:"http://kimastergeorge.i4host.com/",license:"htmlArea"}; +InsertSmiley.prototype._lc=function(_5){ +return Xinha._lc(_5,"InsertSmiley"); +}; +Xinha.Config.prototype.InsertSmiley={smileyURL:"http://www.x-webservice.net/storage/xinha/plugins/InsertSmiley/"}; +InsertSmiley.prototype.buttonPress=function(_6){ +var _7=this; +var _8=_6.getSelectedHTML().replace(/(<[^>]*>| |\n|\r)/g,""); +var _9={}; +_9.editor=_6; +_6._popupDialog("plugin://InsertSmiley/insertsmiley",function(_a){ +_6.insertHTML("\"Smiley\""); +},_9); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys.txt,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys.txt 3 Jan 2016 20:49:02 -0000 1.1.2.1 @@ -0,0 +1,580 @@ +0001.gif +0002.gif +0003.gif +0004.gif +0005.gif +0006.gif +0007.gif +0008.gif +0009.gif +0010.gif +0011.gif +0012.gif +0013.gif +0014.gif +0015.gif +0016.gif +0017.gif +0018.gif +0019.gif +0020.gif +0021.gif +0022.gif +0023.gif +0024.gif +0025.gif +0026.gif +0027.gif +0028.gif +0029.gif +0030.gif +0031.gif +0032.gif +0033.gif +0034.gif +0035.gif +0036.gif +0037.gif +0038.gif +0039.gif +0040.gif +0041.gif +0042.gif +0043.gif +0044.gif +0045.gif +0046.gif +0047.gif +0048.gif +0049.gif +0050.gif +0051.gif +0052.gif +0053.gif +0054.gif +0055.gif +0056.gif +0057.gif +0058.gif +0059.gif +0060.gif +0061.gif +0062.gif +0063.gif +0064.gif +0065.gif +0066.gif +0067.gif +0068.gif +0069.gif +0070.gif +0071.gif +0072.gif +0073.gif +0074.gif +0075.gif +0076.gif +0077.gif +0078.gif +0079.gif +0080.gif +0081.gif +0082.gif +0083.gif +0084.gif +0085.gif +0086.gif +0087.gif +0088.gif +0089.gif +0090.gif +0091.gif +0092.gif +0093.gif +0094.gif +0095.gif +0096.gif +0097.gif +0098.gif +0099.gif +0100.gif +0101.gif +0102.gif +0103.gif +0104.gif +0105.gif +0106.gif +0107.gif +0108.gif +0109.gif +0110.gif +0111.gif +0112.gif +0113.gif +0114.gif +0115.gif +0116.gif +0117.gif +0118.gif +0119.gif +0120.gif +0121.gif +0122.gif +0123.gif +0124.gif +0125.gif +0126.gif +0127.gif +0128.gif +0129.gif +0130.gif +0131.gif +0132.gif +0133.gif +0134.gif +0135.gif +0136.gif +0137.gif +0138.gif +0139.gif +0140.gif +0141.gif +0142.gif +0143.gif +0144.gif +0145.gif +0146.gif +0147.gif +0148.gif +0149.gif +0150.gif +0151.gif +0152.gif +0153.gif +0154.gif +0155.gif +0156.gif +0157.gif +0158.gif +0159.gif +0160.gif +0161.gif +0162.gif +0163.gif +0164.gif +0165.gif +0166.gif +0167.gif +0168.gif +0169.gif +0170.gif +0171.gif +0172.gif +0173.gif +0174.gif +0175.gif +0176.gif +0177.gif +0178.gif +0179.gif +0180.gif +0181.gif +0182.gif +0183.gif +0184.gif +0185.gif +0186.gif +0187.gif +0188.gif +0189.gif +0190.gif +0191.gif +0192.gif +0193.gif +0194.gif +0195.gif +0196.gif +0197.gif +0198.gif +0199.gif +0200.gif +0201.gif +0202.gif +0203.gif +0204.gif +0205.gif +0206.gif +0207.gif +0208.gif +0209.gif +0210.gif +0211.gif +0212.gif +0213.gif +0214.gif +0215.gif +0216.gif +0217.gif +0218.gif +0219.gif +0220.gif +0221.gif +0222.gif +0223.gif +0224.gif +0225.gif +0226.gif +0227.gif +0228.gif +0229.gif +0230.gif +0231.gif +0232.gif +0233.gif +0234.gif +0235.gif +0236.gif +0237.gif +0238.gif +0239.gif +0240.gif +0241.gif +0242.gif +0243.gif +0244.gif +0245.gif +0246.gif +0247.gif +0248.gif +0249.gif +0250.gif +0251.gif +0252.gif +0253.gif +0254.gif +0255.gif +0256.gif +0257.gif +0258.gif +0259.gif +0260.gif +0261.gif +0262.gif +0263.gif +0264.gif +0265.gif +0266.gif +0267.gif +0268.gif +0269.gif +0270.gif +0271.gif +0272.gif +0273.gif +0274.gif +0275.gif +0276.gif +0277.gif +0278.gif +0279.gif +0280.gif +0281.gif +0282.gif +0283.gif +0284.gif +0285.gif +0286.gif +0287.gif +0288.gif +0289.gif +0290.gif +0291.gif +0292.gif +0293.gif +0294.gif +0295.gif +0296.gif +0297.gif +0298.gif +0299.gif +0300.gif +0301.gif +0302.gif +0303.gif +0304.gif +0305.gif +0306.gif +0307.gif +0308.gif +0309.gif +0310.gif +0311.gif +0312.gif +0313.gif +0314.gif +0315.gif +0316.gif +0317.gif +0318.gif +0319.gif +0320.gif +0321.gif +0322.gif +0323.gif +0324.gif +0325.gif +0326.gif +0327.gif +0328.gif +0329.gif +0330.gif +0331.gif +0332.gif +0333.gif +0334.gif +0335.gif +0336.gif +0337.gif +0338.gif +0339.gif +0340.gif +0341.gif +0342.gif +0343.gif +0344.gif +0345.gif +0346.gif +0347.gif +0348.gif +0349.gif +0350.gif +0351.gif +0352.gif +0353.gif +0354.gif +0355.gif +0356.gif +0357.gif +0358.gif +0359.gif +0360.gif +0361.gif +0362.gif +0363.gif +0364.gif +0365.gif +0366.gif +0367.gif +0368.gif +0369.gif +0370.gif +0371.gif +0372.gif +0373.gif +0374.gif +0375.gif +0376.gif +0377.gif +0378.gif +0379.gif +0380.gif +0381.gif +0382.gif +0383.gif +0384.gif +0385.gif +0386.gif +0387.gif +0388.gif +0389.gif +0390.gif +0391.gif +0392.gif +0393.gif +0394.gif +0395.gif +0396.gif +0397.gif +0398.gif +0399.gif +0400.gif +0401.gif +0402.gif +0403.gif +0404.gif +0405.gif +0406.gif +0407.gif +0408.gif +0409.gif +0410.gif +0411.gif +0412.gif +0413.gif +0414.gif +0415.gif +0416.gif +0417.gif +0418.gif +0419.gif +0420.gif +0421.gif +0422.gif +0423.gif +0424.gif +0425.gif +0426.gif +0427.gif +0428.gif +0429.gif +0430.gif +0431.gif +0432.gif +0433.gif +0434.gif +0435.gif +0436.gif +0437.gif +0438.gif +0439.gif +0440.gif +0441.gif +0442.gif +0443.gif +0444.gif +0445.gif +0446.gif +0447.gif +0448.gif +0449.gif +0450.gif +0451.gif +0452.gif +0453.gif +0454.gif +0455.gif +0456.gif +0457.gif +0458.gif +0459.gif +0460.gif +0461.gif +0462.gif +0463.gif +0464.gif +0465.gif +0466.gif +0467.gif +0468.gif +0469.gif +0470.gif +0471.gif +0472.gif +0473.gif +0474.gif +0475.gif +0476.gif +0477.gif +0478.gif +0479.gif +0480.gif +0481.gif +0482.gif +0483.gif +0484.gif +0485.gif +0486.gif +0487.gif +0488.gif +0489.gif +0490.gif +0491.gif +0492.gif +0493.gif +0494.gif +0495.gif +0496.gif +0497.gif +0498.gif +0499.gif +0500.gif +0501.gif +0502.gif +0503.gif +0504.gif +0505.gif +0506.gif +0507.gif +0508.gif +0509.gif +0510.gif +0511.gif +0512.gif +0513.gif +0514.gif +0515.gif +0516.gif +0517.gif +0518.gif +0519.gif +0520.gif +0521.gif +0522.gif +0523.gif +0524.gif +0525.gif +0526.gif +0527.gif +0528.gif +0529.gif +0530.gif +0531.gif +0532.gif +0533.gif +0534.gif +0535.gif +0536.gif +0537.gif +0538.gif +0539.gif +0540.gif +0541.gif +0542.gif +0543.gif +0544.gif +0545.gif +0546.gif +0547.gif +0548.gif +0549.gif +0550.gif +0551.gif +0552.gif +0553.gif +0554.gif +0555.gif +0556.gif +0557.gif +0558.gif +0559.gif +0560.gif +0561.gif +0562.gif +0563.gif +0564.gif +0565.gif +0566.gif +0567.gif +0568.gif +0569.gif +0570.gif +0571.gif +0572.gif +0573.gif +0574.gif +0575.gif +0576.gif +0577.gif +0578.gif +0579.gif +0580.gif Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/img/ed_smiley.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/img/ed_smiley.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/de.js 3 Jan 2016 20:49:03 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +{ + "Insert Smiley": "Smiley einfügen", + "Smiley": "Smiley", + "Cancel": "Abbrechen" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/fr.js 3 Jan 2016 20:49:03 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Insert Smiley": "Insérer un smiley", + "Smiley": "Smiley", + "Cancel": "Annuler" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/ja.js 3 Jan 2016 20:49:03 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Insert Smiley": "スマイリーの挿入", + "Smiley": "スマイリー", + "Cancel": "中止" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/nb.js 3 Jan 2016 20:49:03 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Insert Smiley": "Sett inn smiley", + "Smiley": "Smiley", + "Cancel": "Avbryt" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/nl.js 3 Jan 2016 20:49:04 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Insert Smiley": "Smiley invoegen", + "Smiley": "Smiley", + "Cancel": "Annuleren" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/no.js 3 Jan 2016 20:49:04 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Insert Smiley": "Sett inn smiley", + "Smiley": "Smiley", + "Cancel": "Avbryt" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/lang/pt_br.js 3 Jan 2016 20:49:04 -0000 1.1.2.1 @@ -0,0 +1,19 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Cancel": "Cancelar", + "Insert Smiley": "Inserir Smiley" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/popups/insertsmiley.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/popups/insertsmiley.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/popups/insertsmiley.html 3 Jan 2016 20:49:04 -0000 1.1.2.1 @@ -0,0 +1,64 @@ + + +Insert Smiley + + + + + + + +
    +
    Insert Smiley
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0001.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0001.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0002.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0002.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0003.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0003.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0004.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0004.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0005.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0005.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0006.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0006.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0007.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0007.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0008.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0008.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0009.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0009.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0010.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0010.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0011.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0011.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0012.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0012.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0013.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0013.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0014.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0014.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0015.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0015.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0016.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0016.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0017.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0017.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0018.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0018.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0019.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0019.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0020.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0020.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0021.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0021.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0022.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0022.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0023.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0023.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0024.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0024.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0025.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0025.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0026.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0026.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0027.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0027.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0028.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0028.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0029.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0029.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0030.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0030.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0031.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0031.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0032.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0032.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0033.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0033.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0034.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0034.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0035.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0035.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0036.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0036.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0037.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0037.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0038.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0038.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0039.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0039.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0040.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0040.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0041.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0041.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0042.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0042.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0043.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0043.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0044.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0044.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0045.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0045.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0046.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0046.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0047.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0047.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0048.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0048.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0049.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0049.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0050.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0050.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0051.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0051.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0052.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0052.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0053.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0053.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0054.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0054.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0055.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0055.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0056.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0056.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0057.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0057.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0058.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0058.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0059.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0059.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0060.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0060.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0061.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0061.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0062.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0062.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0063.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0063.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0064.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0064.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0065.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0065.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0066.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0066.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0067.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0067.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0068.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0068.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0069.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0069.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0070.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0070.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0071.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0071.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0072.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0072.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0073.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0073.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0074.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0074.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0075.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0075.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0076.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0076.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0077.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0077.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0078.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0078.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0079.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0079.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0080.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0080.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0081.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0081.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0082.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0082.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0083.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0083.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0084.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0084.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0085.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0085.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0086.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0086.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0087.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0087.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0088.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0088.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0089.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0089.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0090.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0090.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0091.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0091.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0092.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0092.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0093.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0093.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0094.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0094.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0095.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0095.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0096.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0096.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0097.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0097.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0098.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0098.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0099.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0099.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0100.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0100.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0101.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0101.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0102.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0102.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0103.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0103.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0104.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0104.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0105.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0105.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0106.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0106.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0107.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0107.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0108.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0108.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0109.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0109.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0110.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0110.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0111.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0111.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0112.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0112.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0113.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0113.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0114.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0114.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0115.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0115.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0116.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0116.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0117.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0117.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0118.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0118.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0119.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0119.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0120.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0120.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0121.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0121.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0122.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0122.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0123.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0123.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0124.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0124.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0125.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0125.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0126.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0126.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0127.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0127.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0128.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0128.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0129.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0129.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0130.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0130.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0131.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0131.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0132.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0132.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0133.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0133.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0134.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0134.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0135.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0135.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0136.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0136.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0137.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0137.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0138.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0138.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0139.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0139.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0140.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0140.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0141.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0141.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0142.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0142.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0143.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0143.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0144.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0144.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0145.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0145.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0146.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0146.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0147.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0147.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0148.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0148.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0149.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0149.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0150.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0150.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0151.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0151.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0152.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0152.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0153.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0153.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0154.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0154.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0155.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0155.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0156.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0156.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0157.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0157.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0158.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0158.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0159.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0159.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0160.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0160.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0161.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0161.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0162.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0162.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0163.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0163.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0164.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0164.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0165.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0165.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0166.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0166.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0167.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0167.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0168.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0168.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0169.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0169.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0170.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0170.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0171.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0171.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0172.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0172.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0173.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0173.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0174.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0174.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0175.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0175.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0176.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0176.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0177.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0177.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0178.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0178.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0179.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0179.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0180.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0180.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0181.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0181.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0182.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0182.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0183.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0183.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0184.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0184.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0185.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0185.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0186.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0186.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0187.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0187.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0188.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0188.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0189.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0189.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0190.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0190.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0191.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0191.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0192.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0192.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0193.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0193.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0194.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0194.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0195.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0195.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0196.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0196.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0197.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0197.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0198.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0198.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0199.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0199.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0200.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0200.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0201.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0201.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0202.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0202.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0203.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0203.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0204.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0204.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0205.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0205.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0206.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0206.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0207.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0207.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0208.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0208.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0209.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0209.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0210.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0210.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0211.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0211.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0212.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0212.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0213.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0213.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0214.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0214.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0215.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0215.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0216.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0216.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0217.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0217.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0218.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0218.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0219.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0219.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0220.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0220.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0221.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0221.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0222.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0222.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0223.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0223.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0224.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0224.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0225.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0225.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0226.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0226.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0227.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0227.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0228.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0228.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0229.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0229.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0230.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0230.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0231.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0231.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0232.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0232.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0233.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0233.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0234.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0234.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0235.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0235.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0236.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0236.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0237.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0237.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0238.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0238.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0239.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0239.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0240.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0240.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0241.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0241.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0242.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0242.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0243.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0243.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0244.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0244.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0245.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0245.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0246.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0246.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0247.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0247.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0248.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0248.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0249.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0249.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0250.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0250.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0251.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0251.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0252.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0252.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0253.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0253.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0254.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0254.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0255.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0255.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0256.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0256.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0257.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0257.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0258.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0258.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0259.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0259.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0260.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0260.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0261.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0261.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0262.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0262.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0263.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0263.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0264.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0264.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0265.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0265.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0266.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0266.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0267.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0267.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0268.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0268.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0269.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0269.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0270.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0270.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0271.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0271.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0272.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0272.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0273.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0273.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0274.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0274.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0275.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0275.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0276.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0276.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0277.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0277.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0278.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0278.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0279.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0279.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0280.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0280.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0281.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0281.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0282.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0282.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0283.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0283.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0284.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0284.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0285.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0285.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0286.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0286.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0287.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0287.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0288.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0288.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0289.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0289.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0290.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0290.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0291.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0291.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0292.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0292.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0293.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0293.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0294.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0294.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0295.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0295.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0296.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0296.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0297.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0297.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0298.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0298.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0299.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0299.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0300.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0300.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0301.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0301.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0302.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0302.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0303.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0303.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0304.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0304.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0305.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0305.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0306.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0306.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0307.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0307.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0308.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0308.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0309.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0309.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0310.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0310.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0311.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0311.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0312.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0312.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0313.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0313.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0314.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0314.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0315.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0315.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0316.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0316.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0317.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0317.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0318.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0318.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0319.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0319.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0320.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0320.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0321.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0321.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0322.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0322.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0323.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0323.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0324.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0324.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0325.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0325.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0326.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0326.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0327.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0327.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0328.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0328.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0329.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0329.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0330.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0330.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0331.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0331.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0332.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0332.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0333.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0333.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0334.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0334.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0335.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0335.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0336.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0336.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0337.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0337.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0338.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0338.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0339.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0339.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0340.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0340.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0341.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0341.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0342.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0342.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0343.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0343.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0344.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0344.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0345.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0345.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0346.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0346.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0347.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0347.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0348.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0348.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0349.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0349.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0350.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0350.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0351.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0351.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0352.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0352.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0353.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0353.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0354.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0354.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0355.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0355.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0356.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0356.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0357.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0357.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0358.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0358.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0359.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0359.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0360.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0360.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0361.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0361.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0362.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0362.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0363.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0363.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0364.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0364.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0365.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0365.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0366.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0366.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0367.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0367.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0368.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0368.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0369.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0369.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0370.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0370.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0371.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0371.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0372.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0372.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0373.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0373.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0374.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0374.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0375.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0375.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0376.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0376.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0377.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0377.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0378.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0378.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0379.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0379.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0380.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0380.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0381.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0381.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0382.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0382.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0383.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0383.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0384.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0384.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0385.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0385.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0386.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0386.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0387.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0387.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0388.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0388.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0389.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0389.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0390.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0390.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0391.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0391.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0392.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0392.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0393.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0393.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0394.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0394.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0395.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0395.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0396.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0396.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0397.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0397.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0398.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0398.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0399.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0399.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0400.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0400.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0401.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0401.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0402.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0402.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0403.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0403.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0404.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0404.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0405.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0405.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0406.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0406.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0407.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0407.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0408.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0408.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0409.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0409.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0410.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0410.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0411.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0411.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0412.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0412.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0413.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0413.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0414.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0414.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0415.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0415.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0416.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0416.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0417.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0417.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0418.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0418.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0419.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0419.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0420.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0420.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0421.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0421.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0422.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0422.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0423.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0423.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0424.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0424.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0425.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0425.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0426.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0426.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0427.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0427.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0428.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0428.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0429.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0429.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0430.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0430.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0431.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0431.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0432.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0432.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0433.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0433.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0434.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0434.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0435.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0435.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0436.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0436.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0437.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0437.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0438.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0438.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0439.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0439.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0440.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0440.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0441.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0441.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0442.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0442.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0443.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0443.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0444.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0444.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0445.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0445.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0446.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0446.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0447.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0447.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0448.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0448.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0449.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0449.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0450.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0450.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0451.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0451.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0452.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0452.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0453.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0453.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0454.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0454.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0455.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0455.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0456.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0456.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0457.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0457.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0458.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0458.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0459.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0459.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0460.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0460.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0461.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0461.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0462.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0462.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0463.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0463.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0464.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0464.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0465.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0465.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0466.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0466.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0467.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0467.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0468.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0468.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0469.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0469.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0470.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0470.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0471.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0471.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0472.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0472.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0473.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0473.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0474.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0474.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0475.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0475.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0476.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0476.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0477.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0477.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0478.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0478.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0479.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0479.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0480.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0480.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0481.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0481.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0482.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0482.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0483.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0483.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0484.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0484.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0485.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0485.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0486.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0486.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0487.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0487.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0488.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0488.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0489.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0489.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0490.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0490.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0491.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0491.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0492.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0492.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0493.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0493.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0494.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0494.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0495.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0495.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0496.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0496.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0497.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0497.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0498.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0498.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0499.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0499.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0500.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0500.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0501.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0501.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0502.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0502.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0503.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0503.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0504.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0504.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0505.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0505.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0506.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0506.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0507.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0507.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0508.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0508.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0509.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0509.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0510.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0510.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0511.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0511.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0512.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0512.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0513.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0513.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0514.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0514.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0515.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0515.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0516.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0516.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0517.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0517.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0518.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0518.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0519.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0519.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0520.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0520.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0521.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0521.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0522.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0522.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0523.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0523.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0524.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0524.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0525.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0525.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0526.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0526.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0527.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0527.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0528.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0528.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0529.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0529.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0530.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0530.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0531.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0531.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0532.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0532.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0533.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0533.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0534.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0534.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0535.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0535.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0536.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0536.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0537.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0537.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0538.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0538.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0539.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0539.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0540.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0540.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0541.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0541.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0542.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0542.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0543.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0543.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0544.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0544.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0545.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0545.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0546.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0546.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0547.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0547.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0548.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0548.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0549.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0549.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0550.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0550.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0551.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0551.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0552.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0552.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0553.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0553.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0554.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0554.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0555.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0555.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0556.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0556.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0557.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0557.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0558.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0558.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0559.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0559.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0560.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0560.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0561.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0561.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0562.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0562.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0563.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0563.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0564.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0564.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0565.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0565.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0566.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0566.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0567.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0567.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0568.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0568.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0569.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0569.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0570.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0570.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0571.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0571.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0572.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0572.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0573.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0573.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0574.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0574.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0575.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0575.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0576.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0576.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0577.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0577.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0578.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0578.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0579.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0579.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0580.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/0580.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Angry.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Angry.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Cool.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Cool.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Excited.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Excited.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Grin.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Grin.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Pleased.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Pleased.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Sad.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Sad.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Surprised.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Surprised.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Wink.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/Wink.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/smileys.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/smileys.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/smileys.js 3 Jan 2016 20:51:01 -0000 1.1.2.1 @@ -0,0 +1,10 @@ +[ + { title: 'Grin', src: 'Grin.gif' }, + { title: 'Angry', src: 'Angry.gif' }, + { title: 'Excited', src: 'Excited.gif' }, + { title: 'Cool', src: 'Cool.gif' }, + { title: 'Wink', src: 'Wink.gif' }, + { title: 'Surprised', src: 'Surprised.gif' }, + { title: 'Sad', src: 'Sad.gif' }, + { title: 'Pleased', src: 'Pleased.gif' } +] \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/smileys.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/smileys.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSmiley/smileys/smileys.php 3 Jan 2016 20:51:01 -0000 1.1.2.1 @@ -0,0 +1,34 @@ + $M[1], 'src'=> $f); + } + } + closedir($dh); + + + echo xinha_to_js($smileys); + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/InsertSnippet.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/InsertSnippet.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/InsertSnippet.css 3 Jan 2016 20:51:01 -0000 1.1.2.1 @@ -0,0 +1,93 @@ +.navi_links { + width: 177px; + margin: 0; + padding: 0px; + list-style:none; + border: none; +} + +.navi_links li { + margin:0 0 3px 0; +} + +.navi_links li a { + font-size: 13px; + line-height: 16px; + height: 16px; + display:block; + color:#000; + text-decoration: none; + font-weight: bold; + background-color: #fff; + cursor: pointer; + border: 2px solid white; + +} + +.Link1 { +background-color: #DF1D1F !important; + +} + +.Link2 { +background-color: #F9A413 !important; + +} + +.Link3 { +background-color: #167730 !important; +} + +.Link4 { +background-color: #233350 !important; +} + +.Link5 { +background-color: #70685B !important; +} + +a.Link1:hover span{ +background-color: #DF1D1F !important; +} + +a.Link2:hover span { +background-color: #F9A413 !important; + +} + +.Link3:hover span { +background-color: #167730 !important; +color:white; +} + +.Link4:hover span { +background-color: #233350 !important; +color:white; +} + +.Link5:hover span { +background-color: #70685B !important; +color:white; +} + +.navi_links li a span { + height: 16px; + text-indent: 4px; + display:block; + margin-left: 15px; + background-color: #FFF; +} + +div.message_box { +border: dotted 1px black; +margin: 1em; +padding:1em; +} + +.red { +color:red; +} + +.green { +color:green; +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/InsertSnippet.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/InsertSnippet.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/InsertSnippet.js 3 Jan 2016 20:51:01 -0000 1.1.2.1 @@ -0,0 +1,92 @@ +/*------------------------------------------*\ + InsertSnippet for Xinha + _______________________ + + Insert HTML fragments or template variables + +\*------------------------------------------*/ + +function InsertSnippet(editor) { + this.editor = editor; + + var cfg = editor.config; + var self = this; + + + cfg.registerButton({ + id : "insertsnippet", + tooltip : this._lc("Insert Snippet"), + image : editor.imgURL("ed_snippet.gif", "InsertSnippet"), + textMode : false, + action : function(editor) { + self.buttonPress(editor); + } + }); + cfg.addToolbarElement("insertsnippet", "insertimage", -1); + this.snippets = null; + var backend = cfg.InsertSnippet.snippets + '?'; + + if(cfg.InsertSnippet.backend_data != null) + { + for ( var i in cfg.InsertSnippet.backend_data ) + { + backend += '&' + i + '=' + encodeURIComponent(cfg.InsertSnippet.backend_data[i]); + } + } + Xinha._getback(backend,function (getback) {eval(getback); self.snippets = snippets;}); +} + +InsertSnippet.prototype.onUpdateToolbar = function() { + if (!this.snippets){ + this.editor._toolbarObjects.insertsnippet.state("enabled", false); + } + else InsertSnippet.prototype.onUpdateToolbar = null; +} + +InsertSnippet._pluginInfo = { + name : "InsertSnippet", + version : "1.2", + developer : "Raimund Meyer", + developer_url : "http://x-webservice.net", + c_owner : "Raimund Meyer", + sponsor : "", + sponsor_url : "", + license : "htmlArea" +}; + +InsertSnippet.prototype._lc = function(string) { + return Xinha._lc(string, 'InsertSnippet'); +}; + +InsertSnippet.prototype.onGenerate = function() { + this.editor.addEditorStylesheet(Xinha.getPluginDir("InsertSnippet") + '/InsertSnippet.css'); +}; + +Xinha.Config.prototype.InsertSnippet = +{ + 'snippets' : Xinha.getPluginDir("InsertSnippet")+"/demosnippets.js", // purely demo purposes, you should change this + 'css' : ['../InsertSnippet.css'], //deprecated, CSS is now pulled from xinha_config + 'showInsertVariable': false, + 'backend_data' : null +}; + +InsertSnippet.prototype.buttonPress = function(editor) { + var args = editor.config; + args.snippets = this.snippets; + var self = this; + editor._popupDialog( "plugin://InsertSnippet/insertsnippet", function( param ) { + + if ( !param ) { + return false; + } + + + editor.focusEditor(); + if (param['how'] == 'variable') { + editor.insertHTML('{'+self.snippets[param["snippetnum"]].id+'}'); + } else { + editor.insertHTML(self.snippets[param["snippetnum"]].HTML); + } + + }, args); + }; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/demosnippets.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/demosnippets.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/demosnippets.js 3 Jan 2016 20:51:02 -0000 1.1.2.1 @@ -0,0 +1,15 @@ +var snippets = []; +var i = 0; +snippets[i] = {}; +snippets[i]['id'] = 'Box 1'; +snippets[i]['HTML'] = '
    \n Visit the Xinha website
    '; + +i++; +snippets[i] = {}; +snippets[i]['id'] = 'INFORMATION ABOUT SOMETHING'; +snippets[i]['HTML'] = '
    \n This is an information about something\n
    '; + +i++; +snippets[i] = {}; +snippets[i]['id'] = 'Menu'; +snippets[i]['HTML'] = ''; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/insert-snippet.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/insert-snippet.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/insert-snippet.js 3 Jan 2016 20:51:02 -0000 1.1.2.1 @@ -0,0 +1,55 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/InsertSnippet/insert-snippet.js */ +function InsertSnippet(_1){ +this.editor=_1; +var _2=_1.config; +var _3=this; +_2.registerButton({id:"insertsnippet",tooltip:this._lc("Insert Snippet"),image:_1.imgURL("ed_snippet.gif","InsertSnippet"),textMode:false,action:function(_4){ +_3.buttonPress(_4); +}}); +_2.addToolbarElement("insertsnippet","insertimage",-1); +this.snippets=null; +var _5=_2.InsertSnippet.snippets+"?"; +if(_2.InsertSnippet.backend_data!=null){ +for(var i in _2.InsertSnippet.backend_data){ +_5+="&"+i+"="+encodeURIComponent(_2.InsertSnippet.backend_data[i]); +} +} +Xinha._getback(_5,function(_7){ +eval(_7); +_3.snippets=snippets; +}); +} +InsertSnippet.prototype.onUpdateToolbar=function(){ +if(!this.snippets){ +this.editor._toolbarObjects.insertsnippet.state("enabled",false); +}else{ +InsertSnippet.prototype.onUpdateToolbar=null; +} +}; +InsertSnippet._pluginInfo={name:"InsertSnippet",version:"1.2",developer:"Raimund Meyer",developer_url:"http://rheinauf.de",c_owner:"Raimund Meyer",sponsor:"",sponsor_url:"",license:"htmlArea"}; +InsertSnippet.prototype._lc=function(_8){ +return Xinha._lc(_8,"InsertSnippet"); +}; +InsertSnippet.prototype.onGenerate=function(){ +this.editor.addEditorStylesheet(Xinha.getPluginDir("InsertSnippet")+"/InsertSnippet.css"); +}; +Xinha.Config.prototype.InsertSnippet={"snippets":Xinha.getPluginDir("InsertSnippet")+"/demosnippets.js","css":["../InsertSnippet.css"],"showInsertVariable":false,"backend_data":null}; +InsertSnippet.prototype.buttonPress=function(_9){ +var _a=_9.config; +_a.snippets=this.snippets; +var _b=this; +_9._popupDialog("plugin://InsertSnippet/insertsnippet",function(_c){ +if(!_c){ +return false; +} +_9.focusEditor(); +if(_c["how"]=="variable"){ +_9.insertHTML("{"+_b.snippets[_c["snippetnum"]].id+"}"); +}else{ +_9.insertHTML(_b.snippets[_c["snippetnum"]].HTML); +} +},_a); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/readme.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/readme.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/readme.html 3 Jan 2016 20:51:02 -0000 1.1.2.1 @@ -0,0 +1,57 @@ + + + + + InsertSnippet for Xinha + + + + + +

    InsertSnippet for Xinha

    +

    Insert HTML fragments in your document. + +

    +

    Usage

    +

    +In order to use your own snippets you have to add at least one parameter to your xinha_config: +

    +
    +xinha_config.InsertSnippet.snippets = Xinha.getPluginDir('InsertSnippet') + "/snippets.php";
    +
    +

    +The path above indicates the use of the provided backend. This parses a file that contains the snippets and +should have the following format: +

    +
    +<!--Snippet ID-->
    +Snippet content
    +<!--/Snippet ID-->
    +...and so on
    +
    +

    +You can use the snippets.html in the plugin folder or tell the backend where to find the file like this +

    +
    +with (xinha_config.InsertSnippet)
    +{
    +	<?php
    +
    +	// define backend configuration for the plugin
    +	$backend_data['snippets_file'] = '/file/containing/snippets.html';
    +	require_once '../contrib/php-xinha.php';
    +	xinha_pass_to_php_backend($backend_data);
    +    
    +	?>
    +}
    +
    + +

    Raimund Meyer (xinha@raimundmeyer.de)

    + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/snippets.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/snippets.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/snippets.html 3 Jan 2016 20:51:02 -0000 1.1.2.1 @@ -0,0 +1,29 @@ + +
    + Visit the Xinha website +
    + + +
    + This is an information about something +
    + + + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/snippets.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/snippets.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/snippets.js 3 Jan 2016 20:51:02 -0000 1.1.2.1 @@ -0,0 +1,15 @@ +var snippets = new Array(); +var i = 0; +snippets[i] = new Object(); +snippets[i]['id'] = 'Box 1'; +snippets[i]['HTML'] = '
    \n Visit the Xinha website
    '; + +i++; +snippets[i] = new Object(); +snippets[i]['id'] = 'INFORMATION ABOUT SOMETHING'; +snippets[i]['HTML'] = '
    \n This is an information about something\n
    '; + +i++; +snippets[i] = new Object(); +snippets[i]['id'] = 'Menu'; +snippets[i]['HTML'] = ''; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/snippets.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/snippets.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/snippets.php 3 Jan 2016 20:51:03 -0000 1.1.2.1 @@ -0,0 +1,22 @@ +(.*?)/s',$snippets,$matches); + +$array=array(); +for ($i=0;$i$id,'HTML'=>$html); +} +print "var snippets = " . xinha_to_js($array); + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/img/ed_snippet.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/img/ed_snippet.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/de.js 3 Jan 2016 20:51:03 -0000 1.1.2.1 @@ -0,0 +1,10 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +{ + "Insert Snippet": "Snippet einfügen", + "Cancel": "Abbrechen", + "Variable":"Variable", + "Insert as":"Einfügen als", + "Show preview":"Vorschau zeigen", + "Hide preview":"Vorschau verbergen" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/ja.js 3 Jan 2016 20:51:03 -0000 1.1.2.1 @@ -0,0 +1,10 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Insert Snippet": "スニペットの挿入", + "Cancel": "中止", + "Variable":"変数", + "Insert as":"形式を選んで挿入", + "Show preview":"プレビュー表示", + "Hide preview":"プレビュー非表示" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/nb.js 3 Jan 2016 20:51:04 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ +"Insert Snippet": "Sett inn snutt", +"Cancel": "Avbryt", +"Variable":"Variabel", +"Insert as":"Sett inn som", +"Show preview":"Vis forhåndsvisning", +"Hide preview":"Skjul forhåndsvisning" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/nl.js 3 Jan 2016 20:51:04 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ +"Insert Snippet": "Snippet invoegen", +"Cancel": "Annuleren", +"Variable":"Variabele", +"Insert as":"Invoegen als", +"Show preview":"Laat voorbeeld zien", +"Hide preview":"Verberg voorbeeld" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/no.js 3 Jan 2016 20:51:04 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ +"Insert Snippet": "Sett inn snutt", +"Cancel": "Avbryt", +"Variable":"Variabel", +"Insert as":"Sett inn som", +"Show preview":"Vis forhåndsvisning", +"Hide preview":"Skjul forhåndsvisning" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/lang/pt_br.js 3 Jan 2016 20:51:04 -0000 1.1.2.1 @@ -0,0 +1,25 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Cancel": "Cancelar", + "Hide preview": "Esconder Visualização", + "Insert Snippet": "Inserir Fragmento de Código", + "Insert as": "Inserir como", + "InsertSnippet for Xinha": "Fragmento de Códigos para o Xinha", + "Show preview": "Mostrar Visualização", + "This is an information about something": "Isto é uma informação sobre alguma coisa", + "Variable": "Variável" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/popups/insertsnippet.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/popups/insertsnippet.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet/popups/insertsnippet.html 3 Jan 2016 20:51:04 -0000 1.1.2.1 @@ -0,0 +1,133 @@ + + + + +Insert Snippet + + + + + + + + +
    +
    Insert Snippet
    +
    + +
    +
    +
    +
    + +
    +
    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/InsertSnippet.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/InsertSnippet.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/InsertSnippet.css 3 Jan 2016 20:51:05 -0000 1.1.2.1 @@ -0,0 +1,92 @@ +html > body .ISsnippettable button { min-width:70px;white-space:nowrap;} + +.ISsnippettable td { + + background:white; + vertical-align:top; +} + +.ISsnippettable td { + padding:5px; + border:1px solid; + border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; +} +.ISsnippettable button {text-align:center;} +.ISsnippettable a.button {/*background:ButtonFace;*/padding:1px 5px 1px 5px;color:black;text-decoration:none} +.ISpreview { + background-color: white; + padding: 5px; + display : none; + position : absolute; + top : 12px; + left :100px; + border : 1px dotted black; + z-index:100; +} +.IScattabs {line-height:18px; } +.IScattabs a { + white-space:nowrap; + border-width:1px 1px 0px 1px; + border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; + border-style:solid; + padding:4px; + margin-left:1px; + text-decoration:none; + color:black; + -moz-border-radius:10px 10px 0px 0px; + height:12px; + background-repeat:repeat-x; +} + +.IScattabs .tab1 { + background-image:url(img/1.PNG); +} +.IScattabs .tab2 { + background-image:url(img/2.PNG); +} +.IScattabs .tab3 { + background-image:url(img/3.PNG); +} +.IScattabs .tab4 { + background-image:url(img/4.PNG); +} +.IScattabs .tab5 { + background-image:url(img/5.PNG); +} +.IScattabs .tab6 { + background-image:url(img/6.PNG); +} +.IScattabs .tab7 { + background-image:url(img/7.PNG); +} +.IScattabs .tab8 { + background-image:url(img/8.PNG); +} +.IScattabs .tab9 { + background-image:url(img/9.PNG); +} +.IScattabs .tab10 { + background-image:url(img/10.PNG); +} +.IScattabs .tab11 { + background-image:url(img/11.PNG); +} +.IScattabs .tab12 { + background-image:url(img/12.PNG); +} +.IScattabs .tab13 { + background-image:url(img/13.PNG); +} +.IScattabs .tab14 { + background-image:url(img/14.PNG); +} +.IScattabs .tab15 { + background-image:url(img/15.PNG); +} +.IScattabs .tab16 { + background-image:url(img/16.PNG); +} +.IScattabs a.active { + font-weight:bold; + border-width:1px 2px 0px 2px +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/InsertSnippet2.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/InsertSnippet2.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/InsertSnippet2.js 3 Jan 2016 20:51:05 -0000 1.1.2.1 @@ -0,0 +1,396 @@ +/*------------------------------------------*\ + InsertSnippet2 for Xinha + _______________________ + + Insert HTML fragments or template variables + +\*------------------------------------------*/ + +function InsertSnippet2(editor) { + this.editor = editor; + + var cfg = editor.config; + var self = this; + + + cfg.registerButton({ + id : "InsertSnippet2", + tooltip : this._lc("Insert Snippet"), + image : editor.imgURL("ed_snippet.gif", "InsertSnippet2"), + textMode : false, + action : function(editor) { + self.buttonPress(editor); + } + }); + cfg.addToolbarElement("InsertSnippet2", "insertimage", -1); + this.snippets = null; + this.categories = null; + this.html =null; + + Xinha._getback(cfg.InsertSnippet2.snippets,function (txt,req) { + var xml=req.responseXML; + var c = xml.getElementsByTagName('c'); + self.categories = []; + for (var i=0;i\n"; + html += ''; + if ( typeof editor.config.baseHref != 'undefined' && editor.config.baseHref !== null ) + { + html += "\n"; + } + + if ( editor.config.pageStyle ) + { + html += ""; + } + + if ( typeof editor.config.pageStyleSheets !== 'undefined' ) + { + for ( var i = 0; i < editor.config.pageStyleSheets.length; i++ ) + { + if ( editor.config.pageStyleSheets[i].length > 0 ) + { + html += ""; + //html += "\n"; + } + } + } + html += "\n"; + html += "\n"; + html += "\n"; + html += ""; + + doc.write(html); + doc.close(); + setTimeout(function() { + self.previewBody = doc.getElementsByTagName('body')[0]; + },100); +} + +InsertSnippet2.prototype.buttonPress = function(editor) +{ + this.dialog.toggle(); +} + +InsertSnippet2.prototype.doInsert = function(event) +{ + var target = event.target || event.srcElement; + var sn = this.snippets[target.snID]; + this.dialog.hide(); + var cfg = this.editor.config.InsertSnippet2; + if (target._insAs == 'variable') + { + this.editor.insertHTML(sn.v); + } + else + { + this.editor.insertHTML(sn.html); + } +} + +InsertSnippet2.prototype.resize = function () +{ + var insertDiv = this.dialog.getElementById('insert_div'); + var preview_iframe = this.dialog.getElementById('preview_iframe'); + var win = {h:this.dialog.height,w:this.dialog.width}; + + var h = win.h - 90; + if (this.categories.length) h -= this.catTabsH; + insertDiv.style.height = preview_iframe.style.height = h + 'px'; + + //insertDiv.style.width = win.w + 'px'; + + return true; +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/dialog.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/dialog.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/dialog.html 3 Jan 2016 20:51:05 -0000 1.1.2.1 @@ -0,0 +1,20 @@ +

    Insert Snippet

    +
    + +
    +
    + + +
    + +
    +
    +
    +
    +
    + + +
    + +
    + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/readme.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/readme.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/readme.html 3 Jan 2016 20:51:05 -0000 1.1.2.1 @@ -0,0 +1,51 @@ + + InsertSnippet for Xinha + + +

    InsertSnippet2 for Xinha

    +

    Insert HTML fragments or template variables in your document.

    +

    Features

    +
      +
    • Categorization to organize your snippets if you have a lot (optional)
    • +
    • Search for name
    • +
    • Insert as literal text/html or variable (optional) 
    • +
    • XML data format
    • +
    +

    Usage

    +

    +In order to use your own snippets you have to add a parameter to your xinha_config: +

    +
    xinha_config.InsertSnippet2.snippets = "/path/to/your/snippets.xml";
    +
    +

    This path should point to a XML file that has the following format:

    +
    <snXML>
    + <categories>
    +    <c n="the name" />
    +  </categories>
    +  <snippets>
    +        <s n="the name" v="optional variable name to be inserted" c="the category">
    +            &lt;p&gt;some text or HTML, please entize HTML tags&lt;/p&gt;
    +        </s>
    +        <s n="another">
    +            <![CDATA[
    +               <p>or put HTML in a CDATA section</p>
    +            ]]>
    +        </s>
    +  </snipptes>
    +</snXML>
    +
    +

    +

     Tags

    +
    <snXML></snXML>
     The root tag
    <categories></categories>
     This tag contains the categories (optional)
     <c />
     Each category
     <snippets></snippets>
    This tag contains the actual snippet. As this is XML, you cannot put HTML here literally. You have to either entize the <,>, and & characters or wrap the contents in a CDATA section
    +

    Attributes

    +
     n
     The name of one snippet or category. It is obligatory for both.
     v
    If this attribute is present in a snippet tag, there is a button in the UI that allows to insert this variable instead of the textual content of the snippet.
    c
     The category
    +

    Inside the plugin's directory, there is a sample XML file and PHP script that shows how to create the XML dynamically.

    +

    3 October 2008 Raimund Meyer (xinha@raimundmeyer.de)

    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/snippets.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/snippets.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/snippets.php 3 Jan 2016 20:51:05 -0000 1.1.2.1 @@ -0,0 +1,37 @@ +'some text'), + * array('name'= 'snippet2','text'=>'

    some HTML

    ', 'varname'=>'{$var}','category'=>'cat1') //varname and category are optional + * ) + * + * ?> + */ +header("Content-type: text/xml"); +print ' +'; +?> + + +'."\n"; +} + +?> + + + + +'."\n"; +} +?> + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/snippets.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/snippets.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/snippets.xml 3 Jan 2016 20:51:05 -0000 1.1.2.1 @@ -0,0 +1,42 @@ + + + + + + + + + + + + Visit the Xinha website +
  • Nulla placerat nunc ut pede.
  • Vivamus ultrices mi sit amet urna.
  • Quisque sed augue quis nunc laoreet volutpat.
  • Nunc sit amet metus in tortor semper mattis.
  • + ]]> + + + <p>This is some information about something</p> + + + + + + + + + + ]]> + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/1.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/1.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/10.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/10.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/11.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/11.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/12.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/12.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/13.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/13.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/14.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/14.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/15.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/15.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/16.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/16.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/2.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/2.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/3.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/3.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/4.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/4.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/5.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/5.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/6.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/6.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/7.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/7.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/8.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/8.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/9.PNG =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/9.PNG,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/ed_snippet.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/img/ed_snippet.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertSnippet2/lang/de.js 3 Jan 2016 20:51:09 -0000 1.1.2.1 @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +{ + "Insert Snippet": "Snippet einfügen", + "Insert as HTML": "Als HTML einfügen", + "HTML": "HTML", + "Insert as template variable": "Als Template-Variable einfügen", + "Variable": "Variable", + "All Categories" : "Alle Kategorien", + "Only search word beginning" : "Nur nach Wortanfang suchen", + "Filter" : "Filter" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertWords/InsertWords.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertWords/InsertWords.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertWords/InsertWords.js 3 Jan 2016 20:51:09 -0000 1.1.2.1 @@ -0,0 +1,70 @@ +// Plugin for htmlArea to insert keywords, when a type of +// keyword is selected from a dropdown list +// By Adam Wright, for The University of Western Australia +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +function InsertWords(editor, params) { + this.editor = editor; + var cfg = editor.config; + var self = this; + + if(params[0] && params[0].combos) { + //if arguments where passed with registerPlugin use these + var combos = params[0].combos; + } else if (cfg.InsertWords && cfg.InsertWords.combos) { + //if combos is found in config use these + var combos = cfg.InsertWords.combos; + } else { + //no combos found + var combos = []; + } + + // register the toolbar with the keywords dropdown + var first = true; + var toolbar = []; + + for (var i = combos.length; --i >= 0;) { + var combo = combos[i]; + var id = "IW-id" + i; + var iw_class = { + id : id, + options : combo.options, + action : function (editor) { self.onSelect(editor, this, combo.context); }, + refresh : function (editor) { }, + context : combo.context + }; + cfg.registerDropdown(iw_class); + + if (combo.label) + toolbar.push("T[" + combo.label + "]"); + toolbar.push(id); + toolbar.push(first ? "separator" : "space"); + } + + cfg.addToolbarElement(toolbar, "linebreak", 1); + +} + +InsertWords._pluginInfo = { + name : "InsertWords", + version : "1.0", + developer : "Adam Wright", + developer_url : "http://blog.hipikat.org/", + sponsor : "The University of Western Australia", + sponsor_url : "http://www.uwa.edu.au/", + license : "htmlArea" +}; + +InsertWords.prototype.onSelect = function(editor, obj, context) { + + // Get the toolbar object element + var elem = editor._toolbarObjects[obj.id].element; + + // Insert the keyword value blindly at the selection + editor.insertHTML(elem.value); + + // Reset the dropdown to it's label + elem.selectedIndex = 0; +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertWords/insert-words.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertWords/insert-words.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/InsertWords/insert-words.js 3 Jan 2016 20:51:09 -0000 1.1.2.1 @@ -0,0 +1,41 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/InsertWords/insert-words.js */ +function InsertWords(_1,_2){ +this.editor=_1; +var _3=_1.config; +var _4=this; +if(_2[0]&&_2[0].combos){ +var _5=_2[0].combos; +}else{ +if(_3.InsertWords&&_3.InsertWords.combos){ +var _5=_3.InsertWords.combos; +}else{ +var _5=[]; +} +} +var _6=true; +var _7=[]; +for(var i=_5.length;--i>=0;){ +var _9=_5[i]; +var id="IW-id"+i; +var _b={id:id,options:_9.options,action:function(_c){ +_4.onSelect(_c,this,_9.context); +},refresh:function(_d){ +},context:_9.context}; +_3.registerDropdown(_b); +if(_9.label){ +_7.push("T["+_9.label+"]"); +} +_7.push(id); +_7.push(_6?"separator":"space"); +} +_3.addToolbarElement(_7,"linebreak",1); +} +InsertWords._pluginInfo={name:"InsertWords",version:"1.0",developer:"Adam Wright",developer_url:"http://blog.hipikat.org/",sponsor:"The University of Western Australia",sponsor_url:"http://www.uwa.edu.au/",license:"htmlArea"}; +InsertWords.prototype.onSelect=function(_e,_f,_10){ +var _11=_e._toolbarObjects[_f.id].element; +_e.insertHTML(_11.value); +_11.selectedIndex=0; +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/LangMarks.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/LangMarks.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/LangMarks.js 3 Jan 2016 20:51:09 -0000 1.1.2.1 @@ -0,0 +1,179 @@ +// Mask Language plugin for Xinha +// Implementation by Udo Schmal +// +// (c) Udo Schmal & Schaffrath NeueMedien 2004 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +function LangMarks(editor, args) { + this.editor = editor; + var cfg = editor.config; + var self = this; + var options = {}; + options[this._lc("— language —")] = ''; + + // Old configuration type + if(!cfg.LangMarks.languages) + { + Xinha.debugMsg('Warning: Old style LangMarks configuration detected, please update your LangMarks configuration.'); + var newConfig = { + languages: [], + attributes: Xinha.Config.prototype.attributes + }; + + for (var i in cfg.LangMarks) + { + if (typeof i != 'string') continue; + newConfig.languages.push( { name: i, code: cfg.LangMarks[i] } ); + } + + cfg.LangMarks = newConfig; + } + + for (var i = 0; i < cfg.LangMarks.languages.length; i++) + { + options[this._lc(cfg.LangMarks.languages[i].name)] = cfg.LangMarks.languages[i].code; + } + + + cfg.registerDropdown({ + id : "langmarks", + tooltip : this._lc("language select"), + options : options, + action : function(editor) { self.onSelect(editor, this); }, + refresh : function(editor) { self.updateValue(editor, this); } + }); + cfg.addToolbarElement("langmarks", "inserthorizontalrule", 1); +} + +LangMarks._pluginInfo = { + name : "LangMarks", + version : "1.0", + developer : "Udo Schmal", + developer_url : "", + sponsor : "L.N.Schaffrath NeueMedien", + sponsor_url : "http://www.schaffrath-neuemedien.de/", + c_owner : "Udo Schmal & Schaffrath NeueMedien", + license : "htmlArea" +}; + +Xinha.Config.prototype.LangMarks = { + 'languages': [ + { name:"Greek", code: "el" } , + { name:"English", code: "en" }, + { name:"French", code: "fr" } , + { name:"Latin" , code: "la" } + ], + + 'attributes': [ + 'lang', + 'xml:lang' + ] +}; + +LangMarks.prototype._lc = function(string) { + return Xinha._lc(string, 'LangMarks'); +}; + +LangMarks.prototype.onGenerate = function() { + this.editor.addEditorStylesheet(Xinha.getPluginDir("LangMarks") + '/lang-marks.css'); +}; + +LangMarks.prototype.onSelect = function(editor, obj, context, updatecontextclass) { + var tbobj = editor._toolbarObjects[obj.id]; + var index = tbobj.element.selectedIndex; + var language = tbobj.element.value; + + // retrieve parent element of the selection + var parent = editor.getParentElement(); + var surround = true; + + var is_span = (parent && parent.tagName.toLowerCase() == "span"); + var update_parent = (context && updatecontextclass && parent && parent.tagName.toLowerCase() == context); + + if (update_parent) { + parent.className = "haslang"; + parent.lang = language; + + for(var i = 0; i < this.editor.config.LangMarks.attributes.length; i++) + { + parent.setAttribute(this.editor.config.LangMarks.attributes[i], language); + } + + editor.updateToolbar(); + return; + } + + if (is_span && index == 0 && !/\S/.test(parent.style.cssText)) { + while (parent.firstChild) { + parent.parentNode.insertBefore(parent.firstChild, parent); + } + parent.parentNode.removeChild(parent); + editor.updateToolbar(); + return; + } + + if (is_span) { + // maybe we could simply change the class of the parent node? + if (parent.childNodes.length == 1) { + parent.className = "haslang"; + parent.lang = language; + + for(var i = 0; i < this.editor.config.LangMarks.attributes.length; i++) + { + parent.setAttribute(this.editor.config.LangMarks.attributes[i], language); + } + + surround = false; + // in this case we should handle the toolbar updation + // ourselves. + editor.updateToolbar(); + } + } + + // Other possibilities could be checked but require a lot of code. We + // can't afford to do that now. + if (surround) { + // shit happens ;-) most of the time. this method works, but + // it's dangerous when selection spans multiple block-level + // elements. + var html = ''; + for(var i = 0; i < this.editor.config.LangMarks.attributes.length; i++) + { + html += ' ' +this.editor.config.LangMarks.attributes[i] + '="'+language+'"'; + } + + editor.surroundHTML('', ''); + } +}; + +LangMarks.prototype.updateValue = function(editor, obj) { + var select = editor._toolbarObjects[obj.id].element; + var parents = editor.getAllAncestors(); + var parent; + var lang; + for (var i=0;i= 0;) { + var option = options[i]; + if (value == option.value) { + select.selectedIndex = i; + return; + } + } + } + else select.selectedIndex = 0; + +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang-marks.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang-marks.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang-marks.css 3 Jan 2016 20:51:10 -0000 1.1.2.1 @@ -0,0 +1,40 @@ +span.haslang { + border-bottom: 1px dashed #aaa; + white-space : nowrap; +} + + + +span[lang]::after { + content: attr(lang); + text-transform: uppercase; + font-family: sans-serif; + color: white; + background: red; + border: 1px solid red; + font-size: x-small; + font-weight: normal; + vertical-align: top; +} + +/* + * NOTE: The "proper" way to do this is with a CSS namespace + * @namespace xml "http://www.w3.org/XML/1998/namespace"; + * and putting xmlns:xml="http://www.w3.org/XML/1998/namespace" + * on the root element or the itself, then using + * span[xml|lang] as the selector, but this simply doesn't work + * in most browsers. Which sucks. + */ + +span[xml\:lang]::after { + content: attr(xml\:lang); + text-transform: uppercase; + font-family: sans-serif; + color: white; + background: red; + border: 1px solid red; + font-size: x-small; + font-weight: normal; + vertical-align: top; +} + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang-marks.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang-marks.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang-marks.js 3 Jan 2016 20:51:10 -0000 1.1.2.1 @@ -0,0 +1,127 @@ +// Mask Language plugin for Xinha +// Implementation by Udo Schmal +// +// (c) Udo Schmal & Schaffrath NeueMedien 2004 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +function LangMarks(editor, args) { + this.editor = editor; + var cfg = editor.config; + var self = this; + var options = {}; + options[this._lc("— language —")] = ''; + for (var i in cfg.LangMarks) + { + if (typeof i != 'string') continue; + options[this._lc(i)] = cfg.LangMarks[i]; + } + + cfg.registerDropdown({ + id : "langmarks", + tooltip : this._lc("language select"), + options : options, + action : function(editor) { self.onSelect(editor, this); }, + refresh : function(editor) { self.updateValue(editor, this); } + }); + cfg.addToolbarElement("langmarks", "inserthorizontalrule", 1); +} + +LangMarks._pluginInfo = { + name : "LangMarks", + version : "1.0", + developer : "Udo Schmal", + developer_url : "", + sponsor : "L.N.Schaffrath NeueMedien", + sponsor_url : "http://www.schaffrath-neuemedien.de/", + c_owner : "Udo Schmal & Schaffrath NeueMedien", + license : "htmlArea" +}; + +Xinha.Config.prototype.LangMarks = { + "Greek" : "el", + "English" : "en", + "French" : "fr", + "Latin" : "la" +}; + +LangMarks.prototype._lc = function(string) { + return Xinha._lc(string, 'LangMarks'); +}; + +LangMarks.prototype.onGenerate = function() { + this.editor.addEditorStylesheet(Xinha.getPluginDir("LangMarks") + '/lang-marks.css'); +}; + +LangMarks.prototype.onSelect = function(editor, obj, context, updatecontextclass) { + var tbobj = editor._toolbarObjects[obj.id]; + var index = tbobj.element.selectedIndex; + var language = tbobj.element.value; + + // retrieve parent element of the selection + var parent = editor.getParentElement(); + var surround = true; + + var is_span = (parent && parent.tagName.toLowerCase() == "span"); + var update_parent = (context && updatecontextclass && parent && parent.tagName.toLowerCase() == context); + + if (update_parent) { + parent.className = "haslang"; + parent.lang = language; + editor.updateToolbar(); + return; + } + + if (is_span && index == 0 && !/\S/.test(parent.style.cssText)) { + while (parent.firstChild) { + parent.parentNode.insertBefore(parent.firstChild, parent); + } + parent.parentNode.removeChild(parent); + editor.updateToolbar(); + return; + } + + if (is_span) { + // maybe we could simply change the class of the parent node? + if (parent.childNodes.length == 1) { + parent.className = "haslang"; + parent.lang = language; + surround = false; + // in this case we should handle the toolbar updation + // ourselves. + editor.updateToolbar(); + } + } + + // Other possibilities could be checked but require a lot of code. We + // can't afford to do that now. + if (surround) { + // shit happens ;-) most of the time. this method works, but + // it's dangerous when selection spans multiple block-level + // elements. + editor.surroundHTML('', ''); + } +}; + +LangMarks.prototype.updateValue = function(editor, obj) { + var select = editor._toolbarObjects[obj.id].element; + var parents = editor.getAllAncestors(); + var parent; + for (var i=0;i= 0;) { + var option = options[i]; + if (value == option.value) { + select.selectedIndex = i; + return; + } + } + } + else select.selectedIndex = 0; + +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/img/el.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/img/el.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/img/en.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/img/en.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/img/fr.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/img/fr.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/img/la.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/img/la.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/de.js 3 Jan 2016 20:51:11 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 | ISO-8859-1 +// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "language select": "Sprachauswahl", + "— language —": "— Sprache —", + "Greek": "griechisch", + "English": "englisch", + "French": "französisch", + "Latin": "lateinisch" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/es.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/es.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/es.js 3 Jan 2016 20:51:11 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "es", ENCODING: UTF-8 +// translated: Derick Leony +{ + "language select": "seleccionar idioma", + "— language —": "— idioma —", + "Greek": "Griego", + "English": "Inglés", + "French": "Francés", + "Latin": "Latín" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/fr.js 3 Jan 2016 20:51:11 -0000 1.1.2.1 @@ -0,0 +1,10 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "language select": "Sélection de la langue", + "— language —": "— Langue —", + "Greek": "grec", + "English": "anglais", + "French": "français", + "Latin": "latin" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/ja.js 3 Jan 2016 20:51:12 -0000 1.1.2.1 @@ -0,0 +1,10 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "language select": "言語の選択", + "— language —": "— 言語 —", + "Greek": "ギリシャ語", + "English": "英語", + "French": "フランス語", + "Latin": "ラテン語" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/nb.js 3 Jan 2016 20:51:12 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "language select": "Språkvalg", + "— language —": "— Språk —", + "Greek": "grekisk", + "English": "engelsk", + "French": "fransk", + "Latin": "latin" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/nl.js 3 Jan 2016 20:51:12 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1 +// Author: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "language select": "Taalkeuze", + "— language —": "— taal —", + "Greek": "Grieks", + "English": "Engels", + "French": "Frans", + "Latin": "Latijn" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/no.js 3 Jan 2016 20:51:12 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "language select": "Språkvalg", + "— language —": "— Språk —", + "Greek": "grekisk", + "English": "engelsk", + "French": "fransk", + "Latin": "latin" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/LangMarks/lang/pt_br.js 3 Jan 2016 20:51:12 -0000 1.1.2.1 @@ -0,0 +1,23 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "language select": "Selecionar idioma", + "— language —": "— Idioma —", + "Greek": "Grego", + "English": "Inglês", + "French": "Francês", + "Latin": "Latim" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/Linker.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/Linker.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/Linker.js 3 Jan 2016 20:51:13 -0000 1.1.2.1 @@ -0,0 +1,106 @@ +/** htmlArea - James' Fork - Linker Plugin **/ +Linker._pluginInfo = +{ + name : "Linker", + version : "1.0", + developer: "James Sleeman", + developer_url: "http://www.gogo.co.nz/", + c_owner : "Gogo Internet Services", + license : "htmlArea", + sponsor : "Gogo Internet Services", + sponsor_url : "http://www.gogo.co.nz/" +}; + +Xinha.loadStyle('dTree/dtree.css', 'Linker'); + +Xinha.Config.prototype.Linker = +{ + 'treeCaption' : document.location.host, + 'backend' : Xinha.getPluginDir("Linker") + '/scan.php', + 'backend_data' : null, + 'files' : null, + 'dialog': null, + 'canSetTarget': true, + 'canRemoveLink': true +}; + + +function Linker(editor, args) +{ + this.editor = editor; + this.lConfig = editor.config.Linker; + + var linker = this; + if(typeof editor._createLink == 'undefined') { + editor._createLink = function(target) { + if(!target) target = linker._getSelectedAnchor(); + linker._createLink(target); + } + } + if(!editor.config.btnList.createlink) + { + editor.config.registerButton( + 'createlink', 'Insert/Modify Hyperlink', [_editor_url + "images/ed_buttons_main.gif",6,1], false, + function(e, objname, obj) { editor.execCommand("createlink"); } + ); + } + + // See if we can find 'createlink' + editor.config.addToolbarElement("createlink", "createlink", 0); +} + +Linker.prototype._lc = function(string) +{ + return Xinha._lc(string, 'Linker'); +}; + + +Linker.prototype.onGenerateOnce = function() +{ + Linker.loadAssets(); + this.loadFiles(); +}; + +Linker.prototype.onUpdateToolbar = function() +{ + if (typeof dTree == 'undefined' || !Linker.methodsReady || !Linker.html || !this.files) + { + this.editor._toolbarObjects.createlink.state("enabled", false); + } + else this.onUpdateToolbar = null; +}; + +Linker.Dialog_dTrees = [ ]; + +Linker.loadAssets = function() +{ + var self = Linker; + if (self.loading) return; + self.loading = true; + Xinha._getback(Xinha.getPluginDir("Linker") + '/pluginMethods.js', function(getback) { eval(getback); self.methodsReady = true; }); + Xinha._loadback( Xinha.getPluginDir("Linker") + '/dTree/dtree.js', function() {Linker.dTreeReady = true; } ); + Xinha._getback( Xinha.getPluginDir("Linker") + '/dialog.html', function(getback) { self.html = getback; } ); +} + +Linker.prototype.loadFiles = function() +{ + var linker = this; + if(linker.lConfig.backend) + { + //get files from backend + Xinha._postback(linker.lConfig.backend, + linker.lConfig.backend_data, + function(txt) { + try { + linker.files = eval(txt); + } catch(Error) { + linker.files = [ {url:'',title:Error.toString()} ]; + } + }); + } + else if(linker.lConfig.files != null) + { + //get files from plugin-config + linker.files = linker.lConfig.files; + } +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dialog.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dialog.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dialog.html 3 Jan 2016 20:51:13 -0000 1.1.2.1 @@ -0,0 +1,103 @@ +

    Insert/Modify Link

    +
    +
    (the dTree goes in here)
    +
    +
    + + + + + + + + + + +
    Target: +
    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Size:x (px)
    Name:
    Menu Bar:Toolbar:
    Location Bar:Status Bar:
    Scrollbars:Resizeable:
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + +
    +
    + +
    + + + + + + +
    + +
    +
    + +
    + + + +
    +
    +
    + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/link-picker.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/link-picker.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/link-picker.js 3 Jan 2016 20:51:13 -0000 1.1.2.1 @@ -0,0 +1,138 @@ + + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- Xinha (is not htmlArea) - http://xinha.gogo.co.nz/ + -- + -- Use of Xinha is granted by the terms of the htmlArea License (based on + -- BSD license) please read license.txt in this package for details. + -- + -- Xinha was originally based on work by Mihai Bazon which is: + -- Copyright (c) 2003-2004 dynarch.com. + -- Copyright (c) 2002-2003 interactivetools.com, inc. + -- This copyright notice MUST stay intact for use. + -- + -- $HeadURL: http://svn.xinha.webfactional.com/trunk/modules/Dialogs/inline-dialog.js $ + -- $LastChangedDate: 2007-01-24 03:26:04 +1300 (Wed, 24 Jan 2007) $ + -- $LastChangedRevision: 694 $ + -- $LastChangedBy: gogo $ + --------------------------------------------------------------------------*/ + + +/** The Link Picker is a semi-standalone instance of the Linker plugin which can be used + * for providing a Linker style browse dialog for selecting urls which are then + * returned into a standard form field. + * + * Usage: + * -------------------------------------------------------------------------- + * {{{ + + + + + + + + + + + + + +
    + +
    +
    + + * }}} + * + */ + +function LinkPicker(field, config) +{ + this.field = field; + + var linkPicker = this; + + // We use a tempoary anchor tag to pass to the Linker plugin + this.tmpAnchor = document.createElement('a'); + + // We will use the detached dialog always + config.dialog = LinkPicker.Dialog; + config.canSetTarget = false; + config.canRemoveLink = false; + + // These methods are dummy versions of stuff that would normally be in a Xinha object + this.selectionEmpty = function() { return true; }; + this.getSelection = function() { return null; }; + this.selectNodeContents = function() { return true; }; + this.getHTML = function() { return ''; } + this.disableToolbar = function() { return true; } + this.enableToolbar = function() { return true; } + this._doc = { + execCommand: function() { return false; }, + getElementsByTagName: function() { return [ ]; } + } + this.config = { + Linker: config, + btnList: { }, + registerButton: function() { return true; }, + addToolbarElement: function() { } + } + + // Add a button next to the field + var button = document.createElement('input'); button.type='button'; + button.value = 'Browse'; + button.onclick = function() { linkPicker.editLink(); return false; } + field.parentNode.insertBefore(button,field.nextSibling); + + // We co-opt updateToolbar as the point at which we copy the temporary anchor across to the field + // Linker calls this as the last step, so perfect. + this.updateToolbar = function() { linkPicker.field.value = this.fixRelativeLinks(linkPicker.tmpAnchor.href); }; + + this.linker = new Linker(this); + this.linker.onGenerateOnce(); +} + +LinkPicker.prototype.editLink = function() +{ + this.tmpAnchor.href = this.field.value; + this.linker._createLink(this.tmpAnchor); +} + +LinkPicker.prototype.fixRelativeLinks = function(href) +{ + return href.replace(document.location.href.replace( /^(https?:\/\/[^\/]*)(.*)$/i, '$1' ), ''); +} + +LinkPicker.Dialog = function(linkPicker, html, localizer, size, options) +{ + LinkPicker.Dialog.parentConstructor.call(this, html, localizer, size, options); +} + +Xinha.extend(LinkPicker.Dialog, Xinha.DetachedDialog); + +LinkPicker.Config = function() { } +LinkPicker.Config.prototype = Xinha.Config.prototype.Linker; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/pluginMethods.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/pluginMethods.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/pluginMethods.js 3 Jan 2016 20:51:13 -0000 1.1.2.1 @@ -0,0 +1,624 @@ +Linker.prototype._createLink = function(a) +{ + if (!this._dialog) + { + this._dialog = new Linker.Dialog(this); + } + + if(!a && this.editor.selectionEmpty(this.editor.getSelection())) + { + alert(this._lc("You must select some text before making a new link.")); + return false; + } + + var inputs = + { + type: 'url', + href: 'http://www.example.com/', + target: '', + p_width: '', + p_height: '', + p_options: ['menubar=no','toolbar=yes','location=no','status=no','scrollbars=yes','resizeable=yes'], + to: 'alice@example.com', + subject: '', + body: '', + anchor: '' + }; + + if(a && a.tagName.toLowerCase() == 'a') + { + var href =this.editor.fixRelativeLinks(a.getAttribute('href')); + var m = href.match(/^mailto:(.*@[^?&]*)(\?(.*))?$/); + var anchor = href.match(/^#(.*)$/); + + if(m) + { + // Mailto + inputs.type = 'mailto'; + inputs.to = m[1]; + if(m[3]) + { + var args = m[3].split('&'); + for(var x = 0; x]*)(\?[^<]*)?$/i.test(a.innerHTML)) + { + a.innerHTML = RegExp.$1; + } + } + } + } + else + { + if(!atr.href) return true; + + // Insert a link, we let the browser do this, we figure it knows best + var tmp = Xinha.uniq('http://www.example.com/Link'); + linker.editor._doc.execCommand('createlink', false, tmp); + + // Fix them up + var anchors = linker.editor._doc.getElementsByTagName('a'); + for(var i = 0; i < anchors.length; i++) + { + var anchor = anchors[i]; + if(anchor.href == tmp) + { + // Found one. + if (!a) a = anchor; + for(var j in atr) + { + anchor.setAttribute(j, atr[j]); + } + } + } + } + linker.editor.selectNodeContents(a); + linker.editor.updateToolbar(); + }; + + this._dialog.show(inputs, doOK); + +}; + +Linker.prototype._getSelectedAnchor = function() +{ + var sel = this.editor.getSelection(); + var rng = this.editor.createRange(sel); + var a = this.editor.activeElement(sel); + if(a != null && a.tagName.toLowerCase() == 'a') + { + return a; + } + else + { + a = this.editor._getFirstAncestor(sel, 'a'); + if(a != null) + { + return a; + } + } + return null; +}; + +Linker.Dialog_dTrees = [ ]; + +Linker.Dialog = function (linker) +{ + var lDialog = this; + this.Dialog_nxtid = 0; + this.linker = linker; + this.id = { }; // This will be filled below with a replace, nifty + + this.ready = false; + + this.dialog = false; + + // load the dTree script + this._prepareDialog(); + +}; + +Linker.Dialog.prototype._prepareDialog = function() +{ + var lDialog = this; + var linker = this.linker; + + var files = this.linker.files; + + // Now we have everything we need, so we can build the dialog. + if(!linker.lConfig.dialog && Xinha.Dialog) linker.lConfig.dialog = Xinha.Dialog; + + var dialog = this.dialog = new linker.lConfig.dialog(linker.editor, Linker.html, 'Linker',{width:600,height:400}); + var dTreeName = Xinha.uniq('dTree_'); + + this.dTree = new dTree(dTreeName, Xinha.getPluginDir("Linker") + '/dTree/'); + eval(dTreeName + ' = this.dTree'); + + this.dTree.add(this.Dialog_nxtid++, -1, linker.lConfig.treeCaption , null, linker.lConfig.treeCaption); + this.makeNodes(files, 0); + + // Put it in + var ddTree = this.dialog.getElementById('dTree'); + //ddTree.innerHTML = this.dTree.toString(); + ddTree.innerHTML = ''; +// ddTree.style.position = 'absolute'; +// ddTree.style.left = 1 + 'px'; + // ddTree.style.top = 0 + 'px'; + ddTree.style.overflow = 'auto'; + ddTree.style.height = '300px'; + if ( Xinha.is_ie ) + { + ddTree.style.styleFloat = "left"; + } + else + { + ddTree.style.cssFloat = "left"; + } + ddTree.style.backgroundColor = 'white'; + this.ddTree = ddTree; + + this.dTree._linker_premade = this.dTree.toString(); + + var options = this.dialog.getElementById('options'); + //options.style.position = 'absolute'; + //options.style.top = 0 + 'px'; + //options.style.right = 0 + 'px'; + options.style.width = 320 + 'px'; + options.style.overflow = 'auto'; + + // Hookup the resizer + this.dialog.rootElem.style.paddingBottom ="0"; + this.dialog.onresize = function() + { + var h = parseInt(dialog.height) - dialog.getElementById('h1').offsetHeight; + var w = parseInt(dialog.width) - 330 ; + + // An error is thrown with IE when trying to set a negative width or a negative height + // But perhaps a width / height of 0 is not the minimum required we need to set + if (w<0) w = 0; + if (h<0) h = 0; + //options.style.height = + lDialog.ddTree.style.height = h + 'px'; + lDialog.ddTree.style.width = w + 'px'; + } + + // Set the onclick handlers for the link type radio buttons + var self = this; + this.dialog.getElementById('type_url').onclick = function() { + self.showOptionsForType('url'); + }; + this.dialog.getElementById('type_mailto').onclick = function() { + self.showOptionsForType('mailto'); + }; + this.dialog.getElementById('type_anchor').onclick = function() { + self.showOptionsForType('anchor'); + }; + + var hidePopupOptions = function() { + self.showOptionsForTarget('none') + }; + this.dialog.getElementById('noTargetRadio').onclick = hidePopupOptions; + this.dialog.getElementById('sameWindowRadio').onclick = hidePopupOptions; + this.dialog.getElementById('newWindowRadio').onclick = hidePopupOptions; + this.dialog.getElementById('popupWindowRadio').onclick = function() { + self.showOptionsForTarget('popup'); + }; + + this.ready = true; + ddTree = null; + Xinha.freeLater(lDialog, 'ddTree'); + options = null; +}; + +Linker.Dialog.prototype.makeNodes = function(files, parent) +{ + for(var i = 0; i < files.length; i++) + { + if(typeof files[i] == 'string') + { + this.dTree.add(this.Dialog_nxtid++, parent, + files[i].replace(/^.*\//, ''), + 'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=decodeURIComponent(\'' + encodeURIComponent(files[i]) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);', + files[i]); + } + else if(typeof files[i]=="object" && files[i] && typeof files[i].length==="number") // there seems to be a strange bug in IE that requires this complicated check, see #1197 + { + var id = this.Dialog_nxtid++; + this.dTree.add(id, parent, files[i][0].replace(/^.*\//, ''), null, files[i][0]); + this.makeNodes(files[i][1], id); + } + else if(typeof files[i] == 'object') + { + var id = this.Dialog_nxtid++; + if(files[i].title) var title = files[i].title; + else if(files[i].url) var title = files[i].url.replace(/^.*\//, ''); + else var title = "no title defined"; + if(files[i].url) var link = 'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=decodeURIComponent(\'' + encodeURIComponent(files[i].url) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);'; + else var link = ''; + + this.dTree.add(id, parent, title, link, title); + if(files[i].children) { + this.makeNodes(files[i].children, id); + } + } + } +}; + +Linker.Dialog.prototype._lc = Linker.prototype._lc; + +Linker.Dialog.prototype.show = function(inputs, ok, cancel) +{ + if(!this.ready) + { + var lDialog = this; + window.setTimeout(function() {lDialog.show(inputs,ok,cancel);},100); + return; + } + + if(this.ddTree.innerHTML == '') + { + this.ddTree.innerHTML = this.dTree._linker_premade; + } + + if(!this.linker.lConfig.canSetTarget) + { + this.dialog.getElementById('target_options').style.display = 'none'; + } + + this.showOptionsForType(inputs.type); + this.showOptionsForTarget(inputs.target); + + var anchor = this.dialog.getElementById('anchor'); + for(var i=anchor.length;i>=0;i--) { + anchor[i] = null; + } + + var html = this.linker.editor.getHTML(); + var anchors = new Array(); + + var m = html.match(/]+name="([^"]+)"/gi); + if(m) + { + for(i=0;i 0) + { + this.dialog.getElementById(enabledTargets[0]).checked = true; + } + + // Init the sizes + this.dialog.onresize(); +}; + +Linker.Dialog.prototype.hide = function() +{ + this.linker.editor.enableToolbar(); + return this.dialog.hide(); +}; + +Linker.Dialog.prototype.removeLink = function(applyFunc) +{ + this.dialog.getElementById('href').value = ""; + this.dialog.getElementById('to').value = ""; + + return applyFunc(); +}; + +Linker.Dialog.prototype.showOptionsForType = function(type) +{ + var urlOptions = this.dialog.getElementById('urltable'); + var mailtoOptions = this.dialog.getElementById('mailtable'); + var anchorOptions = this.dialog.getElementById('anchortable'); + + if (type == 'anchor') + { + anchorOptions.style.display = ''; + urlOptions.style.display = 'none'; + mailtoOptions.style.display = 'none'; + } + else if (type == 'mailto') + { + mailtoOptions.style.display = ''; + urlOptions.style.display = 'none'; + anchorOptions.style.display = 'none'; + } + else + { + urlOptions.style.display = ''; + mailtoOptions.style.display = 'none'; + anchorOptions.style.display = 'none'; + } +}; + +Linker.Dialog.prototype.showOptionsForTarget = function(target) +{ + var popupOptions = this.dialog.getElementById('popuptable'); + popupOptions.style.display = target == 'popup' ? '' : 'none'; +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/scan.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/scan.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/scan.php 3 Jan 2016 20:51:13 -0000 1.1.2.1 @@ -0,0 +1,114 @@ + + [ ]; + $url, 'children'=>$subdir); + } + } + elseif(is_file($path)) + { + if(($include && !preg_match($include, $url)) || ($exclude && preg_match($exclude, $url))) continue; + $files[] = array('url'=>$url); + } + + } + } + @closedir($dh); + return dirsort($files); + } + + function dirsort($files) + { + usort($files, 'dircomp'); + return $files; + } + + function dircomp($a, $b) + { + if(isset($a['children']) && !isset($b['children'])) return -1; + if(isset($b['children']) && !isset($a['children'])) return 1; + + return strcmp(strtolower($a['url']), strtolower($b['url'])); + } + + echo xinha_to_js(scan($dir,$url)); +?> Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/api.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/api.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/api.html 3 Jan 2016 20:51:13 -0000 1.1.2.1 @@ -0,0 +1,252 @@ + + + + + + Destroydrop » Javascripts » Tree » Api + + + + + + + + +
    + +
    + + + + +
    + +
    + + +

    Overview

    +
    +
    + + + +
    + + +

    Functions

    +
    +
    + + +

    add()

    +

    Adds a node to the tree.
    Can only be called before the tree is drawn.

    +

    id, pid and name are required.

    + +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    idNumberUnique identity number.
    pidNumberNumber refering to the parent node. The value for the root node has to be -1.
    nameStringText label for the node.
    urlStringUrl for the node.
    titleStringTitle for the node.
    targetStringTarget for the node.
    iconStringImage file to use as the icon. Uses default if not specified.
    iconOpenStringImage file to use as the open icon. Uses default if not specified.
    openBooleanIs the node open.
    +
    + + +

    Example

    +

    mytree.add(1, 0, 'My node', 'node.html', 'node title', 'mainframe', 'img/musicfolder.gif');

    +
    + + +

    openAll()

    +

    Opens all the nodes.
    Can be called before and after the tree is drawn.

    +

    Example

    +

    mytree.openAll();

    +
    + + + +

    closeAll()

    +

    Closes all the nodes.
    Can be called before and after the tree is drawn.

    +

    Example

    +

    mytree.closeAll();

    +
    + + + +

    openTo()

    +

    Opens the tree to a certain node and can also select the node.
    + Can only be called after the tree is drawn.

    + +

    Parameters

    + + + + + + + + + + + + + + + + +
    NameTypeDescription
    idNumberIdentity number for the node.
    selectBooleanShould the node be selected.
    + +

    Example

    +

    mytree.openTo(4, true);

    + +
    + + +

    Configuration

    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    VariableTypeDefaultDescription
    targetStringtrueTarget for all the nodes.
    folderLinksBooleantrueShould folders be links.
    useSelectionBooleantrueNodes can be selected(highlighted).
    useCookiesBooleantrueThe tree uses cookies to rember it's state.
    useLinesBooleantrueTree is drawn with lines.
    useIconsBooleantrueTree is drawn with icons.
    useStatusTextBooleanfalseDisplays node names in the statusbar instead of the url.
    closeSameLevelBooleanfalseOnly one node within a parent can be expanded at the same time. openAll() and closeAll() functions do not work when this is enabled.
    inOrderBooleanfalseIf parent nodes are always added before children, setting this to true speeds up the tree.
    + +

    Example

    +

    mytree.config.target = "mytarget";

    + +
    + +
    + +
    + + + + +
    + +
    + + + + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/dtree.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/dtree.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/dtree.css 3 Jan 2016 20:51:14 -0000 1.1.2.1 @@ -0,0 +1,41 @@ +/*--------------------------------------------------| +| dTree 2.05 | www.destroydrop.com/javascript/tree/ | +|---------------------------------------------------| +| Copyright (c) 2002-2003 Geir Landr? | +|--------------------------------------------------*/ + +.dtree { + font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; + font-size: 11px; + color: #666; + white-space: nowrap; +} +.dtree img { + border: 0px !important; + margin:0px !important; + display:inline !important; + vertical-align: middle !important; +} +.dtree a,.dtree a:visited { + color: #333; + text-decoration: none; +} +.dtree a.node, .dtree a.nodeSel { + white-space: nowrap; + padding: 1px 2px 1px 2px; + /*padding: 0px 1px 0px 1px;*/ +} +.dtree a.node:hover, .dtree a.nodeSel:hover { + color: #333; + text-decoration: underline; +} +.dtree a.nodeSel { + background-color: #c0d2ec; + /* + -moz-border-radius : 4px; + border:1px dotted #333; + */ +} +.dtree .clip { + overflow: hidden; +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/dtree.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/dtree.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/dtree.js 3 Jan 2016 20:51:14 -0000 1.1.2.1 @@ -0,0 +1,725 @@ +/*--------------------------------------------------| + +| dTree 2.05 | www.destroydrop.com/javascript/tree/ | + +|---------------------------------------------------| + +| Copyright (c) 2002-2003 Geir Landr? | + +| | + +| This script can be used freely as long as all | + +| copyright messages are intact. | + +| | + +| Updated: 17.04.2003 | + +|--------------------------------------------------*/ + + + +// Node object + +function Node(id, pid, name, url, title, target, icon, iconOpen, open) { + + this.id = id; + + this.pid = pid; + + this.name = name; + + this.url = url; + + this.title = title; + + this.target = target; + + this.icon = icon; + + this.iconOpen = iconOpen; + + this._io = open || false; + + this._is = false; + + this._ls = false; + + this._hc = false; + + this._ai = 0; + + this._p; + +} + + + +// Tree object + +function dTree(objName, baseDir) { + + this.config = { + + target : null, + + folderLinks : true, + + useSelection : true, + + useCookies : true, + + useLines : true, + + useIcons : true, + + useStatusText : false, + + closeSameLevel : false, + + inOrder : false + + }; + + this.icon = { + + root : baseDir + 'img/base.gif', + + folder : baseDir + 'img/folder.gif', + + folderOpen : baseDir + 'img/folderopen.gif', + + node : baseDir + 'img/page.gif', + + empty : baseDir + 'img/empty.gif', + + line : baseDir + 'img/line.gif', + + join : baseDir + 'img/join.gif', + + joinBottom : baseDir + 'img/joinbottom.gif', + + plus : baseDir + 'img/plus.gif', + + plusBottom : baseDir + 'img/plusbottom.gif', + + minus : baseDir + 'img/minus.gif', + + minusBottom : baseDir + 'img/minusbottom.gif', + + nlPlus : baseDir + 'img/nolines_plus.gif', + + nlMinus : baseDir + 'img/nolines_minus.gif' + + }; + + this.obj = objName; + + this.aNodes = []; + + this.aIndent = []; + + this.root = new Node(-1); + + this.selectedNode = null; + + this.selectedFound = false; + + this.completed = false; + +} + + + +// Adds a new node to the node array + +dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) { + + this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open); + +}; + + + +// Open/close all nodes + +dTree.prototype.openAll = function() { + + this.oAll(true); + +}; + +dTree.prototype.closeAll = function() { + + this.oAll(false); + +}; + + + +// Outputs the tree to the page + +dTree.prototype.toString = function() { + this.setCS_All(); + var str = '
    \n'; + + if (document.getElementById) { + + if (this.config.useCookies) this.selectedNode = this.getSelected(); + + str += this.addNode(this.root); + + } else str += 'Browser not supported.'; + + str += '
    '; + + if (!this.selectedFound) this.selectedNode = null; + + this.completed = true; + + return str; + +}; + + + +// Creates the tree structure + +dTree.prototype.addNode = function(pNode) { + + var str = ''; + + var n=0; + + if (this.config.inOrder) n = pNode._ai; + + for (n; n'; + + } + + if (node.url) { + + str += ''; + + str += node.name; + + if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += ''; + + str += ''; + + if (node._hc) { + + str += '
    '; + + str += this.addNode(node); + + str += '
    '; + + } + + this.aIndent.pop(); + + return str; + +}; + + + +// Adds the empty and line icons + +dTree.prototype.indent = function(node, nodeId) { + + var str = ''; + + if (this.root.id != node.pid) { + + for (var n=0; n'; + + (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1); + + if (node._hc) { + + str += ''; + + } else str += ''; + + } + + return str; + +}; + + + +// Checks if a node has any children and if it is the last sibling + +dTree.prototype.setCS = function(node) { + + var lastId; + + for (var n=0; n { _hc: haschildren, _ls_is: lastsibling} + + for(var n = 0; n < this.aNodes.length; n++) + { + var node = this.aNodes[n]; + if(!ids[node.pid]) + { + ids[node.pid] = { _hc: true, _ls_is: node.id }; + } + else + { + ids[node.pid]._hc = true; + ids[node.pid]._ls_is = node.id; + } + + if(!ids[node.id]) + { + ids[node.id] = { _hc: false, _ls_is: null } + } + } + + for(var n = 0; n < this.aNodes.length; n++) + { + var node = this.aNodes[n]; + node._ls = ids[node.pid]._ls_is == node.id ? true : false; + if(ids[node.id]) + { + node._hc = ids[node.id]._hc; + } + } +}; + +// Returns the selected node + +dTree.prototype.getSelected = function() { + + var sn = this.getCookie('cs' + this.obj); + + return (sn) ? sn : null; + +}; + + + +// Highlights the selected node + +dTree.prototype.s = function(id) { + + if (!this.config.useSelection) return; + + var cn = this.aNodes[id]; + + if (cn._hc && !this.config.folderLinks) return; + + if (this.selectedNode != id) { + + if (this.selectedNode || this.selectedNode==0) { + + eOld = document.getElementById("s" + this.obj + this.selectedNode); + + eOld.className = "node"; + + } + + eNew = document.getElementById("s" + this.obj + id); + + eNew.className = "nodeSel"; + + this.selectedNode = id; + + if (this.config.useCookies) this.setCookie('cs' + this.obj, cn.id); + + } + +}; + + + +// Toggle Open or close + +dTree.prototype.o = function(id) { + + var cn = this.aNodes[id]; + + this.nodeStatus(!cn._io, id, cn._ls); + + cn._io = !cn._io; + + if (this.config.closeSameLevel) this.closeLevel(cn); + + if (this.config.useCookies) this.updateCookie(); + +}; + + + +// Open or close all nodes + +dTree.prototype.oAll = function(status) { + + for (var n=0; n + + + + + Destroydrop » Javascripts » Tree + + + + + + + + +

    Destroydrop » Javascripts » Tree

    + +

    Example

    + +
    + +

    open all | close all

    + + + +
    + +

    ©2002-2003 Geir Landrö

    + + + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/base.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/base.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/cd.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/cd.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/copy.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/copy.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/empty.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/empty.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/folder.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/folder.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/folderopen.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/folderopen.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/globe.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/globe.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/imgfolder.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/imgfolder.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/join.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/join.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/joinbottom.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/joinbottom.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/line.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/line.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/minus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/minus.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/minusbottom.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/minusbottom.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/move.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/move.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/musicfolder.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/musicfolder.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/nolines_minus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/nolines_minus.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/nolines_plus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/nolines_plus.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/offline.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/offline.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/offline.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/offline.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/page.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/page.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/plus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/plus.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/plusbottom.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/plusbottom.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/question.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/question.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/trash.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/dTree/img/trash.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/de.js 3 Jan 2016 20:51:18 -0000 1.1.2.1 @@ -0,0 +1,19 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// translated: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "You must select some text before making a new link.": "Sie müssen einen Text markieren um einen Link zu erstellen", + "Are you sure you wish to remove this link?": "Wollen Sie diesen Link wirklich entfernen?", + "Remove Link": "Link entfernen", + "URL Link": "URL Adresse", + "Ordinary Link": "Standard Link", + "Same Window (jump out of frames)": "Selbes Fenster (ganzer Bereich)", + "New Window": "Neues Fenster", + "Popup Window": "Pop-Up Fenster", + "Email Link": "Email Link", + "Email Address:": "Email Adresse", + "Subject:": "Betreff:", + "Message Template:": "Nachrichten Vorlage:", + "Size:": "Größe:", + "Name:": "Name:" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/fr.js 3 Jan 2016 20:51:18 -0000 1.1.2.1 @@ -0,0 +1,18 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "You must select some text before making a new link.": "Vous devez sélectionner un texte avant de créer un nouveau lien", + "Are you sure you wish to remove this link?": "Confirmez-vous la suppression de ce lien ?", + "Remove Link": "Supprimer", + "URL Link": "Lien URL", + "Ordinary Link": "Lien standard", + "Same Window (jump out of frames)": "Même fenêtre (sort des frames)", + "New Window": "Nouvelle fenêtre", + "Popup Window": "Fenêtre popup", + "Email Link": "Lien email", + "Email Address:": "Adresse email", + "Subject:": "Sujet", + "Message Template:": "Message", + "Size:": "Taille", + "Name:": "Nom" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/ja.js 3 Jan 2016 20:51:19 -0000 1.1.2.1 @@ -0,0 +1,24 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "You must select some text before making a new link.": "リンクを作成するにはテキストを選択する必要があります", + "Are you sure you wish to remove this link?": "本当にこのリンクを削除しますか?", + "Remove Link": "リンク削除", + "URL Link": "URLリンク", + "Ordinary Link": "標準リンク", + "Same Window (jump out of frames)": "同一ウィンドウ (フレーム最上位)", + "New Window": "新しいウィンドウ", + "Popup Window": "ポップアップウィンドウ", + "Email Link": "Eメールリンク", + "Email Address:": "アドレス:", + "Subject:": "件名:", + "Message Template:": "本文雛形:", + "Size:": "サイズ:", + "Name:": "名前:", + "Menu Bar:": "メニュー", + "Toolbar:": "ツールバー", + "Location Bar:": "アドレスバー", + "Status Bar:": "ステータスバー", + "Scrollbars:": "スクロール", + "Resizeable:": "リサイズ" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/nb.js 3 Jan 2016 20:51:19 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "You must select some text before making a new link.": "Du må markere tekst eller et bilde før du kan lage en lenke.", + "Are you sure you wish to remove this link?": "Er du sikker på at du vil fjerne lenken?" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/nl.js 3 Jan 2016 20:51:19 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "You must select some text before making a new link.": "Selecteer de tekst welke gelinkt moet worden.", + "Are you sure you wish to remove this link?": "Wilt u deze link werkelijk verwijderen?" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/no.js 3 Jan 2016 20:51:19 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "You must select some text before making a new link.": "Du må markere tekst eller et bilde før du kan lage en lenke.", + "Are you sure you wish to remove this link?": "Er du sikker på at du vil fjerne lenken?" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/pl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/pl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/pl.js 3 Jan 2016 20:51:19 -0000 1.1.2.1 @@ -0,0 +1,19 @@ +// I18N constants +// LANG: "pl", ENCODING: UTF-8 +// translated: Krzysztof Kotowicz, http://www.eskot.krakow.pl/portfolio/, koto@webworkers.pl +{ + "You must select some text before making a new link.": "Zaznacz tekst przed dodaniem odnośnika.", + "Are you sure you wish to remove this link?": "Na pewno chcesz usunąć odnośnik?", + "Remove Link": "USUŃ ODNOŚNIK", + "URL Link": "Adres URL", + "Ordinary Link": "Zwykły odnośnik", + "Same Window (jump out of frames)": "To samo okno (wyskocz z ramek)", + "New Window": "Nowe okno", + "Popup Window": "Okienko pop-up", + "Email Link": "Link do e-maila", + "Email Address:": "Adres e-mail", + "Subject:": "Temat:", + "Message Template:": "Szablon wiadmości:", + "Size:": "Rozmiar:", + "Name:": "Nazwa:" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Linker/lang/pt_br.js 3 Jan 2016 20:51:20 -0000 1.1.2.1 @@ -0,0 +1,43 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt +{ + "Anchor-Link": "Link-Âncora", + "Anchor:": "Âncora:", + "Are you sure you wish to remove this link?": "Você tem certeza que deseja remover este link?", + "Cancel": "Cancelar", + "Email Address:": "Endereço de E-mail:", + "Email Link": "Link de E-mail", + "Insert/Modify Link": "Inserir/Modificar Link", + "Location Bar:": "Barra de Localização:", + "Menu Bar:": "Barra de Menu:", + "Message Template:": "Modelo de Mensagem:", + "Name:": "Nome:", + "New Window": "Nova Janela", + "OK": "OK", + "Ordinary Link": "Link Comum", + "Popup Window": "Janela Pop-up", + "Remove Link": "Remover Link", + "Resizeable:": "Redimensionável", + "Same Window (jump out of frames)": "Mesma Janela (Sair fora dos frames)", + "Scrollbars:": "Barra de Rolagem:", + "Size:": "Tamanho:", + "Status Bar:": "Barra de Informações:", + "Subject:": "Assunto:", + "Target:": "Destino:", + "Toolbar:": "Barra de Ferramentas:", + "URL Link": "URL do Link", + "You must select some text before making a new link.": "Você precisa selecionar algum texto antes de criar um novo link." +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/ListType.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/ListType.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/ListType.css 3 Jan 2016 20:51:20 -0000 1.1.2.1 @@ -0,0 +1,43 @@ +.ListType { } +.ListType a { + display:block; + float:left; + margin:2px 0 0 5px; + padding:0; + width:50px; + height:40px; + border:1px solid #9c96a5; +} +.ListType a:hover { + border:1px solid #ffd760; +} +.ListType a.active { + border:1px solid #000084; +} +.ListType a.circle { + background:url(img/circle.png); +} +.ListType a.disc { + background:url(img/disc.png); +} +.ListType a.square { + background:url(img/square.png); +} +.ListType a.decimal { + background:url(img/decimal.png); +} +.ListType a.lower-alpha { + background:url(img/lower-alpha.png); +} +.ListType a.upper-alpha { + background:url(img/upper-alpha.png); +} +.ListType a.lower-roman { + background:url(img/lower-roman.png); +} +.ListType a.upper-roman { + background:url(img/upper-roman.png); +} +.ListType a.none { + background:url(img/none.png); +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/ListType.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/ListType.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/ListType.js 3 Jan 2016 20:51:20 -0000 1.1.2.1 @@ -0,0 +1,191 @@ +// ListType Plugin for Xinha +// Toolbar Implementation by Mihai Bazon, http://dynarch.com/mishoo/ +Xinha.loadStyle( 'ListType.css', 'ListType' ); + +function ListType( editor ) +{ + this.editor = editor; + var cfg = editor.config; + var self = this; + + if ( cfg.ListType.mode == 'toolbar' ) + { + var options = {}; + options[Xinha._lc( "Decimal numbers", "ListType" )] = "decimal"; + options[Xinha._lc( "Lower roman numbers", "ListType" )] = "lower-roman"; + options[Xinha._lc( "Upper roman numbers", "ListType" )] = "upper-roman"; + options[Xinha._lc( "Lower latin letters", "ListType" )] = "lower-alpha"; + options[Xinha._lc( "Upper latin letters", "ListType" )] = "upper-alpha"; + if (!Xinha.is_ie) + // IE doesn't support this property; even worse, it complains + // with a gross error message when we tried to select it, + // therefore let's hide it from the damn "browser". + options[Xinha._lc( "Lower greek letters", "ListType" )] = "lower-greek"; + var obj = + { + id : "listtype", + tooltip : Xinha._lc( "Choose list style type (for ordered lists)", "ListType" ), + options : options, + action : function( editor ) { self.onSelect( editor, this ); }, + refresh : function( editor ) { self.updateValue( editor, this ); }, + context : "ol" + }; + cfg.registerDropdown( obj ); + cfg.addToolbarElement( "listtype", ["insertorderedlist","orderedlist"], 1 ); + } + else + { + editor._ListType = editor.addPanel( 'right' ); + Xinha.freeLater( editor, '_ListType' ); + Xinha.addClass( editor._ListType, 'ListType' ); + // hurm, ok it's pretty to use the background color for the whole panel, + // but should not it be set by default when creating the panel ? + Xinha.addClass( editor._ListType.parentNode, 'dialog' ); + + editor.notifyOn( 'modechange', + function(e,args) + { + if ( args.mode == 'text' ) editor.hidePanel( editor._ListType ); + } + ); + + var elts_ul = ['disc', 'circle', 'square', 'none']; + var elts_ol = ['decimal', 'lower-alpha', 'upper-alpha', 'lower-roman', 'upper-roman', 'none']; + var divglobal = document.createElement( 'div' ); + divglobal.style.height = '90px'; + var div = document.createElement( 'div' ); + this.divUL = div; + div.style.display = 'none'; + for ( var i=0; i +{ + "Decimal numbers": "Números", + "Lower roman numbers": "Números romanos en minúsculas", + "Upper roman numbers": "Números romanos en mayúsculas", + "Lower latin letters": "Letras minúsculas", + "Upper latin letters": "Letras mayúsculas", + "Lower greek letters": "Letras griegas minúsculas", + "Choose list style type (for ordered lists)": "Seleccionar estilo de lista (para listas ordenadas)" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/fr.js 3 Jan 2016 20:51:23 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Decimal numbers": "Nombres décimaux", + "Lower roman numbers": "Nombres romains minuscule", + "Upper roman numbers": "Nombres romains majuscule", + "Lower latin letters": "Lettres latines minuscule", + "Upper latin letters": "Lettres latines majuscule", + "Lower greek letters": "Lettres grecques minuscule", + "Choose list style type (for ordered lists)": "Choisissez le style de liste (pour les listes ordonnées)" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/ja.js 3 Jan 2016 20:51:23 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Decimal numbers": "10進数", + "Lower roman numbers": "ローマ数字(小文字)", + "Upper roman numbers": "ローマ数字(大文字)", + "Lower latin letters": "アルファベット(小文字)", + "Upper latin letters": "アルファベット(大文字)", + "Lower greek letters": "ギリシャ文字(小文字)", + "Choose list style type (for ordered lists)": "リスト形式の選択(順序付けリスト用)" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/nb.js 3 Jan 2016 20:51:24 -0000 1.1.2.1 @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Decimal numbers": "Desimaltall", + "Lower roman numbers": "Lower roman numbers", + "Upper roman numbers": "Upper roman numbers", + "Lower latin letters": "Lower latin letters", + "Upper latin letters": "Upper latin letters", + "Lower greek letters": "Lower greek letters", + "Choose list style type (for ordered lists)": "Velg listetype (for nummererte lister)" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/nl.js 3 Jan 2016 20:51:24 -0000 1.1.2.1 @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Mihai Bazon, http://dynarch.com/mishoo +{ + "Decimal numbers": "Decimale nummers", + "Lower roman numbers": "Romeinse nummers klein", + "Upper roman numbers": "Romeinse nummers groot", + "Lower latin letters": "Latijnse letters klein", + "Upper latin letters": "Latijnse letters groot", + "Lower greek letters": "Griekse letters", + "Choose list style type (for ordered lists)": "Kies stijl type (voor ordered lists)" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/no.js 3 Jan 2016 20:51:24 -0000 1.1.2.1 @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Decimal numbers": "Desimaltall", + "Lower roman numbers": "Lower roman numbers", + "Upper roman numbers": "Upper roman numbers", + "Lower latin letters": "Lower latin letters", + "Upper latin letters": "Upper latin letters", + "Lower greek letters": "Lower greek letters", + "Choose list style type (for ordered lists)": "Velg listetype (for nummererte lister)" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/pl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/pl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/pl.js 3 Jan 2016 20:51:24 -0000 1.1.2.1 @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "pl", ENCODING: UTF-8 +// translated: Krzysztof Kotowicz, koto1sa@o2.pl, http://www.eskot.krakow.pl/portfolio +{ + "Decimal numbers": "Cyfry arabskie", + "Lower roman numbers": "Małe rzymskie", + "Upper roman numbers": "Duże rzymskie", + "Lower latin letters": "Małe litery", + "Upper latin letters": "Duże litery", + "Lower greek letters": "Małe litery greckie", + "Choose list style type (for ordered lists)": "Wybierz typ listy numerowanej" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/pt_br.js 3 Jan 2016 20:51:24 -0000 1.1.2.1 @@ -0,0 +1,24 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Decimal numbers": "Números decimais", + "Lower roman numbers": "Números romanos inferiores", + "Upper roman numbers": "Números romanos superiores", + "Lower latin letters": "Letras latinas inferiores", + "Upper latin letters": "Letras latinas superiores", + "Lower greek letters": "Letras gregas inferiores", + "Choose list style type (for ordered lists)": "Escolha um tipo de lista (para lista ordenada)" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/ru.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/ru.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/ru.js 3 Jan 2016 20:51:24 -0000 1.1.2.1 @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "ru", ENCODING: UTF-8 +// Author: Andrei Blagorazumov, a@fnr.ru +{ + "Decimal numbers": "Десятичные числа", + "Lower roman numbers": "Строчные романские числа", + "Upper roman numbers": "Заглавные романские числа", + "Lower latin letters": "Строчные латинские символы", + "Upper latin letters": "Заглавные латинские символы", + "Lower greek letters": "Строчные греческие символы", + "Choose list style type (for ordered lists)": "Выберите стиль списков (для упорядоченных списков)" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/sv.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/sv.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/ListType/lang/sv.js 3 Jan 2016 20:51:25 -0000 1.1.2.1 @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "sv" (Swedish), ENCODING: UTF-8 +// translated: Erik Dalén, +{ + "Decimal numbers": "Desimaltal", + "Lower roman numbers": "Små romerska siffror", + "Upper roman numbers": "Stora romerska siffror", + "Lower latin letters": "Små latinska bokstäver", + "Upper latin letters": "Stora latinska bokstäver", + "Lower greek letters": "Små grekiska bokstäver", + "Choose list style type (for ordered lists)": "Välj listtyp (för numrerade listor)" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.FileManager.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.FileManager.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.FileManager.js 3 Jan 2016 20:51:25 -0000 1.1.2.1 @@ -0,0 +1,350 @@ +/** + = Mootools File Manager = + == File Manager == + + The functions in this file extend the MootoolsFileManager plugin with support + for managing files (inserting a link to a file). This file is loaded automatically. + + * @author $Author: gustafn $ + * @version $Id: MootoolsFileManager.FileManager.js,v 1.1.2.1 2016/01/03 20:51:25 gustafn Exp $ + * @package MootoolsFileManager + */ + + +// Open a "files" mode of the plugin to allow to select a file to +// create a link to. +MootoolsFileManager.prototype.OpenFileManager = function(link) +{ + var editor = this.editor; + var outparam = null; + var self = this; + + if (typeof link == "undefined") + { + link = this.editor.getParentElement(); + if (link) + { + if (/^img$/i.test(link.tagName)) + link = link.parentNode; + if (!/^a$/i.test(link.tagName)) + link = null; + } + } + + // If the link wasn't provided, and no link is currently in focus, + // make one from the selection. + if (!link) + { + var sel = editor.getSelection(); + var range = editor.createRange(sel); + var compare = 0; + + if (Xinha.is_ie) + { + if ( sel.type == "Control" ) + { + compare = range.length; + } + else + { + compare = range.compareEndPoints("StartToEnd", range); + } + } + else + { + compare = range.compareBoundaryPoints(range.START_TO_END, range); + } + + if (compare == 0) + { + alert(Xinha._lc("You must select some text before making a new link.", 'MootoolsFileManager')); + return; + } + outparam = { + f_href : '', + f_title : '', + f_target : '', + f_type: '', + baseHref: editor.config.baseHref + }; + } + else + { + outparam = { + f_href : Xinha.is_ie ? link.href : link.getAttribute("href"), + f_title : link.title, + f_target : link.target, + f_type : link.type ? link.type : '', + baseHref: editor.config.baseHref + }; + } + + this.current_link = link; + this.current_attributes = outparam; + + if(!this.FileManagerWidget) + { + this.FileManagerWidget = new FileManager({ + url: this.editor.config.MootoolsFileManager.backend +'__function=file-manager&', + assetBasePath: Xinha.getPluginDir('MootoolsFileManager')+'/mootools-filemanager/Assets', + language: _editor_lang, + selectable: true, + uploadAuthData: this.editor.config.MootoolsFileManager.backend_data, + onComplete: function(path, file) { self.FileManagerReturn(path,file); }, + onHide: function() { if(this.swf && this.swf.box) this.swf.box.style.display = 'none'; }, + onShow: function() { if(this.swf && this.swf.box) this.swf.box.style.display = ''; }, + onDetails: function(details) + { + this.info.adopt(self.FileManagerAttributes(details)); + return true; + }, + onHidePreview: function() + { + $(self.FileManagerAttributes().table).dispose(); + return true; + } + }); + } + + this.FileManagerWidget.show(); +}; + +// Take the values from the file selection and make it (or update) a link +MootoolsFileManager.prototype.FileManagerReturn = function(path, file) +{ + var editor = this.editor; + var a = this.current_link; + + var param = this.FileManagerAttributes(); + param.f_href = path; + + if (!a) + { + try + { + editor._doc.execCommand("createlink", false, param.f_href); + a = editor.getParentElement(); + var sel = editor.getSelection(); + var range = editor.createRange(sel); + if (!Xinha.is_ie) + { + a = range.startContainer; + if (!/^a$/i.test(a.tagName)) + { + a = a.nextSibling; + if (a == null) + { + a = range.startContainer.parentNode; + } + } + } + } catch(e) {} + } + else + { + var href = param.f_href.trim(); + editor.selectNodeContents(a); + if (href == "") + { + editor._doc.execCommand("unlink", false, null); + editor.updateToolbar(); + return false; + } + else + { + a.href = href; + } + } + + if (!(a && /^a$/i.test(a.tagName))) + { + return false; + } + + a.type = param.f_type.trim(); + a.target = param.f_target.trim(); + a.title = param.f_title.trim(); + editor.selectNodeContents(a); + editor.updateToolbar(); +}; + +/** Return a DOM fragment which has all the fields needed to set the + * attributes for a link given a structure of initial values. + * + * OR return a structure of values taken from the currently table. + */ + +MootoolsFileManager.prototype.FileManagerAttributes = function (details) +{ + + var self = this; + self._LastFileDetails = details; + + function f(name) + { + var e = self._FileManagerAttributesTable.getElementsByTagName('input'); + for(var i = 0; i < e.length; i++) + { + if(e[i].name == name) return e[i]; + } + + var e = self._FileManagerAttributesTable.getElementsByTagName('select'); + for(var i = 0; i < e.length; i++) + { + if(e[i].name == name) return e[i]; + } + + return null; + } + + function s(name, value) + { + for(var i = 0; i < f(name).options.length; i++) + { + if(f(name).options[i].value == value) + { + // f(name).options[i].selected = true; + f(name).selectedIndex = i; + return true; + } + } + return false; + } + + if(!this._FileManagerAttributesTable) + { + this._FileManagerAttributesTable = (function() { + var div = document.createElement('div'); + + var h2 = document.createElement('h2'); + h2.appendChild(document.createTextNode('Link Attributes')); + div.appendChild(h2); + + var table = document.createElement('table'); + div.appendChild(table); + + table.className = 'filemanager-extended-options'; + var tbody = table.appendChild(document.createElement('tbody')); + + { // Title + var tr = tbody.appendChild(document.createElement('tr')); + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('Title:')); + + var td = tr.appendChild(document.createElement('td')); + var input = td.appendChild(document.createElement('input')); + + td.colSpan = 6; + input.name = 'f_title'; + input.type = 'text'; + th.className = td.className = 'filemanager-f_title'; + } + + { // Content Type + var tr = tbody.appendChild(document.createElement('tr')); + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('Type:')); + + var td = tr.appendChild(document.createElement('td')); + var input = td.appendChild(document.createElement('input')); + + td.colSpan = 6; + input.name = 'f_type'; + input.type = 'text'; + th.className = td.className = 'filemanager-f_type'; + } + + { // Target + var tr = tbody.appendChild(document.createElement('tr')); + + { // Target + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('Open In:')); + + var td = tr.appendChild(document.createElement('td')); + td.colSpan = 2; + var input = td.appendChild(document.createElement('select')); + + input.name = 'f_target'; + input.options[0] = new Option(''); + input.options[1] = new Option('New Window', '_blank'); + input.options[2] = new Option('Top Frame', '_top'); + input.options[3] = new Option('Other Frame:', ''); + + Xinha._addEvent(input, 'change', function() + { + if(f('f_target').selectedIndex == 3) + { + f('f_otherTarget').style.visibility = 'visible'; + } + else + { + f('f_otherTarget').style.visibility = 'hidden'; + } + }); + + var input = td.appendChild(document.createElement('input')); + input.name = 'f_otherTarget'; + input.size = 7; + input.type = 'text'; + input.style.visibility = 'hidden'; + + th.className = td.className = 'filemanager-f_target'; + } + } + + return div; + })(); + } + + if(this.current_attributes) + { + f('f_title').value = this.current_attributes.f_title; + f('f_type').value = this.current_attributes.f_type; + + if(this.current_attributes.f_target) + { + if(!s('f_target', this.current_attributes.f_target)) + { + f('f_target').selectedIndex = 3; + f('f_otherTarget').value = this.current_attributes.f_target; + } + else + { + f('f_otherTarget').value = ''; + } + } + + this.current_attributes = null; + } + + // If no details were supplied, we return the current ones + if(!details) + { + var details = { + f_title: f('f_title').value, + f_type: f('f_type').value, + f_target: f('f_target').selectedIndex < 3 ? f('f_target').options[f('f_target').selectedIndex].value : f('f_otherTarget').value, + + table: this._FileManagerAttributesTable + } + + return details; + } + + // If details were supplied, we set the appropriate ones. + if(details.mime) f('f_type').value = details.mime; + + f('f_target').style.visibility = ''; // Ensure that the select hasn't been hidden by an overlay and not put back + + if(f('f_target').selectedIndex == 3) + { + f('f_otherTarget').style.visibility = 'visible'; + } + else + { + f('f_otherTarget').style.visibility = 'hidden'; + } + + return this._FileManagerAttributesTable; +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.ImageManager.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.ImageManager.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.ImageManager.js 3 Jan 2016 20:51:25 -0000 1.1.2.1 @@ -0,0 +1,621 @@ +/** + = Mootools File Manager = + == Image Manager == + + The functions in this file extend the MootoolsFileManager plugin with support + for managing images. This file is loaded automatically. + + * @author $Author: gustafn $ + * @version $Id: MootoolsFileManager.ImageManager.js,v 1.1.2.1 2016/01/03 20:51:25 gustafn Exp $ + * @package MootoolsFileManager + */ + + +/** Open the Image Manager version of the plugin. + * + * Called from the _insertImage method of the editor (see the hookup in MootoolsFileManager.js) + * Optional image for future external use. + */ + +MootoolsFileManager.prototype.OpenImageManager = function(image) +{ + var editor = this.editor; // for nested functions + var self = this; + var outparam = null; + + if (typeof image == "undefined") + { + image = editor.getParentElement(); + if (image && !/^img$/i.test(image.tagName)) + { + image = null; + } + } + + if ( image ) + { + outparam = + { + f_url : image.getAttribute('src'), //Xinha.is_ie ? image.src : image.src, + f_alt : image.alt, + f_border : image.style.borderWidth ? image.style.borderWidth : image.border, + f_align : image.hasAttribute('align') ? image.align : null, + f_padding: image.style.padding, + f_margin : image.style.margin, + f_width : image.hasAttribute('width') ? image.width : null, + f_height : image.hasAttribute('height') ? image.height : null, + f_backgroundColor: image.style.backgroundColor, + f_borderColor: image.style.borderColor, + f_hspace: image.hspace && image.hspace != '-1' ? parseInt(image.hspace) : null, + f_vspace: image.vspace && image.vspace != '-1' ? parseInt(image.vspace) : null + }; + + outparam.f_border = this.shortSize(outparam.f_border); + outparam.f_padding = this.shortSize(outparam.f_padding); + outparam.f_margin = this.shortSize(outparam.f_margin); + + outparam.f_backgroundColor = this.convertToHex(outparam.f_backgroundColor); + outparam.f_borderColor = this.convertToHex(outparam.f_borderColor); + } + + this.current_image = image; + this.current_attributes = outparam; + + if(!this.ImageManagerWidget) + { + this.ImageManagerWidget = new FileManager({ + url: this.editor.config.MootoolsFileManager.backend+'__function=image-manager&', + assetBasePath: Xinha.getPluginDir('MootoolsFileManager')+'/mootools-filemanager/Assets', + language: _editor_lang, + selectable: true, + upload: this.phpcfg.allow_images_upload, + uploadAuthData: this.editor.config.MootoolsFileManager.backend_data, + onComplete: function(path, file) { self.ImageManagerReturn(path,file); }, + onHide: function() { if(this.swf && this.swf.box) this.swf.box.style.display = 'none'; }, + onShow: function() { + if(this.swf && this.swf.box) this.swf.box.style.display = ''; + if(self.current_image) + { + var src = self.current_image.getAttribute('src'); + if(!src.match(/^(([a-z]+:)|\/)/i)) + { + src = self.editor.config.baseHref.replace(/\/[^\/]*$/, '') + '/' + src; + if(src.match(/^[a-z]+:/i) && !self.phpcfg.images_url.match(/^[a-z]:/i)) + { + src = src.replace(/^[a-z]+:(\/\/?)[^/]*/i, ''); + } + } + var path = src.replace(self.phpcfg.images_url+'/', '').split('/'); + var base = path.pop(); + path = self.phpcfg.images_url.split('/').pop() + (path.length ? ('/' + path.join('/')) : ''); + this.load(path, true, (function() { this.fillInfo(base); }).bind(this)); + } + }, + onDetails: function(details) + { + this.info.adopt(self.ImageManagerAttributes(details)); + return true; + }, + onHidePreview: function() + { + $(self.ImageManagerAttributes().table).dispose(); + return true; + } + }); + } + + this.ImageManagerWidget.show(); +}; + +/** Return a DOM fragment which has all the fields needed to set the + * attributes for an image given a structure of initial values. + * + * OR return a structure of values taken from the currently table. + */ + +MootoolsFileManager.prototype.ImageManagerAttributes = function (details) +{ + + var self = this; + self._LastImageDetails = details; + + function f(name) + { + var e = self._ImageManagerAttributesTable.getElementsByTagName('input'); + for(var i = 0; i < e.length; i++) + { + if(e[i].name == name) return e[i]; + } + + var e = self._ImageManagerAttributesTable.getElementsByTagName('select'); + for(var i = 0; i < e.length; i++) + { + if(e[i].name == name) return e[i]; + } + + return null; + } + + function s(name, value) + { + for(var i = 0; i < f(name).options.length; i++) + { + if(f(name).options[i].value == value) + { + // f(name).options[i].selected = true; + f(name).selectedIndex = i; + } + } + } + + if(!this._ImageManagerAttributesTable) + { + this._ImageManagerAttributesTable = (function() { + var table = document.createElement('table'); + table.className = 'filemanager-extended-options'; + var tbody = table.appendChild(document.createElement('tbody')); + + { // Description + var tr = tbody.appendChild(document.createElement('tr')); + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('Description:')); + + var td = tr.appendChild(document.createElement('td')); + var input = td.appendChild(document.createElement('input')); + + td.colSpan = 6; + input.name = 'f_alt'; + input.type = 'text'; + th.className = td.className = 'filemanager-f_alt'; + } + + { // Width, Constrain, Margin, + var tr = tbody.appendChild(document.createElement('tr')); + + { // Width + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('Width:')); + + var td = tr.appendChild(document.createElement('td')); + var input = td.appendChild(document.createElement('input')); + + input.name = 'f_width'; + input.size = 4; + input.type = 'text'; + // @TODO Constrain Ratio + th.className = td.className = 'filemanager-f_width'; + } + + { // Constrain + + var td = tr.appendChild(document.createElement('td')); + td.rowSpan = 2; + + var div = td.appendChild(document.createElement('div')); + div.style.position = 'relative'; + + var img = div.appendChild(document.createElement('img')); + img.src = Xinha.getPluginDir("ImageManager") + '/img/locked.gif'; + img.width = 25; + img.height = 32; + img.alt = 'Constrain Proportions'; + img.style.verticalAlign = 'middle'; + + var input = document.createElement('input'); + input.type = 'checkbox'; + input.name = 'f_constrain'; + input.style.position = 'absolute'; + input.style.top = '8px'; + input.style.left = '0px'; + input.value = 'on'; + input.checked = true; + div.appendChild(input); + + td.className = 'filemanager-f_constrain'; + + } + + if(self.phpcfg.UseHSpaceVSpace) + { // HSPACE/VSPACE + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('L/R Margin:')); + + var td = tr.appendChild(document.createElement('td')); + var input = td.appendChild(document.createElement('input')); + input.name = 'f_hspace'; + input.size = 3; + input.type = 'text'; + td.appendChild(document.createTextNode(' px ')); + th.className = td.className = 'filemanager-f_hspace'; + + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('T/B Margin:')); + var td = tr.appendChild(document.createElement('td')); + var input = td.appendChild(document.createElement('input')); + input.name = 'f_vspace'; + input.size = 3; + input.type = 'text'; + td.appendChild(document.createTextNode(' px ')); + th.className = td.className = 'filemanager-f_vspace'; + } + else + { + // Margin + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('Margin:')); + + var td = tr.appendChild(document.createElement('td')); + var input = td.appendChild(document.createElement('input')); + input.name = 'f_margin'; + input.size = 3; + input.type = 'text'; + td.appendChild(document.createTextNode(' px ')); + th.className = td.className = 'filemanager-f_margin'; + } + } + + { // Height, Padding, Colour + var tr = tbody.appendChild(document.createElement('tr')); + + { // Height + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('Height:')); + + var td = tr.appendChild(document.createElement('td')); + var input = td.appendChild(document.createElement('input')); + + input.name = 'f_height'; + input.size = 4; + input.type = 'text'; + // @TODO Constrain Ratio + th.className = td.className = 'filemanager-f_width'; + } + + { // Padding + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('Padding:')); + + var td = tr.appendChild(document.createElement('td')); + var input = td.appendChild(document.createElement('input')); + input.name = 'f_padding'; + input.size = 3; + input.type = 'text'; + td.appendChild(document.createTextNode(' px ')); + th.className = td.className = 'filemanager-f_padding'; + } + + { // Padding Colour (Background) + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('Colour:')); + + var td = tr.appendChild(document.createElement('td')); + var input = td.appendChild(document.createElement('input')); + input.name = 'f_backgroundColor'; + input.size = 7; + input.type = 'text'; + new Xinha.colorPicker.InputBinding(input); + th.className = td.className = 'filemanager-f_backgroundColor'; + } + } + + { // Alignment, Border, Colour + var tr = tbody.appendChild(document.createElement('tr')); + + { // Alignment + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('Alignment:')); + + var td = tr.appendChild(document.createElement('td')); + td.colSpan = 2; + var input = td.appendChild(document.createElement('select')); + + input.name = 'f_align'; + input.title = 'Positioning of this image'; + input.options[0] = new Option('', true, true); + input.options[1] = new Option('Left', 'left'); + input.options[2] = new Option('Right', 'right'); + input.options[3] = new Option('Top', 'top'); + input.options[4] = new Option('Middle', 'middle'); + input.options[5] = new Option('Bottom', 'bottom'); + + // @TODO Constrain Ratio + th.className = td.className = 'filemanager-f_align'; + } + + { // Border + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('Border:')); + + var td = tr.appendChild(document.createElement('td')); + var input = td.appendChild(document.createElement('input')); + input.name = 'f_border'; + input.size = 3; + input.type = 'text'; + td.appendChild(document.createTextNode(' px ')); + th.className = td.className = 'filemanager-f_border'; + } + + { // Border Colour + var th = tr.appendChild(document.createElement('th')); + var label = th.appendChild(document.createTextNode('Colour:')); + + var td = tr.appendChild(document.createElement('td')); + var input = td.appendChild(document.createElement('input')); + input.name = 'f_borderColor'; + input.size = 7; + input.type = 'text'; + new Xinha.colorPicker.InputBinding(input); + th.className = td.className = 'filemanager-f_borderColor'; + } + } + + var div = document.createElement('div'); + var h2 = document.createElement('h2'); + h2.appendChild(document.createTextNode('Image Attributes')); + div.appendChild(h2); + div.appendChild(table); + return div; + })(); + + + f('f_width').onkeyup = function() + { + if(!f('f_constrain').checked) return true; + if(!f('f_width').value) + { + f('f_width').value = ''; + f('f_height').value = ''; + } + else if(f('f_height').value && self._LastImageDetails) + { + f('f_height').value = self.ScaleImage(self._LastImageDetails, { width: f('f_width').value, height: null }).height; + } + else if(!self._LastImageDetails) + { + f('f_height').value = ''; + } + return true; + } + + f('f_height').onkeyup = function() + { + if(!f('f_constrain').checked) return true; + if(!f('f_height').value) + { + f('f_width').value = ''; + f('f_height').value = ''; + } + else if(f('f_width').value && self._LastImageDetails) + { + f('f_width').value = self.ScaleImage(self._LastImageDetails, { width: null, height: f('f_height').value }).width; + } + else if(!self._LastImageDetails) + { + f('f_width').value = ''; + } + return true; + } + + f('f_constrain').onclick = function() + { + if(this.checked && f('f_width').value && f('f_height').value) + { + var new_dim = self.ScaleImage(self._LastImageDetails, { width:f('f_width').value, height:f('f_height').value }); + f('f_width').value = new_dim.width; + f('f_height').value = new_dim.height; + } + } + } + + if(this.current_attributes) + { + f('f_alt').value = this.current_attributes.f_alt; + f('f_border').value = this.current_attributes.f_border; + s('f_align', this.current_attributes.f_align); + f('f_padding').value = this.current_attributes.f_padding; + if(f('f_margin')) f('f_margin').value = this.current_attributes.f_margin; + f('f_backgroundColor').value = this.current_attributes.f_backgroundColor; + f('f_borderColor').value = this.current_attributes.f_borderColor; + if(f('f_hspace')) f('f_hspace').value = this.current_attributes.f_hspace; + if(f('f_vspace')) f('f_vspace').value = this.current_attributes.f_vspace; + f('f_width').value = this.current_attributes.f_width ? this.current_attributes.f_width : ''; + f('f_height').value = this.current_attributes.f_height ? this.current_attributes.f_height : ''; + + this.current_attributes = null; + } + + // If no details were supplied, we return the current ones + if(!details) + { + var details = { + f_alt: f('f_alt').value, + f_border: f('f_border').value, + f_align: f('f_align').options[f('f_align').selectedIndex].value, + f_padding: f('f_padding').value, + f_margin: f('f_margin') ? f('f_margin').value : null, + f_backgroundColor: f('f_backgroundColor').value, + f_borderColor: f('f_borderColor').value, + f_hspace: f('f_hspace') ? f('f_hspace').value : null, + f_vspace: f('f_vspace') ? f('f_vspace').value : null, + f_width: f('f_width').value, + f_height: f('f_height').value, + + table: this._ImageManagerAttributesTable + } + return details; + } + + // If details were supplied, we set the appropriate ones. + if( + ( (f('f_width').value && f('f_width').value != details.width) + || (f('f_height').value && f('f_height').value != details.height) ) + && + (!details.url || !this.current_image || this.current_image.getAttribute('src') != details.url) + ) + { + // Check if this is the same image + var warn = function() { + new Dialog('This image is a different size, would you like to use the new size?', { + language: { + confirm: 'Shrink/Grow To Fit', + decline: 'Fullsize' + }, + + buttons: [ + 'confirm', + 'decline' + ], + + onConfirm: function(){ + if(f('f_constrain').checked) + { + var new_size = self.ScaleImage(details, {width: f('f_width').value, height: f('f_height').value}); + + f('f_width').value = f('f_width').value ? new_size.width : ''; + f('f_height').value = f('f_height').value ? new_size.height : ''; + } + }, + + onDecline: function(){ + f('f_width').value = ''; + f('f_height').value = ''; + } + }); + } + + if(!details.url) warn(); + else if(!this.current_image) warn(); + else + { + var src = self.current_image.getAttribute('src'); + if(!src.match(/^(([a-z]+:)|\/)/i)) + { + src = self.editor.config.baseHref.replace(/\/[^\/]*$/, '') + '/' + src; + if(src.match(/^[a-z]+:/i) && !self.phpcfg.images_url.match(/^[a-z]:/i)) + { + src = src.replace(/^[a-z]+:(\/\/?)[^/]*/i, ''); + } + } + if(details.url != src) warn(); + } + + } + + f('f_align').style.visibility = ''; // Ensure that the select hasn't been hidden by an overlay and not put back + + return this._ImageManagerAttributesTable; +}; + +/** Handle the "Select" return from the File Manager, inserting or updating an + * image as appropriate. Calles ImageManagerAttributes() with no arguments + * to find out the attributes to set. + */ + +MootoolsFileManager.prototype.ImageManagerReturn = function(path, file) +{ + var editor = this.editor; + var self = this; + var image = this.current_image; + + var param = self.ImageManagerAttributes(); + param.f_url = path; + + var img = image; + if (!img) { + if (Xinha.is_ie) { + var sel = editor._getSelection(); + var range = editor._createRange(sel); + editor._doc.execCommand("insertimage", false, param.f_url); + img = range.parentElement(); + // wonder if this works... + if (img.tagName.toLowerCase() != "img") { + img = img.previousSibling; + } + } else { + img = document.createElement('img'); + img.src = param.f_url; + editor.insertNodeAtSelection(img); + } + } else { + img.src = param.f_url; + } + + for (field in param) { + var value = param[field]; + // @TODO: Add ability to mfm for this to be possible. + switch (field) { + case "f_alt" : img.alt = value; break; + case "f_border" : + if(value.length) + { + img.style.borderWidth = /[^0-9]/.test(value) ? value : (parseInt(value) + 'px'); + if(img.style.borderWidth && !img.style.borderStyle) + { + img.style.borderStyle = 'solid'; + } + } + else + { + img.style.borderWidth = ''; + img.style.borderStyle = ''; + } + break; + + case "f_borderColor": img.style.borderColor = value; break; + case "f_backgroundColor": img.style.backgroundColor = value; break; + + case "f_padding": + { + if(value.length) + { + img.style.padding = /[^0-9]/.test(value) ? value : (parseInt(value) + 'px'); + } + else + { + img.style.padding = ''; + } + } + break; + + case "f_margin": + { + if(value && value.length) + { + img.style.margin = /[^0-9]/.test(value) ? value : (parseInt(value) + 'px'); + } + else + { + img.style.margin = ''; + } + } + break; + + case "f_align" : if(value && value !== true) { img.align = value; } else { img.removeAttribute('align'); } break; + + case "f_width" : + { + if(!isNaN(parseInt(value))) { img.width = parseInt(value); } else { img.removeAttribute('width'); } + } + break; + + case "f_height": + { + if(!isNaN(parseInt(value))) { img.height = parseInt(value); } else { img.removeAttribute('height'); } + } + break; + + case "f_hspace" : + { + if(!isNaN(parseInt(value))) { img.hspace = parseInt(value); } else { img.removeAttribute('hspace'); } + } + break; + + case "f_vspace" : + { + if(!isNaN(parseInt(value))) { img.vspace = parseInt(value); } else { img.removeAttribute('vspace'); } + } + break; + } + } +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.css 3 Jan 2016 20:51:25 -0000 1.1.2.1 @@ -0,0 +1,53 @@ +.filemanager-container .filemanager { overflow:visible; } +.filemanager-info-area { width:50%; float:left; clear:left; } +.filemanager-preview-area { width:50%; float:left; clear:right; } +div.filemanager-info-area dt, div.filemanager-preview-area dt { width:25%; margin-left:5px; } +div.filemanager-info-area dd, div.filemanager-preview-area dd { width:auto; } + +div.filemanager-preview-area dt { float:left; } +div.filemanager-preview-area h2 { display:none; } +div.filemanager-preview-area img.preview { margin-left:5px; margin-right:5px; margin-top:0px; float:right; clear:right; max-width:140px; } +div.filemanager-preview-area dl { float:left; clear:left; width:auto; } +div.filemanager-preview div.object { margin-left:15%; margin-right:15%; margin-top:0px; float:right; clear:right; } + +div.filemanager td, div.filemanager th, div.filemanager input[type=text] { + line-height: 20px; + font-size: 11px; +} + +div.filemanager th +{ + font-weight:bold; + text-align:left; + padding-left:0px; +} + +div.filemanager td.filemanager-f_alt input {width:100%;} + +div.filemanager table.filemanager-extended-options { width:550px; margin-left:5px; margin-right:5px; border-collapse:collapse; } + + +table.filemanager-extended-options .buttonColor { + width :1em; + margin-left: 2px; + cursor: default; +} + +table.filemanager-extended-options .buttonColor .chooser, table.filemanager-extended-options .buttonColor .nocolor { + height: 0.6em; + border: 1px solid; + padding: 0px 1em; + border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; +} + +table.filemanager-extended-options .buttonColor .buttonClick { + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; +} +table.filemanager-extended-options .buttonColor .buttonColor-hilite { + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; +} + +table.filemanager-extended-options .buttonColor .nocolor { padding: 0px; } +table.filemanager-extended-options .buttonColor .nocolor-hilite { background-color: #fff; color: #f00; } + +div.filemanager-uploader-area { clear:both; } \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/MootoolsFileManager.js 3 Jan 2016 20:51:26 -0000 1.1.2.1 @@ -0,0 +1,228 @@ +/** + = Mootools File Manager = + The MootoolsFileManager plugin allows for the management, selection and + insertion of links to files and inline images to the edited HTML. + + It requires the use of Mootools. If you do not use mootools plugins, + then mootools is not loaded. If mootools is already loaded, it will + not be reloaded (so if you want to use your own version of Mootools + then load it first). + + == Usage == + Instruct Xinha to load the MootoolsFileManager plugin (follow the NewbieGuide). + + Configure the plugin as per the directions in the config.php file. + + * @author $Author: gustafn $ + * @version $Id: MootoolsFileManager.js,v 1.1.2.1 2016/01/03 20:51:26 gustafn Exp $ + * @package MootoolsFileManager + */ + + +MootoolsFileManager._pluginInfo = { + name : "Mootols File Manager", + version : "1.0", + developer : "James Sleeman (Xinha), Christoph Pojer (FileManager)", + license : "MIT" +}; + +// All the configuration is done through PHP, please read config.php to learn how (or if you're in a real +// hurry, just edit config.php) +Xinha.Config.prototype.MootoolsFileManager = +{ + 'backend' : Xinha.getPluginDir("MootoolsFileManager") + '/backend.php?__plugin=MootoolsFileManager&', + 'backend_data' : { } +}; + +MootoolsFileManager.AssetLoader = Xinha.includeAssets(); + +// In case you want to use your own version of Mootools, you can load it first. +if(typeof MooTools == 'undefined') +{ + MootoolsFileManager.AssetLoader + .loadScript('mootools-filemanager/Demos/mootools-core.js', 'MootoolsFileManager') + .loadScript('mootools-filemanager/Demos/mootools-more.js', 'MootoolsFileManager'); +} + +// In case you want to use your own version of FileManager, you can load it first. +// You better look at the changes we had to do to the standard one though. +if(typeof FileManager == 'undefined') +{ + MootoolsFileManager.AssetLoader + .loadStyle('mootools-filemanager/Css/FileManager.css', 'MootoolsFileManager') + .loadStyle('mootools-filemanager/Css/Additions.css', 'MootoolsFileManager') + .loadScript('mootools-filemanager/Source/Additions.js', 'MootoolsFileManager') + .loadScript('mootools-filemanager/Source/Uploader/Fx.ProgressBar.js', 'MootoolsFileManager') + .loadScript('mootools-filemanager/Source/Uploader/Swiff.Uploader.js', 'MootoolsFileManager') + .loadScript('mootools-filemanager/Source/FileManager.js', 'MootoolsFileManager') + .loadScript('mootools-filemanager/Source/Uploader.js', 'MootoolsFileManager') + .loadScript('mootools-filemanager/Language/Language.en.js', 'MootoolsFileManager'); +} +MootoolsFileManager.AssetLoader.loadStyle('MootoolsFileManager.css', 'MootoolsFileManager'); + + +function MootoolsFileManager(editor) +{ + this.editor = editor; + var self = this; + var cfg = editor.config; + + // Do a callback to the PHP backend and get it to "decode" the configuration for us into a + // javascript object. + + // IMPORTANT: we need to do this synchronously to ensure that the buttons are added to the toolbar + // before the toolbar is drawn. + + var phpcfg = Xinha._posturlcontent(editor.config.MootoolsFileManager.backend+'__function=read-config', editor.config.MootoolsFileManager.backend_data); + + eval ('var f = '+phpcfg+';'); + self.phpcfg = f; + self.hookUpButtons(); + + return; +}; + +/** Connect up/insert the appropriate buttons and load in the auxillary files. + * + * The different "modes" of this plugin have been split into several auxilliary files + * as it's likely you may not want them all (esp if we add more modes later). + * + * Each mode's "include" is loaded as soon as we know it could be needed by the + * editor, we don't wait until the button is pressed as that would be slow for + * the user to respond. + * + */ + +MootoolsFileManager.prototype.hookUpButtons = function() +{ + var self = this; + var phpcfg = self.phpcfg; + + if (phpcfg.files_dir) + { + MootoolsFileManager.AssetLoader.loadScriptOnce('MootoolsFileManager.FileManager.js', 'MootoolsFileManager'); + + this.editor.config.registerButton({ + id : "linkfile", + tooltip : Xinha._lc("Insert File Link",'ExtendedFileManager'), + image : Xinha.getPluginDir('ExtendedFileManager') + '/img/ed_linkfile.gif', + textMode : false, + action : function(editor) { MootoolsFileManager.AssetLoader.whenReady(function() { self.OpenFileManager(); }); } + }); + + this.editor.config.addToolbarElement("linkfile", "createlink", 1); + }; + + if(phpcfg.images_dir) + { + MootoolsFileManager.AssetLoader.loadScriptOnce('MootoolsFileManager.ImageManager.js', 'MootoolsFileManager'); + + // Override our Editors insert image button action. + self.editor._insertImage = function(image) + { + MootoolsFileManager.AssetLoader.whenReady(function() { self.OpenImageManager(image); }); + } + } +}; + +/** Helper method to scale (an image typically) to a new constraint. + * + * @param origdim object { width: 123,height: 456 } The original dimensions. + * @param newdim object { width: 456, height: 123 } The new (maximum) dimensions. + * @param flexside 'width'|'height' (optional) the side which can be "flexible" + * Defaults to the "short" side. + * @return { width: 789, height: 987 } The scaled dimensions which should be used. + */ + +MootoolsFileManager.prototype.ScaleImage = function( origdim, newdim, flexside ) +{ + if(!origdim.height || !origdim.width) return newdim; // No old size, stays new. + if(!newdim.height && !newdim.width) return origdim; // No new size, stays the same. + + if(!flexside) + { + if(origdim.width > origdim.height) + { + flexside = 'height'; // Landscape image, allow the height to flex. + } + else + { + flexside = 'width'; // Portrait image, allow the width to flex + } + } + + var knownside = null; + switch(flexside) + { + case 'height': knownside = 'width'; break; + case 'width' : knownside = 'height'; break; + } + + // If we DON'T know the known side, we need to flip it. + if(!newdim[knownside]) + { + var t = knownside; + knownside = flexside; + flexside = t; + } + + var ratio = 0; + switch(flexside) + { + case 'width': ratio = origdim.width / origdim.height; break; + case 'height': ratio = origdim.height / origdim.width; break; + } + + var rdim = {}; + rdim[knownside] = newdim[knownside]; + rdim[flexside] = Math.floor(newdim[knownside] * ratio); + if(isNaN(rdim[knownside])) rdim[knownside] = null; + if(isNaN(rdim[flexside])) rdim[flexside] = null; + return rdim; +} + +/** Take a multi-part CSS size specification (eg sizes for 4 borders) and + * shrink it into one if possible. + */ + +MootoolsFileManager.prototype.shortSize = function(cssSize) +{ + if(/ /.test(cssSize)) + { + var sizes = cssSize.split(' '); + var useFirstSize = true; + for(var i = 1; i < sizes.length; i++) + { + if(sizes[0] != sizes[i]) + { + useFirstSize = false; + break; + } + } + if(useFirstSize) cssSize = sizes[0]; + } + return cssSize; +}; + +/** Take a colour in rgb(a,b) format and convert to HEX + * handles multiple colours in same string as well. + */ + +MootoolsFileManager.prototype.convertToHex = function(color) +{ + if (typeof color == "string" && /, /.test.color) + color = color.replace(/, /, ','); // rgb(a, b) => rgb(a,b) + + if (typeof color == "string" && / /.test.color) { // multiple values + var colors = color.split(' '); + var colorstring = ''; + for (var i = 0; i < colors.length; i++) { + colorstring += Xinha._colorToRgb(colors[i]); + if (i + 1 < colors.length) + colorstring += " "; + } + return colorstring; + } + + return Xinha._colorToRgb(color); +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/README.DEVELOPERS =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/README.DEVELOPERS,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/README.DEVELOPERS 3 Jan 2016 20:51:26 -0000 1.1.2.1 @@ -0,0 +1,11 @@ +The mootools-filemanager is a git repository which (probably) contains local modifications to work better with Xinha. Therefore, we want to keep it as a git repo so we can easily update. + +The upstream git repository is (from http://github.com/cpojer/mootools-filemanager) + +git://github.com/cpojer/mootools-filemanager.git + +Simply CD'ing into the mootools-filemanager directory and performing + git pull +should be sufficient to update. + +The mootools-filemanager/.git/ directory should be stripped prior to shipping for space concerns. Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/backend.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/backend.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/backend.php 3 Jan 2016 20:51:26 -0000 1.1.2.1 @@ -0,0 +1,133 @@ + $IMConfig['images_dir'], + 'baseURL' => $IMConfig['images_url'], + + 'assetBasePath' => $IMConfig['base_url'] .'/mootools-filemanager/Assets', + + 'upload' => $IMConfig['allow_images_upload'], + 'maxUploadSize' => size_to_bytes($IMConfig['max_images_upload_size']), + + 'suggestedMaxImageDimension' => $IMConfig['suggested_images_image_dimension'], + + 'destroy' => $IMConfig['allow_images_delete'], + 'filter' => 'image/', + + )); + + $browser->fireEvent(!empty($_REQUEST['event']) ? $_REQUEST['event'] : null); + break; + + case 'file-manager': + include('mootools-filemanager/Backend/FileManager.php'); + + $browser = new FileManager(array( + 'directory' => $IMConfig['files_dir'], + 'baseURL' => $IMConfig['files_url'], + + 'assetBasePath' => $IMConfig['base_url'] .'/mootools-filemanager/Assets', + + 'upload' => $IMConfig['allow_files_upload'], + 'maxUploadSize' => size_to_bytes($IMConfig['max_files_upload_size']), + + 'suggestedMaxImageDimension' => $IMConfig['suggested_files_image_dimension'], + + 'destroy' => $IMConfig['allow_files_delete'], + // 'filter' => $IMConfig['files_filter'], + + )); + + $browser->fireEvent(!empty($_REQUEST['event']) ? $_REQUEST['event'] : null); + break; +} + +?> Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/config.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/config.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/config.php 3 Jan 2016 20:51:26 -0000 1.1.2.1 @@ -0,0 +1,193 @@ + '/home/your/directory', + 'images_url' => '/directory', + 'allow_images_upload' => true, + ) + ) + ?> + } + }}} + + This will work provided you are using normal file-based PHP sessions + (most likely), if not, you may need to modify the php-xinha.php + file to suit your setup. + + * @author $Author: gustafn $ + * @version $Id: config.php,v 1.1.2.1 2016/01/03 20:51:26 gustafn Exp $ + * @package MootoolsFileManager + * + */ + + + /** + == File Paths REQUIRED == + + This plugin operates (optionally) in two modes. + + 1. As a File Manager where people are inserting a link to a file + (eg a doc or pdf commonly), we call this "files" mode. + 2. As an Image Manager where people are inserting an inline image, + we call this "images" mode. + + You may provide one of, or both of, files_dir and images_dir. If you do not + provide one, that mode of MootoolsFileManager will be disabled. + + # `files_dir` -- Directory path to the location where ordinary files are stored + (eg /home/you/public_html/downloads/ ) + # `files_url` -- The URL path to the files_dir + (eg /downloads/) + # `images_dir` -- Directory path to the location where inline images are stored + (eg /home/you/public_html/images/) + # `images_url` -- The URL path to the images_dir + + === Security Caution === + + You should ensure that the paths you specify are protected against having PHP and + other scripts from being executed. The following .htaccess file is a good idea + + {{{ + + php_flag engine off + + AddType text/html .html .htm .shtml .php .php3 .php4 .php5 .php6 .php7 .php8 .phtml .phtm .pl .py .cgi + RemoveHandler .php + RemoveHandler .php8 + RemoveHandler .php7 + RemoveHandler .php6 + RemoveHandler .php5 + RemoveHandler .php4 + RemoveHandler .php3 + }}} + + */ + + $IMConfig['files_dir'] = FALSE; // No trailing slash + $IMConfig['files_url'] = FALSE; // No trailing slash + + $IMConfig['images_dir'] = FALSE; // No trailing slash + $IMConfig['images_url'] = FALSE; // No trailing slash + + /** + == Turning On Uploads == + We have two sets of settings for turning on uploads, one controls the files mode + of the plugin, the other is for images mode. + + Note that allowing upload also permits the user to create subdirectories to better + organise the files. + + === Maximum File Sizes === + + Each mode can have a different maximum file size that can be uploaded, this + size is a number followed by one of M, KB or B. + + === Suggested Image Dimensions === + + Each mode can have a different "suggested maximum image dimension", when the + user uses the Mootools File Manager to upload a file, they are able to choose + to "resize large images" on upload. This defines what "large" means. + + */ + + $IMConfig['allow_files_upload'] = false; + $IMConfig['allow_files_delete'] = false; + $IMConfig['max_files_upload_size'] = '3M'; + $IMConfig['suggested_files_image_dimension'] = array('width' => 2048, 'height' => 1536); + + $IMConfig['allow_images_upload'] = false; + $IMConfig['allow_images_delete'] = false; + $IMConfig['max_images_upload_size'] = '3M'; + $IMConfig['suggested_images_image_dimension'] = array('width' => 1024, 'height' => 768); + + +// ------------------------------------------------------------------------- +// OPTIONAL SETTINGS +// ------------------------------------------------------------------------- + +/** + +== Plugin Path == + + For most people the defaults will work fine, but if you have trouble, you can set + `base_dir` to be the directory path to xinha/plugins/MootoolsFileManager + `base_url` to be the url path to xinha/plugins/MootoolsFileManager +*/ + +$IMConfig['base_dir'] = getcwd(); +$IMConfig['base_url'] = preg_replace('/\/backend\.php.*/', '', $_SERVER['REQUEST_URI']); + +/** + +== HTML Compatability == + + For most people the default of using CSS will be fine, but if the HTML you are editing + in Xinha is destined for an email you will probably want to use hspace and vspace + instead of CSS margins because of poor Email support for CSS. + +*/ + +$IMConfig['UseHSpaceVSpace'] = TRUE; + + /** + // Future use, not yet required. + + == ImageMagick Path == + + Certain operations require that ImageMagick is available on your server, + mogrify, convert and identify executables are required. + + If these executables are not in your executable path, you'll want to + set the path to them here, for Linux/Unix etc this will be something like + + {{{ + /usr/bin + }}} + + for Windows servers, something like + + {{{ + C:/"Program Files"/ImageMagick-5.5.7-Q16/ + }}} + + + + $IMConfig['IMAGE_TRANSFORM_LIB_PATH'] = ''; +*/ + +//////////////////////////////////////////////////////////////////////////////// +// ================== END OF CONFIGURATION ======================= // +//////////////////////////////////////////////////////////////////////////////// + + +// Standard PHP Backend Data Passing +// if data was passed using xinha_pass_to_php_backend() we merge the items +// provided into the Config +require_once(realpath(dirname(__FILE__) . '/../../contrib/php-xinha.php')); + +if($passed_data = xinha_read_passed_data()) +{ + $IMConfig = array_merge($IMConfig, $passed_data); +} +@session_write_close(); // Close session now so we don't lock. + +?> Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/LICENSE =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/LICENSE,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/LICENSE 3 Jan 2016 20:51:26 -0000 1.1.2.1 @@ -0,0 +1,24 @@ +MooTools FileManager - MIT License + +Copyright (c) 2009 Christoph Pojer + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/README.md =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/README.md,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/README.md 3 Jan 2016 20:51:27 -0000 1.1.2.1 @@ -0,0 +1,43 @@ +MooTools FileManager - Copyright (c) 2009 [Christoph Pojer](http://og5.net/christoph) +===================================================================================== + +A filemanager for the web based on MooTools that allows you to (pre)view, upload and modify files and folders via your browser. + +![Screenshot](http://cpojer.net/Forge/FileManager.png) + +*Please Note:* This is currently a pre-release. The final 1.0 version is going to be released "soon". + +### Features + +* Browse through Files and Folders on your Server +* Rename, Delete, Move (Drag&Drop), Copy (Drag + hold CTRL) and Download Files +* View detailed Previews of Images, Text-Files, Compressed-Files or Audio Content +* Nice User Interface ;) +* Upload Files via FancyUpload (integrated Feature) +* Option to automatically resize big Images when uploading +* Use it to select a File anywhere you need to specify one inside your Application's Backend +* Use as a FileManager in TinyMCE +* Provides your client with the most possible convenience ( ;D ) +* Create galleries using the Gallery-Plugin + +How to use +---------- + +### Demos + +* Open the "Demos/" folder and have fun +* To test TinyMCE Download and extract it to "Demos/TinyMCE" and access "Demos/tinymce.html" +* Demo of 1.0rc2 (old): http://cpojer.net/Scripts/FileManager/Demos/ + +### Configurable Options + +* See Source/FileManager.js and Backend/FileManager.php for all available options on the client- and server-side + +### Installation + +* See "Demos/index.html" for the clientside integration +* See "Demos/manager.php" or "Demos/selectImage.php" for serverside integration + +### Custom Authentication + +* As Flash and therefore the Uploader ignores authenticated clients you need to specify your own authentication. In order to do this you need to provide a custom "UploadIsAuthenticated" function on the serverside and you need to specify "uploadAuthData" on the client. \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/package.yml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/package.yml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/package.yml 3 Jan 2016 20:51:27 -0000 1.1.2.1 @@ -0,0 +1,5 @@ +name: MooTools FileManager +author: cpojer +category: Interface +tags: [filemanager, upload, gallery, images, navigation] +demo: http://cpojer.net/Scripts/FileManager1-0/Demos \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/add.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/add.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/bar.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/bar.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/button.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/button.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/button_disabled.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/button_disabled.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/cancel.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/cancel.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/checkbox.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/checkbox.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/destroy.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/destroy.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/disk.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/disk.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/filelist.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/filelist.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/filelist_selected.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/filelist_selected.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/loader.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/loader.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/menu.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/menu.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/progress.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/progress.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/rename.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/rename.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/7z.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/7z.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/ace.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/ace.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/as.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/as.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/bat.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/bat.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/bmp.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/bmp.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/cmd.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/cmd.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/default.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/default.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/dir.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/dir.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/dir_up.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/dir_up.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/doc.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/doc.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/docx.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/docx.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/exe.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/exe.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/flv.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/flv.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/gif.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/gif.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/gz.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/gz.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/html.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/html.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/ini.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/ini.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/iso.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/iso.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/jpeg.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/jpeg.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/jpg.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/jpg.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/js.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/js.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/lnk.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/lnk.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/mp3.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/mp3.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/odp.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/odp.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/ods.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/ods.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/odt.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/odt.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/pdf.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/pdf.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/php.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/php.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/png.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/png.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/ppt.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/ppt.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/rar.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/rar.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/rb.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/rb.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/sql.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/sql.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/swf.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/swf.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/tar.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/tar.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/wmv.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/wmv.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/xls.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/xls.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/xlsx.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/xlsx.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/zip.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Assets/Icons/zip.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/FileManager.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/FileManager.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/FileManager.php 3 Jan 2016 20:51:37 -0000 1.1.2.1 @@ -0,0 +1,429 @@ +options = array_merge(array( + 'directory' => '../Demos/Files', + 'baseURL' => '', + 'assetBasePath' => '../Assets', + 'id3Path' => $path . '/Assets/getid3/getid3.php', + 'mimeTypesPath' => $path . '/MimeTypes.ini', + 'dateFormat' => 'j M Y - H:i', + 'maxUploadSize' => 1024 * 1024 * 3, + 'upload' => false, + 'destroy' => false, + 'safe' => true, + 'filter' => null, + + // Xinha: Allow to specify the "Resize Large Images" tolerance level. + 'suggestedMaxImageDimension' => array('width' => 800, 'height' => 600), + ), $options); + + $this->basedir = realpath($this->options['directory']); + $this->basename = pathinfo($this->basedir, PATHINFO_BASENAME) . '/'; + $this->path = realpath($this->options['directory'] . '/../'); + $this->length = strlen($this->path); + + header('Expires: Fri, 01 Jan 1990 00:00:00 GMT'); + header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); + + $this->get = $_GET; + $this->post = $_POST; + } + + public function fireEvent($event){ + $event = $event ? 'on' . ucfirst($event) : null; + if (!$event || !method_exists($this, $event)) $event = 'onView'; + + $this->{$event}(); + } + + protected function onView(){ + $dir = $this->getDir(!empty($this->post['directory']) ? $this->post['directory'] : null); + $files = ($files = glob($dir . '/*')) ? $files : array(); + + if ($dir != $this->basedir) array_unshift($files, $dir . '/..'); + natcasesort($files); + foreach ($files as $file){ + $mime = $this->getMimeType($file); + if ($this->options['filter'] && $mime != 'text/directory' && !FileManagerUtility::startsWith($mime, $this->options['filter'])) + continue; + + $out[is_dir($file) ? 0 : 1][] = array( + 'name' => pathinfo($file, PATHINFO_BASENAME), + 'date' => date($this->options['dateFormat'], filemtime($file)), + 'mime' => $this->getMimeType($file), + 'icon' => $this->getIcon($this->normalize($file)), + 'size' => filesize($file) + ); + } + + echo json_encode(array( + 'path' => $this->getPath($dir), + 'dir' => array( + 'name' => pathinfo($dir, PATHINFO_BASENAME), + 'date' => date($this->options['dateFormat'], filemtime($dir)), + 'mime' => 'text/directory', + 'icon' => 'dir' + ), + 'files' => array_merge(!empty($out[0]) ? $out[0] : array(), !empty($out[1]) ? $out[1] : array()) + )); + } + + protected function onDetail(){ + if (empty($this->post['directory']) || empty($this->post['file'])) return; + + $file = realpath($this->path . '/' . $this->post['directory'] . '/' . $this->post['file']); + if (!$this->checkFile($file)) return; + + require_once($this->options['id3Path']); + + // Xinha: The URL is weird in the standard distribution of filemanager, it seems to expect + // that the files directory (where you are selecting/uploading) is always within the filemanager + // directory itself somewhere. + // + // Also the 'baseURL' seems to be wanted as the parent of the 'basedir' ("directory" option) + // Xinha is supplying both the same (eg url = /foo/test and dir = /home/bar/public_html/foo/test ) + // so we will rip off the first part of directory, below. + $url = $this->options['baseURL'] . '/' . preg_replace('/^[^\/]*\//', '', $this->post['directory'] . '/' . $this->post['file']); + + $mime = $this->getMimeType($file); + $content = null; + + // Xinha: We want to get some more information about what has been selected in a way + // we can use it. Effectively what gets put in here will be passed into the + // 'onDetails' event handler of your FileManager object (if any). + $extra_return_detail = array + ( + 'url' => $url, + 'mime' => $mime + ); + + if (FileManagerUtility::startsWith($mime, 'image/')){ + $size = getimagesize($file); + $content = ' +

    ${more}

    +
    +
    ${width}
    ' . $size[0] . 'px
    +
    ${height}
    ' . $size[1] . 'px
    +
    '; + + // Xinha: Return some information about the image which can be access + // from the onDetails event handler in FileManager + $extra_return_detail['width'] = $size[0]; + $extra_return_detail['height'] = $size[1]; + + }elseif (FileManagerUtility::startsWith($mime, 'text/') || $mime == 'application/x-javascript'){ + $filecontent = file_get_contents($file, null, null, 0, 300); + if (!FileManagerUtility::isBinary($filecontent)) $content = '
    ' . nl2br(str_replace(array('$', "\t"), array('$', '  '), htmlentities($filecontent))) . '
    '; + }elseif ($mime == 'application/zip'){ + $out = array(array(), array()); + $getid3 = new getID3(); + $getid3->Analyze($file); + foreach ($getid3->info['zip']['files'] as $name => $size){ + $icon = is_array($size) ? 'dir' : $this->getIcon($name); + $out[($icon == 'dir') ? 0 : 1][$name] = '
  • ' . $name . '
  • '; + } + natcasesort($out[0]); + natcasesort($out[1]); + $content = '
      ' . implode(array_merge($out[0], $out[1])) . '
    '; + }elseif (FileManagerUtility::startsWith($mime, 'audio/')){ + $getid3 = new getID3(); + $getid3->Analyze($file); + + $content = '
    + + + +
    +

    ${more}

    +
    +
    ${title}
    ' . $getid3->info['comments']['title'][0] . '
    +
    ${artist}
    ' . $getid3->info['comments']['artist'][0] . '
    +
    ${album}
    ' . $getid3->info['comments']['album'][0] . '
    +
    ${length}
    ' . $getid3->info['playtime_string'] . '
    +
    ${bitrate}
    ' . round($getid3->info['bitrate']/1000) . 'kbps
    +
    '; + } + + echo json_encode(array_merge(array( + 'content' => $content ? $content : '
    + ${nopreview}
    +
    ' + ), $extra_return_detail)); + } + + protected function onDestroy(){ + if (!$this->options['destroy'] || empty($this->post['directory']) || empty($this->post['file'])) return; + + $file = realpath($this->path . '/' . $this->post['directory'] . '/' . $this->post['file']); + if (!$this->checkFile($file)) return; + + $this->unlink($file); + + echo json_encode(array( + 'content' => 'destroyed' + )); + } + + protected function onCreate(){ + if ($this->options['upload']) + { + if (empty($this->post['directory']) || empty($this->post['file'])) return; + + $file = $this->getName($this->post['file'], $this->getDir($this->post['directory'])); + if (!$file) return; + + mkdir($file); + } + + $this->onView(); + } + + protected function onUpload(){ + try{ + if (!$this->options['upload']) + throw new FileManagerException('disabled'); + if (empty($this->get['directory']) || (function_exists('UploadIsAuthenticated') && !UploadIsAuthenticated($this->get))) + throw new FileManagerException('authenticated'); + + $dir = $this->getDir($this->get['directory']); + $name = pathinfo((Upload::exists('Filedata')) ? $this->getName($_FILES['Filedata']['name'], $dir) : null, PATHINFO_FILENAME); + $file = Upload::move('Filedata', $dir . '/', array( + 'name' => $name, + 'extension' => $this->options['safe'] && $name && in_array(strtolower(pathinfo($_FILES['Filedata']['name'], PATHINFO_EXTENSION)), array('exe', 'dll', 'php', 'php3', 'php4', 'php5', 'phps')) ? 'txt' : null, + 'size' => $this->options['maxUploadSize'], + 'mimes' => $this->getAllowedMimeTypes() + )); + + if (FileManagerUtility::startsWith(Upload::mime($file), 'image/') && !empty($this->get['resize'])){ + $img = new Image($file); + $size = $img->getSize(); + if ($size['width'] > $this->options['suggestedMaxImageDimension']['width']) $img->resize( $this->options['suggestedMaxImageDimension']['width'])->save(); + elseif ($size['height'] > $this->options['suggestedMaxImageDimension']['height']) $img->resize(null, $this->options['suggestedMaxImageDimension']['height'])->save(); + } + + echo json_encode(array( + 'status' => 1, + 'name' => pathinfo($file, PATHINFO_BASENAME) + )); + }catch(UploadException $e){ + echo json_encode(array( + 'status' => 0, + 'error' => class_exists('ValidatorException') ? strip_tags($e->getMessage()) : '${upload.' . $e->getMessage() . '}' // This is for Styx :) + )); + }catch(FileManagerException $e){ + echo json_encode(array( + 'status' => 0, + 'error' => '${upload.' . $e->getMessage() . '}' + )); + } + } + + /* This method is used by both move and rename */ + protected function onMove(){ + if (empty($this->post['directory']) || empty($this->post['file'])) return; + + $rename = empty($this->post['newDirectory']) && !empty($this->post['name']); + $dir = $this->getDir($this->post['directory']); + $file = realpath($dir . '/' . $this->post['file']); + + $is_dir = is_dir($file); + if (!$this->checkFile($file) || (!$rename && $is_dir)) + return; + + if ($rename || $is_dir){ + if (empty($this->post['name'])) return; + $newname = $this->getName($this->post['name'], $dir); + $fn = 'rename'; + }else{ + $newname = $this->getName(pathinfo($file, PATHINFO_FILENAME), $this->getDir($this->post['newDirectory'])); + $fn = !empty($this->post['copy']) ? 'copy' : 'rename'; + } + + if (!$newname) return; + + $ext = pathinfo($file, PATHINFO_EXTENSION); + if ($ext) $newname .= '.' . $ext; + $fn($file, $newname); + + echo json_encode(array( + 'name' => pathinfo($this->normalize($newname), PATHINFO_BASENAME), + )); + } + + protected function unlink($file){ + $file = realpath($file); + if ($this->basedir==$file || strlen($this->basedir)>=strlen($file)) + return; + + if (is_dir($file)){ + $files = glob($file . '/*'); + if (is_array($files)) + foreach ($files as $f) + $this->unlink($f); + + rmdir($file); + }else{ + try{ if ($this->checkFile($file)) unlink($file); }catch(Exception $e){} + } + } + + protected function getName($file, $dir){ + $files = array(); + foreach ((array)glob($dir . '/*') as $f) + $files[] = pathinfo($f, PATHINFO_FILENAME); + + $pathinfo = pathinfo($file); + $file = $dir . '/' . FileManagerUtility::pagetitle($pathinfo['filename'], $files).(!empty($pathinfo['extension']) ? '.' . $pathinfo['extension'] : null); + + return !$file || !FileManagerUtility::startsWith($file, $this->basedir) || file_exists($file) ? null : $file; + } + + protected function getIcon($file){ + if (FileManagerUtility::endsWith($file, '/..')) return 'dir_up'; + else if (is_dir($file)) return 'dir'; + + $ext = pathinfo($file, PATHINFO_EXTENSION); + return ($ext && file_exists(realpath($this->options['assetBasePath'] . '/Icons/' . $ext . '.png'))) ? $ext : 'default'; + } + + protected function getMimeType($file){ + return is_dir($file) ? 'text/directory' : Upload::mime($file); + } + + protected function getDir($dir){ + $dir = realpath($this->path . '/' . (FileManagerUtility::startsWith($dir, $this->basename) ? $dir : $this->basename)); + return $this->checkFile($dir) ? $dir : $this->basedir; + } + + protected function getPath($file){ + $file = $this->normalize(substr($file, $this->length)); + return substr($file, FileManagerUtility::startsWith($file, '/') ? 1 : 0); + } + + protected function checkFile($file){ + $mimes = $this->getAllowedMimeTypes(); + $hasFilter = $this->options['filter'] && count($mimes); + if ($hasFilter) array_push($mimes, 'text/directory'); + return !(!$file || !FileManagerUtility::startsWith($file, $this->basedir) || !file_exists($file) || ($hasFilter && !in_array($this->getMimeType($file), $mimes))); + } + + protected function normalize($file){ + return preg_replace('/\\\|\/{2,}/', '/', $file); + } + + protected function getAllowedMimeTypes(){ + $filter = $this->options['filter']; + + if (!$filter) return null; + if (!FileManagerUtility::endsWith($filter, '/')) return array($filter); + + static $mimes; + if (!$mimes) $mimes = parse_ini_file($this->options['mimeTypesPath']); + + foreach ($mimes as $mime) + if (FileManagerUtility::startsWith($mime, $filter)) + $mimeTypes[] = strtolower($mime); + + return $mimeTypes; + } + +} + +class FileManagerException extends Exception {} + +/* Stripped-down version of some Styx PHP Framework-Functionality bundled with this FileBrowser. Styx is located at: http://styx.og5.net */ +class FileManagerUtility { + + public static function endsWith($string, $look){ + return strrpos($string, $look)===strlen($string)-strlen($look); + } + + public static function startsWith($string, $look){ + return strpos($string, $look)===0; + } + + public static function pagetitle($data, $options = array()){ + static $regex; + if (!$regex){ + $regex = array( + explode(' ', 'Æ æ Œ œ ß Ü ü Ö ö Ä ä À Á Â Ã Ä Å Ą Ă Ç Ć Č Ď Đ Ð È É Ê Ë Ę Ě Ğ Ì Í Î Ï İ Ł Ľ Ĺ Ñ Ń Ň Ò Ó Ô Õ Ö Ø Ő Ŕ Ř Š Ś Ş Ť Ţ Ù Ú Û Ü Ů Ű Ý Ž Ź Ż à á â ã ä å ą ă ç ć č ď đ è é ê ë ę ě ğ ì í î ï ı ł ľ ĺ ñ ń ň ð ò ó ô õ ö ø ő ŕ ř ś š ş ť ţ ù ú û ü ů ű ý ÿ ž ź ż'), + explode(' ', 'Ae ae Oe oe ss Ue ue Oe oe Ae ae A A A A A A A A C C C D D D E E E E E E G I I I I I L L L N N N O O O O O O O R R S S S T T U U U U U U Y Z Z Z a a a a a a a a c c c d d e e e e e e g i i i i i l l l n n n o o o o o o o o r r s s s t t u u u u u u y y z z z'), + ); + + $regex[0][] = '"'; + $regex[0][] = "'"; + } + + $data = trim(substr(preg_replace('/(?:[^A-z0-9]|_|\^)+/i', '_', str_replace($regex[0], $regex[1], $data)), 0, 64), '_'); + return !empty($options) ? self::checkTitle($data, $options) : $data; + } + + protected static function checkTitle($data, $options = array(), $i = 0){ + if (!is_array($options)) return $data; + + foreach ($options as $content) + if ($content && strtolower($content) == strtolower($data.($i ? '_' . $i : ''))) + return self::checkTitle($data, $options, ++$i); + + return $data.($i ? '_' . $i : ''); + } + + public static function isBinary($str){ + $array = array(0, 255); + for($i = 0; $i < strlen($str); $i++) + if (in_array(ord($str[$i]), $array)) return true; + + return false; + } + + public static function getPath(){ + static $path; + return $path ? $path : $path = pathinfo(__FILE__, PATHINFO_DIRNAME); + } + +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Image.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Image.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Image.php 3 Jan 2016 20:51:37 -0000 1.1.2.1 @@ -0,0 +1,290 @@ + + * + * @link http://www.bin-co.com/php/scripts/classes/gd_image/ Based on work by "Binny V A" + */ + +class Image { + /** + * The path to the image file + * + * @var string + */ + private $file; + /** + * The image resource + * + * @var resource + */ + private $image; + /** + * Metadata regarding the image + * + * @var array + */ + private $meta; + + /** + * @param string $file The path to the image file + */ + public function __construct($file){ + $file = realpath($file); + if(!file_exists($file)) + return; + + $this->file = $file; + $img = getimagesize($file); + + $this->meta = array( + 'width' => $img[0], + 'height' => $img[1], + 'mime' => $img['mime'], + 'ext' => end(explode('/', $img['mime'])), + ); + if($this->meta['ext']=='jpg') + $this->meta['ext'] = 'jpeg'; + + if(!in_array($this->meta['ext'], array('gif', 'png', 'jpeg'))) + return; + + if(in_array($this->meta['ext'], array('gif', 'png'))){ + $this->image = $this->create(); + + $fn = 'imagecreatefrom'.$this->meta['ext']; + $original = $fn($file); + imagecopyresampled($this->image, $original, 0, 0, 0, 0, $this->meta['width'], $this->meta['height'], $this->meta['width'], $this->meta['height']); + }else{ + $this->image = imagecreatefromjpeg($file); + } + } + + public function __destruct(){ + if(!empty($this->image)) imagedestroy($this->image); + } + + /** + * Returns the size of the image + * + * @return array + */ + public function getSize(){ + return array( + 'width' => $this->meta['width'], + 'height' => $this->meta['height'], + ); + } + + /** + * Creates a new, empty image with the desired size + * + * @param int $x + * @param int $y + * @param string $ext + * @return resource + */ + private function create($x = null, $y = null, $ext = null){ + if(!$x) $x = $this->meta['width']; + if(!$y) $y = $this->meta['height']; + + $image = imagecreatetruecolor($x, $y); + if(!$ext) $ext = $this->meta['ext']; + if($ext=='png'){ + imagealphablending($image, false); + imagefilledrectangle($image, 0, 0, $x, $y, imagecolorallocatealpha($image, 0, 0, 0, 127)); + } + + return $image; + } + + /** + * Replaces the image resource with the given parameter + * + * @param resource $new + */ + private function set($new){ + imagedestroy($this->image); + $this->image = $new; + + $this->meta['width'] = imagesx($this->image); + $this->meta['height'] = imagesy($this->image); + } + + /** + * Returns the path to the image file + * + * @return string + */ + public function getPathname(){ + return $this->file; + } + + /** + * Rotates the image by the given angle + * + * @param int $angle + * @param array $bgcolor An indexed array with red/green/blue/alpha values + * @return Image + */ + public function rotate($angle, $bgcolor = null){ + if(empty($this->image) || !$angle || $angle>=360) return $this; + + $this->set(imagerotate($this->image, $angle, is_array($bgcolor) ? imagecolorallocatealpha($this->image, $bgcolor[0], $bgcolor[1], $bgcolor[2], !empty($bgcolor[3]) ? $bgcolor[3] : null) : $bgcolor)); + + return $this; + } + + /** + * Resizes the image to the given size, automatically calculates + * the new ratio if parameter {@link $ratio} is set to true + * + * @param int $x + * @param int $y + * @param bool $ratio + * @return Image + */ + public function resize($x = null, $y = null, $ratio = true){ + if(empty($this->image) || (!$x && !$y)) return $this; + + if(!$y) $y = $ratio ? $this->meta['height']*$x/$this->meta['width'] : $this->meta['height']; + if(!$x) $x = $ratio ? $this->meta['width']*$y/$this->meta['height'] : $this->meta['width']; + + $new = $this->create($x, $y); + imagecopyresampled($new, $this->image, 0, 0, 0, 0, $x, $y, $this->meta['width'], $this->meta['height']); + $this->set($new); + + return $this; + } + + /** + * Crops the image. The values are given like margin/padding values in css + * + * Example + *
      + *
    • crop(10) - Crops by 10px on all sides
    • + *
    • crop(10, 5) - Crops by 10px on top and bottom and by 5px on left and right sides
    • + *
    • crop(10, 5, 5) - Crops by 10px on top and by 5px on left, right and bottom sides
    • + *
    • crop(10, 5, 3, 2) - Crops by 10px on top, 5px by right, 3px by bottom and 2px by left sides
    • + *
    + * + * @param int $top + * @param int $right + * @param int $bottom + * @param int $left + * @return Image + */ + public function crop($top, $right = null, $bottom = null, $left = null){ + if(empty($this->image)) return $this; + + if(!is_numeric($right) && !is_numeric($bottom) && !is_numeric($left)) + $right = $bottom = $left = $top; + + if(!is_numeric($bottom) && !is_numeric($left)){ + $bottom = $top; + $left = $right; + } + + if(!is_numeric($left)) + $left = $right; + + $x = $this->meta['width']-$left-$right; + $y = $this->meta['height']-$top-$bottom; + + if($x<0 || $y<0) return $this; + + $new = $this->create($x, $y); + imagecopy($new, $this->image, 0, 0, $left, $top, $x, $y); + $this->set($new); + + return $this; + } + + /** + * Flips the image horizontally or vertically. To Flip both just use ->rotate(180) + * + * @see Image::rotate() + * @param string $type Either horizontal or vertical + * @return Image + */ + public function flip($type){ + if(empty($this->image) || !in_array($type, array('horizontal', 'vertical'))) return $this; + + $new = $this->create(); + + if($type=='horizontal') + for($x=0;$x<$this->meta['width'];$x++) + imagecopy($new, $this->image, $this->meta['width']-$x-1, 0, $x, 0, 1, $this->meta['height']); + elseif($type=='vertical') + for($y=0;$y<$this->meta['height'];$y++) + imagecopy($new, $this->image, 0, $this->meta['height']-$y-1, 0, $y, $this->meta['width'], 1); + + $this->set($new); + + return $this; + } + + /** + * Stores the image in the desired directory or outputs it + * + * @param string $ext + * @param string $file + */ + private function process($ext = null, $file = null){ + if(!$ext) $ext = $this->meta['ext']; + + if($ext=='png') imagesavealpha($this->image, true); + $fn = 'image'.$ext; + $fn($this->image, $file); + + // If there is a new filename change the internal name too + if($file) $this->file = $file; + } + + /** + * Saves the image to the given path + * + * @param string $file Leave empty to replace the original file + * @return Image + */ + public function save($file = null){ + if(empty($this->image)) return $this; + + if(!$file) $file = $this->file; + + $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION)); + if(!$ext){ + $file .= '.'.$this->meta['ext']; + $ext = $this->meta['ext']; + } + + if($ext=='jpg') $ext = 'jpeg'; + + if(!in_array($ext, array('png', 'jpeg', 'gif'))) + return $this; + + $this->process($ext, $file); + + return $this; + } + + /** + * Outputs the manipulated image + * + * @return Image + */ + public function show(){ + if(empty($this->image)) return $this; + + header('Content-type: '.$this->meta['mime']); + $this->process(); + + return $this; + } + +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/MimeTypes.ini =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/MimeTypes.ini,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/MimeTypes.ini 3 Jan 2016 20:51:38 -0000 1.1.2.1 @@ -0,0 +1,202 @@ +; Mimetypes configuration file +; The types are sorted by the filetype + +[application] +ai = application/postscript +bcpio = application/x-bcpio +bin = application/octet-stream +ccad = application/clariscad +cdf = application/x-netcdf +class = application/octet-stream +cpio = application/x-cpio +cpt = application/mac-compactpro +csh = application/x-csh +dcr = application/x-director +dir = application/x-director +dms = application/octet-stream +doc = application/msword +drw = application/drafting +dvi = application/x-dvi +dwg = application/acad +dxf = application/dxf +dxr = application/x-director +eps = application/postscript +exe = application/octet-stream +ez = application/andrew-inset +gtar = application/x-gtar +gz = application/x-gzip +hdf = application/x-hdf +hqx = application/mac-binhex40 +ips = application/x-ipscript +ipx = application/x-ipix +iso = application/x-isoview; +js = application/x-javascript +latex = application/x-latex +lha = application/octet-stream +lnk = application/x-ms-shortcut +lsp = application/x-lisp +lzh = application/octet-stream +man = application/x-troff-man +me = application/x-troff-me +mif = application/vnd.mif +ms = application/x-troff-ms +nc = application/x-netcdf +oda = application/oda +odt = application/vnd.oasis.opendocument.text +ods = application/vnd.oasis.opendocument.spreadsheet +odp = application/vnd.oasis.opendocument.presentation +odg = application/vnd.oasis.opendocument.graphics +odc = application/vnd.oasis.opendocument.chart +odf = application/vnd.oasis.opendocument.formula +odb = application/vnd.oasis.opendocument.database +odi = application/vnd.oasis.opendocument.image +odm = application/vnd.oasis.opendocument.text-master +ott = application/vnd.oasis.opendocument.text-template +ots = application/vnd.oasis.opendocument.spreadsheet-template +otp = application/vnd.oasis.opendocument.presentation-template +otg = application/vnd.oasis.opendocument.graphics-template +pdf = application/pdf +pgn = application/x-chess-pgn +pot = application/mspowerpoint +pps = application/mspowerpoint +ppt = application/mspowerpoint +ppz = application/mspowerpoint +pre = application/x-freelance +prt = application/pro_eng +ps = application/postscript +rar = application/x-rar +roff = application/x-troff +scm = application/x-lotusscreencam +set = application/set +sh = application/x-sh +shar = application/x-shar +sit = application/x-stuffit +skd = application/x-koan +skm = application/x-koan +skp = application/x-koan +skt = application/x-koan +smi = application/smil +smil = application/smil +sol = application/solids +spl = application/x-futuresplash +src = application/x-wais-source +step = application/STEP +stl = application/SLA +stp = application/STEP +sv4cpio = application/x-sv4cpio +sv4crc = application/x-sv4crc +swf = application/x-shockwave-flash +t = application/x-troff +tar = application/x-tar +tcl = application/x-tcl +tex = application/x-tex +texi = application/x-texinfo +texinfo = application/x-texinfo +tr = application/x-troff +tsp = application/dsptype +unv = application/i-deas +ustar = application/x-ustar +vcd = application/x-cdlink +vda = application/vda +xlc = application/vnd.ms-excel +xll = application/vnd.ms-excel +xlm = application/vnd.ms-excel +xls = application/vnd.ms-excel +xlw = application/vnd.ms-excel +zip = application/zip + +[audio] +aif = audio/x-aiff +aifc = audio/x-aiff +aiff = audio/x-aiff +au = audio/basic +kar = audio/midi +mid = audio/midi +midi = audio/midi +mp2 = audio/mpeg +mp3 = audio/mpeg +mpga = audio/mpeg +ra = audio/x-realaudio +ram = audio/x-pn-realaudio +rm = audio/x-pn-realaudio +rpm = audio/x-pn-realaudio-plugin +snd = audio/basic +tsi = audio/TSP-audio +wav = audio/x-wav + +[text] +as = text/x-actionscript +asc = text/plain +c = text/plain +cc = text/plain +css = text/css +etx = text/x-setext +f = text/plain +f90 = text/plain +h = text/plain +hh = text/plain +htm = text/html +html = text/html +m = text/plain +rtf = text/rtf +rtx = text/richtext +sgm = text/sgml +sgml = text/sgml +tsv = text/tab-separated-values +tpl = text/template +txt = text/plain +xml = text/xml + +[video] +avi = video/x-msvideo +fli = video/x-fli +flv = video/x-flv +mov = video/quicktime +movie = video/x-sgi-movie +mpe = video/mpeg +mpeg = video/mpeg +mpg = video/mpeg +qt = video/quicktime +viv = video/vnd.vivo +vivo = video/vnd.vivo +wmv = video/x-ms-wmv + +[image] +bmp = image/bmp +gif = image/gif +ief = image/ief +jpe = image/jpeg +jpeg = image/jpeg +jpg = image/jpeg +pbm = image/x-portable-bitmap +pgm = image/x-portable-graymap +png = image/png +pnm = image/x-portable-anymap +ppm = image/x-portable-pixmap +psd = image/psd +ras = image/cmu-raster +rgb = image/x-rgb +tif = image/tiff +tiff = image/tiff +xbm = image/x-xbitmap +xpm = image/x-xpixmap +xwd = image/x-xwindowdump + +[x-conference] +ice = x-conference/x-cooltalk + +[model] +iges = model/iges +igs = model/iges +mesh = model/mesh +msh = model/mesh +silo = model/mesh +vrml = model/vrml +wrl = model/vrml + +[www] +mime = www/mime + +[chemical] +pdb = chemical/x-pdb +xyz = chemical/x-pdb \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Upload.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Upload.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Upload.php 3 Jan 2016 20:51:38 -0000 1.1.2.1 @@ -0,0 +1,124 @@ + + */ + +class Upload { + + /** + * Moves the uploaded file to the specified location. It throws a UploadException + * if anything goes wrong except for if the upload does not exist. This can be checked with {@link Upload::exists()} + * + * @param string $file + * @param string $to + * @param array $options + * @return bool|string Path to moved file or false if the specified upload does not exist + */ + public static function move($file, $to, $options = null){ + if(!self::exists($file)) return false; + + $options = array_merge(array( + 'name' => null, + 'extension' => null, + 'size' => null, + 'chmod' => 0777, + 'overwrite' => false, + 'mimes' => array(), + ), $options); + + $file = $_FILES[$file]; + + if($options['size'] && $file['size']>$options['size']) + throw new UploadException('size'); + + $pathinfo = pathinfo($file['name']); + if($options['extension']) $pathinfo['extension'] = $options['extension']; + if(!$pathinfo['extension']) + throw new UploadException('extension'); + + if(count($options['mimes'])){ + $mime = self::mime($file['tmp_name'], array( + 'default' => $file['type'], + 'extension' => $pathinfo['extension'], + )); + + if(!$mime || !in_array($mime, $options['mimes'])) + throw new UploadException('extension'); + } + + $file['ext'] = strtolower($pathinfo['extension']); + $file['base'] = basename($pathinfo['basename'], '.'.$pathinfo['extension']); + + $real = realpath($to); + if(!$real) throw new UploadException('path'); + if(is_dir($real)) $to = $real.'/'.($options['name'] ? $options['name'] : $file['base']).'.'.$file['ext']; + + if(!$options['overwrite'] && file_exists($to)) + throw new UploadException('exists'); + + if(!move_uploaded_file($file['tmp_name'], $to)) + throw new UploadException(strtolower($_FILES[$file]['error']<=2 ? 'size' : ($_FILES[$file]['error']==3 ? 'partial' : 'nofile'))); + + chmod($to, $options['chmod']); + + return realpath($to); + } + + /** + * Returns whether the Upload exists or not + * + * @param string $file + * @return bool + */ + public function exists($file){ + return !(empty($_FILES[$file]['name']) || empty($_FILES[$file]['size'])); + } + + /** + * Returns (if possible) the mimetype of the given file + * + * @param string $file + * @param array $options + */ + public function mime($file, $options = array()){ + $file = realpath($file); + $options = array_merge(array( + 'default' => null, + 'extension' => strtolower(pathinfo($file, PATHINFO_EXTENSION)), + ), $options); + $options['extension'] = strtolower($options['extension']); + $mime = null; + $ini = error_reporting(0); + if (function_exists('finfo_open') && $f = @finfo_open(FILEINFO_MIME, getenv('MAGIC'))){ + $mime = finfo_file($f, $file); + finfo_close($f); + } + error_reporting($ini); + + if(!$mime && in_array($options['extension'], array('gif', 'jpg', 'jpeg', 'png'))){ + $image = getimagesize($file); + if(!empty($image['mime'])) + $mime = $image['mime']; + } + + if(!$mime && $options['default']) $mime = $options['default']; + + if((!$mime || $mime=='application/octet-stream') && $options['extension']){ + static $mimes; + if(!$mimes) $mimes = parse_ini_file(pathinfo(__FILE__, PATHINFO_DIRNAME).'/MimeTypes.ini'); + + if(!empty($mimes[$options['extension']])) return $mimes[$options['extension']]; + } + + return $mime; + } + +} + +class UploadException extends Exception {} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/getid3.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/getid3.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/getid3.php 3 Jan 2016 20:51:38 -0000 1.1.2.1 @@ -0,0 +1,1598 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | getid3.php | +// | Main getID3() file. | +// | dependencies: modules. | +// +----------------------------------------------------------------------+ +// +// $Id: getid3.php,v 1.1.2.1 2016/01/03 20:51:38 gustafn Exp $ + + +class getid3 +{ + //// Settings Section - do NOT modify this file - change setting after newing getid3! + + // Encoding + public $encoding = 'ISO-8859-1'; // CASE SENSITIVE! - i.e. (must be supported by iconv() - see http://www.gnu.org/software/libiconv/). Examples: ISO-8859-1 UTF-8 UTF-16 UTF-16BE. + public $encoding_id3v1 = 'ISO-8859-1'; // Override SPECIFICATION encoding for broken ID3v1 tags caused by bad tag programs. Examples: 'EUC-CN' for "Chinese MP3s" and 'CP1251' for "Cyrillic". + public $encoding_id3v2 = 'ISO-8859-1'; // Override ISO-8859-1 encoding for broken ID3v2 tags caused by BRAINDEAD tag programs that writes system codepage as 'ISO-8859-1' instead of UTF-8. + + // Tags - disable for speed + public $option_tag_id3v1 = true; // Read and process ID3v1 tags. + public $option_tag_id3v2 = true; // Read and process ID3v2 tags. + public $option_tag_lyrics3 = true; // Read and process Lyrics3 tags. + public $option_tag_apetag = true; // Read and process APE tags. + + // Misc calucations - disable for speed + public $option_analyze = true; // Analyze file - disable if you only need to detect file format. + public $option_accurate_results = true; // Disable to greatly speed up parsing of some file formats at the cost of accuracy. + public $option_tags_process = true; // Copy tags to root key 'tags' and 'comments' and encode to $this->encoding. + public $option_tags_images = false; // Scan tags for binary image data - ID3v2 and vorbiscomments only. + public $option_extra_info = true; // Calculate/return additional info such as bitrate, channelmode etc. + public $option_max_2gb_check = false; // Check whether file is larger than 2 Gb and thus not supported by PHP. + + // Misc data hashes - slow - require hash module + public $option_md5_data = false; // Get MD5 sum of data part - slow. + public $option_md5_data_source = false; // Use MD5 of source file if available - only FLAC, MAC, OptimFROG and Wavpack4. + public $option_sha1_data = false; // Get SHA1 sum of data part - slow. + + // Public variables + public $filename; // Filename of file being analysed. + public $fp; // Filepointer to file being analysed. + public $info; // Result array. + + // Protected variables + protected $include_path; // getid3 include path. + protected $warnings = array (); + protected $iconv_present; + + // Class constants + const VERSION = '2.0.0b4'; + const FREAD_BUFFER_SIZE = 16384; // Read buffer size in bytes. + const ICONV_TEST_STRING = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~�������������������������������� �����������������������������������������������������������������������������������������������'; + + + + // Constructor - check PHP enviroment and load library. + public function __construct() { + + // Static varibles - no need to recalc every time we new getid3. + static $include_path; + static $iconv_present; + + + static $initialized; + if ($initialized) { + + // Import static variables + $this->include_path = $include_path; + $this->iconv_present = $iconv_present; + + // Run init checks only on first instance. + return; + } + + // Get include_path + $this->include_path = $include_path = dirname(__FILE__) . '/'; + + // Check for presence of iconv() and make sure it works (simpel test only). + if (function_exists('iconv') && @iconv('UTF-16LE', 'ISO-8859-1', @iconv('ISO-8859-1', 'UTF-16LE', getid3::ICONV_TEST_STRING)) == getid3::ICONV_TEST_STRING) { + $this->iconv_present = $iconv_present = true; + } + + // iconv() not present - load replacement module. + else { + $this->include_module('lib.iconv_replacement'); + $this->iconv_present = $iconv_present = false; + } + + + // Require magic_quotes_runtime off + if (get_magic_quotes_runtime()) { + throw new getid3_exception('magic_quotes_runtime must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_runtime(0) and set_magic_quotes_runtime(1).'); + } + + + // Check memory limit. + $memory_limit = ini_get('memory_limit'); + if (preg_match('/([0-9]+)M/i', $memory_limit, $matches)) { + // could be stored as "16M" rather than 16777216 for example + $memory_limit = $matches[1] * 1048576; + } + if ($memory_limit <= 0) { + // Should not happen. + } elseif ($memory_limit <= 4194304) { + $this->warning('[SERIOUS] PHP has less than 4 Mb available memory and will very likely run out. Increase memory_limit in php.ini.'); + } elseif ($memory_limit <= 12582912) { + $this->warning('PHP has less than 12 Mb available memory and might run out if all modules are loaded. Increase memory_limit in php.ini if needed.'); + } + + + // Check safe_mode off + if ((bool)ini_get('safe_mode')) { + $this->warning('Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbis disabled, ogg vorbis/flac tag writing disabled.'); + } + + $initialized = true; + } + + + + // Analyze file by name + public function Analyze($filename) { + + // Init and save values + $this->filename = $filename; + $this->warnings = array (); + + // Init result array and set parameters + $this->info = array (); + $this->info['GETID3_VERSION'] = getid3::VERSION; + + // Remote files not supported + if (preg_match('/^(ht|f)tp:\/\//', $filename)) { + throw new getid3_exception('Remote files are not supported - please copy the file locally first.'); + } + + // Open local file + if (!$this->fp = @fopen($filename, 'rb')) { + throw new getid3_exception('Could not open file "'.$filename.'"'); + } + + // Set filesize related parameters + $this->info['filesize'] = filesize($filename); + $this->info['avdataoffset'] = 0; + $this->info['avdataend'] = $this->info['filesize']; + + // Option_max_2gb_check + if ($this->option_max_2gb_check) { + // PHP doesn't support integers larger than 31-bit (~2GB) + // filesize() simply returns (filesize % (pow(2, 32)), no matter the actual filesize + // ftell() returns 0 if seeking to the end is beyond the range of unsigned integer + fseek($this->fp, 0, SEEK_END); + if ((($this->info['filesize'] != 0) && (ftell($this->fp) == 0)) || + ($this->info['filesize'] < 0) || + (ftell($this->fp) < 0)) { + unset($this->info['filesize']); + fclose($this->fp); + throw new getid3_exception('File is most likely larger than 2GB and is not supported by PHP.'); + } + } + + + // ID3v2 detection (NOT parsing) done to make fileformat easier. + if (!$this->option_tag_id3v2) { + + fseek($this->fp, 0, SEEK_SET); + $header = fread($this->fp, 10); + if (substr($header, 0, 3) == 'ID3' && strlen($header) == 10) { + $this->info['id3v2']['header'] = true; + $this->info['id3v2']['majorversion'] = ord($header{3}); + $this->info['id3v2']['minorversion'] = ord($header{4}); + $this->info['avdataoffset'] += getid3_lib::BigEndian2Int(substr($header, 6, 4), 1) + 10; // length of ID3v2 tag in 10-byte header doesn't include 10-byte header length + } + } + + + // Handle tags + foreach (array ("id3v2", "id3v1", "apetag", "lyrics3") as $tag_name) { + + $option_tag = 'option_tag_' . $tag_name; + if ($this->$option_tag) { + $this->include_module('tag.'.$tag_name); + try { + $tag_class = 'getid3_' . $tag_name; + $tag = new $tag_class($this); + $tag->Analyze(); + } + catch (getid3_exception $e) { + throw $e; + } + } + } + + + + //// Determine file format by magic bytes in file header. + + // Read 32 kb file data + fseek($this->fp, $this->info['avdataoffset'], SEEK_SET); + $filedata = fread($this->fp, 32774); + + // Get huge FileFormatArray + $file_format_array = getid3::GetFileFormatArray(); + + // Identify file format - loop through $format_info and detect with reg expr + foreach ($file_format_array as $name => $info) { + + if (preg_match('/'.$info['pattern'].'/s', $filedata)) { // The /s switch on preg_match() forces preg_match() NOT to treat newline (0x0A) characters as special chars but do a binary match + + // Format detected but not supported + if (!@$info['module'] || !@$info['group']) { + fclose($this->fp); + $this->info['fileformat'] = $name; + $this->info['mime_type'] = $info['mime_type']; + $this->warning('Format only detected. Parsing not available yet.'); + $this->info['warning'] = $this->warnings; + return $this->info; + } + + $determined_format = $info; // copy $info deleted by foreach() + continue; + } + } + + // Unable to determine file format + if (!@$determined_format) { + + // Too many mp3 encoders on the market put gabage in front of mpeg files + // use assume format on these if format detection failed + if (preg_match('/\.mp[123a]$/i', $filename)) { + $determined_format = $file_format_array['mp3']; + } + + else { + fclose($this->fp); + throw new getid3_exception('Unable to determine file format'); + } + } + + // Free memory + unset($file_format_array); + + // Check for illegal ID3 tags + if (@$determined_format['fail_id3'] && (@$this->info['id3v1'] || @$this->info['id3v2'])) { + if ($determined_format['fail_id3'] === 'ERROR') { + fclose($this->fp); + throw new getid3_exception('ID3 tags not allowed on this file type.'); + } + elseif ($determined_format['fail_id3'] === 'WARNING') { + @$this->info['id3v1'] and $this->warning('ID3v1 tags not allowed on this file type.'); + @$this->info['id3v2'] and $this->warning('ID3v2 tags not allowed on this file type.'); + } + } + + // Check for illegal APE tags + if (@$determined_format['fail_ape'] && @$this->info['tags']['ape']) { + if ($determined_format['fail_ape'] === 'ERROR') { + fclose($this->fp); + throw new getid3_exception('APE tags not allowed on this file type.'); + } elseif ($determined_format['fail_ape'] === 'WARNING') { + $this->warning('APE tags not allowed on this file type.'); + } + } + + + // Set mime type + $this->info['mime_type'] = $determined_format['mime_type']; + + // Calc module file name + $determined_format['include'] = 'module.'.$determined_format['group'].'.'.$determined_format['module'].'.php'; + + // Supported format signature pattern detected, but module deleted. + if (!file_exists($this->include_path.$determined_format['include'])) { + fclose($this->fp); + throw new getid3_exception('Format not supported, module, '.$determined_format['include'].', was removed.'); + } + + // Include module + $this->include_module($determined_format['group'].'.'.$determined_format['module']); + + // Instantiate module class and analyze + $class_name = 'getid3_'.$determined_format['module']; + if (!class_exists($class_name)) { + throw new getid3_exception('Format not supported, module, '.$determined_format['include'].', is corrupt.'); + } + $class = new $class_name($this); + + try { + $this->option_analyze and $class->Analyze(); + } + catch (getid3_exception $e) { + throw $e; + } + catch (Exception $e) { + throw new getid3_exception('Corrupt file.'); + } + + // Close file + fclose($this->fp); + + // Optional - Process all tags - copy to 'tags' and convert charsets + if ($this->option_tags_process) { + $this->HandleAllTags(); + } + + + //// Optional - perform more calculations + if ($this->option_extra_info) { + + // Set channelmode on audio + if (@$this->info['audio']['channels'] == '1') { + $this->info['audio']['channelmode'] = 'mono'; + } elseif (@$this->info['audio']['channels'] == '2') { + $this->info['audio']['channelmode'] = 'stereo'; + } + + // Calculate combined bitrate - audio + video + $combined_bitrate = 0; + $combined_bitrate += (isset($this->info['audio']['bitrate']) ? $this->info['audio']['bitrate'] : 0); + $combined_bitrate += (isset($this->info['video']['bitrate']) ? $this->info['video']['bitrate'] : 0); + if (($combined_bitrate > 0) && empty($this->info['bitrate'])) { + $this->info['bitrate'] = $combined_bitrate; + } + if (!isset($this->info['playtime_seconds']) && !empty($this->info['bitrate'])) { + $this->info['playtime_seconds'] = (($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->info['bitrate']; + } + + // Set playtime string + if (!empty($this->info['playtime_seconds']) && empty($this->info['playtime_string'])) { + $this->info['playtime_string'] = floor(round($this->info['playtime_seconds']) / 60) . ':' . str_pad(floor(round($this->info['playtime_seconds']) % 60), 2, 0, STR_PAD_LEFT);; + } + + + // CalculateCompressionRatioVideo() { + if (@$this->info['video'] && @$this->info['video']['resolution_x'] && @$this->info['video']['resolution_y'] && @$this->info['video']['bits_per_sample']) { + + // From static image formats + if (in_array($this->info['video']['dataformat'], array ('bmp', 'gif', 'jpeg', 'jpg', 'png', 'tiff'))) { + $frame_rate = 1; + $bitrate_compressed = $this->info['filesize'] * 8; + } + + // From video formats + else { + $frame_rate = @$this->info['video']['frame_rate']; + $bitrate_compressed = @$this->info['video']['bitrate']; + } + + if ($frame_rate && $bitrate_compressed) { + $this->info['video']['compression_ratio'] = $bitrate_compressed / ($this->info['video']['resolution_x'] * $this->info['video']['resolution_y'] * $this->info['video']['bits_per_sample'] * $frame_rate); + } + } + + + // CalculateCompressionRatioAudio() { + if (@$this->info['audio']['bitrate'] && @$this->info['audio']['channels'] && @$this->info['audio']['sample_rate']) { + $this->info['audio']['compression_ratio'] = $this->info['audio']['bitrate'] / ($this->info['audio']['channels'] * $this->info['audio']['sample_rate'] * (@$this->info['audio']['bits_per_sample'] ? $this->info['audio']['bits_per_sample'] : 16)); + } + + if (@$this->info['audio']['streams']) { + foreach ($this->info['audio']['streams'] as $stream_number => $stream_data) { + if (@$stream_data['bitrate'] && @$stream_data['channels'] && @$stream_data['sample_rate']) { + $this->info['audio']['streams'][$stream_number]['compression_ratio'] = $stream_data['bitrate'] / ($stream_data['channels'] * $stream_data['sample_rate'] * (@$stream_data['bits_per_sample'] ? $stream_data['bits_per_sample'] : 16)); + } + } + } + + + // CalculateReplayGain() { + if (@$this->info['replay_gain']) { + if (!@$this->info['replay_gain']['reference_volume']) { + $this->info['replay_gain']['reference_volume'] = 89; + } + if (isset($this->info['replay_gain']['track']['adjustment'])) { + $this->info['replay_gain']['track']['volume'] = $this->info['replay_gain']['reference_volume'] - $this->info['replay_gain']['track']['adjustment']; + } + if (isset($this->info['replay_gain']['album']['adjustment'])) { + $this->info['replay_gain']['album']['volume'] = $this->info['replay_gain']['reference_volume'] - $this->info['replay_gain']['album']['adjustment']; + } + + if (isset($this->info['replay_gain']['track']['peak'])) { + $this->info['replay_gain']['track']['max_noclip_gain'] = 0 - 20 * log10($this->info['replay_gain']['track']['peak']); + } + if (isset($this->info['replay_gain']['album']['peak'])) { + $this->info['replay_gain']['album']['max_noclip_gain'] = 0 - 20 * log10($this->info['replay_gain']['album']['peak']); + } + } + + + // ProcessAudioStreams() { + if (@!$this->info['audio']['streams'] && (@$this->info['audio']['bitrate'] || @$this->info['audio']['channels'] || @$this->info['audio']['sample_rate'])) { + foreach ($this->info['audio'] as $key => $value) { + if ($key != 'streams') { + $this->info['audio']['streams'][0][$key] = $value; + } + } + } + } + + + // Get the md5/sha1sum of the audio/video portion of the file - without ID3/APE/Lyrics3/etc header/footer tags. + if ($this->option_md5_data || $this->option_sha1_data) { + + // Load data-hash library if needed + $this->include_module('lib.data_hash'); + + if ($this->option_sha1_data) { + new getid3_lib_data_hash($this, 'sha1'); + } + + if ($this->option_md5_data) { + + // no md5_data_source or option disabled -- md5_data_source supported by FLAC, MAC, OptimFROG, Wavpack4 + if (!$this->option_md5_data_source || !@$this->info['md5_data_source']) { + new getid3_lib_data_hash($this, 'md5'); + } + + // copy md5_data_source to md5_data if option set to true + elseif ($this->option_md5_data_source && @$this->info['md5_data_source']) { + $this->info['md5_data'] = $this->info['md5_data_source']; + } + } + } + + // Set warnings + if ($this->warnings) { + $this->info['warning'] = $this->warnings; + } + + // Return result + return $this->info; + } + + + + // Return array of warnings + public function warnings() { + + return $this->warnings; + } + + + + // Add warning(s) to $this->warnings[] + public function warning($message) { + + if (is_array($message)) { + $this->warnings = array_merge($this->warnings, $message); + } + else { + $this->warnings[] = $message; + } + } + + + + // Clear all warnings when cloning + public function __clone() { + + $this->warnings = array (); + + // Copy info array, otherwise it will be a reference. + $temp = $this->info; + unset($this->info); + $this->info = $temp; + } + + + + // Convert string between charsets -- iconv() wrapper + public function iconv($in_charset, $out_charset, $string, $drop01 = false) { + + if ($drop01 && ($string === "\x00" || $string === "\x01")) { + return ''; + } + + + if (!$this->iconv_present) { + return getid3_iconv_replacement::iconv($in_charset, $out_charset, $string); + } + + + // iconv() present + if ($result = @iconv($in_charset, $out_charset.'//TRANSLIT', $string)) { + + if ($out_charset == 'ISO-8859-1') { + return rtrim($result, "\x00"); + } + return $result; + } + + $this->warning('iconv() was unable to convert the string: "' . $string . '" from ' . $in_charset . ' to ' . $out_charset); + return $string; + } + + + + public function include_module($name) { + + if (!file_exists($this->include_path.'module.'.$name.'.php')) { + throw new getid3_exception('Required module.'.$name.'.php is missing.'); + } + + include_once($this->include_path.'module.'.$name.'.php'); + } + + + + public function include_module_optional($name) { + + if (!file_exists($this->include_path.'module.'.$name.'.php')) { + return; + } + + include_once($this->include_path.'module.'.$name.'.php'); + return true; + } + + + // Return array containing information about all supported formats + public static function GetFileFormatArray() { + + static $format_info = array ( + + // Audio formats + + // AC-3 - audio - Dolby AC-3 / Dolby Digital + 'ac3' => array ( + 'pattern' => '^\x0B\x77', + 'group' => 'audio', + 'module' => 'ac3', + 'mime_type' => 'audio/ac3', + ), + + // AAC - audio - Advanced Audio Coding (AAC) - ADIF format + 'adif' => array ( + 'pattern' => '^ADIF', + 'group' => 'audio', + 'module' => 'aac_adif', + 'mime_type' => 'application/octet-stream', + 'fail_ape' => 'WARNING', + ), + + + // AAC - audio - Advanced Audio Coding (AAC) - ADTS format (very similar to MP3) + 'adts' => array ( + 'pattern' => '^\xFF[\xF0-\xF1\xF8-\xF9]', + 'group' => 'audio', + 'module' => 'aac_adts', + 'mime_type' => 'application/octet-stream', + 'fail_ape' => 'WARNING', + ), + + + // AU - audio - NeXT/Sun AUdio (AU) + 'au' => array ( + 'pattern' => '^\.snd', + 'group' => 'audio', + 'module' => 'au', + 'mime_type' => 'audio/basic', + ), + + // AVR - audio - Audio Visual Research + 'avr' => array ( + 'pattern' => '^2BIT', + 'group' => 'audio', + 'module' => 'avr', + 'mime_type' => 'application/octet-stream', + ), + + // BONK - audio - Bonk v0.9+ + 'bonk' => array ( + 'pattern' => '^\x00(BONK|INFO|META| ID3)', + 'group' => 'audio', + 'module' => 'bonk', + 'mime_type' => 'audio/xmms-bonk', + ), + + // DTS - audio - Dolby Theatre System + 'dts' => array( + 'pattern' => '^\x7F\xFE\x80\x01', + 'group' => 'audio', + 'module' => 'dts', + 'mime_type' => 'audio/dts', + ), + + // FLAC - audio - Free Lossless Audio Codec + 'flac' => array ( + 'pattern' => '^fLaC', + 'group' => 'audio', + 'module' => 'xiph', + 'mime_type' => 'audio/x-flac', + ), + + // LA - audio - Lossless Audio (LA) + 'la' => array ( + 'pattern' => '^LA0[2-4]', + 'group' => 'audio', + 'module' => 'la', + 'mime_type' => 'application/octet-stream', + ), + + // LPAC - audio - Lossless Predictive Audio Compression (LPAC) + 'lpac' => array ( + 'pattern' => '^LPAC', + 'group' => 'audio', + 'module' => 'lpac', + 'mime_type' => 'application/octet-stream', + ), + + // MIDI - audio - MIDI (Musical Instrument Digital Interface) + 'midi' => array ( + 'pattern' => '^MThd', + 'group' => 'audio', + 'module' => 'midi', + 'mime_type' => 'audio/midi', + ), + + // MAC - audio - Monkey's Audio Compressor + 'mac' => array ( + 'pattern' => '^MAC ', + 'group' => 'audio', + 'module' => 'monkey', + 'mime_type' => 'application/octet-stream', + ), + + // MOD - audio - MODule (assorted sub-formats) + 'mod' => array ( + 'pattern' => '^.{1080}(M.K.|[5-9]CHN|[1-3][0-9]CH)', + 'mime_type' => 'audio/mod', + ), + + // MOD - audio - MODule (Impulse Tracker) + 'it' => array ( + 'pattern' => '^IMPM', + 'mime_type' => 'audio/it', + ), + + // MOD - audio - MODule (eXtended Module, various sub-formats) + 'xm' => array ( + 'pattern' => '^Extended Module', + 'mime_type' => 'audio/xm', + ), + + // MOD - audio - MODule (ScreamTracker) + 's3m' => array ( + 'pattern' => '^.{44}SCRM', + 'mime_type' => 'audio/s3m', + ), + + // MPC - audio - Musepack / MPEGplus SV7+ + 'mpc' => array ( + 'pattern' => '^(MP\+)', + 'group' => 'audio', + 'module' => 'mpc', + 'mime_type' => 'audio/x-musepack', + ), + + // MPC - audio - Musepack / MPEGplus SV4-6 + 'mpc_old' => array ( + 'pattern' => '^([\x00\x01\x10\x11\x40\x41\x50\x51\x80\x81\x90\x91\xC0\xC1\xD0\xD1][\x20-37][\x00\x20\x40\x60\x80\xA0\xC0\xE0])', + 'group' => 'audio', + 'module' => 'mpc_old', + 'mime_type' => 'application/octet-stream', + ), + + + // MP3 - audio - MPEG-audio Layer 3 (very similar to AAC-ADTS) + 'mp3' => array ( + 'pattern' => '^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]', + 'group' => 'audio', + 'module' => 'mp3', + 'mime_type' => 'audio/mpeg', + ), + + // OFR - audio - OptimFROG + 'ofr' => array ( + 'pattern' => '^(\*RIFF|OFR)', + 'group' => 'audio', + 'module' => 'optimfrog', + 'mime_type' => 'application/octet-stream', + ), + + // RKAU - audio - RKive AUdio compressor + 'rkau' => array ( + 'pattern' => '^RKA', + 'group' => 'audio', + 'module' => 'rkau', + 'mime_type' => 'application/octet-stream', + ), + + // SHN - audio - Shorten + 'shn' => array ( + 'pattern' => '^ajkg', + 'group' => 'audio', + 'module' => 'shorten', + 'mime_type' => 'audio/xmms-shn', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // TTA - audio - TTA Lossless Audio Compressor (http://tta.corecodec.org) + 'tta' => array ( + 'pattern' => '^TTA', // could also be '^TTA(\x01|\x02|\x03|2|1)' + 'group' => 'audio', + 'module' => 'tta', + 'mime_type' => 'application/octet-stream', + ), + + // VOC - audio - Creative Voice (VOC) + 'voc' => array ( + 'pattern' => '^Creative Voice File', + 'group' => 'audio', + 'module' => 'voc', + 'mime_type' => 'audio/voc', + ), + + // VQF - audio - transform-domain weighted interleave Vector Quantization Format (VQF) + 'vqf' => array ( + 'pattern' => '^TWIN', + 'group' => 'audio', + 'module' => 'vqf', + 'mime_type' => 'application/octet-stream', + ), + + // WV - audio - WavPack (v4.0+) + 'vw' => array( + 'pattern' => '^wvpk', + 'group' => 'audio', + 'module' => 'wavpack', + 'mime_type' => 'application/octet-stream', + ), + + + // Audio-Video formats + + // ASF - audio/video - Advanced Streaming Format, Windows Media Video, Windows Media Audio + 'asf' => array ( + 'pattern' => '^\x30\x26\xB2\x75\x8E\x66\xCF\x11\xA6\xD9\x00\xAA\x00\x62\xCE\x6C', + 'group' => 'audio-video', + 'module' => 'asf', + 'mime_type' => 'video/x-ms-asf', + ), + + // BINK - audio/video - Bink / Smacker + 'bink' => array( + 'pattern' => '^(BIK|SMK)', + 'mime_type' => 'application/octet-stream', + ), + + // FLV - audio/video - FLash Video + 'flv' => array( + 'pattern' => '^FLV\x01', + 'group' => 'audio-video', + 'module' => 'flv', + 'mime_type' => 'video/x-flv', + ), + + // MKAV - audio/video - Mastroka + 'matroska' => array ( + 'pattern' => '^\x1A\x45\xDF\xA3', + 'mime_type' => 'application/octet-stream', + ), + + // MPEG - audio/video - MPEG (Moving Pictures Experts Group) + 'mpeg' => array ( + 'pattern' => '^\x00\x00\x01(\xBA|\xB3)', + 'group' => 'audio-video', + 'module' => 'mpeg', + 'mime_type' => 'video/mpeg', + ), + + // NSV - audio/video - Nullsoft Streaming Video (NSV) + 'nsv' => array ( + 'pattern' => '^NSV[sf]', + 'group' => 'audio-video', + 'module' => 'nsv', + 'mime_type' => 'application/octet-stream', + ), + + // Ogg - audio/video - Ogg (Ogg Vorbis, OggFLAC, Speex, Ogg Theora(*), Ogg Tarkin(*)) + 'ogg' => array ( + 'pattern' => '^OggS', + 'group' => 'audio', + 'module' => 'xiph', + 'mime_type' => 'application/ogg', + 'fail_id3' => 'WARNING', + 'fail_ape' => 'WARNING', + ), + + // QT - audio/video - Quicktime + 'quicktime' => array ( + 'pattern' => '^.{4}(cmov|free|ftyp|mdat|moov|pnot|skip|wide)', + 'group' => 'audio-video', + 'module' => 'quicktime', + 'mime_type' => 'video/quicktime', + ), + + // RIFF - audio/video - Resource Interchange File Format (RIFF) / WAV / AVI / CD-audio / SDSS = renamed variant used by SmartSound QuickTracks (www.smartsound.com) / FORM = Audio Interchange File Format (AIFF) + 'riff' => array ( + 'pattern' => '^(RIFF|SDSS|FORM)', + 'group' => 'audio-video', + 'module' => 'riff', + 'mime_type' => 'audio/x-wave', + 'fail_ape' => 'WARNING', + ), + + // Real - audio/video - RealAudio, RealVideo + 'real' => array ( + 'pattern' => '^(\.RMF|.ra)', + 'group' => 'audio-video', + 'module' => 'real', + 'mime_type' => 'audio/x-realaudio', + ), + + // SWF - audio/video - ShockWave Flash + 'swf' => array ( + 'pattern' => '^(F|C)WS', + 'group' => 'audio-video', + 'module' => 'swf', + 'mime_type' => 'application/x-shockwave-flash', + ), + + + // Still-Image formats + + // BMP - still image - Bitmap (Windows, OS/2; uncompressed, RLE8, RLE4) + 'bmp' => array ( + 'pattern' => '^BM', + 'group' => 'graphic', + 'module' => 'bmp', + 'mime_type' => 'image/bmp', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // GIF - still image - Graphics Interchange Format + 'gif' => array ( + 'pattern' => '^GIF', + 'group' => 'graphic', + 'module' => 'gif', + 'mime_type' => 'image/gif', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // JPEG - still image - Joint Photographic Experts Group (JPEG) + 'jpeg' => array ( + 'pattern' => '^\xFF\xD8\xFF', + 'group' => 'graphic', + 'module' => 'jpeg', + 'mime_type' => 'image/jpeg', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // PCD - still image - Kodak Photo CD + 'pcd' => array ( + 'pattern' => '^.{2048}PCD_IPI\x00', + 'group' => 'graphic', + 'module' => 'pcd', + 'mime_type' => 'image/x-photo-cd', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // PNG - still image - Portable Network Graphics (PNG) + 'png' => array ( + 'pattern' => '^\x89\x50\x4E\x47\x0D\x0A\x1A\x0A', + 'group' => 'graphic', + 'module' => 'png', + 'mime_type' => 'image/png', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // SVG - still image - Scalable Vector Graphics (SVG) + 'svg' => array( + 'pattern' => ' 'image/svg+xml', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // TIFF - still image - Tagged Information File Format (TIFF) + 'tiff' => array ( + 'pattern' => '^(II\x2A\x00|MM\x00\x2A)', + 'group' => 'graphic', + 'module' => 'tiff', + 'mime_type' => 'image/tiff', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // Data formats + + 'exe' => array( + 'pattern' => '^MZ', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // ISO - data - International Standards Organization (ISO) CD-ROM Image + 'iso' => array ( + 'pattern' => '^.{32769}CD001', + 'group' => 'misc', + 'module' => 'iso', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // RAR - data - RAR compressed data + 'rar' => array( + 'pattern' => '^Rar\!', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // SZIP - audio - SZIP compressed data + 'szip' => array ( + 'pattern' => '^SZ\x0A\x04', + 'group' => 'archive', + 'module' => 'szip', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // TAR - data - TAR compressed data + 'tar' => array( + 'pattern' => '^.{100}[0-9\x20]{7}\x00[0-9\x20]{7}\x00[0-9\x20]{7}\x00[0-9\x20\x00]{12}[0-9\x20\x00]{12}', + 'group' => 'archive', + 'module' => 'tar', + 'mime_type' => 'application/x-tar', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // GZIP - data - GZIP compressed data + 'gz' => array( + 'pattern' => '^\x1F\x8B\x08', + 'group' => 'archive', + 'module' => 'gzip', + 'mime_type' => 'application/x-gzip', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // ZIP - data - ZIP compressed data + 'zip' => array ( + 'pattern' => '^PK\x03\x04', + 'group' => 'archive', + 'module' => 'zip', + 'mime_type' => 'application/zip', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // PAR2 - data - Parity Volume Set Specification 2.0 + 'par2' => array ( + 'pattern' => '^PAR2\x00PKT', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // PDF - data - Portable Document Format + 'pdf' => array( + 'pattern' => '^\x25PDF', + 'mime_type' => 'application/pdf', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // DOC - data - Microsoft Word + 'msoffice' => array( + 'pattern' => '^\xD0\xCF\x11\xE0', // D0CF11E == DOCFILE == Microsoft Office Document + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + ); + + return $format_info; + } + + + + // Recursive over array - converts array to $encoding charset from $this->encoding + function CharConvert(&$array, $encoding) { + + // Identical encoding - end here + if ($encoding == $this->encoding) { + return; + } + + // Loop thru array + foreach ($array as $key => $value) { + + // Go recursive + if (is_array($value)) { + $this->CharConvert($array[$key], $encoding); + } + + // Convert string + elseif (is_string($value)) { + $array[$key] = $this->iconv($encoding, $this->encoding, $value); + } + } + } + + + + // Convert and copy tags + protected function HandleAllTags() { + + // Key name => array (tag name, character encoding) + static $tags = array ( + 'asf' => array ('asf', 'UTF-16LE'), + 'midi' => array ('midi', 'ISO-8859-1'), + 'nsv' => array ('nsv', 'ISO-8859-1'), + 'ogg' => array ('vorbiscomment', 'UTF-8'), + 'png' => array ('png', 'UTF-8'), + 'tiff' => array ('tiff', 'ISO-8859-1'), + 'quicktime' => array ('quicktime', 'ISO-8859-1'), + 'real' => array ('real', 'ISO-8859-1'), + 'vqf' => array ('vqf', 'ISO-8859-1'), + 'zip' => array ('zip', 'ISO-8859-1'), + 'riff' => array ('riff', 'ISO-8859-1'), + 'lyrics3' => array ('lyrics3', 'ISO-8859-1'), + 'id3v1' => array ('id3v1', ''), // change below - cannot assign variable to static array + 'id3v2' => array ('id3v2', 'UTF-8'), // module converts all frames to UTF-8 + 'ape' => array ('ape', 'UTF-8') + ); + $tags['id3v1'][1] = $this->encoding_id3v1; + + // Loop thru tags array + foreach ($tags as $comment_name => $tag_name_encoding_array) { + list($tag_name, $encoding) = $tag_name_encoding_array; + + // Fill in default encoding type if not already present + @$this->info[$comment_name] and $this->info[$comment_name]['encoding'] = $encoding; + + // Copy comments if key name set + if (@$this->info[$comment_name]['comments']) { + + foreach ($this->info[$comment_name]['comments'] as $tag_key => $value_array) { + foreach ($value_array as $key => $value) { + if (strlen(trim($value)) > 0) { + $this->info['tags'][$tag_name][trim($tag_key)][] = $value; // do not trim!! Unicode characters will get mangled if trailing nulls are removed! + } + } + + } + + if (!@$this->info['tags'][$tag_name]) { + // comments are set but contain nothing but empty strings, so skip + continue; + } + + $this->CharConvert($this->info['tags'][$tag_name], $encoding); + } + } + + + // Merge comments from ['tags'] into common ['comments'] + if (@$this->info['tags']) { + + foreach ($this->info['tags'] as $tag_type => $tag_array) { + + foreach ($tag_array as $tag_name => $tagdata) { + + foreach ($tagdata as $key => $value) { + + if (!empty($value)) { + + if (empty($this->info['comments'][$tag_name])) { + + // fall through and append value + } + elseif ($tag_type == 'id3v1') { + + $new_value_length = strlen(trim($value)); + foreach ($this->info['comments'][$tag_name] as $existing_key => $existing_value) { + $old_value_length = strlen(trim($existing_value)); + if (($new_value_length <= $old_value_length) && (substr($existing_value, 0, $new_value_length) == trim($value))) { + // new value is identical but shorter-than (or equal-length to) one already in comments - skip + break 2; + } + } + } + else { + + $new_value_length = strlen(trim($value)); + foreach ($this->info['comments'][$tag_name] as $existing_key => $existing_value) { + $old_value_length = strlen(trim($existing_value)); + if (($new_value_length > $old_value_length) && (substr(trim($value), 0, strlen($existing_value)) == $existing_value)) { + $this->info['comments'][$tag_name][$existing_key] = trim($value); + break 2; + } + } + } + + if (empty($this->info['comments'][$tag_name]) || !in_array(trim($value), $this->info['comments'][$tag_name])) { + $this->info['comments'][$tag_name][] = trim($value); + } + } + } + } + } + } + + return true; + } +} + + +abstract class getid3_handler +{ + + protected $getid3; // pointer + + protected $data_string_flag = false; // analyzing filepointer or string + protected $data_string; // string to analyze + protected $data_string_position = 0; // seek position in string + + + public function __construct(getID3 $getid3) { + + $this->getid3 = $getid3; + } + + + // Analyze from file pointer + abstract public function Analyze(); + + + + // Analyze from string instead + public function AnalyzeString(&$string) { + + // Enter string mode + $this->data_string_flag = true; + $this->data_string = $string; + + // Save info + $saved_avdataoffset = $this->getid3->info['avdataoffset']; + $saved_avdataend = $this->getid3->info['avdataend']; + $saved_filesize = $this->getid3->info['filesize']; + + // Reset some info + $this->getid3->info['avdataoffset'] = 0; + $this->getid3->info['avdataend'] = $this->getid3->info['filesize'] = strlen($string); + + // Analyze + $this->Analyze(); + + // Restore some info + $this->getid3->info['avdataoffset'] = $saved_avdataoffset; + $this->getid3->info['avdataend'] = $saved_avdataend; + $this->getid3->info['filesize'] = $saved_filesize; + + // Exit string mode + $this->data_string_flag = false; + } + + + protected function ftell() { + + if ($this->data_string_flag) { + return $this->data_string_position; + } + return ftell($this->getid3->fp); + } + + + protected function fread($bytes) { + + if ($this->data_string_flag) { + $this->data_string_position += $bytes; + return substr($this->data_string, $this->data_string_position - $bytes, $bytes); + } + return fread($this->getid3->fp, $bytes); + } + + + protected function fseek($bytes, $whence = SEEK_SET) { + + if ($this->data_string_flag) { + switch ($whence) { + case SEEK_SET: + $this->data_string_position = $bytes; + return; + + case SEEK_CUR: + $this->data_string_position += $bytes; + return; + + case SEEK_END: + $this->data_string_position = strlen($this->data_string) + $bytes; + return; + } + } + return fseek($this->getid3->fp, $bytes, $whence); + } + +} + + + + +abstract class getid3_handler_write +{ + protected $filename; + protected $user_abort; + + private $fp_lock; + private $owner; + private $group; + private $perms; + + + public function __construct($filename) { + + if (!file_exists($filename)) { + throw new getid3_exception('File does not exist: "' . $filename . '"'); + } + + if (!is_writeable($filename)) { + throw new getid3_exception('File is not writeable: "' . $filename . '"'); + } + + if (!is_writeable(dirname($filename))) { + throw new getid3_exception('Directory is not writeable: ' . dirname($filename) . ' (need to write lock file).'); + } + + $this->user_abort = ignore_user_abort(true); + + $this->fp_lock = fopen($filename . '.getid3.lock', 'w'); + flock($this->fp_lock, LOCK_EX); + + $this->filename = $filename; + } + + + public function __destruct() { + + flock($this->fp_lock, LOCK_UN); + fclose($this->fp_lock); + unlink($this->filename . '.getid3.lock'); + + ignore_user_abort($this->user_abort); + } + + + protected function save_permissions() { + + $this->owner = fileowner($this->filename); + $this->group = filegroup($this->filename); + $this->perms = fileperms($this->filename); + } + + + protected function restore_permissions() { + + @chown($this->filename, $this->owner); + @chgrp($this->filename, $this->group); + @chmod($this->filename, $this->perms); + } + + + abstract public function read(); + + abstract public function write(); + + abstract public function remove(); + +} + + + + +class getid3_exception extends Exception +{ + public $message; + +} + + + + +class getid3_lib +{ + + // Convert Little Endian byte string to int - max 32 bits + public static function LittleEndian2Int($byte_word, $signed = false) { + + return getid3_lib::BigEndian2Int(strrev($byte_word), $signed); + } + + + + // Convert number to Little Endian byte string + public static function LittleEndian2String($number, $minbytes=1, $synchsafe=false) { + $intstring = ''; + while ($number > 0) { + if ($synchsafe) { + $intstring = $intstring.chr($number & 127); + $number >>= 7; + } else { + $intstring = $intstring.chr($number & 255); + $number >>= 8; + } + } + return str_pad($intstring, $minbytes, "\x00", STR_PAD_RIGHT); + } + + + + // Convert Big Endian byte string to int - max 32 bits + public static function BigEndian2Int($byte_word, $signed = false) { + + $int_value = 0; + $byte_wordlen = strlen($byte_word); + + for ($i = 0; $i < $byte_wordlen; $i++) { + $int_value += ord($byte_word{$i}) * pow(256, ($byte_wordlen - 1 - $i)); + } + + if ($signed) { + $sign_mask_bit = 0x80 << (8 * ($byte_wordlen - 1)); + if ($int_value & $sign_mask_bit) { + $int_value = 0 - ($int_value & ($sign_mask_bit - 1)); + } + } + + return $int_value; + } + + + + // Convert Big Endian byte sybc safe string to int - max 32 bits + public static function BigEndianSyncSafe2Int($byte_word) { + + $int_value = 0; + $byte_wordlen = strlen($byte_word); + + // disregard MSB, effectively 7-bit bytes + for ($i = 0; $i < $byte_wordlen; $i++) { + $int_value = $int_value | (ord($byte_word{$i}) & 0x7F) << (($byte_wordlen - 1 - $i) * 7); + } + return $int_value; + } + + + + // Convert Big Endian byte string to bit string + public static function BigEndian2Bin($byte_word) { + + $bin_value = ''; + $byte_wordlen = strlen($byte_word); + for ($i = 0; $i < $byte_wordlen; $i++) { + $bin_value .= str_pad(decbin(ord($byte_word{$i})), 8, '0', STR_PAD_LEFT); + } + return $bin_value; + } + + + + public static function BigEndian2Float($byte_word) { + + // ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic + // http://www.psc.edu/general/software/packages/ieee/ieee.html + // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html + + $bit_word = getid3_lib::BigEndian2Bin($byte_word); + if (!$bit_word) { + return 0; + } + $sign_bit = $bit_word{0}; + + switch (strlen($byte_word) * 8) { + case 32: + $exponent_bits = 8; + $fraction_bits = 23; + break; + + case 64: + $exponent_bits = 11; + $fraction_bits = 52; + break; + + case 80: + // 80-bit Apple SANE format + // http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/ + $exponent_string = substr($bit_word, 1, 15); + $is_normalized = intval($bit_word{16}); + $fraction_string = substr($bit_word, 17, 63); + $exponent = pow(2, getid3_lib::Bin2Dec($exponent_string) - 16383); + $fraction = $is_normalized + getid3_lib::DecimalBinary2Float($fraction_string); + $float_value = $exponent * $fraction; + if ($sign_bit == '1') { + $float_value *= -1; + } + return $float_value; + break; + + default: + return false; + break; + } + $exponent_string = substr($bit_word, 1, $exponent_bits); + $fraction_string = substr($bit_word, $exponent_bits + 1, $fraction_bits); + $exponent = bindec($exponent_string); + $fraction = bindec($fraction_string); + + if (($exponent == (pow(2, $exponent_bits) - 1)) && ($fraction != 0)) { + // Not a Number + $float_value = false; + } elseif (($exponent == (pow(2, $exponent_bits) - 1)) && ($fraction == 0)) { + if ($sign_bit == '1') { + $float_value = '-infinity'; + } else { + $float_value = '+infinity'; + } + } elseif (($exponent == 0) && ($fraction == 0)) { + if ($sign_bit == '1') { + $float_value = -0; + } else { + $float_value = 0; + } + $float_value = ($sign_bit ? 0 : -0); + } elseif (($exponent == 0) && ($fraction != 0)) { + // These are 'unnormalized' values + $float_value = pow(2, (-1 * (pow(2, $exponent_bits - 1) - 2))) * getid3_lib::DecimalBinary2Float($fraction_string); + if ($sign_bit == '1') { + $float_value *= -1; + } + } elseif ($exponent != 0) { + $float_value = pow(2, ($exponent - (pow(2, $exponent_bits - 1) - 1))) * (1 + getid3_lib::DecimalBinary2Float($fraction_string)); + if ($sign_bit == '1') { + $float_value *= -1; + } + } + return (float) $float_value; + } + + + + public static function LittleEndian2Float($byte_word) { + + return getid3_lib::BigEndian2Float(strrev($byte_word)); + } + + + + public static function DecimalBinary2Float($binary_numerator) { + $numerator = bindec($binary_numerator); + $denominator = bindec('1'.str_repeat('0', strlen($binary_numerator))); + return ($numerator / $denominator); + } + + + public static function PrintHexBytes($string, $hex=true, $spaces=true, $html_safe=true) { + + $return_string = ''; + for ($i = 0; $i < strlen($string); $i++) { + if ($hex) { + $return_string .= str_pad(dechex(ord($string{$i})), 2, '0', STR_PAD_LEFT); + } else { + $return_string .= ' '.(preg_match("/[\x20-\x7E]/", $string{$i}) ? $string{$i} : '�'); + } + if ($spaces) { + $return_string .= ' '; + } + } + if ($html_safe) { + $return_string = htmlentities($return_string); + } + return $return_string; + } + + + + // Process header data string - read several values with algorithm and add to target + // algorithm is one one the getid3_lib::Something2Something() function names + // parts_array is index => length - $target[index] = algorithm(substring(data)) + // - OR just substring(data) if length is negative! + // indexes == 'IGNORE**' are ignored + + public static function ReadSequence($algorithm, &$target, &$data, $offset, $parts_array) { + + // Loop thru $parts_array + foreach ($parts_array as $target_string => $length) { + + // Add to target + if (!strstr($target_string, 'IGNORE')) { + + // substr(....length) + if ($length < 0) { + $target[$target_string] = substr($data, $offset, -$length); + } + + // algorithm(substr(...length)) + else { + $target[$target_string] = getid3_lib::$algorithm(substr($data, $offset, $length)); + } + } + + // Move pointer + $offset += abs($length); + } + } + +} + + + +class getid3_lib_replaygain +{ + + public static function NameLookup($name_code) { + + static $lookup = array ( + 0 => 'not set', + 1 => 'Track Gain Adjustment', + 2 => 'Album Gain Adjustment' + ); + + return @$lookup[$name_code]; + } + + + + public static function OriginatorLookup($originator_code) { + + static $lookup = array ( + 0 => 'unspecified', + 1 => 'pre-set by artist/producer/mastering engineer', + 2 => 'set by user', + 3 => 'determined automatically' + ); + + return @$lookup[$originator_code]; + } + + + + public static function AdjustmentLookup($raw_adjustment, $sign_bit) { + + return (float)$raw_adjustment / 10 * ($sign_bit == 1 ? -1 : 1); + } + + + + public static function GainString($name_code, $originator_code, $replaygain) { + + $sign_bit = $replaygain < 0 ? 1 : 0; + + $stored_replaygain = intval(round($replaygain * 10)); + $gain_string = str_pad(decbin($name_code), 3, '0', STR_PAD_LEFT); + $gain_string .= str_pad(decbin($originator_code), 3, '0', STR_PAD_LEFT); + $gain_string .= $sign_bit; + $gain_string .= str_pad(decbin($stored_replaygain), 9, '0', STR_PAD_LEFT); + + return $gain_string; + } + +} + + + + +?> Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.archive.gzip.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.archive.gzip.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.archive.gzip.php 3 Jan 2016 20:51:38 -0000 1.1.2.1 @@ -0,0 +1,296 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.archive.gzip.php | +// | module for analyzing GZIP files | +// | dependencies: PHP compiled with zlib support (optional) | +// +----------------------------------------------------------------------+ +// | Module originally written by Mike Mozolin | +// +----------------------------------------------------------------------+ +// +// $Id: module.archive.gzip.php,v 1.1.2.1 2016/01/03 20:51:38 gustafn Exp $ + + + +class getid3_gzip extends getid3_handler +{ + + // public: Optional file list - disable for speed. + public $option_gzip_parse_contents = true; // decode gzipped files, if possible, and parse recursively (.tar.gz for example) + + + // Reads the gzip-file + function Analyze() { + + $info = &$this->getid3->info; + + $info['fileformat'] = 'gzip'; + + $start_length = 10; + $unpack_header = 'a1id1/a1id2/a1cmethod/a1flags/a4mtime/a1xflags/a1os'; + + //+---+---+---+---+---+---+---+---+---+---+ + //|ID1|ID2|CM |FLG| MTIME |XFL|OS | + //+---+---+---+---+---+---+---+---+---+---+ + + @fseek($this->getid3->fp, 0); + $buffer = @fread($this->getid3->fp, $info['filesize']); + + $arr_members = explode("\x1F\x8B\x08", $buffer); + + while (true) { + $is_wrong_members = false; + $num_members = intval(count($arr_members)); + for ($i = 0; $i < $num_members; $i++) { + if (strlen($arr_members[$i]) == 0) { + continue; + } + $buf = "\x1F\x8B\x08".$arr_members[$i]; + + $attr = unpack($unpack_header, substr($buf, 0, $start_length)); + if (!$this->get_os_type(ord($attr['os']))) { + + // Merge member with previous if wrong OS type + $arr_members[$i - 1] .= $buf; + $arr_members[$i] = ''; + $is_wrong_members = true; + continue; + } + } + if (!$is_wrong_members) { + break; + } + } + + $fpointer = 0; + $idx = 0; + for ($i = 0; $i < $num_members; $i++) { + if (strlen($arr_members[$i]) == 0) { + continue; + } + $info_gzip_member_header_idx = &$info['gzip']['member_header'][++$idx]; + + $buff = "\x1F\x8B\x08".$arr_members[$i]; + + $attr = unpack($unpack_header, substr($buff, 0, $start_length)); + $info_gzip_member_header_idx['filemtime'] = getid3_lib::LittleEndian2Int($attr['mtime']); + $info_gzip_member_header_idx['raw']['id1'] = ord($attr['cmethod']); + $info_gzip_member_header_idx['raw']['id2'] = ord($attr['cmethod']); + $info_gzip_member_header_idx['raw']['cmethod'] = ord($attr['cmethod']); + $info_gzip_member_header_idx['raw']['os'] = ord($attr['os']); + $info_gzip_member_header_idx['raw']['xflags'] = ord($attr['xflags']); + $info_gzip_member_header_idx['raw']['flags'] = ord($attr['flags']); + + $info_gzip_member_header_idx['flags']['crc16'] = (bool) ($info_gzip_member_header_idx['raw']['flags'] & 0x02); + $info_gzip_member_header_idx['flags']['extra'] = (bool) ($info_gzip_member_header_idx['raw']['flags'] & 0x04); + $info_gzip_member_header_idx['flags']['filename'] = (bool) ($info_gzip_member_header_idx['raw']['flags'] & 0x08); + $info_gzip_member_header_idx['flags']['comment'] = (bool) ($info_gzip_member_header_idx['raw']['flags'] & 0x10); + + $info_gzip_member_header_idx['compression'] = $this->get_xflag_type($info_gzip_member_header_idx['raw']['xflags']); + + $info_gzip_member_header_idx['os'] = $this->get_os_type($info_gzip_member_header_idx['raw']['os']); + if (!$info_gzip_member_header_idx['os']) { + $info['error'][] = 'Read error on gzip file'; + return false; + } + + $fpointer = 10; + $arr_xsubfield = array (); + + // bit 2 - FLG.FEXTRA + //+---+---+=================================+ + //| XLEN |...XLEN bytes of "extra field"...| + //+---+---+=================================+ + + if ($info_gzip_member_header_idx['flags']['extra']) { + $w_xlen = substr($buff, $fpointer, 2); + $xlen = getid3_lib::LittleEndian2Int($w_xlen); + $fpointer += 2; + + $info_gzip_member_header_idx['raw']['xfield'] = substr($buff, $fpointer, $xlen); + + // Extra SubFields + //+---+---+---+---+==================================+ + //|SI1|SI2| LEN |... LEN bytes of subfield data ...| + //+---+---+---+---+==================================+ + + $idx = 0; + while (true) { + if ($idx >= $xlen) { + break; + } + $si1 = ord(substr($buff, $fpointer + $idx++, 1)); + $si2 = ord(substr($buff, $fpointer + $idx++, 1)); + if (($si1 == 0x41) && ($si2 == 0x70)) { + $w_xsublen = substr($buff, $fpointer+$idx, 2); + $xsublen = getid3_lib::LittleEndian2Int($w_xsublen); + $idx += 2; + $arr_xsubfield[] = substr($buff, $fpointer+$idx, $xsublen); + $idx += $xsublen; + } else { + break; + } + } + $fpointer += $xlen; + } + + // bit 3 - FLG.FNAME + //+=========================================+ + //|...original file name, zero-terminated...| + //+=========================================+ + // GZIP files may have only one file, with no filename, so assume original filename is current filename without .gz + + $info_gzip_member_header_idx['filename'] = eregi_replace('.gz$', '', @$info['filename']); + if ($info_gzip_member_header_idx['flags']['filename']) { + while (true) { + if (ord($buff[$fpointer]) == 0) { + $fpointer++; + break; + } + $info_gzip_member_header_idx['filename'] .= $buff[$fpointer]; + $fpointer++; + } + } + + // bit 4 - FLG.FCOMMENT + //+===================================+ + //|...file comment, zero-terminated...| + //+===================================+ + + if ($info_gzip_member_header_idx['flags']['comment']) { + while (true) { + if (ord($buff[$fpointer]) == 0) { + $fpointer++; + break; + } + $info_gzip_member_header_idx['comment'] .= $buff[$fpointer]; + $fpointer++; + } + } + + // bit 1 - FLG.FHCRC + //+---+---+ + //| CRC16 | + //+---+---+ + + if ($info_gzip_member_header_idx['flags']['crc16']) { + $w_crc = substr($buff, $fpointer, 2); + $info_gzip_member_header_idx['crc16'] = getid3_lib::LittleEndian2Int($w_crc); + $fpointer += 2; + } + + // bit 0 - FLG.FTEXT + //if ($info_gzip_member_header_idx['raw']['flags'] & 0x01) { + // Ignored... + //} + // bits 5, 6, 7 - reserved + + $info_gzip_member_header_idx['crc32'] = getid3_lib::LittleEndian2Int(substr($buff, strlen($buff) - 8, 4)); + $info_gzip_member_header_idx['filesize'] = getid3_lib::LittleEndian2Int(substr($buff, strlen($buff) - 4)); + + if ($this->option_gzip_parse_contents) { + + // Try to inflate GZip + + if (!function_exists('gzinflate')) { + $this->getid3->warning('PHP does not have zlib support - contents not parsed.'); + return true; + } + + $csize = 0; + $inflated = ''; + $chkcrc32 = ''; + + $cdata = substr($buff, $fpointer); + $cdata = substr($cdata, 0, strlen($cdata) - 8); + $csize = strlen($cdata); + $inflated = gzinflate($cdata); + + // Calculate CRC32 for inflated content + $info_gzip_member_header_idx['crc32_valid'] = (bool) (sprintf('%u', crc32($inflated)) == $info_gzip_member_header_idx['crc32']); + + + //// Analyse contents + + // write content to temp file + if (($temp_file_name = tempnam('*', 'getID3')) === false) { + throw new getid3_exception('Unable to create temporary file.'); + } + + if ($tmp = fopen($temp_file_name, 'wb')) { + fwrite($tmp, $inflated); + fclose($tmp); + + // clone getid3 - we want same settings + $clone = clone $this->getid3; + unset($clone->info); + try { + $clone->Analyze($temp_file_name); + $info_gzip_member_header_idx['parsed_content'] = $clone->info; + } + catch (getid3_exception $e) { + // unable to parse contents + } + + unlink($temp_file_name); + } + + // Unknown/unhandled format + else { + + } + } + } + return true; + } + + + // Converts the OS type + public static function get_os_type($key) { + static $os_type = array ( + '0' => 'FAT filesystem (MS-DOS, OS/2, NT/Win32)', + '1' => 'Amiga', + '2' => 'VMS (or OpenVMS)', + '3' => 'Unix', + '4' => 'VM/CMS', + '5' => 'Atari TOS', + '6' => 'HPFS filesystem (OS/2, NT)', + '7' => 'Macintosh', + '8' => 'Z-System', + '9' => 'CP/M', + '10' => 'TOPS-20', + '11' => 'NTFS filesystem (NT)', + '12' => 'QDOS', + '13' => 'Acorn RISCOS', + '255' => 'unknown' + ); + return @$os_type[$key]; + } + + + // Converts the eXtra FLags + public static function get_xflag_type($key) { + static $xflag_type = array ( + '0' => 'unknown', + '2' => 'maximum compression', + '4' => 'fastest algorithm' + ); + return @$xflag_type[$key]; + } + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.archive.szip.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.archive.szip.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.archive.szip.php 3 Jan 2016 20:51:38 -0000 1.1.2.1 @@ -0,0 +1,105 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.archive.szip.php | +// | module for analyzing SZIP compressed files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.archive.szip.php,v 1.1.2.1 2016/01/03 20:51:38 gustafn Exp $ + + + +class getid3_szip extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $szip_rkau = fread($getid3->fp, 6); + + // Magic bytes: 'SZ'."\x0A\x04" + + $getid3->info['fileformat'] = 'szip'; + + $getid3->info['szip']['major_version'] = getid3_lib::BigEndian2Int(substr($szip_rkau, 4, 1)); + $getid3->info['szip']['minor_version'] = getid3_lib::BigEndian2Int(substr($szip_rkau, 5, 1)); + + while (!feof($getid3->fp)) { + $next_block_id = fread($getid3->fp, 2); + switch ($next_block_id) { + case 'SZ': + // Note that szip files can be concatenated, this has the same effect as + // concatenating the files. this also means that global header blocks + // might be present between directory/data blocks. + fseek($getid3->fp, 4, SEEK_CUR); + break; + + case 'BH': + $bh_header_bytes = getid3_lib::BigEndian2Int(fread($getid3->fp, 3)); + $bh_header_data = fread($getid3->fp, $bh_header_bytes); + $bh_header_offset = 0; + while (strpos($bh_header_data, "\x00", $bh_header_offset) > 0) { + //filename as \0 terminated string (empty string indicates end) + //owner as \0 terminated string (empty is same as last file) + //group as \0 terminated string (empty is same as last file) + //3 byte filelength in this block + //2 byte access flags + //4 byte creation time (like in unix) + //4 byte modification time (like in unix) + //4 byte access time (like in unix) + + $bh_data_array['filename'] = substr($bh_header_data, $bh_header_offset, strcspn($bh_header_data, "\x00")); + $bh_header_offset += (strlen($bh_data_array['filename']) + 1); + + $bh_data_array['owner'] = substr($bh_header_data, $bh_header_offset, strcspn($bh_header_data, "\x00")); + $bh_header_offset += (strlen($bh_data_array['owner']) + 1); + + $bh_data_array['group'] = substr($bh_header_data, $bh_header_offset, strcspn($bh_header_data, "\x00")); + $bh_header_offset += (strlen($bh_data_array['group']) + 1); + + $bh_data_array['filelength'] = getid3_lib::BigEndian2Int(substr($bh_header_data, $bh_header_offset, 3)); + $bh_header_offset += 3; + + $bh_data_array['access_flags'] = getid3_lib::BigEndian2Int(substr($bh_header_data, $bh_header_offset, 2)); + $bh_header_offset += 2; + + $bh_data_array['creation_time'] = getid3_lib::BigEndian2Int(substr($bh_header_data, $bh_header_offset, 4)); + $bh_header_offset += 4; + + $bh_data_array['modification_time'] = getid3_lib::BigEndian2Int(substr($bh_header_data, $bh_header_offset, 4)); + $bh_header_offset += 4; + + $bh_data_array['access_time'] = getid3_lib::BigEndian2Int(substr($bh_header_data, $bh_header_offset, 4)); + $bh_header_offset += 4; + + $getid3->info['szip']['BH'][] = $bh_data_array; + } + break; + + default: + break 2; + } + } + + return true; + } + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.archive.tar.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.archive.tar.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.archive.tar.php 3 Jan 2016 20:51:38 -0000 1.1.2.1 @@ -0,0 +1,231 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.archive.tar.php | +// | module for analyzing TAR files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// | Module originally written by Mike Mozolin | +// +----------------------------------------------------------------------+ +// +// $Id: module.archive.tar.php,v 1.1.2.1 2016/01/03 20:51:38 gustafn Exp $ + + + +class getid3_tar extends getid3_handler +{ + + function Analyze() { + + $info = &$this->getid3->info; + + $info['fileformat'] = 'tar'; + + $fp = $this->getid3->fp; + + fseek($fp, 0); + + $unpack_header = 'a100fname/a8mode/a8uid/a8gid/a12size/a12mtime/a8chksum/a1typflag/a100lnkname/a6magic/a2ver/a32uname/a32gname/a8devmaj/a8devmin/a155/prefix'; + + $null_512k = str_repeat("\0", 512); // end-of-file marker + + $already_warned = false; + + while (!feof($fp)) { + + $buffer = fread($fp, 512); + + // check the block + $checksum = 0; + for ($i = 0; $i < 148; $i++) { + $checksum += ord(substr($buffer, $i, 1)); + } + for ($i = 148; $i < 156; $i++) { + $checksum += ord(' '); + } + for ($i = 156; $i < 512; $i++) { + $checksum += ord(substr($buffer, $i, 1)); + } + $attr = unpack($unpack_header, $buffer); + $name = trim(@$attr['fname']); + $mode = octdec(trim(@$attr['mode'])); + $uid = octdec(trim(@$attr['uid'])); + $gid = octdec(trim(@$attr['gid'])); + $size = octdec(trim(@$attr['size'])); + $mtime = octdec(trim(@$attr['mtime'])); + $chksum = octdec(trim(@$attr['chksum'])); + $typflag = trim(@$attr['typflag']); + $lnkname = trim(@$attr['lnkname']); + $magic = trim(@$attr['magic']); + $ver = trim(@$attr['ver']); + $uname = trim(@$attr['uname']); + $gname = trim(@$attr['gname']); + $devmaj = octdec(trim(@$attr['devmaj'])); + $devmin = octdec(trim(@$attr['devmin'])); + $prefix = trim(@$attr['prefix']); + + // EOF Found + if (($checksum == 256) && ($chksum == 0)) { + break; + } + + // Check if filename if 7bit as spec requires + if (!$already_warned) { + for ($i = 0; $i < strlen($name); $i++) { + if ($name{$i} < chr(32) || $name{$i} > chr(127)) { + $this->getid3->warning('Some filenames contains extended characters, which breaks the tar specifation. This is not uncommon, but you will have to handle the character encoding for filenames yourself.'); + $already_warned = true; + break; + } + } + } + + if ($prefix) { + $name = $prefix.'/'.$name; + } + if ((preg_match('#/$#', $name)) && !$name) { + $typeflag = 5; + } + + // If it's the end of the tar-file... + if ($buffer == $null_512k) { + break; + } + + // Protect against tar-files with garbage at the end + if ($name == '') { + break; + } + + $info['tar']['file_details'][$name] = array ( + 'name' => $name, + 'mode_raw' => $mode, + 'mode' => getid3_tar::display_perms($mode), + 'uid' => $uid, + 'gid' => $gid, + 'size' => $size, + 'mtime' => $mtime, + 'chksum' => $chksum, + 'typeflag' => getid3_tar::get_flag_type($typflag), + 'linkname' => $lnkname, + 'magic' => $magic, + 'version' => $ver, + 'uname' => $uname, + 'gname' => $gname, + 'devmajor' => $devmaj, + 'devminor' => $devmin + ); + + // Skip the next chunk + fseek($fp, $size, SEEK_CUR); + + // Throw away padding + if ($size % 512) { + fseek($fp, 512 - $diff, SEEK_CUR); + } + + } + return true; + } + + + // Parses the file mode to file permissions + public static function display_perms($mode) { + + // Determine Type + if ($mode & 0x1000) { + $type='p'; // FIFO pipe + } + elseif ($mode & 0x2000) { + $type='c'; // Character special + } + elseif ($mode & 0x4000) { + $type='d'; // Directory + } + elseif ($mode & 0x6000) { + $type='b'; // Block special + } + elseif ($mode & 0x8000) { + $type='-'; // Regular + } + elseif ($mode & 0xA000) { + $type='l'; // Symbolic Link + } + elseif ($mode & 0xC000) { + $type='s'; // Socket + } + else { + $type='u'; // UNKNOWN + } + + // Determine permissions + $owner['read'] = (($mode & 00400) ? 'r' : '-'); + $owner['write'] = (($mode & 00200) ? 'w' : '-'); + $owner['execute'] = (($mode & 00100) ? 'x' : '-'); + $group['read'] = (($mode & 00040) ? 'r' : '-'); + $group['write'] = (($mode & 00020) ? 'w' : '-'); + $group['execute'] = (($mode & 00010) ? 'x' : '-'); + $world['read'] = (($mode & 00004) ? 'r' : '-'); + $world['write'] = (($mode & 00002) ? 'w' : '-'); + $world['execute'] = (($mode & 00001) ? 'x' : '-'); + + // Adjust for SUID, SGID and sticky bit + if ($mode & 0x800) { + $owner['execute'] = ($owner['execute'] == 'x') ? 's' : 'S'; + } + if ($mode & 0x400) { + $group['execute'] = ($group['execute'] == 'x') ? 's' : 'S'; + } + if ($mode & 0x200) { + $world['execute'] = ($world['execute'] == 'x') ? 't' : 'T'; + } + + $s = sprintf('%1s', $type); + $s .= sprintf('%1s%1s%1s', $owner['read'], $owner['write'], $owner['execute']); + $s .= sprintf('%1s%1s%1s', $group['read'], $group['write'], $group['execute']); + $s .= sprintf('%1s%1s%1s'."\n", $world['read'], $world['write'], $world['execute']); + + return $s; + } + + + // Converts the file type + public static function get_flag_type($typflag) { + + static $flag_types = array ( + '0' => 'LF_NORMAL', + '1' => 'LF_LINK', + '2' => 'LF_SYNLINK', + '3' => 'LF_CHR', + '4' => 'LF_BLK', + '5' => 'LF_DIR', + '6' => 'LF_FIFO', + '7' => 'LF_CONFIG', + 'D' => 'LF_DUMPDIR', + 'K' => 'LF_LONGLINK', + 'L' => 'LF_LONGNAME', + 'M' => 'LF_MULTIVOL', + 'N' => 'LF_NAMES', + 'S' => 'LF_SPARSE', + 'V' => 'LF_VOLHDR' + ); + + return @$flag_types[$typflag]; + } + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.archive.zip.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.archive.zip.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.archive.zip.php 3 Jan 2016 20:51:39 -0000 1.1.2.1 @@ -0,0 +1,510 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.archive.zip.php | +// | Module for analyzing pkZip files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.archive.zip.php,v 1.1.2.1 2016/01/03 20:51:39 gustafn Exp $ + + + +class getid3_zip extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['zip'] = array (); + $info_zip = &$getid3->info['zip']; + + $getid3->info['fileformat'] = 'zip'; + + $info_zip['encoding'] = 'ISO-8859-1'; + $info_zip['files'] = array (); + $info_zip['compressed_size'] = $info_zip['uncompressed_size'] = $info_zip['entries_count'] = 0; + + $eocd_search_data = ''; + $eocd_search_counter = 0; + while ($eocd_search_counter++ < 512) { + + fseek($getid3->fp, -128 * $eocd_search_counter, SEEK_END); + $eocd_search_data = fread($getid3->fp, 128).$eocd_search_data; + + if (strstr($eocd_search_data, 'PK'."\x05\x06")) { + + $eocd_position = strpos($eocd_search_data, 'PK'."\x05\x06"); + fseek($getid3->fp, (-128 * $eocd_search_counter) + $eocd_position, SEEK_END); + $info_zip['end_central_directory'] = $this->ZIPparseEndOfCentralDirectory(); + + fseek($getid3->fp, $info_zip['end_central_directory']['directory_offset'], SEEK_SET); + $info_zip['entries_count'] = 0; + while ($central_directoryentry = $this->ZIPparseCentralDirectory($getid3->fp)) { + $info_zip['central_directory'][] = $central_directoryentry; + $info_zip['entries_count']++; + $info_zip['compressed_size'] += $central_directoryentry['compressed_size']; + $info_zip['uncompressed_size'] += $central_directoryentry['uncompressed_size']; + + if ($central_directoryentry['uncompressed_size'] > 0) { + $info_zip['files'] = getid3_zip::array_merge_clobber($info_zip['files'], getid3_zip::CreateDeepArray($central_directoryentry['filename'], '/', $central_directoryentry['uncompressed_size'])); + } + } + + if ($info_zip['entries_count'] == 0) { + throw new getid3_exception('No Central Directory entries found (truncated file?)'); + } + + if (!empty($info_zip['end_central_directory']['comment'])) { + $info_zip['comments']['comment'][] = $info_zip['end_central_directory']['comment']; + } + + if (isset($info_zip['central_directory'][0]['compression_method'])) { + $info_zip['compression_method'] = $info_zip['central_directory'][0]['compression_method']; + } + if (isset($info_zip['central_directory'][0]['flags']['compression_speed'])) { + $info_zip['compression_speed'] = $info_zip['central_directory'][0]['flags']['compression_speed']; + } + if (isset($info_zip['compression_method']) && ($info_zip['compression_method'] == 'store') && !isset($info_zip['compression_speed'])) { + $info_zip['compression_speed'] = 'store'; + } + + return true; + } + } + + if ($this->getZIPentriesFilepointer()) { + + // central directory couldn't be found and/or parsed + // scan through actual file data entries, recover as much as possible from probable trucated file + if (@$info_zip['compressed_size'] > ($getid3->info['filesize'] - 46 - 22)) { + throw new getid3_exception('Warning: Truncated file! - Total compressed file sizes ('.$info_zip['compressed_size'].' bytes) is greater than filesize minus Central Directory and End Of Central Directory structures ('.($getid3->info['filesize'] - 46 - 22).' bytes)'); + } + throw new getid3_exception('Cannot find End Of Central Directory - returned list of files in [zip][entries] array may not be complete'); + } + + //throw new getid3_exception('Cannot find End Of Central Directory (truncated file?)'); + } + + + + private function getZIPHeaderFilepointerTopDown() { + + // shortcut + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'zip'; + + $getid3->info['zip'] = array (); + $info_zip['compressed_size'] = $info_zip['uncompressed_size'] = $info_zip['entries_count'] = 0; + + rewind($getid3->fp); + while ($fileentry = $this->ZIPparseLocalFileHeader()) { + $info_zip['entries'][] = $fileentry; + $info_zip['entries_count']++; + } + if ($info_zip['entries_count'] == 0) { + throw new getid3_exception('No Local File Header entries found'); + } + + $info_zip['entries_count'] = 0; + while ($central_directoryentry = $this->ZIPparseCentralDirectory($getid3->fp)) { + $info_zip['central_directory'][] = $central_directoryentry; + $info_zip['entries_count']++; + $info_zip['compressed_size'] += $central_directoryentry['compressed_size']; + $info_zip['uncompressed_size'] += $central_directoryentry['uncompressed_size']; + } + if ($info_zip['entries_count'] == 0) { + throw new getid3_exception('No Central Directory entries found (truncated file?)'); + } + + if ($eocd = $this->ZIPparseEndOfCentralDirectory()) { + $info_zip['end_central_directory'] = $eocd; + } else { + throw new getid3_exception('No End Of Central Directory entry found (truncated file?)'); + } + + if (!@$info_zip['end_central_directory']['comment']) { + $info_zip['comments']['comment'][] = $info_zip['end_central_directory']['comment']; + } + + return true; + } + + + + private function getZIPentriesFilepointer() { + + // shortcut + $getid3 = $this->getid3; + + $getid3->info['zip'] = array (); + $info_zip['compressed_size'] = $info_zip['uncompressed_size'] = $info_zip['entries_count'] = 0; + + rewind($getid3->fp); + while ($fileentry = $this->ZIPparseLocalFileHeader($getid3->fp)) { + $info_zip['entries'][] = $fileentry; + $info_zip['entries_count']++; + $info_zip['compressed_size'] += $fileentry['compressed_size']; + $info_zip['uncompressed_size'] += $fileentry['uncompressed_size']; + } + if ($info_zip['entries_count'] == 0) { + throw new getid3_exception('No Local File Header entries found'); + } + + return true; + } + + + + private function ZIPparseLocalFileHeader() { + + // shortcut + $getid3 = $this->getid3; + + $local_file_header['offset'] = ftell($getid3->fp); + + $zip_local_file_header = fread($getid3->fp, 30); + + $local_file_header['raw']['signature'] = getid3_lib::LittleEndian2Int(substr($zip_local_file_header, 0, 4)); + + // Invalid Local File Header Signature + if ($local_file_header['raw']['signature'] != 0x04034B50) { + fseek($getid3->fp, $local_file_header['offset'], SEEK_SET); // seek back to where filepointer originally was so it can be handled properly + return false; + } + + getid3_lib::ReadSequence('LittleEndian2Int', $local_file_header['raw'], $zip_local_file_header, 4, + array ( + 'extract_version' => 2, + 'general_flags' => 2, + 'compression_method' => 2, + 'last_mod_file_time' => 2, + 'last_mod_file_date' => 2, + 'crc_32' => 2, + 'compressed_size' => 2, + 'uncompressed_size' => 2, + 'filename_length' => 2, + 'extra_field_length' => 2 + ) + ); + + $local_file_header['extract_version'] = sprintf('%1.1f', $local_file_header['raw']['extract_version'] / 10); + $local_file_header['host_os'] = $this->ZIPversionOSLookup(($local_file_header['raw']['extract_version'] & 0xFF00) >> 8); + $local_file_header['compression_method'] = $this->ZIPcompressionMethodLookup($local_file_header['raw']['compression_method']); + $local_file_header['compressed_size'] = $local_file_header['raw']['compressed_size']; + $local_file_header['uncompressed_size'] = $local_file_header['raw']['uncompressed_size']; + $local_file_header['flags'] = $this->ZIPparseGeneralPurposeFlags($local_file_header['raw']['general_flags'], $local_file_header['raw']['compression_method']); + $local_file_header['last_modified_timestamp'] = $this->DOStime2UNIXtime($local_file_header['raw']['last_mod_file_date'], $local_file_header['raw']['last_mod_file_time']); + + $filename_extra_field_length = $local_file_header['raw']['filename_length'] + $local_file_header['raw']['extra_field_length']; + if ($filename_extra_field_length > 0) { + $zip_local_file_header .= fread($getid3->fp, $filename_extra_field_length); + + if ($local_file_header['raw']['filename_length'] > 0) { + $local_file_header['filename'] = substr($zip_local_file_header, 30, $local_file_header['raw']['filename_length']); + } + if ($local_file_header['raw']['extra_field_length'] > 0) { + $local_file_header['raw']['extra_field_data'] = substr($zip_local_file_header, 30 + $local_file_header['raw']['filename_length'], $local_file_header['raw']['extra_field_length']); + } + } + + $local_file_header['data_offset'] = ftell($getid3->fp); + fseek($getid3->fp, $local_file_header['raw']['compressed_size'], SEEK_CUR); + + if ($local_file_header['flags']['data_descriptor_used']) { + $data_descriptor = fread($getid3->fp, 12); + + getid3_lib::ReadSequence('LittleEndian2Int', $local_file_header['data_descriptor'], $data_descriptor, 0, + array ( + 'crc_32' => 4, + 'compressed_size' => 4, + 'uncompressed_size' => 4 + ) + ); + } + + return $local_file_header; + } + + + + private function ZIPparseCentralDirectory() { + + // shortcut + $getid3 = $this->getid3; + + $central_directory['offset'] = ftell($getid3->fp); + + $zip_central_directory = fread($getid3->fp, 46); + + $central_directory['raw']['signature'] = getid3_lib::LittleEndian2Int(substr($zip_central_directory, 0, 4)); + + // invalid Central Directory Signature + if ($central_directory['raw']['signature'] != 0x02014B50) { + fseek($getid3->fp, $central_directory['offset'], SEEK_SET); // seek back to where filepointer originally was so it can be handled properly + return false; + } + + getid3_lib::ReadSequence('LittleEndian2Int', $central_directory['raw'], $zip_central_directory, 4, + array ( + 'create_version' => 2, + 'extract_version' => 2, + 'general_flags' => 2, + 'compression_method' => 2, + 'last_mod_file_time' => 2, + 'last_mod_file_date' => 2, + 'crc_32' => 4, + 'compressed_size' => 4, + 'uncompressed_size' => 4, + 'filename_length' => 2, + 'extra_field_length' => 2, + 'file_comment_length' => 2, + 'disk_number_start' => 2, + 'internal_file_attrib' => 2, + 'external_file_attrib' => 4, + 'local_header_offset' => 4 + ) + ); + + $central_directory['entry_offset'] = $central_directory['raw']['local_header_offset']; + $central_directory['create_version'] = sprintf('%1.1f', $central_directory['raw']['create_version'] / 10); + $central_directory['extract_version'] = sprintf('%1.1f', $central_directory['raw']['extract_version'] / 10); + $central_directory['host_os'] = $this->ZIPversionOSLookup(($central_directory['raw']['extract_version'] & 0xFF00) >> 8); + $central_directory['compression_method'] = $this->ZIPcompressionMethodLookup($central_directory['raw']['compression_method']); + $central_directory['compressed_size'] = $central_directory['raw']['compressed_size']; + $central_directory['uncompressed_size'] = $central_directory['raw']['uncompressed_size']; + $central_directory['flags'] = $this->ZIPparseGeneralPurposeFlags($central_directory['raw']['general_flags'], $central_directory['raw']['compression_method']); + $central_directory['last_modified_timestamp'] = $this->DOStime2UNIXtime($central_directory['raw']['last_mod_file_date'], $central_directory['raw']['last_mod_file_time']); + + $filename_extra_field_comment_length = $central_directory['raw']['filename_length'] + $central_directory['raw']['extra_field_length'] + $central_directory['raw']['file_comment_length']; + if ($filename_extra_field_comment_length > 0) { + $filename_extra_field_comment = fread($getid3->fp, $filename_extra_field_comment_length); + + if ($central_directory['raw']['filename_length'] > 0) { + $central_directory['filename']= substr($filename_extra_field_comment, 0, $central_directory['raw']['filename_length']); + } + if ($central_directory['raw']['extra_field_length'] > 0) { + $central_directory['raw']['extra_field_data'] = substr($filename_extra_field_comment, $central_directory['raw']['filename_length'], $central_directory['raw']['extra_field_length']); + } + if ($central_directory['raw']['file_comment_length'] > 0) { + $central_directory['file_comment'] = substr($filename_extra_field_comment, $central_directory['raw']['filename_length'] + $central_directory['raw']['extra_field_length'], $central_directory['raw']['file_comment_length']); + } + } + + return $central_directory; + } + + + + private function ZIPparseEndOfCentralDirectory() { + + // shortcut + $getid3 = $this->getid3; + + $end_of_central_directory['offset'] = ftell($getid3->fp); + + $zip_end_of_central_directory = fread($getid3->fp, 22); + + $end_of_central_directory['signature'] = getid3_lib::LittleEndian2Int(substr($zip_end_of_central_directory, 0, 4)); + + // invalid End Of Central Directory Signature + if ($end_of_central_directory['signature'] != 0x06054B50) { + fseek($getid3->fp, $end_of_central_directory['offset'], SEEK_SET); // seek back to where filepointer originally was so it can be handled properly + return false; + } + + getid3_lib::ReadSequence('LittleEndian2Int', $end_of_central_directory, $zip_end_of_central_directory, 4, + array ( + 'disk_number_current' => 2, + 'disk_number_start_directory' => 2, + 'directory_entries_this_disk' => 2, + 'directory_entries_total' => 2, + 'directory_size' => 4, + 'directory_offset' => 4, + 'comment_length' => 2 + ) + ); + + if ($end_of_central_directory['comment_length'] > 0) { + $end_of_central_directory['comment'] = fread($getid3->fp, $end_of_central_directory['comment_length']); + } + + return $end_of_central_directory; + } + + + + public static function ZIPparseGeneralPurposeFlags($flag_bytes, $compression_method) { + + $parsed_flags['encrypted'] = (bool)($flag_bytes & 0x0001); + + switch ($compression_method) { + case 6: + $parsed_flags['dictionary_size'] = (($flag_bytes & 0x0002) ? 8192 : 4096); + $parsed_flags['shannon_fano_trees'] = (($flag_bytes & 0x0004) ? 3 : 2); + break; + + case 8: + case 9: + switch (($flag_bytes & 0x0006) >> 1) { + case 0: + $parsed_flags['compression_speed'] = 'normal'; + break; + case 1: + $parsed_flags['compression_speed'] = 'maximum'; + break; + case 2: + $parsed_flags['compression_speed'] = 'fast'; + break; + case 3: + $parsed_flags['compression_speed'] = 'superfast'; + break; + } + break; + } + $parsed_flags['data_descriptor_used'] = (bool)($flag_bytes & 0x0008); + + return $parsed_flags; + } + + + + public static function ZIPversionOSLookup($index) { + + static $lookup = array ( + 0 => 'MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems)', + 1 => 'Amiga', + 2 => 'OpenVMS', + 3 => 'Unix', + 4 => 'VM/CMS', + 5 => 'Atari ST', + 6 => 'OS/2 H.P.F.S.', + 7 => 'Macintosh', + 8 => 'Z-System', + 9 => 'CP/M', + 10 => 'Windows NTFS', + 11 => 'MVS', + 12 => 'VSE', + 13 => 'Acorn Risc', + 14 => 'VFAT', + 15 => 'Alternate MVS', + 16 => 'BeOS', + 17 => 'Tandem' + ); + return (isset($lookup[$index]) ? $lookup[$index] : '[unknown]'); + } + + + + public static function ZIPcompressionMethodLookup($index) { + + static $lookup = array ( + 0 => 'store', + 1 => 'shrink', + 2 => 'reduce-1', + 3 => 'reduce-2', + 4 => 'reduce-3', + 5 => 'reduce-4', + 6 => 'implode', + 7 => 'tokenize', + 8 => 'deflate', + 9 => 'deflate64', + 10 => 'PKWARE Date Compression Library Imploding' + ); + return (isset($lookup[$index]) ? $lookup[$index] : '[unknown]'); + } + + + + public static function DOStime2UNIXtime($DOSdate, $DOStime) { + + /* + // wFatDate + // Specifies the MS-DOS date. The date is a packed 16-bit value with the following format: + // Bits Contents + // 0-4 Day of the month (1-31) + // 5-8 Month (1 = January, 2 = February, and so on) + // 9-15 Year offset from 1980 (add 1980 to get actual year) + + $UNIXday = ($DOSdate & 0x001F); + $UNIXmonth = (($DOSdate & 0x01E0) >> 5); + $UNIXyear = (($DOSdate & 0xFE00) >> 9) + 1980; + + // wFatTime + // Specifies the MS-DOS time. The time is a packed 16-bit value with the following format: + // Bits Contents + // 0-4 Second divided by 2 + // 5-10 Minute (0-59) + // 11-15 Hour (0-23 on a 24-hour clock) + + $UNIXsecond = ($DOStime & 0x001F) * 2; + $UNIXminute = (($DOStime & 0x07E0) >> 5); + $UNIXhour = (($DOStime & 0xF800) >> 11); + + return gmmktime($UNIXhour, $UNIXminute, $UNIXsecond, $UNIXmonth, $UNIXday, $UNIXyear); + */ + return gmmktime(($DOStime & 0xF800) >> 11, ($DOStime & 0x07E0) >> 5, ($DOStime & 0x001F) * 2, ($DOSdate & 0x01E0) >> 5, $DOSdate & 0x001F, (($DOSdate & 0xFE00) >> 9) + 1980); + } + + + + public static function array_merge_clobber($array1, $array2) { + + // written by kc�hireability*com + // taken from http://www.php.net/manual/en/function.array-merge-recursive.php + + if (!is_array($array1) || !is_array($array2)) { + return false; + } + + $newarray = $array1; + foreach ($array2 as $key => $val) { + if (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) { + $newarray[$key] = getid3_zip::array_merge_clobber($newarray[$key], $val); + } else { + $newarray[$key] = $val; + } + } + return $newarray; + } + + + + public static function CreateDeepArray($array_path, $separator, $value) { + + // assigns $value to a nested array path: + // $foo = getid3_lib::CreateDeepArray('/path/to/my', '/', 'file.txt') + // is the same as: + // $foo = array ('path'=>array('to'=>'array('my'=>array('file.txt')))); + // or + // $foo['path']['to']['my'] = 'file.txt'; + + while ($array_path{0} == $separator) { + $array_path = substr($array_path, 1); + } + if (($pos = strpos($array_path, $separator)) !== false) { + return array (substr($array_path, 0, $pos) => getid3_zip::CreateDeepArray(substr($array_path, $pos + 1), $separator, $value)); + } + + return array ($array_path => $value); + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.asf.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.asf.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.asf.php 3 Jan 2016 20:51:39 -0000 1.1.2.1 @@ -0,0 +1,1846 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio-video.php | +// | Module for analyzing Microsoft ASF, WMA and WMV files. | +// | dependencies: module.audio-video.riff.php | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.asf.php,v 1.1.2.1 2016/01/03 20:51:39 gustafn Exp $ + + + +class getid3_asf extends getid3_handler +{ + + const Extended_Stream_Properties_Object = '14E6A5CB-C672-4332-8399-A96952065B5A'; + const Padding_Object = '1806D474-CADF-4509-A4BA-9AABCB96AAE8'; + const Payload_Ext_Syst_Pixel_Aspect_Ratio = '1B1EE554-F9EA-4BC8-821A-376B74E4C4B8'; + const Script_Command_Object = '1EFB1A30-0B62-11D0-A39B-00A0C90348F6'; + const No_Error_Correction = '20FB5700-5B55-11CF-A8FD-00805F5C442B'; + const Content_Branding_Object = '2211B3FA-BD23-11D2-B4B7-00A0C955FC6E'; + const Content_Encryption_Object = '2211B3FB-BD23-11D2-B4B7-00A0C955FC6E'; + const Digital_Signature_Object = '2211B3FC-BD23-11D2-B4B7-00A0C955FC6E'; + const Extended_Content_Encryption_Object = '298AE614-2622-4C17-B935-DAE07EE9289C'; + const Simple_Index_Object = '33000890-E5B1-11CF-89F4-00A0C90349CB'; + const Degradable_JPEG_Media = '35907DE0-E415-11CF-A917-00805F5C442B'; + const Payload_Extension_System_Timecode = '399595EC-8667-4E2D-8FDB-98814CE76C1E'; + const Binary_Media = '3AFB65E2-47EF-40F2-AC2C-70A90D71D343'; + const Timecode_Index_Object = '3CB73FD0-0C4A-4803-953D-EDF7B6228F0C'; + const Metadata_Library_Object = '44231C94-9498-49D1-A141-1D134E457054'; + const Reserved_3 = '4B1ACBE3-100B-11D0-A39B-00A0C90348F6'; + const Reserved_4 = '4CFEDB20-75F6-11CF-9C0F-00A0C90349CB'; + const Command_Media = '59DACFC0-59E6-11D0-A3AC-00A0C90348F6'; + const Header_Extension_Object = '5FBF03B5-A92E-11CF-8EE3-00C00C205365'; + const Media_Object_Index_Parameters_Obj = '6B203BAD-3F11-4E84-ACA8-D7613DE2CFA7'; + const Header_Object = '75B22630-668E-11CF-A6D9-00AA0062CE6C'; + const Content_Description_Object = '75B22633-668E-11CF-A6D9-00AA0062CE6C'; + const Error_Correction_Object = '75B22635-668E-11CF-A6D9-00AA0062CE6C'; + const Data_Object = '75B22636-668E-11CF-A6D9-00AA0062CE6C'; + const Web_Stream_Media_Subtype = '776257D4-C627-41CB-8F81-7AC7FF1C40CC'; + const Stream_Bitrate_Properties_Object = '7BF875CE-468D-11D1-8D82-006097C9A2B2'; + const Language_List_Object = '7C4346A9-EFE0-4BFC-B229-393EDE415C85'; + const Codec_List_Object = '86D15240-311D-11D0-A3A4-00A0C90348F6'; + const Reserved_2 = '86D15241-311D-11D0-A3A4-00A0C90348F6'; + const File_Properties_Object = '8CABDCA1-A947-11CF-8EE4-00C00C205365'; + const File_Transfer_Media = '91BD222C-F21C-497A-8B6D-5AA86BFC0185'; + const Old_RTP_Extension_Data = '96800C63-4C94-11D1-837B-0080C7A37F95'; + const Advanced_Mutual_Exclusion_Object = 'A08649CF-4775-4670-8A16-6E35357566CD'; + const Bandwidth_Sharing_Object = 'A69609E6-517B-11D2-B6AF-00C04FD908E9'; + const Reserved_1 = 'ABD3D211-A9BA-11CF-8EE6-00C00C205365'; + const Bandwidth_Sharing_Exclusive = 'AF6060AA-5197-11D2-B6AF-00C04FD908E9'; + const Bandwidth_Sharing_Partial = 'AF6060AB-5197-11D2-B6AF-00C04FD908E9'; + const JFIF_Media = 'B61BE100-5B4E-11CF-A8FD-00805F5C442B'; + const Stream_Properties_Object = 'B7DC0791-A9B7-11CF-8EE6-00C00C205365'; + const Video_Media = 'BC19EFC0-5B4D-11CF-A8FD-00805F5C442B'; + const Audio_Spread = 'BFC3CD50-618F-11CF-8BB2-00AA00B4E220'; + const Metadata_Object = 'C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA'; + const Payload_Ext_Syst_Sample_Duration = 'C6BD9450-867F-4907-83A3-C77921B733AD'; + const Group_Mutual_Exclusion_Object = 'D1465A40-5A79-4338-B71B-E36B8FD6C249'; + const Extended_Content_Description_Object = 'D2D0A440-E307-11D2-97F0-00A0C95EA850'; + const Stream_Prioritization_Object = 'D4FED15B-88D3-454F-81F0-ED5C45999E24'; + const Payload_Ext_System_Content_Type = 'D590DC20-07BC-436C-9CF7-F3BBFBF1A4DC'; + const Old_File_Properties_Object = 'D6E229D0-35DA-11D1-9034-00A0C90349BE'; + const Old_ASF_Header_Object = 'D6E229D1-35DA-11D1-9034-00A0C90349BE'; + const Old_ASF_Data_Object = 'D6E229D2-35DA-11D1-9034-00A0C90349BE'; + const Index_Object = 'D6E229D3-35DA-11D1-9034-00A0C90349BE'; + const Old_Stream_Properties_Object = 'D6E229D4-35DA-11D1-9034-00A0C90349BE'; + const Old_Content_Description_Object = 'D6E229D5-35DA-11D1-9034-00A0C90349BE'; + const Old_Script_Command_Object = 'D6E229D6-35DA-11D1-9034-00A0C90349BE'; + const Old_Marker_Object = 'D6E229D7-35DA-11D1-9034-00A0C90349BE'; + const Old_Component_Download_Object = 'D6E229D8-35DA-11D1-9034-00A0C90349BE'; + const Old_Stream_Group_Object = 'D6E229D9-35DA-11D1-9034-00A0C90349BE'; + const Old_Scalable_Object = 'D6E229DA-35DA-11D1-9034-00A0C90349BE'; + const Old_Prioritization_Object = 'D6E229DB-35DA-11D1-9034-00A0C90349BE'; + const Bitrate_Mutual_Exclusion_Object = 'D6E229DC-35DA-11D1-9034-00A0C90349BE'; + const Old_Inter_Media_Dependency_Object = 'D6E229DD-35DA-11D1-9034-00A0C90349BE'; + const Old_Rating_Object = 'D6E229DE-35DA-11D1-9034-00A0C90349BE'; + const Index_Parameters_Object = 'D6E229DF-35DA-11D1-9034-00A0C90349BE'; + const Old_Color_Table_Object = 'D6E229E0-35DA-11D1-9034-00A0C90349BE'; + const Old_Language_List_Object = 'D6E229E1-35DA-11D1-9034-00A0C90349BE'; + const Old_Audio_Media = 'D6E229E2-35DA-11D1-9034-00A0C90349BE'; + const Old_Video_Media = 'D6E229E3-35DA-11D1-9034-00A0C90349BE'; + const Old_Image_Media = 'D6E229E4-35DA-11D1-9034-00A0C90349BE'; + const Old_Timecode_Media = 'D6E229E5-35DA-11D1-9034-00A0C90349BE'; + const Old_Text_Media = 'D6E229E6-35DA-11D1-9034-00A0C90349BE'; + const Old_MIDI_Media = 'D6E229E7-35DA-11D1-9034-00A0C90349BE'; + const Old_Command_Media = 'D6E229E8-35DA-11D1-9034-00A0C90349BE'; + const Old_No_Error_Concealment = 'D6E229EA-35DA-11D1-9034-00A0C90349BE'; + const Old_Scrambled_Audio = 'D6E229EB-35DA-11D1-9034-00A0C90349BE'; + const Old_No_Color_Table = 'D6E229EC-35DA-11D1-9034-00A0C90349BE'; + const Old_SMPTE_Time = 'D6E229ED-35DA-11D1-9034-00A0C90349BE'; + const Old_ASCII_Text = 'D6E229EE-35DA-11D1-9034-00A0C90349BE'; + const Old_Unicode_Text = 'D6E229EF-35DA-11D1-9034-00A0C90349BE'; + const Old_HTML_Text = 'D6E229F0-35DA-11D1-9034-00A0C90349BE'; + const Old_URL_Command = 'D6E229F1-35DA-11D1-9034-00A0C90349BE'; + const Old_Filename_Command = 'D6E229F2-35DA-11D1-9034-00A0C90349BE'; + const Old_ACM_Codec = 'D6E229F3-35DA-11D1-9034-00A0C90349BE'; + const Old_VCM_Codec = 'D6E229F4-35DA-11D1-9034-00A0C90349BE'; + const Old_QuickTime_Codec = 'D6E229F5-35DA-11D1-9034-00A0C90349BE'; + const Old_DirectShow_Transform_Filter = 'D6E229F6-35DA-11D1-9034-00A0C90349BE'; + const Old_DirectShow_Rendering_Filter = 'D6E229F7-35DA-11D1-9034-00A0C90349BE'; + const Old_No_Enhancement = 'D6E229F8-35DA-11D1-9034-00A0C90349BE'; + const Old_Unknown_Enhancement_Type = 'D6E229F9-35DA-11D1-9034-00A0C90349BE'; + const Old_Temporal_Enhancement = 'D6E229FA-35DA-11D1-9034-00A0C90349BE'; + const Old_Spatial_Enhancement = 'D6E229FB-35DA-11D1-9034-00A0C90349BE'; + const Old_Quality_Enhancement = 'D6E229FC-35DA-11D1-9034-00A0C90349BE'; + const Old_Number_of_Channels_Enhancement = 'D6E229FD-35DA-11D1-9034-00A0C90349BE'; + const Old_Frequency_Response_Enhancement = 'D6E229FE-35DA-11D1-9034-00A0C90349BE'; + const Old_Media_Object = 'D6E229FF-35DA-11D1-9034-00A0C90349BE'; + const Mutex_Language = 'D6E22A00-35DA-11D1-9034-00A0C90349BE'; + const Mutex_Bitrate = 'D6E22A01-35DA-11D1-9034-00A0C90349BE'; + const Mutex_Unknown = 'D6E22A02-35DA-11D1-9034-00A0C90349BE'; + const Old_ASF_Placeholder_Object = 'D6E22A0E-35DA-11D1-9034-00A0C90349BE'; + const Old_Data_Unit_Extension_Object = 'D6E22A0F-35DA-11D1-9034-00A0C90349BE'; + const Web_Stream_Format = 'DA1E6B13-8359-4050-B398-388E965BF00C'; + const Payload_Ext_System_File_Name = 'E165EC0E-19ED-45D7-B4A7-25CBD1E28E9B'; + const Marker_Object = 'F487CD01-A951-11CF-8EE6-00C00C205365'; + const Timecode_Index_Parameters_Object = 'F55E496D-9797-4B5D-8C8B-604DFE9BFB24'; + const Audio_Media = 'F8699E40-5B4D-11CF-A8FD-00805F5C442B'; + const Media_Object_Index_Object = 'FEB103F8-12AD-4C64-840F-2A1D2F7AD48C'; + const Alt_Extended_Content_Encryption_Obj = 'FF889EF1-ADEE-40DA-9E71-98704BB928CE'; + + + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->include_module('audio-video.riff'); + + !isset($getid3->info['audio']) and $getid3->info['audio'] = array (); + !isset($getid3->info['video']) and $getid3->info['video'] = array (); + $getid3->info['asf']['comments'] = $getid3->info['asf']['header_object'] = array (); + + $info_audio = &$getid3->info['audio']; + $info_video = &$getid3->info['video']; + $info_asf = &$getid3->info['asf']; + $info_asf_comments = &$info_asf['comments']; + $info_asf_header_object = &$info_asf['header_object']; + + // ASF structure: + // * Header Object [required] + // * File Properties Object [required] (global file attributes) + // * Stream Properties Object [required] (defines media stream & characteristics) + // * Header Extension Object [required] (additional functionality) + // * Content Description Object (bibliographic information) + // * Script Command Object (commands for during playback) + // * Marker Object (named jumped points within the file) + // * Data Object [required] + // * Data Packets + // * Index Object + + // Header Object: (mandatory, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for header object - getid3_asf::Header_Object + // Object Size QWORD 64 // size of header object, including 30 bytes of Header Object header + // Number of Header Objects DWORD 32 // number of objects in header object + // Reserved1 BYTE 8 // hardcoded: 0x01 + // Reserved2 BYTE 8 // hardcoded: 0x02 + + $getid3->info['fileformat'] = 'asf'; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $header_object_data = fread($getid3->fp, 30); + + $info_asf_header_object['objectid_guid'] = getid3_asf::BytestringToGUID(substr($header_object_data, 0, 16)); + + if ($info_asf_header_object['objectid_guid'] != getid3_asf::Header_Object) { + throw new getid3_exception('ASF header GUID {'.$info_asf_header_object['objectid_guid'].'} does not match expected "getid3_asf::Header_Object" GUID {'.getid3_asf::Header_Object.'}'); + } + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_header_object, $header_object_data, 16, + array ( + 'objectsize' => 8, + 'headerobjects' => 4, + 'reserved1' => 1, + 'reserved2' => 1 + ) + ); + + $asf_header_data = fread($getid3->fp, $info_asf_header_object['objectsize'] - 30); + $offset = 0; + + for ($header_objects_counter = 0; $header_objects_counter < $info_asf_header_object['headerobjects']; $header_objects_counter++) { + + $next_object_guid = substr($asf_header_data, $offset, 16); + $offset += 16; + + $next_object_size = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 8)); + $offset += 8; + + $next_object_guidtext = getid3_asf::BytestringToGUID($next_object_guid); + + switch ($next_object_guidtext) { + + case getid3_asf::File_Properties_Object: + + // File Properties Object: (mandatory, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for file properties object - getid3_asf::File_Properties_Object + // Object Size QWORD 64 // size of file properties object, including 104 bytes of File Properties Object header + // File ID GUID 128 // unique ID - identical to File ID in Data Object + // File Size QWORD 64 // entire file in bytes. Invalid if Broadcast Flag == 1 + // Creation Date QWORD 64 // date & time of file creation. Maybe invalid if Broadcast Flag == 1 + // Data Packets Count QWORD 64 // number of data packets in Data Object. Invalid if Broadcast Flag == 1 + // Play Duration QWORD 64 // playtime, in 100-nanosecond units. Invalid if Broadcast Flag == 1 + // Send Duration QWORD 64 // time needed to send file, in 100-nanosecond units. Players can ignore this value. Invalid if Broadcast Flag == 1 + // Preroll QWORD 64 // time to buffer data before starting to play file, in 1-millisecond units. If <> 0, PlayDuration and PresentationTime have been offset by this amount + // Flags DWORD 32 // + // * Broadcast Flag bits 1 (0x01) // file is currently being written, some header values are invalid + // * Seekable Flag bits 1 (0x02) // is file seekable + // * Reserved bits 30 (0xFFFFFFFC) // reserved - set to zero + // Minimum Data Packet Size DWORD 32 // in bytes. should be same as Maximum Data Packet Size. Invalid if Broadcast Flag == 1 + // Maximum Data Packet Size DWORD 32 // in bytes. should be same as Minimum Data Packet Size. Invalid if Broadcast Flag == 1 + // Maximum Bitrate DWORD 32 // maximum instantaneous bitrate in bits per second for entire file, including all data streams and ASF overhead + + $info_asf['file_properties_object'] = array (); + $info_asf_file_properties_object = &$info_asf['file_properties_object']; + + $info_asf_file_properties_object['objectid_guid'] = $next_object_guidtext; + $info_asf_file_properties_object['objectsize'] = $next_object_size; + + $info_asf_file_properties_object['fileid_guid'] = getid3_asf::BytestringToGUID(substr($asf_header_data, $offset, 16)); + $offset += 16; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_file_properties_object, $asf_header_data, $offset, + array ( + 'filesize' => 8, + 'creation_date' => 8, + 'data_packets' => 8, + 'play_duration' => 8, + 'send_duration' => 8, + 'preroll' => 8, + 'flags_raw' => 4, + 'min_packet_size' => 4, + 'max_packet_size' => 4, + 'max_bitrate' => 4 + ) + ); + + $offset += 64 ; + + $info_asf_file_properties_object['creation_date_unix'] = getid3_asf::FiletimeToUNIXtime($info_asf_file_properties_object['creation_date']); + $info_asf_file_properties_object['flags']['broadcast'] = (bool)($info_asf_file_properties_object['flags_raw'] & 0x0001); + $info_asf_file_properties_object['flags']['seekable'] = (bool)($info_asf_file_properties_object['flags_raw'] & 0x0002); + + $getid3->info['playtime_seconds'] = ($info_asf_file_properties_object['play_duration'] / 10000000) - ($info_asf_file_properties_object['preroll'] / 1000); + $getid3->info['bitrate'] = ($info_asf_file_properties_object['filesize'] * 8) / $getid3->info['playtime_seconds']; + break; + + + case getid3_asf::Stream_Properties_Object: + + // Stream Properties Object: (mandatory, one per media stream) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for stream properties object - getid3_asf::Stream_Properties_Object + // Object Size QWORD 64 // size of stream properties object, including 78 bytes of Stream Properties Object header + // Stream Type GUID 128 // getid3_asf::Audio_Media, getid3_asf::Video_Media or getid3_asf::Command_Media + // Error Correction Type GUID 128 // getid3_asf::Audio_Spread for audio-only streams, getid3_asf::No_Error_Correction for other stream types + // Time Offset QWORD 64 // 100-nanosecond units. typically zero. added to all timestamps of samples in the stream + // Type-Specific Data Length DWORD 32 // number of bytes for Type-Specific Data field + // Error Correction Data Length DWORD 32 // number of bytes for Error Correction Data field + // Flags WORD 16 // + // * Stream Number bits 7 (0x007F) // number of this stream. 1 <= valid <= 127 + // * Reserved bits 8 (0x7F80) // reserved - set to zero + // * Encrypted Content Flag bits 1 (0x8000) // stream contents encrypted if set + // Reserved DWORD 32 // reserved - set to zero + // Type-Specific Data BYTESTREAM variable // type-specific format data, depending on value of Stream Type + // Error Correction Data BYTESTREAM variable // error-correction-specific format data, depending on value of Error Correct Type + + // There is one getid3_asf::Stream_Properties_Object for each stream (audio, video) but the + // stream number isn't known until halfway through decoding the structure, hence it + // it is decoded to a temporary variable and then stuck in the appropriate index later + + $stream_properties_object_data['objectid_guid'] = $next_object_guidtext; + $stream_properties_object_data['objectsize'] = $next_object_size; + + getid3_lib::ReadSequence('LittleEndian2Int', $stream_properties_object_data, $asf_header_data, $offset, + array ( + 'stream_type' => -16, + 'error_correct_type' => -16, + 'time_offset' => 8, + 'type_data_length' => 4, + 'error_data_length' => 4, + 'flags_raw' => 2 + ) + ); + + $stream_properties_stream_number = $stream_properties_object_data['flags_raw'] & 0x007F; + $stream_properties_object_data['flags']['encrypted'] = (bool)($stream_properties_object_data['flags_raw'] & 0x8000); + + $stream_properties_object_data['stream_type_guid'] = getid3_asf::BytestringToGUID($stream_properties_object_data['stream_type']); + $stream_properties_object_data['error_correct_guid'] = getid3_asf::BytestringToGUID($stream_properties_object_data['error_correct_type']); + + $offset += 54; // 50 bytes + 4 bytes reserved - DWORD + + $stream_properties_object_data['type_specific_data'] = substr($asf_header_data, $offset, $stream_properties_object_data['type_data_length']); + $offset += $stream_properties_object_data['type_data_length']; + + $stream_properties_object_data['error_correct_data'] = substr($asf_header_data, $offset, $stream_properties_object_data['error_data_length']); + $offset += $stream_properties_object_data['error_data_length']; + + switch ($stream_properties_object_data['stream_type_guid']) { + + case getid3_asf::Audio_Media: + + $info_audio['dataformat'] = (@$info_audio['dataformat'] ? $info_audio['dataformat'] : 'asf'); + $info_audio['bitrate_mode'] = (@$info_audio['bitrate_mode'] ? $info_audio['bitrate_mode'] : 'cbr'); + + $audiodata = getid3_riff::RIFFparseWAVEFORMATex(substr($stream_properties_object_data['type_specific_data'], 0, 16)); + unset($audiodata['raw']); + $info_audio = getid3_riff::array_merge_noclobber($audiodata, $info_audio); + break; + + + case getid3_asf::Video_Media: + + $info_video['dataformat'] = (@$info_video['dataformat'] ? $info_video['dataformat'] : 'asf'); + $info_video['bitrate_mode'] = (@$info_video['bitrate_mode'] ? $info_video['bitrate_mode'] : 'cbr'); + break; + + + /* does nothing but eat memory + case getid3_asf::Command_Media: + default: + // do nothing + break; + */ + } + + $info_asf['stream_properties_object'][$stream_properties_stream_number] = $stream_properties_object_data; + unset($stream_properties_object_data); // clear for next stream, if any + break; + + + case getid3_asf::Header_Extension_Object: + + // Header Extension Object: (mandatory, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Header Extension object - getid3_asf::Header_Extension_Object + // Object Size QWORD 64 // size of Header Extension object, including 46 bytes of Header Extension Object header + // Reserved Field 1 GUID 128 // hardcoded: getid3_asf::Reserved_1 + // Reserved Field 2 WORD 16 // hardcoded: 0x00000006 + // Header Extension Data Size DWORD 32 // in bytes. valid: 0, or > 24. equals object size minus 46 + // Header Extension Data BYTESTREAM variable // array of zero or more extended header objects + + $info_asf['header_extension_object'] = array (); + $info_asf_header_extension_object = &$info_asf['header_extension_object']; + + $info_asf_header_extension_object['objectid_guid'] = $next_object_guidtext; + $info_asf_header_extension_object['objectsize'] = $next_object_size; + $info_asf_header_extension_object['reserved_1_guid'] = getid3_asf::BytestringToGUID(substr($asf_header_data, $offset, 16)); + $offset += 16; + + if ($info_asf_header_extension_object['reserved_1_guid'] != getid3_asf::Reserved_1) { + $getid3->warning('header_extension_object.reserved_1 GUID ('.$info_asf_header_extension_object['reserved_1_guid'].') does not match expected "getid3_asf::Reserved_1" GUID ('.getid3_asf::Reserved_1.')'); + break; + } + + $info_asf_header_extension_object['reserved_2'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + if ($info_asf_header_extension_object['reserved_2'] != 6) { + $getid3->warning('header_extension_object.reserved_2 ('.getid3_lib::PrintHexBytes($info_asf_header_extension_object['reserved_2']).') does not match expected value of "6"'); + break; + } + + $info_asf_header_extension_object['extension_data_size'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 4)); + $offset += 4; + + $info_asf_header_extension_object['extension_data'] = substr($asf_header_data, $offset, $info_asf_header_extension_object['extension_data_size']); + $offset += $info_asf_header_extension_object['extension_data_size']; + break; + + + case getid3_asf::Codec_List_Object: + + // Codec List Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Codec List object - getid3_asf::Codec_List_Object + // Object Size QWORD 64 // size of Codec List object, including 44 bytes of Codec List Object header + // Reserved GUID 128 // hardcoded: 86D15241-311D-11D0-A3A4-00A0C90348F6 + // Codec Entries Count DWORD 32 // number of entries in Codec Entries array + // Codec Entries array of: variable // + // * Type WORD 16 // 0x0001 = Video Codec, 0x0002 = Audio Codec, 0xFFFF = Unknown Codec + // * Codec Name Length WORD 16 // number of Unicode characters stored in the Codec Name field + // * Codec Name WCHAR variable // array of Unicode characters - name of codec used to create the content + // * Codec Description Length WORD 16 // number of Unicode characters stored in the Codec Description field + // * Codec Description WCHAR variable // array of Unicode characters - description of format used to create the content + // * Codec Information Length WORD 16 // number of Unicode characters stored in the Codec Information field + // * Codec Information BYTESTREAM variable // opaque array of information bytes about the codec used to create the content + + $info_asf['codec_list_object'] = array (); + $info_asf_codec_list_object = &$info_asf['codec_list_object']; + + $info_asf_codec_list_object['objectid_guid'] = $next_object_guidtext; + $info_asf_codec_list_object['objectsize'] = $next_object_size; + + $info_asf_codec_list_object['reserved_guid'] = getid3_asf::BytestringToGUID(substr($asf_header_data, $offset, 16)); + $offset += 16; + + if ($info_asf_codec_list_object['reserved_guid'] != '86D15241-311D-11D0-A3A4-00A0C90348F6') { + $getid3->warning('codec_list_object.reserved GUID {'.$info_asf_codec_list_object['reserved_guid'].'} does not match expected "getid3_asf::Reserved_1" GUID {86D15241-311D-11D0-A3A4-00A0C90348F6}'); + break; + } + + $info_asf_codec_list_object['codec_entries_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 4)); + $offset += 4; + + for ($codec_entry_counter = 0; $codec_entry_counter < $info_asf_codec_list_object['codec_entries_count']; $codec_entry_counter++) { + + $info_asf_codec_list_object['codec_entries'][$codec_entry_counter] = array (); + $info_asf_codec_list_object_codecentries_current = &$info_asf_codec_list_object['codec_entries'][$codec_entry_counter]; + + $info_asf_codec_list_object_codecentries_current['type_raw'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_codec_list_object_codecentries_current['type'] = getid3_asf::ASFCodecListObjectTypeLookup($info_asf_codec_list_object_codecentries_current['type_raw']); + + $codec_name_length = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)) * 2; // 2 bytes per character + $offset += 2; + + $info_asf_codec_list_object_codecentries_current['name'] = substr($asf_header_data, $offset, $codec_name_length); + $offset += $codec_name_length; + + $codec_description_length = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)) * 2; // 2 bytes per character + $offset += 2; + + $info_asf_codec_list_object_codecentries_current['description'] = substr($asf_header_data, $offset, $codec_description_length); + $offset += $codec_description_length; + + $codec_information_length = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_codec_list_object_codecentries_current['information'] = substr($asf_header_data, $offset, $codec_information_length); + $offset += $codec_information_length; + + if ($info_asf_codec_list_object_codecentries_current['type_raw'] == 2) { + + // audio codec + if (strpos($info_asf_codec_list_object_codecentries_current['description'], ',') === false) { + throw new getid3_exception('[asf][codec_list_object][codec_entries]['.$codec_entry_counter.'][description] expected to contain comma-seperated list of parameters: "'.$info_asf_codec_list_object_codecentries_current['description'].'"'); + } + list($audio_codec_bitrate, $audio_codec_frequency, $audio_codec_channels) = explode(',', $this->TrimConvert($info_asf_codec_list_object_codecentries_current['description'])); + $info_audio['codec'] = $this->TrimConvert($info_asf_codec_list_object_codecentries_current['name']); + + if (!isset($info_audio['bitrate']) && strstr($audio_codec_bitrate, 'kbps')) { + $info_audio['bitrate'] = (int)(trim(str_replace('kbps', '', $audio_codec_bitrate)) * 1000); + } + + if (!isset($info_video['bitrate']) && isset($info_audio['bitrate']) && isset($info_asf['file_properties_object']['max_bitrate']) && ($info_asf_codec_list_object['codec_entries_count'] > 1)) { + $info_video['bitrate'] = $info_asf['file_properties_object']['max_bitrate'] - $info_audio['bitrate']; + } + + if (!@$info_video['bitrate'] && @$info_audio['bitrate'] && @$getid3->info['bitrate']) { + $info_video['bitrate'] = $getid3->info['bitrate'] - $info_audio['bitrate']; + } + + $audio_codec_frequency = (int)trim(str_replace('kHz', '', $audio_codec_frequency)); + + static $sample_rate_lookup = array ( + 8 => 8000, 8000 => 8000, + 11 => 11025, 11025 => 11025, + 12 => 12000, 12000 => 12000, + 16 => 16000, 16000 => 16000, + 22 => 22050, 22050 => 22050, + 24 => 24000, 24000 => 24000, + 32 => 32000, 32000 => 32000, + 44 => 44100, 44100 => 44100, + 48 => 48000, 48000 => 48000, + ); + + $info_audio['sample_rate'] = @$sample_rate_lookup[$audio_codec_frequency]; + + if (!$info_audio['sample_rate']) { + $getid3->warning('unknown frequency: "'.$audio_codec_frequency.'" ('.$this->TrimConvert($info_asf_codec_list_object_codecentries_current['description']).')'); + break; + } + + if (!isset($info_audio['channels'])) { + if (strstr($audio_codec_channels, 'stereo')) { + $info_audio['channels'] = 2; + } elseif (strstr($audio_codec_channels, 'mono')) { + $info_audio['channels'] = 1; + } + } + } + } + break; + + + case getid3_asf::Script_Command_Object: + + // Script Command Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Script Command object - getid3_asf::Script_Command_Object + // Object Size QWORD 64 // size of Script Command object, including 44 bytes of Script Command Object header + // Reserved GUID 128 // hardcoded: 4B1ACBE3-100B-11D0-A39B-00A0C90348F6 + // Commands Count WORD 16 // number of Commands structures in the Script Commands Objects + // Command Types Count WORD 16 // number of Command Types structures in the Script Commands Objects + // Command Types array of: variable // + // * Command Type Name Length WORD 16 // number of Unicode characters for Command Type Name + // * Command Type Name WCHAR variable // array of Unicode characters - name of a type of command + // Commands array of: variable // + // * Presentation Time DWORD 32 // presentation time of that command, in milliseconds + // * Type Index WORD 16 // type of this command, as a zero-based index into the array of Command Types of this object + // * Command Name Length WORD 16 // number of Unicode characters for Command Name + // * Command Name WCHAR variable // array of Unicode characters - name of this command + + // shortcut + $info_asf['script_command_object'] = array (); + $info_asf_script_command_object = &$info_asf['script_command_object']; + + $info_asf_script_command_object['objectid_guid'] = $next_object_guidtext; + $info_asf_script_command_object['objectsize'] = $next_object_size; + $info_asf_script_command_object['reserved_guid'] = getid3_asf::BytestringToGUID(substr($asf_header_data, $offset, 16)); + $offset += 16; + + if ($info_asf_script_command_object['reserved_guid'] != '4B1ACBE3-100B-11D0-A39B-00A0C90348F6') { + $getid3->warning('script_command_object.reserved GUID {'.$info_asf_script_command_object['reserved_guid'].'} does not match expected GUID {4B1ACBE3-100B-11D0-A39B-00A0C90348F6}'); + break; + } + + $info_asf_script_command_object['commands_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_script_command_object['command_types_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + for ($command_types_counter = 0; $command_types_counter < $info_asf_script_command_object['command_types_count']; $command_types_counter++) { + + $command_type_name_length = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)) * 2; // 2 bytes per character + $offset += 2; + + $info_asf_script_command_object['command_types'][$command_types_counter]['name'] = substr($asf_header_data, $offset, $command_type_name_length); + $offset += $command_type_name_length; + } + + for ($commands_counter = 0; $commands_counter < $info_asf_script_command_object['commands_count']; $commands_counter++) { + + $info_asf_script_command_object['commands'][$commands_counter]['presentation_time'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 4)); + $offset += 4; + + $info_asf_script_command_object['commands'][$commands_counter]['type_index'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $command_type_name_length = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)) * 2; // 2 bytes per character + $offset += 2; + + $info_asf_script_command_object['commands'][$commands_counter]['name'] = substr($asf_header_data, $offset, $command_type_name_length); + $offset += $command_type_name_length; + } + break; + + + case getid3_asf::Marker_Object: + + // Marker Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Marker object - getid3_asf::Marker_Object + // Object Size QWORD 64 // size of Marker object, including 48 bytes of Marker Object header + // Reserved GUID 128 // hardcoded: 4CFEDB20-75F6-11CF-9C0F-00A0C90349CB + // Markers Count DWORD 32 // number of Marker structures in Marker Object + // Reserved WORD 16 // hardcoded: 0x0000 + // Name Length WORD 16 // number of bytes in the Name field + // Name WCHAR variable // name of the Marker Object + // Markers array of: variable // + // * Offset QWORD 64 // byte offset into Data Object + // * Presentation Time QWORD 64 // in 100-nanosecond units + // * Entry Length WORD 16 // length in bytes of (Send Time + Flags + Marker Description Length + Marker Description + Padding) + // * Send Time DWORD 32 // in milliseconds + // * Flags DWORD 32 // hardcoded: 0x00000000 + // * Marker Description Length DWORD 32 // number of bytes in Marker Description field + // * Marker Description WCHAR variable // array of Unicode characters - description of marker entry + // * Padding BYTESTREAM variable // optional padding bytes + + $info_asf['marker_object'] = array (); + $info_asf_marker_object = &$info_asf['marker_object']; + + $info_asf_marker_object['objectid_guid'] = $next_object_guidtext; + $info_asf_marker_object['objectsize'] = $next_object_size; + $info_asf_marker_object['reserved_guid'] = getid3_asf::BytestringToGUID(substr($asf_header_data, $offset, 16)); + $offset += 16; + + if ($info_asf_marker_object['reserved_guid'] != '4CFEDB20-75F6-11CF-9C0F-00A0C90349CB') { + $getid3->warning('marker_object.reserved GUID {'.$info_asf_marker_object['reserved_guid'].'} does not match expected GUID {4CFEDB20-75F6-11CF-9C0F-00A0C90349CB}'); + break; + } + + $info_asf_marker_object['markers_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 4)); + $offset += 4; + + $info_asf_marker_object['reserved_2'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + if ($info_asf_marker_object['reserved_2'] != 0) { + $getid3->warning('marker_object.reserved_2 ('.getid3_lib::PrintHexBytes($info_asf_marker_object['reserved_2']).') does not match expected value of "0"'); + break; + } + + $info_asf_marker_object['name_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_marker_object['name'] = substr($asf_header_data, $offset, $info_asf_marker_object['name_length']); + $offset += $info_asf_marker_object['name_length']; + + for ($markers_counter = 0; $markers_counter < $info_asf_marker_object['markers_count']; $markers_counter++) { + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_marker_object['markers'][$markers_counter], $asf_header_data, $offset, + array ( + 'offset' => 8, + 'presentation_time' => 8, + 'entry_length' => 2, + 'send_time' => 4, + 'flags' => 4, + 'marker_description_length' => 4 + ) + ); + $offset += 30; + + $info_asf_marker_object['markers'][$markers_counter]['marker_description'] = substr($asf_header_data, $offset, $info_asf_marker_object['markers'][$markers_counter]['marker_description_length']); + $offset += $info_asf_marker_object['markers'][$markers_counter]['marker_description_length']; + + $padding_length = $info_asf_marker_object['markers'][$markers_counter]['entry_length'] - 4 - 4 - 4 - $info_asf_marker_object['markers'][$markers_counter]['marker_description_length']; + if ($padding_length > 0) { + $info_asf_marker_object['markers'][$markers_counter]['padding'] = substr($asf_header_data, $offset, $padding_length); + $offset += $padding_length; + } + } + break; + + + case getid3_asf::Bitrate_Mutual_Exclusion_Object: + + // Bitrate Mutual Exclusion Object: (optional) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Bitrate Mutual Exclusion object - getid3_asf::Bitrate_Mutual_Exclusion_Object + // Object Size QWORD 64 // size of Bitrate Mutual Exclusion object, including 42 bytes of Bitrate Mutual Exclusion Object header + // Exlusion Type GUID 128 // nature of mutual exclusion relationship. one of: (getid3_asf::Mutex_Bitrate, getid3_asf::Mutex_Unknown) + // Stream Numbers Count WORD 16 // number of video streams + // Stream Numbers WORD variable // array of mutually exclusive video stream numbers. 1 <= valid <= 127 + + // shortcut + $info_asf['bitrate_mutual_exclusion_object'] = array (); + $info_asf_bitrate_mutual_exclusion_object = &$info_asf['bitrate_mutual_exclusion_object']; + + $info_asf_bitrate_mutual_exclusion_object['objectid_guid'] = $next_object_guidtext; + $info_asf_bitrate_mutual_exclusion_object['objectsize'] = $next_object_size; + $info_asf_bitrate_mutual_exclusion_object['reserved_guid'] = getid3_asf::BytestringToGUID(substr($asf_header_data, $offset, 16)); + $offset += 16; + + if ($info_asf_bitrate_mutual_exclusion_object['reserved_guid'] != getid3_asf::Mutex_Bitrate && $info_asf_bitrate_mutual_exclusion_object['reserved_guid'] != getid3_asf::Mutex_Unknown) { + $getid3->warning('bitrate_mutual_exclusion_object.reserved GUID {'.$info_asf_bitrate_mutual_exclusion_object['reserved_guid'].'} does not match expected "getid3_asf::Mutex_Bitrate" GUID {'.getid3_asf::Mutex_Bitrate.'} or "getid3_asf::Mutex_Unknown" GUID {'.getid3_asf::Mutex_Unknown.'}'); + break; + } + + $info_asf_bitrate_mutual_exclusion_object['stream_numbers_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + for ($stream_number_counter = 0; $stream_number_counter < $info_asf_bitrate_mutual_exclusion_object['stream_numbers_count']; $stream_number_counter++) { + $info_asf_bitrate_mutual_exclusion_object['stream_numbers'][$stream_number_counter] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + } + break; + + + case getid3_asf::Error_Correction_Object: + + // Error Correction Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Error Correction object - getid3_asf::Error_Correction_Object + // Object Size QWORD 64 // size of Error Correction object, including 44 bytes of Error Correction Object header + // Error Correction Type GUID 128 // type of error correction. one of: (getid3_asf::No_Error_Correction, getid3_asf::Audio_Spread) + // Error Correction Data Length DWORD 32 // number of bytes in Error Correction Data field + // Error Correction Data BYTESTREAM variable // structure depends on value of Error Correction Type field + + $info_asf['error_correction_object'] = array (); + $info_asf_error_correction_object = &$info_asf['error_correction_object']; + + $info_asf_error_correction_object['objectid_guid'] = $next_object_guidtext; + $info_asf_error_correction_object['objectsize'] = $next_object_size; + $info_asf_error_correction_object['error_correction_type'] = substr($asf_header_data, $offset, 16); + $offset += 16; + + $info_asf_error_correction_object['error_correction_guid'] = getid3_asf::BytestringToGUID($info_asf_error_correction_object['error_correction_type']); + $info_asf_error_correction_object['error_correction_data_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 4)); + $offset += 4; + + switch ($info_asf_error_correction_object['error_correction_type_guid']) { + + case getid3_asf::No_Error_Correction: + + // should be no data, but just in case there is, skip to the end of the field + $offset += $info_asf_error_correction_object['error_correction_data_length']; + break; + + + case getid3_asf::Audio_Spread: + + // Field Name Field Type Size (bits) + // Span BYTE 8 // number of packets over which audio will be spread. + // Virtual Packet Length WORD 16 // size of largest audio payload found in audio stream + // Virtual Chunk Length WORD 16 // size of largest audio payload found in audio stream + // Silence Data Length WORD 16 // number of bytes in Silence Data field + // Silence Data BYTESTREAM variable // hardcoded: 0x00 * (Silence Data Length) bytes + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_error_correction_object, $asf_header_data, $offset, + array ( + 'span' => 1, + 'virtual_packet_length' => 2, + 'virtual_chunk_length' => 2, + 'silence_data_length' => 2 + ) + ); + $offset += 7; + + $info_asf_error_correction_object['silence_data'] = substr($asf_header_data, $offset, $info_asf_error_correction_object['silence_data_length']); + $offset += $info_asf_error_correction_object['silence_data_length']; + break; + + default: + $getid3->warning('error_correction_object.error_correction_type GUID {'.$info_asf_error_correction_object['reserved_guid'].'} does not match expected "getid3_asf::No_Error_Correction" GUID {'.getid3_asf::No_Error_Correction.'} or "getid3_asf::Audio_Spread" GUID {'.getid3_asf::Audio_Spread.'}'); + break; + } + + break; + + + case getid3_asf::Content_Description_Object: + + // Content Description Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Content Description object - getid3_asf::Content_Description_Object + // Object Size QWORD 64 // size of Content Description object, including 34 bytes of Content Description Object header + // Title Length WORD 16 // number of bytes in Title field + // Author Length WORD 16 // number of bytes in Author field + // Copyright Length WORD 16 // number of bytes in Copyright field + // Description Length WORD 16 // number of bytes in Description field + // Rating Length WORD 16 // number of bytes in Rating field + // Title WCHAR 16 // array of Unicode characters - Title + // Author WCHAR 16 // array of Unicode characters - Author + // Copyright WCHAR 16 // array of Unicode characters - Copyright + // Description WCHAR 16 // array of Unicode characters - Description + // Rating WCHAR 16 // array of Unicode characters - Rating + + $info_asf['content_description_object'] = array (); + $info_asf_content_description_object = &$info_asf['content_description_object']; + + $info_asf_content_description_object['objectid_guid'] = $next_object_guidtext; + $info_asf_content_description_object['objectsize'] = $next_object_size; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_content_description_object, $asf_header_data, $offset, + array ( + 'title_length' => 2, + 'author_length' => 2, + 'copyright_length' => 2, + 'description_length' => 2, + 'rating_length' => 2 + ) + ); + $offset += 10; + + $info_asf_content_description_object['title'] = substr($asf_header_data, $offset, $info_asf_content_description_object['title_length']); + $offset += $info_asf_content_description_object['title_length']; + + $info_asf_content_description_object['author'] = substr($asf_header_data, $offset, $info_asf_content_description_object['author_length']); + $offset += $info_asf_content_description_object['author_length']; + + $info_asf_content_description_object['copyright'] = substr($asf_header_data, $offset, $info_asf_content_description_object['copyright_length']); + $offset += $info_asf_content_description_object['copyright_length']; + + $info_asf_content_description_object['description'] = substr($asf_header_data, $offset, $info_asf_content_description_object['description_length']); + $offset += $info_asf_content_description_object['description_length']; + + $info_asf_content_description_object['rating'] = substr($asf_header_data, $offset, $info_asf_content_description_object['rating_length']); + $offset += $info_asf_content_description_object['rating_length']; + + foreach (array ('title'=>'title', 'author'=>'artist', 'copyright'=>'copyright', 'description'=>'comment', 'rating'=>'rating') as $key_to_copy_from => $key_to_copy_to) { + if (!empty($info_asf_content_description_object[$key_to_copy_from])) { + $info_asf_comments[$key_to_copy_to][] = getid3_asf::TrimTerm($info_asf_content_description_object[$key_to_copy_from]); + } + } + break; + + + case getid3_asf::Extended_Content_Description_Object: + + // Extended Content Description Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Extended Content Description object - getid3_asf::Extended_Content_Description_Object + // Object Size QWORD 64 // size of ExtendedContent Description object, including 26 bytes of Extended Content Description Object header + // Content Descriptors Count WORD 16 // number of entries in Content Descriptors list + // Content Descriptors array of: variable // + // * Descriptor Name Length WORD 16 // size in bytes of Descriptor Name field + // * Descriptor Name WCHAR variable // array of Unicode characters - Descriptor Name + // * Descriptor Value Data Type WORD 16 // Lookup array: + // 0x0000 = Unicode String (variable length) + // 0x0001 = BYTE array (variable length) + // 0x0002 = BOOL (DWORD, 32 bits) + // 0x0003 = DWORD (DWORD, 32 bits) + // 0x0004 = QWORD (QWORD, 64 bits) + // 0x0005 = WORD (WORD, 16 bits) + // * Descriptor Value Length WORD 16 // number of bytes stored in Descriptor Value field + // * Descriptor Value variable variable // value for Content Descriptor + + $info_asf['extended_content_description_object'] = array (); + $info_asf_extended_content_description_object = &$info_asf['extended_content_description_object']; + + $info_asf_extended_content_description_object['objectid_guid'] = $next_object_guidtext; + $info_asf_extended_content_description_object['objectsize'] = $next_object_size; + $info_asf_extended_content_description_object['content_descriptors_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + for ($extended_content_descriptors_counter = 0; $extended_content_descriptors_counter < $info_asf_extended_content_description_object['content_descriptors_count']; $extended_content_descriptors_counter++) { + + $info_asf_extended_content_description_object['content_descriptors'][$extended_content_descriptors_counter] = array (); + $info_asf_extended_content_description_object_content_descriptor_current = &$info_asf_extended_content_description_object['content_descriptors'][$extended_content_descriptors_counter]; + + $info_asf_extended_content_description_object_content_descriptor_current['base_offset'] = $offset + 30; + $info_asf_extended_content_description_object_content_descriptor_current['name_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_extended_content_description_object_content_descriptor_current['name'] = substr($asf_header_data, $offset, $info_asf_extended_content_description_object_content_descriptor_current['name_length']); + $offset += $info_asf_extended_content_description_object_content_descriptor_current['name_length']; + + $info_asf_extended_content_description_object_content_descriptor_current['value_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_extended_content_description_object_content_descriptor_current['value_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_extended_content_description_object_content_descriptor_current['value'] = substr($asf_header_data, $offset, $info_asf_extended_content_description_object_content_descriptor_current['value_length']); + $offset += $info_asf_extended_content_description_object_content_descriptor_current['value_length']; + + switch ($info_asf_extended_content_description_object_content_descriptor_current['value_type']) { + + case 0x0000: // Unicode string + break; + + case 0x0001: // BYTE array + // do nothing + break; + + case 0x0002: // BOOL + $info_asf_extended_content_description_object_content_descriptor_current['value'] = (bool)getid3_lib::LittleEndian2Int($info_asf_extended_content_description_object_content_descriptor_current['value']); + break; + + case 0x0003: // DWORD + case 0x0004: // QWORD + case 0x0005: // WORD + $info_asf_extended_content_description_object_content_descriptor_current['value'] = getid3_lib::LittleEndian2Int($info_asf_extended_content_description_object_content_descriptor_current['value']); + break; + + default: + $getid3->warning('extended_content_description.content_descriptors.'.$extended_content_descriptors_counter.'.value_type is invalid ('.$info_asf_extended_content_description_object_content_descriptor_current['value_type'].')'); + break; + } + + switch ($this->TrimConvert(strtolower($info_asf_extended_content_description_object_content_descriptor_current['name']))) { + + case 'wm/albumartist': + case 'artist': + $info_asf_comments['artist'] = array (getid3_asf::TrimTerm($info_asf_extended_content_description_object_content_descriptor_current['value'])); + break; + + + case 'wm/albumtitle': + case 'album': + $info_asf_comments['album'] = array (getid3_asf::TrimTerm($info_asf_extended_content_description_object_content_descriptor_current['value'])); + break; + + + case 'wm/genre': + case 'genre': + $genre = getid3_asf::TrimTerm($info_asf_extended_content_description_object_content_descriptor_current['value']); + $info_asf_comments['genre'] = array ($genre); + break; + + + case 'wm/tracknumber': + case 'tracknumber': + $info_asf_comments['track'] = array (intval(getid3_asf::TrimTerm($info_asf_extended_content_description_object_content_descriptor_current['value']))); + break; + + + case 'wm/track': + if (empty($info_asf_comments['track'])) { + $info_asf_comments['track'] = array (1 + $this->TrimConvert($info_asf_extended_content_description_object_content_descriptor_current['value'])); + } + break; + + + case 'wm/year': + case 'year': + case 'date': + $info_asf_comments['year'] = array ( getid3_asf::TrimTerm($info_asf_extended_content_description_object_content_descriptor_current['value'])); + break; + + + case 'wm/lyrics': + case 'lyrics': + $info_asf_comments['lyrics'] = array ( getid3_asf::TrimTerm($info_asf_extended_content_description_object_content_descriptor_current['value'])); + break; + + + case 'isvbr': + if ($info_asf_extended_content_description_object_content_descriptor_current['value']) { + $info_audio['bitrate_mode'] = 'vbr'; + $info_video['bitrate_mode'] = 'vbr'; + } + break; + + + case 'id3': + + // id3v2 parsing might not be enabled + if (class_exists('getid3_id3v2')) { + + // Clone getid3 + $clone = clone $getid3; + + // Analyse clone by string + $id3v2 = new getid3_id3v2($clone); + $id3v2->AnalyzeString($info_asf_extended_content_description_object_content_descriptor_current['value']); + + // Import from clone and destroy + $getid3->info['id3v2'] = $clone->info['id3v2']; + $getid3->warnings($clone->warnings()); + unset($clone); + } + break; + + + case 'wm/encodingtime': + $info_asf_extended_content_description_object_content_descriptor_current['encoding_time_unix'] = getid3_asf::FiletimeToUNIXtime($info_asf_extended_content_description_object_content_descriptor_current['value']); + $info_asf_comments['encoding_time_unix'] = array ($info_asf_extended_content_description_object_content_descriptor_current['encoding_time_unix']); + break; + + + case 'wm/picture': + + //typedef struct _WMPicture{ + // LPWSTR pwszMIMEType; + // BYTE bPictureType; + // LPWSTR pwszDescription; + // DWORD dwDataLen; + // BYTE* pbData; + //} WM_PICTURE; + + $info_asf_extended_content_description_object_content_descriptor_current['image_type_id'] = getid3_lib::LittleEndian2Int($info_asf_extended_content_description_object_content_descriptor_current['value']{0}); + $info_asf_extended_content_description_object_content_descriptor_current['image_type'] = getid3_asf::WMpictureTypeLookup($info_asf_extended_content_description_object_content_descriptor_current['image_type_id']); + $info_asf_extended_content_description_object_content_descriptor_current['image_size'] = getid3_lib::LittleEndian2Int(substr($info_asf_extended_content_description_object_content_descriptor_current['value'], 1, 4)); + $info_asf_extended_content_description_object_content_descriptor_current['image_mime'] = ''; + + $wm_picture_offset = 5; + + do { + $next_byte_pair = substr($info_asf_extended_content_description_object_content_descriptor_current['value'], $wm_picture_offset, 2); + $wm_picture_offset += 2; + $info_asf_extended_content_description_object_content_descriptor_current['image_mime'] .= $next_byte_pair; + } while ($next_byte_pair !== "\x00\x00"); + + $info_asf_extended_content_description_object_content_descriptor_current['image_description'] = ''; + + do { + $next_byte_pair = substr($info_asf_extended_content_description_object_content_descriptor_current['value'], $wm_picture_offset, 2); + $wm_picture_offset += 2; + $info_asf_extended_content_description_object_content_descriptor_current['image_description'] .= $next_byte_pair; + } while ($next_byte_pair !== "\x00\x00"); + + $info_asf_extended_content_description_object_content_descriptor_current['dataoffset'] = $wm_picture_offset; + $info_asf_extended_content_description_object_content_descriptor_current['data'] = substr($info_asf_extended_content_description_object_content_descriptor_current['value'], $wm_picture_offset); + unset($info_asf_extended_content_description_object_content_descriptor_current['value']); + break; + + default: + switch ($info_asf_extended_content_description_object_content_descriptor_current['value_type']) { + case 0: // Unicode string + if (substr($this->TrimConvert($info_asf_extended_content_description_object_content_descriptor_current['name']), 0, 3) == 'WM/') { + $info_asf_comments[str_replace('wm/', '', strtolower($this->TrimConvert($info_asf_extended_content_description_object_content_descriptor_current['name'])))] = array (getid3_asf::TrimTerm($info_asf_extended_content_description_object_content_descriptor_current['value'])); + } + break; + + case 1: + break; + } + break; + } + + } + break; + + + case getid3_asf::Stream_Bitrate_Properties_Object: + + // Stream Bitrate Properties Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Stream Bitrate Properties object - getid3_asf::Stream_Bitrate_Properties_Object + // Object Size QWORD 64 // size of Extended Content Description object, including 26 bytes of Stream Bitrate Properties Object header + // Bitrate Records Count WORD 16 // number of records in Bitrate Records + // Bitrate Records array of: variable // + // * Flags WORD 16 // + // * * Stream Number bits 7 (0x007F) // number of this stream + // * * Reserved bits 9 (0xFF80) // hardcoded: 0 + // * Average Bitrate DWORD 32 // in bits per second + + // shortcut + $info_asf['stream_bitrate_properties_object'] = array (); + $info_asf_stream_bitrate_properties_object = &$info_asf['stream_bitrate_properties_object']; + + $info_asf_stream_bitrate_properties_object['objectid_guid'] = $next_object_guidtext; + $info_asf_stream_bitrate_properties_object['objectsize'] = $next_object_size; + $info_asf_stream_bitrate_properties_object['bitrate_records_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + for ($bitrate_records_counter = 0; $bitrate_records_counter < $info_asf_stream_bitrate_properties_object['bitrate_records_count']; $bitrate_records_counter++) { + + $info_asf_stream_bitrate_properties_object['bitrate_records'][$bitrate_records_counter]['flags_raw'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 2)); + $offset += 2; + + $info_asf_stream_bitrate_properties_object['bitrate_records'][$bitrate_records_counter]['flags']['stream_number'] = $info_asf_stream_bitrate_properties_object['bitrate_records'][$bitrate_records_counter]['flags_raw'] & 0x007F; + + $info_asf_stream_bitrate_properties_object['bitrate_records'][$bitrate_records_counter]['bitrate'] = getid3_lib::LittleEndian2Int(substr($asf_header_data, $offset, 4)); + $offset += 4; + } + break; + + + case getid3_asf::Padding_Object: + + // Padding Object: (optional) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Padding object - getid3_asf::Padding_Object + // Object Size QWORD 64 // size of Padding object, including 24 bytes of ASF Padding Object header + // Padding Data BYTESTREAM variable // ignore + + // shortcut + $info_asf['padding_object'] = array (); + $info_asf_paddingobject = &$info_asf['padding_object']; + + $info_asf_paddingobject['objectid_guid'] = $next_object_guidtext; + $info_asf_paddingobject['objectsize'] = $next_object_size; + $info_asf_paddingobject['padding_length'] = $info_asf_paddingobject['objectsize'] - 16 - 8; + $info_asf_paddingobject['padding'] = substr($asf_header_data, $offset, $info_asf_paddingobject['padding_length']); + $offset += ($next_object_size - 16 - 8); + break; + + + case getid3_asf::Extended_Content_Encryption_Object: + case getid3_asf::Content_Encryption_Object: + + // WMA DRM - just ignore + $offset += ($next_object_size - 16 - 8); + break; + + + default: + + // Implementations shall ignore any standard or non-standard object that they do not know how to handle. + if (getid3_asf::GUIDname($next_object_guidtext)) { + $getid3->warning('unhandled GUID "'.getid3_asf::GUIDname($next_object_guidtext).'" {'.$next_object_guidtext.'} in ASF header at offset '.($offset - 16 - 8)); + } else { + $getid3->warning('unknown GUID {'.$next_object_guidtext.'} in ASF header at offset '.($offset - 16 - 8)); + } + $offset += ($next_object_size - 16 - 8); + break; + } + } + + if (isset($info_asf_stream_bitrate_properties['bitrate_records_count'])) { + $asf_bitrate_audio = 0; + $asf_bitrate_video = 0; + + for ($bitrate_records_counter = 0; $bitrate_records_counter < $info_asf_stream_bitrate_properties['bitrate_records_count']; $bitrate_records_counter++) { + if (isset($info_asf_codec_list_object['codec_entries'][$bitrate_records_counter])) { + switch ($info_asf_codec_list_object['codec_entries'][$bitrate_records_counter]['type_raw']) { + + case 1: + $asf_bitrate_video += $info_asf_stream_bitrate_properties['bitrate_records'][$bitrate_records_counter]['bitrate']; + break; + + case 2: + $asf_bitrate_audio += $info_asf_stream_bitrate_properties['bitrate_records'][$bitrate_records_counter]['bitrate']; + break; + } + } + } + if ($asf_bitrate_audio > 0) { + $info_audio['bitrate'] = $asf_bitrate_audio; + } + if ($asf_bitrate_video > 0) { + $info_video['bitrate'] = $asf_bitrate_video; + } + } + + if (isset($info_asf['stream_properties_object']) && is_array($info_asf['stream_properties_object'])) { + + $info_audio['bitrate'] = 0; + $info_video['bitrate'] = 0; + + foreach ($info_asf['stream_properties_object'] as $stream_number => $stream_data) { + + switch ($stream_data['stream_type_guid']) { + + case getid3_asf::Audio_Media: + + // Field Name Field Type Size (bits) + // Codec ID / Format Tag WORD 16 // unique ID of audio codec - defined as wFormatTag field of WAVEFORMATEX structure + // Number of Channels WORD 16 // number of channels of audio - defined as nChannels field of WAVEFORMATEX structure + // Samples Per Second DWORD 32 // in Hertz - defined as nSamplesPerSec field of WAVEFORMATEX structure + // Average number of Bytes/sec DWORD 32 // bytes/sec of audio stream - defined as nAvgBytesPerSec field of WAVEFORMATEX structure + // Block Alignment WORD 16 // block size in bytes of audio codec - defined as nBlockAlign field of WAVEFORMATEX structure + // Bits per sample WORD 16 // bits per sample of mono data. set to zero for variable bitrate codecs. defined as wBitsPerSample field of WAVEFORMATEX structure + // Codec Specific Data Size WORD 16 // size in bytes of Codec Specific Data buffer - defined as cbSize field of WAVEFORMATEX structure + // Codec Specific Data BYTESTREAM variable // array of codec-specific data bytes + + // shortcut + $info_asf['audio_media'][$stream_number] = array (); + $info_asf_audio_media_current_stream = &$info_asf['audio_media'][$stream_number]; + + $audio_media_offset = 0; + + $info_asf_audio_media_current_stream = getid3_riff::RIFFparseWAVEFORMATex(substr($stream_data['type_specific_data'], $audio_media_offset, 16)); + + $audio_media_offset += 16; + + $info_audio['lossless'] = false; + switch ($info_asf_audio_media_current_stream['raw']['wFormatTag']) { + case 0x0001: // PCM + case 0x0163: // WMA9 Lossless + $info_audio['lossless'] = true; + break; + } + + if (!empty($info_asf['stream_bitrate_properties_object']['bitrate_records'])) { + foreach ($info_asf['stream_bitrate_properties_object']['bitrate_records'] as $data_array) { + if (@$data_array['flags']['stream_number'] == $stream_number) { + $info_asf_audio_media_current_stream['bitrate'] = $data_array['bitrate']; + $info_audio['bitrate'] += $data_array['bitrate']; + break; + } + } + } else { + if (@$info_asf_audio_media_current_stream['bytes_sec']) { + $info_audio['bitrate'] += $info_asf_audio_media_current_stream['bytes_sec'] * 8; + } elseif (@$info_asf_audio_media_current_stream['bitrate']) { + $info_audio['bitrate'] += $info_asf_audio_media_current_stream['bitrate']; + } + } + + $info_audio['streams'][$stream_number] = $info_asf_audio_media_current_stream; + $info_audio['streams'][$stream_number]['wformattag'] = $info_asf_audio_media_current_stream['raw']['wFormatTag']; + $info_audio['streams'][$stream_number]['lossless'] = $info_audio['lossless']; + $info_audio['streams'][$stream_number]['bitrate'] = $info_audio['bitrate']; + unset($info_audio['streams'][$stream_number]['raw']); + + $info_asf_audio_media_current_stream['codec_data_size'] = getid3_lib::LittleEndian2Int(substr($stream_data['type_specific_data'], $audio_media_offset, 2)); + $audio_media_offset += 2; + + $info_asf_audio_media_current_stream['codec_data'] = substr($stream_data['type_specific_data'], $audio_media_offset, $info_asf_audio_media_current_stream['codec_data_size']); + $audio_media_offset += $info_asf_audio_media_current_stream['codec_data_size']; + break; + + + case getid3_asf::Video_Media: + + // Field Name Field Type Size (bits) + // Encoded Image Width DWORD 32 // width of image in pixels + // Encoded Image Height DWORD 32 // height of image in pixels + // Reserved Flags BYTE 8 // hardcoded: 0x02 + // Format Data Size WORD 16 // size of Format Data field in bytes + // Format Data array of: variable // + // * Format Data Size DWORD 32 // number of bytes in Format Data field, in bytes - defined as biSize field of BITMAPINFOHEADER structure + // * Image Width LONG 32 // width of encoded image in pixels - defined as biWidth field of BITMAPINFOHEADER structure + // * Image Height LONG 32 // height of encoded image in pixels - defined as biHeight field of BITMAPINFOHEADER structure + // * Reserved WORD 16 // hardcoded: 0x0001 - defined as biPlanes field of BITMAPINFOHEADER structure + // * Bits Per Pixel Count WORD 16 // bits per pixel - defined as biBitCount field of BITMAPINFOHEADER structure + // * Compression ID FOURCC 32 // fourcc of video codec - defined as biCompression field of BITMAPINFOHEADER structure + // * Image Size DWORD 32 // image size in bytes - defined as biSizeImage field of BITMAPINFOHEADER structure + // * Horizontal Pixels / Meter DWORD 32 // horizontal resolution of target device in pixels per meter - defined as biXPelsPerMeter field of BITMAPINFOHEADER structure + // * Vertical Pixels / Meter DWORD 32 // vertical resolution of target device in pixels per meter - defined as biYPelsPerMeter field of BITMAPINFOHEADER structure + // * Colors Used Count DWORD 32 // number of color indexes in the color table that are actually used - defined as biClrUsed field of BITMAPINFOHEADER structure + // * Important Colors Count DWORD 32 // number of color index required for displaying bitmap. if zero, all colors are required. defined as biClrImportant field of BITMAPINFOHEADER structure + // * Codec Specific Data BYTESTREAM variable // array of codec-specific data bytes + + $info_asf['video_media'][$stream_number] = array (); + $info_asf_video_media_current_stream = &$info_asf['video_media'][$stream_number]; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_video_media_current_stream, $stream_data['type_specific_data'], 0, + array ( + 'image_width' => 4, + 'image_height' => 4, + 'flags' => 1, + 'format_data_size'=> 2 + ) + ); + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_video_media_current_stream['format_data'], $stream_data['type_specific_data'], 11, + array ( + 'format_data_size' => 4, + 'image_width' => 4, + 'image_height' => 4, + 'reserved' => 2, + 'bits_per_pixel' => 2, + 'codec_fourcc' => -4, + 'image_size' => 4, + 'horizontal_pels' => 4, + 'vertical_pels' => 4, + 'colors_used' => 4, + 'colors_important' => 4 + ) + ); + + $info_asf_video_media_current_stream['format_data']['codec_data'] = substr($stream_data['type_specific_data'], 51); + + if (!empty($info_asf['stream_bitrate_properties_object']['bitrate_records'])) { + foreach ($info_asf['stream_bitrate_properties_object']['bitrate_records'] as $data_array) { + if (@$data_array['flags']['stream_number'] == $stream_number) { + $info_asf_video_media_current_stream['bitrate'] = $data_array['bitrate']; + $info_video['streams'][$stream_number]['bitrate'] = $data_array['bitrate']; + $info_video['bitrate'] += $data_array['bitrate']; + + break; + } + } + } + + $info_asf_video_media_current_stream['format_data']['codec'] = getid3_riff::RIFFfourccLookup($info_asf_video_media_current_stream['format_data']['codec_fourcc']); + + $info_video['streams'][$stream_number]['fourcc'] = $info_asf_video_media_current_stream['format_data']['codec_fourcc']; + $info_video['streams'][$stream_number]['codec'] = $info_asf_video_media_current_stream['format_data']['codec']; + $info_video['streams'][$stream_number]['resolution_x'] = $info_asf_video_media_current_stream['image_width']; + $info_video['streams'][$stream_number]['resolution_y'] = $info_asf_video_media_current_stream['image_height']; + $info_video['streams'][$stream_number]['bits_per_sample'] = $info_asf_video_media_current_stream['format_data']['bits_per_pixel']; + break; + + default: + break; + } + } + } + + while (ftell($getid3->fp) < $getid3->info['avdataend']) { + + $next_object_data_header = fread($getid3->fp, 24); + $offset = 0; + + $next_object_guid = substr($next_object_data_header, 0, 16); + $offset += 16; + + $next_object_guidtext = getid3_asf::BytestringToGUID($next_object_guid); + $next_object_size = getid3_lib::LittleEndian2Int(substr($next_object_data_header, $offset, 8)); + $offset += 8; + + switch ($next_object_guidtext) { + + case getid3_asf::Data_Object: + + // Data Object: (mandatory, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Data object - getid3_asf::Data_Object + // Object Size QWORD 64 // size of Data object, including 50 bytes of Data Object header. may be 0 if FilePropertiesObject.BroadcastFlag == 1 + // File ID GUID 128 // unique identifier. identical to File ID field in Header Object + // Total Data Packets QWORD 64 // number of Data Packet entries in Data Object. invalid if FilePropertiesObject.BroadcastFlag == 1 + // Reserved WORD 16 // hardcoded: 0x0101 + + // shortcut + $info_asf['data_object'] = array (); + $info_asf_data_object = &$info_asf['data_object']; + + $data_object_data = $next_object_data_header.fread($getid3->fp, 50 - 24); + $offset = 24; + + $info_asf_data_object['objectid_guid'] = $next_object_guidtext; + $info_asf_data_object['objectsize'] = $next_object_size; + + $info_asf_data_object['fileid_guid'] = getid3_asf::BytestringToGUID(substr($data_object_data, $offset, 16)); + $offset += 16; + + $info_asf_data_object['total_data_packets'] = getid3_lib::LittleEndian2Int(substr($data_object_data, $offset, 8)); + $offset += 8; + + $info_asf_data_object['reserved'] = getid3_lib::LittleEndian2Int(substr($data_object_data, $offset, 2)); + $offset += 2; + + if ($info_asf_data_object['reserved'] != 0x0101) { + $getid3->warning('data_object.reserved ('.getid3_lib::PrintHexBytes($info_asf_data_object['reserved']).') does not match expected value of "0x0101"'); + break; + } + + // Data Packets array of: variable // + // * Error Correction Flags BYTE 8 // + // * * Error Correction Data Length bits 4 // if Error Correction Length Type == 00, size of Error Correction Data in bytes, else hardcoded: 0000 + // * * Opaque Data Present bits 1 // + // * * Error Correction Length Type bits 2 // number of bits for size of the error correction data. hardcoded: 00 + // * * Error Correction Present bits 1 // If set, use Opaque Data Packet structure, else use Payload structure + // * Error Correction Data + + $getid3->info['avdataoffset'] = ftell($getid3->fp); + fseek($getid3->fp, ($info_asf_data_object['objectsize'] - 50), SEEK_CUR); // skip actual audio/video data + $getid3->info['avdataend'] = ftell($getid3->fp); + break; + + + case getid3_asf::Simple_Index_Object: + + // Simple Index Object: (optional, recommended, one per video stream) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Simple Index object - getid3_asf::Data_Object + // Object Size QWORD 64 // size of Simple Index object, including 56 bytes of Simple Index Object header + // File ID GUID 128 // unique identifier. may be zero or identical to File ID field in Data Object and Header Object + // Index Entry Time Interval QWORD 64 // interval between index entries in 100-nanosecond units + // Maximum Packet Count DWORD 32 // maximum packet count for all index entries + // Index Entries Count DWORD 32 // number of Index Entries structures + // Index Entries array of: variable // + // * Packet Number DWORD 32 // number of the Data Packet associated with this index entry + // * Packet Count WORD 16 // number of Data Packets to sent at this index entry + + // shortcut + $info_asf['simple_index_object'] = array (); + $info_asf_simple_index_object = &$info_asf['simple_index_object']; + + $info_asf_simple_index_object['objectid_guid'] = $next_object_guidtext; + $info_asf_simple_index_object['objectsize'] = $next_object_size; + + $simple_index_object_data = $next_object_data_header.fread($getid3->fp, 56 - 24); + + $info_asf_simple_index_object['fileid_guid'] = getid3_asf::BytestringToGUID(substr($simple_index_object_data, 24, 16)); + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_simple_index_object, $simple_index_object_data, 40, + array ( + 'index_entry_time_interval' => 8, + 'maximum_packet_count' => 4, + 'index_entries_count' => 4 + ) + ); + + $offset = 56; + + $index_entries_data = $simple_index_object_data.fread($getid3->fp, 6 * $info_asf_simple_index_object['index_entries_count']); + for ($index_entries_counter = 0; $index_entries_counter < $info_asf_simple_index_object['index_entries_count']; $index_entries_counter++) { + + $info_asf_simple_index_object['index_entries'][$index_entries_counter]['packet_number'] = getid3_lib::LittleEndian2Int(substr($index_entries_data, $offset, 4)); + $offset += 4; + + $info_asf_simple_index_object['index_entries'][$index_entries_counter]['packet_count'] = getid3_lib::LittleEndian2Int(substr($index_entries_data, $offset, 4)); + $offset += 2; + } + break; + + + case getid3_asf::Index_Object: + + // 6.2 ASF top-level Index Object (optional but recommended when appropriate, 0 or 1) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for the Index Object - getid3_asf::Index_Object + // Object Size QWORD 64 // Specifies the size, in bytes, of the Index Object, including at least 34 bytes of Index Object header + // Index Entry Time Interval DWORD 32 // Specifies the time interval between each index entry in ms. + // Index Specifiers Count WORD 16 // Specifies the number of Index Specifiers structures in this Index Object. + // Index Blocks Count DWORD 32 // Specifies the number of Index Blocks structures in this Index Object. + + // Index Entry Time Interval DWORD 32 // Specifies the time interval between index entries in milliseconds. This value cannot be 0. + // Index Specifiers Count WORD 16 // Specifies the number of entries in the Index Specifiers list. Valid values are 1 and greater. + // Index Specifiers array of: varies // + // * Stream Number WORD 16 // Specifies the stream number that the Index Specifiers refer to. Valid values are between 1 and 127. + // * Index Type WORD 16 // Specifies Index Type values as follows: + // 1 = Nearest Past Data Packet - indexes point to the data packet whose presentation time is closest to the index entry time. + // 2 = Nearest Past Media Object - indexes point to the closest data packet containing an entire object or first fragment of an object. + // 3 = Nearest Past Cleanpoint. - indexes point to the closest data packet containing an entire object (or first fragment of an object) that has the Cleanpoint Flag set. + // Nearest Past Cleanpoint is the most common type of index. + // Index Entry Count DWORD 32 // Specifies the number of Index Entries in the block. + // * Block Positions QWORD varies // Specifies a list of byte offsets of the beginnings of the blocks relative to the beginning of the first Data Packet (i.e., the beginning of the Data Object + 50 bytes). The number of entries in this list is specified by the value of the Index Specifiers Count field. The order of those byte offsets is tied to the order in which Index Specifiers are listed. + // * Index Entries array of: varies // + // * * Offsets DWORD varies // An offset value of 0xffffffff indicates an invalid offset value + + // shortcut + $info_asf['asf_index_object'] = array (); + $info_asf_asf_index_object = &$info_asf['asf_index_object']; + + $asf_index_object_data = $next_object_data_header.fread($getid3->fp, 34 - 24); + + $info_asf_asf_index_object['objectid_guid'] = $next_object_guidtext; + $info_asf_asf_index_object['objectsize'] = $next_object_size; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_asf_asf_index_object, $asf_index_object_data, 24, + array ( + 'entry_time_interval' =>4, + 'index_specifiers_count' =>2, + 'index_blocks_count' =>4 + ) + ); + + $offset = 34; + + $asf_index_object_data .= fread($getid3->fp, 4 * $info_asf_asf_index_object['index_specifiers_count']); + + for ($index_specifiers_counter = 0; $index_specifiers_counter < $info_asf_asf_index_object['index_specifiers_count']; $index_specifiers_counter++) { + + $index_specifier_stream_number = getid3_lib::LittleEndian2Int(substr($asf_index_object_data, $offset, 2)); + $offset += 2; + + $info_asf_asf_index_object['index_specifiers'][$index_specifiers_counter]['stream_number'] = $index_specifier_stream_number; + + $info_asf_asf_index_object['index_specifiers'][$index_specifiers_counter]['index_type'] = getid3_lib::LittleEndian2Int(substr($asf_index_object_data, $offset, 2)); + $offset += 2; + + $info_asf_asf_index_object['index_specifiers'][$index_specifiers_counter]['index_type_text'] = getid3_asf::ASFIndexObjectIndexTypeLookup($info_asf_asf_index_object['index_specifiers'][$index_specifiers_counter]['index_type']); + } + + $asf_index_object_data .= fread($getid3->fp, 4); + $info_asf_asf_index_object['index_entry_count'] = getid3_lib::LittleEndian2Int(substr($asf_index_object_data, $offset, 4)); + $offset += 4; + + $asf_index_object_data .= fread($getid3->fp, 8 * $info_asf_asf_index_object['index_specifiers_count']); + + for ($index_specifiers_counter = 0; $index_specifiers_counter < $info_asf_asf_index_object['index_specifiers_count']; $index_specifiers_counter++) { + $info_asf_asf_index_object['block_positions'][$index_specifiers_counter] = getid3_lib::LittleEndian2Int(substr($asf_index_object_data, $offset, 8)); + $offset += 8; + } + + $asf_index_object_data .= fread($getid3->fp, 4 * $info_asf_asf_index_object['index_specifiers_count'] * $info_asf_asf_index_object['index_entry_count']); + + for ($index_entry_counter = 0; $index_entry_counter < $info_asf_asf_index_object['index_entry_count']; $index_entry_counter++) { + for ($index_specifiers_counter = 0; $index_specifiers_counter < $info_asf_asf_index_object['index_specifiers_count']; $index_specifiers_counter++) { + $info_asf_asf_index_object['offsets'][$index_specifiers_counter][$index_entry_counter] = getid3_lib::LittleEndian2Int(substr($asf_index_object_data, $offset, 4)); + $offset += 4; + } + } + break; + + + default: + + // Implementations shall ignore any standard or non-standard object that they do not know how to handle. + if (getid3_asf::GUIDname($next_object_guidtext)) { + $getid3->warning('unhandled GUID "'.getid3_asf::GUIDname($next_object_guidtext).'" {'.$next_object_guidtext.'} in ASF body at offset '.($offset - 16 - 8)); + } else { + $getid3->warning('unknown GUID {'.$next_object_guidtext.'} in ASF body at offset '.(ftell($getid3->fp) - 16 - 8)); + } + fseek($getid3->fp, ($next_object_size - 16 - 8), SEEK_CUR); + break; + } + } + + if (isset($info_asf_codec_list_object['codec_entries']) && is_array($info_asf_codec_list_object['codec_entries'])) { + foreach ($info_asf_codec_list_object['codec_entries'] as $stream_number => $stream_data) { + switch ($stream_data['information']) { + case 'WMV1': + case 'WMV2': + case 'WMV3': + case 'MSS1': + case 'MSS2': + case 'WMVA': + case 'WVC1': + case 'WMVP': + case 'WVP2': + $info_video['dataformat'] = 'wmv'; + $getid3->info['mime_type'] = 'video/x-ms-wmv'; + break; + + case 'MP42': + case 'MP43': + case 'MP4S': + case 'mp4s': + $info_video['dataformat'] = 'asf'; + $getid3->info['mime_type'] = 'video/x-ms-asf'; + break; + + default: + switch ($stream_data['type_raw']) { + case 1: + if (strstr($this->TrimConvert($stream_data['name']), 'Windows Media')) { + $info_video['dataformat'] = 'wmv'; + if ($getid3->info['mime_type'] == 'video/x-ms-asf') { + $getid3->info['mime_type'] = 'video/x-ms-wmv'; + } + } + break; + + case 2: + if (strstr($this->TrimConvert($stream_data['name']), 'Windows Media')) { + $info_audio['dataformat'] = 'wma'; + if ($getid3->info['mime_type'] == 'video/x-ms-asf') { + $getid3->info['mime_type'] = 'audio/x-ms-wma'; + } + } + break; + + } + break; + } + } + } + + switch (@$info_audio['codec']) { + case 'MPEG Layer-3': + $info_audio['dataformat'] = 'mp3'; + break; + + default: + break; + } + + if (isset($info_asf_codec_list_object['codec_entries'])) { + foreach ($info_asf_codec_list_object['codec_entries'] as $stream_number => $stream_data) { + switch ($stream_data['type_raw']) { + + case 1: // video + $info_video['encoder'] = $this->TrimConvert($info_asf_codec_list_object['codec_entries'][$stream_number]['name']); + break; + + case 2: // audio + $info_audio['encoder'] = $this->TrimConvert($info_asf_codec_list_object['codec_entries'][$stream_number]['name']); + $info_audio['encoder_options'] = $this->TrimConvert($info_asf_codec_list_object['codec_entries'][0]['description']); + $info_audio['codec'] = $info_audio['encoder']; + break; + + default: + $getid3->warning('Unknown streamtype: [codec_list_object][codec_entries]['.$stream_number.'][type_raw] == '.$stream_data['type_raw']); + break; + + } + } + } + + if (isset($getid3->info['audio'])) { + $info_audio['lossless'] = (isset($info_audio['lossless']) ? $info_audio['lossless'] : false); + $info_audio['dataformat'] = (!empty($info_audio['dataformat']) ? $info_audio['dataformat'] : 'asf'); + } + + if (!empty($info_video['dataformat'])) { + $info_video['lossless'] = (isset($info_audio['lossless']) ? $info_audio['lossless'] : false); + $info_video['pixel_aspect_ratio'] = (isset($info_audio['pixel_aspect_ratio']) ? $info_audio['pixel_aspect_ratio'] : (float)1); + $info_video['dataformat'] = (!empty($info_video['dataformat']) ? $info_video['dataformat'] : 'asf'); + } + + $getid3->info['bitrate'] = @$info_audio['bitrate'] + @$info_video['bitrate']; + + if (empty($info_audio)) { + unset($getid3->info['audio']); + } + + if (empty($info_video)) { + unset($getid3->info['video']); + } + + return true; + } + + + + // Remove terminator 00 00 and convert UNICODE to Latin-1 + private function TrimConvert($string) { + + // remove terminator, only if present (it should be, but...) + if (substr($string, strlen($string) - 2, 2) == "\x00\x00") { + $string = substr($string, 0, strlen($string) - 2); + } + + // convert + return trim($this->getid3->iconv('UTF-16LE', 'ISO-8859-1', $string), ' '); + } + + + + private function WMpictureTypeLookup($wm_picture_type) { + + static $lookup = array ( + 0x03 => 'Front Cover', + 0x04 => 'Back Cover', + 0x00 => 'User Defined', + 0x05 => 'Leaflet Page', + 0x06 => 'Media Label', + 0x07 => 'Lead Artist', + 0x08 => 'Artist', + 0x09 => 'Conductor', + 0x0A => 'Band', + 0x0B => 'Composer', + 0x0C => 'Lyricist', + 0x0D => 'Recording Location', + 0x0E => 'During Recording', + 0x0F => 'During Performance', + 0x10 => 'Video Screen Capture', + 0x12 => 'Illustration', + 0x13 => 'Band Logotype', + 0x14 => 'Publisher Logotype' + ); + + return isset($lookup[$wm_picture_type]) ? $this->getid3->iconv('ISO-8859-1', 'UTF-16LE', $lookup[$wm_picture_type]) : ''; + } + + + + public static function ASFCodecListObjectTypeLookup($codec_list_type) { + + static $lookup = array ( + 0x0001 => 'Video Codec', + 0x0002 => 'Audio Codec', + 0xFFFF => 'Unknown Codec' + ); + + return (isset($lookup[$codec_list_type]) ? $lookup[$codec_list_type] : 'Invalid Codec Type'); + } + + + + public static function GUIDname($guid_string) { + + static $lookup = array ( + getid3_asf::Extended_Stream_Properties_Object => 'Extended_Stream_Properties_Object', + getid3_asf::Padding_Object => 'Padding_Object', + getid3_asf::Payload_Ext_Syst_Pixel_Aspect_Ratio => 'Payload_Ext_Syst_Pixel_Aspect_Ratio', + getid3_asf::Script_Command_Object => 'Script_Command_Object', + getid3_asf::No_Error_Correction => 'No_Error_Correction', + getid3_asf::Content_Branding_Object => 'Content_Branding_Object', + getid3_asf::Content_Encryption_Object => 'Content_Encryption_Object', + getid3_asf::Digital_Signature_Object => 'Digital_Signature_Object', + getid3_asf::Extended_Content_Encryption_Object => 'Extended_Content_Encryption_Object', + getid3_asf::Simple_Index_Object => 'Simple_Index_Object', + getid3_asf::Degradable_JPEG_Media => 'Degradable_JPEG_Media', + getid3_asf::Payload_Extension_System_Timecode => 'Payload_Extension_System_Timecode', + getid3_asf::Binary_Media => 'Binary_Media', + getid3_asf::Timecode_Index_Object => 'Timecode_Index_Object', + getid3_asf::Metadata_Library_Object => 'Metadata_Library_Object', + getid3_asf::Reserved_3 => 'Reserved_3', + getid3_asf::Reserved_4 => 'Reserved_4', + getid3_asf::Command_Media => 'Command_Media', + getid3_asf::Header_Extension_Object => 'Header_Extension_Object', + getid3_asf::Media_Object_Index_Parameters_Obj => 'Media_Object_Index_Parameters_Obj', + getid3_asf::Header_Object => 'Header_Object', + getid3_asf::Content_Description_Object => 'Content_Description_Object', + getid3_asf::Error_Correction_Object => 'Error_Correction_Object', + getid3_asf::Data_Object => 'Data_Object', + getid3_asf::Web_Stream_Media_Subtype => 'Web_Stream_Media_Subtype', + getid3_asf::Stream_Bitrate_Properties_Object => 'Stream_Bitrate_Properties_Object', + getid3_asf::Language_List_Object => 'Language_List_Object', + getid3_asf::Codec_List_Object => 'Codec_List_Object', + getid3_asf::Reserved_2 => 'Reserved_2', + getid3_asf::File_Properties_Object => 'File_Properties_Object', + getid3_asf::File_Transfer_Media => 'File_Transfer_Media', + getid3_asf::Old_RTP_Extension_Data => 'Old_RTP_Extension_Data', + getid3_asf::Advanced_Mutual_Exclusion_Object => 'Advanced_Mutual_Exclusion_Object', + getid3_asf::Bandwidth_Sharing_Object => 'Bandwidth_Sharing_Object', + getid3_asf::Reserved_1 => 'Reserved_1', + getid3_asf::Bandwidth_Sharing_Exclusive => 'Bandwidth_Sharing_Exclusive', + getid3_asf::Bandwidth_Sharing_Partial => 'Bandwidth_Sharing_Partial', + getid3_asf::JFIF_Media => 'JFIF_Media', + getid3_asf::Stream_Properties_Object => 'Stream_Properties_Object', + getid3_asf::Video_Media => 'Video_Media', + getid3_asf::Audio_Spread => 'Audio_Spread', + getid3_asf::Metadata_Object => 'Metadata_Object', + getid3_asf::Payload_Ext_Syst_Sample_Duration => 'Payload_Ext_Syst_Sample_Duration', + getid3_asf::Group_Mutual_Exclusion_Object => 'Group_Mutual_Exclusion_Object', + getid3_asf::Extended_Content_Description_Object => 'Extended_Content_Description_Object', + getid3_asf::Stream_Prioritization_Object => 'Stream_Prioritization_Object', + getid3_asf::Payload_Ext_System_Content_Type => 'Payload_Ext_System_Content_Type', + getid3_asf::Old_File_Properties_Object => 'Old_File_Properties_Object', + getid3_asf::Old_ASF_Header_Object => 'Old_ASF_Header_Object', + getid3_asf::Old_ASF_Data_Object => 'Old_ASF_Data_Object', + getid3_asf::Index_Object => 'Index_Object', + getid3_asf::Old_Stream_Properties_Object => 'Old_Stream_Properties_Object', + getid3_asf::Old_Content_Description_Object => 'Old_Content_Description_Object', + getid3_asf::Old_Script_Command_Object => 'Old_Script_Command_Object', + getid3_asf::Old_Marker_Object => 'Old_Marker_Object', + getid3_asf::Old_Component_Download_Object => 'Old_Component_Download_Object', + getid3_asf::Old_Stream_Group_Object => 'Old_Stream_Group_Object', + getid3_asf::Old_Scalable_Object => 'Old_Scalable_Object', + getid3_asf::Old_Prioritization_Object => 'Old_Prioritization_Object', + getid3_asf::Bitrate_Mutual_Exclusion_Object => 'Bitrate_Mutual_Exclusion_Object', + getid3_asf::Old_Inter_Media_Dependency_Object => 'Old_Inter_Media_Dependency_Object', + getid3_asf::Old_Rating_Object => 'Old_Rating_Object', + getid3_asf::Index_Parameters_Object => 'Index_Parameters_Object', + getid3_asf::Old_Color_Table_Object => 'Old_Color_Table_Object', + getid3_asf::Old_Language_List_Object => 'Old_Language_List_Object', + getid3_asf::Old_Audio_Media => 'Old_Audio_Media', + getid3_asf::Old_Video_Media => 'Old_Video_Media', + getid3_asf::Old_Image_Media => 'Old_Image_Media', + getid3_asf::Old_Timecode_Media => 'Old_Timecode_Media', + getid3_asf::Old_Text_Media => 'Old_Text_Media', + getid3_asf::Old_MIDI_Media => 'Old_MIDI_Media', + getid3_asf::Old_Command_Media => 'Old_Command_Media', + getid3_asf::Old_No_Error_Concealment => 'Old_No_Error_Concealment', + getid3_asf::Old_Scrambled_Audio => 'Old_Scrambled_Audio', + getid3_asf::Old_No_Color_Table => 'Old_No_Color_Table', + getid3_asf::Old_SMPTE_Time => 'Old_SMPTE_Time', + getid3_asf::Old_ASCII_Text => 'Old_ASCII_Text', + getid3_asf::Old_Unicode_Text => 'Old_Unicode_Text', + getid3_asf::Old_HTML_Text => 'Old_HTML_Text', + getid3_asf::Old_URL_Command => 'Old_URL_Command', + getid3_asf::Old_Filename_Command => 'Old_Filename_Command', + getid3_asf::Old_ACM_Codec => 'Old_ACM_Codec', + getid3_asf::Old_VCM_Codec => 'Old_VCM_Codec', + getid3_asf::Old_QuickTime_Codec => 'Old_QuickTime_Codec', + getid3_asf::Old_DirectShow_Transform_Filter => 'Old_DirectShow_Transform_Filter', + getid3_asf::Old_DirectShow_Rendering_Filter => 'Old_DirectShow_Rendering_Filter', + getid3_asf::Old_No_Enhancement => 'Old_No_Enhancement', + getid3_asf::Old_Unknown_Enhancement_Type => 'Old_Unknown_Enhancement_Type', + getid3_asf::Old_Temporal_Enhancement => 'Old_Temporal_Enhancement', + getid3_asf::Old_Spatial_Enhancement => 'Old_Spatial_Enhancement', + getid3_asf::Old_Quality_Enhancement => 'Old_Quality_Enhancement', + getid3_asf::Old_Number_of_Channels_Enhancement => 'Old_Number_of_Channels_Enhancement', + getid3_asf::Old_Frequency_Response_Enhancement => 'Old_Frequency_Response_Enhancement', + getid3_asf::Old_Media_Object => 'Old_Media_Object', + getid3_asf::Mutex_Language => 'Mutex_Language', + getid3_asf::Mutex_Bitrate => 'Mutex_Bitrate', + getid3_asf::Mutex_Unknown => 'Mutex_Unknown', + getid3_asf::Old_ASF_Placeholder_Object => 'Old_ASF_Placeholder_Object', + getid3_asf::Old_Data_Unit_Extension_Object => 'Old_Data_Unit_Extension_Object', + getid3_asf::Web_Stream_Format => 'Web_Stream_Format', + getid3_asf::Payload_Ext_System_File_Name => 'Payload_Ext_System_File_Name', + getid3_asf::Marker_Object => 'Marker_Object', + getid3_asf::Timecode_Index_Parameters_Object => 'Timecode_Index_Parameters_Object', + getid3_asf::Audio_Media => 'Audio_Media', + getid3_asf::Media_Object_Index_Object => 'Media_Object_Index_Object', + getid3_asf::Alt_Extended_Content_Encryption_Obj => 'Alt_Extended_Content_Encryption_Obj' + ); + + return @$lookup[$guid_string]; + } + + + + public static function ASFIndexObjectIndexTypeLookup($id) { + + static $lookup = array ( + 1 => 'Nearest Past Data Packet', + 2 => 'Nearest Past Media Object', + 3 => 'Nearest Past Cleanpoint' + ); + + return (isset($lookup[$id]) ? $lookup[$id] : 'invalid'); + } + + + + public static function GUIDtoBytestring($guid_string) { + + // Microsoft defines these 16-byte (128-bit) GUIDs in the strangest way: + // first 4 bytes are in little-endian order + // next 2 bytes are appended in little-endian order + // next 2 bytes are appended in little-endian order + // next 2 bytes are appended in big-endian order + // next 6 bytes are appended in big-endian order + + // AaBbCcDd-EeFf-GgHh-IiJj-KkLlMmNnOoPp is stored as this 16-byte string: + // $Dd $Cc $Bb $Aa $Ff $Ee $Hh $Gg $Ii $Jj $Kk $Ll $Mm $Nn $Oo $Pp + + $hex_byte_char_string = chr(hexdec(substr($guid_string, 6, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 4, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 2, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 0, 2))); + + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 11, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 9, 2))); + + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 16, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 14, 2))); + + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 19, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 21, 2))); + + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 24, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 26, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 28, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 30, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 32, 2))); + $hex_byte_char_string .= chr(hexdec(substr($guid_string, 34, 2))); + + return $hex_byte_char_string; + } + + + + public static function BytestringToGUID($byte_string) { + + $guid_string = str_pad(dechex(ord($byte_string{3})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{2})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{1})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{0})), 2, '0', STR_PAD_LEFT); + $guid_string .= '-'; + $guid_string .= str_pad(dechex(ord($byte_string{5})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{4})), 2, '0', STR_PAD_LEFT); + $guid_string .= '-'; + $guid_string .= str_pad(dechex(ord($byte_string{7})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{6})), 2, '0', STR_PAD_LEFT); + $guid_string .= '-'; + $guid_string .= str_pad(dechex(ord($byte_string{8})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{9})), 2, '0', STR_PAD_LEFT); + $guid_string .= '-'; + $guid_string .= str_pad(dechex(ord($byte_string{10})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{11})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{12})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{13})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{14})), 2, '0', STR_PAD_LEFT); + $guid_string .= str_pad(dechex(ord($byte_string{15})), 2, '0', STR_PAD_LEFT); + + return strtoupper($guid_string); + } + + + + public static function FiletimeToUNIXtime($file_time, $round=true) { + + // FILETIME is a 64-bit unsigned integer representing + // the number of 100-nanosecond intervals since January 1, 1601 + // UNIX timestamp is number of seconds since January 1, 1970 + // 116444736000000000 = 10000000 * 60 * 60 * 24 * 365 * 369 + 89 leap days + + $time = ($file_time - 116444736000000000) / 10000000; + + if ($round) { + return intval(round($time)); + } + + return $time; + } + + + + public static function TrimTerm($string) { + + // remove terminator, only if present (it should be, but...) + if (substr($string, -2) == "\x00\x00") { + $string = substr($string, 0, -2); + } + return $string; + } + + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.flv.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.flv.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.flv.php 3 Jan 2016 20:51:39 -0000 1.1.2.1 @@ -0,0 +1,574 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.archive.gzip.php | +// | module for analyzing GZIP files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// | FLV module by Seth Kaufman | +// | | +// | * version 0.1 (26 June 2005) | +// | | +// | minor modifications by James Heinrich | +// | * version 0.1.1 (15 July 2005) | +// | | +// | Support for On2 VP6 codec and meta information by | +// | Steve Webster | +// | * version 0.2 (22 February 2006) | +// | | +// | Modified to not read entire file into memory | +// | by James Heinrich | +// | * version 0.3 (15 June 2006) | +// | | +// | Modifications by Allan Hansen | +// | Adapted module for PHP5 and getID3 2.0.0. | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.flv.php,v 1.1.2.1 2016/01/03 20:51:39 gustafn Exp $ + + + +class getid3_flv extends getid3_handler +{ + + const TAG_AUDIO = 8; + const TAG_VIDEO = 9; + const TAG_META = 18; + + const VIDEO_H263 = 2; + const VIDEO_SCREEN = 3; + const VIDEO_VP6 = 4; + + + public function Analyze() + { + $info = &$this->getid3->info; + + $info['flv'] = array (); + $info_flv = &$info['flv']; + + fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET); + + $flv_data_length = $info['avdataend'] - $info['avdataoffset']; + $flv_header = fread($this->getid3->fp, 5); + + $info['fileformat'] = 'flv'; + $info_flv['header']['signature'] = substr($flv_header, 0, 3); + $info_flv['header']['version'] = getid3_lib::BigEndian2Int(substr($flv_header, 3, 1)); + $type_flags = getid3_lib::BigEndian2Int(substr($flv_header, 4, 1)); + + $info_flv['header']['hasAudio'] = (bool) ($type_flags & 0x04); + $info_flv['header']['hasVideo'] = (bool) ($type_flags & 0x01); + + $frame_size_data_length = getid3_lib::BigEndian2Int(fread($this->getid3->fp, 4)); + $flv_header_frame_length = 9; + if ($frame_size_data_length > $flv_header_frame_length) { + fseek($this->getid3->fp, $frame_size_data_length - $flv_header_frame_length, SEEK_CUR); + } + + $duration = 0; + while ((ftell($this->getid3->fp) + 1) < $info['avdataend']) { + + $this_tag_header = fread($this->getid3->fp, 16); + + $previous_tag_length = getid3_lib::BigEndian2Int(substr($this_tag_header, 0, 4)); + $tag_type = getid3_lib::BigEndian2Int(substr($this_tag_header, 4, 1)); + $data_length = getid3_lib::BigEndian2Int(substr($this_tag_header, 5, 3)); + $timestamp = getid3_lib::BigEndian2Int(substr($this_tag_header, 8, 3)); + $last_header_byte = getid3_lib::BigEndian2Int(substr($this_tag_header, 15, 1)); + $next_offset = ftell($this->getid3->fp) - 1 + $data_length; + + switch ($tag_type) { + + case getid3_flv::TAG_AUDIO: + if (!isset($info_flv['audio']['audioFormat'])) { + $info_flv['audio']['audioFormat'] = $last_header_byte & 0x07; + $info_flv['audio']['audioRate'] = ($last_header_byte & 0x30) / 0x10; + $info_flv['audio']['audioSampleSize'] = ($last_header_byte & 0x40) / 0x40; + $info_flv['audio']['audioType'] = ($last_header_byte & 0x80) / 0x80; + } + break; + + + case getid3_flv::TAG_VIDEO: + if (!isset($info_flv['video']['videoCodec'])) { + $info_flv['video']['videoCodec'] = $last_header_byte & 0x07; + + $flv_video_header = fread($this->getid3->fp, 11); + + if ($info_flv['video']['videoCodec'] != getid3_flv::VIDEO_VP6) { + + $picture_size_type = (getid3_lib::BigEndian2Int(substr($flv_video_header, 3, 2))) >> 7; + $picture_size_type = $picture_size_type & 0x0007; + $info_flv['header']['videoSizeType'] = $picture_size_type; + + switch ($picture_size_type) { + case 0: + $picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 5, 2)); + $picture_size_enc <<= 1; + $info['video']['resolution_x'] = ($picture_size_enc & 0xFF00) >> 8; + $picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 6, 2)); + $picture_size_enc <<= 1; + $info['video']['resolution_y'] = ($picture_size_enc & 0xFF00) >> 8; + break; + + case 1: + $picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 5, 4)); + $picture_size_enc <<= 1; + $info['video']['resolution_x'] = ($picture_size_enc & 0xFFFF0000) >> 16; + + $picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 7, 4)); + $picture_size_enc <<= 1; + $info['video']['resolution_y'] = ($picture_size_enc & 0xFFFF0000) >> 16; + break; + + case 2: + $info['video']['resolution_x'] = 352; + $info['video']['resolution_y'] = 288; + break; + + case 3: + $info['video']['resolution_x'] = 176; + $info['video']['resolution_y'] = 144; + break; + + case 4: + $info['video']['resolution_x'] = 128; + $info['video']['resolution_y'] = 96; + break; + + case 5: + $info['video']['resolution_x'] = 320; + $info['video']['resolution_y'] = 240; + break; + + case 6: + $info['video']['resolution_x'] = 160; + $info['video']['resolution_y'] = 120; + break; + + default: + $info['video']['resolution_x'] = 0; + $info['video']['resolution_y'] = 0; + break; + } + } + } + break; + + + // Meta tag + case getid3_flv::TAG_META: + + fseek($this->getid3->fp, -1, SEEK_CUR); + $reader = new AMFReader(new AMFStream(fread($this->getid3->fp, $data_length))); + $event_name = $reader->readData(); + $info['meta'][$event_name] = $reader->readData(); + unset($reader); + + $info['video']['frame_rate'] = @$info['meta']['onMetaData']['framerate']; + $info['video']['resolution_x'] = @$info['meta']['onMetaData']['width']; + $info['video']['resolution_y'] = @$info['meta']['onMetaData']['height']; + break; + + default: + // noop + break; + } + + if ($timestamp > $duration) { + $duration = $timestamp; + } + + fseek($this->getid3->fp, $next_offset, SEEK_SET); + } + + if ($info['playtime_seconds'] = $duration / 1000) { + $info['bitrate'] = ($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']; + } + + if ($info_flv['header']['hasAudio']) { + $info['audio']['codec'] = $this->FLVaudioFormat($info_flv['audio']['audioFormat']); + $info['audio']['sample_rate'] = $this->FLVaudioRate($info_flv['audio']['audioRate']); + $info['audio']['bits_per_sample'] = $this->FLVaudioBitDepth($info_flv['audio']['audioSampleSize']); + + $info['audio']['channels'] = $info_flv['audio']['audioType'] + 1; // 0=mono,1=stereo + $info['audio']['lossless'] = ($info_flv['audio']['audioFormat'] ? false : true); // 0=uncompressed + $info['audio']['dataformat'] = 'flv'; + } + if (@$info_flv['header']['hasVideo']) { + $info['video']['codec'] = $this->FLVvideoCodec($info_flv['video']['videoCodec']); + $info['video']['dataformat'] = 'flv'; + $info['video']['lossless'] = false; + } + + return true; + } + + + public static function FLVaudioFormat($id) { + + static $lookup = array( + 0 => 'uncompressed', + 1 => 'ADPCM', + 2 => 'mp3', + 5 => 'Nellymoser 8kHz mono', + 6 => 'Nellymoser', + ); + return (@$lookup[$id] ? @$lookup[$id] : false); + } + + + public static function FLVaudioRate($id) { + + static $lookup = array( + 0 => 5500, + 1 => 11025, + 2 => 22050, + 3 => 44100, + ); + return (@$lookup[$id] ? @$lookup[$id] : false); + } + + + public static function FLVaudioBitDepth($id) { + + static $lookup = array( + 0 => 8, + 1 => 16, + ); + return (@$lookup[$id] ? @$lookup[$id] : false); + } + + + public static function FLVvideoCodec($id) { + + static $lookup = array( + getid3_flv::VIDEO_H263 => 'Sorenson H.263', + getid3_flv::VIDEO_SCREEN => 'Screen video', + getid3_flv::VIDEO_VP6 => 'On2 VP6', + ); + return (@$lookup[$id] ? @$lookup[$id] : false); + } +} + + + +class AMFStream +{ + public $bytes; + public $pos; + + + public function AMFStream($bytes) { + + $this->bytes = $bytes; + $this->pos = 0; + } + + + public function readByte() { + + return getid3_lib::BigEndian2Int(substr($this->bytes, $this->pos++, 1)); + } + + + public function readInt() { + + return ($this->readByte() << 8) + $this->readByte(); + } + + + public function readLong() { + + return ($this->readByte() << 24) + ($this->readByte() << 16) + ($this->readByte() << 8) + $this->readByte(); + } + + + public function readDouble() { + + return getid3_lib::BigEndian2Float($this->read(8)); + } + + + public function readUTF() { + + $length = $this->readInt(); + return $this->read($length); + } + + + public function readLongUTF() { + + $length = $this->readLong(); + return $this->read($length); + } + + + public function read($length) { + + $val = substr($this->bytes, $this->pos, $length); + $this->pos += $length; + return $val; + } + + + public function peekByte() { + + $pos = $this->pos; + $val = $this->readByte(); + $this->pos = $pos; + return $val; + } + + + public function peekInt() { + + $pos = $this->pos; + $val = $this->readInt(); + $this->pos = $pos; + return $val; + } + + + public function peekLong() { + + $pos = $this->pos; + $val = $this->readLong(); + $this->pos = $pos; + return $val; + } + + + public function peekDouble() { + + $pos = $this->pos; + $val = $this->readDouble(); + $this->pos = $pos; + return $val; + } + + + public function peekUTF() { + + $pos = $this->pos; + $val = $this->readUTF(); + $this->pos = $pos; + return $val; + } + + + public function peekLongUTF() { + + $pos = $this->pos; + $val = $this->readLongUTF(); + $this->pos = $pos; + return $val; + } +} + + + +class AMFReader +{ + public $stream; + + public function __construct($stream) { + + $this->stream = $stream; + } + + + public function readData() { + + $value = null; + + $type = $this->stream->readByte(); + + switch($type) { + // Double + case 0: + $value = $this->readDouble(); + break; + + // Boolean + case 1: + $value = $this->readBoolean(); + break; + + // String + case 2: + $value = $this->readString(); + break; + + // Object + case 3: + $value = $this->readObject(); + break; + + // null + case 6: + return null; + break; + + // Mixed array + case 8: + $value = $this->readMixedArray(); + break; + + // Array + case 10: + $value = $this->readArray(); + break; + + // Date + case 11: + $value = $this->readDate(); + break; + + // Long string + case 13: + $value = $this->readLongString(); + break; + + // XML (handled as string) + case 15: + $value = $this->readXML(); + break; + + // Typed object (handled as object) + case 16: + $value = $this->readTypedObject(); + break; + + // Long string + default: + $value = '(unknown or unsupported data type)'; + break; + } + + return $value; + } + + + public function readDouble() { + + return $this->stream->readDouble(); + } + + + public function readBoolean() { + + return $this->stream->readByte() == 1; + } + + + public function readString() { + + return $this->stream->readUTF(); + } + + + public function readObject() { + + // Get highest numerical index - ignored + $highestIndex = $this->stream->readLong(); + + $data = array(); + + while ($key = $this->stream->readUTF()) { + // Mixed array record ends with empty string (0x00 0x00) and 0x09 + if (($key == '') && ($this->stream->peekByte() == 0x09)) { + // Consume byte + $this->stream->readByte(); + break; + } + + $data[$key] = $this->readData(); + } + + return $data; + } + + + public function readMixedArray() { + + // Get highest numerical index - ignored + $highestIndex = $this->stream->readLong(); + + $data = array(); + + while ($key = $this->stream->readUTF()) { + // Mixed array record ends with empty string (0x00 0x00) and 0x09 + if (($key == '') && ($this->stream->peekByte() == 0x09)) { + // Consume byte + $this->stream->readByte(); + break; + } + + if (is_numeric($key)) { + $key = (float) $key; + } + + $data[$key] = $this->readData(); + } + + return $data; + } + + + public function readArray() { + + $length = $this->stream->readLong(); + + $data = array(); + + for ($i = 0; $i < count($length); $i++) { + $data[] = $this->readData(); + } + + return $data; + } + + + public function readDate() { + + $timestamp = $this->stream->readDouble(); + $timezone = $this->stream->readInt(); + return $timestamp; + } + + + public function readLongString() { + + return $this->stream->readLongUTF(); + } + + + public function readXML() { + + return $this->stream->readLongUTF(); + } + + + public function readTypedObject() { + + $className = $this->stream->readUTF(); + return $this->readObject(); + } +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.mpeg.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.mpeg.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.mpeg.php 3 Jan 2016 20:51:39 -0000 1.1.2.1 @@ -0,0 +1,324 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio-video.mpeg.php | +// | Module for analyzing MPEG files | +// | dependencies: module.audio.mp3.php | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.mpeg.php,v 1.1.2.1 2016/01/03 20:51:39 gustafn Exp $ + + + +class getid3_mpeg extends getid3_handler +{ + + const VIDEO_PICTURE_START = "\x00\x00\x01\x00"; + const VIDEO_USER_DATA_START = "\x00\x00\x01\xB2"; + const VIDEO_SEQUENCE_HEADER = "\x00\x00\x01\xB3"; + const VIDEO_SEQUENCE_ERROR = "\x00\x00\x01\xB4"; + const VIDEO_EXTENSION_START = "\x00\x00\x01\xB5"; + const VIDEO_SEQUENCE_END = "\x00\x00\x01\xB7"; + const VIDEO_GROUP_START = "\x00\x00\x01\xB8"; + const AUDIO_START = "\x00\x00\x01\xC0"; + + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['mpeg']['video']['raw'] = array (); + $info_mpeg_video = &$getid3->info['mpeg']['video']; + $info_mpeg_video_raw = &$info_mpeg_video['raw']; + + $getid3->info['video'] = array (); + $info_video = &$getid3->info['video']; + + $getid3->include_module('audio.mp3'); + + if ($getid3->info['avdataend'] <= $getid3->info['avdataoffset']) { + throw new getid3_exception('"avdataend" ('.$getid3->info['avdataend'].') is unexpectedly less-than-or-equal-to "avdataoffset" ('.$getid3->info['avdataoffset'].')'); + } + + $getid3->info['fileformat'] = 'mpeg'; + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $mpeg_stream_data = fread($getid3->fp, min(100000, $getid3->info['avdataend'] - $getid3->info['avdataoffset'])); + $mpeg_stream_data_length = strlen($mpeg_stream_data); + + $video_chunk_offset = 0; + while (substr($mpeg_stream_data, $video_chunk_offset++, 4) !== getid3_mpeg::VIDEO_SEQUENCE_HEADER) { + if ($video_chunk_offset >= $mpeg_stream_data_length) { + throw new getid3_exception('Could not find start of video block in the first 100,000 bytes (or before end of file) - this might not be an MPEG-video file?'); + } + } + + // Start code 32 bits + // horizontal frame size 12 bits + // vertical frame size 12 bits + // pixel aspect ratio 4 bits + // frame rate 4 bits + // bitrate 18 bits + // marker bit 1 bit + // VBV buffer size 10 bits + // constrained parameter flag 1 bit + // intra quant. matrix flag 1 bit + // intra quant. matrix values 512 bits (present if matrix flag == 1) + // non-intra quant. matrix flag 1 bit + // non-intra quant. matrix values 512 bits (present if matrix flag == 1) + + $info_video['dataformat'] = 'mpeg'; + + $video_chunk_offset += (strlen(getid3_mpeg::VIDEO_SEQUENCE_HEADER) - 1); + + $frame_size_dword = getid3_lib::BigEndian2Int(substr($mpeg_stream_data, $video_chunk_offset, 3)); + $video_chunk_offset += 3; + + $aspect_ratio_frame_rate_dword = getid3_lib::BigEndian2Int(substr($mpeg_stream_data, $video_chunk_offset, 1)); + $video_chunk_offset += 1; + + $assorted_information = getid3_lib::BigEndian2Bin(substr($mpeg_stream_data, $video_chunk_offset, 4)); + $video_chunk_offset += 4; + + $info_mpeg_video_raw['framesize_horizontal'] = ($frame_size_dword & 0xFFF000) >> 12; // 12 bits for horizontal frame size + $info_mpeg_video_raw['framesize_vertical'] = ($frame_size_dword & 0x000FFF); // 12 bits for vertical frame size + $info_mpeg_video_raw['pixel_aspect_ratio'] = ($aspect_ratio_frame_rate_dword & 0xF0) >> 4; + $info_mpeg_video_raw['frame_rate'] = ($aspect_ratio_frame_rate_dword & 0x0F); + + $info_mpeg_video['framesize_horizontal'] = $info_mpeg_video_raw['framesize_horizontal']; + $info_mpeg_video['framesize_vertical'] = $info_mpeg_video_raw['framesize_vertical']; + + $info_mpeg_video['pixel_aspect_ratio'] = $this->MPEGvideoAspectRatioLookup($info_mpeg_video_raw['pixel_aspect_ratio']); + $info_mpeg_video['pixel_aspect_ratio_text'] = $this->MPEGvideoAspectRatioTextLookup($info_mpeg_video_raw['pixel_aspect_ratio']); + $info_mpeg_video['frame_rate'] = $this->MPEGvideoFramerateLookup($info_mpeg_video_raw['frame_rate']); + + $info_mpeg_video_raw['bitrate'] = bindec(substr($assorted_information, 0, 18)); + $info_mpeg_video_raw['marker_bit'] = (bool)bindec($assorted_information{18}); + $info_mpeg_video_raw['vbv_buffer_size'] = bindec(substr($assorted_information, 19, 10)); + $info_mpeg_video_raw['constrained_param_flag'] = (bool)bindec($assorted_information{29}); + $info_mpeg_video_raw['intra_quant_flag'] = (bool)bindec($assorted_information{30}); + + if ($info_mpeg_video_raw['intra_quant_flag']) { + + // read 512 bits + $info_mpeg_video_raw['intra_quant'] = getid3_lib::BigEndian2Bin(substr($mpeg_stream_data, $video_chunk_offset, 64)); + $video_chunk_offset += 64; + + $info_mpeg_video_raw['non_intra_quant_flag'] = (bool)bindec($info_mpeg_video_raw['intra_quant']{511}); + $info_mpeg_video_raw['intra_quant'] = bindec($assorted_information{31}).substr(getid3_lib::BigEndian2Bin(substr($mpeg_stream_data, $video_chunk_offset, 64)), 0, 511); + + if ($info_mpeg_video_raw['non_intra_quant_flag']) { + $info_mpeg_video_raw['non_intra_quant'] = substr($mpeg_stream_data, $video_chunk_offset, 64); + $video_chunk_offset += 64; + } + + } else { + + $info_mpeg_video_raw['non_intra_quant_flag'] = (bool)bindec($assorted_information{31}); + if ($info_mpeg_video_raw['non_intra_quant_flag']) { + $info_mpeg_video_raw['non_intra_quant'] = substr($mpeg_stream_data, $video_chunk_offset, 64); + $video_chunk_offset += 64; + } + } + + if ($info_mpeg_video_raw['bitrate'] == 0x3FFFF) { // 18 set bits + + $getid3->warning('This version of getID3() cannot determine average bitrate of VBR MPEG video files'); + $info_mpeg_video['bitrate_mode'] = 'vbr'; + + } else { + + $info_mpeg_video['bitrate'] = $info_mpeg_video_raw['bitrate'] * 400; + $info_mpeg_video['bitrate_mode'] = 'cbr'; + $info_video['bitrate'] = $info_mpeg_video['bitrate']; + } + + $info_video['resolution_x'] = $info_mpeg_video['framesize_horizontal']; + $info_video['resolution_y'] = $info_mpeg_video['framesize_vertical']; + $info_video['frame_rate'] = $info_mpeg_video['frame_rate']; + $info_video['bitrate_mode'] = $info_mpeg_video['bitrate_mode']; + $info_video['pixel_aspect_ratio'] = $info_mpeg_video['pixel_aspect_ratio']; + $info_video['lossless'] = false; + $info_video['bits_per_sample'] = 24; + + + //0x000001B3 begins the sequence_header of every MPEG video stream. + //But in MPEG-2, this header must immediately be followed by an + //extension_start_code (0x000001B5) with a sequence_extension ID (1). + //(This extension contains all the additional MPEG-2 stuff.) + //MPEG-1 doesn't have this extension, so that's a sure way to tell the + //difference between MPEG-1 and MPEG-2 video streams. + + $info_video['codec'] = substr($mpeg_stream_data, $video_chunk_offset, 4) == getid3_mpeg::VIDEO_EXTENSION_START ? 'MPEG-2' : 'MPEG-1'; + + $audio_chunk_offset = 0; + while (true) { + while (substr($mpeg_stream_data, $audio_chunk_offset++, 4) !== getid3_mpeg::AUDIO_START) { + if ($audio_chunk_offset >= $mpeg_stream_data_length) { + break 2; + } + } + + for ($i = 0; $i <= 7; $i++) { + // some files have the MPEG-audio header 8 bytes after the end of the $00 $00 $01 $C0 signature, some have it up to 13 bytes (or more?) after + // I have no idea why or what the difference is, so this is a stupid hack. + // If anybody has any better idea of what's going on, please let me know - info@getid3.org + + // make copy of info + $dummy = $getid3->info; + + // clone getid3 - better safe than sorry + $clone = clone $this->getid3; + + // check + $mp3 = new getid3_mp3($clone); + if ($mp3->decodeMPEGaudioHeader($getid3->fp, ($audio_chunk_offset + 3) + 8 + $i, $dummy, false)) { + + $getid3->info = $dummy; + $getid3->info['audio']['bitrate_mode'] = 'cbr'; + $getid3->info['audio']['lossless'] = false; + break 2; + } + + // destroy copy + unset($dummy); + } + } + + // Temporary hack to account for interleaving overhead: + if (!empty($info_video['bitrate']) && !empty($getid3->info['audio']['bitrate'])) { + $getid3->info['playtime_seconds'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / ($info_video['bitrate'] + $getid3->info['audio']['bitrate']); + + // Interleaved MPEG audio/video files have a certain amount of overhead that varies + // by both video and audio bitrates, and not in any sensible, linear/logarithmic patter + // Use interpolated lookup tables to approximately guess how much is overhead, because + // playtime is calculated as filesize / total-bitrate + $getid3->info['playtime_seconds'] *= $this->MPEGsystemNonOverheadPercentage($info_video['bitrate'], $getid3->info['audio']['bitrate']); + + //switch ($info_video['bitrate']) { + // case('5000000'): + // $multiplier = 0.93292642112380355828048824319889; + // break; + // case('5500000'): + // $multiplier = 0.93582895375200989965359777343219; + // break; + // case('6000000'): + // $multiplier = 0.93796247714820932532911373859139; + // break; + // case('7000000'): + // $multiplier = 0.9413264083635103463010117778776; + // break; + // default: + // $multiplier = 1; + // break; + //} + //$getid3->info['playtime_seconds'] *= $multiplier; + //$getid3->warning('Interleaved MPEG audio/video playtime may be inaccurate. With current hack should be within a few seconds of accurate. Report to info@getid3.org if off by more than 10 seconds.'); + + if ($info_video['bitrate'] < 50000) { + $getid3->warning('Interleaved MPEG audio/video playtime may be slightly inaccurate for video bitrates below 100kbps. Except in extreme low-bitrate situations, error should be less than 1%. Report to info@getid3.org if greater than this.'); + } + } + + return true; + } + + + + public static function MPEGsystemNonOverheadPercentage($video_bitrate, $audio_bitrate) { + + $overhead_percentage = 0; + + $audio_bitrate = max(min($audio_bitrate / 1000, 384), 32); // limit to range of 32kbps - 384kbps (should be only legal bitrates, but maybe VBR?) + $video_bitrate = max(min($video_bitrate / 1000, 10000), 10); // limit to range of 10kbps - 10Mbps (beyond that curves flatten anyways, no big loss) + + //OMBB[audiobitrate] = array ( video-10kbps, video-100kbps, video-1000kbps, video-10000kbps) + static $overhead_multiplier_by_bitrate = array ( + 32 => array (0, 0.9676287944368530, 0.9802276264360310, 0.9844916183244460, 0.9852821845179940), + 48 => array (0, 0.9779100089209830, 0.9787770035359320, 0.9846738664076130, 0.9852683013799960), + 56 => array (0, 0.9731249855367600, 0.9776624308938040, 0.9832606361852130, 0.9843922606633340), + 64 => array (0, 0.9755642683275760, 0.9795256705493390, 0.9836573009193170, 0.9851122539404470), + 96 => array (0, 0.9788025247497290, 0.9798553314148700, 0.9822956869792560, 0.9834815119124690), + 128 => array (0, 0.9816940050925480, 0.9821675936072120, 0.9829756927470870, 0.9839763420152050), + 160 => array (0, 0.9825894094561180, 0.9820913399073960, 0.9823907143253970, 0.9832821783651570), + 192 => array (0, 0.9832038474336260, 0.9825731694317960, 0.9821028622712400, 0.9828262076447620), + 224 => array (0, 0.9836516298538770, 0.9824718601823890, 0.9818302180625380, 0.9823735101626480), + 256 => array (0, 0.9845863022094920, 0.9837229411967540, 0.9824521662210830, 0.9828645172100790), + 320 => array (0, 0.9849565280263180, 0.9837683142805110, 0.9822885275960400, 0.9824424382727190), + 384 => array (0, 0.9856094774357600, 0.9844573394432720, 0.9825970399837330, 0.9824673808303890) + ); + + $bitrate_to_use_min = $bitrate_to_use_max = $previous_bitrate = 32; + + foreach ($overhead_multiplier_by_bitrate as $key => $value) { + + if ($audio_bitrate >= $previous_bitrate) { + $bitrate_to_use_min = $previous_bitrate; + } + if ($audio_bitrate < $key) { + $bitrate_to_use_max = $key; + break; + } + $previous_bitrate = $key; + } + + $factor_a = ($bitrate_to_use_max - $audio_bitrate) / ($bitrate_to_use_max - $bitrate_to_use_min); + + $video_bitrate_log10 = log10($video_bitrate); + $video_factor_min1 = $overhead_multiplier_by_bitrate[$bitrate_to_use_min][floor($video_bitrate_log10)]; + $video_factor_min2 = $overhead_multiplier_by_bitrate[$bitrate_to_use_max][floor($video_bitrate_log10)]; + $video_factor_max1 = $overhead_multiplier_by_bitrate[$bitrate_to_use_min][ceil($video_bitrate_log10)]; + $video_factor_max2 = $overhead_multiplier_by_bitrate[$bitrate_to_use_max][ceil($video_bitrate_log10)]; + $factor_v = $video_bitrate_log10 - floor($video_bitrate_log10); + + $overhead_percentage = $video_factor_min1 * $factor_a * $factor_v; + $overhead_percentage += $video_factor_min2 * (1 - $factor_a) * $factor_v; + $overhead_percentage += $video_factor_max1 * $factor_a * (1 - $factor_v); + $overhead_percentage += $video_factor_max2 * (1 - $factor_a) * (1 - $factor_v); + + return $overhead_percentage; + } + + + + public static function MPEGvideoFramerateLookup($raw_frame_rate) { + + $lookup = array (0, 23.976, 24, 25, 29.97, 30, 50, 59.94, 60); + + return (float)(isset($lookup[$raw_frame_rate]) ? $lookup[$raw_frame_rate] : 0); + } + + + + public static function MPEGvideoAspectRatioLookup($raw_aspect_ratio) { + + $lookup = array (0, 1, 0.6735, 0.7031, 0.7615, 0.8055, 0.8437, 0.8935, 0.9157, 0.9815, 1.0255, 1.0695, 1.0950, 1.1575, 1.2015, 0); + + return (float)(isset($lookup[$raw_aspect_ratio]) ? $lookup[$raw_aspect_ratio] : 0); + } + + + + public static function MPEGvideoAspectRatioTextLookup($raw_aspect_ratio) { + + $lookup = array ('forbidden', 'square pixels', '0.6735', '16:9, 625 line, PAL', '0.7615', '0.8055', '16:9, 525 line, NTSC', '0.8935', '4:3, 625 line, PAL, CCIR601', '0.9815', '1.0255', '1.0695', '4:3, 525 line, NTSC, CCIR601', '1.1575', '1.2015', 'reserved'); + + return (isset($lookup[$raw_aspect_ratio]) ? $lookup[$raw_aspect_ratio] : ''); + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.nsv.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.nsv.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.nsv.php 3 Jan 2016 20:51:39 -0000 1.1.2.1 @@ -0,0 +1,210 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio-video.nsv.php | +// | module for analyzing Nullsoft NSV files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.nsv.php,v 1.1.2.1 2016/01/03 20:51:39 gustafn Exp $ + + + +class getid3_nsv extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'nsv'; + $getid3->info['audio']['dataformat'] = 'nsv'; + $getid3->info['video']['dataformat'] = 'nsv'; + $getid3->info['audio']['lossless'] = false; + $getid3->info['video']['lossless'] = false; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $nsv_header = fread($getid3->fp, 4); + + switch ($nsv_header) { + + case 'NSVs': + $this->getNSVsHeader(); + break; + + case 'NSVf': + if ($this->getNSVfHeader()) { + $this->getNSVsHeader($getid3->info['nsv']['NSVf']['header_length']); + } + break; + + default: + throw new getid3_exception('Expecting "NSVs" or "NSVf" at offset '.$getid3->info['avdataoffset'].', found "'.$nsv_header.'"'); + break; + } + + if (!isset($getid3->info['nsv']['NSVf'])) { + $getid3->warning('NSVf header not present - cannot calculate playtime or bitrate'); + } + + return true; + } + + + + private function getNSVsHeader($file_offset = 0) { + + $getid3 = $this->getid3; + + fseek($getid3->fp, $file_offset, SEEK_SET); + $nsvs_header = fread($getid3->fp, 28); + + $getid3->info['nsv']['NSVs'] = array (); + $info_nsv_NSVs = &$getid3->info['nsv']['NSVs']; + + $info_nsv_NSVs['identifier'] = substr($nsvs_header, 0, 4); + if ($info_nsv_NSVs['identifier'] != 'NSVs') { + throw new getid3_exception('expected "NSVs" at offset ('.$file_offset.'), found "'.$info_nsv_NSVs['identifier'].'" instead'); + } + + $info_nsv_NSVs['offset'] = $file_offset; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_nsv_NSVs, $nsvs_header, 4, + array ( + 'video_codec' => -4, // string + 'audio_codec' => -4, // string + 'resolution_x' => 2, + 'resolution_y' => 2, + 'framerate_index' => 1, + ) + ); + + if ($info_nsv_NSVs['audio_codec'] == 'PCM ') { + + getid3_lib::ReadSequence('LittleEndian2Int', $info_nsv_NSVs, $nsvs_header, 24, + array ( + 'bits_channel' => 1, + 'channels' => 1, + 'sample_rate' => 2 + ) + ); + $getid3->info['audio']['sample_rate'] = $info_nsv_NSVs['sample_rate']; + + } + + $getid3->info['video']['resolution_x'] = $info_nsv_NSVs['resolution_x']; + $getid3->info['video']['resolution_y'] = $info_nsv_NSVs['resolution_y']; + $info_nsv_NSVs['frame_rate'] = getid3_nsv::NSVframerateLookup($info_nsv_NSVs['framerate_index']); + $getid3->info['video']['frame_rate'] = $info_nsv_NSVs['frame_rate']; + $getid3->info['video']['bits_per_sample'] = 24; + $getid3->info['video']['pixel_aspect_ratio'] = (float)1; + + return true; + } + + + + private function getNSVfHeader($file_offset = 0, $get_toc_offsets=false) { + + $getid3 = $this->getid3; + + fseek($getid3->fp, $file_offset, SEEK_SET); + $nsvf_header = fread($getid3->fp, 28); + + $getid3->info['nsv']['NSVf'] = array (); + $info_nsv_NSVf = &$getid3->info['nsv']['NSVf']; + + $info_nsv_NSVf['identifier'] = substr($nsvf_header, 0, 4); + if ($info_nsv_NSVf['identifier'] != 'NSVf') { + throw new getid3_exception('expected "NSVf" at offset ('.$file_offset.'), found "'.$info_nsv_NSVf['identifier'].'" instead'); + } + + $getid3->info['nsv']['NSVs']['offset'] = $file_offset; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_nsv_NSVf, $nsvf_header, 4, + array ( + 'header_length' => 4, + 'file_size' => 4, + 'playtime_ms' => 4, + 'meta_size' => 4, + 'TOC_entries_1' => 4, + 'TOC_entries_2' => 4 + ) + ); + + if ($info_nsv_NSVf['playtime_ms'] == 0) { + throw new getid3_exception('Corrupt NSV file: NSVf.playtime_ms == zero'); + } + + if ($info_nsv_NSVf['file_size'] > $getid3->info['avdataend']) { + $getid3->warning('truncated file - NSVf header indicates '.$info_nsv_NSVf['file_size'].' bytes, file actually '.$getid3->info['avdataend'].' bytes'); + } + + $nsvf_header .= fread($getid3->fp, $info_nsv_NSVf['meta_size'] + (4 * $info_nsv_NSVf['TOC_entries_1']) + (4 * $info_nsv_NSVf['TOC_entries_2'])); + $nsvf_headerlength = strlen($nsvf_header); + $info_nsv_NSVf['metadata'] = substr($nsvf_header, 28, $info_nsv_NSVf['meta_size']); + + $offset = 28 + $info_nsv_NSVf['meta_size']; + if ($get_toc_offsets) { + $toc_counter = 0; + while ($toc_counter < $info_nsv_NSVf['TOC_entries_1']) { + if ($toc_counter < $info_nsv_NSVf['TOC_entries_1']) { + $info_nsv_NSVf['TOC_1'][$toc_counter] = getid3_lib::LittleEndian2Int(substr($nsvf_header, $offset, 4)); + $offset += 4; + $toc_counter++; + } + } + } + + if (trim($info_nsv_NSVf['metadata']) != '') { + $info_nsv_NSVf['metadata'] = str_replace('`', "\x01", $info_nsv_NSVf['metadata']); + $comment_pair_array = explode("\x01".' ', $info_nsv_NSVf['metadata']); + foreach ($comment_pair_array as $comment_pair) { + if (strstr($comment_pair, '='."\x01")) { + list($key, $value) = explode('='."\x01", $comment_pair, 2); + $getid3->info['nsv']['comments'][strtolower($key)][] = trim(str_replace("\x01", '', $value)); + } + } + } + + $getid3->info['playtime_seconds'] = $info_nsv_NSVf['playtime_ms'] / 1000; + $getid3->info['bitrate'] = ($info_nsv_NSVf['file_size'] * 8) / $getid3->info['playtime_seconds']; + + return true; + } + + + + public static function NSVframerateLookup($frame_rate_index) { + + if ($frame_rate_index <= 127) { + return (float)$frame_rate_index; + } + + static $lookup = array ( + 129 => 29.970, + 131 => 23.976, + 133 => 14.985, + 197 => 59.940, + 199 => 47.952 + ); + return (isset($lookup[$frame_rate_index]) ? $lookup[$frame_rate_index] : false); + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.quicktime.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.quicktime.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.quicktime.php 3 Jan 2016 20:51:39 -0000 1.1.2.1 @@ -0,0 +1,1529 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio-video.quicktime.php | +// | Module for analyzing Quicktime, MP3-in-MP4 and Apple Lossless files. | +// | dependencies: module.audio.mp3.php | +// | zlib support in PHP (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.quicktime.php,v 1.1.2.1 2016/01/03 20:51:39 gustafn Exp $ + + + +class getid3_quicktime extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $info = &$getid3->info; + + $getid3->include_module('audio.mp3'); + + $info['quicktime'] = array (); + $info_quicktime = &$info['quicktime']; + + $info['fileformat'] = 'quicktime'; + $info_quicktime['hinting'] = false; + + fseek($getid3->fp, $info['avdataoffset'], SEEK_SET); + + $offset = $atom_counter = 0; + + while ($offset < $info['avdataend']) { + + fseek($getid3->fp, $offset, SEEK_SET); + $atom_header = fread($getid3->fp, 8); + + $atom_size = getid3_lib::BigEndian2Int(substr($atom_header, 0, 4)); + $atom_name = substr($atom_header, 4, 4); + + $info_quicktime[$atom_name]['name'] = $atom_name; + $info_quicktime[$atom_name]['size'] = $atom_size; + $info_quicktime[$atom_name]['offset'] = $offset; + + if (($offset + $atom_size) > $info['avdataend']) { + throw new getid3_exception('Atom at offset '.$offset.' claims to go beyond end-of-file (length: '.$atom_size.' bytes)'); + } + + if ($atom_size == 0) { + // Furthermore, for historical reasons the list of atoms is optionally + // terminated by a 32-bit integer set to 0. If you are writing a program + // to read user data atoms, you should allow for the terminating 0. + break; + } + + switch ($atom_name) { + + case 'mdat': // Media DATa atom + // 'mdat' contains the actual data for the audio/video + if (($atom_size > 8) && (!isset($info['avdataend_tmp']) || ($info_quicktime[$atom_name]['size'] > ($info['avdataend_tmp'] - $info['avdataoffset'])))) { + + $info['avdataoffset'] = $info_quicktime[$atom_name]['offset'] + 8; + $old_av_data_end = $info['avdataend']; + $info['avdataend'] = $info_quicktime[$atom_name]['offset'] + $info_quicktime[$atom_name]['size']; + + + //// MP3 + + if (!$getid3->include_module_optional('audio.mp3')) { + $getid3->warning('MP3 skipped because mpeg module is missing.'); + } + + else { + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + + if (getid3_mp3::MPEGaudioHeaderValid(getid3_mp3::MPEGaudioHeaderDecode(fread($clone->fp, 4)))) { + + $mp3 = new getid3_mp3($clone); + $mp3->AnalyzeMPEGaudioInfo(); + + // Import from clone and destroy + if (isset($clone->info['mpeg']['audio'])) { + + $info['mpeg']['audio'] = $clone->info['mpeg']['audio']; + + $info['audio']['dataformat'] = 'mp3'; + $info['audio']['codec'] = (!empty($info['mpeg']['audio']['encoder']) ? $info['mpeg']['audio']['encoder'] : (!empty($info['mpeg']['audio']['codec']) ? $info['mpeg']['audio']['codec'] : (!empty($info['mpeg']['audio']['LAME']) ? 'LAME' :'mp3'))); + $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; + $info['audio']['channels'] = $info['mpeg']['audio']['channels']; + $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate']; + $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); + $info['bitrate'] = $info['audio']['bitrate']; + + $getid3->warning($clone->warnings()); + unset($clone); + } + } + } + + $info['avdataend'] = $old_av_data_end; + unset($old_av_data_end); + + } + break; + + + case 'free': // FREE space atom + case 'skip': // SKIP atom + case 'wide': // 64-bit expansion placeholder atom + // 'free', 'skip' and 'wide' are just padding, contains no useful data at all + break; + + + default: + $atom_hierarchy = array (); + $info_quicktime[$atom_name] = $this->QuicktimeParseAtom($atom_name, $atom_size, fread($getid3->fp, $atom_size), $offset, $atom_hierarchy); + break; + } + + $offset += $atom_size; + $atom_counter++; + } + + if (!empty($info['avdataend_tmp'])) { + // this value is assigned to a temp value and then erased because + // otherwise any atoms beyond the 'mdat' atom would not get parsed + $info['avdataend'] = $info['avdataend_tmp']; + unset($info['avdataend_tmp']); + } + + if (!isset($info['bitrate']) && isset($info['playtime_seconds'])) { + $info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + } + + if (isset($info['bitrate']) && !isset($info['audio']['bitrate']) && !isset($info_quicktime['video'])) { + $info['audio']['bitrate'] = $info['bitrate']; + } + + if ((@$info['audio']['dataformat'] == 'mp4') && empty($info['video']['resolution_x'])) { + $info['fileformat'] = 'mp4'; + $info['mime_type'] = 'audio/mp4'; + unset($info['video']['dataformat']); + } + + if (!$getid3->option_extra_info) { + unset($info_quicktime['moov']); + } + + if (empty($info['audio']['dataformat']) && !empty($info_quicktime['audio'])) { + $info['audio']['dataformat'] = 'quicktime'; + } + + if (empty($info['video']['dataformat']) && !empty($info_quicktime['video'])) { + $info['video']['dataformat'] = 'quicktime'; + } + + return true; + } + + + + private function QuicktimeParseAtom($atom_name, $atom_size, $atom_data, $base_offset, &$atom_hierarchy) { + + // http://developer.apple.com/techpubs/quicktime/qtdevdocs/APIREF/INDEX/atomalphaindex.htm + + $getid3 = $this->getid3; + + $info = &$getid3->info; + $info_quicktime = &$info['quicktime']; + + array_push($atom_hierarchy, $atom_name); + $atom_structure['hierarchy'] = implode(' ', $atom_hierarchy); + $atom_structure['name'] = $atom_name; + $atom_structure['size'] = $atom_size; + $atom_structure['offset'] = $base_offset; + + switch ($atom_name) { + case 'moov': // MOVie container atom + case 'trak': // TRAcK container atom + case 'clip': // CLIPping container atom + case 'matt': // track MATTe container atom + case 'edts': // EDiTS container atom + case 'tref': // Track REFerence container atom + case 'mdia': // MeDIA container atom + case 'minf': // Media INFormation container atom + case 'dinf': // Data INFormation container atom + case 'udta': // User DaTA container atom + case 'stbl': // Sample TaBLe container atom + case 'cmov': // Compressed MOVie container atom + case 'rmra': // Reference Movie Record Atom + case 'rmda': // Reference Movie Descriptor Atom + case 'gmhd': // Generic Media info HeaDer atom (seen on QTVR) + $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $base_offset + 8, $atom_hierarchy); + break; + + + case '�cpy': + case '�day': + case '�dir': + case '�ed1': + case '�ed2': + case '�ed3': + case '�ed4': + case '�ed5': + case '�ed6': + case '�ed7': + case '�ed8': + case '�ed9': + case '�fmt': + case '�inf': + case '�prd': + case '�prf': + case '�req': + case '�src': + case '�wrt': + case '�nam': + case '�cmt': + case '�wrn': + case '�hst': + case '�mak': + case '�mod': + case '�PRD': + case '�swr': + case '�aut': + case '�ART': + case '�trk': + case '�alb': + case '�com': + case '�gen': + case '�ope': + case '�url': + case '�enc': + $atom_structure['data_length'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 2)); + $atom_structure['language_id'] = getid3_lib::BigEndian2Int(substr($atom_data, 2, 2)); + $atom_structure['data'] = substr($atom_data, 4); + + $atom_structure['language'] = $this->QuicktimeLanguageLookup($atom_structure['language_id']); + if (empty($info['comments']['language']) || (!in_array($atom_structure['language'], $info['comments']['language']))) { + $info['comments']['language'][] = $atom_structure['language']; + } + $this->CopyToAppropriateCommentsSection($atom_name, $atom_structure['data']); + break; + + + case 'play': // auto-PLAY atom + $atom_structure['autoplay'] = (bool)getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); + + $info_quicktime['autoplay'] = $atom_structure['autoplay']; + break; + + + case 'WLOC': // Window LOCation atom + $atom_structure['location_x'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 2)); + $atom_structure['location_y'] = getid3_lib::BigEndian2Int(substr($atom_data, 2, 2)); + break; + + + case 'LOOP': // LOOPing atom + case 'SelO': // play SELection Only atom + case 'AllF': // play ALL Frames atom + $atom_structure['data'] = getid3_lib::BigEndian2Int($atom_data); + break; + + + case 'name': // + case 'MCPS': // Media Cleaner PRo + case '@PRM': // adobe PReMiere version + case '@PRQ': // adobe PRemiere Quicktime version + $atom_structure['data'] = $atom_data; + break; + + + case 'cmvd': // Compressed MooV Data atom + // Code by ubergeek�ubergeek*tv based on information from + // http://developer.apple.com/quicktime/icefloe/dispatch012.html + $atom_structure['unCompressedSize'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 4)); + + $compressed_file_data = substr($atom_data, 4); + if (!function_exists('gzuncompress')) { + $getid3->warning('PHP does not have zlib support - cannot decompress MOV atom at offset '.$atom_structure['offset']); + } + elseif ($uncompressed_header = @gzuncompress($compressed_file_data)) { + $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($uncompressed_header, 0, $atom_hierarchy); + } else { + $getid3->warning('Error decompressing compressed MOV atom at offset '.$atom_structure['offset']); + } + break; + + + case 'dcom': // Data COMpression atom + $atom_structure['compression_id'] = $atom_data; + $atom_structure['compression_text'] = getid3_quicktime::QuicktimeDCOMLookup($atom_data); + break; + + + case 'rdrf': // Reference movie Data ReFerence atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, + 'reference_type_name' => -4, + 'reference_length' => 4, + ) + ); + + $atom_structure['flags']['internal_data'] = (bool)($atom_structure['flags_raw'] & 0x000001); + + switch ($atom_structure['reference_type_name']) { + case 'url ': + $atom_structure['url'] = $this->NoNullString(substr($atom_data, 12)); + break; + + case 'alis': + $atom_structure['file_alias'] = substr($atom_data, 12); + break; + + case 'rsrc': + $atom_structure['resource_alias'] = substr($atom_data, 12); + break; + + default: + $atom_structure['data'] = substr($atom_data, 12); + break; + } + break; + + + case 'rmqu': // Reference Movie QUality atom + $atom_structure['movie_quality'] = getid3_lib::BigEndian2Int($atom_data); + break; + + + case 'rmcs': // Reference Movie Cpu Speed atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'cpu_speed_rating' => 2 + ) + ); + break; + + + case 'rmvc': // Reference Movie Version Check atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'gestalt_selector' => -4, + 'gestalt_value_mask' => 4, + 'gestalt_value' => 4, + 'gestalt_check_type' => 2 + ) + ); + break; + + + case 'rmcd': // Reference Movie Component check atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'component_type' => -4, + 'component_subtype' => -4, + 'component_manufacturer' => -4, + 'component_flags_raw' => 4, + 'component_flags_mask' => 4, + 'component_min_version' => 4 + ) + ); + break; + + + case 'rmdr': // Reference Movie Data Rate atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'data_rate' => 4 + ) + ); + + $atom_structure['data_rate_bps'] = $atom_structure['data_rate'] * 10; + break; + + + case 'rmla': // Reference Movie Language Atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'language_id' => 2 + ) + ); + + $atom_structure['language'] = $this->QuicktimeLanguageLookup($atom_structure['language_id']); + if (empty($info['comments']['language']) || (!in_array($atom_structure['language'], $info['comments']['language']))) { + $info['comments']['language'][] = $atom_structure['language']; + } + break; + + + case 'rmla': // Reference Movie Language Atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'track_id' => 2 + ) + ); + break; + + + case 'ptv ': // Print To Video - defines a movie's full screen mode + // http://developer.apple.com/documentation/QuickTime/APIREF/SOURCESIV/at_ptv-_pg.htm + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'display_size_raw' => 2, + 'reserved_1' => 2, // hardcoded: 0x0000 + 'reserved_2' => 2, // hardcoded: 0x0000 + 'slide_show_flag' => 1, + 'play_on_open_flag' => 1 + ) + ); + + $atom_structure['flags']['play_on_open'] = (bool)$atom_structure['play_on_open_flag']; + $atom_structure['flags']['slide_show'] = (bool)$atom_structure['slide_show_flag']; + + $ptv_lookup[0] = 'normal'; + $ptv_lookup[1] = 'double'; + $ptv_lookup[2] = 'half'; + $ptv_lookup[3] = 'full'; + $ptv_lookup[4] = 'current'; + if (isset($ptv_lookup[$atom_structure['display_size_raw']])) { + $atom_structure['display_size'] = $ptv_lookup[$atom_structure['display_size_raw']]; + } else { + $getid3->warning('unknown "ptv " display constant ('.$atom_structure['display_size_raw'].')'); + } + break; + + + case 'stsd': // Sample Table Sample Description atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'number_entries' => 4 + ) + ); + $stsd_entries_data_offset = 8; + for ($i = 0; $i < $atom_structure['number_entries']; $i++) { + + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure['sample_description_table'][$i], $atom_data, $stsd_entries_data_offset, + array ( + 'size' => 4, + 'data_format' => -4, + 'reserved' => 6, + 'reference_index' => 2 + ) + ); + + $atom_structure['sample_description_table'][$i]['data'] = substr($atom_data, 16+$stsd_entries_data_offset, ($atom_structure['sample_description_table'][$i]['size'] - 4 - 4 - 6 - 2)); + $stsd_entries_data_offset += 16 + ($atom_structure['sample_description_table'][$i]['size'] - 4 - 4 - 6 - 2); + + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure['sample_description_table'][$i], $atom_structure['sample_description_table'][$i]['data'], 0, + array ( + 'encoder_version' => 2, + 'encoder_revision' => 2, + 'encoder_vendor' => -4 + ) + ); + + switch ($atom_structure['sample_description_table'][$i]['encoder_vendor']) { + + case "\x00\x00\x00\x00": + // audio atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure['sample_description_table'][$i], $atom_structure['sample_description_table'][$i]['data'], 8, + array ( + 'audio_channels' => 2, + 'audio_bit_depth' => 2, + 'audio_compression_id' => 2, + 'audio_packet_size' => 2 + ) + ); + + $atom_structure['sample_description_table'][$i]['audio_sample_rate'] = getid3_quicktime::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 16, 4)); + + switch ($atom_structure['sample_description_table'][$i]['data_format']) { + + case 'mp4v': + $info['fileformat'] = 'mp4'; + throw new getid3_exception('This version of getID3() does not fully support MPEG-4 audio/video streams'); + + case 'qtvr': + $info['video']['dataformat'] = 'quicktimevr'; + break; + + case 'mp4a': + default: + $info_quicktime['audio']['codec'] = $this->QuicktimeAudioCodecLookup($atom_structure['sample_description_table'][$i]['data_format']); + $info_quicktime['audio']['sample_rate'] = $atom_structure['sample_description_table'][$i]['audio_sample_rate']; + $info_quicktime['audio']['channels'] = $atom_structure['sample_description_table'][$i]['audio_channels']; + $info_quicktime['audio']['bit_depth'] = $atom_structure['sample_description_table'][$i]['audio_bit_depth']; + $info['audio']['codec'] = $info_quicktime['audio']['codec']; + $info['audio']['sample_rate'] = $info_quicktime['audio']['sample_rate']; + $info['audio']['channels'] = $info_quicktime['audio']['channels']; + $info['audio']['bits_per_sample'] = $info_quicktime['audio']['bit_depth']; + switch ($atom_structure['sample_description_table'][$i]['data_format']) { + case 'raw ': // PCM + case 'alac': // Apple Lossless Audio Codec + $info['audio']['lossless'] = true; + break; + default: + $info['audio']['lossless'] = false; + break; + } + break; + } + break; + + default: + switch ($atom_structure['sample_description_table'][$i]['data_format']) { + case 'mp4s': + $info['fileformat'] = 'mp4'; + break; + + default: + // video atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure['sample_description_table'][$i], $atom_structure['sample_description_table'][$i]['data'], 8, + array ( + 'video_temporal_quality' => 4, + 'video_spatial_quality' => 4, + 'video_frame_width' => 2, + 'video_frame_height' => 2 + ) + ); + $atom_structure['sample_description_table'][$i]['video_resolution_x'] = getid3_quicktime::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 20, 4)); + $atom_structure['sample_description_table'][$i]['video_resolution_y'] = getid3_quicktime::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 24, 4)); + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure['sample_description_table'][$i], $atom_structure['sample_description_table'][$i]['data'], 28, + array ( + 'video_data_size' => 4, + 'video_frame_count' => 2, + 'video_encoder_name_len' => 1 + ) + ); + $atom_structure['sample_description_table'][$i]['video_encoder_name'] = substr($atom_structure['sample_description_table'][$i]['data'], 35, $atom_structure['sample_description_table'][$i]['video_encoder_name_len']); + $atom_structure['sample_description_table'][$i]['video_pixel_color_depth'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 66, 2)); + $atom_structure['sample_description_table'][$i]['video_color_table_id'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 68, 2)); + + $atom_structure['sample_description_table'][$i]['video_pixel_color_type'] = (($atom_structure['sample_description_table'][$i]['video_pixel_color_depth'] > 32) ? 'grayscale' : 'color'); + $atom_structure['sample_description_table'][$i]['video_pixel_color_name'] = $this->QuicktimeColorNameLookup($atom_structure['sample_description_table'][$i]['video_pixel_color_depth']); + + if ($atom_structure['sample_description_table'][$i]['video_pixel_color_name'] != 'invalid') { + $info_quicktime['video']['codec_fourcc'] = $atom_structure['sample_description_table'][$i]['data_format']; + $info_quicktime['video']['codec_fourcc_lookup'] = $this->QuicktimeVideoCodecLookup($atom_structure['sample_description_table'][$i]['data_format']); + $info_quicktime['video']['codec'] = $atom_structure['sample_description_table'][$i]['video_encoder_name']; + $info_quicktime['video']['color_depth'] = $atom_structure['sample_description_table'][$i]['video_pixel_color_depth']; + $info_quicktime['video']['color_depth_name'] = $atom_structure['sample_description_table'][$i]['video_pixel_color_name']; + + $info['video']['codec'] = $info_quicktime['video']['codec']; + $info['video']['bits_per_sample'] = $info_quicktime['video']['color_depth']; + } + $info['video']['lossless'] = false; + $info['video']['pixel_aspect_ratio'] = (float)1; + break; + } + break; + } + switch (strtolower($atom_structure['sample_description_table'][$i]['data_format'])) { + case 'mp4a': + $info['audio']['dataformat'] = $info_quicktime['audio']['codec'] = 'mp4'; + break; + + case '3ivx': + case '3iv1': + case '3iv2': + $info['video']['dataformat'] = '3ivx'; + break; + + case 'xvid': + $info['video']['dataformat'] = 'xvid'; + break; + + case 'mp4v': + $info['video']['dataformat'] = 'mpeg4'; + break; + + case 'divx': + case 'div1': + case 'div2': + case 'div3': + case 'div4': + case 'div5': + case 'div6': + //$TDIVXileInfo['video']['dataformat'] = 'divx'; + break; + + default: + // do nothing + break; + } + unset($atom_structure['sample_description_table'][$i]['data']); + } + break; + + + case 'stts': // Sample Table Time-to-Sample atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'number_entries' => 4 + ) + ); + + $stts_entries_data_offset = 8; + $frame_rate_calculator_array = array (); + for ($i = 0; $i < $atom_structure['number_entries']; $i++) { + + $atom_structure['time_to_sample_table'][$i]['sample_count'] = getid3_lib::BigEndian2Int(substr($atom_data, $stts_entries_data_offset, 4)); + $stts_entries_data_offset += 4; + + $atom_structure['time_to_sample_table'][$i]['sample_duration'] = getid3_lib::BigEndian2Int(substr($atom_data, $stts_entries_data_offset, 4)); + $stts_entries_data_offset += 4; + + if (!empty($info_quicktime['time_scale']) && (@$atoms_structure['time_to_sample_table'][$i]['sample_duration'] > 0)) { + + $stts_new_framerate = $info_quicktime['time_scale'] / $atom_structure['time_to_sample_table'][$i]['sample_duration']; + if ($stts_new_framerate <= 60) { + // some atoms have durations of "1" giving a very large framerate, which probably is not right + $info['video']['frame_rate'] = max(@$info['video']['frame_rate'], $stts_new_framerate); + } + } + //@$frame_rate_calculator_array[($info_quicktime['time_scale'] / $atom_structure['time_to_sample_table'][$i]['sample_duration'])] += $atom_structure['time_to_sample_table'][$i]['sample_count']; + } + /* + $stts_frames_total = 0; + $stts_seconds_total = 0; + foreach ($frame_rate_calculator_array as $frames_per_second => $frame_count) { + if (($frames_per_second > 60) || ($frames_per_second < 1)) { + // not video FPS information, probably audio information + $stts_frames_total = 0; + $stts_seconds_total = 0; + break; + } + $stts_frames_total += $frame_count; + $stts_seconds_total += $frame_count / $frames_per_second; + } + if (($stts_frames_total > 0) && ($stts_seconds_total > 0)) { + if (($stts_frames_total / $stts_seconds_total) > @$info['video']['frame_rate']) { + $info['video']['frame_rate'] = $stts_frames_total / $stts_seconds_total; + } + } + */ + break; + + + case 'stss': // Sample Table Sync Sample (key frames) atom + /* + $atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); + $atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000 + $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 4)); + $stss_entries_data_offset = 8; + for ($i = 0; $i < $atom_structure['number_entries']; $i++) { + $atom_structure['time_to_sample_table'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $stss_entries_data_offset, 4)); + $stss_entries_data_offset += 4; + } + */ + break; + + + case 'stsc': // Sample Table Sample-to-Chunk atom + /* + $atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); + $atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000 + $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 4)); + $stsc_entries_data_offset = 8; + for ($i = 0; $i < $atom_structure['number_entries']; $i++) { + $atom_structure['sample_to_chunk_table'][$i]['first_chunk'] = getid3_lib::BigEndian2Int(substr($atom_data, $stsc_entries_data_offset, 4)); + $stsc_entries_data_offset += 4; + $atom_structure['sample_to_chunk_table'][$i]['samples_per_chunk'] = getid3_lib::BigEndian2Int(substr($atom_data, $stsc_entries_data_offset, 4)); + $stsc_entries_data_offset += 4; + $atom_structure['sample_to_chunk_table'][$i]['sample_description'] = getid3_lib::BigEndian2Int(substr($atom_data, $stsc_entries_data_offset, 4)); + $stsc_entries_data_offset += 4; + } + */ + break; + + + case 'stsz': // Sample Table SiZe atom + /* + $atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); + $atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000 + $atom_structure['sample_size'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 4)); + $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data, 8, 4)); + $stsz_entries_data_offset = 12; + if ($atom_structure['sample_size'] == 0) { + for ($i = 0; $i < $atom_structure['number_entries']; $i++) { + $atom_structure['sample_size_table'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $stsz_entries_data_offset, 4)); + $stsz_entries_data_offset += 4; + } + } + */ + break; + + + case 'stco': // Sample Table Chunk Offset atom + /* + $atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); + $atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000 + $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 4)); + $stco_entries_data_offset = 8; + for ($i = 0; $i < $atom_structure['number_entries']; $i++) { + $atom_structure['chunk_offset_table'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $stco_entries_data_offset, 4)); + $stco_entries_data_offset += 4; + } + */ + break; + + + case 'dref': // Data REFerence atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'number_entries' => 4 + ) + ); + + $dref_data_offset = 8; + for ($i = 0; $i < $atom_structure['number_entries']; $i++) { + + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure['data_references'][$i], $atom_data, $dref_data_offset, + array ( + 'size' => 4, + 'type' => -4, + 'version' => 1, + 'flags_raw' => 3 // hardcoded: 0x0000 + ) + ); + $dref_data_offset += 12; + + $atom_structure['data_references'][$i]['data'] = substr($atom_data, $dref_data_offset, ($atom_structure['data_references'][$i]['size'] - 4 - 4 - 1 - 3)); + $dref_data_offset += ($atom_structure['data_references'][$i]['size'] - 4 - 4 - 1 - 3); + + $atom_structure['data_references'][$i]['flags']['self_reference'] = (bool)($atom_structure['data_references'][$i]['flags_raw'] & 0x001); + } + break; + + + case 'gmin': // base Media INformation atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'graphics_mode' => 2, + 'opcolor_red' => 2, + 'opcolor_green' => 2, + 'opcolor_blue' => 2, + 'balance' => 2, + 'reserved' => 2 + ) + ); + break; + + + case 'smhd': // Sound Media information HeaDer atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'balance' => 2, + 'reserved' => 2 + ) + ); + break; + + + case 'vmhd': // Video Media information HeaDer atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, + 'graphics_mode' => 2, + 'opcolor_red' => 2, + 'opcolor_green' => 2, + 'opcolor_blue' => 2 + ) + ); + $atom_structure['flags']['no_lean_ahead'] = (bool)($atom_structure['flags_raw'] & 0x001); + break; + + + case 'hdlr': // HanDLeR reference atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'component_type' => -4, + 'component_subtype' => -4, + 'component_manufacturer' => -4, + 'component_flags_raw' => 4, + 'component_flags_mask' => 4 + ) + ); + + $atom_structure['component_name'] = substr(substr($atom_data, 24), 1); /// Pascal2String + + if (($atom_structure['component_subtype'] == 'STpn') && ($atom_structure['component_manufacturer'] == 'zzzz')) { + $info['video']['dataformat'] = 'quicktimevr'; + } + break; + + + case 'mdhd': // MeDia HeaDer atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'creation_time' => 4, + 'modify_time' => 4, + 'time_scale' => 4, + 'duration' => 4, + 'language_id' => 2, + 'quality' => 2 + ) + ); + + if ($atom_structure['time_scale'] == 0) { + throw new getid3_exception('Corrupt Quicktime file: mdhd.time_scale == zero'); + } + $info_quicktime['time_scale'] = max(@$info['quicktime']['time_scale'], $atom_structure['time_scale']); + + $atom_structure['creation_time_unix'] = (int)($atom_structure['creation_time'] - 2082844800); // DateMac2Unix() + $atom_structure['modify_time_unix'] = (int)($atom_structure['modify_time'] - 2082844800); // DateMac2Unix() + $atom_structure['playtime_seconds'] = $atom_structure['duration'] / $atom_structure['time_scale']; + $atom_structure['language'] = $this->QuicktimeLanguageLookup($atom_structure['language_id']); + if (empty($info['comments']['language']) || (!in_array($atom_structure['language'], $info['comments']['language']))) { + $info['comments']['language'][] = $atom_structure['language']; + } + break; + + + case 'pnot': // Preview atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'modification_date' => 4, // "standard Macintosh format" + 'version_number' => 2, // hardcoded: 0x00 + 'atom_type' => -4, // usually: 'PICT' + 'atom_index' => 2 // usually: 0x01 + ) + ); + $atom_structure['modification_date_unix'] = (int)($atom_structure['modification_date'] - 2082844800); // DateMac2Unix() + break; + + + case 'crgn': // Clipping ReGioN atom + $atom_structure['region_size'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 2)); // The Region size, Region boundary box, + $atom_structure['boundary_box'] = getid3_lib::BigEndian2Int(substr($atom_data, 2, 8)); // and Clipping region data fields + $atom_structure['clipping_data'] = substr($atom_data, 10); // constitute a QuickDraw region. + break; + + + case 'load': // track LOAD settings atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'preload_start_time' => 4, + 'preload_duration' => 4, + 'preload_flags_raw' => 4, + 'default_hints_raw' => 4 + ) + ); + + $atom_structure['default_hints']['double_buffer'] = (bool)($atom_structure['default_hints_raw'] & 0x0020); + $atom_structure['default_hints']['high_quality'] = (bool)($atom_structure['default_hints_raw'] & 0x0100); + break; + + + case 'tmcd': // TiMe CoDe atom + case 'chap': // CHAPter list atom + case 'sync': // SYNChronization atom + case 'scpt': // tranSCriPT atom + case 'ssrc': // non-primary SouRCe atom + for ($i = 0; $i < (strlen($atom_data) % 4); $i++) { + $atom_structure['track_id'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $i * 4, 4)); + } + break; + + + case 'elst': // Edit LiST atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, // hardcoded: 0x0000 + 'number_entries' => 4 + ) + ); + + for ($i = 0; $i < $atom_structure['number_entries']; $i++ ) { + $atom_structure['edit_list'][$i]['track_duration'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($i * 12) + 0, 4)); + $atom_structure['edit_list'][$i]['media_time'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($i * 12) + 4, 4)); + $atom_structure['edit_list'][$i]['media_rate'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 8 + ($i * 12) + 8, 4)); + } + break; + + + case 'kmat': // compressed MATte atom + $atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); + $atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000 + $atom_structure['matte_data_raw'] = substr($atom_data, 4); + break; + + + case 'ctab': // Color TABle atom + $atom_structure['color_table_seed'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 4)); // hardcoded: 0x00000000 + $atom_structure['color_table_flags'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 2)); // hardcoded: 0x8000 + $atom_structure['color_table_size'] = getid3_lib::BigEndian2Int(substr($atom_data, 6, 2)) + 1; + for ($colortableentry = 0; $colortableentry < $atom_structure['color_table_size']; $colortableentry++) { + $atom_structure['color_table'][$colortableentry]['alpha'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 0, 2)); + $atom_structure['color_table'][$colortableentry]['red'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 2, 2)); + $atom_structure['color_table'][$colortableentry]['green'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 4, 2)); + $atom_structure['color_table'][$colortableentry]['blue'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 6, 2)); + } + break; + + + case 'mvhd': // MoVie HeaDer atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, + 'creation_time' => 4, + 'modify_time' => 4, + 'time_scale' => 4, + 'duration' => 4 + ) + ); + + $atom_structure['preferred_rate'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 20, 4)); + $atom_structure['preferred_volume'] = getid3_quicktime::FixedPoint8_8(substr($atom_data, 24, 2)); + $atom_structure['reserved'] = substr($atom_data, 26, 10); + $atom_structure['matrix_a'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 36, 4)); + $atom_structure['matrix_b'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 40, 4)); + $atom_structure['matrix_u'] = getid3_quicktime::FixedPoint2_30(substr($atom_data, 44, 4)); + $atom_structure['matrix_c'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 48, 4)); + $atom_structure['matrix_d'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 52, 4)); + $atom_structure['matrix_v'] = getid3_quicktime::FixedPoint2_30(substr($atom_data, 56, 4)); + $atom_structure['matrix_x'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 60, 4)); + $atom_structure['matrix_y'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 64, 4)); + $atom_structure['matrix_w'] = getid3_quicktime::FixedPoint2_30(substr($atom_data, 68, 4)); + + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 72, + array ( + 'preview_time' => 4, + 'preview_duration' => 4, + 'poster_time' => 4, + 'selection_time' => 4, + 'selection_duration' => 4, + 'current_time' => 4, + 'next_track_id' => 4 + ) + ); + + if ($atom_structure['time_scale'] == 0) { + throw new getid3_exception('Corrupt Quicktime file: mvhd.time_scale == zero'); + } + + $atom_structure['creation_time_unix'] = (int)($atom_structure['creation_time'] - 2082844800); // DateMac2Unix() + $atom_structure['modify_time_unix'] = (int)($atom_structure['modify_time'] - 2082844800); // DateMac2Unix() + $info_quicktime['time_scale'] = max(@$info['quicktime']['time_scale'], $atom_structure['time_scale']); + $info_quicktime['display_scale'] = $atom_structure['matrix_a']; + $info['playtime_seconds'] = $atom_structure['duration'] / $atom_structure['time_scale']; + break; + + + case 'tkhd': // TracK HeaDer atom + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'version' => 1, + 'flags_raw' => 3, + 'creation_time' => 4, + 'modify_time' => 4, + 'trackid' => 4, + 'reserved1' => 4, + 'duration' => 4, + 'reserved2' => 8, + 'layer' => 2, + 'alternate_group' => 2 + ) + ); + + $atom_structure['volume'] = getid3_quicktime::FixedPoint8_8(substr($atom_data, 36, 2)); + $atom_structure['reserved3'] = getid3_lib::BigEndian2Int(substr($atom_data, 38, 2)); + $atom_structure['matrix_a'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 40, 4)); + $atom_structure['matrix_b'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 44, 4)); + $atom_structure['matrix_u'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 48, 4)); + $atom_structure['matrix_c'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 52, 4)); + $atom_structure['matrix_v'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 56, 4)); + $atom_structure['matrix_d'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 60, 4)); + $atom_structure['matrix_x'] = getid3_quicktime::FixedPoint2_30(substr($atom_data, 64, 4)); + $atom_structure['matrix_y'] = getid3_quicktime::FixedPoint2_30(substr($atom_data, 68, 4)); + $atom_structure['matrix_w'] = getid3_quicktime::FixedPoint2_30(substr($atom_data, 72, 4)); + $atom_structure['width'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 76, 4)); + $atom_structure['height'] = getid3_quicktime::FixedPoint16_16(substr($atom_data, 80, 4)); + + $atom_structure['flags']['enabled'] = (bool)($atom_structure['flags_raw'] & 0x0001); + $atom_structure['flags']['in_movie'] = (bool)($atom_structure['flags_raw'] & 0x0002); + $atom_structure['flags']['in_preview'] = (bool)($atom_structure['flags_raw'] & 0x0004); + $atom_structure['flags']['in_poster'] = (bool)($atom_structure['flags_raw'] & 0x0008); + $atom_structure['creation_time_unix'] = (int)($atom_structure['creation_time'] - 2082844800); // DateMac2Unix() + $atom_structure['modify_time_unix'] = (int)($atom_structure['modify_time'] - 2082844800); // DateMac2Unix() + + if (!isset($info['video']['resolution_x']) || !isset($info['video']['resolution_y'])) { + $info['video']['resolution_x'] = $atom_structure['width']; + $info['video']['resolution_y'] = $atom_structure['height']; + } + + if ($atom_structure['flags']['enabled'] == 1) { + $info['video']['resolution_x'] = max($info['video']['resolution_x'], $atom_structure['width']); + $info['video']['resolution_y'] = max($info['video']['resolution_y'], $atom_structure['height']); + } + + if (!empty($info['video']['resolution_x']) && !empty($info['video']['resolution_y'])) { + $info_quicktime['video']['resolution_x'] = $info['video']['resolution_x']; + $info_quicktime['video']['resolution_y'] = $info['video']['resolution_y']; + } else { + unset($info['video']['resolution_x']); + unset($info['video']['resolution_y']); + unset($info_quicktime['video']); + } + break; + + + case 'meta': // METAdata atom + // http://www.geocities.com/xhelmboyx/quicktime/formats/qti-layout.txt + $next_tag_position = strpos($atom_data, '�'); + while ($next_tag_position < strlen($atom_data)) { + $meta_item_size = getid3_lib::BigEndian2Int(substr($atom_data, $next_tag_position - 4, 4)) - 4; + if ($meta_item_size == -4) { + break; + } + $meta_item_raw = substr($atom_data, $next_tag_position, $meta_item_size); + $meta_item_key = substr($meta_item_raw, 0, 4); + $meta_item_data = substr($meta_item_raw, 20); + $next_tag_position += $meta_item_size + 4; + + $this->CopyToAppropriateCommentsSection($meta_item_key, $meta_item_data); + } + break; + + case 'ftyp': // FileTYPe (?) atom (for MP4 it seems) + getid3_lib::ReadSequence('BigEndian2Int', $atom_structure, $atom_data, 0, + array ( + 'signature' => -4, + 'unknown_1' => 4, + 'fourcc' => -4, + ) + ); + break; + + case 'mdat': // Media DATa atom + case 'free': // FREE space atom + case 'skip': // SKIP atom + case 'wide': // 64-bit expansion placeholder atom + // 'mdat' data is too big to deal with, contains no useful metadata + // 'free', 'skip' and 'wide' are just padding, contains no useful data at all + + // When writing QuickTime files, it is sometimes necessary to update an atom's size. + // It is impossible to update a 32-bit atom to a 64-bit atom since the 32-bit atom + // is only 8 bytes in size, and the 64-bit atom requires 16 bytes. Therefore, QuickTime + // puts an 8-byte placeholder atom before any atoms it may have to update the size of. + // In this way, if the atom needs to be converted from a 32-bit to a 64-bit atom, the + // placeholder atom can be overwritten to obtain the necessary 8 extra bytes. + // The placeholder atom has a type of kWideAtomPlaceholderType ( 'wide' ). + break; + + + case 'nsav': // NoSAVe atom + // http://developer.apple.com/technotes/tn/tn2038.html + $atom_structure['data'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 4)); + break; + + case 'ctyp': // Controller TYPe atom (seen on QTVR) + // http://homepages.slingshot.co.nz/~helmboy/quicktime/formats/qtm-layout.txt + // some controller names are: + // 0x00 + 'std' for linear movie + // 'none' for no controls + $atom_structure['ctyp'] = substr($atom_data, 0, 4); + switch ($atom_structure['ctyp']) { + case 'qtvr': + $info['video']['dataformat'] = 'quicktimevr'; + break; + } + break; + + case 'pano': // PANOrama track (seen on QTVR) + $atom_structure['pano'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 4)); + break; + + case 'hint': // HINT track + case 'hinf': // + case 'hinv': // + case 'hnti': // + $info['quicktime']['hinting'] = true; + break; + + case 'imgt': // IMaGe Track reference (kQTVRImageTrackRefType) (seen on QTVR) + for ($i = 0; $i < ($atom_structure['size'] - 8); $i += 4) { + $atom_structure['imgt'][] = getid3_lib::BigEndian2Int(substr($atom_data, $i, 4)); + } + break; + + case 'FXTC': // Something to do with Adobe After Effects (?) + case 'PrmA': + case 'code': + case 'FIEL': // this is NOT "fiel" (Field Ordering) as describe here: http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap3/chapter_4_section_2.html + // Observed-but-not-handled atom types are just listed here + // to prevent warnings being generated + $atom_structure['data'] = $atom_data; + break; + + default: + $getid3->warning('Unknown QuickTime atom type: "'.$atom_name.'" at offset '.$base_offset); + $atom_structure['data'] = $atom_data; + break; + } + array_pop($atom_hierarchy); + return $atom_structure; + } + + + + private function QuicktimeParseContainerAtom($atom_data, $base_offset, &$atom_hierarchy) { + + if ((strlen($atom_data) == 4) && (getid3_lib::BigEndian2Int($atom_data) == 0x00000000)) { + return false; + } + + $atom_structure = false; + $subatom_offset = 0; + + while ($subatom_offset < strlen($atom_data)) { + + $subatom_size = getid3_lib::BigEndian2Int(substr($atom_data, $subatom_offset + 0, 4)); + $subatom_name = substr($atom_data, $subatom_offset + 4, 4); + $subatom_data = substr($atom_data, $subatom_offset + 8, $subatom_size - 8); + + if ($subatom_size == 0) { + // Furthermore, for historical reasons the list of atoms is optionally + // terminated by a 32-bit integer set to 0. If you are writing a program + // to read user data atoms, you should allow for the terminating 0. + return $atom_structure; + } + + $atom_structure[] = $this->QuicktimeParseAtom($subatom_name, $subatom_size, $subatom_data, $base_offset + $subatom_offset, $atom_hierarchy); + + $subatom_offset += $subatom_size; + } + return $atom_structure; + } + + + + private function CopyToAppropriateCommentsSection($key_name, $data) { + + // http://www.geocities.com/xhelmboyx/quicktime/formats/qtm-layout.txt + + static $translator = array ( + '�cpy' => 'copyright', + '�day' => 'creation_date', + '�dir' => 'director', + '�ed1' => 'edit1', + '�ed2' => 'edit2', + '�ed3' => 'edit3', + '�ed4' => 'edit4', + '�ed5' => 'edit5', + '�ed6' => 'edit6', + '�ed7' => 'edit7', + '�ed8' => 'edit8', + '�ed9' => 'edit9', + '�fmt' => 'format', + '�inf' => 'information', + '�prd' => 'producer', + '�prf' => 'performers', + '�req' => 'system_requirements', + '�src' => 'source_credit', + '�wrt' => 'writer', + '�nam' => 'title', + '�cmt' => 'comment', + '�wrn' => 'warning', + '�hst' => 'host_computer', + '�mak' => 'make', + '�mod' => 'model', + '�PRD' => 'product', + '�swr' => 'software', + '�aut' => 'author', + '�ART' => 'artist', + '�trk' => 'track', + '�alb' => 'album', + '�com' => 'comment', + '�gen' => 'genre', + '�ope' => 'composer', + '�url' => 'url', + '�enc' => 'encoder' + ); + + if (isset($translator[$key_name])) { + $this->getid3->info['quicktime']['comments'][$translator[$key_name]][] = $data; + } + + return true; + } + + + + public static function QuicktimeLanguageLookup($language_id) { + + static $lookup = array ( + 0 => 'English', + 1 => 'French', + 2 => 'German', + 3 => 'Italian', + 4 => 'Dutch', + 5 => 'Swedish', + 6 => 'Spanish', + 7 => 'Danish', + 8 => 'Portuguese', + 9 => 'Norwegian', + 10 => 'Hebrew', + 11 => 'Japanese', + 12 => 'Arabic', + 13 => 'Finnish', + 14 => 'Greek', + 15 => 'Icelandic', + 16 => 'Maltese', + 17 => 'Turkish', + 18 => 'Croatian', + 19 => 'Chinese (Traditional)', + 20 => 'Urdu', + 21 => 'Hindi', + 22 => 'Thai', + 23 => 'Korean', + 24 => 'Lithuanian', + 25 => 'Polish', + 26 => 'Hungarian', + 27 => 'Estonian', + 28 => 'Lettish', + 28 => 'Latvian', + 29 => 'Saamisk', + 29 => 'Lappish', + 30 => 'Faeroese', + 31 => 'Farsi', + 31 => 'Persian', + 32 => 'Russian', + 33 => 'Chinese (Simplified)', + 34 => 'Flemish', + 35 => 'Irish', + 36 => 'Albanian', + 37 => 'Romanian', + 38 => 'Czech', + 39 => 'Slovak', + 40 => 'Slovenian', + 41 => 'Yiddish', + 42 => 'Serbian', + 43 => 'Macedonian', + 44 => 'Bulgarian', + 45 => 'Ukrainian', + 46 => 'Byelorussian', + 47 => 'Uzbek', + 48 => 'Kazakh', + 49 => 'Azerbaijani', + 50 => 'AzerbaijanAr', + 51 => 'Armenian', + 52 => 'Georgian', + 53 => 'Moldavian', + 54 => 'Kirghiz', + 55 => 'Tajiki', + 56 => 'Turkmen', + 57 => 'Mongolian', + 58 => 'MongolianCyr', + 59 => 'Pashto', + 60 => 'Kurdish', + 61 => 'Kashmiri', + 62 => 'Sindhi', + 63 => 'Tibetan', + 64 => 'Nepali', + 65 => 'Sanskrit', + 66 => 'Marathi', + 67 => 'Bengali', + 68 => 'Assamese', + 69 => 'Gujarati', + 70 => 'Punjabi', + 71 => 'Oriya', + 72 => 'Malayalam', + 73 => 'Kannada', + 74 => 'Tamil', + 75 => 'Telugu', + 76 => 'Sinhalese', + 77 => 'Burmese', + 78 => 'Khmer', + 79 => 'Lao', + 80 => 'Vietnamese', + 81 => 'Indonesian', + 82 => 'Tagalog', + 83 => 'MalayRoman', + 84 => 'MalayArabic', + 85 => 'Amharic', + 86 => 'Tigrinya', + 87 => 'Galla', + 87 => 'Oromo', + 88 => 'Somali', + 89 => 'Swahili', + 90 => 'Ruanda', + 91 => 'Rundi', + 92 => 'Chewa', + 93 => 'Malagasy', + 94 => 'Esperanto', + 128 => 'Welsh', + 129 => 'Basque', + 130 => 'Catalan', + 131 => 'Latin', + 132 => 'Quechua', + 133 => 'Guarani', + 134 => 'Aymara', + 135 => 'Tatar', + 136 => 'Uighur', + 137 => 'Dzongkha', + 138 => 'JavaneseRom' + ); + + return (isset($lookup[$language_id]) ? $lookup[$language_id] : 'invalid'); + } + + + + public static function QuicktimeVideoCodecLookup($codec_id) { + + static $lookup = array ( + '3IVX' => '3ivx MPEG-4', + '3IV1' => '3ivx MPEG-4 v1', + '3IV2' => '3ivx MPEG-4 v2', + 'avr ' => 'AVR-JPEG', + 'base' => 'Base', + 'WRLE' => 'BMP', + 'cvid' => 'Cinepak', + 'clou' => 'Cloud', + 'cmyk' => 'CMYK', + 'yuv2' => 'ComponentVideo', + 'yuvu' => 'ComponentVideoSigned', + 'yuvs' => 'ComponentVideoUnsigned', + 'dvc ' => 'DVC-NTSC', + 'dvcp' => 'DVC-PAL', + 'dvpn' => 'DVCPro-NTSC', + 'dvpp' => 'DVCPro-PAL', + 'fire' => 'Fire', + 'flic' => 'FLC', + 'b48r' => '48RGB', + 'gif ' => 'GIF', + 'smc ' => 'Graphics', + 'h261' => 'H261', + 'h263' => 'H263', + 'IV41' => 'Indeo4', + 'jpeg' => 'JPEG', + 'PNTG' => 'MacPaint', + 'msvc' => 'Microsoft Video1', + 'mjpa' => 'Motion JPEG-A', + 'mjpb' => 'Motion JPEG-B', + 'myuv' => 'MPEG YUV420', + 'dmb1' => 'OpenDML JPEG', + 'kpcd' => 'PhotoCD', + '8BPS' => 'Planar RGB', + 'png ' => 'PNG', + 'qdrw' => 'QuickDraw', + 'qdgx' => 'QuickDrawGX', + 'raw ' => 'RAW', + '.SGI' => 'SGI', + 'b16g' => '16Gray', + 'b64a' => '64ARGB', + 'SVQ1' => 'Sorenson Video 1', + 'SVQ1' => 'Sorenson Video 3', + 'syv9' => 'Sorenson YUV9', + 'tga ' => 'Targa', + 'b32a' => '32AlphaGray', + 'tiff' => 'TIFF', + 'path' => 'Vector', + 'rpza' => 'Video', + 'ripl' => 'WaterRipple', + 'WRAW' => 'Windows RAW', + 'y420' => 'YUV420' + ); + + return (isset($lookup[$codec_id]) ? $lookup[$codec_id] : ''); + } + + + + public static function QuicktimeAudioCodecLookup($codec_id) { + + static $lookup = array ( + '.mp3' => 'Fraunhofer MPEG Layer-III alias', + 'aac ' => 'ISO/IEC 14496-3 AAC', + 'agsm' => 'Apple GSM 10:1', + 'alac' => 'Apple Lossless Audio Codec', + 'alaw' => 'A-law 2:1', + 'conv' => 'Sample Format', + 'dvca' => 'DV', + 'dvi ' => 'DV 4:1', + 'eqal' => 'Frequency Equalizer', + 'fl32' => '32-bit Floating Point', + 'fl64' => '64-bit Floating Point', + 'ima4' => 'Interactive Multimedia Association 4:1', + 'in24' => '24-bit Integer', + 'in32' => '32-bit Integer', + 'lpc ' => 'LPC 23:1', + 'MAC3' => 'Macintosh Audio Compression/Expansion (MACE) 3:1', + 'MAC6' => 'Macintosh Audio Compression/Expansion (MACE) 6:1', + 'mixb' => '8-bit Mixer', + 'mixw' => '16-bit Mixer', + 'mp4a' => 'ISO/IEC 14496-3 AAC', + "MS'\x00\x02" => 'Microsoft ADPCM', + "MS'\x00\x11" => 'DV IMA', + "MS\x00\x55" => 'Fraunhofer MPEG Layer III', + 'NONE' => 'No Encoding', + 'Qclp' => 'Qualcomm PureVoice', + 'QDM2' => 'QDesign Music 2', + 'QDMC' => 'QDesign Music 1', + 'ratb' => '8-bit Rate', + 'ratw' => '16-bit Rate', + 'raw ' => 'raw PCM', + 'sour' => 'Sound Source', + 'sowt' => 'signed/two\'s complement (Little Endian)', + 'str1' => 'Iomega MPEG layer II', + 'str2' => 'Iomega MPEG *layer II', + 'str3' => 'Iomega MPEG **layer II', + 'str4' => 'Iomega MPEG ***layer II', + 'twos' => 'signed/two\'s complement (Big Endian)', + 'ulaw' => 'mu-law 2:1', + ); + + return (isset($lookup[$codec_id]) ? $lookup[$codec_id] : ''); + } + + + + public static function QuicktimeDCOMLookup($compression_id) { + + static $lookup = array ( + 'zlib' => 'ZLib Deflate', + 'adec' => 'Apple Compression' + ); + + return (isset($lookup[$compression_id]) ? $lookup[$compression_id] : ''); + } + + + + public static function QuicktimeColorNameLookup($color_depth_id) { + + static $lookup = array ( + 1 => '2-color (monochrome)', + 2 => '4-color', + 4 => '16-color', + 8 => '256-color', + 16 => 'thousands (16-bit color)', + 24 => 'millions (24-bit color)', + 32 => 'millions+ (32-bit color)', + 33 => 'black & white', + 34 => '4-gray', + 36 => '16-gray', + 40 => '256-gray', + ); + + return (isset($lookup[$color_depth_id]) ? $lookup[$color_depth_id] : 'invalid'); + } + + + + public static function NoNullString($null_terminated_string) { + + // remove the single null terminator on null terminated strings + if (substr($null_terminated_string, strlen($null_terminated_string) - 1, 1) === "\x00") { + return substr($null_terminated_string, 0, strlen($null_terminated_string) - 1); + } + + return $null_terminated_string; + } + + + + public static function FixedPoint8_8($raw_data) { + + return getid3_lib::BigEndian2Int($raw_data{0}) + (float)(getid3_lib::BigEndian2Int($raw_data{1}) / 256); + } + + + + public static function FixedPoint16_16($raw_data) { + + return getid3_lib::BigEndian2Int(substr($raw_data, 0, 2)) + (float)(getid3_lib::BigEndian2Int(substr($raw_data, 2, 2)) / 65536); + } + + + + public static function FixedPoint2_30($raw_data) { + + $binary_string = getid3_lib::BigEndian2Bin($raw_data); + return bindec(substr($binary_string, 0, 2)) + (float)(bindec(substr($binary_string, 2, 30)) / 1073741824); + } + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.real.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.real.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.real.php 3 Jan 2016 20:51:40 -0000 1.1.2.1 @@ -0,0 +1,591 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio-video.real.php | +// | Module for analyzing Real Audio/Video files | +// | dependencies: module.audio-video.riff.php | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.real.php,v 1.1.2.1 2016/01/03 20:51:40 gustafn Exp $ + + + +class getid3_real extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->include_module('audio-video.riff'); + + $getid3->info['fileformat'] = 'real'; + $getid3->info['bitrate'] = 0; + $getid3->info['playtime_seconds'] = 0; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $chunk_counter = 0; + + while (ftell($getid3->fp) < $getid3->info['avdataend']) { + + $chunk_data = fread($getid3->fp, 8); + $chunk_name = substr($chunk_data, 0, 4); + $chunk_size = getid3_lib::BigEndian2Int(substr($chunk_data, 4, 4)); + + if ($chunk_name == '.ra'."\xFD") { + $chunk_data .= fread($getid3->fp, $chunk_size - 8); + + if ($this->ParseOldRAheader(substr($chunk_data, 0, 128), $getid3->info['real']['old_ra_header'])) { + + $getid3->info['audio']['dataformat'] = 'real'; + $getid3->info['audio']['lossless'] = false; + $getid3->info['audio']['sample_rate'] = $getid3->info['real']['old_ra_header']['sample_rate']; + $getid3->info['audio']['bits_per_sample'] = $getid3->info['real']['old_ra_header']['bits_per_sample']; + $getid3->info['audio']['channels'] = $getid3->info['real']['old_ra_header']['channels']; + + $getid3->info['playtime_seconds'] = 60 * ($getid3->info['real']['old_ra_header']['audio_bytes'] / $getid3->info['real']['old_ra_header']['bytes_per_minute']); + $getid3->info['audio']['bitrate'] = 8 * ($getid3->info['real']['old_ra_header']['audio_bytes'] / $getid3->info['playtime_seconds']); + $getid3->info['audio']['codec'] = $this->RealAudioCodecFourCClookup($getid3->info['real']['old_ra_header']['fourcc'], $getid3->info['audio']['bitrate']); + + foreach ($getid3->info['real']['old_ra_header']['comments'] as $key => $value_array) { + + if (strlen(trim($value_array[0])) > 0) { + $getid3->info['real']['comments'][$key][] = trim($value_array[0]); + } + } + return true; + } + + throw new getid3_exception('There was a problem parsing this RealAudio file. Please submit it for analysis to http://www.getid3.org/upload/ or info@getid3.org'); + } + + $getid3->info['real']['chunks'][$chunk_counter] = array (); + $info_real_chunks_current_chunk = &$getid3->info['real']['chunks'][$chunk_counter]; + + $info_real_chunks_current_chunk['name'] = $chunk_name; + $info_real_chunks_current_chunk['offset'] = ftell($getid3->fp) - 8; + $info_real_chunks_current_chunk['length'] = $chunk_size; + + if (($info_real_chunks_current_chunk['offset'] + $info_real_chunks_current_chunk['length']) > $getid3->info['avdataend']) { + $getid3->warning('Chunk "'.$info_real_chunks_current_chunk['name'].'" at offset '.$info_real_chunks_current_chunk['offset'].' claims to be '.$info_real_chunks_current_chunk['length'].' bytes long, which is beyond end of file'); + return false; + } + + if ($chunk_size > (getid3::FREAD_BUFFER_SIZE + 8)) { + $chunk_data .= fread($getid3->fp, getid3::FREAD_BUFFER_SIZE - 8); + fseek($getid3->fp, $info_real_chunks_current_chunk['offset'] + $chunk_size, SEEK_SET); + + } elseif(($chunk_size - 8) > 0) { + $chunk_data .= fread($getid3->fp, $chunk_size - 8); + } + $offset = 8; + + switch ($chunk_name) { + + case '.RMF': // RealMedia File Header + + $info_real_chunks_current_chunk['object_version'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + switch ($info_real_chunks_current_chunk['object_version']) { + + case 0: + $info_real_chunks_current_chunk['file_version'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 4)); + $offset += 4; + + $info_real_chunks_current_chunk['headers_count'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 4)); + $offset += 4; + break; + + default: + //$getid3->warning('Expected .RMF-object_version to be "0", actual value is "'.$info_real_chunks_current_chunk['object_version'].'" (should not be a problem)'; + break; + + } + break; + + + case 'PROP': // Properties Header + + $info_real_chunks_current_chunk['object_version'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + if ($info_real_chunks_current_chunk['object_version'] == 0) { + + getid3_lib::ReadSequence('BigEndian2Int', $info_real_chunks_current_chunk, $chunk_data, $offset, + array ( + 'max_bit_rate' => 4, + 'avg_bit_rate' => 4, + 'max_packet_size' => 4, + 'avg_packet_size' => 4, + 'num_packets' => 4, + 'duration' => 4, + 'preroll' => 4, + 'index_offset' => 4, + 'data_offset' => 4, + 'num_streams' => 2, + 'flags_raw' => 2 + ) + ); + $offset += 40; + + $getid3->info['playtime_seconds'] = $info_real_chunks_current_chunk['duration'] / 1000; + if ($info_real_chunks_current_chunk['duration'] > 0) { + $getid3->info['bitrate'] += $info_real_chunks_current_chunk['avg_bit_rate']; + } + + $info_real_chunks_current_chunk['flags']['save_enabled'] = (bool)($info_real_chunks_current_chunk['flags_raw'] & 0x0001); + $info_real_chunks_current_chunk['flags']['perfect_play'] = (bool)($info_real_chunks_current_chunk['flags_raw'] & 0x0002); + $info_real_chunks_current_chunk['flags']['live_broadcast'] = (bool)($info_real_chunks_current_chunk['flags_raw'] & 0x0004); + } + break; + + + case 'MDPR': // Media Properties Header + + $info_real_chunks_current_chunk['object_version'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + if ($info_real_chunks_current_chunk['object_version'] == 0) { + + getid3_lib::ReadSequence('BigEndian2Int', $info_real_chunks_current_chunk, $chunk_data, $offset, + array ( + 'stream_number' => 2, + 'max_bit_rate' => 4, + 'avg_bit_rate' => 4, + 'max_packet_size' => 4, + 'avg_packet_size' => 4, + 'start_time' => 4, + 'preroll' => 4, + 'duration' => 4, + 'stream_name_size' => 1 + ) + ); + $offset += 31; + + $info_real_chunks_current_chunk['stream_name'] = substr($chunk_data, $offset, $info_real_chunks_current_chunk['stream_name_size']); + $offset += $info_real_chunks_current_chunk['stream_name_size']; + + $info_real_chunks_current_chunk['mime_type_size'] = getid3_lib::BigEndian2Int($chunk_data{$offset++}); + + $info_real_chunks_current_chunk['mime_type'] = substr($chunk_data, $offset, $info_real_chunks_current_chunk['mime_type_size']); + $offset += $info_real_chunks_current_chunk['mime_type_size']; + + $info_real_chunks_current_chunk['type_specific_len'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 4)); + $offset += 4; + + $info_real_chunks_current_chunk['type_specific_data'] = substr($chunk_data, $offset, $info_real_chunks_current_chunk['type_specific_len']); + $offset += $info_real_chunks_current_chunk['type_specific_len']; + + $info_real_chunks_current_chunk_typespecificdata = &$info_real_chunks_current_chunk['type_specific_data']; + + switch ($info_real_chunks_current_chunk['mime_type']) { + + case 'video/x-pn-realvideo': + case 'video/x-pn-multirate-realvideo': + // http://www.freelists.org/archives/matroska-devel/07-2003/msg00010.html + + $info_real_chunks_current_chunk['video_info'] = array (); + $info_real_chunks_current_chunk_video_info = &$info_real_chunks_current_chunk['video_info']; + + getid3_lib::ReadSequence('BigEndian2Int', $info_real_chunks_current_chunk_video_info, $info_real_chunks_current_chunk_typespecificdata, 0, + array ( + 'dwSize' => 4, + 'fourcc1' => -4, + 'fourcc2' => -4, + 'width' => 2, + 'height' => 2, + 'bits_per_sample' => 2, + 'IGNORE-unknown1' => 2, + 'IGNORE-unknown2' => 2, + 'frames_per_second' => 2, + 'IGNORE-unknown3' => 2, + 'IGNORE-unknown4' => 2, + 'IGNORE-unknown5' => 2, + 'IGNORE-unknown6' => 2, + 'IGNORE-unknown7' => 2, + 'IGNORE-unknown8' => 2, + 'IGNORE-unknown9' => 2 + ) + ); + + $info_real_chunks_current_chunk_video_info['codec'] = getid3_riff::RIFFfourccLookup($info_real_chunks_current_chunk_video_info['fourcc2']); + + $getid3->info['video']['resolution_x'] = $info_real_chunks_current_chunk_video_info['width']; + $getid3->info['video']['resolution_y'] = $info_real_chunks_current_chunk_video_info['height']; + $getid3->info['video']['frame_rate'] = (float)$info_real_chunks_current_chunk_video_info['frames_per_second']; + $getid3->info['video']['codec'] = $info_real_chunks_current_chunk_video_info['codec']; + $getid3->info['video']['bits_per_sample'] = $info_real_chunks_current_chunk_video_info['bits_per_sample']; + break; + + + case 'audio/x-pn-realaudio': + case 'audio/x-pn-multirate-realaudio': + + $this->ParseOldRAheader($info_real_chunks_current_chunk_typespecificdata, $info_real_chunks_current_chunk['parsed_audio_data']); + + $getid3->info['audio']['sample_rate'] = $info_real_chunks_current_chunk['parsed_audio_data']['sample_rate']; + $getid3->info['audio']['bits_per_sample'] = $info_real_chunks_current_chunk['parsed_audio_data']['bits_per_sample']; + $getid3->info['audio']['channels'] = $info_real_chunks_current_chunk['parsed_audio_data']['channels']; + + if (!empty($getid3->info['audio']['dataformat'])) { + foreach ($getid3->info['audio'] as $key => $value) { + if ($key != 'streams') { + $getid3->info['audio']['streams'][$info_real_chunks_current_chunk['stream_number']][$key] = $value; + } + } + } + break; + + + case 'logical-fileinfo': + + $info_real_chunks_current_chunk['logical_fileinfo']['logical_fileinfo_length'] = getid3_lib::BigEndian2Int(substr($info_real_chunks_current_chunk_typespecificdata, 0, 4)); + // $info_real_chunks_current_chunk['logical_fileinfo']['IGNORE-unknown1'] = getid3_lib::BigEndian2Int(substr($info_real_chunks_current_chunk_typespecificdata, 4, 4)); + $info_real_chunks_current_chunk['logical_fileinfo']['num_tags'] = getid3_lib::BigEndian2Int(substr($info_real_chunks_current_chunk_typespecificdata, 8, 4)); + // $info_real_chunks_current_chunk['logical_fileinfo']['IGNORE-unknown2'] = getid3_lib::BigEndian2Int(substr($info_real_chunks_current_chunk_typespecificdata, 12, 4)); + break; + + } + + + if (empty($getid3->info['playtime_seconds'])) { + $getid3->info['playtime_seconds'] = max($getid3->info['playtime_seconds'], ($info_real_chunks_current_chunk['duration'] + $info_real_chunks_current_chunk['start_time']) / 1000); + } + + if ($info_real_chunks_current_chunk['duration'] > 0) { + + switch ($info_real_chunks_current_chunk['mime_type']) { + + case 'audio/x-pn-realaudio': + case 'audio/x-pn-multirate-realaudio': + + $getid3->info['audio']['bitrate'] = (isset($getid3->info['audio']['bitrate']) ? $getid3->info['audio']['bitrate'] : 0) + $info_real_chunks_current_chunk['avg_bit_rate']; + $getid3->info['audio']['codec'] = $this->RealAudioCodecFourCClookup($info_real_chunks_current_chunk['parsed_audio_data']['fourcc'], $getid3->info['audio']['bitrate']); + $getid3->info['audio']['dataformat'] = 'real'; + $getid3->info['audio']['lossless'] = false; + break; + + + case 'video/x-pn-realvideo': + case 'video/x-pn-multirate-realvideo': + + $getid3->info['video']['bitrate'] = (isset($getid3->info['video']['bitrate']) ? $getid3->info['video']['bitrate'] : 0) + $info_real_chunks_current_chunk['avg_bit_rate']; + $getid3->info['video']['bitrate_mode'] = 'cbr'; + $getid3->info['video']['dataformat'] = 'real'; + $getid3->info['video']['lossless'] = false; + $getid3->info['video']['pixel_aspect_ratio'] = (float)1; + break; + + + case 'audio/x-ralf-mpeg4-generic': + + $getid3->info['audio']['bitrate'] = (isset($getid3->info['audio']['bitrate']) ? $getid3->info['audio']['bitrate'] : 0) + $info_real_chunks_current_chunk['avg_bit_rate']; + $getid3->info['audio']['codec'] = 'RealAudio Lossless'; + $getid3->info['audio']['dataformat'] = 'real'; + $getid3->info['audio']['lossless'] = true; + break; + + } + + $getid3->info['bitrate'] = (isset($getid3->info['video']['bitrate']) ? $getid3->info['video']['bitrate'] : 0) + (isset($getid3->info['audio']['bitrate']) ? $getid3->info['audio']['bitrate'] : 0); + } + } + break; + + + case 'CONT': // Content Description Header (text comments) + + $info_real_chunks_current_chunk['object_version'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + if ($info_real_chunks_current_chunk['object_version'] == 0) { + + $info_real_chunks_current_chunk['title_len'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + $info_real_chunks_current_chunk['title'] = (string) substr($chunk_data, $offset, $info_real_chunks_current_chunk['title_len']); + $offset += $info_real_chunks_current_chunk['title_len']; + + $info_real_chunks_current_chunk['artist_len'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + $info_real_chunks_current_chunk['artist'] = (string) substr($chunk_data, $offset, $info_real_chunks_current_chunk['artist_len']); + $offset += $info_real_chunks_current_chunk['artist_len']; + + $info_real_chunks_current_chunk['copyright_len'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + $info_real_chunks_current_chunk['copyright'] = (string) substr($chunk_data, $offset, $info_real_chunks_current_chunk['copyright_len']); + $offset += $info_real_chunks_current_chunk['copyright_len']; + + $info_real_chunks_current_chunk['comment_len'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + $info_real_chunks_current_chunk['comment'] = (string) substr($chunk_data, $offset, $info_real_chunks_current_chunk['comment_len']); + $offset += $info_real_chunks_current_chunk['comment_len']; + + foreach (array ('title'=>'title', 'artist'=>'artist', 'copyright'=>'copyright', 'comment'=>'comment') as $key => $val) { + if ($info_real_chunks_current_chunk[$key]) { + $getid3->info['real']['comments'][$val][] = trim($info_real_chunks_current_chunk[$key]); + } + } + } + break; + + + case 'DATA': // Data Chunk Header + + // do nothing + break; + + + case 'INDX': // Index Section Header + + $info_real_chunks_current_chunk['object_version'] = getid3_lib::BigEndian2Int(substr($chunk_data, $offset, 2)); + $offset += 2; + + if ($info_real_chunks_current_chunk['object_version'] == 0) { + + getid3_lib::ReadSequence('BigEndian2Int', $info_real_chunks_current_chunk, $chunk_data, $offset, + array ( + 'num_indices' => 4, + 'stream_number' => 2, + 'next_index_header' => 4 + ) + ); + $offset += 10; + + if ($info_real_chunks_current_chunk['next_index_header'] == 0) { + // last index chunk found, ignore rest of file + break 2; + } else { + // non-last index chunk, seek to next index chunk (skipping actual index data) + fseek($getid3->fp, $info_real_chunks_current_chunk['next_index_header'], SEEK_SET); + } + } + break; + + + default: + $getid3->warning('Unhandled RealMedia chunk "'.$chunk_name.'" at offset '.$info_real_chunks_current_chunk['offset']); + break; + } + $chunk_counter++; + } + + if (!empty($getid3->info['audio']['streams'])) { + + $getid3->info['audio']['bitrate'] = 0; + + foreach ($getid3->info['audio']['streams'] as $key => $value_array) { + $getid3->info['audio']['bitrate'] += $value_array['bitrate']; + } + } + + return true; + } + + + + public static function ParseOldRAheader($old_ra_header_data, &$parsed_array) { + + // http://www.freelists.org/archives/matroska-devel/07-2003/msg00010.html + + $parsed_array = array (); + $parsed_array['magic'] = substr($old_ra_header_data, 0, 4); + + if ($parsed_array['magic'] != '.ra'."\xFD") { + return false; + } + + $parsed_array['version1'] = getid3_lib::BigEndian2Int(substr($old_ra_header_data, 4, 2)); + + if ($parsed_array['version1'] < 3) { + + return false; + } + + if ($parsed_array['version1'] == 3) { + + $parsed_array['fourcc1'] = '.ra3'; + $parsed_array['bits_per_sample'] = 16; // hard-coded for old versions? + $parsed_array['sample_rate'] = 8000; // hard-coded for old versions? + + getid3_lib::ReadSequence('BigEndian2Int', $parsed_array, $old_ra_header_data, 6, + array ( + 'header_size' => 2, + 'channels' => 2, // always 1 (?) + 'IGNORE-unknown1' => 2, + 'IGNORE-unknown2' => 2, + 'IGNORE-unknown3' => 2, + 'bytes_per_minute' => 2, + 'audio_bytes' => 4, + ) + ); + + $parsed_array['comments_raw'] = substr($old_ra_header_data, 22, $parsed_array['header_size'] - 22 + 1); // not including null terminator + + $comment_offset = 0; + + foreach (array ('title', 'artist', 'copyright') as $name) { + $comment_length = getid3_lib::BigEndian2Int($parsed_array['comments_raw']{$comment_offset++}); + $parsed_array['comments'][$name][]= substr($parsed_array['comments_raw'], $comment_offset, $comment_length); + $comment_offset += $comment_length; + } + + $comment_offset++; // final null terminator (?) + $comment_offset++; // fourcc length (?) should be 4 + + $parsed_array['fourcc'] = substr($old_ra_header_data, 23 + $comment_offset, 4); + + + } elseif ($parsed_array['version1'] <= 5) { + + getid3_lib::ReadSequence('BigEndian2Int', $parsed_array, $old_ra_header_data, 6, + array ( + 'IGNORE-unknown1' => 2, + 'fourcc1' => -4, + 'file_size' => 4, + 'version2' => 2, + 'header_size' => 4, + 'codec_flavor_id' => 2, + 'coded_frame_size' => 4, + 'audio_bytes' => 4, + 'bytes_per_minute' => 4, + 'IGNORE-unknown5' => 4, + 'sub_packet_h' => 2, + 'frame_size' => 2, + 'sub_packet_size' => 2, + 'IGNORE-unknown6' => 2 + ) + ); + + switch ($parsed_array['version1']) { + + case 4: + + getid3_lib::ReadSequence('BigEndian2Int', $parsed_array, $old_ra_header_data, 48, + array ( + 'sample_rate' => 2, + 'IGNORE-unknown8' => 2, + 'bits_per_sample' => 2, + 'channels' => 2, + 'length_fourcc2' => 1, + 'fourcc2' => -4, + 'length_fourcc3' => 1, + 'fourcc3' => -4, + 'IGNORE-unknown9' => 1, + 'IGNORE-unknown10' => 2, + ) + ); + + $parsed_array['comments_raw'] = substr($old_ra_header_data, 69, $parsed_array['header_size'] - 69 + 16); + + $comment_offset = 0; + + foreach (array ('title', 'artist', 'copyright') as $name) { + $comment_length = getid3_lib::BigEndian2Int($parsed_array['comments_raw']{$comment_offset++}); + $parsed_array['comments'][$name][]= substr($parsed_array['comments_raw'], $comment_offset, $comment_length); + $comment_offset += $comment_length; + } + break; + + + case 5: + + getid3_lib::ReadSequence('BigEndian2Int', $parsed_array, $old_ra_header_data, 48, + array ( + 'sample_rate' => 4, + 'sample_rate2' => 4, + 'bits_per_sample' => 4, + 'channels' => 2, + 'genr' => -4, + 'fourcc3' => -4, + ) + ); + $parsed_array['comments'] = array (); + break; + + } + + $parsed_array['fourcc'] = $parsed_array['fourcc3']; + + } + + foreach ($parsed_array['comments'] as $key => $value) { + + if ($parsed_array['comments'][$key][0] === false) { + $parsed_array['comments'][$key][0] = ''; + } + } + + return true; + } + + + + public static function RealAudioCodecFourCClookup($fourcc, $bitrate) { + + // http://www.its.msstate.edu/net/real/reports/config/tags.stats + // http://www.freelists.org/archives/matroska-devel/06-2003/fullthread18.html + + static $lookup; + + if (empty($lookup)) { + $lookup['14_4'][8000] = 'RealAudio v2 (14.4kbps)'; + $lookup['14.4'][8000] = 'RealAudio v2 (14.4kbps)'; + $lookup['lpcJ'][8000] = 'RealAudio v2 (14.4kbps)'; + $lookup['28_8'][15200] = 'RealAudio v2 (28.8kbps)'; + $lookup['28.8'][15200] = 'RealAudio v2 (28.8kbps)'; + $lookup['sipr'][4933] = 'RealAudio v4 (5kbps Voice)'; + $lookup['sipr'][6444] = 'RealAudio v4 (6.5kbps Voice)'; + $lookup['sipr'][8444] = 'RealAudio v4 (8.5kbps Voice)'; + $lookup['sipr'][16000] = 'RealAudio v4 (16kbps Wideband)'; + $lookup['dnet'][8000] = 'RealAudio v3 (8kbps Music)'; + $lookup['dnet'][16000] = 'RealAudio v3 (16kbps Music Low Response)'; + $lookup['dnet'][15963] = 'RealAudio v3 (16kbps Music Mid/High Response)'; + $lookup['dnet'][20000] = 'RealAudio v3 (20kbps Music Stereo)'; + $lookup['dnet'][32000] = 'RealAudio v3 (32kbps Music Mono)'; + $lookup['dnet'][31951] = 'RealAudio v3 (32kbps Music Stereo)'; + $lookup['dnet'][39965] = 'RealAudio v3 (40kbps Music Mono)'; + $lookup['dnet'][40000] = 'RealAudio v3 (40kbps Music Stereo)'; + $lookup['dnet'][79947] = 'RealAudio v3 (80kbps Music Mono)'; + $lookup['dnet'][80000] = 'RealAudio v3 (80kbps Music Stereo)'; + + $lookup['dnet'][0] = 'RealAudio v3'; + $lookup['sipr'][0] = 'RealAudio v4'; + $lookup['cook'][0] = 'RealAudio G2'; + $lookup['atrc'][0] = 'RealAudio 8'; + } + + $round_bitrate = intval(round($bitrate)); + + if (isset($lookup[$fourcc][$round_bitrate])) { + return $lookup[$fourcc][$round_bitrate]; + } + + if (isset($lookup[$fourcc][0])) { + return $lookup[$fourcc][0]; + } + + return $fourcc; + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.riff.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.riff.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.riff.php 3 Jan 2016 20:51:40 -0000 1.1.2.1 @@ -0,0 +1,2319 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio-video.riff.php | +// | module for analyzing RIFF files: | +// | Wave, AVI, AIFF/AIFC, (MP3,AC3)/RIFF, Wavpack3, 8SVX | +// | dependencies: module.audio.mp3.php (optional) | +// | module.audio.ac3.php (optional) | +// | module.audio.dts.php (optional) | +// | module.audio-video.mpeg.php (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.riff.php,v 1.1.2.1 2016/01/03 20:51:40 gustafn Exp $ + + + +class getid3_riff extends getid3_handler +{ + + private $endian_function = 'LittleEndian2Int'; + + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['riff']['raw'] = array (); + $info_riff = &$getid3->info['riff']; + $info_riff_raw = &$info_riff['raw']; + $info_audio = &$getid3->info['audio']; + $info_video = &$getid3->info['video']; + $info_avdataoffset = &$getid3->info['avdataoffset']; + $info_avdataend = &$getid3->info['avdataend']; + $info_audio_dataformat = &$info_audio['dataformat']; + $info_riff_audio = &$info_riff['audio']; + $info_riff_video = &$info_riff['video']; + + $original['avdataend'] = $info_avdataend; + + $this->fseek($info_avdataoffset, SEEK_SET); + $riff_header = $this->fread(12); + + $riff_sub_type = substr($riff_header, 8, 4); + + switch (substr($riff_header, 0, 4)) { + + case 'FORM': + $getid3->info['fileformat'] = 'aiff'; + $this->endian_function = 'BigEndian2Int'; + $riff_header_size = getid3_lib::BigEndian2Int(substr($riff_header, 4, 4)); + $info_riff[$riff_sub_type] = $this->ParseRIFF($info_avdataoffset + 12, $info_avdataoffset + $riff_header_size); + $info_riff['header_size'] = $riff_header_size; + break; + + + case 'RIFF': + case 'SDSS': // SDSS is identical to RIFF, just renamed. Used by SmartSound QuickTracks (www.smartsound.com) + case 'RMP3': // RMP3 is identical to RIFF, just renamed. Used by [unknown program] when creating RIFF-MP3s + + if ($riff_sub_type == 'RMP3') { + $riff_sub_type = 'WAVE'; + } + + $getid3->info['fileformat'] = 'riff'; + $this->endian_function = 'LittleEndian2Int'; + $riff_header_size = getid3_lib::LittleEndian2Int(substr($riff_header, 4, 4)); + $info_riff[$riff_sub_type] = $this->ParseRIFF($info_avdataoffset + 12, $info_avdataoffset + $riff_header_size); + $info_riff['header_size'] = $riff_header_size; + if ($riff_sub_type == 'WAVE') { + $info_riff_wave = &$info_riff['WAVE']; + } + break; + + + default: + throw new getid3_exception('Cannot parse RIFF (this is maybe not a RIFF / WAV / AVI file?) - expecting "FORM|RIFF|SDSS|RMP3" found "'.$riff_sub_type.'" instead'); + } + + $endian_function = $this->endian_function; + + $stream_index = 0; + switch ($riff_sub_type) { + + case 'WAVE': + + if (empty($info_audio['bitrate_mode'])) { + $info_audio['bitrate_mode'] = 'cbr'; + } + + if (empty($info_audio_dataformat)) { + $info_audio_dataformat = 'wav'; + } + + if (isset($info_riff_wave['data'][0]['offset'])) { + $info_avdataoffset = $info_riff_wave['data'][0]['offset'] + 8; + $info_avdataend = $info_avdataoffset + $info_riff_wave['data'][0]['size']; + } + + if (isset($info_riff_wave['fmt '][0]['data'])) { + + $info_riff_audio[$stream_index] = getid3_riff::RIFFparseWAVEFORMATex($info_riff_wave['fmt '][0]['data']); + $info_audio['wformattag'] = $info_riff_audio[$stream_index]['raw']['wFormatTag']; + $info_riff_raw['fmt '] = $info_riff_audio[$stream_index]['raw']; + unset($info_riff_audio[$stream_index]['raw']); + $info_audio['streams'][$stream_index] = $info_riff_audio[$stream_index]; + + $info_audio = getid3_riff::array_merge_noclobber($info_audio, $info_riff_audio[$stream_index]); + if (substr($info_audio['codec'], 0, strlen('unknown: 0x')) == 'unknown: 0x') { + $getid3->warning('Audio codec = '.$info_audio['codec']); + } + $info_audio['bitrate'] = $info_riff_audio[$stream_index]['bitrate']; + + $getid3->info['playtime_seconds'] = (float)((($info_avdataend - $info_avdataoffset) * 8) / $info_audio['bitrate']); + + $info_audio['lossless'] = false; + + if (isset($info_riff_wave['data'][0]['offset']) && isset($info_riff_raw['fmt ']['wFormatTag'])) { + + switch ($info_riff_raw['fmt ']['wFormatTag']) { + + case 0x0001: // PCM + $info_audio['lossless'] = true; + break; + + case 0x2000: // AC-3 + $info_audio_dataformat = 'ac3'; + break; + + default: + // do nothing + break; + + } + } + + $info_audio['streams'][$stream_index]['wformattag'] = $info_audio['wformattag']; + $info_audio['streams'][$stream_index]['bitrate_mode'] = $info_audio['bitrate_mode']; + $info_audio['streams'][$stream_index]['lossless'] = $info_audio['lossless']; + $info_audio['streams'][$stream_index]['dataformat'] = $info_audio_dataformat; + } + + + if (isset($info_riff_wave['rgad'][0]['data'])) { + + // shortcuts + $rgadData = &$info_riff_wave['rgad'][0]['data']; + $info_riff_raw['rgad'] = array ('track'=>array(), 'album'=>array()); + $info_riff_raw_rgad = &$info_riff_raw['rgad']; + $info_riff_raw_rgad_track = &$info_riff_raw_rgad['track']; + $info_riff_raw_rgad_album = &$info_riff_raw_rgad['album']; + + $info_riff_raw_rgad['fPeakAmplitude'] = getid3_riff::BigEndian2Float(strrev(substr($rgadData, 0, 4))); // LittleEndian2Float() + $info_riff_raw_rgad['nRadioRgAdjust'] = getid3_lib::$endian_function(substr($rgadData, 4, 2)); + $info_riff_raw_rgad['nAudiophileRgAdjust'] = getid3_lib::$endian_function(substr($rgadData, 6, 2)); + + $n_track_rg_adjust_bit_string = str_pad(decbin($info_riff_raw_rgad['nRadioRgAdjust']), 16, '0', STR_PAD_LEFT); + $n_album_rg_adjust_bit_string = str_pad(decbin($info_riff_raw_rgad['nAudiophileRgAdjust']), 16, '0', STR_PAD_LEFT); + + $info_riff_raw_rgad_track['name'] = bindec(substr($n_track_rg_adjust_bit_string, 0, 3)); + $info_riff_raw_rgad_track['originator'] = bindec(substr($n_track_rg_adjust_bit_string, 3, 3)); + $info_riff_raw_rgad_track['signbit'] = bindec($n_track_rg_adjust_bit_string[6]); + $info_riff_raw_rgad_track['adjustment'] = bindec(substr($n_track_rg_adjust_bit_string, 7, 9)); + $info_riff_raw_rgad_album['name'] = bindec(substr($n_album_rg_adjust_bit_string, 0, 3)); + $info_riff_raw_rgad_album['originator'] = bindec(substr($n_album_rg_adjust_bit_string, 3, 3)); + $info_riff_raw_rgad_album['signbit'] = bindec($n_album_rg_adjust_bit_string[6]); + $info_riff_raw_rgad_album['adjustment'] = bindec(substr($n_album_rg_adjust_bit_string, 7, 9)); + + $info_riff['rgad']['peakamplitude'] = $info_riff_raw_rgad['fPeakAmplitude']; + if (($info_riff_raw_rgad_track['name'] != 0) && ($info_riff_raw_rgad_track['originator'] != 0)) { + $info_riff['rgad']['track']['name'] = getid3_lib_replaygain::NameLookup($info_riff_raw_rgad_track['name']); + $info_riff['rgad']['track']['originator'] = getid3_lib_replaygain::OriginatorLookup($info_riff_raw_rgad_track['originator']); + $info_riff['rgad']['track']['adjustment'] = getid3_lib_replaygain::AdjustmentLookup($info_riff_raw_rgad_track['adjustment'], $info_riff_raw_rgad_track['signbit']); + } + + if (($info_riff_raw_rgad_album['name'] != 0) && ($info_riff_raw_rgad_album['originator'] != 0)) { + $info_riff['rgad']['album']['name'] = getid3_lib_replaygain::NameLookup($info_riff_raw_rgad_album['name']); + $info_riff['rgad']['album']['originator'] = getid3_lib_replaygain::OriginatorLookup($info_riff_raw_rgad_album['originator']); + $info_riff['rgad']['album']['adjustment'] = getid3_lib_replaygain::AdjustmentLookup($info_riff_raw_rgad_album['adjustment'], $info_riff_raw_rgad_album['signbit']); + } + } + + if (isset($info_riff_wave['fact'][0]['data'])) { + + $info_riff_raw['fact']['NumberOfSamples'] = getid3_lib::$endian_function(substr($info_riff_wave['fact'][0]['data'], 0, 4)); + + // This should be a good way of calculating exact playtime, but some sample files have had incorrect number of samples, so cannot use this method + // if (!empty($info_riff_raw['fmt ']['nSamplesPerSec'])) { + // $getid3->info['playtime_seconds'] = (float)$info_riff_raw['fact']['NumberOfSamples'] / $info_riff_raw['fmt ']['nSamplesPerSec']; + // } + } + + + if (!empty($info_riff_raw['fmt ']['nAvgBytesPerSec'])) { + $info_audio['bitrate'] = (int)$info_riff_raw['fmt ']['nAvgBytesPerSec'] * 8; + } + + if (isset($info_riff_wave['bext'][0]['data'])) { + + $info_riff_wave_bext_0 = &$info_riff_wave['bext'][0]; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_riff_wave_bext_0, $info_riff_wave_bext_0['data'], 0, + array ( + 'title' => -256, + 'author' => -32, + 'reference' => -32, + 'origin_date' => -10, + 'origin_time' => -8, + 'time_reference' => 8, + 'bwf_version' => 1, + 'reserved' => 254 + ) + ); + + foreach (array ('title', 'author', 'reference') as $key) { + $info_riff_wave_bext_0[$key] = trim($info_riff_wave_bext_0[$key]); + } + + $info_riff_wave_bext_0['coding_history'] = explode("\r\n", trim(substr($info_riff_wave_bext_0['data'], 601))); + + $info_riff_wave_bext_0['origin_date_unix'] = gmmktime(substr($info_riff_wave_bext_0['origin_time'], 0, 2), + substr($info_riff_wave_bext_0['origin_time'], 3, 2), + substr($info_riff_wave_bext_0['origin_time'], 6, 2), + substr($info_riff_wave_bext_0['origin_date'], 5, 2), + substr($info_riff_wave_bext_0['origin_date'], 8, 2), + substr($info_riff_wave_bext_0['origin_date'], 0, 4)); + + $info_riff['comments']['author'][] = $info_riff_wave_bext_0['author']; + $info_riff['comments']['title'][] = $info_riff_wave_bext_0['title']; + } + + if (isset($info_riff_wave['MEXT'][0]['data'])) { + + $info_riff_wave_mext_0 = &$info_riff_wave['MEXT'][0]; + + $info_riff_wave_mext_0['raw']['sound_information'] = getid3_lib::LittleEndian2Int(substr($info_riff_wave_mext_0['data'], 0, 2)); + $info_riff_wave_mext_0['flags']['homogenous'] = (bool)($info_riff_wave_mext_0['raw']['sound_information'] & 0x0001); + if ($info_riff_wave_mext_0['flags']['homogenous']) { + $info_riff_wave_mext_0['flags']['padding'] = ($info_riff_wave_mext_0['raw']['sound_information'] & 0x0002) ? false : true; + $info_riff_wave_mext_0['flags']['22_or_44'] = (bool)($info_riff_wave_mext_0['raw']['sound_information'] & 0x0004); + $info_riff_wave_mext_0['flags']['free_format'] = (bool)($info_riff_wave_mext_0['raw']['sound_information'] & 0x0008); + + $info_riff_wave_mext_0['nominal_frame_size'] = getid3_lib::LittleEndian2Int(substr($info_riff_wave_mext_0['data'], 2, 2)); + } + $info_riff_wave_mext_0['anciliary_data_length'] = getid3_lib::LittleEndian2Int(substr($info_riff_wave_mext_0['data'], 6, 2)); + $info_riff_wave_mext_0['raw']['anciliary_data_def'] = getid3_lib::LittleEndian2Int(substr($info_riff_wave_mext_0['data'], 8, 2)); + $info_riff_wave_mext_0['flags']['anciliary_data_left'] = (bool)($info_riff_wave_mext_0['raw']['anciliary_data_def'] & 0x0001); + $info_riff_wave_mext_0['flags']['anciliary_data_free'] = (bool)($info_riff_wave_mext_0['raw']['anciliary_data_def'] & 0x0002); + $info_riff_wave_mext_0['flags']['anciliary_data_right'] = (bool)($info_riff_wave_mext_0['raw']['anciliary_data_def'] & 0x0004); + } + + if (isset($info_riff_wave['cart'][0]['data'])) { + + $info_riff_wave_cart_0 = &$info_riff_wave['cart'][0]; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_riff_wave_cart_0, $info_riff_wave_cart_0['data'], 0, + array ( + 'version' => -4, + 'title' => -64, + 'artist' => -64, + 'cut_id' => -64, + 'client_id' => -64, + 'category' => -64, + 'classification' => -64, + 'out_cue' => -64, + 'start_date' => -10, + 'start_time' => -8, + 'end_date' => -10, + 'end_time' => -8, + 'producer_app_id' => -64, + 'producer_app_version' => -64, + 'user_defined_text' => -64, + ) + ); + + foreach (array ('artist', 'cut_id', 'client_id', 'category', 'classification', 'out_cue', 'start_date', 'start_time', 'end_date', 'end_time', 'producer_app_id', 'producer_app_version', 'user_defined_text') as $key) { + $info_riff_wave_cart_0[$key] = trim($info_riff_wave_cart_0[$key]); + } + + $info_riff_wave_cart_0['zero_db_reference'] = getid3_lib::LittleEndian2Int(substr($info_riff_wave_cart_0['data'], 680, 4), true); + + for ($i = 0; $i < 8; $i++) { + $info_riff_wave_cart_0['post_time'][$i]['usage_fourcc'] = substr($info_riff_wave_cart_0['data'], 684 + ($i * 8), 4); + $info_riff_wave_cart_0['post_time'][$i]['timer_value'] = getid3_lib::LittleEndian2Int(substr($info_riff_wave_cart_0['data'], 684 + ($i * 8) + 4, 4)); + } + $info_riff_wave_cart_0['url'] = trim(substr($info_riff_wave_cart_0['data'], 748, 1024)); + $info_riff_wave_cart_0['tag_text'] = explode("\r\n", trim(substr($info_riff_wave_cart_0['data'], 1772))); + + $info_riff['comments']['artist'][] = $info_riff_wave_cart_0['artist']; + $info_riff['comments']['title'][] = $info_riff_wave_cart_0['title']; + } + + if (!isset($info_audio['bitrate']) && isset($info_riff_audio[$stream_index]['bitrate'])) { + $info_audio['bitrate'] = $info_riff_audio[$stream_index]['bitrate']; + $getid3->info['playtime_seconds'] = (float)((($info_avdataend - $info_avdataoffset) * 8) / $info_audio['bitrate']); + } + + if (@$getid3->info['wavpack']) { + + if (!$this->data_string_flag) { + + $info_audio_dataformat = 'wavpack'; + $info_audio['bitrate_mode'] = 'vbr'; + $info_audio['encoder'] = 'WavPack v'.$getid3->info['wavpack']['version']; + + // Reset to the way it was - RIFF parsing will have messed this up + $info_avdataend = $original['avdataend']; + $info_audio['bitrate'] = (($info_avdataend - $info_avdataoffset) * 8) / $getid3->info['playtime_seconds']; + + $this->fseek($info_avdataoffset - 44, SEEK_SET); + $riff_data = $this->fread(44); + $orignal_riff_header_size = getid3_lib::LittleEndian2Int(substr($riff_data, 4, 4)) + 8; + $orignal_riff_data_size = getid3_lib::LittleEndian2Int(substr($riff_data, 40, 4)) + 44; + + if ($orignal_riff_header_size > $orignal_riff_data_size) { + $info_avdataend -= ($orignal_riff_header_size - $orignal_riff_data_size); + $this->fseek($info_avdataend, SEEK_SET); + $riff_data .= $this->fread($orignal_riff_header_size - $orignal_riff_data_size); + } + + // move the data chunk after all other chunks (if any) + // so that the RIFF parser doesn't see EOF when trying + // to skip over the data chunk + $riff_data = substr($riff_data, 0, 36).substr($riff_data, 44).substr($riff_data, 36, 8); + + // Save audio info key + $saved_info_audio = $info_audio; + + // Analyze riff_data + $this->AnalyzeString($riff_data); + + // Restore info key + $info_audio = $saved_info_audio; + } + } + + if (isset($info_riff_raw['fmt ']['wFormatTag'])) { + + switch ($info_riff_raw['fmt ']['wFormatTag']) { + + case 0x08AE: // ClearJump LiteWave + $info_audio['bitrate_mode'] = 'vbr'; + $info_audio_dataformat = 'litewave'; + + //typedef struct tagSLwFormat { + // WORD m_wCompFormat; // low byte defines compression method, high byte is compression flags + // DWORD m_dwScale; // scale factor for lossy compression + // DWORD m_dwBlockSize; // number of samples in encoded blocks + // WORD m_wQuality; // alias for the scale factor + // WORD m_wMarkDistance; // distance between marks in bytes + // WORD m_wReserved; + // + // //following paramters are ignored if CF_FILESRC is not set + // DWORD m_dwOrgSize; // original file size in bytes + // WORD m_bFactExists; // indicates if 'fact' chunk exists in the original file + // DWORD m_dwRiffChunkSize; // riff chunk size in the original file + // + // PCMWAVEFORMAT m_OrgWf; // original wave format + // }SLwFormat, *PSLwFormat; + + $info_riff['litewave']['raw'] = array (); + $info_riff_litewave = &$info_riff['litewave']; + $info_riff_litewave_raw = &$info_riff_litewave['raw']; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_riff_litewave_raw, $info_riff_wave['fmt '][0]['data'], 18, + array ( + 'compression_method' => 1, + 'compression_flags' => 1, + 'm_dwScale' => 4, + 'm_dwBlockSize' => 4, + 'm_wQuality' => 2, + 'm_wMarkDistance' => 2, + 'm_wReserved' => 2, + 'm_dwOrgSize' => 4, + 'm_bFactExists' => 2, + 'm_dwRiffChunkSize' => 4 + ) + ); + + //$info_riff_litewave['quality_factor'] = intval(round((2000 - $info_riff_litewave_raw['m_dwScale']) / 20)); + $info_riff_litewave['quality_factor'] = $info_riff_litewave_raw['m_wQuality']; + + $info_riff_litewave['flags']['raw_source'] = ($info_riff_litewave_raw['compression_flags'] & 0x01) ? false : true; + $info_riff_litewave['flags']['vbr_blocksize'] = ($info_riff_litewave_raw['compression_flags'] & 0x02) ? false : true; + $info_riff_litewave['flags']['seekpoints'] = (bool)($info_riff_litewave_raw['compression_flags'] & 0x04); + + $info_audio['lossless'] = (($info_riff_litewave_raw['m_wQuality'] == 100) ? true : false); + $info_audio['encoder_options'] = '-q'.$info_riff_litewave['quality_factor']; + break; + } + } + + if ($info_avdataend > $getid3->info['filesize']) { + + switch (@$info_audio_dataformat) { + + case 'wavpack': // WavPack + case 'lpac': // LPAC + case 'ofr': // OptimFROG + case 'ofs': // OptimFROG DualStream + // lossless compressed audio formats that keep original RIFF headers - skip warning + break; + + + case 'litewave': + + if (($info_avdataend - $getid3->info['filesize']) == 1) { + // LiteWave appears to incorrectly *not* pad actual output file + // to nearest WORD boundary so may appear to be short by one + // byte, in which case - skip warning + } else { + // Short by more than one byte, throw warning + $getid3->warning('Probably truncated file - expecting '.$info_riff[$riff_sub_type]['data'][0]['size'].' bytes of data, only found '.($getid3->info['filesize'] - $info_avdataoffset).' (short by '.($info_riff[$riff_sub_type]['data'][0]['size'] - ($getid3->info['filesize'] - $info_avdataoffset)).' bytes)'); + } + break; + + + default: + + if ((($info_avdataend - $getid3->info['filesize']) == 1) && (($info_riff[$riff_sub_type]['data'][0]['size'] % 2) == 0) && ((($getid3->info['filesize'] - $info_avdataoffset) % 2) == 1)) { + // output file appears to be incorrectly *not* padded to nearest WORD boundary + // Output less severe warning + $getid3->warning('File should probably be padded to nearest WORD boundary, but it is not (expecting '.$info_riff[$riff_sub_type]['data'][0]['size'].' bytes of data, only found '.($getid3->info['filesize'] - $info_avdataoffset).' therefore short by '.($info_riff[$riff_sub_type]['data'][0]['size'] - ($getid3->info['filesize'] - $info_avdataoffset)).' bytes)'); + $info_avdataend = $getid3->info['filesize']; + break; + + } + // Short by more than one byte, throw warning + $getid3->warning('Probably truncated file - expecting '.$info_riff[$riff_sub_type]['data'][0]['size'].' bytes of data, only found '.($getid3->info['filesize'] - $info_avdataoffset).' (short by '.($info_riff[$riff_sub_type]['data'][0]['size'] - ($getid3->info['filesize'] - $info_avdataoffset)).' bytes)'); + $info_avdataend = $getid3->info['filesize']; + break; + } + } + + if (!empty($getid3->info['mpeg']['audio']['LAME']['audio_bytes'])) { + if ((($info_avdataend - $info_avdataoffset) - $getid3->info['mpeg']['audio']['LAME']['audio_bytes']) == 1) { + $info_avdataend--; + $getid3->warning('Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored'); + } + } + + if (@$info_audio_dataformat == 'ac3') { + unset($info_audio['bits_per_sample']); + if (!empty($getid3->info['ac3']['bitrate']) && ($getid3->info['ac3']['bitrate'] != $info_audio['bitrate'])) { + $info_audio['bitrate'] = $getid3->info['ac3']['bitrate']; + } + } + break; + + + case 'AVI ': + $info_video['bitrate_mode'] = 'vbr'; // maybe not, but probably + $info_video['dataformat'] = 'avi'; + $getid3->info['mime_type'] = 'video/avi'; + + if (isset($info_riff[$riff_sub_type]['movi']['offset'])) { + $info_avdataoffset = $info_riff[$riff_sub_type]['movi']['offset'] + 8; + $info_avdataend = $info_avdataoffset + $info_riff[$riff_sub_type]['movi']['size']; + if ($info_avdataend > $getid3->info['filesize']) { + $getid3->warning('Probably truncated file - expecting '.$info_riff[$riff_sub_type]['movi']['size'].' bytes of data, only found '.($getid3->info['filesize'] - $info_avdataoffset).' (short by '.($info_riff[$riff_sub_type]['movi']['size'] - ($getid3->info['filesize'] - $info_avdataoffset)).' bytes)'); + $info_avdataend = $getid3->info['filesize']; + } + } + + if (isset($info_riff['AVI ']['hdrl']['avih'][$stream_index]['data'])) { + $avihData = $info_riff['AVI ']['hdrl']['avih'][$stream_index]['data']; + + $info_riff_raw['avih'] = array (); + $info_riff_raw_avih = &$info_riff_raw['avih']; + + getid3_lib::ReadSequence($this->endian_function, $info_riff_raw_avih, $avihData, 0, + array ( + 'dwMicroSecPerFrame' => 4, // frame display rate (or 0L) + 'dwMaxBytesPerSec' => 4, // max. transfer rate + 'dwPaddingGranularity' => 4, // pad to multiples of this size; normally 2K. + 'dwFlags' => 4, // the ever-present flags + 'dwTotalFrames' => 4, // # frames in file + 'dwInitialFrames' => 4, + 'dwStreams' => 4, + 'dwSuggestedBufferSize' => 4, + 'dwWidth' => 4, + 'dwHeight' => 4, + 'dwScale' => 4, + 'dwRate' => 4, + 'dwStart' => 4, + 'dwLength' => 4 + ) + ); + + $info_riff_raw_avih['flags']['hasindex'] = (bool)($info_riff_raw_avih['dwFlags'] & 0x00000010); + $info_riff_raw_avih['flags']['mustuseindex'] = (bool)($info_riff_raw_avih['dwFlags'] & 0x00000020); + $info_riff_raw_avih['flags']['interleaved'] = (bool)($info_riff_raw_avih['dwFlags'] & 0x00000100); + $info_riff_raw_avih['flags']['trustcktype'] = (bool)($info_riff_raw_avih['dwFlags'] & 0x00000800); + $info_riff_raw_avih['flags']['capturedfile'] = (bool)($info_riff_raw_avih['dwFlags'] & 0x00010000); + $info_riff_raw_avih['flags']['copyrighted'] = (bool)($info_riff_raw_avih['dwFlags'] & 0x00020010); + + $info_riff_video[$stream_index] = array (); + $info_riff_video_current = &$info_riff_video[$stream_index]; + + if ($info_riff_raw_avih['dwWidth'] > 0) { + $info_riff_video_current['frame_width'] = $info_riff_raw_avih['dwWidth']; + $info_video['resolution_x'] = $info_riff_video_current['frame_width']; + } + + if ($info_riff_raw_avih['dwHeight'] > 0) { + $info_riff_video_current['frame_height'] = $info_riff_raw_avih['dwHeight']; + $info_video['resolution_y'] = $info_riff_video_current['frame_height']; + } + + if ($info_riff_raw_avih['dwTotalFrames'] > 0) { + $info_riff_video_current['total_frames'] = $info_riff_raw_avih['dwTotalFrames']; + $info_video['total_frames'] = $info_riff_video_current['total_frames']; + } + + $info_riff_video_current['frame_rate'] = round(1000000 / $info_riff_raw_avih['dwMicroSecPerFrame'], 3); + $info_video['frame_rate'] = $info_riff_video_current['frame_rate']; + } + + if (isset($info_riff['AVI ']['hdrl']['strl']['strh'][0]['data'])) { + if (is_array($info_riff['AVI ']['hdrl']['strl']['strh'])) { + for ($i = 0; $i < count($info_riff['AVI ']['hdrl']['strl']['strh']); $i++) { + if (isset($info_riff['AVI ']['hdrl']['strl']['strh'][$i]['data'])) { + $strh_data = $info_riff['AVI ']['hdrl']['strl']['strh'][$i]['data']; + $strh_fcc_type = substr($strh_data, 0, 4); + + if (isset($info_riff['AVI ']['hdrl']['strl']['strf'][$i]['data'])) { + $strf_data = $info_riff['AVI ']['hdrl']['strl']['strf'][$i]['data']; + + // shortcut + $info_riff_raw_strf_strh_fcc_type_stream_index = &$info_riff_raw['strf'][$strh_fcc_type][$stream_index]; + + switch ($strh_fcc_type) { + case 'auds': + $info_audio['bitrate_mode'] = 'cbr'; + $info_audio_dataformat = 'wav'; + if (isset($info_riff_audio) && is_array($info_riff_audio)) { + $stream_index = count($info_riff_audio); + } + + $info_riff_audio[$stream_index] = getid3_riff::RIFFparseWAVEFORMATex($strf_data); + $info_audio['wformattag'] = $info_riff_audio[$stream_index]['raw']['wFormatTag']; + + // shortcut + $info_audio['streams'][$stream_index] = $info_riff_audio[$stream_index]; + $info_audio_streams_currentstream = &$info_audio['streams'][$stream_index]; + + if (@$info_audio_streams_currentstream['bits_per_sample'] === 0) { + unset($info_audio_streams_currentstream['bits_per_sample']); + } + $info_audio_streams_currentstream['wformattag'] = $info_audio_streams_currentstream['raw']['wFormatTag']; + unset($info_audio_streams_currentstream['raw']); + + // shortcut + $info_riff_raw['strf'][$strh_fcc_type][$stream_index] = $info_riff_audio[$stream_index]['raw']; + + unset($info_riff_audio[$stream_index]['raw']); + $info_audio = getid3_riff::array_merge_noclobber($info_audio, $info_riff_audio[$stream_index]); + + $info_audio['lossless'] = false; + switch ($info_riff_raw_strf_strh_fcc_type_stream_index['wFormatTag']) { + + case 0x0001: // PCM + $info_audio_dataformat = 'wav'; + $info_audio['lossless'] = true; + break; + + case 0x0050: // MPEG Layer 2 or Layer 1 + $info_audio_dataformat = 'mp2'; // Assume Layer-2 + break; + + case 0x0055: // MPEG Layer 3 + $info_audio_dataformat = 'mp3'; + break; + + case 0x00FF: // AAC + $info_audio_dataformat = 'aac'; + break; + + case 0x0161: // Windows Media v7 / v8 / v9 + case 0x0162: // Windows Media Professional v9 + case 0x0163: // Windows Media Lossess v9 + $info_audio_dataformat = 'wma'; + break; + + case 0x2000: // AC-3 + $info_audio_dataformat = 'ac3'; + break; + + case 0x2001: // DTS + $info_audio_dataformat = 'dts'; + break; + + default: + $info_audio_dataformat = 'wav'; + break; + } + $info_audio_streams_currentstream['dataformat'] = $info_audio_dataformat; + $info_audio_streams_currentstream['lossless'] = $info_audio['lossless']; + $info_audio_streams_currentstream['bitrate_mode'] = $info_audio['bitrate_mode']; + break; + + + case 'iavs': + case 'vids': + // shortcut + $info_riff_raw['strh'][$i] = array (); + $info_riff_raw_strh_current = &$info_riff_raw['strh'][$i]; + + getid3_lib::ReadSequence($this->endian_function, $info_riff_raw_strh_current, $strh_data, 0, + array ( + 'fccType' => -4, // same as $strh_fcc_type; + 'fccHandler' => -4, + 'dwFlags' => 4, // Contains AVITF_* flags + 'wPriority' => 2, + 'wLanguage' => 2, + 'dwInitialFrames' => 4, + 'dwScale' => 4, + 'dwRate' => 4, + 'dwStart' => 4, + 'dwLength' => 4, + 'dwSuggestedBufferSize' => 4, + 'dwQuality' => 4, + 'dwSampleSize' => 4, + 'rcFrame' => 4 + ) + ); + + $info_riff_video_current['codec'] = getid3_riff::RIFFfourccLookup($info_riff_raw_strh_current['fccHandler']); + $info_video['fourcc'] = $info_riff_raw_strh_current['fccHandler']; + + if (!$info_riff_video_current['codec'] && isset($info_riff_raw_strf_strh_fcc_type_stream_index['fourcc']) && getid3_riff::RIFFfourccLookup($info_riff_raw_strf_strh_fcc_type_stream_index['fourcc'])) { + $info_riff_video_current['codec'] = getid3_riff::RIFFfourccLookup($info_riff_raw_strf_strh_fcc_type_stream_index['fourcc']); + $info_video['fourcc'] = $info_riff_raw_strf_strh_fcc_type_stream_index['fourcc']; + } + + $info_video['codec'] = $info_riff_video_current['codec']; + $info_video['pixel_aspect_ratio'] = (float)1; + + switch ($info_riff_raw_strh_current['fccHandler']) { + + case 'HFYU': // Huffman Lossless Codec + case 'IRAW': // Intel YUV Uncompressed + case 'YUY2': // Uncompressed YUV 4:2:2 + $info_video['lossless'] = true; + break; + + default: + $info_video['lossless'] = false; + break; + } + + switch ($strh_fcc_type) { + + case 'vids': + getid3_lib::ReadSequence($this->endian_function, $info_riff_raw_strf_strh_fcc_type_stream_index, $strf_data, 0, + array ( + 'biSize' => 4, // number of bytes required by the BITMAPINFOHEADER structure + 'biWidth' => 4, // width of the bitmap in pixels + 'biHeight' => 4, // height of the bitmap in pixels. If biHeight is positive, the bitmap is a 'bottom-up' DIB and its origin is the lower left corner. If biHeight is negative, the bitmap is a 'top-down' DIB and its origin is the upper left corner + 'biPlanes' => 2, // number of color planes on the target device. In most cases this value must be set to 1 + 'biBitCount' => 2, // Specifies the number of bits per pixels + 'fourcc' => -4, // + 'biSizeImage' => 4, // size of the bitmap data section of the image (the actual pixel data, excluding BITMAPINFOHEADER and RGBQUAD structures) + 'biXPelsPerMeter' => 4, // horizontal resolution, in pixels per metre, of the target device + 'biYPelsPerMeter' => 4, // vertical resolution, in pixels per metre, of the target device + 'biClrUsed' => 4, // actual number of color indices in the color table used by the bitmap. If this value is zero, the bitmap uses the maximum number of colors corresponding to the value of the biBitCount member for the compression mode specified by biCompression + 'biClrImportant' => 4 // number of color indices that are considered important for displaying the bitmap. If this value is zero, all colors are important + ) + ); + + $info_video['bits_per_sample'] = $info_riff_raw_strf_strh_fcc_type_stream_index['biBitCount']; + + if ($info_riff_video_current['codec'] == 'DV') { + $info_riff_video_current['dv_type'] = 2; + } + break; + + case 'iavs': + $info_riff_video_current['dv_type'] = 1; + break; + } + break; + + default: + $getid3->warning('Unhandled fccType for stream ('.$i.'): "'.$strh_fcc_type.'"'); + break; + + } + } + } + + if (isset($info_riff_raw_strf_strh_fcc_type_stream_index['fourcc']) && getid3_riff::RIFFfourccLookup($info_riff_raw_strf_strh_fcc_type_stream_index['fourcc'])) { + + $info_riff_video_current['codec'] = getid3_riff::RIFFfourccLookup($info_riff_raw_strf_strh_fcc_type_stream_index['fourcc']); + $info_video['codec'] = $info_riff_video_current['codec']; + $info_video['fourcc'] = $info_riff_raw_strf_strh_fcc_type_stream_index['fourcc']; + + switch ($info_riff_raw_strf_strh_fcc_type_stream_index['fourcc']) { + + case 'HFYU': // Huffman Lossless Codec + case 'IRAW': // Intel YUV Uncompressed + case 'YUY2': // Uncompressed YUV 4:2:2 + $info_video['lossless'] = true; + $info_video['bits_per_sample'] = 24; + break; + + default: + $info_video['lossless'] = false; + $info_video['bits_per_sample'] = 24; + break; + } + + } + } + } + } + break; + + + case 'CDDA': + $info_audio['bitrate_mode'] = 'cbr'; + $info_audio_dataformat = 'cda'; + $info_audio['lossless'] = true; + unset($getid3->info['mime_type']); + + $info_avdataoffset = 44; + + if (isset($info_riff['CDDA']['fmt '][0]['data'])) { + + $info_riff_cdda_fmt_0 = &$info_riff['CDDA']['fmt '][0]; + + getid3_lib::ReadSequence($this->endian_function, $info_riff_cdda_fmt_0, $info_riff_cdda_fmt_0['data'], 0, + array ( + 'unknown1' => 2, + 'track_num' => 2, + 'disc_id' => 4, + 'start_offset_frame' => 4, + 'playtime_frames' => 4, + 'unknown6' => 4, + 'unknown7' => 4 + ) + ); + + $info_riff_cdda_fmt_0['start_offset_seconds'] = (float)$info_riff_cdda_fmt_0['start_offset_frame'] / 75; + $info_riff_cdda_fmt_0['playtime_seconds'] = (float)$info_riff_cdda_fmt_0['playtime_frames'] / 75; + $getid3->info['comments']['track'] = $info_riff_cdda_fmt_0['track_num']; + $getid3->info['playtime_seconds'] = $info_riff_cdda_fmt_0['playtime_seconds']; + + // hardcoded data for CD-audio + $info_audio['sample_rate'] = 44100; + $info_audio['channels'] = 2; + $info_audio['bits_per_sample'] = 16; + $info_audio['bitrate'] = $info_audio['sample_rate'] * $info_audio['channels'] * $info_audio['bits_per_sample']; + $info_audio['bitrate_mode'] = 'cbr'; + } + break; + + + case 'AIFF': + case 'AIFC': + $info_audio['bitrate_mode'] = 'cbr'; + $info_audio_dataformat = 'aiff'; + $info_audio['lossless'] = true; + $getid3->info['mime_type'] = 'audio/x-aiff'; + + if (isset($info_riff[$riff_sub_type]['SSND'][0]['offset'])) { + $info_avdataoffset = $info_riff[$riff_sub_type]['SSND'][0]['offset'] + 8; + $info_avdataend = $info_avdataoffset + $info_riff[$riff_sub_type]['SSND'][0]['size']; + if ($info_avdataend > $getid3->info['filesize']) { + if (($info_avdataend == ($getid3->info['filesize'] + 1)) && (($getid3->info['filesize'] % 2) == 1)) { + // structures rounded to 2-byte boundary, but dumb encoders + // forget to pad end of file to make this actually work + } else { + $getid3->warning('Probable truncated AIFF file: expecting '.$info_riff[$riff_sub_type]['SSND'][0]['size'].' bytes of audio data, only '.($getid3->info['filesize'] - $info_avdataoffset).' bytes found'); + } + $info_avdataend = $getid3->info['filesize']; + } + } + + if (isset($info_riff[$riff_sub_type]['COMM'][0]['data'])) { + + // shortcut + $info_riff_RIFFsubtype_COMM_0_data = &$info_riff[$riff_sub_type]['COMM'][0]['data']; + + $info_riff_audio['channels'] = getid3_lib::BigEndianSyncSafe2Int(substr($info_riff_RIFFsubtype_COMM_0_data, 0, 2)); + $info_riff_audio['total_samples'] = getid3_lib::BigEndian2Int( substr($info_riff_RIFFsubtype_COMM_0_data, 2, 4)); + $info_riff_audio['bits_per_sample'] = getid3_lib::BigEndianSyncSafe2Int(substr($info_riff_RIFFsubtype_COMM_0_data, 6, 2)); + $info_riff_audio['sample_rate'] = (int)getid3_riff::BigEndian2Float(substr($info_riff_RIFFsubtype_COMM_0_data, 8, 10)); + + if ($info_riff[$riff_sub_type]['COMM'][0]['size'] > 18) { + $info_riff_audio['codec_fourcc'] = substr($info_riff_RIFFsubtype_COMM_0_data, 18, 4); + $codec_name_size = getid3_lib::BigEndian2Int(substr($info_riff_RIFFsubtype_COMM_0_data, 22, 1)); + $info_riff_audio['codec_name'] = substr($info_riff_RIFFsubtype_COMM_0_data, 23, $codec_name_size); + + switch ($info_riff_audio['codec_name']) { + + case 'NONE': + $info_audio['codec'] = 'Pulse Code Modulation (PCM)'; + $info_audio['lossless'] = true; + break; + + case '': + switch ($info_riff_audio['codec_fourcc']) { + + // http://developer.apple.com/qa/snd/snd07.html + case 'sowt': + $info_riff_audio['codec_name'] = 'Two\'s Compliment Little-Endian PCM'; + $info_audio['lossless'] = true; + break; + + case 'twos': + $info_riff_audio['codec_name'] = 'Two\'s Compliment Big-Endian PCM'; + $info_audio['lossless'] = true; + break; + + default: + break; + } + break; + + default: + $info_audio['codec'] = $info_riff_audio['codec_name']; + $info_audio['lossless'] = false; + break; + } + } + + $info_audio['channels'] = $info_riff_audio['channels']; + + if ($info_riff_audio['bits_per_sample'] > 0) { + $info_audio['bits_per_sample'] = $info_riff_audio['bits_per_sample']; + } + + $info_audio['sample_rate'] = $info_riff_audio['sample_rate']; + $getid3->info['playtime_seconds'] = $info_riff_audio['total_samples'] / $info_audio['sample_rate']; + } + + if (isset($info_riff[$riff_sub_type]['COMT'])) { + + $comment_count = getid3_lib::BigEndian2Int(substr($info_riff[$riff_sub_type]['COMT'][0]['data'], 0, 2)); + $offset = 2; + + for ($i = 0; $i < $comment_count; $i++) { + + $getid3->info['comments_raw'][$i]['timestamp'] = getid3_lib::BigEndian2Int( substr($info_riff[$riff_sub_type]['COMT'][0]['data'], $offset, 4)); + $offset += 4; + + $getid3->info['comments_raw'][$i]['marker_id'] = getid3_lib::BigEndianSyncSafe2Int(substr($info_riff[$riff_sub_type]['COMT'][0]['data'], $offset, 2)); + $offset += 2; + + $comment_length = getid3_lib::BigEndian2Int( substr($info_riff[$riff_sub_type]['COMT'][0]['data'], $offset, 2)); + $offset += 2; + + $getid3->info['comments_raw'][$i]['comment'] = substr($info_riff[$riff_sub_type]['COMT'][0]['data'], $offset, $comment_length); + $offset += $comment_length; + + $getid3->info['comments_raw'][$i]['timestamp_unix'] = getid3_riff::DateMac2Unix($getid3->info['comments_raw'][$i]['timestamp']); + $info_riff['comments']['comment'][] = $getid3->info['comments_raw'][$i]['comment']; + } + } + + foreach (array ('NAME'=>'title', 'author'=>'artist', '(c) '=>'copyright', 'ANNO'=>'comment') as $key => $value) { + if (isset($info_riff[$riff_sub_type][$key][0]['data'])) { + $info_riff['comments'][$value][] = $info_riff[$riff_sub_type][$key][0]['data']; + } + } + break; + + + case '8SVX': + $info_audio['bitrate_mode'] = 'cbr'; + $info_audio_dataformat = '8svx'; + $info_audio['bits_per_sample'] = 8; + $info_audio['channels'] = 1; // overridden below, if need be + $getid3->info['mime_type'] = 'audio/x-aiff'; + + if (isset($info_riff[$riff_sub_type]['BODY'][0]['offset'])) { + $info_avdataoffset = $info_riff[$riff_sub_type]['BODY'][0]['offset'] + 8; + $info_avdataend = $info_avdataoffset + $info_riff[$riff_sub_type]['BODY'][0]['size']; + if ($info_avdataend > $getid3->info['filesize']) { + $getid3->warning('Probable truncated AIFF file: expecting '.$info_riff[$riff_sub_type]['BODY'][0]['size'].' bytes of audio data, only '.($getid3->info['filesize'] - $info_avdataoffset).' bytes found'); + } + } + + if (isset($info_riff[$riff_sub_type]['VHDR'][0]['offset'])) { + // shortcut + $info_riff_riff_sub_type_vhdr_0 = &$info_riff[$riff_sub_type]['VHDR'][0]; + + getid3_lib::ReadSequence('BigEndian2Int', $info_riff_riff_sub_type_vhdr_0, $info_riff_riff_sub_type_vhdr_0['data'], 0, + array ( + 'oneShotHiSamples' => 4, + 'repeatHiSamples' => 4, + 'samplesPerHiCycle' => 4, + 'samplesPerSec' => 2, + 'ctOctave' => 1, + 'sCompression' => 1, + 'Volume' => -4 + ) + ); + + $info_riff_riff_sub_type_vhdr_0['Volume'] = getid3_riff::FixedPoint16_16($info_riff_riff_sub_type_vhdr_0['Volume']); + + $info_audio['sample_rate'] = $info_riff_riff_sub_type_vhdr_0['samplesPerSec']; + + switch ($info_riff_riff_sub_type_vhdr_0['sCompression']) { + case 0: + $info_audio['codec'] = 'Pulse Code Modulation (PCM)'; + $info_audio['lossless'] = true; + $actual_bits_per_sample = 8; + break; + + case 1: + $info_audio['codec'] = 'Fibonacci-delta encoding'; + $info_audio['lossless'] = false; + $actual_bits_per_sample = 4; + break; + + default: + $getid3->warning('Unexpected sCompression value in 8SVX.VHDR chunk - expecting 0 or 1, found "'.sCompression.'"'); + break; + } + } + + if (isset($info_riff[$riff_sub_type]['CHAN'][0]['data'])) { + $ChannelsIndex = getid3_lib::BigEndian2Int(substr($info_riff[$riff_sub_type]['CHAN'][0]['data'], 0, 4)); + switch ($ChannelsIndex) { + case 6: // Stereo + $info_audio['channels'] = 2; + break; + + case 2: // Left channel only + case 4: // Right channel only + $info_audio['channels'] = 1; + break; + + default: + $getid3->warning('Unexpected value in 8SVX.CHAN chunk - expecting 2 or 4 or 6, found "'.$ChannelsIndex.'"'); + break; + } + + } + + foreach (array ('NAME'=>'title', 'author'=>'artist', '(c) '=>'copyright', 'ANNO'=>'comment') as $key => $value) { + if (isset($info_riff[$riff_sub_type][$key][0]['data'])) { + $info_riff['comments'][$value][] = $info_riff[$riff_sub_type][$key][0]['data']; + } + } + + $info_audio['bitrate'] = $info_audio['sample_rate'] * $actual_bits_per_sample * $info_audio['channels']; + if (!empty($info_audio['bitrate'])) { + $getid3->info['playtime_seconds'] = ($info_avdataend - $info_avdataoffset) / ($info_audio['bitrate'] / 8); + } + break; + + + case 'CDXA': + + $getid3->info['mime_type'] = 'video/mpeg'; + if (!empty($info_riff['CDXA']['data'][0]['size'])) { + $GETID3_ERRORARRAY = &$getid3->info['warning']; + + if (!$getid3->include_module_optional('audio-video.mpeg')) { + $getid3->warning('MPEG skipped because mpeg module is missing.'); + } + + else { + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + + // Analyse + $mpeg = new getid3_mpeg($clone); + $mpeg->Analyze(); + + // Import from clone and destroy + $getid3->info['audio'] = $clone->info['audio']; + $getid3->info['video'] = $clone->info['video']; + $getid3->info['mpeg'] = $clone->info['mpeg']; + $getid3->info['warning'] = $clone->info['warning']; + + unset($clone); + } + } + + break; + + + default: + throw new getid3_exception('Unknown RIFF type: expecting one of (WAVE|RMP3|AVI |CDDA|AIFF|AIFC|8SVX|CDXA), found "'.$riff_sub_type.'" instead'); + } + + + if (@$info_riff_raw['fmt ']['wFormatTag'] == 1) { + + // http://www.mega-nerd.com/erikd/Blog/Windiots/dts.html + $this->fseek($getid3->info['avdataoffset'], SEEK_SET); + $bytes4 = $this->fread(4); + + // DTSWAV + if (preg_match('/^\xFF\x1F\x00\xE8/s', $bytes4)) { + $info_audio_dataformat = 'dts'; + } + + // DTS, but this probably shouldn't happen + elseif (preg_match('/^\x7F\xFF\x80\x01/s', $bytes4)) { + $info_audio_dataformat = 'dts'; + } + } + + if (@is_array($info_riff_wave['DISP'])) { + $info_riff['comments']['title'][] = trim(substr($info_riff_wave['DISP'][count($info_riff_wave['DISP']) - 1]['data'], 4)); + } + + if (@is_array($info_riff_wave['INFO'])) { + getid3_riff::RIFFCommentsParse($info_riff_wave['INFO'], $info_riff['comments']); + } + + if (isset($info_riff_wave['INFO']) && is_array($info_riff_wave['INFO'])) { + + foreach (array ('IARL' => 'archivallocation', 'IART' => 'artist', 'ICDS' => 'costumedesigner', 'ICMS' => 'commissionedby', 'ICMT' => 'comment', 'ICNT' => 'country', 'ICOP' => 'copyright', 'ICRD' => 'creationdate', 'IDIM' => 'dimensions', 'IDIT' => 'digitizationdate', 'IDPI' => 'resolution', 'IDST' => 'distributor', 'IEDT' => 'editor', 'IENG' => 'engineers', 'IFRM' => 'accountofparts', 'IGNR' => 'genre', 'IKEY' => 'keywords', 'ILGT' => 'lightness', 'ILNG' => 'language', 'IMED' => 'orignalmedium', 'IMUS' => 'composer', 'INAM' => 'title', 'IPDS' => 'productiondesigner', 'IPLT' => 'palette', 'IPRD' => 'product', 'IPRO' => 'producer', 'IPRT' => 'part', 'IRTD' => 'rating', 'ISBJ' => 'subject', 'ISFT' => 'software', 'ISGN' => 'secondarygenre', 'ISHP' => 'sharpness', 'ISRC' => 'sourcesupplier', 'ISRF' => 'digitizationsource', 'ISTD' => 'productionstudio', 'ISTR' => 'starring', 'ITCH' => 'encoded_by', 'IWEB' => 'url', 'IWRI' => 'writer') as $key => $value) { + if (isset($info_riff_wave['INFO'][$key])) { + foreach ($info_riff_wave['INFO'][$key] as $comment_id => $comment_data) { + if (trim($comment_data['data']) != '') { + $info_riff['comments'][$value][] = trim($comment_data['data']); + } + } + } + } + } + + if (empty($info_audio['encoder']) && !empty($getid3->info['mpeg']['audio']['LAME']['short_version'])) { + $info_audio['encoder'] = $getid3->info['mpeg']['audio']['LAME']['short_version']; + } + + if (!isset($getid3->info['playtime_seconds'])) { + $getid3->info['playtime_seconds'] = 0; + } + + if (isset($info_riff_raw['avih']['dwTotalFrames']) && isset($info_riff_raw['avih']['dwMicroSecPerFrame'])) { + $getid3->info['playtime_seconds'] = $info_riff_raw['avih']['dwTotalFrames'] * ($info_riff_raw['avih']['dwMicroSecPerFrame'] / 1000000); + } + + if ($getid3->info['playtime_seconds'] > 0) { + if (isset($info_riff_audio) && isset($info_riff_video)) { + + if (!isset($getid3->info['bitrate'])) { + $getid3->info['bitrate'] = ((($info_avdataend - $info_avdataoffset) / $getid3->info['playtime_seconds']) * 8); + } + + } elseif (isset($info_riff_audio) && !isset($info_riff_video)) { + + if (!isset($info_audio['bitrate'])) { + $info_audio['bitrate'] = ((($info_avdataend - $info_avdataoffset) / $getid3->info['playtime_seconds']) * 8); + } + + } elseif (!isset($info_riff_audio) && isset($info_riff_video)) { + + if (!isset($info_video['bitrate'])) { + $info_video['bitrate'] = ((($info_avdataend - $info_avdataoffset) / $getid3->info['playtime_seconds']) * 8); + } + + } + } + + + if (isset($info_riff_video) && isset($info_audio['bitrate']) && ($info_audio['bitrate'] > 0) && ($getid3->info['playtime_seconds'] > 0)) { + + $getid3->info['bitrate'] = ((($info_avdataend - $info_avdataoffset) / $getid3->info['playtime_seconds']) * 8); + $info_audio['bitrate'] = 0; + $info_video['bitrate'] = $getid3->info['bitrate']; + foreach ($info_riff_audio as $channelnumber => $audioinfoarray) { + $info_video['bitrate'] -= $audioinfoarray['bitrate']; + $info_audio['bitrate'] += $audioinfoarray['bitrate']; + } + if ($info_video['bitrate'] <= 0) { + unset($info_video['bitrate']); + } + if ($info_audio['bitrate'] <= 0) { + unset($info_audio['bitrate']); + } + } + + if (isset($getid3->info['mpeg']['audio'])) { + $info_audio_dataformat = 'mp'.$getid3->info['mpeg']['audio']['layer']; + $info_audio['sample_rate'] = $getid3->info['mpeg']['audio']['sample_rate']; + $info_audio['channels'] = $getid3->info['mpeg']['audio']['channels']; + $info_audio['bitrate'] = $getid3->info['mpeg']['audio']['bitrate']; + $info_audio['bitrate_mode'] = strtolower($getid3->info['mpeg']['audio']['bitrate_mode']); + + if (!empty($getid3->info['mpeg']['audio']['codec'])) { + $info_audio['codec'] = $getid3->info['mpeg']['audio']['codec'].' '.$info_audio['codec']; + } + + if (!empty($info_audio['streams'])) { + foreach ($info_audio['streams'] as $streamnumber => $streamdata) { + if ($streamdata['dataformat'] == $info_audio_dataformat) { + $info_audio['streams'][$streamnumber]['sample_rate'] = $info_audio['sample_rate']; + $info_audio['streams'][$streamnumber]['channels'] = $info_audio['channels']; + $info_audio['streams'][$streamnumber]['bitrate'] = $info_audio['bitrate']; + $info_audio['streams'][$streamnumber]['bitrate_mode'] = $info_audio['bitrate_mode']; + $info_audio['streams'][$streamnumber]['codec'] = $info_audio['codec']; + } + } + } + $info_audio['encoder_options'] = getid3_mp3::GuessEncoderOptions($getid3->info); + } + + + if (!empty($info_riff_raw['fmt ']['wBitsPerSample']) && ($info_riff_raw['fmt ']['wBitsPerSample'] > 0)) { + switch ($info_audio_dataformat) { + case 'ac3': + // ignore bits_per_sample + break; + + default: + $info_audio['bits_per_sample'] = $info_riff_raw['fmt ']['wBitsPerSample']; + break; + } + } + + + if (empty($info_riff_raw)) { + unset($info_riff['raw']); + } + if (empty($info_riff_audio)) { + unset($info_riff['audio']); + } + if (empty($info_riff_video)) { + unset($info_riff['video']); + } + if (empty($info_audio_dataformat)) { + unset($info_audio['dataformat']); + } + if (empty($getid3->info['audio'])) { + unset($getid3->info['audio']); + } + if (empty($info_video)) { + unset($getid3->info['video']); + } + + return true; + } + + + + public function ParseRIFF($start_offset, $max_offset) { + + $getid3 = $this->getid3; + + $info = &$getid3->info; + + $endian_function = $this->endian_function; + + $max_offset = min($max_offset, $info['avdataend']); + + $riff_chunk = false; + + $this->fseek($start_offset, SEEK_SET); + + while ($this->ftell() < $max_offset) { + + $chunk_name = $this->fread(4); + + if (strlen($chunk_name) < 4) { + throw new getid3_exception('Expecting chunk name at offset '.($this->ftell() - 4).' but found nothing. Aborting RIFF parsing.'); + } + + $chunk_size = getid3_lib::$endian_function($this->fread(4)); + + if ($chunk_size == 0) { + continue; + throw new getid3_exception('Chunk size at offset '.($this->ftell() - 4).' is zero. Aborting RIFF parsing.'); + } + + if (($chunk_size % 2) != 0) { + // all structures are packed on word boundaries + $chunk_size++; + } + + switch ($chunk_name) { + + case 'LIST': + $list_name = $this->fread(4); + + switch ($list_name) { + + case 'movi': + case 'rec ': + $riff_chunk[$list_name]['offset'] = $this->ftell() - 4; + $riff_chunk[$list_name]['size'] = $chunk_size; + + static $parsed_audio_stream = false; + + if (!$parsed_audio_stream) { + $where_we_were = $this->ftell(); + $audio_chunk_header = $this->fread(12); + $audio_chunk_stream_num = substr($audio_chunk_header, 0, 2); + $audio_chunk_stream_type = substr($audio_chunk_header, 2, 2); + $audio_chunk_size = getid3_lib::LittleEndian2Int(substr($audio_chunk_header, 4, 4)); + + if ($audio_chunk_stream_type == 'wb') { + $first_four_bytes = substr($audio_chunk_header, 8, 4); + + + //// MPEG + + if (preg_match('/^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]/s', $first_four_bytes)) { + + if (!$getid3->include_module_optional('audio.mp3')) { + $getid3->warning('MP3 skipped because mp3 module is missing.'); + } + + elseif (getid3_mp3::MPEGaudioHeaderBytesValid($first_four_bytes)) { + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + $clone->info['avdataoffset'] = $this->ftell() - 4; + $clone->info['avdataend'] = $this->ftell() + $audio_chunk_size; + + $mp3 = new getid3_mp3($clone); + $mp3->AnalyzeMPEGaudioInfo(); + + // Import from clone and destroy + if (isset($clone->info['mpeg']['audio'])) { + + $info['mpeg']['audio'] = $clone->info['mpeg']['audio']; + + $info['audio']['dataformat'] = 'mp'.$info['mpeg']['audio']['layer']; + $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; + $info['audio']['channels'] = $info['mpeg']['audio']['channels']; + $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate']; + $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); + $info['bitrate'] = $info['audio']['bitrate']; + + $getid3->warning($clone->warnings()); + unset($clone); + } + } + } + + //// AC3-WAVE + + elseif (preg_match('/^\x0B\x77/s', $first_four_bytes)) { + + if (!$getid3->include_module_optional('audio.ac3')) { + $getid3->warning('AC3 skipped because ac3 module is missing.'); + } + + else { + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + $clone->info['avdataoffset'] = $this->ftell() - 4; + $clone->info['avdataend'] = $this->ftell() + $audio_chunk_size; + + // Analyze clone by fp + $ac3 = new getid3_ac3($clone); + $ac3->Analyze(); + + // Import from clone and destroy + $info['audio'] = $clone->info['audio']; + $info['ac3'] = $clone->info['ac3']; + $getid3->warning($clone->warnings()); + unset($clone); + } + } + } + + $parsed_audio_stream = true; + $this->fseek($where_we_were, SEEK_SET); + + } + $this->fseek($chunk_size - 4, SEEK_CUR); + break; + + default: + if (!isset($riff_chunk[$list_name])) { + $riff_chunk[$list_name] = array (); + } + $list_chunk_parent = $list_name; + $list_chunk_max_offset = $this->ftell() - 4 + $chunk_size; + if ($parsed_chunk = $this->ParseRIFF($this->ftell(), $this->ftell() + $chunk_size - 4)) { + $riff_chunk[$list_name] = array_merge_recursive($riff_chunk[$list_name], $parsed_chunk); + } + break; + } + break; + + + default: + + $this_index = 0; + if (isset($riff_chunk[$chunk_name]) && is_array($riff_chunk[$chunk_name])) { + $this_index = count($riff_chunk[$chunk_name]); + } + $riff_chunk[$chunk_name][$this_index]['offset'] = $this->ftell() - 8; + $riff_chunk[$chunk_name][$this_index]['size'] = $chunk_size; + switch ($chunk_name) { + case 'data': + $info['avdataoffset'] = $this->ftell(); + $info['avdataend'] = $info['avdataoffset'] + $chunk_size; + + $riff_data_chunk_contents_test = $this->fread(36); + + + //// This is probably MP3 data + + if ((strlen($riff_data_chunk_contents_test) > 0) && preg_match('/^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]/s', substr($riff_data_chunk_contents_test, 0, 4))) { + + try { + + if (!$getid3->include_module_optional('audio.mp3')) { + $getid3->warning('MP3 skipped because mp3 module is missing.'); + } + + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + + if (getid3_mp3::MPEGaudioHeaderBytesValid(substr($riff_data_chunk_contents_test, 0, 4))) { + + $mp3 = new getid3_mp3($clone); + $mp3->AnalyzeMPEGaudioInfo(); + + // Import from clone and destroy + if (isset($clone->info['mpeg']['audio'])) { + + $info['mpeg']['audio'] = $clone->info['mpeg']['audio']; + + $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; + $info['audio']['channels'] = $info['mpeg']['audio']['channels']; + $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate']; + $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); + $info['bitrate'] = $info['audio']['bitrate']; + + $getid3->warning($clone->warnings()); + unset($clone); + } + } + } + catch (Exception $e) { + // do nothing - not MP3 data + } + } + + + //// This is probably AC-3 data + + elseif ((strlen($riff_data_chunk_contents_test) > 0) && (substr($riff_data_chunk_contents_test, 0, 2) == "\x0B\x77")) { + + if (!$getid3->include_module_optional('audio.ac3')) { + $getid3->warning('AC3 skipped because ac3 module is missing.'); + } + + else { + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + $clone->info['avdataoffset'] = $riff_chunk[$chunk_name][$this_index]['offset']; + $clone->info['avdataend'] = $clone->info['avdataoffset'] + $riff_chunk[$chunk_name][$this_index]['size']; + + // Analyze clone by fp + $ac3 = new getid3_ac3($clone); + $ac3->Analyze(); + + // Import from clone and destroy + $info['audio'] = $clone->info['audio']; + $info['ac3'] = $clone->info['ac3']; + $getid3->warning($clone->warnings()); + unset($clone); + } + } + + + // Dolby Digital WAV + // AC-3 content, but not encoded in same format as normal AC-3 file + // For one thing, byte order is swapped + + elseif ((strlen($riff_data_chunk_contents_test) > 0) && (substr($riff_data_chunk_contents_test, 8, 2) == "\x77\x0B")) { + + if (!$getid3->include_module_optional('audio.ac3')) { + $getid3->warning('AC3 skipped because ac3 module is missing.'); + } + + else { + + // Extract ac3 data to string + $ac3_data = ''; + for ($i = 0; $i < 28; $i += 2) { + // swap byte order + $ac3_data .= substr($riff_data_chunk_contents_test, 8 + $i + 1, 1); + $ac3_data .= substr($riff_data_chunk_contents_test, 8 + $i + 0, 1); + } + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + $clone->info['avdataoffset'] = 0; + $clone->info['avdataend'] = 20; + + // Analyse clone by string + $ac3 = new getid3_ac3($clone); + $ac3->AnalyzeString($ac3_data); + + // Import from clone and destroy + $info['audio'] = $clone->info['audio']; + $info['ac3'] = $clone->info['ac3']; + $getid3->warning($clone->warnings()); + unset($clone); + } + } + + + if ((strlen($riff_data_chunk_contents_test) > 0) && (substr($riff_data_chunk_contents_test, 0, 4) == 'wvpk')) { + + // This is WavPack data + $info['wavpack']['offset'] = $riff_chunk[$chunk_name][$this_index]['offset']; + $info['wavpack']['size'] = getid3_lib::LittleEndian2Int(substr($riff_data_chunk_contents_test, 4, 4)); + $this->RIFFparseWavPackHeader(substr($riff_data_chunk_contents_test, 8, 28)); + + } else { + + // This is some other kind of data (quite possibly just PCM) + // do nothing special, just skip it + + } + $this->fseek($riff_chunk[$chunk_name][$this_index]['offset'] + 8 + $chunk_size, SEEK_SET); + break; + + case 'bext': + case 'cart': + case 'fmt ': + case 'MEXT': + case 'DISP': + // always read data in + $riff_chunk[$chunk_name][$this_index]['data'] = $this->fread($chunk_size); + break; + + default: + if (!empty($list_chunk_parent) && (($riff_chunk[$chunk_name][$this_index]['offset'] + $riff_chunk[$chunk_name][$this_index]['size']) <= $list_chunk_max_offset)) { + $riff_chunk[$list_chunk_parent][$chunk_name][$this_index]['offset'] = $riff_chunk[$chunk_name][$this_index]['offset']; + $riff_chunk[$list_chunk_parent][$chunk_name][$this_index]['size'] = $riff_chunk[$chunk_name][$this_index]['size']; + unset($riff_chunk[$chunk_name][$this_index]['offset']); + unset($riff_chunk[$chunk_name][$this_index]['size']); + if (isset($riff_chunk[$chunk_name][$this_index]) && empty($riff_chunk[$chunk_name][$this_index])) { + unset($riff_chunk[$chunk_name][$this_index]); + } + if (isset($riff_chunk[$chunk_name]) && empty($riff_chunk[$chunk_name])) { + unset($riff_chunk[$chunk_name]); + } + $riff_chunk[$list_chunk_parent][$chunk_name][$this_index]['data'] = $this->fread($chunk_size); + } elseif ($chunk_size < 2048) { + // only read data in if smaller than 2kB + $riff_chunk[$chunk_name][$this_index]['data'] = $this->fread($chunk_size); + } else { + $this->fseek($chunk_size, SEEK_CUR); + } + break; + } + break; + + } + + } + + return $riff_chunk; + } + + + + private function RIFFparseWavPackHeader($wavpack3_chunk_data) { + + // typedef struct { + // char ckID [4]; + // long ckSize; + // short version; + // short bits; // added for version 2.00 + // short flags, shift; // added for version 3.00 + // long total_samples, crc, crc2; + // char extension [4], extra_bc, extras [3]; + // } WavpackHeader; + + $this->getid3->info['wavpack'] = array (); + $info_wavpack = &$this->getid3->info['wavpack']; + + $info_wavpack['version'] = getid3_lib::LittleEndian2Int(substr($wavpack3_chunk_data, 0, 2)); + + if ($info_wavpack['version'] >= 2) { + $info_wavpack['bits'] = getid3_lib::LittleEndian2Int(substr($wavpack3_chunk_data, 2, 2)); + } + + if ($info_wavpack['version'] >= 3) { + + getid3_lib::ReadSequence('LittleEndian2Int', $info_wavpack, $wavpack3_chunk_data, 4, + array ( + 'flags_raw' => 2, + 'shift' => 2, + 'total_samples' => 4, + 'crc1' => 4, + 'crc2' => 4, + 'extension' => -4, + 'extra_bc' => 1 + ) + ); + + for ($i = 0; $i < 3; $i++) { + $info_wavpack['extras'][] = getid3_lib::LittleEndian2Int($wavpack3_chunk_data{25 + $i}); + } + + $info_wavpack['flags'] = array (); + $info_wavpack_flags = &$info_wavpack['flags']; + + $info_wavpack_flags['mono'] = (bool)($info_wavpack['flags_raw'] & 0x000001); + $info_wavpack_flags['fast_mode'] = (bool)($info_wavpack['flags_raw'] & 0x000002); + $info_wavpack_flags['raw_mode'] = (bool)($info_wavpack['flags_raw'] & 0x000004); + $info_wavpack_flags['calc_noise'] = (bool)($info_wavpack['flags_raw'] & 0x000008); + $info_wavpack_flags['high_quality'] = (bool)($info_wavpack['flags_raw'] & 0x000010); + $info_wavpack_flags['3_byte_samples'] = (bool)($info_wavpack['flags_raw'] & 0x000020); + $info_wavpack_flags['over_20_bits'] = (bool)($info_wavpack['flags_raw'] & 0x000040); + $info_wavpack_flags['use_wvc'] = (bool)($info_wavpack['flags_raw'] & 0x000080); + $info_wavpack_flags['noiseshaping'] = (bool)($info_wavpack['flags_raw'] & 0x000100); + $info_wavpack_flags['very_fast_mode'] = (bool)($info_wavpack['flags_raw'] & 0x000200); + $info_wavpack_flags['new_high_quality'] = (bool)($info_wavpack['flags_raw'] & 0x000400); + $info_wavpack_flags['cancel_extreme'] = (bool)($info_wavpack['flags_raw'] & 0x000800); + $info_wavpack_flags['cross_decorrelation'] = (bool)($info_wavpack['flags_raw'] & 0x001000); + $info_wavpack_flags['new_decorrelation'] = (bool)($info_wavpack['flags_raw'] & 0x002000); + $info_wavpack_flags['joint_stereo'] = (bool)($info_wavpack['flags_raw'] & 0x004000); + $info_wavpack_flags['extra_decorrelation'] = (bool)($info_wavpack['flags_raw'] & 0x008000); + $info_wavpack_flags['override_noiseshape'] = (bool)($info_wavpack['flags_raw'] & 0x010000); + $info_wavpack_flags['override_jointstereo'] = (bool)($info_wavpack['flags_raw'] & 0x020000); + $info_wavpack_flags['copy_source_filetime'] = (bool)($info_wavpack['flags_raw'] & 0x040000); + $info_wavpack_flags['create_exe'] = (bool)($info_wavpack['flags_raw'] & 0x080000); + } + + return true; + } + + + + public function AnalyzeString(&$string) { + + // Rewrite header_size in header + $new_header_size = getid3_lib::LittleEndian2String(strlen($string), 4); + for ($i = 0; $i < 4; $i++) { + $string{$i + 4} = $new_header_size{$i}; + } + + return parent::AnalyzeString($string); + } + + + + public static function RIFFparseWAVEFORMATex($wave_format_ex_data) { + + $wave_format_ex['raw'] = array (); + $wave_format_ex_raw = &$wave_format_ex['raw']; + + getid3_lib::ReadSequence('LittleEndian2Int', $wave_format_ex_raw, $wave_format_ex_data, 0, + array ( + 'wFormatTag' => 2, + 'nChannels' => 2, + 'nSamplesPerSec' => 4, + 'nAvgBytesPerSec' => 4, + 'nBlockAlign' => 2, + 'wBitsPerSample' => 2 + ) + ); + + if (strlen($wave_format_ex_data) > 16) { + $wave_format_ex_raw['cbSize'] = getid3_lib::LittleEndian2Int(substr($wave_format_ex_data, 16, 2)); + } + + $wave_format_ex['codec'] = getid3_riff::RIFFwFormatTagLookup($wave_format_ex_raw['wFormatTag']); + $wave_format_ex['channels'] = $wave_format_ex_raw['nChannels']; + $wave_format_ex['sample_rate'] = $wave_format_ex_raw['nSamplesPerSec']; + $wave_format_ex['bitrate'] = $wave_format_ex_raw['nAvgBytesPerSec'] * 8; + if (@$wave_format_ex_raw['wBitsPerSample']) { + $wave_format_ex['bits_per_sample'] = $wave_format_ex_raw['wBitsPerSample']; + } + + return $wave_format_ex; + } + + + + public static function RIFFwFormatTagLookup($w_format_tag) { + + static $lookup = array ( + 0x0000 => 'Microsoft Unknown Wave Format', + 0x0001 => 'Pulse Code Modulation (PCM)', + 0x0002 => 'Microsoft ADPCM', + 0x0003 => 'IEEE Float', + 0x0004 => 'Compaq Computer VSELP', + 0x0005 => 'IBM CVSD', + 0x0006 => 'Microsoft A-Law', + 0x0007 => 'Microsoft mu-Law', + 0x0008 => 'Microsoft DTS', + 0x0010 => 'OKI ADPCM', + 0x0011 => 'Intel DVI/IMA ADPCM', + 0x0012 => 'Videologic MediaSpace ADPCM', + 0x0013 => 'Sierra Semiconductor ADPCM', + 0x0014 => 'Antex Electronics G.723 ADPCM', + 0x0015 => 'DSP Solutions DigiSTD', + 0x0016 => 'DSP Solutions DigiFIX', + 0x0017 => 'Dialogic OKI ADPCM', + 0x0018 => 'MediaVision ADPCM', + 0x0019 => 'Hewlett-Packard CU', + 0x0020 => 'Yamaha ADPCM', + 0x0021 => 'Speech Compression Sonarc', + 0x0022 => 'DSP Group TrueSpeech', + 0x0023 => 'Echo Speech EchoSC1', + 0x0024 => 'Audiofile AF36', + 0x0025 => 'Audio Processing Technology APTX', + 0x0026 => 'AudioFile AF10', + 0x0027 => 'Prosody 1612', + 0x0028 => 'LRC', + 0x0030 => 'Dolby AC2', + 0x0031 => 'Microsoft GSM 6.10', + 0x0032 => 'MSNAudio', + 0x0033 => 'Antex Electronics ADPCME', + 0x0034 => 'Control Resources VQLPC', + 0x0035 => 'DSP Solutions DigiREAL', + 0x0036 => 'DSP Solutions DigiADPCM', + 0x0037 => 'Control Resources CR10', + 0x0038 => 'Natural MicroSystems VBXADPCM', + 0x0039 => 'Crystal Semiconductor IMA ADPCM', + 0x003A => 'EchoSC3', + 0x003B => 'Rockwell ADPCM', + 0x003C => 'Rockwell Digit LK', + 0x003D => 'Xebec', + 0x0040 => 'Antex Electronics G.721 ADPCM', + 0x0041 => 'G.728 CELP', + 0x0042 => 'MSG723', + 0x0050 => 'MPEG Layer-2 or Layer-1', + 0x0052 => 'RT24', + 0x0053 => 'PAC', + 0x0055 => 'MPEG Layer-3', + 0x0059 => 'Lucent G.723', + 0x0060 => 'Cirrus', + 0x0061 => 'ESPCM', + 0x0062 => 'Voxware', + 0x0063 => 'Canopus Atrac', + 0x0064 => 'G.726 ADPCM', + 0x0065 => 'G.722 ADPCM', + 0x0066 => 'DSAT', + 0x0067 => 'DSAT Display', + 0x0069 => 'Voxware Byte Aligned', + 0x0070 => 'Voxware AC8', + 0x0071 => 'Voxware AC10', + 0x0072 => 'Voxware AC16', + 0x0073 => 'Voxware AC20', + 0x0074 => 'Voxware MetaVoice', + 0x0075 => 'Voxware MetaSound', + 0x0076 => 'Voxware RT29HW', + 0x0077 => 'Voxware VR12', + 0x0078 => 'Voxware VR18', + 0x0079 => 'Voxware TQ40', + 0x0080 => 'Softsound', + 0x0081 => 'Voxware TQ60', + 0x0082 => 'MSRT24', + 0x0083 => 'G.729A', + 0x0084 => 'MVI MV12', + 0x0085 => 'DF G.726', + 0x0086 => 'DF GSM610', + 0x0088 => 'ISIAudio', + 0x0089 => 'Onlive', + 0x0091 => 'SBC24', + 0x0092 => 'Dolby AC3 SPDIF', + 0x0093 => 'MediaSonic G.723', + 0x0094 => 'Aculab PLC Prosody 8kbps', + 0x0097 => 'ZyXEL ADPCM', + 0x0098 => 'Philips LPCBB', + 0x0099 => 'Packed', + 0x00FF => 'AAC', + 0x0100 => 'Rhetorex ADPCM', + 0x0101 => 'IBM mu-law', + 0x0102 => 'IBM A-law', + 0x0103 => 'IBM AVC Adaptive Differential Pulse Code Modulation (ADPCM)', + 0x0111 => 'Vivo G.723', + 0x0112 => 'Vivo Siren', + 0x0123 => 'Digital G.723', + 0x0125 => 'Sanyo LD ADPCM', + 0x0130 => 'Sipro Lab Telecom ACELP NET', + 0x0131 => 'Sipro Lab Telecom ACELP 4800', + 0x0132 => 'Sipro Lab Telecom ACELP 8V3', + 0x0133 => 'Sipro Lab Telecom G.729', + 0x0134 => 'Sipro Lab Telecom G.729A', + 0x0135 => 'Sipro Lab Telecom Kelvin', + 0x0140 => 'Windows Media Video V8', + 0x0150 => 'Qualcomm PureVoice', + 0x0151 => 'Qualcomm HalfRate', + 0x0155 => 'Ring Zero Systems TUB GSM', + 0x0160 => 'Microsoft Audio 1', + 0x0161 => 'Windows Media Audio V7 / V8 / V9', + 0x0162 => 'Windows Media Audio Professional V9', + 0x0163 => 'Windows Media Audio Lossless V9', + 0x0200 => 'Creative Labs ADPCM', + 0x0202 => 'Creative Labs Fastspeech8', + 0x0203 => 'Creative Labs Fastspeech10', + 0x0210 => 'UHER Informatic GmbH ADPCM', + 0x0220 => 'Quarterdeck', + 0x0230 => 'I-link Worldwide VC', + 0x0240 => 'Aureal RAW Sport', + 0x0250 => 'Interactive Products HSX', + 0x0251 => 'Interactive Products RPELP', + 0x0260 => 'Consistent Software CS2', + 0x0270 => 'Sony SCX', + 0x0300 => 'Fujitsu FM Towns Snd', + 0x0400 => 'BTV Digital', + 0x0401 => 'Intel Music Coder', + 0x0450 => 'QDesign Music', + 0x0680 => 'VME VMPCM', + 0x0681 => 'AT&T Labs TPC', + 0x08AE => 'ClearJump LiteWave', + 0x1000 => 'Olivetti GSM', + 0x1001 => 'Olivetti ADPCM', + 0x1002 => 'Olivetti CELP', + 0x1003 => 'Olivetti SBC', + 0x1004 => 'Olivetti OPR', + 0x1100 => 'Lernout & Hauspie Codec (0x1100)', + 0x1101 => 'Lernout & Hauspie CELP Codec (0x1101)', + 0x1102 => 'Lernout & Hauspie SBC Codec (0x1102)', + 0x1103 => 'Lernout & Hauspie SBC Codec (0x1103)', + 0x1104 => 'Lernout & Hauspie SBC Codec (0x1104)', + 0x1400 => 'Norris', + 0x1401 => 'AT&T ISIAudio', + 0x1500 => 'Soundspace Music Compression', + 0x181C => 'VoxWare RT24 Speech', + 0x1FC4 => 'NCT Soft ALF2CD (www.nctsoft.com)', + 0x2000 => 'Dolby AC3', + 0x2001 => 'Dolby DTS', + 0x2002 => 'WAVE_FORMAT_14_4', + 0x2003 => 'WAVE_FORMAT_28_8', + 0x2004 => 'WAVE_FORMAT_COOK', + 0x2005 => 'WAVE_FORMAT_DNET', + 0x674F => 'Ogg Vorbis 1', + 0x6750 => 'Ogg Vorbis 2', + 0x6751 => 'Ogg Vorbis 3', + 0x676F => 'Ogg Vorbis 1+', + 0x6770 => 'Ogg Vorbis 2+', + 0x6771 => 'Ogg Vorbis 3+', + 0x7A21 => 'GSM-AMR (CBR, no SID)', + 0x7A22 => 'GSM-AMR (VBR, including SID)', + 0xFFFE => 'WAVE_FORMAT_EXTENSIBLE', + 0xFFFF => 'WAVE_FORMAT_DEVELOPMENT' + ); + + return @$lookup[$w_format_tag]; + } + + + + public static function RIFFfourccLookup($four_cc) { + + static $lookup = array ( + 'swot' => 'http://developer.apple.com/qa/snd/snd07.html', + '____' => 'No Codec (____)', + '_BIT' => 'BI_BITFIELDS (Raw RGB)', + '_JPG' => 'JPEG compressed', + '_PNG' => 'PNG compressed W3C/ISO/IEC (RFC-2083)', + '_RAW' => 'Full Frames (Uncompressed)', + '_RGB' => 'Raw RGB Bitmap', + '_RL4' => 'RLE 4bpp RGB', + '_RL8' => 'RLE 8bpp RGB', + '3IV1' => '3ivx MPEG-4 v1', + '3IV2' => '3ivx MPEG-4 v2', + '3IVX' => '3ivx MPEG-4', + 'AASC' => 'Autodesk Animator', + 'ABYR' => 'Kensington ?ABYR?', + 'AEMI' => 'Array Microsystems VideoONE MPEG1-I Capture', + 'AFLC' => 'Autodesk Animator FLC', + 'AFLI' => 'Autodesk Animator FLI', + 'AMPG' => 'Array Microsystems VideoONE MPEG', + 'ANIM' => 'Intel RDX (ANIM)', + 'AP41' => 'AngelPotion Definitive', + 'ASV1' => 'Asus Video v1', + 'ASV2' => 'Asus Video v2', + 'ASVX' => 'Asus Video 2.0 (audio)', + 'AUR2' => 'AuraVision Aura 2 Codec - YUV 4:2:2', + 'AURA' => 'AuraVision Aura 1 Codec - YUV 4:1:1', + 'AVDJ' => 'Independent JPEG Group\'s codec (AVDJ)', + 'AVRN' => 'Independent JPEG Group\'s codec (AVRN)', + 'AYUV' => '4:4:4 YUV (AYUV)', + 'AZPR' => 'Quicktime Apple Video (AZPR)', + 'BGR ' => 'Raw RGB32', + 'BLZ0' => 'FFmpeg MPEG-4', + 'BTVC' => 'Conexant Composite Video', + 'BINK' => 'RAD Game Tools Bink Video', + 'BT20' => 'Conexant Prosumer Video', + 'BTCV' => 'Conexant Composite Video Codec', + 'BW10' => 'Data Translation Broadway MPEG Capture', + 'CC12' => 'Intel YUV12', + 'CDVC' => 'Canopus DV', + 'CFCC' => 'Digital Processing Systems DPS Perception', + 'CGDI' => 'Microsoft Office 97 Camcorder Video', + 'CHAM' => 'Winnov Caviara Champagne', + 'CJPG' => 'Creative WebCam JPEG', + 'CLJR' => 'Cirrus Logic YUV 4:1:1', + 'CMYK' => 'Common Data Format in Printing (Colorgraph)', + 'CPLA' => 'Weitek 4:2:0 YUV Planar', + 'CRAM' => 'Microsoft Video 1 (CRAM)', + 'cvid' => 'Radius Cinepak', + 'CVID' => 'Radius Cinepak', + 'CWLT' => 'Microsoft Color WLT DIB', + 'CYUV' => 'Creative Labs YUV', + 'CYUY' => 'ATI YUV', + 'D261' => 'H.261', + 'D263' => 'H.263', + 'DIB ' => 'Device Independent Bitmap', + 'DIV1' => 'FFmpeg OpenDivX', + 'DIV2' => 'Microsoft MPEG-4 v1/v2', + 'DIV3' => 'DivX ;-) MPEG-4 v3.x Low-Motion', + 'DIV4' => 'DivX ;-) MPEG-4 v3.x Fast-Motion', + 'DIV5' => 'DivX MPEG-4 v5.x', + 'DIV6' => 'DivX ;-) (MS MPEG-4 v3.x)', + 'DIVX' => 'DivX MPEG-4 v4 (OpenDivX / Project Mayo)', + 'divx' => 'DivX MPEG-4', + 'DMB1' => 'Matrox Rainbow Runner hardware MJPEG', + 'DMB2' => 'Paradigm MJPEG', + 'DSVD' => '?DSVD?', + 'DUCK' => 'Duck TrueMotion 1.0', + 'DPS0' => 'DPS/Leitch Reality Motion JPEG', + 'DPSC' => 'DPS/Leitch PAR Motion JPEG', + 'DV25' => 'Matrox DVCPRO codec', + 'DV50' => 'Matrox DVCPRO50 codec', + 'DVC ' => 'IEC 61834 and SMPTE 314M (DVC/DV Video)', + 'DVCP' => 'IEC 61834 and SMPTE 314M (DVC/DV Video)', + 'DVHD' => 'IEC Standard DV 1125 lines @ 30fps / 1250 lines @ 25fps', + 'DVMA' => 'Darim Vision DVMPEG (dummy for MPEG compressor) (www.darvision.com)', + 'DVSL' => 'IEC Standard DV compressed in SD (SDL)', + 'DVAN' => '?DVAN?', + 'DVE2' => 'InSoft DVE-2 Videoconferencing', + 'dvsd' => 'IEC 61834 and SMPTE 314M DVC/DV Video', + 'DVSD' => 'IEC 61834 and SMPTE 314M DVC/DV Video', + 'DVX1' => 'Lucent DVX1000SP Video Decoder', + 'DVX2' => 'Lucent DVX2000S Video Decoder', + 'DVX3' => 'Lucent DVX3000S Video Decoder', + 'DX50' => 'DivX v5', + 'DXT1' => 'Microsoft DirectX Compressed Texture (DXT1)', + 'DXT2' => 'Microsoft DirectX Compressed Texture (DXT2)', + 'DXT3' => 'Microsoft DirectX Compressed Texture (DXT3)', + 'DXT4' => 'Microsoft DirectX Compressed Texture (DXT4)', + 'DXT5' => 'Microsoft DirectX Compressed Texture (DXT5)', + 'DXTC' => 'Microsoft DirectX Compressed Texture (DXTC)', + 'DXTn' => 'Microsoft DirectX Compressed Texture (DXTn)', + 'EM2V' => 'Etymonix MPEG-2 I-frame (www.etymonix.com)', + 'EKQ0' => 'Elsa ?EKQ0?', + 'ELK0' => 'Elsa ?ELK0?', + 'ESCP' => 'Eidos Escape', + 'ETV1' => 'eTreppid Video ETV1', + 'ETV2' => 'eTreppid Video ETV2', + 'ETVC' => 'eTreppid Video ETVC', + 'FLIC' => 'Autodesk FLI/FLC Animation', + 'FRWT' => 'Darim Vision Forward Motion JPEG (www.darvision.com)', + 'FRWU' => 'Darim Vision Forward Uncompressed (www.darvision.com)', + 'FLJP' => 'D-Vision Field Encoded Motion JPEG', + 'FRWA' => 'SoftLab-Nsk Forward Motion JPEG w/ alpha channel', + 'FRWD' => 'SoftLab-Nsk Forward Motion JPEG', + 'FVF1' => 'Iterated Systems Fractal Video Frame', + 'GLZW' => 'Motion LZW (gabest@freemail.hu)', + 'GPEG' => 'Motion JPEG (gabest@freemail.hu)', + 'GWLT' => 'Microsoft Greyscale WLT DIB', + 'H260' => 'Intel ITU H.260 Videoconferencing', + 'H261' => 'Intel ITU H.261 Videoconferencing', + 'H262' => 'Intel ITU H.262 Videoconferencing', + 'H263' => 'Intel ITU H.263 Videoconferencing', + 'H264' => 'Intel ITU H.264 Videoconferencing', + 'H265' => 'Intel ITU H.265 Videoconferencing', + 'H266' => 'Intel ITU H.266 Videoconferencing', + 'H267' => 'Intel ITU H.267 Videoconferencing', + 'H268' => 'Intel ITU H.268 Videoconferencing', + 'H269' => 'Intel ITU H.269 Videoconferencing', + 'HFYU' => 'Huffman Lossless Codec', + 'HMCR' => 'Rendition Motion Compensation Format (HMCR)', + 'HMRR' => 'Rendition Motion Compensation Format (HMRR)', + 'I263' => 'FFmpeg I263 decoder', + 'IF09' => 'Indeo YVU9 ("YVU9 with additional delta-frame info after the U plane")', + 'IUYV' => 'Interlaced version of UYVY (www.leadtools.com)', + 'IY41' => 'Interlaced version of Y41P (www.leadtools.com)', + 'IYU1' => '12 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec IEEE standard', + 'IYU2' => '24 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec IEEE standard', + 'IYUV' => 'Planar YUV format (8-bpp Y plane, followed by 8-bpp 2�2 U and V planes)', + 'i263' => 'Intel ITU H.263 Videoconferencing (i263)', + 'I420' => 'Intel Indeo 4', + 'IAN ' => 'Intel Indeo 4 (RDX)', + 'ICLB' => 'InSoft CellB Videoconferencing', + 'IGOR' => 'Power DVD', + 'IJPG' => 'Intergraph JPEG', + 'ILVC' => 'Intel Layered Video', + 'ILVR' => 'ITU-T H.263+', + 'IPDV' => 'I-O Data Device Giga AVI DV Codec', + 'IR21' => 'Intel Indeo 2.1', + 'IRAW' => 'Intel YUV Uncompressed', + 'IV30' => 'Intel Indeo 3.0', + 'IV31' => 'Intel Indeo 3.1', + 'IV32' => 'Ligos Indeo 3.2', + 'IV33' => 'Ligos Indeo 3.3', + 'IV34' => 'Ligos Indeo 3.4', + 'IV35' => 'Ligos Indeo 3.5', + 'IV36' => 'Ligos Indeo 3.6', + 'IV37' => 'Ligos Indeo 3.7', + 'IV38' => 'Ligos Indeo 3.8', + 'IV39' => 'Ligos Indeo 3.9', + 'IV40' => 'Ligos Indeo Interactive 4.0', + 'IV41' => 'Ligos Indeo Interactive 4.1', + 'IV42' => 'Ligos Indeo Interactive 4.2', + 'IV43' => 'Ligos Indeo Interactive 4.3', + 'IV44' => 'Ligos Indeo Interactive 4.4', + 'IV45' => 'Ligos Indeo Interactive 4.5', + 'IV46' => 'Ligos Indeo Interactive 4.6', + 'IV47' => 'Ligos Indeo Interactive 4.7', + 'IV48' => 'Ligos Indeo Interactive 4.8', + 'IV49' => 'Ligos Indeo Interactive 4.9', + 'IV50' => 'Ligos Indeo Interactive 5.0', + 'JBYR' => 'Kensington ?JBYR?', + 'JPEG' => 'Still Image JPEG DIB', + 'JPGL' => 'Pegasus Lossless Motion JPEG', + 'KMVC' => 'Team17 Software Karl Morton\'s Video Codec', + 'LSVM' => 'Vianet Lighting Strike Vmail (Streaming) (www.vianet.com)', + 'LEAD' => 'LEAD Video Codec', + 'Ljpg' => 'LEAD MJPEG Codec', + 'MDVD' => 'Alex MicroDVD Video (hacked MS MPEG-4) (www.tiasoft.de)', + 'MJPA' => 'Morgan Motion JPEG (MJPA) (www.morgan-multimedia.com)', + 'MJPB' => 'Morgan Motion JPEG (MJPB) (www.morgan-multimedia.com)', + 'MMES' => 'Matrox MPEG-2 I-frame', + 'MP2v' => 'Microsoft S-Mpeg 4 version 1 (MP2v)', + 'MP42' => 'Microsoft S-Mpeg 4 version 2 (MP42)', + 'MP43' => 'Microsoft S-Mpeg 4 version 3 (MP43)', + 'MP4S' => 'Microsoft S-Mpeg 4 version 3 (MP4S)', + 'MP4V' => 'FFmpeg MPEG-4', + 'MPG1' => 'FFmpeg MPEG 1/2', + 'MPG2' => 'FFmpeg MPEG 1/2', + 'MPG3' => 'FFmpeg DivX ;-) (MS MPEG-4 v3)', + 'MPG4' => 'Microsoft MPEG-4', + 'MPGI' => 'Sigma Designs MPEG', + 'MPNG' => 'PNG images decoder', + 'MSS1' => 'Microsoft Windows Screen Video', + 'MSZH' => 'LCL (Lossless Codec Library) (www.geocities.co.jp/Playtown-Denei/2837/LRC.htm)', + 'M261' => 'Microsoft H.261', + 'M263' => 'Microsoft H.263', + 'M4S2' => 'Microsoft Fully Compliant MPEG-4 v2 simple profile (M4S2)', + 'm4s2' => 'Microsoft Fully Compliant MPEG-4 v2 simple profile (m4s2)', + 'MC12' => 'ATI Motion Compensation Format (MC12)', + 'MCAM' => 'ATI Motion Compensation Format (MCAM)', + 'MJ2C' => 'Morgan Multimedia Motion JPEG2000', + 'mJPG' => 'IBM Motion JPEG w/ Huffman Tables', + 'MJPG' => 'Microsoft Motion JPEG DIB', + 'MP42' => 'Microsoft MPEG-4 (low-motion)', + 'MP43' => 'Microsoft MPEG-4 (fast-motion)', + 'MP4S' => 'Microsoft MPEG-4 (MP4S)', + 'mp4s' => 'Microsoft MPEG-4 (mp4s)', + 'MPEG' => 'Chromatic Research MPEG-1 Video I-Frame', + 'MPG4' => 'Microsoft MPEG-4 Video High Speed Compressor', + 'MPGI' => 'Sigma Designs MPEG', + 'MRCA' => 'FAST Multimedia Martin Regen Codec', + 'MRLE' => 'Microsoft Run Length Encoding', + 'MSVC' => 'Microsoft Video 1', + 'MTX1' => 'Matrox ?MTX1?', + 'MTX2' => 'Matrox ?MTX2?', + 'MTX3' => 'Matrox ?MTX3?', + 'MTX4' => 'Matrox ?MTX4?', + 'MTX5' => 'Matrox ?MTX5?', + 'MTX6' => 'Matrox ?MTX6?', + 'MTX7' => 'Matrox ?MTX7?', + 'MTX8' => 'Matrox ?MTX8?', + 'MTX9' => 'Matrox ?MTX9?', + 'MV12' => 'Motion Pixels Codec (old)', + 'MWV1' => 'Aware Motion Wavelets', + 'nAVI' => 'SMR Codec (hack of Microsoft MPEG-4) (IRC #shadowrealm)', + 'NT00' => 'NewTek LightWave HDTV YUV w/ Alpha (www.newtek.com)', + 'NUV1' => 'NuppelVideo', + 'NTN1' => 'Nogatech Video Compression 1', + 'NVS0' => 'nVidia GeForce Texture (NVS0)', + 'NVS1' => 'nVidia GeForce Texture (NVS1)', + 'NVS2' => 'nVidia GeForce Texture (NVS2)', + 'NVS3' => 'nVidia GeForce Texture (NVS3)', + 'NVS4' => 'nVidia GeForce Texture (NVS4)', + 'NVS5' => 'nVidia GeForce Texture (NVS5)', + 'NVT0' => 'nVidia GeForce Texture (NVT0)', + 'NVT1' => 'nVidia GeForce Texture (NVT1)', + 'NVT2' => 'nVidia GeForce Texture (NVT2)', + 'NVT3' => 'nVidia GeForce Texture (NVT3)', + 'NVT4' => 'nVidia GeForce Texture (NVT4)', + 'NVT5' => 'nVidia GeForce Texture (NVT5)', + 'PIXL' => 'MiroXL, Pinnacle PCTV', + 'PDVC' => 'I-O Data Device Digital Video Capture DV codec', + 'PGVV' => 'Radius Video Vision', + 'PHMO' => 'IBM Photomotion', + 'PIM1' => 'MPEG Realtime (Pinnacle Cards)', + 'PIM2' => 'Pegasus Imaging ?PIM2?', + 'PIMJ' => 'Pegasus Imaging Lossless JPEG', + 'PVEZ' => 'Horizons Technology PowerEZ', + 'PVMM' => 'PacketVideo Corporation MPEG-4', + 'PVW2' => 'Pegasus Imaging Wavelet Compression', + 'Q1.0' => 'Q-Team\'s QPEG 1.0 (www.q-team.de)', + 'Q1.1' => 'Q-Team\'s QPEG 1.1 (www.q-team.de)', + 'QPEG' => 'Q-Team QPEG 1.0', + 'qpeq' => 'Q-Team QPEG 1.1', + 'RGB ' => 'Raw BGR32', + 'RGBA' => 'Raw RGB w/ Alpha', + 'RMP4' => 'REALmagic MPEG-4 (unauthorized XVID copy) (www.sigmadesigns.com)', + 'ROQV' => 'Id RoQ File Video Decoder', + 'RPZA' => 'Quicktime Apple Video (RPZA)', + 'RUD0' => 'Rududu video codec (http://rududu.ifrance.com/rududu/)', + 'RV10' => 'RealVideo 1.0 (aka RealVideo 5.0)', + 'RV13' => 'RealVideo 1.0 (RV13)', + 'RV20' => 'RealVideo G2', + 'RV30' => 'RealVideo 8', + 'RV40' => 'RealVideo 9', + 'RGBT' => 'Raw RGB w/ Transparency', + 'RLE ' => 'Microsoft Run Length Encoder', + 'RLE4' => 'Run Length Encoded (4bpp, 16-color)', + 'RLE8' => 'Run Length Encoded (8bpp, 256-color)', + 'RT21' => 'Intel Indeo RealTime Video 2.1', + 'rv20' => 'RealVideo G2', + 'rv30' => 'RealVideo 8', + 'RVX ' => 'Intel RDX (RVX )', + 'SMC ' => 'Apple Graphics (SMC )', + 'SP54' => 'Logitech Sunplus Sp54 Codec for Mustek GSmart Mini 2', + 'SPIG' => 'Radius Spigot', + 'SVQ3' => 'Sorenson Video 3 (Apple Quicktime 5)', + 's422' => 'Tekram VideoCap C210 YUV 4:2:2', + 'SDCC' => 'Sun Communication Digital Camera Codec', + 'SFMC' => 'CrystalNet Surface Fitting Method', + 'SMSC' => 'Radius SMSC', + 'SMSD' => 'Radius SMSD', + 'smsv' => 'WorldConnect Wavelet Video', + 'SPIG' => 'Radius Spigot', + 'SPLC' => 'Splash Studios ACM Audio Codec (www.splashstudios.net)', + 'SQZ2' => 'Microsoft VXTreme Video Codec V2', + 'STVA' => 'ST Microelectronics CMOS Imager Data (Bayer)', + 'STVB' => 'ST Microelectronics CMOS Imager Data (Nudged Bayer)', + 'STVC' => 'ST Microelectronics CMOS Imager Data (Bunched)', + 'STVX' => 'ST Microelectronics CMOS Imager Data (Extended CODEC Data Format)', + 'STVY' => 'ST Microelectronics CMOS Imager Data (Extended CODEC Data Format with Correction Data)', + 'SV10' => 'Sorenson Video R1', + 'SVQ1' => 'Sorenson Video', + 'T420' => 'Toshiba YUV 4:2:0', + 'TM2A' => 'Duck TrueMotion Archiver 2.0 (www.duck.com)', + 'TVJP' => 'Pinnacle/Truevision Targa 2000 board (TVJP)', + 'TVMJ' => 'Pinnacle/Truevision Targa 2000 board (TVMJ)', + 'TY0N' => 'Tecomac Low-Bit Rate Codec (www.tecomac.com)', + 'TY2C' => 'Trident Decompression Driver', + 'TLMS' => 'TeraLogic Motion Intraframe Codec (TLMS)', + 'TLST' => 'TeraLogic Motion Intraframe Codec (TLST)', + 'TM20' => 'Duck TrueMotion 2.0', + 'TM2X' => 'Duck TrueMotion 2X', + 'TMIC' => 'TeraLogic Motion Intraframe Codec (TMIC)', + 'TMOT' => 'Horizons Technology TrueMotion S', + 'tmot' => 'Horizons TrueMotion Video Compression', + 'TR20' => 'Duck TrueMotion RealTime 2.0', + 'TSCC' => 'TechSmith Screen Capture Codec', + 'TV10' => 'Tecomac Low-Bit Rate Codec', + 'TY2N' => 'Trident ?TY2N?', + 'U263' => 'UB Video H.263/H.263+/H.263++ Decoder', + 'UMP4' => 'UB Video MPEG 4 (www.ubvideo.com)', + 'UYNV' => 'Nvidia UYVY packed 4:2:2', + 'UYVP' => 'Evans & Sutherland YCbCr 4:2:2 extended precision', + 'UCOD' => 'eMajix.com ClearVideo', + 'ULTI' => 'IBM Ultimotion', + 'UYVY' => 'UYVY packed 4:2:2', + 'V261' => 'Lucent VX2000S', + 'VIFP' => 'VFAPI Reader Codec (www.yks.ne.jp/~hori/)', + 'VIV1' => 'FFmpeg H263+ decoder', + 'VIV2' => 'Vivo H.263', + 'VQC2' => 'Vector-quantised codec 2 (research) http://eprints.ecs.soton.ac.uk/archive/00001310/01/VTC97-js.pdf)', + 'VTLP' => 'Alaris VideoGramPiX', + 'VYU9' => 'ATI YUV (VYU9)', + 'VYUY' => 'ATI YUV (VYUY)', + 'V261' => 'Lucent VX2000S', + 'V422' => 'Vitec Multimedia 24-bit YUV 4:2:2 Format', + 'V655' => 'Vitec Multimedia 16-bit YUV 4:2:2 Format', + 'VCR1' => 'ATI Video Codec 1', + 'VCR2' => 'ATI Video Codec 2', + 'VCR3' => 'ATI VCR 3.0', + 'VCR4' => 'ATI VCR 4.0', + 'VCR5' => 'ATI VCR 5.0', + 'VCR6' => 'ATI VCR 6.0', + 'VCR7' => 'ATI VCR 7.0', + 'VCR8' => 'ATI VCR 8.0', + 'VCR9' => 'ATI VCR 9.0', + 'VDCT' => 'Vitec Multimedia Video Maker Pro DIB', + 'VDOM' => 'VDOnet VDOWave', + 'VDOW' => 'VDOnet VDOLive (H.263)', + 'VDTZ' => 'Darim Vison VideoTizer YUV', + 'VGPX' => 'Alaris VideoGramPiX', + 'VIDS' => 'Vitec Multimedia YUV 4:2:2 CCIR 601 for V422', + 'VIVO' => 'Vivo H.263 v2.00', + 'vivo' => 'Vivo H.263', + 'VIXL' => 'Miro/Pinnacle Video XL', + 'VLV1' => 'VideoLogic/PURE Digital Videologic Capture', + 'VP30' => 'On2 VP3.0', + 'VP31' => 'On2 VP3.1', + 'VX1K' => 'Lucent VX1000S Video Codec', + 'VX2K' => 'Lucent VX2000S Video Codec', + 'VXSP' => 'Lucent VX1000SP Video Codec', + 'WBVC' => 'Winbond W9960', + 'WHAM' => 'Microsoft Video 1 (WHAM)', + 'WINX' => 'Winnov Software Compression', + 'WJPG' => 'AverMedia Winbond JPEG', + 'WMV1' => 'Windows Media Video V7', + 'WMV2' => 'Windows Media Video V8', + 'WMV3' => 'Windows Media Video V9', + 'WNV1' => 'Winnov Hardware Compression', + 'XYZP' => 'Extended PAL format XYZ palette (www.riff.org)', + 'x263' => 'Xirlink H.263', + 'XLV0' => 'NetXL Video Decoder', + 'XMPG' => 'Xing MPEG (I-Frame only)', + 'XVID' => 'XviD MPEG-4 (www.xvid.org)', + 'XXAN' => '?XXAN?', + 'YU92' => 'Intel YUV (YU92)', + 'YUNV' => 'Nvidia Uncompressed YUV 4:2:2', + 'YUVP' => 'Extended PAL format YUV palette (www.riff.org)', + 'Y211' => 'YUV 2:1:1 Packed', + 'Y411' => 'YUV 4:1:1 Packed', + 'Y41B' => 'Weitek YUV 4:1:1 Planar', + 'Y41P' => 'Brooktree PC1 YUV 4:1:1 Packed', + 'Y41T' => 'Brooktree PC1 YUV 4:1:1 with transparency', + 'Y42B' => 'Weitek YUV 4:2:2 Planar', + 'Y42T' => 'Brooktree UYUV 4:2:2 with transparency', + 'Y422' => 'ADS Technologies Copy of UYVY used in Pyro WebCam firewire camera', + 'Y800' => 'Simple, single Y plane for monochrome images', + 'Y8 ' => 'Grayscale video', + 'YC12' => 'Intel YUV 12 codec', + 'YUV8' => 'Winnov Caviar YUV8', + 'YUV9' => 'Intel YUV9', + 'YUY2' => 'Uncompressed YUV 4:2:2', + 'YUYV' => 'Canopus YUV', + 'YV12' => 'YVU12 Planar', + 'YVU9' => 'Intel YVU9 Planar (8-bpp Y plane, followed by 8-bpp 4x4 U and V planes)', + 'YVYU' => 'YVYU 4:2:2 Packed', + 'ZLIB' => 'Lossless Codec Library zlib compression (www.geocities.co.jp/Playtown-Denei/2837/LRC.htm)', + 'ZPEG' => 'Metheus Video Zipper' + ); + + return @$lookup[$four_cc]; + } + + + + public static function RIFFcommentsParse(&$riff_info_aray, &$comments_target_array) { + + static $lookup = array( + 'IARL' => 'archivallocation', + 'IART' => 'artist', + 'ICDS' => 'costumedesigner', + 'ICMS' => 'commissionedby', + 'ICMT' => 'comment', + 'ICNT' => 'country', + 'ICOP' => 'copyright', + 'ICRD' => 'creationdate', + 'IDIM' => 'dimensions', + 'IDIT' => 'digitizationdate', + 'IDPI' => 'resolution', + 'IDST' => 'distributor', + 'IEDT' => 'editor', + 'IENG' => 'engineers', + 'IFRM' => 'accountofparts', + 'IGNR' => 'genre', + 'IKEY' => 'keywords', + 'ILGT' => 'lightness', + 'ILNG' => 'language', + 'IMED' => 'orignalmedium', + 'IMUS' => 'composer', + 'INAM' => 'title', + 'IPDS' => 'productiondesigner', + 'IPLT' => 'palette', + 'IPRD' => 'product', + 'IPRO' => 'producer', + 'IPRT' => 'part', + 'IRTD' => 'rating', + 'ISBJ' => 'subject', + 'ISFT' => 'software', + 'ISGN' => 'secondarygenre', + 'ISHP' => 'sharpness', + 'ISRC' => 'sourcesupplier', + 'ISRF' => 'digitizationsource', + 'ISTD' => 'productionstudio', + 'ISTR' => 'starring', + 'ITCH' => 'encoded_by', + 'IWEB' => 'url', + 'IWRI' => 'writer' + ); + + foreach ($lookup as $key => $value) { + if (isset($riff_info_aray[$key])) { + foreach ($riff_info_aray[$key] as $comment_id => $comment_data) { + if (trim($comment_data['data']) != '') { + @$comments_target_array[$value][] = trim($comment_data['data']); + } + } + } + } + return true; + } + + + + public static function array_merge_noclobber($array1, $array2) { + if (!is_array($array1) || !is_array($array2)) { + return false; + } + $new_array = $array1; + foreach ($array2 as $key => $val) { + if (is_array($val) && isset($new_array[$key]) && is_array($new_array[$key])) { + $new_array[$key] = getid3_riff::array_merge_noclobber($new_array[$key], $val); + } elseif (!isset($new_array[$key])) { + $new_array[$key] = $val; + } + } + return $new_array; + } + + + + public static function DateMac2Unix($mac_date) { + + // Macintosh timestamp: seconds since 00:00h January 1, 1904 + // UNIX timestamp: seconds since 00:00h January 1, 1970 + return (int)($mac_date - 2082844800); + } + + + + public static function FixedPoint16_16($raw_data) { + + return getid3_lib::BigEndian2Int(substr($raw_data, 0, 2)) + (float)(getid3_lib::BigEndian2Int(substr($raw_data, 2, 2)) / 65536); // pow(2, 16) = 65536 + } + + + + function BigEndian2Float($byte_word) { + + // ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic + // http://www.psc.edu/general/software/packages/ieee/ieee.html + // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html + + $bit_word = getid3_lib::BigEndian2Bin($byte_word); + $sign_bit = $bit_word{0}; + + switch (strlen($byte_word) * 8) { + case 32: + $exponent_bits = 8; + $fraction_bits = 23; + break; + + case 64: + $exponent_bits = 11; + $fraction_bits = 52; + break; + + case 80: + // 80-bit Apple SANE format + // http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/ + $exponent_string = substr($bit_word, 1, 15); + $is_normalized = intval($bit_word{16}); + $fraction_string = substr($bit_word, 17, 63); + $exponent = pow(2, bindec($exponent_string) - 16383); + $fraction = $is_normalized + bindec($fraction_string) / bindec('1'.str_repeat('0', strlen($fraction_string))); + $float_value = $exponent * $fraction; + if ($sign_bit == '1') { + $float_value *= -1; + } + return $float_value; + break; + + default: + return false; + break; + } + $exponent_string = substr($bit_word, 1, $exponent_bits); + $fraction_string = substr($bit_word, $exponent_bits + 1, $fraction_bits); + $exponent = bindec($exponent_string); + $fraction = bindec($fraction_string); + + if (($exponent == (pow(2, $exponent_bits) - 1)) && ($fraction != 0)) { + // Not a Number + $float_value = false; + } elseif (($exponent == (pow(2, $exponent_bits) - 1)) && ($fraction == 0)) { + if ($sign_bit == '1') { + $float_value = '-infinity'; + } else { + $float_value = '+infinity'; + } + } elseif (($exponent == 0) && ($fraction == 0)) { + if ($sign_bit == '1') { + $float_value = -0; + } else { + $float_value = 0; + } + $float_value = ($sign_bit ? 0 : -0); + } elseif (($exponent == 0) && ($fraction != 0)) { + // These are 'unnormalized' values + $float_value = pow(2, (-1 * (pow(2, $exponent_bits - 1) - 2))) * bindec($fraction_string) / bindec('1'.str_repeat('0', strlen($fraction_string))); + if ($sign_bit == '1') { + $float_value *= -1; + } + } elseif ($exponent != 0) { + $float_value = pow(2, ($exponent - (pow(2, $exponent_bits - 1) - 1))) * (1 + bindec($fraction_string) / bindec('1'.str_repeat('0', strlen($fraction_string)))); + if ($sign_bit == '1') { + $float_value *= -1; + } + } + return (float) $float_value; + } +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.swf.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.swf.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio-video.swf.php 3 Jan 2016 20:51:40 -0000 1.1.2.1 @@ -0,0 +1,154 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio-video.swf.php | +// | module for analyzing Macromedia Shockwave Flash files. | +// | dependencies: zlib support in PHP | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio-video.swf.php,v 1.1.2.1 2016/01/03 20:51:40 gustafn Exp $ + + + +class getid3_swf extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'swf'; + $getid3->info['video']['dataformat'] = 'swf'; + + // http://www.openswf.org/spec/SWFfileformat.html + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + $swf_file_data = fread($getid3->fp, $getid3->info['avdataend'] - $getid3->info['avdataoffset']); // 8 + 2 + 2 + max(9) bytes NOT including Frame_Size RECT data + + $getid3->info['swf']['header']['signature'] = substr($swf_file_data, 0, 3); + switch ($getid3->info['swf']['header']['signature']) { + + case 'FWS': + $getid3->info['swf']['header']['compressed'] = false; + break; + + case 'CWS': + $getid3->info['swf']['header']['compressed'] = true; + break; + + default: + throw new getid3_exception('Expecting "FWS" or "CWS" at offset '.$getid3->info['avdataoffset'].', found "'.$getid3->info['swf']['header']['signature'].'"'); + } + $getid3->info['swf']['header']['version'] = getid3_lib::LittleEndian2Int($swf_file_data{3}); + $getid3->info['swf']['header']['length'] = getid3_lib::LittleEndian2Int(substr($swf_file_data, 4, 4)); + + if (!function_exists('gzuncompress')) { + throw new getid3_exception('getid3_swf requires --zlib support in PHP.'); + } + + if ($getid3->info['swf']['header']['compressed']) { + + if ($uncompressed_file_data = @gzuncompress(substr($swf_file_data, 8))) { + $swf_file_data = substr($swf_file_data, 0, 8).$uncompressed_file_data; + + } else { + throw new getid3_exception('Error decompressing compressed SWF data'); + } + + } + + $frame_size_bits_per_value = (ord(substr($swf_file_data, 8, 1)) & 0xF8) >> 3; + $frame_size_data_length = ceil((5 + (4 * $frame_size_bits_per_value)) / 8); + $frame_size_data_string = str_pad(decbin(ord($swf_file_data[8]) & 0x07), 3, '0', STR_PAD_LEFT); + + for ($i = 1; $i < $frame_size_data_length; $i++) { + $frame_size_data_string .= str_pad(decbin(ord(substr($swf_file_data, 8 + $i, 1))), 8, '0', STR_PAD_LEFT); + } + + list($x1, $x2, $y1, $y2) = explode("\n", wordwrap($frame_size_data_string, $frame_size_bits_per_value, "\n", 1)); + $getid3->info['swf']['header']['frame_width'] = bindec($x2); + $getid3->info['swf']['header']['frame_height'] = bindec($y2); + + // http://www-lehre.informatik.uni-osnabrueck.de/~fbstark/diplom/docs/swf/Flash_Uncovered.htm + // Next in the header is the frame rate, which is kind of weird. + // It is supposed to be stored as a 16bit integer, but the first byte + // (or last depending on how you look at it) is completely ignored. + // Example: 0x000C -> 0x0C -> 12 So the frame rate is 12 fps. + + // Byte at (8 + $frame_size_data_length) is always zero and ignored + $getid3->info['swf']['header']['frame_rate'] = getid3_lib::LittleEndian2Int($swf_file_data[9 + $frame_size_data_length]); + $getid3->info['swf']['header']['frame_count'] = getid3_lib::LittleEndian2Int(substr($swf_file_data, 10 + $frame_size_data_length, 2)); + + $getid3->info['video']['frame_rate'] = $getid3->info['swf']['header']['frame_rate']; + $getid3->info['video']['resolution_x'] = intval(round($getid3->info['swf']['header']['frame_width'] / 20)); + $getid3->info['video']['resolution_y'] = intval(round($getid3->info['swf']['header']['frame_height'] / 20)); + $getid3->info['video']['pixel_aspect_ratio'] = (float)1; + + if (($getid3->info['swf']['header']['frame_count'] > 0) && ($getid3->info['swf']['header']['frame_rate'] > 0)) { + $getid3->info['playtime_seconds'] = $getid3->info['swf']['header']['frame_count'] / $getid3->info['swf']['header']['frame_rate']; + } + + + // SWF tags + + $current_offset = 12 + $frame_size_data_length; + $swf_data_length = strlen($swf_file_data); + + while ($current_offset < $swf_data_length) { + + $tag_ID_tag_length = getid3_lib::LittleEndian2Int(substr($swf_file_data, $current_offset, 2)); + $tag_ID = ($tag_ID_tag_length & 0xFFFC) >> 6; + $tag_length = ($tag_ID_tag_length & 0x003F); + $current_offset += 2; + if ($tag_length == 0x3F) { + $tag_length = getid3_lib::LittleEndian2Int(substr($swf_file_data, $current_offset, 4)); + $current_offset += 4; + } + + unset($tag_data); + $tag_data['offset'] = $current_offset; + $tag_data['size'] = $tag_length; + $tag_data['id'] = $tag_ID; + $tag_data['data'] = substr($swf_file_data, $current_offset, $tag_length); + switch ($tag_ID) { + + case 0: // end of movie + break 2; + + case 9: // Set background color + $getid3->info['swf']['bgcolor'] = strtoupper(str_pad(dechex(getid3_lib::BigEndian2Int($tag_data['data'])), 6, '0', STR_PAD_LEFT)); + break; + + default: + /* + if ($ReturnAllTagData) { + $getid3->info['swf']['tags'][] = $tag_data; + } + */ + break; + } + + $current_offset += $tag_length; + } + + return true; + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.aac_adif.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.aac_adif.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.aac_adif.php 3 Jan 2016 20:51:40 -0000 1.1.2.1 @@ -0,0 +1,311 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.aac_adif.php | +// | Module for analyzing AAC files with ADIF header. | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.aac_adif.php,v 1.1.2.1 2016/01/03 20:51:40 gustafn Exp $ + + + +class getid3_aac_adif extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + // http://faac.sourceforge.net/wiki/index.php?page=ADIF + // http://libmpeg.org/mpeg4/doc/w2203tfs.pdf + // adif_header() { + // adif_id 32 + // copyright_id_present 1 + // if( copyright_id_present ) + // copyright_id 72 + // original_copy 1 + // home 1 + // bitstream_type 1 + // bitrate 23 + // num_program_config_elements 4 + // for (i = 0; i < num_program_config_elements + 1; i++ ) { + // if( bitstream_type == '0' ) + // adif_buffer_fullness 20 + // program_config_element() + // } + // } + + + $getid3->info['fileformat'] = 'aac'; + $getid3->info['audio']['dataformat'] = 'aac'; + $getid3->info['audio']['lossless'] = false; + + $getid3->info['aac']['header'] = array () ; + $info_aac = &$getid3->info['aac']; + $info_aac_header = & $info_aac['header']; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $aac_header_bitstream = getid3_lib::BigEndian2Bin(fread($getid3->fp, 1024)); + + $info_aac['header_type'] = 'ADIF'; + $info_aac_header['mpeg_version'] = 4; + $bit_offset = 32; + + $info_aac_header['copyright'] = $aac_header_bitstream{$bit_offset++} == '1'; + if ($info_aac_header['copyright']) { + $info_aac_header['copyright_id'] = getid3_aac_adif::Bin2String(substr($aac_header_bitstream, $bit_offset, 72)); + $bit_offset += 72; + } + + $info_aac_header['original_copy'] = $aac_header_bitstream{$bit_offset++} == '1'; + $info_aac_header['home'] = $aac_header_bitstream{$bit_offset++} == '1'; + $info_aac_header['is_vbr'] = $aac_header_bitstream{$bit_offset++} == '1'; + + if ($info_aac_header['is_vbr']) { + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + $info_aac_header['bitrate_max'] = bindec(substr($aac_header_bitstream, $bit_offset, 23)); + $bit_offset += 23; + } + else { + $getid3->info['audio']['bitrate_mode'] = 'cbr'; + $info_aac_header['bitrate'] = bindec(substr($aac_header_bitstream, $bit_offset, 23)); + $bit_offset += 23; + $getid3->info['audio']['bitrate'] = $info_aac_header['bitrate']; + } + + $info_aac_header['num_program_configs'] = 1 + bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + + for ($i = 0; $i < $info_aac_header['num_program_configs']; $i++) { + + // http://www.audiocoding.com/wiki/index.php?page=program_config_element + + // buffer_fullness 20 + + // element_instance_tag 4 + // object_type 2 + // sampling_frequency_index 4 + // num_front_channel_elements 4 + // num_side_channel_elements 4 + // num_back_channel_elements 4 + // num_lfe_channel_elements 2 + // num_assoc_data_elements 3 + // num_valid_cc_elements 4 + // mono_mixdown_present 1 + // mono_mixdown_element_number 4 if mono_mixdown_present == 1 + // stereo_mixdown_present 1 + // stereo_mixdown_element_number 4 if stereo_mixdown_present == 1 + // matrix_mixdown_idx_present 1 + // matrix_mixdown_idx 2 if matrix_mixdown_idx_present == 1 + // pseudo_surround_enable 1 if matrix_mixdown_idx_present == 1 + // for (i = 0; i < num_front_channel_elements; i++) { + // front_element_is_cpe[i] 1 + // front_element_tag_select[i] 4 + // } + // for (i = 0; i < num_side_channel_elements; i++) { + // side_element_is_cpe[i] 1 + // side_element_tag_select[i] 4 + // } + // for (i = 0; i < num_back_channel_elements; i++) { + // back_element_is_cpe[i] 1 + // back_element_tag_select[i] 4 + // } + // for (i = 0; i < num_lfe_channel_elements; i++) { + // lfe_element_tag_select[i] 4 + // } + // for (i = 0; i < num_assoc_data_elements; i++) { + // assoc_data_element_tag_select[i] 4 + // } + // for (i = 0; i < num_valid_cc_elements; i++) { + // cc_element_is_ind_sw[i] 1 + // valid_cc_element_tag_select[i] 4 + // } + // byte_alignment() VAR + // comment_field_bytes 8 + // for (i = 0; i < comment_field_bytes; i++) { + // comment_field_data[i] 8 + // } + + $info_aac['program_configs'][$i] = array (); + $info_aac_program_configs_i = &$info_aac['program_configs'][$i]; + + if (!$info_aac_header['is_vbr']) { + $info_aac_program_configs_i['buffer_fullness'] = bindec(substr($aac_header_bitstream, $bit_offset, 20)); + $bit_offset += 20; + } + + $info_aac_program_configs_i['element_instance_tag'] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $info_aac_program_configs_i['object_type'] = bindec(substr($aac_header_bitstream, $bit_offset + 4, 2)); + $info_aac_program_configs_i['sampling_frequency_index'] = bindec(substr($aac_header_bitstream, $bit_offset + 6, 4)); + $info_aac_program_configs_i['num_front_channel_elements'] = bindec(substr($aac_header_bitstream, $bit_offset + 10, 4)); + $info_aac_program_configs_i['num_side_channel_elements'] = bindec(substr($aac_header_bitstream, $bit_offset + 14, 4)); + $info_aac_program_configs_i['num_back_channel_elements'] = bindec(substr($aac_header_bitstream, $bit_offset + 18, 4)); + $info_aac_program_configs_i['num_lfe_channel_elements'] = bindec(substr($aac_header_bitstream, $bit_offset + 22, 2)); + $info_aac_program_configs_i['num_assoc_data_elements'] = bindec(substr($aac_header_bitstream, $bit_offset + 24, 3)); + $info_aac_program_configs_i['num_valid_cc_elements'] = bindec(substr($aac_header_bitstream, $bit_offset + 27, 4)); + $bit_offset += 31; + + $info_aac_program_configs_i['mono_mixdown_present'] = $aac_header_bitstream{$bit_offset++} == 1; + if ($info_aac_program_configs_i['mono_mixdown_present']) { + $info_aac_program_configs_i['mono_mixdown_element_number'] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + + $info_aac_program_configs_i['stereo_mixdown_present'] = $aac_header_bitstream{$bit_offset++} == 1; + if ($info_aac_program_configs_i['stereo_mixdown_present']) { + $info_aac_program_configs_i['stereo_mixdown_element_number'] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + + $info_aac_program_configs_i['matrix_mixdown_idx_present'] = $aac_header_bitstream{$bit_offset++} == 1; + if ($info_aac_program_configs_i['matrix_mixdown_idx_present']) { + $info_aac_program_configs_i['matrix_mixdown_idx'] = bindec(substr($aac_header_bitstream, $bit_offset, 2)); + $bit_offset += 2; + $info_aac_program_configs_i['pseudo_surround_enable'] = $aac_header_bitstream{$bit_offset++} == 1; + } + + for ($j = 0; $j < $info_aac_program_configs_i['num_front_channel_elements']; $j++) { + $info_aac_program_configs_i['front_element_is_cpe'][$j] = $aac_header_bitstream{$bit_offset++} == 1; + $info_aac_program_configs_i['front_element_tag_select'][$j] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + for ($j = 0; $j < $info_aac_program_configs_i['num_side_channel_elements']; $j++) { + $info_aac_program_configs_i['side_element_is_cpe'][$j] = $aac_header_bitstream{$bit_offset++} == 1; + $info_aac_program_configs_i['side_element_tag_select'][$j] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + for ($j = 0; $j < $info_aac_program_configs_i['num_back_channel_elements']; $j++) { + $info_aac_program_configs_i['back_element_is_cpe'][$j] = $aac_header_bitstream{$bit_offset++} == 1; + $info_aac_program_configs_i['back_element_tag_select'][$j] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + for ($j = 0; $j < $info_aac_program_configs_i['num_lfe_channel_elements']; $j++) { + $info_aac_program_configs_i['lfe_element_tag_select'][$j] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + for ($j = 0; $j < $info_aac_program_configs_i['num_assoc_data_elements']; $j++) { + $info_aac_program_configs_i['assoc_data_element_tag_select'][$j] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + for ($j = 0; $j < $info_aac_program_configs_i['num_valid_cc_elements']; $j++) { + $info_aac_program_configs_i['cc_element_is_ind_sw'][$j] = $aac_header_bitstream{$bit_offset++} == 1; + $info_aac_program_configs_i['valid_cc_element_tag_select'][$j] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + } + + $bit_offset = ceil($bit_offset / 8) * 8; + + $info_aac_program_configs_i['comment_field_bytes'] = bindec(substr($aac_header_bitstream, $bit_offset, 8)); + $bit_offset += 8; + + $info_aac_program_configs_i['comment_field'] = getid3_aac_adif::Bin2String(substr($aac_header_bitstream, $bit_offset, 8 * $info_aac_program_configs_i['comment_field_bytes'])); + $bit_offset += 8 * $info_aac_program_configs_i['comment_field_bytes']; + + $info_aac_header['profile_text'] = getid3_aac_adif::AACprofileLookup($info_aac_program_configs_i['object_type'], $info_aac_header['mpeg_version']); + $info_aac_program_configs_i['sampling_frequency'] = $getid3->info['audio']['sample_rate'] = getid3_aac_adif::AACsampleRateLookup($info_aac_program_configs_i['sampling_frequency_index']); + $getid3->info['audio']['channels'] = getid3_aac_adif::AACchannelCountCalculate($info_aac_program_configs_i); + + if ($info_aac_program_configs_i['comment_field']) { + $info_aac['comments'][] = $info_aac_program_configs_i['comment_field']; + } + } + + $getid3->info['playtime_seconds'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['audio']['bitrate']; + $getid3->info['audio']['encoder_options'] = $info_aac['header_type'].' '.$info_aac_header['profile_text']; + + return true; + } + + + + public static function Bin2String($bin_string) { + // return 'hi' for input of '0110100001101001' + $string = ''; + $bin_string_reversed = strrev($bin_string); + for ($i = 0; $i < strlen($bin_string_reversed); $i += 8) { + $string = chr(bindec(strrev(substr($bin_string_reversed, $i, 8)))).$string; + } + return $string; + } + + + + public static function AACsampleRateLookup($samplerate_id) { + + static $lookup = array ( + 0 => 96000, + 1 => 88200, + 2 => 64000, + 3 => 48000, + 4 => 44100, + 5 => 32000, + 6 => 24000, + 7 => 22050, + 8 => 16000, + 9 => 12000, + 10 => 11025, + 11 => 8000, + 12 => 0, + 13 => 0, + 14 => 0, + 15 => 0 + ); + return (isset($lookup[$samplerate_id]) ? $lookup[$samplerate_id] : 'invalid'); + } + + + + public static function AACprofileLookup($profile_id, $mpeg_version) { + + static $lookup = array ( + 2 => array ( + 0 => 'Main profile', + 1 => 'Low Complexity profile (LC)', + 2 => 'Scalable Sample Rate profile (SSR)', + 3 => '(reserved)' + ), + 4 => array ( + 0 => 'AAC_MAIN', + 1 => 'AAC_LC', + 2 => 'AAC_SSR', + 3 => 'AAC_LTP' + ) + ); + return (isset($lookup[$mpeg_version][$profile_id]) ? $lookup[$mpeg_version][$profile_id] : 'invalid'); + } + + + + public static function AACchannelCountCalculate($program_configs) { + + $channels = 0; + + foreach (array ('front', 'side', 'back') as $placement) { + for ($i = 0; $i < $program_configs['num_'.$placement.'_channel_elements']; $i++) { + + // Each element is channel pair (CPE = Channel Pair Element) + $channels += 1 + ($program_configs[$placement.'_element_is_cpe'][$i] ? 1 : 0); + } + } + + return $channels + $program_configs['num_lfe_channel_elements']; + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.aac_adts.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.aac_adts.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.aac_adts.php 3 Jan 2016 20:51:40 -0000 1.1.2.1 @@ -0,0 +1,282 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.aac_adts.php | +// | Module for analyzing AAC files with ADTS header. | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.aac_adts.php,v 1.1.2.1 2016/01/03 20:51:40 gustafn Exp $ + + + +class getid3_aac_adts extends getid3_handler +{ + + public $option_max_frames_to_scan = 1000000; + public $option_return_extended_info = false; + + + private $decbin_cache; + private $bitrate_cache; + + + + public function __construct(getID3 $getid3) { + + parent::__construct($getid3); + + // Populate bindec_cache + for ($i = 0; $i < 256; $i++) { + $this->decbin_cache[chr($i)] = str_pad(decbin($i), 8, '0', STR_PAD_LEFT); + } + + // Init cache + $this->bitrate_cache = array (); + + // Fast scanning? + if (!$getid3->option_accurate_results) { + $this->option_max_frames_to_scan = 200; + $getid3->warning('option_accurate_results set to false - bitrate and playing time are not accurate.'); + } + } + + + + public function Analyze() { + + $getid3 = $this->getid3; + + // based loosely on code from AACfile by Jurgen Faul + // http://jfaul.de/atl or http://j-faul.virtualave.net/atl/atl.html + + + // http://faac.sourceforge.net/wiki/index.php?page=ADTS + + // * ADTS Fixed Header: these don't change from frame to frame + // syncword 12 always: '111111111111' + // ID 1 0: MPEG-4, 1: MPEG-2 + // layer 2 always: '00' + // protection_absent 1 + // profile 2 + // sampling_frequency_index 4 + // private_bit 1 + // channel_configuration 3 + // original/copy 1 + // home 1 + // emphasis 2 only if ID == 0 (ie MPEG-4) + + // * ADTS Variable Header: these can change from frame to frame + // copyright_identification_bit 1 + // copyright_identification_start 1 + // aac_frame_length 13 length of the frame including header (in bytes) + // adts_buffer_fullness 11 0x7FF indicates VBR + // no_raw_data_blocks_in_frame 2 + + // * ADTS Error check + // crc_check 16 only if protection_absent == 0 + + $getid3->info['aac']['header'] = array () ; + $info_aac = &$getid3->info['aac']; + $info_aac_header = & $info_aac['header']; + + $byte_offset = $frame_number = 0; + + while (true) { + + // Breaks out when end-of-file encountered, or invalid data found, + // or MaxFramesToScan frames have been scanned + + fseek($getid3->fp, $byte_offset, SEEK_SET); + + // First get substring + $sub_string = fread($getid3->fp, 10); + $sub_string_length = strlen($sub_string); + if ($sub_string_length != 10) { + throw new getid3_exception('Failed to read 10 bytes at offset '.(ftell($getid3->fp) - $sub_string_length).' (only read '.$sub_string_length.' bytes)'); + } + + // Initialise $aac_header_bitstream + $aac_header_bitstream = ''; + + // Loop thru substring chars + for ($i = 0; $i < 10; $i++) { + $aac_header_bitstream .= $this->decbin_cache[$sub_string[$i]]; + } + + $sync_test = bindec(substr($aac_header_bitstream, 0, 12)); + $bit_offset = 12; + + if ($sync_test != 0x0FFF) { + throw new getid3_exception('Synch pattern (0x0FFF) not found at offset '.(ftell($getid3->fp) - 10).' (found 0x0'.strtoupper(dechex($sync_test)).' instead)'); + } + + // Only gather info once - this takes time to do 1000 times! + if ($frame_number > 0) { + + // MPEG-4: 20, // MPEG-2: 18 + $bit_offset += $aac_header_bitstream[$bit_offset] ? 18 : 20; + } + + // Gather info for first frame only - this takes time to do 1000 times! + else { + + $info_aac['header_type'] = 'ADTS'; + $info_aac_header['synch'] = $sync_test; + $getid3->info['fileformat'] = 'aac'; + $getid3->info['audio']['dataformat'] = 'aac'; + + $info_aac_header['mpeg_version'] = $aac_header_bitstream{$bit_offset++} == '0' ? 4 : 2; + $info_aac_header['layer'] = bindec(substr($aac_header_bitstream, $bit_offset, 2)); + $bit_offset += 2; + + if ($info_aac_header['layer'] != 0) { + throw new getid3_exception('Layer error - expected 0x00, found 0x'.dechex($info_aac_header['layer']).' instead'); + } + + $info_aac_header['crc_present'] = $aac_header_bitstream{$bit_offset++} == '0' ? true : false; + + $info_aac_header['profile_id'] = bindec(substr($aac_header_bitstream, $bit_offset, 2)); + $bit_offset += 2; + + $info_aac_header['profile_text'] = getid3_aac_adts::AACprofileLookup($info_aac_header['profile_id'], $info_aac_header['mpeg_version']); + + $info_aac_header['sample_frequency_index'] = bindec(substr($aac_header_bitstream, $bit_offset, 4)); + $bit_offset += 4; + + $info_aac_header['sample_frequency'] = getid3_aac_adts::AACsampleRateLookup($info_aac_header['sample_frequency_index']); + + $getid3->info['audio']['sample_rate'] = $info_aac_header['sample_frequency']; + + $info_aac_header['private'] = $aac_header_bitstream{$bit_offset++} == 1; + + $info_aac_header['channel_configuration'] = $getid3->info['audio']['channels'] = bindec(substr($aac_header_bitstream, $bit_offset, 3)); + $bit_offset += 3; + + $info_aac_header['original'] = $aac_header_bitstream{$bit_offset++} == 1; + $info_aac_header['home'] = $aac_header_bitstream{$bit_offset++} == 1; + + if ($info_aac_header['mpeg_version'] == 4) { + $info_aac_header['emphasis'] = bindec(substr($aac_header_bitstream, $bit_offset, 2)); + $bit_offset += 2; + } + + if ($this->option_return_extended_info) { + + $info_aac[$frame_number]['copyright_id_bit'] = $aac_header_bitstream{$bit_offset++} == 1; + $info_aac[$frame_number]['copyright_id_start'] = $aac_header_bitstream{$bit_offset++} == 1; + + } else { + $bit_offset += 2; + } + } + + $frame_length = bindec(substr($aac_header_bitstream, $bit_offset, 13)); + + if (!isset($this->bitrate_cache[$frame_length])) { + $this->bitrate_cache[$frame_length] = ($info_aac_header['sample_frequency'] / 1024) * $frame_length * 8; + } + @$info_aac['bitrate_distribution'][$this->bitrate_cache[$frame_length]]++; + + $info_aac[$frame_number]['aac_frame_length'] = $frame_length; + $bit_offset += 13; + + $info_aac[$frame_number]['adts_buffer_fullness'] = bindec(substr($aac_header_bitstream, $bit_offset, 11)); + $bit_offset += 11; + + $getid3->info['audio']['bitrate_mode'] = ($info_aac[$frame_number]['adts_buffer_fullness'] == 0x07FF) ? 'vbr' : 'cbr'; + + $info_aac[$frame_number]['num_raw_data_blocks'] = bindec(substr($aac_header_bitstream, $bit_offset, 2)); + $bit_offset += 2; + + if ($info_aac_header['crc_present']) { + $bit_offset += 16; + } + + if (!$this->option_return_extended_info) { + unset($info_aac[$frame_number]); + } + + $byte_offset += $frame_length; + if ((++$frame_number < $this->option_max_frames_to_scan) && (($byte_offset + 10) < $getid3->info['avdataend'])) { + + // keep scanning + + } else { + + $info_aac['frames'] = $frame_number; + $getid3->info['playtime_seconds'] = ($getid3->info['avdataend'] / $byte_offset) * (($frame_number * 1024) / $info_aac_header['sample_frequency']); // (1 / % of file scanned) * (samples / (samples/sec)) = seconds + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + ksort($info_aac['bitrate_distribution']); + + $getid3->info['audio']['encoder_options'] = $info_aac['header_type'].' '.$info_aac_header['profile_text']; + + return true; + } + } + } + + + + public static function AACsampleRateLookup($samplerate_id) { + + static $lookup = array ( + 0 => 96000, + 1 => 88200, + 2 => 64000, + 3 => 48000, + 4 => 44100, + 5 => 32000, + 6 => 24000, + 7 => 22050, + 8 => 16000, + 9 => 12000, + 10 => 11025, + 11 => 8000, + 12 => 0, + 13 => 0, + 14 => 0, + 15 => 0 + ); + return (isset($lookup[$samplerate_id]) ? $lookup[$samplerate_id] : 'invalid'); + } + + + + public static function AACprofileLookup($profile_id, $mpeg_version) { + + static $lookup = array ( + 2 => array ( + 0 => 'Main profile', + 1 => 'Low Complexity profile (LC)', + 2 => 'Scalable Sample Rate profile (SSR)', + 3 => '(reserved)' + ), + 4 => array ( + 0 => 'AAC_MAIN', + 1 => 'AAC_LC', + 2 => 'AAC_SSR', + 3 => 'AAC_LTP' + ) + ); + return (isset($lookup[$mpeg_version][$profile_id]) ? $lookup[$mpeg_version][$profile_id] : 'invalid'); + } + + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.ac3.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.ac3.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.ac3.php 3 Jan 2016 20:51:41 -0000 1.1.2.1 @@ -0,0 +1,500 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.ac3.php | +// | Module for analyzing AC-3 (aka Dolby Digital) audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.ac3.php,v 1.1.2.1 2016/01/03 20:51:41 gustafn Exp $ + + + +class getid3_ac3 extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + // http://www.atsc.org/standards/a_52a.pdf + + $getid3->info['fileformat'] = 'ac3'; + $getid3->info['audio']['dataformat'] = 'ac3'; + $getid3->info['audio']['bitrate_mode'] = 'cbr'; + $getid3->info['audio']['lossless'] = false; + + $getid3->info['ac3']['raw']['bsi'] = array (); + $info_ac3 = &$getid3->info['ac3']; + $info_ac3_raw = &$info_ac3['raw']; + $info_ac3_raw_bsi = &$info_ac3_raw['bsi']; + + + // An AC-3 serial coded audio bit stream is made up of a sequence of synchronization frames + // Each synchronization frame contains 6 coded audio blocks (AB), each of which represent 256 + // new audio samples per channel. A synchronization information (SI) header at the beginning + // of each frame contains information needed to acquire and maintain synchronization. A + // bit stream information (BSI) header follows SI, and contains parameters describing the coded + // audio service. The coded audio blocks may be followed by an auxiliary data (Aux) field. At the + // end of each frame is an error check field that includes a CRC word for error detection. An + // additional CRC word is located in the SI header, the use of which, by a decoder, is optional. + // + // syncinfo() | bsi() | AB0 | AB1 | AB2 | AB3 | AB4 | AB5 | Aux | CRC + + $this->fseek($getid3->info['avdataoffset'], SEEK_SET); + $ac3_header['syncinfo'] = $this->fread(5); + $info_ac3_raw['synchinfo']['synchword'] = substr($ac3_header['syncinfo'], 0, 2); + + if ($info_ac3_raw['synchinfo']['synchword'] != "\x0B\x77") { + throw new getid3_exception('Expecting "\x0B\x77" at offset '.$getid3->info['avdataoffset'].', found \x'.strtoupper(dechex($ac3_header['syncinfo']{0})).'\x'.strtoupper(dechex($ac3_header['syncinfo']{1})).' instead'); + } + + + // syncinfo() { + // syncword 16 + // crc1 16 + // fscod 2 + // frmsizecod 6 + // } /* end of syncinfo */ + + $info_ac3_raw['synchinfo']['crc1'] = getid3_lib::LittleEndian2Int(substr($ac3_header['syncinfo'], 2, 2)); + $ac3_synchinfo_fscod_frmsizecod = getid3_lib::LittleEndian2Int(substr($ac3_header['syncinfo'], 4, 1)); + $info_ac3_raw['synchinfo']['fscod'] = ($ac3_synchinfo_fscod_frmsizecod & 0xC0) >> 6; + $info_ac3_raw['synchinfo']['frmsizecod'] = ($ac3_synchinfo_fscod_frmsizecod & 0x3F); + + $info_ac3['sample_rate'] = getid3_ac3::AC3sampleRateCodeLookup($info_ac3_raw['synchinfo']['fscod']); + if ($info_ac3_raw['synchinfo']['fscod'] <= 3) { + $getid3->info['audio']['sample_rate'] = $info_ac3['sample_rate']; + } + + $info_ac3['frame_length'] = getid3_ac3::AC3frameSizeLookup($info_ac3_raw['synchinfo']['frmsizecod'], $info_ac3_raw['synchinfo']['fscod']); + $info_ac3['bitrate'] = getid3_ac3::AC3bitrateLookup($info_ac3_raw['synchinfo']['frmsizecod']); + $getid3->info['audio']['bitrate'] = $info_ac3['bitrate']; + + $ac3_header['bsi'] = getid3_lib::BigEndian2Bin($this->fread(15)); + + $info_ac3_raw_bsi['bsid'] = bindec(substr($ac3_header['bsi'], 0, 5)); + if ($info_ac3_raw_bsi['bsid'] > 8) { + // Decoders which can decode version 8 will thus be able to decode version numbers less than 8. + // If this standard is extended by the addition of additional elements or features, a value of bsid greater than 8 will be used. + // Decoders built to this version of the standard will not be able to decode versions with bsid greater than 8. + throw new getid3_exception('Bit stream identification is version '.$info_ac3_raw_bsi['bsid'].', but getID3() only understands up to version 8'); + } + + $info_ac3_raw_bsi['bsmod'] = bindec(substr($ac3_header['bsi'], 5, 3)); + $info_ac3_raw_bsi['acmod'] = bindec(substr($ac3_header['bsi'], 8, 3)); + + $info_ac3['service_type'] = getid3_ac3::AC3serviceTypeLookup($info_ac3_raw_bsi['bsmod'], $info_ac3_raw_bsi['acmod']); + $ac3_coding_mode = getid3_ac3::AC3audioCodingModeLookup($info_ac3_raw_bsi['acmod']); + foreach($ac3_coding_mode as $key => $value) { + $info_ac3[$key] = $value; + } + switch ($info_ac3_raw_bsi['acmod']) { + case 0: + case 1: + $getid3->info['audio']['channelmode'] = 'mono'; + break; + case 3: + case 4: + $getid3->info['audio']['channelmode'] = 'stereo'; + break; + default: + $getid3->info['audio']['channelmode'] = 'surround'; + break; + } + $getid3->info['audio']['channels'] = $info_ac3['num_channels']; + + $offset = 11; + + if ($info_ac3_raw_bsi['acmod'] & 0x01) { + // If the lsb of acmod is a 1, center channel is in use and cmixlev follows in the bit stream. + $info_ac3_raw_bsi['cmixlev'] = bindec(substr($ac3_header['bsi'], $offset, 2)); + $info_ac3['center_mix_level'] = getid3_ac3::AC3centerMixLevelLookup($info_ac3_raw_bsi['cmixlev']); + $offset += 2; + } + + if ($info_ac3_raw_bsi['acmod'] & 0x04) { + // If the msb of acmod is a 1, surround channels are in use and surmixlev follows in the bit stream. + $info_ac3_raw_bsi['surmixlev'] = bindec(substr($ac3_header['bsi'], $offset, 2)); + $info_ac3['surround_mix_level'] = getid3_ac3::AC3surroundMixLevelLookup($info_ac3_raw_bsi['surmixlev']); + $offset += 2; + } + + if ($info_ac3_raw_bsi['acmod'] == 0x02) { + // When operating in the two channel mode, this 2-bit code indicates whether or not the program has been encoded in Dolby Surround. + $info_ac3_raw_bsi['dsurmod'] = bindec(substr($ac3_header['bsi'], $offset, 2)); + $info_ac3['dolby_surround_mode'] = getid3_ac3::AC3dolbySurroundModeLookup($info_ac3_raw_bsi['dsurmod']); + $offset += 2; + } + + $info_ac3_raw_bsi['lfeon'] = $ac3_header['bsi']{$offset++} == '1'; + $info_ac3['lfe_enabled'] = $info_ac3_raw_bsi['lfeon']; + if ($info_ac3_raw_bsi['lfeon']) { + $getid3->info['audio']['channels'] .= '.1'; + } + + $info_ac3['channels_enabled'] = getid3_ac3::AC3channelsEnabledLookup($info_ac3_raw_bsi['acmod'], $info_ac3_raw_bsi['lfeon']); + + // This indicates how far the average dialogue level is below digital 100 percent. Valid values are 1�31. + // The value of 0 is reserved. The values of 1 to 31 are interpreted as -1 dB to -31 dB with respect to digital 100 percent. + $info_ac3_raw_bsi['dialnorm'] = bindec(substr($ac3_header['bsi'], $offset, 5)); + $offset += 5; + $info_ac3['dialogue_normalization'] = '-'.$info_ac3_raw_bsi['dialnorm'].'dB'; + + $info_ac3_raw_bsi['compre_flag'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['compre_flag']) { + $info_ac3_raw_bsi['compr'] = bindec(substr($ac3_header['bsi'], $offset, 8)); + $offset += 8; + + $info_ac3['heavy_compression'] = getid3_ac3::AC3heavyCompression($info_ac3_raw_bsi['compr']); + } + + $info_ac3_raw_bsi['langcode_flag'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['langcode_flag']) { + $info_ac3_raw_bsi['langcod'] = bindec(substr($ac3_header['bsi'], $offset, 8)); + $offset += 8; + } + + $info_ac3_raw_bsi['audprodie'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['audprodie']) { + $info_ac3_raw_bsi['mixlevel'] = bindec(substr($ac3_header['bsi'], $offset, 5)); + $offset += 5; + + $info_ac3_raw_bsi['roomtyp'] = bindec(substr($ac3_header['bsi'], $offset, 2)); + $offset += 2; + + $info_ac3['mixing_level'] = (80 + $info_ac3_raw_bsi['mixlevel']).'dB'; + $info_ac3['room_type'] = getid3_ac3::AC3roomTypeLookup($info_ac3_raw_bsi['roomtyp']); + } + + if ($info_ac3_raw_bsi['acmod'] == 0x00) { + // If acmod is 0, then two completely independent program channels (dual mono) + // are encoded into the bit stream, and are referenced as Ch1, Ch2. In this case, + // a number of additional items are present in BSI or audblk to fully describe Ch2. + + + // This indicates how far the average dialogue level is below digital 100 percent. Valid values are 1�31. + // The value of 0 is reserved. The values of 1 to 31 are interpreted as -1 dB to -31 dB with respect to digital 100 percent. + $info_ac3_raw_bsi['dialnorm2'] = bindec(substr($ac3_header['bsi'], $offset, 5)); + $offset += 5; + + $info_ac3['dialogue_normalization2'] = '-'.$info_ac3_raw_bsi['dialnorm2'].'dB'; + + $info_ac3_raw_bsi['compre_flag2'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['compre_flag2']) { + $info_ac3_raw_bsi['compr2'] = bindec(substr($ac3_header['bsi'], $offset, 8)); + $offset += 8; + + $info_ac3['heavy_compression2'] = getid3_ac3::AC3heavyCompression($info_ac3_raw_bsi['compr2']); + } + + $info_ac3_raw_bsi['langcode_flag2'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['langcode_flag2']) { + $info_ac3_raw_bsi['langcod2'] = bindec(substr($ac3_header['bsi'], $offset, 8)); + $offset += 8; + } + + $info_ac3_raw_bsi['audprodie2'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['audprodie2']) { + $info_ac3_raw_bsi['mixlevel2'] = bindec(substr($ac3_header['bsi'], $offset, 5)); + $offset += 5; + + $info_ac3_raw_bsi['roomtyp2'] = bindec(substr($ac3_header['bsi'], $offset, 2)); + $offset += 2; + + $info_ac3['mixing_level2'] = (80 + $info_ac3_raw_bsi['mixlevel2']).'dB'; + $info_ac3['room_type2'] = getid3_ac3::AC3roomTypeLookup($info_ac3_raw_bsi['roomtyp2']); + } + + } + + $info_ac3_raw_bsi['copyright'] = $ac3_header['bsi']{$offset++} == '1'; + + $info_ac3_raw_bsi['original'] = $ac3_header['bsi']{$offset++} == '1'; + + $info_ac3_raw_bsi['timecode1_flag'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['timecode1_flag']) { + $info_ac3_raw_bsi['timecode1'] = bindec(substr($ac3_header['bsi'], $offset, 14)); + $offset += 14; + } + + $info_ac3_raw_bsi['timecode2_flag'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['timecode2_flag']) { + $info_ac3_raw_bsi['timecode2'] = bindec(substr($ac3_header['bsi'], $offset, 14)); + $offset += 14; + } + + $info_ac3_raw_bsi['addbsi_flag'] = $ac3_header['bsi']{$offset++} == '1'; + if ($info_ac3_raw_bsi['addbsi_flag']) { + $info_ac3_raw_bsi['addbsi_length'] = bindec(substr($ac3_header['bsi'], $offset, 6)); + $offset += 6; + + $ac3_header['bsi'] .= getid3_lib::BigEndian2Bin($this->fread($info_ac3_raw_bsi['addbsi_length'])); + + $info_ac3_raw_bsi['addbsi_data'] = substr($ac3_header['bsi'], 119, $info_ac3_raw_bsi['addbsi_length'] * 8); + } + + return true; + } + + + + public static function AC3sampleRateCodeLookup($fscod) { + + static $lookup = array ( + 0 => 48000, + 1 => 44100, + 2 => 32000, + 3 => 'reserved' // If the reserved code is indicated, the decoder should not attempt to decode audio and should mute. + ); + return (isset($lookup[$fscod]) ? $lookup[$fscod] : false); + } + + + + public static function AC3serviceTypeLookup($bsmod, $acmod) { + + static $lookup = array ( + 0 => 'main audio service: complete main (CM)', + 1 => 'main audio service: music and effects (ME)', + 2 => 'associated service: visually impaired (VI)', + 3 => 'associated service: hearing impaired (HI)', + 4 => 'associated service: dialogue (D)', + 5 => 'associated service: commentary (C)', + 6 => 'associated service: emergency (E)', + 7 => 'main audio service: karaoke' + ); + + if ($bsmod == 7 && $acmod == 1) { + return 'associated service: voice over (VO)'; + } + + return (isset($lookup[$bsmod]) ? $lookup[$bsmod] : false); + } + + + + public static function AC3audioCodingModeLookup($acmod) { + + // array (channel configuration, # channels (not incl LFE), channel order) + static $lookup = array ( + 0 => array ('channel_config'=>'1+1', 'num_channels'=>2, 'channel_order'=>'Ch1,Ch2'), + 1 => array ('channel_config'=>'1/0', 'num_channels'=>1, 'channel_order'=>'C'), + 2 => array ('channel_config'=>'2/0', 'num_channels'=>2, 'channel_order'=>'L,R'), + 3 => array ('channel_config'=>'3/0', 'num_channels'=>3, 'channel_order'=>'L,C,R'), + 4 => array ('channel_config'=>'2/1', 'num_channels'=>3, 'channel_order'=>'L,R,S'), + 5 => array ('channel_config'=>'3/1', 'num_channels'=>4, 'channel_order'=>'L,C,R,S'), + 6 => array ('channel_config'=>'2/2', 'num_channels'=>4, 'channel_order'=>'L,R,SL,SR'), + 7 => array ('channel_config'=>'3/2', 'num_channels'=>5, 'channel_order'=>'L,C,R,SL,SR') + ); + return (isset($lookup[$acmod]) ? $lookup[$acmod] : false); + } + + + + public static function AC3centerMixLevelLookup($cmixlev) { + + static $lookup; + if (!@$lookup) { + $lookup = array ( + 0 => pow(2, -3.0 / 6), // 0.707 (�3.0 dB) + 1 => pow(2, -4.5 / 6), // 0.595 (�4.5 dB) + 2 => pow(2, -6.0 / 6), // 0.500 (�6.0 dB) + 3 => 'reserved' + ); + } + return (isset($lookup[$cmixlev]) ? $lookup[$cmixlev] : false); + } + + + + public static function AC3surroundMixLevelLookup($surmixlev) { + + static $lookup; + if (!@$lookup) { + $lookup = array ( + 0 => pow(2, -3.0 / 6), + 1 => pow(2, -6.0 / 6), + 2 => 0, + 3 => 'reserved' + ); + } + return (isset($lookup[$surmixlev]) ? $lookup[$surmixlev] : false); + } + + + + public static function AC3dolbySurroundModeLookup($dsurmod) { + + static $lookup = array ( + 0 => 'not indicated', + 1 => 'Not Dolby Surround encoded', + 2 => 'Dolby Surround encoded', + 3 => 'reserved' + ); + return (isset($lookup[$dsurmod]) ? $lookup[$dsurmod] : false); + } + + + + public static function AC3channelsEnabledLookup($acmod, $lfeon) { + + return array ( + 'ch1' => $acmod == 0, + 'ch2' => $acmod == 0, + 'left' => $acmod > 1, + 'right' => $acmod > 1, + 'center' => (bool)($acmod & 0x01), + 'surround_mono' => $acmod == 4 || $acmod == 5, + 'surround_left' => $acmod == 6 || $acmod == 7, + 'surround_right' => $acmod == 6 || $acmod == 7, + 'lfe' => $lfeon + ); + } + + + + public static function AC3heavyCompression($compre) { + + // The first four bits indicate gain changes in 6.02dB increments which can be + // implemented with an arithmetic shift operation. The following four bits + // indicate linear gain changes, and require a 5-bit multiply. + // We will represent the two 4-bit fields of compr as follows: + // X0 X1 X2 X3 . Y4 Y5 Y6 Y7 + // The meaning of the X values is most simply described by considering X to represent a 4-bit + // signed integer with values from �8 to +7. The gain indicated by X is then (X + 1) * 6.02 dB. The + // following table shows this in detail. + + // Meaning of 4 msb of compr + // 7 +48.16 dB + // 6 +42.14 dB + // 5 +36.12 dB + // 4 +30.10 dB + // 3 +24.08 dB + // 2 +18.06 dB + // 1 +12.04 dB + // 0 +6.02 dB + // -1 0 dB + // -2 �6.02 dB + // -3 �12.04 dB + // -4 �18.06 dB + // -5 �24.08 dB + // -6 �30.10 dB + // -7 �36.12 dB + // -8 �42.14 dB + + $fourbit = str_pad(decbin(($compre & 0xF0) >> 4), 4, '0', STR_PAD_LEFT); + if ($fourbit{0} == '1') { + $log_gain = -8 + bindec(substr($fourbit, 1)); + } else { + $log_gain = bindec(substr($fourbit, 1)); + } + $log_gain = ($log_gain + 1) * (20 * log10(2)); + + // The value of Y is a linear representation of a gain change of up to �6 dB. Y is considered to + // be an unsigned fractional integer, with a leading value of 1, or: 0.1 Y4 Y5 Y6 Y7 (base 2). Y can + // represent values between 0.111112 (or 31/32) and 0.100002 (or 1/2). Thus, Y can represent gain + // changes from �0.28 dB to �6.02 dB. + + $lin_gain = (16 + ($compre & 0x0F)) / 32; + + // The combination of X and Y values allows compr to indicate gain changes from + // 48.16 � 0.28 = +47.89 dB, to + // �42.14 � 6.02 = �48.16 dB. + + return $log_gain - $lin_gain; + } + + + + public static function AC3roomTypeLookup($roomtyp) { + + static $lookup = array ( + 0 => 'not indicated', + 1 => 'large room, X curve monitor', + 2 => 'small room, flat monitor', + 3 => 'reserved' + ); + return (isset($lookup[$roomtyp]) ? $lookup[$roomtyp] : false); + } + + + + public static function AC3frameSizeLookup($frmsizecod, $fscod) { + + $padding = (bool)($frmsizecod % 2); + $frame_size_id = floor($frmsizecod / 2); + + static $lookup = array ( + 0 => array (128, 138, 192), + 1 => array (40, 160, 174, 240), + 2 => array (48, 192, 208, 288), + 3 => array (56, 224, 242, 336), + 4 => array (64, 256, 278, 384), + 5 => array (80, 320, 348, 480), + 6 => array (96, 384, 416, 576), + 7 => array (112, 448, 486, 672), + 8 => array (128, 512, 556, 768), + 9 => array (160, 640, 696, 960), + 10 => array (192, 768, 834, 1152), + 11 => array (224, 896, 974, 1344), + 12 => array (256, 1024, 1114, 1536), + 13 => array (320, 1280, 1392, 1920), + 14 => array (384, 1536, 1670, 2304), + 15 => array (448, 1792, 1950, 2688), + 16 => array (512, 2048, 2228, 3072), + 17 => array (576, 2304, 2506, 3456), + 18 => array (640, 2560, 2786, 3840) + ); + if (($fscod == 1) && $padding) { + // frame lengths are padded by 1 word (16 bits) at 44100 + $lookup[$frmsizecod] += 2; + } + return (isset($lookup[$frame_size_id][$fscod]) ? $lookup[$frame_size_id][$fscod] : false); + } + + + + public static function AC3bitrateLookup($frmsizecod) { + + static $lookup = array ( + 0 => 32000, + 1 => 40000, + 2 => 48000, + 3 => 56000, + 4 => 64000, + 5 => 80000, + 6 => 96000, + 7 => 112000, + 8 => 128000, + 9 => 160000, + 10 => 192000, + 11 => 224000, + 12 => 256000, + 13 => 320000, + 14 => 384000, + 15 => 448000, + 16 => 512000, + 17 => 576000, + 18 => 640000 + ); + $frame_size_id = floor($frmsizecod / 2); + return (isset($lookup[$frame_size_id]) ? $lookup[$frame_size_id] : false); + } + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.au.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.au.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.au.php 3 Jan 2016 20:51:42 -0000 1.1.2.1 @@ -0,0 +1,184 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.au.php | +// | module for analyzing AU files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.au.php,v 1.1.2.1 2016/01/03 20:51:42 gustafn Exp $ + + + +class getid3_au extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $au_header = fread($getid3->fp, 8); + + // Magic bytes: .snd + + $getid3->info['au'] = array (); + $info_au = &$getid3->info['au']; + + $getid3->info['fileformat'] = 'au'; + $getid3->info['audio']['dataformat'] = 'au'; + $getid3->info['audio']['bitrate_mode'] = 'cbr'; + $info_au['encoding'] = 'ISO-8859-1'; + + $info_au['header_length'] = getid3_lib::BigEndian2Int(substr($au_header, 4, 4)); + $au_header .= fread($getid3->fp, $info_au['header_length'] - 8); + $getid3->info['avdataoffset'] += $info_au['header_length']; + + getid3_lib::ReadSequence('BigEndian2Int', $info_au, $au_header, 8, + array ( + 'data_size' => 4, + 'data_format_id'=> 4, + 'sample_rate' => 4, + 'channels' => 4 + ) + ); + $info_au['comments']['comment'][] = trim(substr($au_header, 24)); + + $info_au['data_format'] = getid3_au::AUdataFormatNameLookup($info_au['data_format_id']); + $info_au['used_bits_per_sample'] = getid3_au::AUdataFormatUsedBitsPerSampleLookup($info_au['data_format_id']); + if ($info_au['bits_per_sample'] = getid3_au::AUdataFormatBitsPerSampleLookup($info_au['data_format_id'])) { + $getid3->info['audio']['bits_per_sample'] = $info_au['bits_per_sample']; + } else { + unset($info_au['bits_per_sample']); + } + + $getid3->info['audio']['sample_rate'] = $info_au['sample_rate']; + $getid3->info['audio']['channels'] = $info_au['channels']; + + if (($getid3->info['avdataoffset'] + $info_au['data_size']) > $getid3->info['avdataend']) { + $getid3->warning('Possible truncated file - expecting "'.$info_au['data_size'].'" bytes of audio data, only found '.($getid3->info['avdataend'] - $getid3->info['avdataoffset']).' bytes"'); + } + + $getid3->info['playtime_seconds'] = $info_au['data_size'] / ($info_au['sample_rate'] * $info_au['channels'] * ($info_au['used_bits_per_sample'] / 8)); + $getid3->info['audio']['bitrate'] = ($info_au['data_size'] * 8) / $getid3->info['playtime_seconds']; + + return true; + } + + + + public static function AUdataFormatNameLookup($id) { + + static $lookup = array ( + 0 => 'unspecified format', + 1 => '8-bit mu-law', + 2 => '8-bit linear', + 3 => '16-bit linear', + 4 => '24-bit linear', + 5 => '32-bit linear', + 6 => 'floating-point', + 7 => 'double-precision float', + 8 => 'fragmented sampled data', + 9 => 'SUN_FORMAT_NESTED', + 10 => 'DSP program', + 11 => '8-bit fixed-point', + 12 => '16-bit fixed-point', + 13 => '24-bit fixed-point', + 14 => '32-bit fixed-point', + + 16 => 'non-audio display data', + 17 => 'SND_FORMAT_MULAW_SQUELCH', + 18 => '16-bit linear with emphasis', + 19 => '16-bit linear with compression', + 20 => '16-bit linear with emphasis + compression', + 21 => 'Music Kit DSP commands', + 22 => 'SND_FORMAT_DSP_COMMANDS_SAMPLES', + 23 => 'CCITT g.721 4-bit ADPCM', + 24 => 'CCITT g.722 ADPCM', + 25 => 'CCITT g.723 3-bit ADPCM', + 26 => 'CCITT g.723 5-bit ADPCM', + 27 => 'A-Law 8-bit' + ); + + return (isset($lookup[$id]) ? $lookup[$id] : false); + } + + + + public static function AUdataFormatBitsPerSampleLookup($id) { + + static $lookup = array ( + 1 => 8, + 2 => 8, + 3 => 16, + 4 => 24, + 5 => 32, + 6 => 32, + 7 => 64, + + 11 => 8, + 12 => 16, + 13 => 24, + 14 => 32, + + 18 => 16, + 19 => 16, + 20 => 16, + + 23 => 16, + + 25 => 16, + 26 => 16, + 27 => 8 + ); + return (isset($lookup[$id]) ? $lookup[$id] : false); + } + + + + public static function AUdataFormatUsedBitsPerSampleLookup($id) { + + static $lookup = array ( + 1 => 8, + 2 => 8, + 3 => 16, + 4 => 24, + 5 => 32, + 6 => 32, + 7 => 64, + + 11 => 8, + 12 => 16, + 13 => 24, + 14 => 32, + + 18 => 16, + 19 => 16, + 20 => 16, + + 23 => 4, + + 25 => 3, + 26 => 5, + 27 => 8, + ); + return (isset($lookup[$id]) ? $lookup[$id] : false); + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.avr.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.avr.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.avr.php 3 Jan 2016 20:51:42 -0000 1.1.2.1 @@ -0,0 +1,135 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.avr.php | +// | Module for analyzing AVR audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.avr.php,v 1.1.2.1 2016/01/03 20:51:42 gustafn Exp $ + + + +class getid3_avr extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + // http://cui.unige.ch/OSG/info/AudioFormats/ap11.html + // http://www.btinternet.com/~AnthonyJ/Atari/programming/avr_format.html + // offset type length name comments + // --------------------------------------------------------------------- + // 0 char 4 ID format ID == "2BIT" + // 4 char 8 name sample name (unused space filled with 0) + // 12 short 1 mono/stereo 0=mono, -1 (0xFFFF)=stereo + // With stereo, samples are alternated, + // the first voice is the left : + // (LRLRLRLRLRLRLRLRLR...) + // 14 short 1 resolution 8, 12 or 16 (bits) + // 16 short 1 signed or not 0=unsigned, -1 (0xFFFF)=signed + // 18 short 1 loop or not 0=no loop, -1 (0xFFFF)=loop on + // 20 short 1 MIDI note 0xFFnn, where 0 <= nn <= 127 + // 0xFFFF means "no MIDI note defined" + // 22 byte 1 Replay speed Frequence in the Replay software + // 0=5.485 Khz, 1=8.084 Khz, 2=10.971 Khz, + // 3=16.168 Khz, 4=21.942 Khz, 5=32.336 Khz + // 6=43.885 Khz, 7=47.261 Khz + // -1 (0xFF)=no defined Frequence + // 23 byte 3 sample rate in Hertz + // 26 long 1 size in bytes (2 * bytes in stereo) + // 30 long 1 loop begin 0 for no loop + // 34 long 1 loop size equal to 'size' for no loop + // 38 short 2 Reserved, MIDI keyboard split */ + // 40 short 2 Reserved, sample compression */ + // 42 short 2 Reserved */ + // 44 char 20; Additional filename space, used if (name[7] != 0) + // 64 byte 64 user data + // 128 bytes ? sample data (12 bits samples are coded on 16 bits: + // 0000 xxxx xxxx xxxx) + // --------------------------------------------------------------------- + + // Note that all values are in motorola (big-endian) format, and that long is + // assumed to be 4 bytes, and short 2 bytes. + // When reading the samples, you should handle both signed and unsigned data, + // and be prepared to convert 16->8 bit, or mono->stereo if needed. To convert + // 8-bit data between signed/unsigned just add 127 to the sample values. + // Simularly for 16-bit data you should add 32769 + + + // Magic bytes: '2BIT' + + $getid3->info['avr'] = array (); + $info_avr = &$getid3->info['avr']; + + $getid3->info['fileformat'] = 'avr'; + $info_avr['raw']['magic'] = '2BIT'; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $avr_header = fread($getid3->fp, 128); + + $getid3->info['avdataoffset'] += 128; + + $info_avr['sample_name'] = rtrim(substr($avr_header, 4, 8)); + + $info_avr['raw']['mono'] = getid3_lib::BigEndian2Int(substr($avr_header, 12, 2)); + $info_avr['bits_per_sample'] = getid3_lib::BigEndian2Int(substr($avr_header, 14, 2)); + $info_avr['raw']['signed'] = getid3_lib::BigEndian2Int(substr($avr_header, 16, 2)); + $info_avr['raw']['loop'] = getid3_lib::BigEndian2Int(substr($avr_header, 18, 2)); + $info_avr['raw']['midi'] = getid3_lib::BigEndian2Int(substr($avr_header, 20, 2)); + $info_avr['raw']['replay_freq'] = getid3_lib::BigEndian2Int(substr($avr_header, 22, 1)); + $info_avr['sample_rate'] = getid3_lib::BigEndian2Int(substr($avr_header, 23, 3)); + $info_avr['sample_length'] = getid3_lib::BigEndian2Int(substr($avr_header, 26, 4)); + $info_avr['loop_start'] = getid3_lib::BigEndian2Int(substr($avr_header, 30, 4)); + $info_avr['loop_end'] = getid3_lib::BigEndian2Int(substr($avr_header, 34, 4)); + $info_avr['midi_split'] = getid3_lib::BigEndian2Int(substr($avr_header, 38, 2)); + $info_avr['sample_compression'] = getid3_lib::BigEndian2Int(substr($avr_header, 40, 2)); + $info_avr['reserved'] = getid3_lib::BigEndian2Int(substr($avr_header, 42, 2)); + $info_avr['sample_name_extra'] = rtrim(substr($avr_header, 44, 20)); + $info_avr['comment'] = rtrim(substr($avr_header, 64, 64)); + + $info_avr['flags']['stereo'] = (($info_avr['raw']['mono'] == 0) ? false : true); + $info_avr['flags']['signed'] = (($info_avr['raw']['signed'] == 0) ? false : true); + $info_avr['flags']['loop'] = (($info_avr['raw']['loop'] == 0) ? false : true); + + $info_avr['midi_notes'] = array (); + if (($info_avr['raw']['midi'] & 0xFF00) != 0xFF00) { + $info_avr['midi_notes'][] = ($info_avr['raw']['midi'] & 0xFF00) >> 8; + } + if (($info_avr['raw']['midi'] & 0x00FF) != 0x00FF) { + $info_avr['midi_notes'][] = ($info_avr['raw']['midi'] & 0x00FF); + } + + if (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) != ($info_avr['sample_length'] * (($info_avr['bits_per_sample'] == 8) ? 1 : 2))) { + $getid3->warning('Probable truncated file: expecting '.($info_avr['sample_length'] * (($info_avr['bits_per_sample'] == 8) ? 1 : 2)).' bytes of audio data, found '.($getid3->info['avdataend'] - $getid3->info['avdataoffset'])); + } + + $getid3->info['audio']['dataformat'] = 'avr'; + $getid3->info['audio']['lossless'] = true; + $getid3->info['audio']['bitrate_mode'] = 'cbr'; + $getid3->info['audio']['bits_per_sample'] = $info_avr['bits_per_sample']; + $getid3->info['audio']['sample_rate'] = $info_avr['sample_rate']; + $getid3->info['audio']['channels'] = ($info_avr['flags']['stereo'] ? 2 : 1); + $getid3->info['playtime_seconds'] = ($info_avr['sample_length'] / $getid3->info['audio']['channels']) / $info_avr['sample_rate']; + $getid3->info['audio']['bitrate'] = ($info_avr['sample_length'] * (($info_avr['bits_per_sample'] == 8) ? 8 : 16)) / $getid3->info['playtime_seconds']; + + return true; + } +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.bonk.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.bonk.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.bonk.php 3 Jan 2016 20:51:42 -0000 1.1.2.1 @@ -0,0 +1,235 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.bonk.php | +// | Module for analyzing BONK audio files | +// | dependencies: module.tag.id3v2.php (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.bonk.php,v 1.1.2.1 2016/01/03 20:51:42 gustafn Exp $ + + + +class getid3_bonk extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['bonk'] = array (); + $info_bonk = &$getid3->info['bonk']; + + $info_bonk['dataoffset'] = $getid3->info['avdataoffset']; + $info_bonk['dataend'] = $getid3->info['avdataend']; + + + // Scan-from-end method, for v0.6 and higher + fseek($getid3->fp, $info_bonk['dataend'] - 8, SEEK_SET); + $possible_bonk_tag = fread($getid3->fp, 8); + while (getid3_bonk::BonkIsValidTagName(substr($possible_bonk_tag, 4, 4), true)) { + $bonk_tag_size = getid3_lib::LittleEndian2Int(substr($possible_bonk_tag, 0, 4)); + fseek($getid3->fp, 0 - $bonk_tag_size, SEEK_CUR); + $bonk_tag_offset = ftell($getid3->fp); + $tag_header_test = fread($getid3->fp, 5); + if (($tag_header_test{0} != "\x00") || (substr($possible_bonk_tag, 4, 4) != strtolower(substr($possible_bonk_tag, 4, 4)))) { + throw new getid3_exception('Expecting "�'.strtoupper(substr($possible_bonk_tag, 4, 4)).'" at offset '.$bonk_tag_offset.', found "'.$tag_header_test.'"'); + } + $bonk_tag_name = substr($tag_header_test, 1, 4); + + $info_bonk[$bonk_tag_name]['size'] = $bonk_tag_size; + $info_bonk[$bonk_tag_name]['offset'] = $bonk_tag_offset; + $this->HandleBonkTags($bonk_tag_name); + + $next_tag_end_offset = $bonk_tag_offset - 8; + if ($next_tag_end_offset < $info_bonk['dataoffset']) { + if (empty($getid3->info['audio']['encoder'])) { + $getid3->info['audio']['encoder'] = 'Extended BONK v0.9+'; + } + return true; + } + fseek($getid3->fp, $next_tag_end_offset, SEEK_SET); + $possible_bonk_tag = fread($getid3->fp, 8); + } + + // Seek-from-beginning method for v0.4 and v0.5 + if (empty($info_bonk['BONK'])) { + fseek($getid3->fp, $info_bonk['dataoffset'], SEEK_SET); + do { + $tag_header_test = fread($getid3->fp, 5); + switch ($tag_header_test) { + case "\x00".'BONK': + if (empty($getid3->info['audio']['encoder'])) { + $getid3->info['audio']['encoder'] = 'BONK v0.4'; + } + break; + + case "\x00".'INFO': + $getid3->info['audio']['encoder'] = 'Extended BONK v0.5'; + break; + + default: + break 2; + } + $bonk_tag_name = substr($tag_header_test, 1, 4); + $info_bonk[$bonk_tag_name]['size'] = $info_bonk['dataend'] - $info_bonk['dataoffset']; + $info_bonk[$bonk_tag_name]['offset'] = $info_bonk['dataoffset']; + $this->HandleBonkTags($bonk_tag_name); + + } while (true); + } + + + // Parse META block for v0.6 - v0.8 + if (!@$info_bonk['INFO'] && isset($info_bonk['META']['tags']['info'])) { + fseek($getid3->fp, $info_bonk['META']['tags']['info'], SEEK_SET); + $tag_header_test = fread($getid3->fp, 5); + if ($tag_header_test == "\x00".'INFO') { + $getid3->info['audio']['encoder'] = 'Extended BONK v0.6 - v0.8'; + + $bonk_tag_name = substr($tag_header_test, 1, 4); + $info_bonk[$bonk_tag_name]['size'] = $info_bonk['dataend'] - $info_bonk['dataoffset']; + $info_bonk[$bonk_tag_name]['offset'] = $info_bonk['dataoffset']; + $this->HandleBonkTags($bonk_tag_name); + } + } + + if (empty($getid3->info['audio']['encoder'])) { + $getid3->info['audio']['encoder'] = 'Extended BONK v0.9+'; + } + if (empty($info_bonk['BONK'])) { + unset($getid3->info['bonk']); + } + return true; + + } + + + + private function HandleBonkTags(&$bonk_tag_name) { + + // Shortcut to getid3 pointer + $getid3 = $this->getid3; + $info_audio = &$getid3->info['audio']; + + switch ($bonk_tag_name) { + + case 'BONK': + // shortcut + $info_bonk_BONK = &$getid3->info['bonk']['BONK']; + + $bonk_data = "\x00".'BONK'.fread($getid3->fp, 17); + + getid3_lib::ReadSequence('LittleEndian2Int', $info_bonk_BONK, $bonk_data, 5, + array ( + 'version' => 1, + 'number_samples' => 4, + 'sample_rate' => 4, + 'channels' => 1, + 'lossless' => 1, + 'joint_stereo' => 1, + 'number_taps' => 2, + 'downsampling_ratio' => 1, + 'samples_per_packet' => 2 + ) + ); + + $info_bonk_BONK['lossless'] = (bool)$info_bonk_BONK['lossless']; + $info_bonk_BONK['joint_stereo'] = (bool)$info_bonk_BONK['joint_stereo']; + + $getid3->info['avdataoffset'] = $info_bonk_BONK['offset'] + 5 + 17; + $getid3->info['avdataend'] = $info_bonk_BONK['offset'] + $info_bonk_BONK['size']; + + $getid3->info['fileformat'] = 'bonk'; + $info_audio['dataformat'] = 'bonk'; + $info_audio['bitrate_mode'] = 'vbr'; // assumed + $info_audio['channels'] = $info_bonk_BONK['channels']; + $info_audio['sample_rate'] = $info_bonk_BONK['sample_rate']; + $info_audio['channelmode'] = $info_bonk_BONK['joint_stereo'] ? 'joint stereo' : 'stereo'; + $info_audio['lossless'] = $info_bonk_BONK['lossless']; + $info_audio['codec'] = 'bonk'; + + $getid3->info['playtime_seconds'] = $info_bonk_BONK['number_samples'] / ($info_bonk_BONK['sample_rate'] * $info_bonk_BONK['channels']); + if ($getid3->info['playtime_seconds'] > 0) { + $info_audio['bitrate'] = (($getid3->info['bonk']['dataend'] - $getid3->info['bonk']['dataoffset']) * 8) / $getid3->info['playtime_seconds']; + } + break; + + case 'INFO': + // shortcut + $info_bonk_INFO = &$getid3->info['bonk']['INFO']; + + $info_bonk_INFO['version'] = getid3_lib::LittleEndian2Int(fread($getid3->fp, 1)); + $info_bonk_INFO['entries_count'] = 0; + $next_info_data_pair = fread($getid3->fp, 5); + if (!getid3_bonk::BonkIsValidTagName(substr($next_info_data_pair, 1, 4))) { + while (!feof($getid3->fp)) { + $next_info_data_pair = fread($getid3->fp, 5); + if (getid3_bonk::BonkIsValidTagName(substr($next_info_data_pair, 1, 4))) { + fseek($getid3->fp, -5, SEEK_CUR); + break; + } + $info_bonk_INFO['entries_count']++; + } + } + break; + + case 'META': + $bonk_data = "\x00".'META'.fread($getid3->fp, $getid3->info['bonk']['META']['size'] - 5); + $getid3->info['bonk']['META']['version'] = getid3_lib::LittleEndian2Int(substr($bonk_data, 5, 1)); + + $meta_tag_entries = floor(((strlen($bonk_data) - 8) - 6) / 8); // BonkData - xxxxmeta - �META + $offset = 6; + for ($i = 0; $i < $meta_tag_entries; $i++) { + $meta_entry_tag_name = substr($bonk_data, $offset, 4); + $offset += 4; + $meta_entry_tag_offset = getid3_lib::LittleEndian2Int(substr($bonk_data, $offset, 4)); + $offset += 4; + $getid3->info['bonk']['META']['tags'][$meta_entry_tag_name] = $meta_entry_tag_offset; + } + break; + + case ' ID3': + $info_audio['encoder'] = 'Extended BONK v0.9+'; + + // ID3v2 checking is optional + if (class_exists('getid3_id3v2')) { + + $id3v2 = new getid3_id3v2($getid3); + $id3v2->option_starting_offset = $getid3->info['bonk'][' ID3']['offset'] + 2; + $getid3->info['bonk'][' ID3']['valid'] = $id3v2->Analyze(); + } + break; + + default: + $getid3->warning('Unexpected Bonk tag "'.$bonk_tag_name.'" at offset '.$getid3->info['bonk'][$bonk_tag_name]['offset']); + break; + + } + } + + + + public static function BonkIsValidTagName($possible_bonk_tag, $ignore_case=false) { + + $ignore_case = $ignore_case ? 'i' : ''; + return preg_match('/^(BONK|INFO| ID3|META)$/'.$ignore_case, $possible_bonk_tag); + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.dts.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.dts.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.dts.php 3 Jan 2016 20:51:42 -0000 1.1.2.1 @@ -0,0 +1,254 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.dts.php | +// | Module for analyzing DTS audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.dts.php,v 1.1.2.1 2016/01/03 20:51:42 gustafn Exp $ + + + +// Specs taken from "DTS Coherent Acoustics;Core and Extensions, ETSI TS 102 114 V1.2.1 (2002-12)" +// (http://pda.etsi.org/pda/queryform.asp) +// With thanks to Gambit http://mac.sourceforge.net/atl/ + +class getid3_dts extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['dts'] = array (); + $info_dts = &$getid3->info['dts']; + + $getid3->info['fileformat'] = 'dts'; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $header = fread($getid3->fp, 16); + + $fhBS = getid3_lib::BigEndian2Bin(substr($header, 4, 12)); + $bs_offset = 0; + $info_dts['raw']['frame_type'] = bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['raw']['deficit_samples'] = bindec(substr($fhBS, $bs_offset, 5)); $bs_offset += 5; + $info_dts['flags']['crc_present'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['raw']['pcm_sample_blocks'] = bindec(substr($fhBS, $bs_offset, 7)); $bs_offset += 7; + $info_dts['raw']['frame_byte_size'] = bindec(substr($fhBS, $bs_offset, 14)); $bs_offset += 14; + $info_dts['raw']['channel_arrangement'] = bindec(substr($fhBS, $bs_offset, 6)); $bs_offset += 6; + $info_dts['raw']['sample_frequency'] = bindec(substr($fhBS, $bs_offset, 4)); $bs_offset += 4; + $info_dts['raw']['bitrate'] = bindec(substr($fhBS, $bs_offset, 5)); $bs_offset += 5; + $info_dts['flags']['embedded_downmix'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['flags']['dynamicrange'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['flags']['timestamp'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['flags']['auxdata'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['flags']['hdcd'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['raw']['extension_audio'] = bindec(substr($fhBS, $bs_offset, 3)); $bs_offset += 3; + $info_dts['flags']['extended_coding'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['flags']['audio_sync_insertion'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['raw']['lfe_effects'] = bindec(substr($fhBS, $bs_offset, 2)); $bs_offset += 2; + $info_dts['flags']['predictor_history'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + if ($info_dts['flags']['crc_present']) { + $info_dts['raw']['crc16'] = bindec(substr($fhBS, $bs_offset, 16)); $bs_offset += 16; + } + $info_dts['flags']['mri_perfect_reconst'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['raw']['encoder_soft_version'] = bindec(substr($fhBS, $bs_offset, 4)); $bs_offset += 4; + $info_dts['raw']['copy_history'] = bindec(substr($fhBS, $bs_offset, 2)); $bs_offset += 2; + $info_dts['raw']['bits_per_sample'] = bindec(substr($fhBS, $bs_offset, 2)); $bs_offset += 2; + $info_dts['flags']['surround_es'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['flags']['front_sum_diff'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['flags']['surround_sum_diff'] = (bool) bindec(substr($fhBS, $bs_offset, 1)); $bs_offset += 1; + $info_dts['raw']['dialog_normalization'] = bindec(substr($fhBS, $bs_offset, 4)); $bs_offset += 4; + + + $info_dts['bitrate'] = $this->DTSbitrateLookup($info_dts['raw']['bitrate']); + $info_dts['bits_per_sample'] = $this->DTSbitPerSampleLookup($info_dts['raw']['bits_per_sample']); + $info_dts['sample_rate'] = $this->DTSsampleRateLookup($info_dts['raw']['sample_frequency']); + $info_dts['dialog_normalization'] = $this->DTSdialogNormalization($info_dts['raw']['dialog_normalization'], $info_dts['raw']['encoder_soft_version']); + $info_dts['flags']['lossless'] = (($info_dts['raw']['bitrate'] == 31) ? true : false); + $info_dts['bitrate_mode'] = (($info_dts['raw']['bitrate'] == 30) ? 'vbr' : 'cbr'); + $info_dts['channels'] = $this->DTSnumChannelsLookup($info_dts['raw']['channel_arrangement']); + $info_dts['channel_arrangement'] = $this->DTSchannelArrangementLookup($info_dts['raw']['channel_arrangement']); + + $getid3->info['audio']['dataformat'] = 'dts'; + $getid3->info['audio']['lossless'] = $info_dts['flags']['lossless']; + $getid3->info['audio']['bitrate_mode'] = $info_dts['bitrate_mode']; + $getid3->info['audio']['bits_per_sample'] = $info_dts['bits_per_sample']; + $getid3->info['audio']['sample_rate'] = $info_dts['sample_rate']; + $getid3->info['audio']['channels'] = $info_dts['channels']; + $getid3->info['audio']['bitrate'] = $info_dts['bitrate']; + $getid3->info['playtime_seconds'] = ($getid3->info['avdataend'] - $getid3->info['avdataoffset']) / ($info_dts['bitrate'] / 8); + + return true; + } + + + public static function DTSbitrateLookup($index) { + + static $lookup = array ( + 0 => 32000, + 1 => 56000, + 2 => 64000, + 3 => 96000, + 4 => 112000, + 5 => 128000, + 6 => 192000, + 7 => 224000, + 8 => 256000, + 9 => 320000, + 10 => 384000, + 11 => 448000, + 12 => 512000, + 13 => 576000, + 14 => 640000, + 15 => 768000, + 16 => 960000, + 17 => 1024000, + 18 => 1152000, + 19 => 1280000, + 20 => 1344000, + 21 => 1408000, + 22 => 1411200, + 23 => 1472000, + 24 => 1536000, + 25 => 1920000, + 26 => 2048000, + 27 => 3072000, + 28 => 3840000, + 29 => 'open', + 30 => 'variable', + 31 => 'lossless' + ); + return @$lookup[$index]; + } + + + public static function DTSsampleRateLookup($index) { + + static $lookup = array ( + 0 => 'invalid', + 1 => 8000, + 2 => 16000, + 3 => 32000, + 4 => 'invalid', + 5 => 'invalid', + 6 => 11025, + 7 => 22050, + 8 => 44100, + 9 => 'invalid', + 10 => 'invalid', + 11 => 12000, + 12 => 24000, + 13 => 48000, + 14 => 'invalid', + 15 => 'invalid' + ); + return @$lookup[$index]; + } + + + public static function DTSbitPerSampleLookup($index) { + + static $lookup = array ( + 0 => 16, + 1 => 20, + 2 => 24, + 3 => 24, + ); + return @$lookup[$index]; + } + + + public static function DTSnumChannelsLookup($index) { + + switch ($index) { + case 0: + return 1; + + case 1: + case 2: + case 3: + case 4: + return 2; + + case 5: + case 6: + return 3; + + case 7: + case 8: + return 4; + + case 9: + return 5; + + case 10: + case 11: + case 12: + return 6; + + case 13: + return 7; + + case 14: + case 15: + return 8; + } + return false; + } + + + public static function DTSchannelArrangementLookup($index) { + + static $lookup = array ( + 0 => 'A', + 1 => 'A + B (dual mono)', + 2 => 'L + R (stereo)', + 3 => '(L+R) + (L-R) (sum-difference)', + 4 => 'LT + RT (left and right total)', + 5 => 'C + L + R', + 6 => 'L + R + S', + 7 => 'C + L + R + S', + 8 => 'L + R + SL + SR', + 9 => 'C + L + R + SL + SR', + 10 => 'CL + CR + L + R + SL + SR', + 11 => 'C + L + R+ LR + RR + OV', + 12 => 'CF + CR + LF + RF + LR + RR', + 13 => 'CL + C + CR + L + R + SL + SR', + 14 => 'CL + CR + L + R + SL1 + SL2 + SR1 + SR2', + 15 => 'CL + C+ CR + L + R + SL + S + SR', + ); + return (@$lookup[$index] ? @$lookup[$index] : 'user-defined'); + } + + + public static function DTSdialogNormalization($index, $version) { + + switch ($version) { + case 7: + return 0 - $index; + + case 6: + return 0 - 16 - $index; + } + return false; + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.la.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.la.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.la.php 3 Jan 2016 20:51:42 -0000 1.1.2.1 @@ -0,0 +1,196 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.la.php | +// | Module for analyzing LA udio files | +// | dependencies: module.audio-video.riff.php | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.la.php,v 1.1.2.1 2016/01/03 20:51:42 gustafn Exp $ + + + +class getid3_la extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->include_module('audio-video.riff'); + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $raw_data = fread($getid3->fp, getid3::FREAD_BUFFER_SIZE); + + $getid3->info['fileformat'] = 'la'; + $getid3->info['audio']['dataformat'] = 'la'; + $getid3->info['audio']['lossless'] = true; + + $getid3->info['la']['version_major'] = (int)$raw_data{2}; + $getid3->info['la']['version_minor'] = (int)$raw_data{3}; + $getid3->info['la']['version'] = (float)$getid3->info['la']['version_major'] + ($getid3->info['la']['version_minor'] / 10); + + $getid3->info['la']['uncompressed_size'] = getid3_lib::LittleEndian2Int(substr($raw_data, 4, 4)); + + $wave_chunk = substr($raw_data, 8, 4); + if ($wave_chunk !== 'WAVE') { + throw new getid3_exception('Expected "WAVE" ('.getid3_lib::PrintHexBytes('WAVE').') at offset 8, found "'.$wave_chunk.'" ('.getid3_lib::PrintHexBytes($wave_chunk).') instead.'); + } + + $offset = 12; + + $getid3->info['la']['fmt_size'] = 24; + if ($getid3->info['la']['version'] >= 0.3) { + + $getid3->info['la']['fmt_size'] = getid3_lib::LittleEndian2Int(substr($raw_data, $offset, 4)); + $getid3->info['la']['header_size'] = 49 + $getid3->info['la']['fmt_size'] - 24; + $offset += 4; + + } else { + + // version 0.2 didn't support additional data blocks + $getid3->info['la']['header_size'] = 41; + } + + $fmt_chunk = substr($raw_data, $offset, 4); + if ($fmt_chunk !== 'fmt ') { + throw new getid3_exception('Expected "fmt " ('.getid3_lib::PrintHexBytes('fmt ').') at offset '.$offset.', found "'.$fmt_chunk.'" ('.getid3_lib::PrintHexBytes($fmt_chunk).') instead.'); + } + $offset += 4; + + $fmt_size = getid3_lib::LittleEndian2Int(substr($raw_data, $offset, 4)); + $offset += 4; + + $getid3->info['la']['raw']['format'] = getid3_lib::LittleEndian2Int(substr($raw_data, $offset, 2)); + $offset += 2; + + getid3_lib::ReadSequence('LittleEndian2Int', $getid3->info['la'], $raw_data, $offset, + array ( + 'channels' => 2, + 'sample_rate' => 4, + 'bytes_per_second' => 4, + 'bytes_per_sample' => 2, + 'bits_per_sample' => 2, + 'samples' => 4 + ) + ); + $offset += 18; + + $getid3->info['la']['raw']['flags'] = getid3_lib::LittleEndian2Int($raw_data{$offset++}); + + $getid3->info['la']['flags']['seekable'] = (bool)($getid3->info['la']['raw']['flags'] & 0x01); + if ($getid3->info['la']['version'] >= 0.4) { + $getid3->info['la']['flags']['high_compression'] = (bool)($getid3->info['la']['raw']['flags'] & 0x02); + } + + $getid3->info['la']['original_crc'] = getid3_lib::LittleEndian2Int(substr($raw_data, $offset, 4)); + $offset += 4; + + // mike�bevin*de + // Basically, the blocksize/seekevery are 61440/19 in La0.4 and 73728/16 + // in earlier versions. A seekpoint is added every blocksize * seekevery + // samples, so 4 * int(totalSamples / (blockSize * seekEvery)) should + // give the number of bytes used for the seekpoints. Of course, if seeking + // is disabled, there are no seekpoints stored. + + if ($getid3->info['la']['version'] >= 0.4) { + $getid3->info['la']['blocksize'] = 61440; + $getid3->info['la']['seekevery'] = 19; + } else { + $getid3->info['la']['blocksize'] = 73728; + $getid3->info['la']['seekevery'] = 16; + } + + $getid3->info['la']['seekpoint_count'] = 0; + if ($getid3->info['la']['flags']['seekable']) { + $getid3->info['la']['seekpoint_count'] = floor($getid3->info['la']['samples'] / ($getid3->info['la']['blocksize'] * $getid3->info['la']['seekevery'])); + + for ($i = 0; $i < $getid3->info['la']['seekpoint_count']; $i++) { + $getid3->info['la']['seekpoints'][] = getid3_lib::LittleEndian2Int(substr($raw_data, $offset, 4)); + $offset += 4; + } + } + + if ($getid3->info['la']['version'] >= 0.3) { + + // Following the main header information, the program outputs all of the + // seekpoints. Following these is what I called the 'footer start', + // i.e. the position immediately after the La audio data is finished. + + $getid3->info['la']['footerstart'] = getid3_lib::LittleEndian2Int(substr($raw_data, $offset, 4)); + $offset += 4; + + if ($getid3->info['la']['footerstart'] > $getid3->info['filesize']) { + $getid3->warning('FooterStart value points to offset '.$getid3->info['la']['footerstart'].' which is beyond end-of-file ('.$getid3->info['filesize'].')'); + $getid3->info['la']['footerstart'] = $getid3->info['filesize']; + } + + } else { + + // La v0.2 didn't have FooterStart value + $getid3->info['la']['footerstart'] = $getid3->info['avdataend']; + + } + + if ($getid3->info['la']['footerstart'] < $getid3->info['avdataend']) { + + // Create riff header + $riff_data = 'WAVE'; + if ($getid3->info['la']['version'] == 0.2) { + $riff_data .= substr($raw_data, 12, 24); + } else { + $riff_data .= substr($raw_data, 16, 24); + } + if ($getid3->info['la']['footerstart'] < $getid3->info['avdataend']) { + fseek($getid3->fp, $getid3->info['la']['footerstart'], SEEK_SET); + $riff_data .= fread($getid3->fp, $getid3->info['avdataend'] - $getid3->info['la']['footerstart']); + } + $riff_data = 'RIFF'.getid3_lib::LittleEndian2String(strlen($riff_data), 4, false).$riff_data; + + // Clone getid3 - messing with offsets - better safe than sorry + $clone = clone $getid3; + + // Analyze clone by string + $riff = new getid3_riff($clone); + $riff->AnalyzeString($riff_data); + + // Import from clone and destroy + $getid3->info['riff'] = $clone->info['riff']; + $getid3->warnings($clone->warnings()); + unset($clone); + } + + // $getid3->info['avdataoffset'] should be zero to begin with, but just in case it's not, include the addition anyway + $getid3->info['avdataend'] = $getid3->info['avdataoffset'] + $getid3->info['la']['footerstart']; + $getid3->info['avdataoffset'] = $getid3->info['avdataoffset'] + $offset; + + $getid3->info['la']['compression_ratio'] = (float)(($getid3->info['avdataend'] - $getid3->info['avdataoffset']) / $getid3->info['la']['uncompressed_size']); + $getid3->info['playtime_seconds'] = (float)($getid3->info['la']['samples'] / $getid3->info['la']['sample_rate']) / $getid3->info['la']['channels']; + + $getid3->info['audio']['bitrate'] = ($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8 / $getid3->info['playtime_seconds']; + $getid3->info['audio']['bits_per_sample'] = $getid3->info['la']['bits_per_sample']; + + $getid3->info['audio']['channels'] = $getid3->info['la']['channels']; + $getid3->info['audio']['sample_rate'] = (int)$getid3->info['la']['sample_rate']; + $getid3->info['audio']['encoder'] = 'LA v'.$getid3->info['la']['version']; + + return true; + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.lpac.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.lpac.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.lpac.php 3 Jan 2016 20:51:42 -0000 1.1.2.1 @@ -0,0 +1,148 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.lpac.php | +// | Module for analyzing LPAC Audio files | +// | dependencies: module.audio-video.riff.php | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.lpac.php,v 1.1.2.1 2016/01/03 20:51:42 gustafn Exp $ + + + +class getid3_lpac extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->include_module('audio-video.riff'); + + // Magic bytes - 'LPAC' + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $lpac_header = fread($getid3->fp, 14); + + $getid3->info['avdataoffset'] += 14; + + $getid3->info['lpac'] = array (); + $info_lpac = &$getid3->info['lpac']; + + $getid3->info['fileformat'] = 'lpac'; + $getid3->info['audio']['dataformat'] = 'lpac'; + $getid3->info['audio']['lossless'] = true; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + + $info_lpac['file_version'] = getid3_lib::BigEndian2Int($lpac_header{4}); + $flags['audio_type'] = getid3_lib::BigEndian2Int($lpac_header{5}); + $info_lpac['total_samples'] = getid3_lib::BigEndian2Int(substr($lpac_header, 6, 4)); + $flags['parameters'] = getid3_lib::BigEndian2Int(substr($lpac_header, 10, 4)); + + $info_lpac['flags']['is_wave'] = (bool)($flags['audio_type'] & 0x40); + $info_lpac['flags']['stereo'] = (bool)($flags['audio_type'] & 0x04); + $info_lpac['flags']['24_bit'] = (bool)($flags['audio_type'] & 0x02); + $info_lpac['flags']['16_bit'] = (bool)($flags['audio_type'] & 0x01); + + if ($info_lpac['flags']['24_bit'] && $info_lpac['flags']['16_bit']) { + $getid3->warning('24-bit and 16-bit flags cannot both be set'); + } + + $info_lpac['flags']['fast_compress'] = (bool)($flags['parameters'] & 0x40000000); + $info_lpac['flags']['random_access'] = (bool)($flags['parameters'] & 0x08000000); + $info_lpac['block_length'] = pow(2, (($flags['parameters'] & 0x07000000) >> 24)) * 256; + $info_lpac['flags']['adaptive_prediction_order'] = (bool)($flags['parameters'] & 0x00800000); + $info_lpac['flags']['adaptive_quantization'] = (bool)($flags['parameters'] & 0x00400000); + $info_lpac['flags']['joint_stereo'] = (bool)($flags['parameters'] & 0x00040000); + $info_lpac['quantization'] = ($flags['parameters'] & 0x00001F00) >> 8; + $info_lpac['max_prediction_order'] = ($flags['parameters'] & 0x0000003F); + + if ($info_lpac['flags']['fast_compress'] && ($info_lpac['max_prediction_order'] != 3)) { + $getid3->warning('max_prediction_order expected to be "3" if fast_compress is true, actual value is "'.$info_lpac['max_prediction_order'].'"'); + } + + switch ($info_lpac['file_version']) { + + case 6: + if ($info_lpac['flags']['adaptive_quantization']) { + $getid3->warning('adaptive_quantization expected to be false in LPAC file stucture v6, actually true'); + } + if ($info_lpac['quantization'] != 20) { + $getid3->warning('Quantization expected to be 20 in LPAC file stucture v6, actually '.$info_lpac['flags']['Q']); + } + break; + + + default: + //$getid3->warning('This version of getID3() only supports LPAC file format version 6, this file is version '.$info_lpac['file_version'].' - please report to info@getid3.org'); + break; + } + + // Clone getid3 - messing with something - better safe than sorry + $clone = clone $getid3; + + // Analyze clone by fp + $riff = new getid3_riff($clone); + $riff->Analyze(); + + // Import from clone and destroy + $getid3->info['avdataoffset'] = $clone->info['avdataoffset']; + $getid3->info['riff'] = $clone->info['riff']; + //$info_lpac['comments']['comment'] = $clone->info['comments']; + $getid3->info['audio']['sample_rate'] = $clone->info['audio']['sample_rate']; + $getid3->warnings($clone->warnings()); + unset($clone); + + $getid3->info['audio']['channels'] = ($info_lpac['flags']['stereo'] ? 2 : 1); + + if ($info_lpac['flags']['24_bit']) { + $getid3->info['audio']['bits_per_sample'] = $getid3->info['riff']['audio'][0]['bits_per_sample']; + } elseif ($info_lpac['flags']['16_bit']) { + $getid3->info['audio']['bits_per_sample'] = 16; + } else { + $getid3->info['audio']['bits_per_sample'] = 8; + } + + if ($info_lpac['flags']['fast_compress']) { + // fast + $getid3->info['audio']['encoder_options'] = '-1'; + } else { + switch ($info_lpac['max_prediction_order']) { + case 20: // simple + $getid3->info['audio']['encoder_options'] = '-2'; + break; + case 30: // medium + $getid3->info['audio']['encoder_options'] = '-3'; + break; + case 40: // high + $getid3->info['audio']['encoder_options'] = '-4'; + break; + case 60: // extrahigh + $getid3->info['audio']['encoder_options'] = '-5'; + break; + } + } + + $getid3->info['playtime_seconds'] = $info_lpac['total_samples'] / $getid3->info['audio']['sample_rate']; + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + + return true; + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.midi.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.midi.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.midi.php 3 Jan 2016 20:51:42 -0000 1.1.2.1 @@ -0,0 +1,552 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.midi.php | +// | Module for analyzing midi audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.midi.php,v 1.1.2.1 2016/01/03 20:51:42 gustafn Exp $ + + + +class getid3_midi extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['midi']['raw'] = array (); + $info_midi = &$getid3->info['midi']; + $info_midi_raw = &$info_midi['raw']; + + $getid3->info['fileformat'] = 'midi'; + $getid3->info['audio']['dataformat'] = 'midi'; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $midi_data = fread($getid3->fp, getid3::FREAD_BUFFER_SIZE); + + // Magic bytes: 'MThd' + + getid3_lib::ReadSequence('BigEndian2Int', $info_midi_raw, $midi_data, 4, + array ( + 'headersize' => 4, + 'fileformat' => 2, + 'tracks' => 2, + 'ticksperqnote' => 2 + ) + ); + + $offset = 14; + + for ($i = 0; $i < $info_midi_raw['tracks']; $i++) { + + if ((strlen($midi_data) - $offset) < 8) { + $midi_data .= fread($getid3->fp, getid3::FREAD_BUFFER_SIZE); + } + + $track_id = substr($midi_data, $offset, 4); + $offset += 4; + + if ($track_id != 'MTrk') { + throw new getid3_exception('Expecting "MTrk" at '.$offset.', found '.$track_id.' instead'); + } + + $track_size = getid3_lib::BigEndian2Int(substr($midi_data, $offset, 4)); + $offset += 4; + + $track_data_array[$i] = substr($midi_data, $offset, $track_size); + $offset += $track_size; + } + + if (!isset($track_data_array) || !is_array($track_data_array)) { + throw new getid3_exception('Cannot find MIDI track information'); + } + + + $info_midi['totalticks'] = 0; + $getid3->info['playtime_seconds'] = 0; + $current_ms_per_beat = 500000; // 120 beats per minute; 60,000,000 microseconds per minute -> 500,000 microseconds per beat + $current_beats_per_min = 120; // 120 beats per minute; 60,000,000 microseconds per minute -> 500,000 microseconds per beat + $ms_per_quarter_note_after = array (); + + foreach ($track_data_array as $track_number => $track_data) { + + $events_offset = $last_issued_midi_command = $last_issued_midi_channel = $cumulative_delta_time = $ticks_at_current_bpm = 0; + + while ($events_offset < strlen($track_data)) { + + $event_id = 0; + if (isset($midi_events[$track_number]) && is_array($midi_events[$track_number])) { + $event_id = count($midi_events[$track_number]); + } + $delta_time = 0; + for ($i = 0; $i < 4; $i++) { + $delta_time_byte = ord($track_data{$events_offset++}); + $delta_time = ($delta_time << 7) + ($delta_time_byte & 0x7F); + if ($delta_time_byte & 0x80) { + // another byte follows + } else { + break; + } + } + + $cumulative_delta_time += $delta_time; + $ticks_at_current_bpm += $delta_time; + + $midi_events[$track_number][$event_id]['deltatime'] = $delta_time; + + $midi_event_channel = ord($track_data{$events_offset++}); + + // OK, normal event - MIDI command has MSB set + if ($midi_event_channel & 0x80) { + $last_issued_midi_command = $midi_event_channel >> 4; + $last_issued_midi_channel = $midi_event_channel & 0x0F; + } + + // Running event - assume last command + else { + $events_offset--; + } + + $midi_events[$track_number][$event_id]['eventid'] = $last_issued_midi_command; + $midi_events[$track_number][$event_id]['channel'] = $last_issued_midi_channel; + + switch ($midi_events[$track_number][$event_id]['eventid']) { + + case 0x8: // Note off (key is released) + case 0x9: // Note on (key is pressed) + case 0xA: // Key after-touch + + //$notenumber = ord($track_data{$events_offset++}); + //$velocity = ord($track_data{$events_offset++}); + $events_offset += 2; + break; + + + case 0xB: // Control Change + + //$controllernum = ord($track_data{$events_offset++}); + //$newvalue = ord($track_data{$events_offset++}); + $events_offset += 2; + break; + + + case 0xC: // Program (patch) change + + $new_program_num = ord($track_data{$events_offset++}); + + $info_midi_raw['track'][$track_number]['instrumentid'] = $new_program_num; + $info_midi_raw['track'][$track_number]['instrument'] = $track_number == 10 ? getid3_midi::GeneralMIDIpercussionLookup($new_program_num) : getid3_midi::GeneralMIDIinstrumentLookup($new_program_num); + break; + + + case 0xD: // Channel after-touch + + //$channelnumber = ord($track_data{$events_offset++}); + break; + + + case 0xE: // Pitch wheel change (2000H is normal or no change) + + //$changeLSB = ord($track_data{$events_offset++}); + //$changeMSB = ord($track_data{$events_offset++}); + //$pitchwheelchange = (($changeMSB & 0x7F) << 7) & ($changeLSB & 0x7F); + $events_offset += 2; + break; + + + case 0xF: + + if ($midi_events[$track_number][$event_id]['channel'] == 0xF) { + + $meta_event_command = ord($track_data{$events_offset++}); + $meta_event_length = ord($track_data{$events_offset++}); + $meta_event_data = substr($track_data, $events_offset, $meta_event_length); + $events_offset += $meta_event_length; + + switch ($meta_event_command) { + + case 0x00: // Set track sequence number + + //$track_sequence_number = getid3_lib::BigEndian2Int(substr($meta_event_data, 0, $meta_event_length)); + //$info_midi_raw['events'][$track_number][$event_id]['seqno'] = $track_sequence_number; + break; + + + case 0x01: // Text: generic + + $text_generic = substr($meta_event_data, 0, $meta_event_length); + //$info_midi_raw['events'][$track_number][$event_id]['text'] = $text_generic; + $info_midi['comments']['comment'][] = $text_generic; + break; + + + case 0x02: // Text: copyright + + $text_copyright = substr($meta_event_data, 0, $meta_event_length); + //$info_midi_raw['events'][$track_number][$event_id]['copyright'] = $text_copyright; + $info_midi['comments']['copyright'][] = $text_copyright; + break; + + + case 0x03: // Text: track name + + $text_trackname = substr($meta_event_data, 0, $meta_event_length); + $info_midi_raw['track'][$track_number]['name'] = $text_trackname; + break; + + + case 0x04: // Text: track instrument name + + //$text_instrument = substr($meta_event_data, 0, $meta_event_length); + //$info_midi_raw['events'][$track_number][$event_id]['instrument'] = $text_instrument; + break; + + + case 0x05: // Text: lyrics + + $text_lyrics = substr($meta_event_data, 0, $meta_event_length); + //$info_midi_raw['events'][$track_number][$event_id]['lyrics'] = $text_lyrics; + if (!isset($info_midi['lyrics'])) { + $info_midi['lyrics'] = ''; + } + $info_midi['lyrics'] .= $text_lyrics . "\n"; + break; + + + case 0x06: // Text: marker + + //$text_marker = substr($meta_event_data, 0, $meta_event_length); + //$info_midi_raw['events'][$track_number][$event_id]['marker'] = $text_marker; + break; + + + case 0x07: // Text: cue point + + //$text_cuepoint = substr($meta_event_data, 0, $meta_event_length); + //$info_midi_raw['events'][$track_number][$event_id]['cuepoint'] = $text_cuepoint; + break; + + + case 0x2F: // End Of Track + + //$info_midi_raw['events'][$track_number][$event_id]['EOT'] = $cumulative_delta_time; + break; + + + case 0x51: // Tempo: microseconds / quarter note + + $current_ms_per_beat = getid3_lib::BigEndian2Int(substr($meta_event_data, 0, $meta_event_length)); + $info_midi_raw['events'][$track_number][$cumulative_delta_time]['us_qnote'] = $current_ms_per_beat; + $current_beats_per_min = (1000000 / $current_ms_per_beat) * 60; + $ms_per_quarter_note_after[$cumulative_delta_time] = $current_ms_per_beat; + $ticks_at_current_bpm = 0; + break; + + + case 0x58: // Time signature + $timesig_numerator = getid3_lib::BigEndian2Int($meta_event_data[0]); + $timesig_denominator = pow(2, getid3_lib::BigEndian2Int($meta_event_data[1])); // $02 -> x/4, $03 -> x/8, etc + //$timesig_32inqnote = getid3_lib::BigEndian2Int($meta_event_data[2]); // number of 32nd notes to the quarter note + //$info_midi_raw['events'][$track_number][$event_id]['timesig_32inqnote'] = $timesig_32inqnote; + //$info_midi_raw['events'][$track_number][$event_id]['timesig_numerator'] = $timesig_numerator; + //$info_midi_raw['events'][$track_number][$event_id]['timesig_denominator'] = $timesig_denominator; + //$info_midi_raw['events'][$track_number][$event_id]['timesig_text'] = $timesig_numerator.'/'.$timesig_denominator; + $info_midi['timesignature'][] = $timesig_numerator.'/'.$timesig_denominator; + break; + + + case 0x59: // Keysignature + + $keysig_sharpsflats = getid3_lib::BigEndian2Int($meta_event_data{0}); + if ($keysig_sharpsflats & 0x80) { + // (-7 -> 7 flats, 0 ->key of C, 7 -> 7 sharps) + $keysig_sharpsflats -= 256; + } + + $keysig_majorminor = getid3_lib::BigEndian2Int($meta_event_data{1}); // 0 -> major, 1 -> minor + $keysigs = array (-7=>'Cb', -6=>'Gb', -5=>'Db', -4=>'Ab', -3=>'Eb', -2=>'Bb', -1=>'F', 0=>'C', 1=>'G', 2=>'D', 3=>'A', 4=>'E', 5=>'B', 6=>'F#', 7=>'C#'); + //$info_midi_raw['events'][$track_number][$event_id]['keysig_sharps'] = (($keysig_sharpsflats > 0) ? abs($keysig_sharpsflats) : 0); + //$info_midi_raw['events'][$track_number][$event_id]['keysig_flats'] = (($keysig_sharpsflats < 0) ? abs($keysig_sharpsflats) : 0); + //$info_midi_raw['events'][$track_number][$event_id]['keysig_minor'] = (bool)$keysig_majorminor; + //$info_midi_raw['events'][$track_number][$event_id]['keysig_text'] = $keysigs[$keysig_sharpsflats].' '.($info_midi_raw['events'][$track_number][$event_id]['keysig_minor'] ? 'minor' : 'major'); + + // $keysigs[$keysig_sharpsflats] gets an int key (correct) - $keysigs["$keysig_sharpsflats"] gets a string key (incorrect) + $info_midi['keysignature'][] = $keysigs[$keysig_sharpsflats].' '.((bool)$keysig_majorminor ? 'minor' : 'major'); + break; + + + case 0x7F: // Sequencer specific information + + $custom_data = substr($meta_event_data, 0, $meta_event_length); + break; + + + default: + + $getid3->warning('Unhandled META Event Command: '.$meta_event_command); + } + } + break; + + + default: + $getid3->warning('Unhandled MIDI Event ID: '.$midi_events[$track_number][$event_id]['eventid']); + } + } + + if (($track_number > 0) || (count($track_data_array) == 1)) { + $info_midi['totalticks'] = max($info_midi['totalticks'], $cumulative_delta_time); + } + } + + $previous_tick_offset = null; + + ksort($ms_per_quarter_note_after); + foreach ($ms_per_quarter_note_after as $tick_offset => $ms_per_beat) { + + if (is_null($previous_tick_offset)) { + $prev_ms_per_beat = $ms_per_beat; + $previous_tick_offset = $tick_offset; + continue; + } + + if ($info_midi['totalticks'] > $tick_offset) { + $getid3->info['playtime_seconds'] += (($tick_offset - $previous_tick_offset) / $info_midi_raw['ticksperqnote']) * ($prev_ms_per_beat / 1000000); + + $prev_ms_per_beat = $ms_per_beat; + $previous_tick_offset = $tick_offset; + } + } + + if ($info_midi['totalticks'] > $previous_tick_offset) { + $getid3->info['playtime_seconds'] += (($info_midi['totalticks'] - $previous_tick_offset) / $info_midi_raw['ticksperqnote']) * ($ms_per_beat / 1000000); + } + + if (@$getid3->info['playtime_seconds'] > 0) { + $getid3->info['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + } + + if (!empty($info_midi['lyrics'])) { + $info_midi['comments']['lyrics'][] = $info_midi['lyrics']; + } + + return true; + } + + + + public static function GeneralMIDIinstrumentLookup($instrument_id) { + + static $lookup = array ( + + 0 => 'Acoustic Grand', + 1 => 'Bright Acoustic', + 2 => 'Electric Grand', + 3 => 'Honky-Tonk', + 4 => 'Electric Piano 1', + 5 => 'Electric Piano 2', + 6 => 'Harpsichord', + 7 => 'Clavier', + 8 => 'Celesta', + 9 => 'Glockenspiel', + 10 => 'Music Box', + 11 => 'Vibraphone', + 12 => 'Marimba', + 13 => 'Xylophone', + 14 => 'Tubular Bells', + 15 => 'Dulcimer', + 16 => 'Drawbar Organ', + 17 => 'Percussive Organ', + 18 => 'Rock Organ', + 19 => 'Church Organ', + 20 => 'Reed Organ', + 21 => 'Accordian', + 22 => 'Harmonica', + 23 => 'Tango Accordian', + 24 => 'Acoustic Guitar (nylon)', + 25 => 'Acoustic Guitar (steel)', + 26 => 'Electric Guitar (jazz)', + 27 => 'Electric Guitar (clean)', + 28 => 'Electric Guitar (muted)', + 29 => 'Overdriven Guitar', + 30 => 'Distortion Guitar', + 31 => 'Guitar Harmonics', + 32 => 'Acoustic Bass', + 33 => 'Electric Bass (finger)', + 34 => 'Electric Bass (pick)', + 35 => 'Fretless Bass', + 36 => 'Slap Bass 1', + 37 => 'Slap Bass 2', + 38 => 'Synth Bass 1', + 39 => 'Synth Bass 2', + 40 => 'Violin', + 41 => 'Viola', + 42 => 'Cello', + 43 => 'Contrabass', + 44 => 'Tremolo Strings', + 45 => 'Pizzicato Strings', + 46 => 'Orchestral Strings', + 47 => 'Timpani', + 48 => 'String Ensemble 1', + 49 => 'String Ensemble 2', + 50 => 'SynthStrings 1', + 51 => 'SynthStrings 2', + 52 => 'Choir Aahs', + 53 => 'Voice Oohs', + 54 => 'Synth Voice', + 55 => 'Orchestra Hit', + 56 => 'Trumpet', + 57 => 'Trombone', + 58 => 'Tuba', + 59 => 'Muted Trumpet', + 60 => 'French Horn', + 61 => 'Brass Section', + 62 => 'SynthBrass 1', + 63 => 'SynthBrass 2', + 64 => 'Soprano Sax', + 65 => 'Alto Sax', + 66 => 'Tenor Sax', + 67 => 'Baritone Sax', + 68 => 'Oboe', + 69 => 'English Horn', + 70 => 'Bassoon', + 71 => 'Clarinet', + 72 => 'Piccolo', + 73 => 'Flute', + 74 => 'Recorder', + 75 => 'Pan Flute', + 76 => 'Blown Bottle', + 77 => 'Shakuhachi', + 78 => 'Whistle', + 79 => 'Ocarina', + 80 => 'Lead 1 (square)', + 81 => 'Lead 2 (sawtooth)', + 82 => 'Lead 3 (calliope)', + 83 => 'Lead 4 (chiff)', + 84 => 'Lead 5 (charang)', + 85 => 'Lead 6 (voice)', + 86 => 'Lead 7 (fifths)', + 87 => 'Lead 8 (bass + lead)', + 88 => 'Pad 1 (new age)', + 89 => 'Pad 2 (warm)', + 90 => 'Pad 3 (polysynth)', + 91 => 'Pad 4 (choir)', + 92 => 'Pad 5 (bowed)', + 93 => 'Pad 6 (metallic)', + 94 => 'Pad 7 (halo)', + 95 => 'Pad 8 (sweep)', + 96 => 'FX 1 (rain)', + 97 => 'FX 2 (soundtrack)', + 98 => 'FX 3 (crystal)', + 99 => 'FX 4 (atmosphere)', + 100 => 'FX 5 (brightness)', + 101 => 'FX 6 (goblins)', + 102 => 'FX 7 (echoes)', + 103 => 'FX 8 (sci-fi)', + 104 => 'Sitar', + 105 => 'Banjo', + 106 => 'Shamisen', + 107 => 'Koto', + 108 => 'Kalimba', + 109 => 'Bagpipe', + 110 => 'Fiddle', + 111 => 'Shanai', + 112 => 'Tinkle Bell', + 113 => 'Agogo', + 114 => 'Steel Drums', + 115 => 'Woodblock', + 116 => 'Taiko Drum', + 117 => 'Melodic Tom', + 118 => 'Synth Drum', + 119 => 'Reverse Cymbal', + 120 => 'Guitar Fret Noise', + 121 => 'Breath Noise', + 122 => 'Seashore', + 123 => 'Bird Tweet', + 124 => 'Telephone Ring', + 125 => 'Helicopter', + 126 => 'Applause', + 127 => 'Gunshot' + ); + + return @$lookup[$instrument_id]; + } + + + + public static function GeneralMIDIpercussionLookup($instrument_id) { + + static $lookup = array ( + + 35 => 'Acoustic Bass Drum', + 36 => 'Bass Drum 1', + 37 => 'Side Stick', + 38 => 'Acoustic Snare', + 39 => 'Hand Clap', + 40 => 'Electric Snare', + 41 => 'Low Floor Tom', + 42 => 'Closed Hi-Hat', + 43 => 'High Floor Tom', + 44 => 'Pedal Hi-Hat', + 45 => 'Low Tom', + 46 => 'Open Hi-Hat', + 47 => 'Low-Mid Tom', + 48 => 'Hi-Mid Tom', + 49 => 'Crash Cymbal 1', + 50 => 'High Tom', + 51 => 'Ride Cymbal 1', + 52 => 'Chinese Cymbal', + 53 => 'Ride Bell', + 54 => 'Tambourine', + 55 => 'Splash Cymbal', + 56 => 'Cowbell', + 57 => 'Crash Cymbal 2', + 59 => 'Ride Cymbal 2', + 60 => 'Hi Bongo', + 61 => 'Low Bongo', + 62 => 'Mute Hi Conga', + 63 => 'Open Hi Conga', + 64 => 'Low Conga', + 65 => 'High Timbale', + 66 => 'Low Timbale', + 67 => 'High Agogo', + 68 => 'Low Agogo', + 69 => 'Cabasa', + 70 => 'Maracas', + 71 => 'Short Whistle', + 72 => 'Long Whistle', + 73 => 'Short Guiro', + 74 => 'Long Guiro', + 75 => 'Claves', + 76 => 'Hi Wood Block', + 77 => 'Low Wood Block', + 78 => 'Mute Cuica', + 79 => 'Open Cuica', + 80 => 'Mute Triangle', + 81 => 'Open Triangle' + ); + + return @$lookup[$instrument_id]; + } + + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.monkey.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.monkey.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.monkey.php 3 Jan 2016 20:51:43 -0000 1.1.2.1 @@ -0,0 +1,216 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.monkey.php | +// | Module for analyzing Monkey's Audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.monkey.php,v 1.1.2.1 2016/01/03 20:51:43 gustafn Exp $ + + + +class getid3_monkey extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + // based loosely on code from TMonkey by Jurgen Faul + // http://jfaul.de/atl or http://j-faul.virtualave.net/atl/atl.html + + $getid3->info['fileformat'] = 'mac'; + $getid3->info['audio']['dataformat'] = 'mac'; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + $getid3->info['audio']['lossless'] = true; + + $getid3->info['monkeys_audio']['raw'] = array (); + $info_monkeys_audio = &$getid3->info['monkeys_audio']; + $info_monkeys_audio_raw = &$info_monkeys_audio['raw']; + + // Read file header + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $mac_header_data = fread($getid3->fp, 74); + + $info_monkeys_audio_raw['magic'] = 'MAC '; // Magic bytes + + // Read MAC version + $info_monkeys_audio_raw['nVersion'] = getid3_lib::LittleEndian2Int(substr($mac_header_data, 4, 2)); // appears to be uint32 in 3.98+ + + // Parse MAC Header < v3980 + if ($info_monkeys_audio_raw['nVersion'] < 3980) { + + getid3_lib::ReadSequence("LittleEndian2Int", $info_monkeys_audio_raw, $mac_header_data, 6, + array ( + 'nCompressionLevel' => 2, + 'nFormatFlags' => 2, + 'nChannels' => 2, + 'nSampleRate' => 4, + 'nHeaderDataBytes' => 4, + 'nWAVTerminatingBytes' => 4, + 'nTotalFrames' => 4, + 'nFinalFrameSamples' => 4, + 'nPeakLevel' => 4, + 'IGNORE-1' => 2, + 'nSeekElements' => 2 + ) + ); + } + + // Parse MAC Header >= v3980 + else { + + getid3_lib::ReadSequence("LittleEndian2Int", $info_monkeys_audio_raw, $mac_header_data, 8, + array ( + // APE_DESCRIPTOR + 'nDescriptorBytes' => 4, + 'nHeaderBytes' => 4, + 'nSeekTableBytes' => 4, + 'nHeaderDataBytes' => 4, + 'nAPEFrameDataBytes' => 4, + 'nAPEFrameDataBytesHigh'=> 4, + 'nTerminatingDataBytes' => 4, + + // MD5 - string + 'cFileMD5' => -16, + + // APE_HEADER + 'nCompressionLevel' => 2, + 'nFormatFlags' => 2, + 'nBlocksPerFrame' => 4, + 'nFinalFrameBlocks' => 4, + 'nTotalFrames' => 4, + 'nBitsPerSample' => 2, + 'nChannels' => 2, + 'nSampleRate' => 4 + ) + ); + } + + // Process data + $info_monkeys_audio['flags']['8-bit'] = (bool)($info_monkeys_audio_raw['nFormatFlags'] & 0x0001); + $info_monkeys_audio['flags']['crc-32'] = (bool)($info_monkeys_audio_raw['nFormatFlags'] & 0x0002); + $info_monkeys_audio['flags']['peak_level'] = (bool)($info_monkeys_audio_raw['nFormatFlags'] & 0x0004); + $info_monkeys_audio['flags']['24-bit'] = (bool)($info_monkeys_audio_raw['nFormatFlags'] & 0x0008); + $info_monkeys_audio['flags']['seek_elements'] = (bool)($info_monkeys_audio_raw['nFormatFlags'] & 0x0010); + $info_monkeys_audio['flags']['no_wav_header'] = (bool)($info_monkeys_audio_raw['nFormatFlags'] & 0x0020); + + $info_monkeys_audio['version'] = $info_monkeys_audio_raw['nVersion'] / 1000; + + $info_monkeys_audio['compression'] = getid3_monkey::MonkeyCompressionLevelNameLookup($info_monkeys_audio_raw['nCompressionLevel']); + + $info_monkeys_audio['bits_per_sample'] = ($info_monkeys_audio['flags']['24-bit'] ? 24 : ($info_monkeys_audio['flags']['8-bit'] ? 8 : 16)); + + $info_monkeys_audio['channels'] = $info_monkeys_audio_raw['nChannels']; + + $getid3->info['audio']['channels'] = $info_monkeys_audio['channels']; + + $info_monkeys_audio['sample_rate'] = $info_monkeys_audio_raw['nSampleRate']; + + $getid3->info['audio']['sample_rate'] = $info_monkeys_audio['sample_rate']; + + if ($info_monkeys_audio['flags']['peak_level']) { + $info_monkeys_audio['peak_level'] = $info_monkeys_audio_raw['nPeakLevel']; + $info_monkeys_audio['peak_ratio'] = $info_monkeys_audio['peak_level'] / pow(2, $info_monkeys_audio['bits_per_sample'] - 1); + } + + // MAC >= v3980 + if ($info_monkeys_audio_raw['nVersion'] >= 3980) { + $info_monkeys_audio['samples'] = (($info_monkeys_audio_raw['nTotalFrames'] - 1) * $info_monkeys_audio_raw['nBlocksPerFrame']) + $info_monkeys_audio_raw['nFinalFrameBlocks']; + } + + // MAC < v3980 + else { + $info_monkeys_audio['samples_per_frame'] = getid3_monkey::MonkeySamplesPerFrame($info_monkeys_audio_raw['nVersion'], $info_monkeys_audio_raw['nCompressionLevel']); + $info_monkeys_audio['samples'] = (($info_monkeys_audio_raw['nTotalFrames'] - 1) * $info_monkeys_audio['samples_per_frame']) + $info_monkeys_audio_raw['nFinalFrameSamples']; + } + + $info_monkeys_audio['playtime'] = $info_monkeys_audio['samples'] / $info_monkeys_audio['sample_rate']; + + $getid3->info['playtime_seconds'] = $info_monkeys_audio['playtime']; + + $info_monkeys_audio['compressed_size'] = $getid3->info['avdataend'] - $getid3->info['avdataoffset']; + $info_monkeys_audio['uncompressed_size'] = $info_monkeys_audio['samples'] * $info_monkeys_audio['channels'] * ($info_monkeys_audio['bits_per_sample'] / 8); + $info_monkeys_audio['compression_ratio'] = $info_monkeys_audio['compressed_size'] / ($info_monkeys_audio['uncompressed_size'] + $info_monkeys_audio_raw['nHeaderDataBytes']); + $info_monkeys_audio['bitrate'] = (($info_monkeys_audio['samples'] * $info_monkeys_audio['channels'] * $info_monkeys_audio['bits_per_sample']) / $info_monkeys_audio['playtime']) * $info_monkeys_audio['compression_ratio']; + + $getid3->info['audio']['bitrate'] = $info_monkeys_audio['bitrate']; + + $getid3->info['audio']['bits_per_sample'] = $info_monkeys_audio['bits_per_sample']; + $getid3->info['audio']['encoder'] = 'MAC v'.number_format($info_monkeys_audio['version'], 2); + $getid3->info['audio']['encoder_options'] = ucfirst($info_monkeys_audio['compression']).' compression'; + + // MAC >= v3980 - get avdataoffsets from MAC header + if ($info_monkeys_audio_raw['nVersion'] >= 3980) { + $getid3->info['avdataoffset'] += $info_monkeys_audio_raw['nDescriptorBytes'] + $info_monkeys_audio_raw['nHeaderBytes'] + $info_monkeys_audio_raw['nSeekTableBytes'] + $info_monkeys_audio_raw['nHeaderDataBytes']; + $getid3->info['avdataend'] -= $info_monkeys_audio_raw['nTerminatingDataBytes']; + } + + // MAC < v3980 Add size of MAC header to avdataoffset + else { + $getid3->info['avdataoffset'] += 8; + } + + // Convert md5sum to 32 byte string + if (@$info_monkeys_audio_raw['cFileMD5']) { + if ($info_monkeys_audio_raw['cFileMD5'] !== str_repeat("\x00", 16)) { + $getid3->info['md5_data_source'] = ''; + $md5 = $info_monkeys_audio_raw['cFileMD5']; + for ($i = 0; $i < strlen($md5); $i++) { + $getid3->info['md5_data_source'] .= str_pad(dechex(ord($md5{$i})), 2, '00', STR_PAD_LEFT); + } + if (!preg_match('/^[0-9a-f]{32}$/', $getid3->info['md5_data_source'])) { + unset($getid3->info['md5_data_source']); + } + } + } + + + return true; + } + + + + public static function MonkeyCompressionLevelNameLookup($compression_level) { + + static $lookup = array ( + 0 => 'unknown', + 1000 => 'fast', + 2000 => 'normal', + 3000 => 'high', + 4000 => 'extra-high', + 5000 => 'insane' + ); + return (isset($lookup[$compression_level]) ? $lookup[$compression_level] : 'invalid'); + } + + + + public static function MonkeySamplesPerFrame($version_id, $compression_level) { + + if ($version_id >= 3950) { + return 73728 * 4; + } + if (($version_id >= 3900) || (($version_id >= 3800) && ($compression_level == 4000))) { + return 73728; + } + return 9216; + } + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.mp3.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.mp3.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.mp3.php 3 Jan 2016 20:51:43 -0000 1.1.2.1 @@ -0,0 +1,1696 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.mp3.php | +// | Module for analyzing MPEG Audio Layer 1,2,3 files. | +// | dependencies: none | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.mp3.php,v 1.1.2.1 2016/01/03 20:51:43 gustafn Exp $ + + + +class getid3_mp3 extends getid3_handler +{ + // Number of frames to scan to determine if MPEG-audio sequence is valid. + // Lower this number to 5-20 for faster scanning + // Increase this number to 50+ for most accurate detection of valid VBR/CBR mpeg-audio streams + const VALID_CHECK_FRAMES = 35; + + + public function Analyze() { + + $this->getAllMPEGInfo($this->getid3->fp, $this->getid3->info); + + return true; + } + + + public function AnalyzeMPEGaudioInfo() { + + $this->getOnlyMPEGaudioInfo($this->getid3->fp, $this->getid3->info, $this->getid3->info['avdataoffset'], false); + } + + + public function getAllMPEGInfo(&$fd, &$info) { + + $this->getOnlyMPEGaudioInfo($fd, $info, 0 + $info['avdataoffset']); + + if (isset($info['mpeg']['audio']['bitrate_mode'])) { + $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); + } + + if (((isset($info['id3v2']['headerlength']) && ($info['avdataoffset'] > $info['id3v2']['headerlength'])) || (!isset($info['id3v2']) && ($info['avdataoffset'] > 0)))) { + + $synch_offset_warning = 'Unknown data before synch '; + if (isset($info['id3v2']['headerlength'])) { + $synch_offset_warning .= '(ID3v2 header ends at '.$info['id3v2']['headerlength'].', then '.($info['avdataoffset'] - $info['id3v2']['headerlength']).' bytes garbage, '; + } else { + $synch_offset_warning .= '(should be at beginning of file, '; + } + $synch_offset_warning .= 'synch detected at '.$info['avdataoffset'].')'; + if ($info['audio']['bitrate_mode'] == 'cbr') { + + if (!empty($info['id3v2']['headerlength']) && (($info['avdataoffset'] - $info['id3v2']['headerlength']) == $info['mpeg']['audio']['framelength'])) { + + $synch_offset_warning .= '. This is a known problem with some versions of LAME (3.90-3.92) DLL in CBR mode.'; + $info['audio']['codec'] = 'LAME'; + $current_data_lame_version_string = 'LAME3.'; + + } elseif (empty($info['id3v2']['headerlength']) && ($info['avdataoffset'] == $info['mpeg']['audio']['framelength'])) { + + $synch_offset_warning .= '. This is a known problem with some versions of LAME (3.90 - 3.92) DLL in CBR mode.'; + $info['audio']['codec'] = 'LAME'; + $current_data_lame_version_string = 'LAME3.'; + + } + + } + $this->getid3->warning($synch_offset_warning); + + } + + if (isset($info['mpeg']['audio']['LAME'])) { + $info['audio']['codec'] = 'LAME'; + if (!empty($info['mpeg']['audio']['LAME']['long_version'])) { + $info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['long_version'], "\x00"); + } elseif (!empty($info['mpeg']['audio']['LAME']['short_version'])) { + $info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['short_version'], "\x00"); + } + } + + $current_data_lame_version_string = (!empty($current_data_lame_version_string) ? $current_data_lame_version_string : @$info['audio']['encoder']); + if (!empty($current_data_lame_version_string) && (substr($current_data_lame_version_string, 0, 6) == 'LAME3.') && !preg_match('[0-9\)]', substr($current_data_lame_version_string, -1))) { + // a version number of LAME that does not end with a number like "LAME3.92" + // or with a closing parenthesis like "LAME3.88 (alpha)" + // or a version of LAME with the LAMEtag-not-filled-in-DLL-mode bug (3.90-3.92) + + // not sure what the actual last frame length will be, but will be less than or equal to 1441 + $possibly_longer_lame_version_frame_length = 1441; + + // Not sure what version of LAME this is - look in padding of last frame for longer version string + $possible_lame_version_string_offset = $info['avdataend'] - $possibly_longer_lame_version_frame_length; + fseek($fd, $possible_lame_version_string_offset); + $possibly_longer_lame_version_data = fread($fd, $possibly_longer_lame_version_frame_length); + switch (substr($current_data_lame_version_string, -1)) { + case 'a': + case 'b': + // "LAME3.94a" will have a longer version string of "LAME3.94 (alpha)" for example + // need to trim off "a" to match longer string + $current_data_lame_version_string = substr($current_data_lame_version_string, 0, -1); + break; + } + if (($possibly_longer_lame_version_string = strstr($possibly_longer_lame_version_data, $current_data_lame_version_string)) !== false) { + if (substr($possibly_longer_lame_version_string, 0, strlen($current_data_lame_version_string)) == $current_data_lame_version_string) { + $possibly_longer_lame_version_new_string = substr($possibly_longer_lame_version_string, 0, strspn($possibly_longer_lame_version_string, 'LAME0123456789., (abcdefghijklmnopqrstuvwxyzJFSOND)')); //"LAME3.90.3" "LAME3.87 (beta 1, Sep 27 2000)" "LAME3.88 (beta)" + if (strlen($possibly_longer_lame_version_new_string) > strlen(@$info['audio']['encoder'])) { + $info['audio']['encoder'] = $possibly_longer_lame_version_new_string; + } + } + } + } + if (!empty($info['audio']['encoder'])) { + $info['audio']['encoder'] = rtrim($info['audio']['encoder'], "\x00 "); + } + + switch (@$info['mpeg']['audio']['layer']) { + case 1: + case 2: + $info['audio']['dataformat'] = 'mp'.$info['mpeg']['audio']['layer']; + break; + } + if (@$info['fileformat'] == 'mp3') { + switch ($info['audio']['dataformat']) { + case 'mp1': + case 'mp2': + case 'mp3': + $info['fileformat'] = $info['audio']['dataformat']; + break; + + default: + $this->getid3->warning('Expecting [audio][dataformat] to be mp1/mp2/mp3 when fileformat == mp3, [audio][dataformat] actually "'.$info['audio']['dataformat'].'"'); + break; + } + } + + $info['mime_type'] = 'audio/mpeg'; + $info['audio']['lossless'] = false; + + // Calculate playtime + if (!isset($info['playtime_seconds']) && isset($info['audio']['bitrate']) && ($info['audio']['bitrate'] > 0)) { + $info['playtime_seconds'] = ($info['avdataend'] - $info['avdataoffset']) * 8 / $info['audio']['bitrate']; + } + + $info['audio']['encoder_options'] = getid3_mp3::GuessEncoderOptions($info); + + return true; + } + + + + public static function GuessEncoderOptions(&$info) { + // shortcuts + if (!empty($info['mpeg']['audio'])) { + $thisfile_mpeg_audio = &$info['mpeg']['audio']; + if (!empty($thisfile_mpeg_audio['LAME'])) { + $thisfile_mpeg_audio_lame = &$thisfile_mpeg_audio['LAME']; + } + } + + $encoder_options = ''; + static $named_preset_bitrates = array (16, 24, 40, 56, 112, 128, 160, 192, 256); + + if ((@$thisfile_mpeg_audio['VBR_method'] == 'Fraunhofer') && !empty($thisfile_mpeg_audio['VBR_quality'])) { + + $encoder_options = 'VBR q'.$thisfile_mpeg_audio['VBR_quality']; + + } elseif (!empty($thisfile_mpeg_audio_lame['preset_used']) && (!in_array($thisfile_mpeg_audio_lame['preset_used_id'], $named_preset_bitrates))) { + + $encoder_options = $thisfile_mpeg_audio_lame['preset_used']; + + } elseif (!empty($thisfile_mpeg_audio_lame['vbr_quality'])) { + + static $known_encoder_values = array (); + if (empty($known_encoder_values)) { + + //$known_encoder_values[abrbitrate_minbitrate][vbr_quality][raw_vbr_method][raw_noise_shaping][raw_stereo_mode][ath_type][lowpass_frequency] = 'preset name'; + $known_encoder_values[0xFF][58][1][1][3][2][20500] = '--alt-preset insane'; // 3.90, 3.90.1, 3.92 + $known_encoder_values[0xFF][58][1][1][3][2][20600] = '--alt-preset insane'; // 3.90.2, 3.90.3, 3.91 + $known_encoder_values[0xFF][57][1][1][3][4][20500] = '--alt-preset insane'; // 3.94, 3.95 + $known_encoder_values['**'][78][3][2][3][2][19500] = '--alt-preset extreme'; // 3.90, 3.90.1, 3.92 + $known_encoder_values['**'][78][3][2][3][2][19600] = '--alt-preset extreme'; // 3.90.2, 3.91 + $known_encoder_values['**'][78][3][1][3][2][19600] = '--alt-preset extreme'; // 3.90.3 + $known_encoder_values['**'][78][4][2][3][2][19500] = '--alt-preset fast extreme'; // 3.90, 3.90.1, 3.92 + $known_encoder_values['**'][78][4][2][3][2][19600] = '--alt-preset fast extreme'; // 3.90.2, 3.90.3, 3.91 + $known_encoder_values['**'][78][3][2][3][4][19000] = '--alt-preset standard'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values['**'][78][3][1][3][4][19000] = '--alt-preset standard'; // 3.90.3 + $known_encoder_values['**'][78][4][2][3][4][19000] = '--alt-preset fast standard'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values['**'][78][4][1][3][4][19000] = '--alt-preset fast standard'; // 3.90.3 + $known_encoder_values['**'][88][4][1][3][3][19500] = '--r3mix'; // 3.90, 3.90.1, 3.92 + $known_encoder_values['**'][88][4][1][3][3][19600] = '--r3mix'; // 3.90.2, 3.90.3, 3.91 + $known_encoder_values['**'][67][4][1][3][4][18000] = '--r3mix'; // 3.94, 3.95 + $known_encoder_values['**'][68][3][2][3][4][18000] = '--alt-preset medium'; // 3.90.3 + $known_encoder_values['**'][68][4][2][3][4][18000] = '--alt-preset fast medium'; // 3.90.3 + + $known_encoder_values[0xFF][99][1][1][1][2][0] = '--preset studio'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values[0xFF][58][2][1][3][2][20600] = '--preset studio'; // 3.90.3, 3.93.1 + $known_encoder_values[0xFF][58][2][1][3][2][20500] = '--preset studio'; // 3.93 + $known_encoder_values[0xFF][57][2][1][3][4][20500] = '--preset studio'; // 3.94, 3.95 + $known_encoder_values[0xC0][88][1][1][1][2][0] = '--preset cd'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values[0xC0][58][2][2][3][2][19600] = '--preset cd'; // 3.90.3, 3.93.1 + $known_encoder_values[0xC0][58][2][2][3][2][19500] = '--preset cd'; // 3.93 + $known_encoder_values[0xC0][57][2][1][3][4][19500] = '--preset cd'; // 3.94, 3.95 + $known_encoder_values[0xA0][78][1][1][3][2][18000] = '--preset hifi'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values[0xA0][58][2][2][3][2][18000] = '--preset hifi'; // 3.90.3, 3.93, 3.93.1 + $known_encoder_values[0xA0][57][2][1][3][4][18000] = '--preset hifi'; // 3.94, 3.95 + $known_encoder_values[0x80][67][1][1][3][2][18000] = '--preset tape'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values[0x80][67][1][1][3][2][15000] = '--preset radio'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values[0x70][67][1][1][3][2][15000] = '--preset fm'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $known_encoder_values[0x70][58][2][2][3][2][16000] = '--preset tape/radio/fm'; // 3.90.3, 3.93, 3.93.1 + $known_encoder_values[0x70][57][2][1][3][4][16000] = '--preset tape/radio/fm'; // 3.94, 3.95 + $known_encoder_values[0x38][58][2][2][0][2][10000] = '--preset voice'; // 3.90.3, 3.93, 3.93.1 + $known_encoder_values[0x38][57][2][1][0][4][15000] = '--preset voice'; // 3.94, 3.95 + $known_encoder_values[0x38][57][2][1][0][4][16000] = '--preset voice'; // 3.94a14 + $known_encoder_values[0x28][65][1][1][0][2][7500] = '--preset mw-us'; // 3.90, 3.90.1, 3.92 + $known_encoder_values[0x28][65][1][1][0][2][7600] = '--preset mw-us'; // 3.90.2, 3.91 + $known_encoder_values[0x28][58][2][2][0][2][7000] = '--preset mw-us'; // 3.90.3, 3.93, 3.93.1 + $known_encoder_values[0x28][57][2][1][0][4][10500] = '--preset mw-us'; // 3.94, 3.95 + $known_encoder_values[0x28][57][2][1][0][4][11200] = '--preset mw-us'; // 3.94a14 + $known_encoder_values[0x28][57][2][1][0][4][8800] = '--preset mw-us'; // 3.94a15 + $known_encoder_values[0x18][58][2][2][0][2][4000] = '--preset phon+/lw/mw-eu/sw'; // 3.90.3, 3.93.1 + $known_encoder_values[0x18][58][2][2][0][2][3900] = '--preset phon+/lw/mw-eu/sw'; // 3.93 + $known_encoder_values[0x18][57][2][1][0][4][5900] = '--preset phon+/lw/mw-eu/sw'; // 3.94, 3.95 + $known_encoder_values[0x18][57][2][1][0][4][6200] = '--preset phon+/lw/mw-eu/sw'; // 3.94a14 + $known_encoder_values[0x18][57][2][1][0][4][3200] = '--preset phon+/lw/mw-eu/sw'; // 3.94a15 + $known_encoder_values[0x10][58][2][2][0][2][3800] = '--preset phone'; // 3.90.3, 3.93.1 + $known_encoder_values[0x10][58][2][2][0][2][3700] = '--preset phone'; // 3.93 + $known_encoder_values[0x10][57][2][1][0][4][5600] = '--preset phone'; // 3.94, 3.95 + } + + if (isset($known_encoder_values[$thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']])) { + + $encoder_options = $known_encoder_values[$thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']]; + + } elseif (isset($known_encoder_values['**'][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']])) { + + $encoder_options = $known_encoder_values['**'][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']]; + + } elseif ($info['audio']['bitrate_mode'] == 'vbr') { + + // http://gabriel.mp3-tech.org/mp3infotag.html + // int Quality = (100 - 10 * gfp->VBR_q - gfp->quality)h + + + $lame_v_value = 10 - ceil($thisfile_mpeg_audio_lame['vbr_quality'] / 10); + $lame_q_value = 100 - $thisfile_mpeg_audio_lame['vbr_quality'] - ($lame_v_value * 10); + $encoder_options = '-V'.$lame_v_value.' -q'.$lame_q_value; + + } elseif ($info['audio']['bitrate_mode'] == 'cbr') { + + $encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000); + + } else { + + $encoder_options = strtoupper($info['audio']['bitrate_mode']); + + } + + } elseif (!empty($thisfile_mpeg_audio_lame['bitrate_abr'])) { + + $encoder_options = 'ABR'.$thisfile_mpeg_audio_lame['bitrate_abr']; + + } elseif (!empty($info['audio']['bitrate'])) { + + if ($info['audio']['bitrate_mode'] == 'cbr') { + $encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000); + } else { + $encoder_options = strtoupper($info['audio']['bitrate_mode']); + } + + } + if (!empty($thisfile_mpeg_audio_lame['bitrate_min'])) { + $encoder_options .= ' -b'.$thisfile_mpeg_audio_lame['bitrate_min']; + } + + if (@$thisfile_mpeg_audio_lame['encoding_flags']['nogap_prev'] || @$thisfile_mpeg_audio_lame['encoding_flags']['nogap_next']) { + $encoder_options .= ' --nogap'; + } + + if (!empty($thisfile_mpeg_audio_lame['lowpass_frequency'])) { + $exploded_options = explode(' ', $encoder_options, 4); + if ($exploded_options[0] == '--r3mix') { + $exploded_options[1] = 'r3mix'; + } + switch ($exploded_options[0]) { + case '--preset': + case '--alt-preset': + case '--r3mix': + if ($exploded_options[1] == 'fast') { + $exploded_options[1] .= ' '.$exploded_options[2]; + } + switch ($exploded_options[1]) { + case 'portable': + case 'medium': + case 'standard': + case 'extreme': + case 'insane': + case 'fast portable': + case 'fast medium': + case 'fast standard': + case 'fast extreme': + case 'fast insane': + case 'r3mix': + static $expected_lowpass = array ( + 'insane|20500' => 20500, + 'insane|20600' => 20600, // 3.90.2, 3.90.3, 3.91 + 'medium|18000' => 18000, + 'fast medium|18000' => 18000, + 'extreme|19500' => 19500, // 3.90, 3.90.1, 3.92, 3.95 + 'extreme|19600' => 19600, // 3.90.2, 3.90.3, 3.91, 3.93.1 + 'fast extreme|19500' => 19500, // 3.90, 3.90.1, 3.92, 3.95 + 'fast extreme|19600' => 19600, // 3.90.2, 3.90.3, 3.91, 3.93.1 + 'standard|19000' => 19000, + 'fast standard|19000' => 19000, + 'r3mix|19500' => 19500, // 3.90, 3.90.1, 3.92 + 'r3mix|19600' => 19600, // 3.90.2, 3.90.3, 3.91 + 'r3mix|18000' => 18000, // 3.94, 3.95 + ); + if (!isset($expected_lowpass[$exploded_options[1].'|'.$thisfile_mpeg_audio_lame['lowpass_frequency']]) && ($thisfile_mpeg_audio_lame['lowpass_frequency'] < 22050) && (round($thisfile_mpeg_audio_lame['lowpass_frequency'] / 1000) < round($thisfile_mpeg_audio['sample_rate'] / 2000))) { + $encoder_options .= ' --lowpass '.$thisfile_mpeg_audio_lame['lowpass_frequency']; + } + break; + + default: + break; + } + break; + } + } + + if (isset($thisfile_mpeg_audio_lame['raw']['source_sample_freq'])) { + if (($thisfile_mpeg_audio['sample_rate'] == 44100) && ($thisfile_mpeg_audio_lame['raw']['source_sample_freq'] != 1)) { + $encoder_options .= ' --resample 44100'; + } elseif (($thisfile_mpeg_audio['sample_rate'] == 48000) && ($thisfile_mpeg_audio_lame['raw']['source_sample_freq'] != 2)) { + $encoder_options .= ' --resample 48000'; + } elseif ($thisfile_mpeg_audio['sample_rate'] < 44100) { + switch ($thisfile_mpeg_audio_lame['raw']['source_sample_freq']) { + case 0: // <= 32000 + // may or may not be same as source frequency - ignore + break; + case 1: // 44100 + case 2: // 48000 + case 3: // 48000+ + $exploded_options = explode(' ', $encoder_options, 4); + switch ($exploded_options[0]) { + case '--preset': + case '--alt-preset': + switch ($exploded_options[1]) { + case 'fast': + case 'portable': + case 'medium': + case 'standard': + case 'extreme': + case 'insane': + $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate']; + break; + + default: + static $expected_resampled_rate = array ( + 'phon+/lw/mw-eu/sw|16000' => 16000, + 'mw-us|24000' => 24000, // 3.95 + 'mw-us|32000' => 32000, // 3.93 + 'mw-us|16000' => 16000, // 3.92 + 'phone|16000' => 16000, + 'phone|11025' => 11025, // 3.94a15 + 'radio|32000' => 32000, // 3.94a15 + 'fm/radio|32000' => 32000, // 3.92 + 'fm|32000' => 32000, // 3.90 + 'voice|32000' => 32000); + if (!isset($expected_resampled_rate[$exploded_options[1].'|'.$thisfile_mpeg_audio['sample_rate']])) { + $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate']; + } + break; + } + break; + + case '--r3mix': + default: + $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate']; + break; + } + break; + } + } + } + if (empty($encoder_options) && !empty($info['audio']['bitrate']) && !empty($info['audio']['bitrate_mode'])) { + //$encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000); + $encoder_options = strtoupper($info['audio']['bitrate_mode']); + } + + return $encoder_options; + } + + + + public function decodeMPEGaudioHeader($fd, $offset, &$info, $recursive_search=true, $scan_as_cbr=false, $fast_mpeg_header_scan=false) { + + static $mpeg_audio_version_lookup; + static $mpeg_audio_layer_lookup; + static $mpeg_audio_bitrate_lookup; + static $mpeg_audio_frequency_lookup; + static $mpeg_audio_channel_mode_lookup; + static $mpeg_audio_mode_extension_lookup; + static $mpeg_audio_emphasis_lookup; + if (empty($mpeg_audio_version_lookup)) { + $mpeg_audio_version_lookup = getid3_mp3::MPEGaudioVersionarray(); + $mpeg_audio_layer_lookup = getid3_mp3::MPEGaudioLayerarray(); + $mpeg_audio_bitrate_lookup = getid3_mp3::MPEGaudioBitratearray(); + $mpeg_audio_frequency_lookup = getid3_mp3::MPEGaudioFrequencyarray(); + $mpeg_audio_channel_mode_lookup = getid3_mp3::MPEGaudioChannelModearray(); + $mpeg_audio_mode_extension_lookup = getid3_mp3::MPEGaudioModeExtensionarray(); + $mpeg_audio_emphasis_lookup = getid3_mp3::MPEGaudioEmphasisarray(); + } + + if ($offset >= $info['avdataend']) { + + // non-fatal error: 'end of file encounter looking for MPEG synch' + return; + + } + fseek($fd, $offset, SEEK_SET); + $header_string = fread($fd, 226); // LAME header at offset 36 + 190 bytes of Xing/LAME data + + // MP3 audio frame structure: + // $aa $aa $aa $aa [$bb $bb] $cc... + // where $aa..$aa is the four-byte mpeg-audio header (below) + // $bb $bb is the optional 2-byte CRC + // and $cc... is the audio data + + $head4 = substr($header_string, 0, 4); + + if (isset($mpeg_audio_header_decode_cache[$head4])) { + $mpeg_header_raw_array= $mpeg_audio_header_decode_cache[$head4]; + } else { + $mpeg_header_raw_array = getid3_mp3::MPEGaudioHeaderDecode($head4); + $mpeg_audio_header_decode_cache[$head4] = $mpeg_header_raw_array; + } + + // Not in cache + if (!isset($mpeg_audio_header_valid_cache[$head4])) { + $mpeg_audio_header_valid_cache[$head4] = getid3_mp3::MPEGaudioHeaderValid($mpeg_header_raw_array, false, false); + } + + // shortcut + if (!isset($info['mpeg']['audio'])) { + $info['mpeg']['audio'] = array (); + } + $thisfile_mpeg_audio = &$info['mpeg']['audio']; + + + if ($mpeg_audio_header_valid_cache[$head4]) { + $thisfile_mpeg_audio['raw'] = $mpeg_header_raw_array; + } else { + + // non-fatal error: Invalid MPEG audio header at offset $offset + return; + } + + if (!$fast_mpeg_header_scan) { + + $thisfile_mpeg_audio['version'] = $mpeg_audio_version_lookup[$thisfile_mpeg_audio['raw']['version']]; + $thisfile_mpeg_audio['layer'] = $mpeg_audio_layer_lookup[$thisfile_mpeg_audio['raw']['layer']]; + + $thisfile_mpeg_audio['channelmode'] = $mpeg_audio_channel_mode_lookup[$thisfile_mpeg_audio['raw']['channelmode']]; + $thisfile_mpeg_audio['channels'] = (($thisfile_mpeg_audio['channelmode'] == 'mono') ? 1 : 2); + $thisfile_mpeg_audio['sample_rate'] = $mpeg_audio_frequency_lookup[$thisfile_mpeg_audio['version']][$thisfile_mpeg_audio['raw']['sample_rate']]; + $thisfile_mpeg_audio['protection'] = !$thisfile_mpeg_audio['raw']['protection']; + $thisfile_mpeg_audio['private'] = (bool) $thisfile_mpeg_audio['raw']['private']; + $thisfile_mpeg_audio['modeextension'] = $mpeg_audio_mode_extension_lookup[$thisfile_mpeg_audio['layer']][$thisfile_mpeg_audio['raw']['modeextension']]; + $thisfile_mpeg_audio['copyright'] = (bool) $thisfile_mpeg_audio['raw']['copyright']; + $thisfile_mpeg_audio['original'] = (bool) $thisfile_mpeg_audio['raw']['original']; + $thisfile_mpeg_audio['emphasis'] = $mpeg_audio_emphasis_lookup[$thisfile_mpeg_audio['raw']['emphasis']]; + + $info['audio']['channels'] = $thisfile_mpeg_audio['channels']; + $info['audio']['sample_rate'] = $thisfile_mpeg_audio['sample_rate']; + + if ($thisfile_mpeg_audio['protection']) { + $thisfile_mpeg_audio['crc'] = getid3_lib::BigEndian2Int(substr($header_string, 4, 2)); + } + + } + + if ($thisfile_mpeg_audio['raw']['bitrate'] == 15) { + // http://www.hydrogenaudio.org/?act=ST&f=16&t=9682&st=0 + $this->getid3->warning('Invalid bitrate index (15), this is a known bug in free-format MP3s encoded by LAME v3.90 - 3.93.1'); + $thisfile_mpeg_audio['raw']['bitrate'] = 0; + } + $thisfile_mpeg_audio['padding'] = (bool) $thisfile_mpeg_audio['raw']['padding']; + $thisfile_mpeg_audio['bitrate'] = $mpeg_audio_bitrate_lookup[$thisfile_mpeg_audio['version']][$thisfile_mpeg_audio['layer']][$thisfile_mpeg_audio['raw']['bitrate']]; + + if (($thisfile_mpeg_audio['bitrate'] == 'free') && ($offset == $info['avdataoffset'])) { + // only skip multiple frame check if free-format bitstream found at beginning of file + // otherwise is quite possibly simply corrupted data + $recursive_search = false; + } + + // For Layer 2 there are some combinations of bitrate and mode which are not allowed. + if (!$fast_mpeg_header_scan && ($thisfile_mpeg_audio['layer'] == '2')) { + + $info['audio']['dataformat'] = 'mp2'; + switch ($thisfile_mpeg_audio['channelmode']) { + + case 'mono': + if (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] <= 192000)) { + // these are ok + } else { + + // non-fatal error: bitrate not allowed in Layer 2/mono + return; + } + break; + + case 'stereo': + case 'joint stereo': + case 'dual channel': + if (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] == 64000) || ($thisfile_mpeg_audio['bitrate'] >= 96000)) { + // these are ok + } else { + + // non-fatal error: bitrate not allowed in Layer 2/stereo/joint stereo/dual channel + return; + } + break; + + } + + } + + + if ($info['audio']['sample_rate'] > 0) { + $thisfile_mpeg_audio['framelength'] = getid3_mp3::MPEGaudioFrameLength($thisfile_mpeg_audio['bitrate'], $thisfile_mpeg_audio['version'], $thisfile_mpeg_audio['layer'], (int) $thisfile_mpeg_audio['padding'], $info['audio']['sample_rate']); + } + + $next_frame_test_offset = $offset + 1; + if ($thisfile_mpeg_audio['bitrate'] != 'free') { + + $info['audio']['bitrate'] = $thisfile_mpeg_audio['bitrate']; + + if (isset($thisfile_mpeg_audio['framelength'])) { + $next_frame_test_offset = $offset + $thisfile_mpeg_audio['framelength']; + } else { + + // non-fatal error: Frame at offset('.$offset.') is has an invalid frame length. + return; + } + + } + + $expected_number_of_audio_bytes = 0; + + //////////////////////////////////////////////////////////////////////////////////// + // Variable-bitrate headers + + if (substr($header_string, 4 + 32, 4) == 'VBRI') { + // Fraunhofer VBR header is hardcoded 'VBRI' at offset 0x24 (36) + // specs taken from http://minnie.tuhs.org/pipermail/mp3encoder/2001-January/001800.html + + $thisfile_mpeg_audio['bitrate_mode'] = 'vbr'; + $thisfile_mpeg_audio['VBR_method'] = 'Fraunhofer'; + $info['audio']['codec'] = 'Fraunhofer'; + + $side_info_data = substr($header_string, 4 + 2, 32); + + $fraunhofer_vbr_offset = 36; + + $thisfile_mpeg_audio['VBR_encoder_version'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 4, 2)); // VbriVersion + $thisfile_mpeg_audio['VBR_encoder_delay'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 6, 2)); // VbriDelay + $thisfile_mpeg_audio['VBR_quality'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 8, 2)); // VbriQuality + $thisfile_mpeg_audio['VBR_bytes'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 10, 4)); // VbriStreamBytes + $thisfile_mpeg_audio['VBR_frames'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 14, 4)); // VbriStreamFrames + $thisfile_mpeg_audio['VBR_seek_offsets'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 18, 2)); // VbriTableSize + $thisfile_mpeg_audio['VBR_seek_scale'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 20, 2)); // VbriTableScale + $thisfile_mpeg_audio['VBR_entry_bytes'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 22, 2)); // VbriEntryBytes + $thisfile_mpeg_audio['VBR_entry_frames'] = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset + 24, 2)); // VbriEntryFrames + + $expected_number_of_audio_bytes = $thisfile_mpeg_audio['VBR_bytes']; + + $previous_byte_offset = $offset; + for ($i = 0; $i < $thisfile_mpeg_audio['VBR_seek_offsets']; $i++) { + $fraunhofer_offset_n = getid3_lib::BigEndian2Int(substr($header_string, $fraunhofer_vbr_offset, $thisfile_mpeg_audio['VBR_entry_bytes'])); + $fraunhofer_vbr_offset += $thisfile_mpeg_audio['VBR_entry_bytes']; + $thisfile_mpeg_audio['VBR_offsets_relative'][$i] = ($fraunhofer_offset_n * $thisfile_mpeg_audio['VBR_seek_scale']); + $thisfile_mpeg_audio['VBR_offsets_absolute'][$i] = ($fraunhofer_offset_n * $thisfile_mpeg_audio['VBR_seek_scale']) + $previous_byte_offset; + $previous_byte_offset += $fraunhofer_offset_n; + } + + + } else { + + // Xing VBR header is hardcoded 'Xing' at a offset 0x0D (13), 0x15 (21) or 0x24 (36) + // depending on MPEG layer and number of channels + + $vbr_id_offset = getid3_mp3::XingVBRidOffset($thisfile_mpeg_audio['version'], $thisfile_mpeg_audio['channelmode']); + $side_info_data = substr($header_string, 4 + 2, $vbr_id_offset - 4); + + if ((substr($header_string, $vbr_id_offset, strlen('Xing')) == 'Xing') || (substr($header_string, $vbr_id_offset, strlen('Info')) == 'Info')) { + // 'Xing' is traditional Xing VBR frame + // 'Info' is LAME-encoded CBR (This was done to avoid CBR files to be recognized as traditional Xing VBR files by some decoders.) + // 'Info' *can* legally be used to specify a VBR file as well, however. + + // http://www.multiweb.cz/twoinches/MP3inside.htm + //00..03 = "Xing" or "Info" + //04..07 = Flags: + // 0x01 Frames Flag set if value for number of frames in file is stored + // 0x02 Bytes Flag set if value for filesize in bytes is stored + // 0x04 TOC Flag set if values for TOC are stored + // 0x08 VBR Scale Flag set if values for VBR scale is stored + //08..11 Frames: Number of frames in file (including the first Xing/Info one) + //12..15 Bytes: File length in Bytes + //16..115 TOC (Table of Contents): + // Contains of 100 indexes (one Byte length) for easier lookup in file. Approximately solves problem with moving inside file. + // Each Byte has a value according this formula: + // (TOC[i] / 256) * fileLenInBytes + // So if song lasts eg. 240 sec. and you want to jump to 60. sec. (and file is 5 000 000 Bytes length) you can use: + // TOC[(60/240)*100] = TOC[25] + // and corresponding Byte in file is then approximately at: + // (TOC[25]/256) * 5000000 + //116..119 VBR Scale + + + // should be safe to leave this at 'vbr' and let it be overriden to 'cbr' if a CBR preset/mode is used by LAME + $thisfile_mpeg_audio['bitrate_mode'] = 'vbr'; + $thisfile_mpeg_audio['VBR_method'] = 'Xing'; + + $thisfile_mpeg_audio['xing_flags_raw'] = getid3_lib::BigEndian2Int(substr($header_string, $vbr_id_offset + 4, 4)); + + $thisfile_mpeg_audio['xing_flags']['frames'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000001); + $thisfile_mpeg_audio['xing_flags']['bytes'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000002); + $thisfile_mpeg_audio['xing_flags']['toc'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000004); + $thisfile_mpeg_audio['xing_flags']['vbr_scale'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000008); + + if ($thisfile_mpeg_audio['xing_flags']['frames']) { + $thisfile_mpeg_audio['VBR_frames'] = getid3_lib::BigEndian2Int(substr($header_string, $vbr_id_offset + 8, 4)); + } + if ($thisfile_mpeg_audio['xing_flags']['bytes']) { + $thisfile_mpeg_audio['VBR_bytes'] = getid3_lib::BigEndian2Int(substr($header_string, $vbr_id_offset + 12, 4)); + } + + if (!empty($thisfile_mpeg_audio['VBR_frames']) && !empty($thisfile_mpeg_audio['VBR_bytes'])) { + + $frame_lengthfloat = $thisfile_mpeg_audio['VBR_bytes'] / $thisfile_mpeg_audio['VBR_frames']; + + if ($thisfile_mpeg_audio['layer'] == '1') { + // BitRate = (((FrameLengthInBytes / 4) - Padding) * SampleRate) / 12 + $info['audio']['bitrate'] = ($frame_lengthfloat / 4) * $thisfile_mpeg_audio['sample_rate'] * (2 / $info['audio']['channels']) / 12; + } else { + // Bitrate = ((FrameLengthInBytes - Padding) * SampleRate) / 144 + $info['audio']['bitrate'] = $frame_lengthfloat * $thisfile_mpeg_audio['sample_rate'] * (2 / $info['audio']['channels']) / 144; + } + $thisfile_mpeg_audio['framelength'] = floor($frame_lengthfloat); + } + + if ($thisfile_mpeg_audio['xing_flags']['toc']) { + $lame_toc_data = substr($header_string, $vbr_id_offset + 16, 100); + for ($i = 0; $i < 100; $i++) { + $thisfile_mpeg_audio['toc'][$i] = ord($lame_toc_data{$i}); + } + } + if ($thisfile_mpeg_audio['xing_flags']['vbr_scale']) { + $thisfile_mpeg_audio['VBR_scale'] = getid3_lib::BigEndian2Int(substr($header_string, $vbr_id_offset + 116, 4)); + } + + + // http://gabriel.mp3-tech.org/mp3infotag.html + if (substr($header_string, $vbr_id_offset + 120, 4) == 'LAME') { + + // shortcut + $thisfile_mpeg_audio['LAME'] = array (); + $thisfile_mpeg_audio_lame = &$thisfile_mpeg_audio['LAME']; + + + $thisfile_mpeg_audio_lame['long_version'] = substr($header_string, $vbr_id_offset + 120, 20); + $thisfile_mpeg_audio_lame['short_version'] = substr($thisfile_mpeg_audio_lame['long_version'], 0, 9); + + if ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.90') { + + // extra 11 chars are not part of version string when LAMEtag present + unset($thisfile_mpeg_audio_lame['long_version']); + + // It the LAME tag was only introduced in LAME v3.90 + // http://www.hydrogenaudio.org/?act=ST&f=15&t=9933 + + // Offsets of various bytes in http://gabriel.mp3-tech.org/mp3infotag.html + // are assuming a 'Xing' identifier offset of 0x24, which is the case for + // MPEG-1 non-mono, but not for other combinations + $lame_tag_offset_contant = $vbr_id_offset - 0x24; + + // shortcuts + $thisfile_mpeg_audio_lame['RGAD'] = array ('track'=>array(), 'album'=>array()); + $thisfile_mpeg_audio_lame_rgad = &$thisfile_mpeg_audio_lame['RGAD']; + $thisfile_mpeg_audio_lame_rgad_track = &$thisfile_mpeg_audio_lame_rgad['track']; + $thisfile_mpeg_audio_lame_rgad_album = &$thisfile_mpeg_audio_lame_rgad['album']; + $thisfile_mpeg_audio_lame['raw'] = array (); + $thisfile_mpeg_audio_lame_raw = &$thisfile_mpeg_audio_lame['raw']; + + // byte $9B VBR Quality + // This field is there to indicate a quality level, although the scale was not precised in the original Xing specifications. + // Actually overwrites original Xing bytes + unset($thisfile_mpeg_audio['VBR_scale']); + $thisfile_mpeg_audio_lame['vbr_quality'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0x9B, 1)); + + // bytes $9C-$A4 Encoder short VersionString + $thisfile_mpeg_audio_lame['short_version'] = substr($header_string, $lame_tag_offset_contant + 0x9C, 9); + + // byte $A5 Info Tag revision + VBR method + $lame_tagRevisionVBRmethod = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xA5, 1)); + + $thisfile_mpeg_audio_lame['tag_revision'] = ($lame_tagRevisionVBRmethod & 0xF0) >> 4; + $thisfile_mpeg_audio_lame_raw['vbr_method'] = $lame_tagRevisionVBRmethod & 0x0F; + $thisfile_mpeg_audio_lame['vbr_method'] = getid3_mp3::LAMEvbrMethodLookup($thisfile_mpeg_audio_lame_raw['vbr_method']); + $thisfile_mpeg_audio['bitrate_mode'] = substr($thisfile_mpeg_audio_lame['vbr_method'], 0, 3); // usually either 'cbr' or 'vbr', but truncates 'vbr-old / vbr-rh' to 'vbr' + + // byte $A6 Lowpass filter value + $thisfile_mpeg_audio_lame['lowpass_frequency'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xA6, 1)) * 100; + + // bytes $A7-$AE Replay Gain + // http://privatewww.essex.ac.uk/~djmrob/replaygain/rg_data_format.html + // bytes $A7-$AA : 32 bit floating point "Peak signal amplitude" + if ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.94b') { + // LAME 3.94a16 and later - 9.23 fixed point + // ie 0x0059E2EE / (2^23) = 5890798 / 8388608 = 0.7022378444671630859375 + $thisfile_mpeg_audio_lame_rgad['peak_amplitude'] = (float) ((getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xA7, 4))) / 8388608); + } else { + // LAME 3.94a15 and earlier - 32-bit floating point + // Actually 3.94a16 will fall in here too and be WRONG, but is hard to detect 3.94a16 vs 3.94a15 + $thisfile_mpeg_audio_lame_rgad['peak_amplitude'] = getid3_lib::LittleEndian2Float(substr($header_string, $lame_tag_offset_contant + 0xA7, 4)); + } + if ($thisfile_mpeg_audio_lame_rgad['peak_amplitude'] == 0) { + unset($thisfile_mpeg_audio_lame_rgad['peak_amplitude']); + } else { + $thisfile_mpeg_audio_lame_rgad['peak_db'] = 20 * log10($thisfile_mpeg_audio_lame_rgad['peak_amplitude']); + } + + $thisfile_mpeg_audio_lame_raw['RGAD_track'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xAB, 2)); + $thisfile_mpeg_audio_lame_raw['RGAD_album'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xAD, 2)); + + + if ($thisfile_mpeg_audio_lame_raw['RGAD_track'] != 0) { + + $thisfile_mpeg_audio_lame_rgad_track['raw']['name'] = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0xE000) >> 13; + $thisfile_mpeg_audio_lame_rgad_track['raw']['originator'] = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x1C00) >> 10; + $thisfile_mpeg_audio_lame_rgad_track['raw']['sign_bit'] = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x0200) >> 9; + $thisfile_mpeg_audio_lame_rgad_track['raw']['gain_adjust'] = $thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x01FF; + $thisfile_mpeg_audio_lame_rgad_track['name'] = getid3_lib_replaygain::NameLookup($thisfile_mpeg_audio_lame_rgad_track['raw']['name']); + $thisfile_mpeg_audio_lame_rgad_track['originator'] = getid3_lib_replaygain::OriginatorLookup($thisfile_mpeg_audio_lame_rgad_track['raw']['originator']); + $thisfile_mpeg_audio_lame_rgad_track['gain_db'] = getid3_lib_replaygain::AdjustmentLookup($thisfile_mpeg_audio_lame_rgad_track['raw']['gain_adjust'], $thisfile_mpeg_audio_lame_rgad_track['raw']['sign_bit']); + + if (!empty($thisfile_mpeg_audio_lame_rgad['peak_amplitude'])) { + $info['replay_gain']['track']['peak'] = $thisfile_mpeg_audio_lame_rgad['peak_amplitude']; + } + $info['replay_gain']['track']['originator'] = $thisfile_mpeg_audio_lame_rgad_track['originator']; + $info['replay_gain']['track']['adjustment'] = $thisfile_mpeg_audio_lame_rgad_track['gain_db']; + } else { + unset($thisfile_mpeg_audio_lame_rgad['track']); + } + if ($thisfile_mpeg_audio_lame_raw['RGAD_album'] != 0) { + + $thisfile_mpeg_audio_lame_rgad_album['raw']['name'] = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0xE000) >> 13; + $thisfile_mpeg_audio_lame_rgad_album['raw']['originator'] = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x1C00) >> 10; + $thisfile_mpeg_audio_lame_rgad_album['raw']['sign_bit'] = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x0200) >> 9; + $thisfile_mpeg_audio_lame_rgad_album['raw']['gain_adjust'] = $thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x01FF; + $thisfile_mpeg_audio_lame_rgad_album['name'] = getid3_lib_replaygain::NameLookup($thisfile_mpeg_audio_lame_rgad_album['raw']['name']); + $thisfile_mpeg_audio_lame_rgad_album['originator'] = getid3_lib_replaygain::OriginatorLookup($thisfile_mpeg_audio_lame_rgad_album['raw']['originator']); + $thisfile_mpeg_audio_lame_rgad_album['gain_db'] = getid3_lib_replaygain::AdjustmentLookup($thisfile_mpeg_audio_lame_rgad_album['raw']['gain_adjust'], $thisfile_mpeg_audio_lame_rgad_album['raw']['sign_bit']); + + if (!empty($thisfile_mpeg_audio_lame_rgad['peak_amplitude'])) { + $info['replay_gain']['album']['peak'] = $thisfile_mpeg_audio_lame_rgad['peak_amplitude']; + } + $info['replay_gain']['album']['originator'] = $thisfile_mpeg_audio_lame_rgad_album['originator']; + $info['replay_gain']['album']['adjustment'] = $thisfile_mpeg_audio_lame_rgad_album['gain_db']; + } else { + unset($thisfile_mpeg_audio_lame_rgad['album']); + } + if (empty($thisfile_mpeg_audio_lame_rgad)) { + unset($thisfile_mpeg_audio_lame['RGAD']); + } + + + // byte $AF Encoding flags + ATH Type + $encoding_flags_ath_type = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xAF, 1)); + $thisfile_mpeg_audio_lame['encoding_flags']['nspsytune'] = (bool) ($encoding_flags_ath_type & 0x10); + $thisfile_mpeg_audio_lame['encoding_flags']['nssafejoint'] = (bool) ($encoding_flags_ath_type & 0x20); + $thisfile_mpeg_audio_lame['encoding_flags']['nogap_next'] = (bool) ($encoding_flags_ath_type & 0x40); + $thisfile_mpeg_audio_lame['encoding_flags']['nogap_prev'] = (bool) ($encoding_flags_ath_type & 0x80); + $thisfile_mpeg_audio_lame['ath_type'] = $encoding_flags_ath_type & 0x0F; + + // byte $B0 if ABR {specified bitrate} else {minimal bitrate} + $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xB0, 1)); + if ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 2) { // Average BitRate (ABR) + $thisfile_mpeg_audio_lame['bitrate_abr'] = $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']; + } elseif ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1) { // Constant BitRate (CBR) + // ignore + } elseif ($thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'] > 0) { // Variable BitRate (VBR) - minimum bitrate + $thisfile_mpeg_audio_lame['bitrate_min'] = $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']; + } + + // bytes $B1-$B3 Encoder delays + $encoder_delays = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xB1, 3)); + $thisfile_mpeg_audio_lame['encoder_delay'] = ($encoder_delays & 0xFFF000) >> 12; + $thisfile_mpeg_audio_lame['end_padding'] = $encoder_delays & 0x000FFF; + + // byte $B4 Misc + $misc_byte = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xB4, 1)); + $thisfile_mpeg_audio_lame_raw['noise_shaping'] = ($misc_byte & 0x03); + $thisfile_mpeg_audio_lame_raw['stereo_mode'] = ($misc_byte & 0x1C) >> 2; + $thisfile_mpeg_audio_lame_raw['not_optimal_quality'] = ($misc_byte & 0x20) >> 5; + $thisfile_mpeg_audio_lame_raw['source_sample_freq'] = ($misc_byte & 0xC0) >> 6; + $thisfile_mpeg_audio_lame['noise_shaping'] = $thisfile_mpeg_audio_lame_raw['noise_shaping']; + $thisfile_mpeg_audio_lame['stereo_mode'] = getid3_mp3::LAMEmiscStereoModeLookup($thisfile_mpeg_audio_lame_raw['stereo_mode']); + $thisfile_mpeg_audio_lame['not_optimal_quality'] = (bool) $thisfile_mpeg_audio_lame_raw['not_optimal_quality']; + $thisfile_mpeg_audio_lame['source_sample_freq'] = getid3_mp3::LAMEmiscSourceSampleFrequencyLookup($thisfile_mpeg_audio_lame_raw['source_sample_freq']); + + // byte $B5 MP3 Gain + $thisfile_mpeg_audio_lame_raw['mp3_gain'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xB5, 1), false, true); + $thisfile_mpeg_audio_lame['mp3_gain_db'] = (20 * log10(2) / 4) * $thisfile_mpeg_audio_lame_raw['mp3_gain']; + $thisfile_mpeg_audio_lame['mp3_gain_factor'] = pow(2, ($thisfile_mpeg_audio_lame['mp3_gain_db'] / 6)); + + // bytes $B6-$B7 Preset and surround info + $PresetSurroundBytes = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xB6, 2)); + // Reserved = ($PresetSurroundBytes & 0xC000); + $thisfile_mpeg_audio_lame_raw['surround_info'] = ($PresetSurroundBytes & 0x3800); + $thisfile_mpeg_audio_lame['surround_info'] = getid3_mp3::LAMEsurroundInfoLookup($thisfile_mpeg_audio_lame_raw['surround_info']); + $thisfile_mpeg_audio_lame['preset_used_id'] = ($PresetSurroundBytes & 0x07FF); + $thisfile_mpeg_audio_lame['preset_used'] = getid3_mp3::LAMEpresetUsedLookup($thisfile_mpeg_audio_lame); + if (!empty($thisfile_mpeg_audio_lame['preset_used_id']) && empty($thisfile_mpeg_audio_lame['preset_used'])) { + $this->getid3->warning('Unknown LAME preset used ('.$thisfile_mpeg_audio_lame['preset_used_id'].') - please report to info@getid3.org'); + } + if (($thisfile_mpeg_audio_lame['short_version'] == 'LAME3.90.') && !empty($thisfile_mpeg_audio_lame['preset_used_id'])) { + // this may change if 3.90.4 ever comes out + $thisfile_mpeg_audio_lame['short_version'] = 'LAME3.90.3'; + } + + // bytes $B8-$BB MusicLength + $thisfile_mpeg_audio_lame['audio_bytes'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xB8, 4)); + $expected_number_of_audio_bytes = (($thisfile_mpeg_audio_lame['audio_bytes'] > 0) ? $thisfile_mpeg_audio_lame['audio_bytes'] : $thisfile_mpeg_audio['VBR_bytes']); + + // bytes $BC-$BD MusicCRC + $thisfile_mpeg_audio_lame['music_crc'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xBC, 2)); + + // bytes $BE-$BF CRC-16 of Info Tag + $thisfile_mpeg_audio_lame['lame_tag_crc'] = getid3_lib::BigEndian2Int(substr($header_string, $lame_tag_offset_contant + 0xBE, 2)); + + + // LAME CBR + if ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1) { + + $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; + $thisfile_mpeg_audio['bitrate'] = getid3_mp3::ClosestStandardMP3Bitrate($thisfile_mpeg_audio['bitrate']); + $info['audio']['bitrate'] = $thisfile_mpeg_audio['bitrate']; + + } + + } + } + + } else { + + // not Fraunhofer or Xing VBR methods, most likely CBR (but could be VBR with no header) + $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; + if ($recursive_search) { + $thisfile_mpeg_audio['bitrate_mode'] = 'vbr'; + if (getid3_mp3::RecursiveFrameScanning($fd, $info, $offset, $next_frame_test_offset, true)) { + $recursive_search = false; + $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; + } + if ($thisfile_mpeg_audio['bitrate_mode'] == 'vbr') { + $this->getid3->warning('VBR file with no VBR header. Bitrate values calculated from actual frame bitrates.'); + } + } + + } + + } + + if (($expected_number_of_audio_bytes > 0) && ($expected_number_of_audio_bytes != ($info['avdataend'] - $info['avdataoffset']))) { + if ($expected_number_of_audio_bytes > ($info['avdataend'] - $info['avdataoffset'])) { + if (($expected_number_of_audio_bytes - ($info['avdataend'] - $info['avdataoffset'])) == 1) { + $this->getid3->warning('Last byte of data truncated (this is a known bug in Meracl ID3 Tag Writer before v1.3.5)'); + } else { + $this->getid3->warning('Probable truncated file: expecting '.$expected_number_of_audio_bytes.' bytes of audio data, only found '.($info['avdataend'] - $info['avdataoffset']).' (short by '.($expected_number_of_audio_bytes - ($info['avdataend'] - $info['avdataoffset'])).' bytes)'); + } + } else { + if ((($info['avdataend'] - $info['avdataoffset']) - $expected_number_of_audio_bytes) == 1) { + $info['avdataend']--; + } else { + $this->getid3->warning('Too much data in file: expecting '.$expected_number_of_audio_bytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $expected_number_of_audio_bytes).' bytes too many)'); + } + } + } + + if (($thisfile_mpeg_audio['bitrate'] == 'free') && empty($info['audio']['bitrate'])) { + if (($offset == $info['avdataoffset']) && empty($thisfile_mpeg_audio['VBR_frames'])) { + $frame_byte_length = getid3_mp3::FreeFormatFrameLength($fd, $offset, $info, true); + if ($frame_byte_length > 0) { + $thisfile_mpeg_audio['framelength'] = $frame_byte_length; + if ($thisfile_mpeg_audio['layer'] == '1') { + // BitRate = (((FrameLengthInBytes / 4) - Padding) * SampleRate) / 12 + $info['audio']['bitrate'] = ((($frame_byte_length / 4) - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 12; + } else { + // Bitrate = ((FrameLengthInBytes - Padding) * SampleRate) / 144 + $info['audio']['bitrate'] = (($frame_byte_length - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 144; + } + } else { + + // non-fatal error: Error calculating frame length of free-format MP3 without Xing/LAME header. + return; + } + } + } + + if (@$thisfile_mpeg_audio['VBR_frames']) { + switch ($thisfile_mpeg_audio['bitrate_mode']) { + case 'vbr': + case 'abr': + if (($thisfile_mpeg_audio['version'] == '1') && ($thisfile_mpeg_audio['layer'] == 1)) { + $thisfile_mpeg_audio['VBR_bitrate'] = ((@$thisfile_mpeg_audio['VBR_bytes'] / $thisfile_mpeg_audio['VBR_frames']) * 8) * ($info['audio']['sample_rate'] / 384); + } elseif ((($thisfile_mpeg_audio['version'] == '2') || ($thisfile_mpeg_audio['version'] == '2.5')) && ($thisfile_mpeg_audio['layer'] == 3)) { + $thisfile_mpeg_audio['VBR_bitrate'] = ((@$thisfile_mpeg_audio['VBR_bytes'] / $thisfile_mpeg_audio['VBR_frames']) * 8) * ($info['audio']['sample_rate'] / 576); + } else { + $thisfile_mpeg_audio['VBR_bitrate'] = ((@$thisfile_mpeg_audio['VBR_bytes'] / $thisfile_mpeg_audio['VBR_frames']) * 8) * ($info['audio']['sample_rate'] / 1152); + } + if ($thisfile_mpeg_audio['VBR_bitrate'] > 0) { + $info['audio']['bitrate'] = $thisfile_mpeg_audio['VBR_bitrate']; + $thisfile_mpeg_audio['bitrate'] = $thisfile_mpeg_audio['VBR_bitrate']; // to avoid confusion + } + break; + } + } + + // End variable-bitrate headers + //////////////////////////////////////////////////////////////////////////////////// + + if ($recursive_search) { + + if (!getid3_mp3::RecursiveFrameScanning($fd, $info, $offset, $next_frame_test_offset, $scan_as_cbr)) { + return false; + } + + } + + return true; + } + + + + public function RecursiveFrameScanning(&$fd, &$info, &$offset, &$next_frame_test_offset, $scan_as_cbr) { + for ($i = 0; $i < getid3_mp3::VALID_CHECK_FRAMES; $i++) { + // check next getid3_mp3::VALID_CHECK_FRAMES frames for validity, to make sure we haven't run across a false synch + if (($next_frame_test_offset + 4) >= $info['avdataend']) { + // end of file + return true; + } + + $next_frame_test_array = array ('avdataend' => $info['avdataend'], 'avdataoffset' => $info['avdataoffset']); + if ($this->decodeMPEGaudioHeader($fd, $next_frame_test_offset, $next_frame_test_array, false)) { + if ($scan_as_cbr) { + // force CBR mode, used for trying to pick out invalid audio streams with + // valid(?) VBR headers, or VBR streams with no VBR header + if (!isset($next_frame_test_array['mpeg']['audio']['bitrate']) || !isset($info['mpeg']['audio']['bitrate']) || ($next_frame_test_array['mpeg']['audio']['bitrate'] != $info['mpeg']['audio']['bitrate'])) { + return false; + } + } + + + // next frame is OK, get ready to check the one after that + if (isset($next_frame_test_array['mpeg']['audio']['framelength']) && ($next_frame_test_array['mpeg']['audio']['framelength'] > 0)) { + $next_frame_test_offset += $next_frame_test_array['mpeg']['audio']['framelength']; + } else { + + // non-fatal error: Frame at offset $offset has an invalid frame length. + return; + } + + } else { + + // non-fatal error: Next frame is not valid. + return; + } + } + return true; + } + + + + public function FreeFormatFrameLength($fd, $offset, &$info, $deep_scan=false) { + fseek($fd, $offset, SEEK_SET); + $mpeg_audio_data = fread($fd, 32768); + + $sync_pattern1 = substr($mpeg_audio_data, 0, 4); + // may be different pattern due to padding + $sync_pattern2 = $sync_pattern1{0}.$sync_pattern1{1}.chr(ord($sync_pattern1{2}) | 0x02).$sync_pattern1{3}; + if ($sync_pattern2 === $sync_pattern1) { + $sync_pattern2 = $sync_pattern1{0}.$sync_pattern1{1}.chr(ord($sync_pattern1{2}) & 0xFD).$sync_pattern1{3}; + } + + $frame_length = false; + $frame_length1 = strpos($mpeg_audio_data, $sync_pattern1, 4); + $frame_length2 = strpos($mpeg_audio_data, $sync_pattern2, 4); + if ($frame_length1 > 4) { + $frame_length = $frame_length1; + } + if (($frame_length2 > 4) && ($frame_length2 < $frame_length1)) { + $frame_length = $frame_length2; + } + if (!$frame_length) { + + // LAME 3.88 has a different value for modeextension on the first frame vs the rest + $frame_length1 = strpos($mpeg_audio_data, substr($sync_pattern1, 0, 3), 4); + $frame_length2 = strpos($mpeg_audio_data, substr($sync_pattern2, 0, 3), 4); + + if ($frame_length1 > 4) { + $frame_length = $frame_length1; + } + if (($frame_length2 > 4) && ($frame_length2 < $frame_length1)) { + $frame_length = $frame_length2; + } + if (!$frame_length) { + throw new getid3_exception('Cannot find next free-format synch pattern ('.getid3_lib::PrintHexBytes($sync_pattern1).' or '.getid3_lib::PrintHexBytes($sync_pattern2).') after offset '.$offset); + } else { + $this->getid3->warning('ModeExtension varies between first frame and other frames (known free-format issue in LAME 3.88)'); + $info['audio']['codec'] = 'LAME'; + $info['audio']['encoder'] = 'LAME3.88'; + $sync_pattern1 = substr($sync_pattern1, 0, 3); + $sync_pattern2 = substr($sync_pattern2, 0, 3); + } + } + + if ($deep_scan) { + + $actual_frame_length_values = array (); + $next_offset = $offset + $frame_length; + while ($next_offset < ($info['avdataend'] - 6)) { + fseek($fd, $next_offset - 1, SEEK_SET); + $NextSyncPattern = fread($fd, 6); + if ((substr($NextSyncPattern, 1, strlen($sync_pattern1)) == $sync_pattern1) || (substr($NextSyncPattern, 1, strlen($sync_pattern2)) == $sync_pattern2)) { + // good - found where expected + $actual_frame_length_values[] = $frame_length; + } elseif ((substr($NextSyncPattern, 0, strlen($sync_pattern1)) == $sync_pattern1) || (substr($NextSyncPattern, 0, strlen($sync_pattern2)) == $sync_pattern2)) { + // ok - found one byte earlier than expected (last frame wasn't padded, first frame was) + $actual_frame_length_values[] = ($frame_length - 1); + $next_offset--; + } elseif ((substr($NextSyncPattern, 2, strlen($sync_pattern1)) == $sync_pattern1) || (substr($NextSyncPattern, 2, strlen($sync_pattern2)) == $sync_pattern2)) { + // ok - found one byte later than expected (last frame was padded, first frame wasn't) + $actual_frame_length_values[] = ($frame_length + 1); + $next_offset++; + } else { + throw new getid3_exception('Did not find expected free-format sync pattern at offset '.$next_offset); + } + $next_offset += $frame_length; + } + if (count($actual_frame_length_values) > 0) { + $frame_length = intval(round(array_sum($actual_frame_length_values) / count($actual_frame_length_values))); + } + } + return $frame_length; + } + + + + public function getOnlyMPEGaudioInfo($fd, &$info, $avdata_offset, $bit_rate_histogram=false) { + + // looks for synch, decodes MPEG audio header + + fseek($fd, $avdata_offset, SEEK_SET); + + $sync_seek_buffer_size = min(128 * 1024, $info['avdataend'] - $avdata_offset); + $header = fread($fd, $sync_seek_buffer_size); + $sync_seek_buffer_size = strlen($header); + $synch_seek_offset = 0; + + static $mpeg_audio_version_lookup; + static $mpeg_audio_layer_lookup; + static $mpeg_audio_bitrate_lookup; + if (empty($mpeg_audio_version_lookup)) { + $mpeg_audio_version_lookup = getid3_mp3::MPEGaudioVersionarray(); + $mpeg_audio_layer_lookup = getid3_mp3::MPEGaudioLayerarray(); + $mpeg_audio_bitrate_lookup = getid3_mp3::MPEGaudioBitratearray(); + + } + + while ($synch_seek_offset < $sync_seek_buffer_size) { + + if ((($avdata_offset + $synch_seek_offset) < $info['avdataend']) && !feof($fd)) { + + // if a synch's not found within the first 128k bytes, then give up + if ($synch_seek_offset > $sync_seek_buffer_size) { + throw new getid3_exception('Could not find valid MPEG audio synch within the first '.round($sync_seek_buffer_size / 1024).'kB'); + } + + if (feof($fd)) { + throw new getid3_exception('Could not find valid MPEG audio synch before end of file'); + } + } + + if (($synch_seek_offset + 1) >= strlen($header)) { + throw new getid3_exception('Could not find valid MPEG synch before end of file'); + } + + if (($header{$synch_seek_offset} == "\xFF") && ($header{($synch_seek_offset + 1)} > "\xE0")) { // synch detected + + if (!isset($first_frame_info) && !isset($info['mpeg']['audio'])) { + $first_frame_info = $info; + $first_frame_avdata_offset = $avdata_offset + $synch_seek_offset; + if (!getid3_mp3::decodeMPEGaudioHeader($fd, $avdata_offset + $synch_seek_offset, $first_frame_info, false)) { + // if this is the first valid MPEG-audio frame, save it in case it's a VBR header frame and there's + // garbage between this frame and a valid sequence of MPEG-audio frames, to be restored below + unset($first_frame_info); + } + } + + $dummy = $info; // only overwrite real data if valid header found + if (getid3_mp3::decodeMPEGaudioHeader($fd, $avdata_offset + $synch_seek_offset, $dummy, true)) { + $info = $dummy; + $info['avdataoffset'] = $avdata_offset + $synch_seek_offset; + + switch (@$info['fileformat']) { + case '': + case 'mp3': + $info['fileformat'] = 'mp3'; + $info['audio']['dataformat'] = 'mp3'; + break; + } + if (isset($first_frame_info['mpeg']['audio']['bitrate_mode']) && ($first_frame_info['mpeg']['audio']['bitrate_mode'] == 'vbr')) { + if (!(abs($info['audio']['bitrate'] - $first_frame_info['audio']['bitrate']) <= 1)) { + // If there is garbage data between a valid VBR header frame and a sequence + // of valid MPEG-audio frames the VBR data is no longer discarded. + $info = $first_frame_info; + $info['avdataoffset'] = $first_frame_avdata_offset; + $info['fileformat'] = 'mp3'; + $info['audio']['dataformat'] = 'mp3'; + $dummy = $info; + unset($dummy['mpeg']['audio']); + $GarbageOffsetStart = $first_frame_avdata_offset + $first_frame_info['mpeg']['audio']['framelength']; + $GarbageOffsetEnd = $avdata_offset + $synch_seek_offset; + if (getid3_mp3::decodeMPEGaudioHeader($fd, $GarbageOffsetEnd, $dummy, true, true)) { + + $info = $dummy; + $info['avdataoffset'] = $GarbageOffsetEnd; + $this->getid3->warning('apparently-valid VBR header not used because could not find '.getid3_mp3::VALID_CHECK_FRAMES.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.'), but did find valid CBR stream starting at '.$GarbageOffsetEnd); + + } else { + + $this->getid3->warning('using data from VBR header even though could not find '.getid3_mp3::VALID_CHECK_FRAMES.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.')'); + + } + } + } + if (isset($info['mpeg']['audio']['bitrate_mode']) && ($info['mpeg']['audio']['bitrate_mode'] == 'vbr') && !isset($info['mpeg']['audio']['VBR_method'])) { + // VBR file with no VBR header + $bit_rate_histogram = true; + } + + if ($bit_rate_histogram) { + + $info['mpeg']['audio']['stereo_distribution'] = array ('stereo'=>0, 'joint stereo'=>0, 'dual channel'=>0, 'mono'=>0); + $info['mpeg']['audio']['version_distribution'] = array ('1'=>0, '2'=>0, '2.5'=>0); + + if ($info['mpeg']['audio']['version'] == '1') { + if ($info['mpeg']['audio']['layer'] == 3) { + $info['mpeg']['audio']['bitrate_distribution'] = array ('free'=>0, 32000=>0, 40000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 320000=>0); + } elseif ($info['mpeg']['audio']['layer'] == 2) { + $info['mpeg']['audio']['bitrate_distribution'] = array ('free'=>0, 32000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 320000=>0, 384000=>0); + } elseif ($info['mpeg']['audio']['layer'] == 1) { + $info['mpeg']['audio']['bitrate_distribution'] = array ('free'=>0, 32000=>0, 64000=>0, 96000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 288000=>0, 320000=>0, 352000=>0, 384000=>0, 416000=>0, 448000=>0); + } + } elseif ($info['mpeg']['audio']['layer'] == 1) { + $info['mpeg']['audio']['bitrate_distribution'] = array ('free'=>0, 32000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 144000=>0, 160000=>0, 176000=>0, 192000=>0, 224000=>0, 256000=>0); + } else { + $info['mpeg']['audio']['bitrate_distribution'] = array ('free'=>0, 8000=>0, 16000=>0, 24000=>0, 32000=>0, 40000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 144000=>0, 160000=>0); + } + + $dummy = array ('avdataend' => $info['avdataend'], 'avdataoffset' => $info['avdataoffset']); + $synch_start_offset = $info['avdataoffset']; + + $fast_mode = false; + $synch_errors_found = 0; + while ($this->decodeMPEGaudioHeader($fd, $synch_start_offset, $dummy, false, false, $fast_mode)) { + $fast_mode = true; + $thisframebitrate = $mpeg_audio_bitrate_lookup[$mpeg_audio_version_lookup[$dummy['mpeg']['audio']['raw']['version']]][$mpeg_audio_layer_lookup[$dummy['mpeg']['audio']['raw']['layer']]][$dummy['mpeg']['audio']['raw']['bitrate']]; + + if (empty($dummy['mpeg']['audio']['framelength'])) { + $synch_errors_found++; + } + else { + @$info['mpeg']['audio']['bitrate_distribution'][$thisframebitrate]++; + @$info['mpeg']['audio']['stereo_distribution'][$dummy['mpeg']['audio']['channelmode']]++; + @$info['mpeg']['audio']['version_distribution'][$dummy['mpeg']['audio']['version']]++; + + $synch_start_offset += $dummy['mpeg']['audio']['framelength']; + } + } + if ($synch_errors_found > 0) { + $this->getid3->warning('Found '.$synch_errors_found.' synch errors in histogram analysis'); + } + + $bit_total = 0; + $frame_counter = 0; + foreach ($info['mpeg']['audio']['bitrate_distribution'] as $bit_rate_value => $bit_rate_count) { + $frame_counter += $bit_rate_count; + if ($bit_rate_value != 'free') { + $bit_total += ($bit_rate_value * $bit_rate_count); + } + } + if ($frame_counter == 0) { + throw new getid3_exception('Corrupt MP3 file: framecounter == zero'); + } + $info['mpeg']['audio']['frame_count'] = $frame_counter; + $info['mpeg']['audio']['bitrate'] = ($bit_total / $frame_counter); + + $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate']; + + + // Definitively set VBR vs CBR, even if the Xing/LAME/VBRI header says differently + $distinct_bit_rates = 0; + foreach ($info['mpeg']['audio']['bitrate_distribution'] as $bit_rate_value => $bit_rate_count) { + if ($bit_rate_count > 0) { + $distinct_bit_rates++; + } + } + if ($distinct_bit_rates > 1) { + $info['mpeg']['audio']['bitrate_mode'] = 'vbr'; + } else { + $info['mpeg']['audio']['bitrate_mode'] = 'cbr'; + } + $info['audio']['bitrate_mode'] = $info['mpeg']['audio']['bitrate_mode']; + + } + + break; // exit while() + } + } + + $synch_seek_offset++; + if (($avdata_offset + $synch_seek_offset) >= $info['avdataend']) { + // end of file/data + + if (empty($info['mpeg']['audio'])) { + + throw new getid3_exception('could not find valid MPEG synch before end of file'); + } + break; + } + + } + + $info['audio']['channels'] = $info['mpeg']['audio']['channels']; + $info['audio']['channelmode'] = $info['mpeg']['audio']['channelmode']; + $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; + return true; + } + + + + public static function MPEGaudioVersionarray() { + + static $array = array ('2.5', false, '2', '1'); + return $array; + } + + + + public static function MPEGaudioLayerarray() { + + static $array = array (false, 3, 2, 1); + return $array; + } + + + + public static function MPEGaudioBitratearray() { + + static $array; + if (empty($array)) { + $array = array ( + '1' => array (1 => array ('free', 32000, 64000, 96000, 128000, 160000, 192000, 224000, 256000, 288000, 320000, 352000, 384000, 416000, 448000), + 2 => array ('free', 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000, 384000), + 3 => array ('free', 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000) + ), + + '2' => array (1 => array ('free', 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000, 176000, 192000, 224000, 256000), + 2 => array ('free', 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000), + ) + ); + $array['2'][3] = $array['2'][2]; + $array['2.5'] = $array['2']; + } + return $array; + } + + + + public static function MPEGaudioFrequencyarray() { + + static $array = array ( + '1' => array (44100, 48000, 32000), + '2' => array (22050, 24000, 16000), + '2.5' => array (11025, 12000, 8000) + ); + return $array; + } + + + + public static function MPEGaudioChannelModearray() { + + static $array = array ('stereo', 'joint stereo', 'dual channel', 'mono'); + return $array; + } + + + + public static function MPEGaudioModeExtensionarray() { + + static $array = array ( + 1 => array ('4-31', '8-31', '12-31', '16-31'), + 2 => array ('4-31', '8-31', '12-31', '16-31'), + 3 => array ('', 'IS', 'MS', 'IS+MS') + ); + return $array; + } + + + + public static function MPEGaudioEmphasisarray() { + + static $array = array ('none', '50/15ms', false, 'CCIT J.17'); + return $array; + } + + + + public static function MPEGaudioHeaderBytesValid($head4, $allow_bitrate_15=false) { + + return getid3_mp3::MPEGaudioHeaderValid(getid3_mp3::MPEGaudioHeaderDecode($head4), false, $allow_bitrate_15); + } + + + + public static function MPEGaudioHeaderValid($raw_array, $echo_errors=false, $allow_bitrate_15=false) { + + if (($raw_array['synch'] & 0x0FFE) != 0x0FFE) { + return false; + } + + static $mpeg_audio_version_lookup; + static $mpeg_audio_layer_lookup; + static $mpeg_audio_bitrate_lookup; + static $mpeg_audio_frequency_lookup; + static $mpeg_audio_channel_mode_lookup; + static $mpeg_audio_mode_extension_lookup; + static $mpeg_audio_emphasis_lookup; + if (empty($mpeg_audio_version_lookup)) { + $mpeg_audio_version_lookup = getid3_mp3::MPEGaudioVersionarray(); + $mpeg_audio_layer_lookup = getid3_mp3::MPEGaudioLayerarray(); + $mpeg_audio_bitrate_lookup = getid3_mp3::MPEGaudioBitratearray(); + $mpeg_audio_frequency_lookup = getid3_mp3::MPEGaudioFrequencyarray(); + $mpeg_audio_channel_mode_lookup = getid3_mp3::MPEGaudioChannelModearray(); + $mpeg_audio_mode_extension_lookup = getid3_mp3::MPEGaudioModeExtensionarray(); + $mpeg_audio_emphasis_lookup = getid3_mp3::MPEGaudioEmphasisarray(); + } + + if (isset($mpeg_audio_version_lookup[$raw_array['version']])) { + $decodedVersion = $mpeg_audio_version_lookup[$raw_array['version']]; + } else { + echo ($echo_errors ? "\n".'invalid Version ('.$raw_array['version'].')' : ''); + return false; + } + if (isset($mpeg_audio_layer_lookup[$raw_array['layer']])) { + $decodedLayer = $mpeg_audio_layer_lookup[$raw_array['layer']]; + } else { + echo ($echo_errors ? "\n".'invalid Layer ('.$raw_array['layer'].')' : ''); + return false; + } + if (!isset($mpeg_audio_bitrate_lookup[$decodedVersion][$decodedLayer][$raw_array['bitrate']])) { + echo ($echo_errors ? "\n".'invalid Bitrate ('.$raw_array['bitrate'].')' : ''); + if ($raw_array['bitrate'] == 15) { + // known issue in LAME 3.90 - 3.93.1 where free-format has bitrate ID of 15 instead of 0 + // let it go through here otherwise file will not be identified + if (!$allow_bitrate_15) { + return false; + } + } else { + return false; + } + } + if (!isset($mpeg_audio_frequency_lookup[$decodedVersion][$raw_array['sample_rate']])) { + echo ($echo_errors ? "\n".'invalid Frequency ('.$raw_array['sample_rate'].')' : ''); + return false; + } + if (!isset($mpeg_audio_channel_mode_lookup[$raw_array['channelmode']])) { + echo ($echo_errors ? "\n".'invalid ChannelMode ('.$raw_array['channelmode'].')' : ''); + return false; + } + if (!isset($mpeg_audio_mode_extension_lookup[$decodedLayer][$raw_array['modeextension']])) { + echo ($echo_errors ? "\n".'invalid Mode Extension ('.$raw_array['modeextension'].')' : ''); + return false; + } + if (!isset($mpeg_audio_emphasis_lookup[$raw_array['emphasis']])) { + echo ($echo_errors ? "\n".'invalid Emphasis ('.$raw_array['emphasis'].')' : ''); + return false; + } + // These are just either set or not set, you can't mess that up :) + // $raw_array['protection']; + // $raw_array['padding']; + // $raw_array['private']; + // $raw_array['copyright']; + // $raw_array['original']; + + return true; + } + + + + public static function MPEGaudioHeaderDecode($header_four_bytes) { + // AAAA AAAA AAAB BCCD EEEE FFGH IIJJ KLMM + // A - Frame sync (all bits set) + // B - MPEG Audio version ID + // C - Layer description + // D - Protection bit + // E - Bitrate index + // F - Sampling rate frequency index + // G - Padding bit + // H - Private bit + // I - Channel Mode + // J - Mode extension (Only if Joint stereo) + // K - Copyright + // L - Original + // M - Emphasis + + if (strlen($header_four_bytes) != 4) { + return false; + } + + $mpeg_raw_header['synch'] = (getid3_lib::BigEndian2Int(substr($header_four_bytes, 0, 2)) & 0xFFE0) >> 4; + $mpeg_raw_header['version'] = (ord($header_four_bytes{1}) & 0x18) >> 3; // BB + $mpeg_raw_header['layer'] = (ord($header_four_bytes{1}) & 0x06) >> 1; // CC + $mpeg_raw_header['protection'] = (ord($header_four_bytes{1}) & 0x01); // D + $mpeg_raw_header['bitrate'] = (ord($header_four_bytes{2}) & 0xF0) >> 4; // EEEE + $mpeg_raw_header['sample_rate'] = (ord($header_four_bytes{2}) & 0x0C) >> 2; // FF + $mpeg_raw_header['padding'] = (ord($header_four_bytes{2}) & 0x02) >> 1; // G + $mpeg_raw_header['private'] = (ord($header_four_bytes{2}) & 0x01); // H + $mpeg_raw_header['channelmode'] = (ord($header_four_bytes{3}) & 0xC0) >> 6; // II + $mpeg_raw_header['modeextension'] = (ord($header_four_bytes{3}) & 0x30) >> 4; // JJ + $mpeg_raw_header['copyright'] = (ord($header_four_bytes{3}) & 0x08) >> 3; // K + $mpeg_raw_header['original'] = (ord($header_four_bytes{3}) & 0x04) >> 2; // L + $mpeg_raw_header['emphasis'] = (ord($header_four_bytes{3}) & 0x03); // MM + + return $mpeg_raw_header; + } + + + + public static function MPEGaudioFrameLength(&$bit_rate, &$version, &$layer, $padding, &$sample_rate) { + + if (!isset($cache[$bit_rate][$version][$layer][$padding][$sample_rate])) { + $cache[$bit_rate][$version][$layer][$padding][$sample_rate] = false; + if ($bit_rate != 'free') { + + if ($version == '1') { + + if ($layer == '1') { + + // For Layer I slot is 32 bits long + $frame_length_coefficient = 48; + $slot_length = 4; + + } else { // Layer 2 / 3 + + // for Layer 2 and Layer 3 slot is 8 bits long. + $frame_length_coefficient = 144; + $slot_length = 1; + + } + + } else { // MPEG-2 / MPEG-2.5 + + if ($layer == '1') { + + // For Layer I slot is 32 bits long + $frame_length_coefficient = 24; + $slot_length = 4; + + } elseif ($layer == '2') { + + // for Layer 2 and Layer 3 slot is 8 bits long. + $frame_length_coefficient = 144; + $slot_length = 1; + + } else { // layer 3 + + // for Layer 2 and Layer 3 slot is 8 bits long. + $frame_length_coefficient = 72; + $slot_length = 1; + + } + + } + + // FrameLengthInBytes = ((Coefficient * BitRate) / SampleRate) + Padding + if ($sample_rate > 0) { + $new_frame_length = ($frame_length_coefficient * $bit_rate) / $sample_rate; + $new_frame_length = floor($new_frame_length / $slot_length) * $slot_length; // round to next-lower multiple of SlotLength (1 byte for Layer 2/3, 4 bytes for Layer I) + if ($padding) { + $new_frame_length += $slot_length; + } + $cache[$bit_rate][$version][$layer][$padding][$sample_rate] = (int) $new_frame_length; + } + } + } + return $cache[$bit_rate][$version][$layer][$padding][$sample_rate]; + } + + + + public static function ClosestStandardMP3Bitrate($bit_rate) { + + static $standard_bit_rates = array (320000, 256000, 224000, 192000, 160000, 128000, 112000, 96000, 80000, 64000, 56000, 48000, 40000, 32000, 24000, 16000, 8000); + static $bit_rate_table = array (0=>'-'); + $round_bit_rate = intval(round($bit_rate, -3)); + if (!isset($bit_rate_table[$round_bit_rate])) { + if ($round_bit_rate > 320000) { + $bit_rate_table[$round_bit_rate] = round($bit_rate, -4); + } else { + $last_bit_rate = 320000; + foreach ($standard_bit_rates as $standard_bit_rate) { + $bit_rate_table[$round_bit_rate] = $standard_bit_rate; + if ($round_bit_rate >= $standard_bit_rate - (($last_bit_rate - $standard_bit_rate) / 2)) { + break; + } + $last_bit_rate = $standard_bit_rate; + } + } + } + return $bit_rate_table[$round_bit_rate]; + } + + + + public static function XingVBRidOffset($version, $channel_mode) { + + static $lookup = array ( + '1' => array ('mono' => 0x15, // 4 + 17 = 21 + 'stereo' => 0x24, // 4 + 32 = 36 + 'joint stereo' => 0x24, + 'dual channel' => 0x24 + ), + + '2' => array ('mono' => 0x0D, // 4 + 9 = 13 + 'stereo' => 0x15, // 4 + 17 = 21 + 'joint stereo' => 0x15, + 'dual channel' => 0x15 + ), + + '2.5' => array ('mono' => 0x15, + 'stereo' => 0x15, + 'joint stereo' => 0x15, + 'dual channel' => 0x15 + ) + ); + + return $lookup[$version][$channel_mode]; + } + + + + public static function LAMEvbrMethodLookup($vbr_method_id) { + + static $lookup = array ( + 0x00 => 'unknown', + 0x01 => 'cbr', + 0x02 => 'abr', + 0x03 => 'vbr-old / vbr-rh', + 0x04 => 'vbr-new / vbr-mtrh', + 0x05 => 'vbr-mt', + 0x06 => 'Full VBR Method 4', + 0x08 => 'constant bitrate 2 pass', + 0x09 => 'abr 2 pass', + 0x0F => 'reserved' + ); + return (isset($lookup[$vbr_method_id]) ? $lookup[$vbr_method_id] : ''); + } + + + + public static function LAMEmiscStereoModeLookup($stereo_mode_id) { + + static $lookup = array ( + 0 => 'mono', + 1 => 'stereo', + 2 => 'dual mono', + 3 => 'joint stereo', + 4 => 'forced stereo', + 5 => 'auto', + 6 => 'intensity stereo', + 7 => 'other' + ); + return (isset($lookup[$stereo_mode_id]) ? $lookup[$stereo_mode_id] : ''); + } + + + + public static function LAMEmiscSourceSampleFrequencyLookup($source_sample_frequency_id) { + + static $lookup = array ( + 0 => '<= 32 kHz', + 1 => '44.1 kHz', + 2 => '48 kHz', + 3 => '> 48kHz' + ); + return (isset($lookup[$source_sample_frequency_id]) ? $lookup[$source_sample_frequency_id] : ''); + } + + + + public static function LAMEsurroundInfoLookup($surround_info_id) { + + static $lookup = array ( + 0 => 'no surround info', + 1 => 'DPL encoding', + 2 => 'DPL2 encoding', + 3 => 'Ambisonic encoding' + ); + return (isset($lookup[$surround_info_id]) ? $lookup[$surround_info_id] : 'reserved'); + } + + + + public static function LAMEpresetUsedLookup($lame_tag) { + + if ($lame_tag['preset_used_id'] == 0) { + // no preset used (LAME >=3.93) + // no preset recorded (LAME <3.93) + return ''; + } + + $lame_preset_used_lookup = array (); + + for ($i = 8; $i <= 320; $i++) { + switch ($lame_tag['vbr_method']) { + case 'cbr': + $lame_preset_used_lookup[$i] = '--alt-preset '.$lame_tag['vbr_method'].' '.$i; + break; + case 'abr': + default: // other VBR modes shouldn't be here(?) + $lame_preset_used_lookup[$i] = '--alt-preset '.$i; + break; + } + } + + // named old-style presets (studio, phone, voice, etc) are handled in GuessEncoderOptions() + + // named alt-presets + $lame_preset_used_lookup[1000] = '--r3mix'; + $lame_preset_used_lookup[1001] = '--alt-preset standard'; + $lame_preset_used_lookup[1002] = '--alt-preset extreme'; + $lame_preset_used_lookup[1003] = '--alt-preset insane'; + $lame_preset_used_lookup[1004] = '--alt-preset fast standard'; + $lame_preset_used_lookup[1005] = '--alt-preset fast extreme'; + $lame_preset_used_lookup[1006] = '--alt-preset medium'; + $lame_preset_used_lookup[1007] = '--alt-preset fast medium'; + + // LAME 3.94 additions/changes + $lame_preset_used_lookup[1010] = '--preset portable'; // 3.94a15 Oct 21 2003 + $lame_preset_used_lookup[1015] = '--preset radio'; // 3.94a15 Oct 21 2003 + + $lame_preset_used_lookup[320] = '--preset insane'; // 3.94a15 Nov 12 2003 + $lame_preset_used_lookup[410] = '-V9'; + $lame_preset_used_lookup[420] = '-V8'; + $lame_preset_used_lookup[430] = '--preset radio'; // 3.94a15 Nov 12 2003 + $lame_preset_used_lookup[440] = '-V6'; + $lame_preset_used_lookup[450] = '--preset '.(($lame_tag['raw']['vbr_method'] == 4) ? 'fast ' : '').'portable'; // 3.94a15 Nov 12 2003 + $lame_preset_used_lookup[460] = '--preset '.(($lame_tag['raw']['vbr_method'] == 4) ? 'fast ' : '').'medium'; // 3.94a15 Nov 12 2003 + $lame_preset_used_lookup[470] = '--r3mix'; // 3.94b1 Dec 18 2003 + $lame_preset_used_lookup[480] = '--preset '.(($lame_tag['raw']['vbr_method'] == 4) ? 'fast ' : '').'standard'; // 3.94a15 Nov 12 2003 + $lame_preset_used_lookup[490] = '-V1'; + $lame_preset_used_lookup[500] = '--preset '.(($lame_tag['raw']['vbr_method'] == 4) ? 'fast ' : '').'extreme'; // 3.94a15 Nov 12 2003 + + return (isset($lame_preset_used_lookup[$lame_tag['preset_used_id']]) ? $lame_preset_used_lookup[$lame_tag['preset_used_id']] : 'new/unknown preset: '.$lame_tag['preset_used_id'].' - report to info@getid3.org'); + } + + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.mpc.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.mpc.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.mpc.php 3 Jan 2016 20:51:43 -0000 1.1.2.1 @@ -0,0 +1,211 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.mpc.php | +// | Module for analyzing Musepack/MPEG+ Audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.mpc.php,v 1.1.2.1 2016/01/03 20:51:43 gustafn Exp $ + + + +class getid3_mpc extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + // http://www.uni-jena.de/~pfk/mpp/sv8/header.html + + $getid3->info['fileformat'] = 'mpc'; + $getid3->info['audio']['dataformat'] = 'mpc'; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + $getid3->info['audio']['channels'] = 2; // the format appears to be hardcoded for stereo only + $getid3->info['audio']['lossless'] = false; + + $getid3->info['mpc']['header'] = array (); + $info_mpc_header = &$getid3->info['mpc']['header']; + $info_mpc_header['size'] = 28; + $info_mpc_header['raw']['preamble'] = 'MP+'; // Magic bytes + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $mpc_header_data = fread($getid3->fp, 28); + + $stream_version_byte = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 3, 1)); + $info_mpc_header['stream_major_version'] = ($stream_version_byte & 0x0F); + $info_mpc_header['stream_minor_version'] = ($stream_version_byte & 0xF0) >> 4; + if ($info_mpc_header['stream_major_version'] != 7) { + throw new getid3_exception('Only Musepack SV7 supported'); + } + + $info_mpc_header['frame_count'] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 4, 4)); + + $info_mpc_header['raw']['title_peak'] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 12, 2)); + $info_mpc_header['raw']['title_gain'] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 14, 2), true); + $info_mpc_header['raw']['album_peak'] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 16, 2)); + $info_mpc_header['raw']['album_gain'] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 18, 2), true); + + $info_mpc_header['raw']['not_sure_what'] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 24, 3)); + $info_mpc_header['raw']['encoder_version'] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 27, 1)); + + $flags_dword1 = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 8, 4)); + $flags_dword2 = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 20, 4)); + + $info_mpc_header['intensity_stereo'] = (bool)(($flags_dword1 & 0x80000000) >> 31); + $info_mpc_header['mid_side_stereo'] = (bool)(($flags_dword1 & 0x40000000) >> 30); + $info_mpc_header['max_subband'] = ($flags_dword1 & 0x3F000000) >> 24; + $info_mpc_header['raw']['profile'] = ($flags_dword1 & 0x00F00000) >> 20; + $info_mpc_header['begin_loud'] = (bool)(($flags_dword1 & 0x00080000) >> 19); + $info_mpc_header['end_loud'] = (bool)(($flags_dword1 & 0x00040000) >> 18); + $info_mpc_header['raw']['sample_rate'] = ($flags_dword1 & 0x00030000) >> 16; + $info_mpc_header['max_level'] = ($flags_dword1 & 0x0000FFFF); + + $info_mpc_header['true_gapless'] = (bool)(($flags_dword2 & 0x80000000) >> 31); + $info_mpc_header['last_frame_length'] = ($flags_dword2 & 0x7FF00000) >> 20; + + $info_mpc_header['profile'] = getid3_mpc::MPCprofileNameLookup($info_mpc_header['raw']['profile']); + $info_mpc_header['sample_rate'] = getid3_mpc::MPCfrequencyLookup($info_mpc_header['raw']['sample_rate']); + $getid3->info['audio']['sample_rate'] = $info_mpc_header['sample_rate']; + $info_mpc_header['samples'] = ((($info_mpc_header['frame_count'] - 1) * 1152) + $info_mpc_header['last_frame_length']) * $getid3->info['audio']['channels']; + + $getid3->info['playtime_seconds'] = ($info_mpc_header['samples'] / $getid3->info['audio']['channels']) / $getid3->info['audio']['sample_rate']; + + $getid3->info['avdataoffset'] += $info_mpc_header['size']; + + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + + $info_mpc_header['title_peak'] = $info_mpc_header['raw']['title_peak']; + $info_mpc_header['title_peak_db'] = getid3_mpc::MPCpeakDBLookup($info_mpc_header['title_peak']); + if ($info_mpc_header['raw']['title_gain'] < 0) { + $info_mpc_header['title_gain_db'] = (float)(32768 + $info_mpc_header['raw']['title_gain']) / -100; + } + else { + $info_mpc_header['title_gain_db'] = (float)$info_mpc_header['raw']['title_gain'] / 100; + } + + $info_mpc_header['album_peak'] = $info_mpc_header['raw']['album_peak']; + $info_mpc_header['album_peak_db'] = getid3_mpc::MPCpeakDBLookup($info_mpc_header['album_peak']); + if ($info_mpc_header['raw']['album_gain'] < 0) { + $info_mpc_header['album_gain_db'] = (float)(32768 + $info_mpc_header['raw']['album_gain']) / -100; + } + else { + $info_mpc_header['album_gain_db'] = (float)$info_mpc_header['raw']['album_gain'] / 100;; + } + $info_mpc_header['encoder_version'] = getid3_mpc::MPCencoderVersionLookup($info_mpc_header['raw']['encoder_version']); + + $getid3->info['replay_gain']['track']['adjustment'] = $info_mpc_header['title_gain_db']; + $getid3->info['replay_gain']['album']['adjustment'] = $info_mpc_header['album_gain_db']; + + if ($info_mpc_header['title_peak'] > 0) { + $getid3->info['replay_gain']['track']['peak'] = $info_mpc_header['title_peak']; + } + elseif (round($info_mpc_header['max_level'] * 1.18) > 0) { + $getid3->info['replay_gain']['track']['peak'] = (int)(round($info_mpc_header['max_level'] * 1.18)); // why? I don't know - see mppdec.c + } + if ($info_mpc_header['album_peak'] > 0) { + $getid3->info['replay_gain']['album']['peak'] = $info_mpc_header['album_peak']; + } + + $getid3->info['audio']['encoder'] = $info_mpc_header['encoder_version']; + $getid3->info['audio']['encoder_options'] = $info_mpc_header['profile']; + + return true; + } + + + + public static function MPCprofileNameLookup($profileid) { + + static $lookup = array ( + 0 => 'no profile', + 1 => 'Experimental', + 2 => 'unused', + 3 => 'unused', + 4 => 'unused', + 5 => 'below Telephone (q = 0.0)', + 6 => 'below Telephone (q = 1.0)', + 7 => 'Telephone (q = 2.0)', + 8 => 'Thumb (q = 3.0)', + 9 => 'Radio (q = 4.0)', + 10 => 'Standard (q = 5.0)', + 11 => 'Extreme (q = 6.0)', + 12 => 'Insane (q = 7.0)', + 13 => 'BrainDead (q = 8.0)', + 14 => 'above BrainDead (q = 9.0)', + 15 => 'above BrainDead (q = 10.0)' + ); + return (isset($lookup[$profileid]) ? $lookup[$profileid] : 'invalid'); + } + + + + public static function MPCfrequencyLookup($frequencyid) { + + static $lookup = array ( + 0 => 44100, + 1 => 48000, + 2 => 37800, + 3 => 32000 + ); + return (isset($lookup[$frequencyid]) ? $lookup[$frequencyid] : 'invalid'); + } + + + + public static function MPCpeakDBLookup($int_value) { + + if ($int_value > 0) { + return ((log10($int_value) / log10(2)) - 15) * 6; + } + return false; + } + + + + public static function MPCencoderVersionLookup($encoder_version) { + + //Encoder version * 100 (106 = 1.06) + //EncoderVersion % 10 == 0 Release (1.0) + //EncoderVersion % 2 == 0 Beta (1.06) + //EncoderVersion % 2 == 1 Alpha (1.05a...z) + + if ($encoder_version == 0) { + // very old version, not known exactly which + return 'Buschmann v1.7.0-v1.7.9 or Klemm v0.90-v1.05'; + } + + if (($encoder_version % 10) == 0) { + + // release version + return number_format($encoder_version / 100, 2); + + } elseif (($encoder_version % 2) == 0) { + + // beta version + return number_format($encoder_version / 100, 2).' beta'; + + } + + // alpha version + return number_format($encoder_version / 100, 2).' alpha'; + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.mpc_old.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.mpc_old.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.mpc_old.php 3 Jan 2016 20:51:43 -0000 1.1.2.1 @@ -0,0 +1,107 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.mpc_old.php | +// | Module for analyzing Musepack/MPEG+ Audio files - SV4-SV6 | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.mpc_old.php,v 1.1.2.1 2016/01/03 20:51:43 gustafn Exp $ + + + +class getid3_mpc_old extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + // http://www.uni-jena.de/~pfk/mpp/sv8/header.html + + $getid3->info['mpc']['header'] = array (); + $info_mpc_header = &$getid3->info['mpc']['header']; + + $getid3->info['fileformat'] = 'mpc'; + $getid3->info['audio']['dataformat'] = 'mpc'; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + $getid3->info['audio']['channels'] = 2; // the format appears to be hardcoded for stereo only + $getid3->info['audio']['lossless'] = false; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + $info_mpc_header['size'] = 8; + $getid3->info['avdataoffset'] += $info_mpc_header['size']; + + $mpc_header_data = fread($getid3->fp, $info_mpc_header['size']); + + + // Most of this code adapted from Jurgen Faul's MPEGplus source code - thanks Jurgen! :) + $header_dword[0] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 0, 4)); + $header_dword[1] = getid3_lib::LittleEndian2Int(substr($mpc_header_data, 4, 4)); + + + // DDDD DDDD CCCC CCCC BBBB BBBB AAAA AAAA + // aaaa aaaa abcd dddd dddd deee eeff ffff + // + // a = bitrate = anything + // b = IS = anything + // c = MS = anything + // d = streamversion = 0000000004 or 0000000005 or 0000000006 + // e = maxband = anything + // f = blocksize = 000001 for SV5+, anything(?) for SV4 + + $info_mpc_header['target_bitrate'] = (($header_dword[0] & 0xFF800000) >> 23); + $info_mpc_header['intensity_stereo'] = (bool)(($header_dword[0] & 0x00400000) >> 22); + $info_mpc_header['mid-side_stereo'] = (bool)(($header_dword[0] & 0x00200000) >> 21); + $info_mpc_header['stream_major_version'] = ($header_dword[0] & 0x001FF800) >> 11; + $info_mpc_header['stream_minor_version'] = 0; + $info_mpc_header['max_band'] = ($header_dword[0] & 0x000007C0) >> 6; // related to lowpass frequency, not sure how it translates exactly + $info_mpc_header['block_size'] = ($header_dword[0] & 0x0000003F); + + switch ($info_mpc_header['stream_major_version']) { + case 4: + $info_mpc_header['frame_count'] = ($header_dword[1] >> 16); + break; + case 5: + case 6: + $info_mpc_header['frame_count'] = $header_dword[1]; + break; + + default: + throw new getid3_exception('Expecting 4, 5 or 6 in version field, found '.$info_mpc_header['stream_major_version'].' instead'); + } + + if (($info_mpc_header['stream_major_version'] > 4) && ($info_mpc_header['block_size'] != 1)) { + $getid3->warning('Block size expected to be 1, actual value found: '.$info_mpc_header['block_size']); + } + + $info_mpc_header['sample_rate'] = $getid3->info['audio']['sample_rate'] = 44100; // AB: used by all files up to SV7 + $info_mpc_header['samples'] = $info_mpc_header['frame_count'] * 1152 * $getid3->info['audio']['channels']; + + $getid3->info['audio']['bitrate_mode'] = $info_mpc_header['target_bitrate'] == 0 ? 'vbr' : 'cbr'; + + $getid3->info['mpc']['bitrate'] = ($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8 * 44100 / $info_mpc_header['frame_count'] / 1152; + $getid3->info['audio']['bitrate'] = $getid3->info['mpc']['bitrate']; + $getid3->info['audio']['encoder'] = 'SV'.$info_mpc_header['stream_major_version']; + + return true; + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.optimfrog.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.optimfrog.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.optimfrog.php 3 Jan 2016 20:51:43 -0000 1.1.2.1 @@ -0,0 +1,468 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.optimfrog.php | +// | Module for analyzing OptimFROG Audio files | +// | dependencies: module.audio-video.riff.php | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.optimfrog.php,v 1.1.2.1 2016/01/03 20:51:43 gustafn Exp $ + + + +class getid3_optimfrog extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->include_module('audio-video.riff'); + + $getid3->info['audio']['dataformat'] = 'ofr'; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + $getid3->info['audio']['lossless'] = true; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $ofr_header = fread($getid3->fp, 8); + + if (substr($ofr_header, 0, 5) == '*RIFF') { + return $this->ParseOptimFROGheader42($getid3->fp, $getid3->info); + + } elseif (substr($ofr_header, 0, 3) == 'OFR') { + return $this->ParseOptimFROGheader45($getid3->fp, $getid3->info); + } + + throw new getid3_exception('Expecting "*RIFF" or "OFR " at offset '.$getid3->info['avdataoffset'].', found "'.$ofr_header.'"'); + } + + + + private function ParseOptimFROGheader42() { + + $getid3 = $this->getid3; + + // for fileformat of v4.21 and older + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + $ofr_header_data = fread($getid3->fp, 45); + $getid3->info['avdataoffset'] = 45; + + $ofr_encoder_version_raw = getid3_lib::LittleEndian2Int(substr($ofr_header_data, 0, 1)); + $ofr_encoder_version_major = floor($ofr_encoder_version_raw / 10); + $ofr_encoder_version_minor = $ofr_encoder_version_raw - ($ofr_encoder_version_major * 10); + $riff_data = substr($ofr_header_data, 1, 44); + $origna_riff_header_size = getid3_lib::LittleEndian2Int(substr($riff_data, 4, 4)) + 8; + $origna_riff_data_size = getid3_lib::LittleEndian2Int(substr($riff_data, 40, 4)) + 44; + + if ($origna_riff_header_size > $origna_riff_data_size) { + $getid3->info['avdataend'] -= ($origna_riff_header_size - $origna_riff_data_size); + fseek($getid3->fp, $getid3->info['avdataend'], SEEK_SET); + $riff_data .= fread($getid3->fp, $origna_riff_header_size - $origna_riff_data_size); + } + + // move the data chunk after all other chunks (if any) + // so that the RIFF parser doesn't see EOF when trying + // to skip over the data chunk + + $riff_data = substr($riff_data, 0, 36).substr($riff_data, 44).substr($riff_data, 36, 8); + + // Save audio info key + $saved_info_audio = $getid3->info['audio']; + + // Instantiate riff module and analyze string + $riff = new getid3_riff($getid3); + $riff->AnalyzeString($riff_data); + + // Restore info key + $getid3->info['audio'] = $saved_info_audio; + + $getid3->info['audio']['encoder'] = 'OptimFROG '.$ofr_encoder_version_major.'.'.$ofr_encoder_version_minor; + $getid3->info['audio']['channels'] = $getid3->info['riff']['audio'][0]['channels']; + $getid3->info['audio']['sample_rate'] = $getid3->info['riff']['audio'][0]['sample_rate']; + $getid3->info['audio']['bits_per_sample'] = $getid3->info['riff']['audio'][0]['bits_per_sample']; + $getid3->info['playtime_seconds'] = $origna_riff_data_size / ($getid3->info['audio']['channels'] * $getid3->info['audio']['sample_rate'] * ($getid3->info['audio']['bits_per_sample'] / 8)); + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + + $getid3->info['fileformat'] = 'ofr'; + + return true; + } + + + + private function ParseOptimFROGheader45() { + + $getid3 = $this->getid3; + + // for fileformat of v4.50a and higher + + $riff_data = ''; + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + while (!feof($getid3->fp) && (ftell($getid3->fp) < $getid3->info['avdataend'])) { + + $block_offset = ftell($getid3->fp); + $block_data = fread($getid3->fp, 8); + $offset = 8; + $block_name = substr($block_data, 0, 4); + $block_size = getid3_lib::LittleEndian2Int(substr($block_data, 4, 4)); + + if ($block_name == 'OFRX') { + $block_name = 'OFR '; + } + if (!isset($getid3->info['ofr'][$block_name])) { + $getid3->info['ofr'][$block_name] = array (); + } + $info_ofr_this_block = &$getid3->info['ofr'][$block_name]; + + switch ($block_name) { + case 'OFR ': + + // shortcut + $info_ofr_this_block['offset'] = $block_offset; + $info_ofr_this_block['size'] = $block_size; + + $getid3->info['audio']['encoder'] = 'OptimFROG 4.50 alpha'; + switch ($block_size) { + case 12: + case 15: + // good + break; + + default: + $getid3->warning('"'.$block_name.'" contains more data than expected (expected 12 or 15 bytes, found '.$block_size.' bytes)'); + break; + } + $block_data .= fread($getid3->fp, $block_size); + + $info_ofr_this_block['total_samples'] = getid3_lib::LittleEndian2Int(substr($block_data, $offset, 6)); + $offset += 6; + + $info_ofr_this_block['raw']['sample_type'] = getid3_lib::LittleEndian2Int($block_data{$offset++}); + $info_ofr_this_block['sample_type'] = $this->OptimFROGsampleTypeLookup($info_ofr_this_block['raw']['sample_type']); + + $info_ofr_this_block['channel_config'] = getid3_lib::LittleEndian2Int($block_data{$offset++}); + $info_ofr_this_block['channels'] = $info_ofr_this_block['channel_config']; + + $info_ofr_this_block['sample_rate'] = getid3_lib::LittleEndian2Int(substr($block_data, $offset, 4)); + $offset += 4; + + if ($block_size > 12) { + + // OFR 4.504b or higher + $info_ofr_this_block['channels'] = $this->OptimFROGchannelConfigNumChannelsLookup($info_ofr_this_block['channel_config']); + $info_ofr_this_block['raw']['encoder_id'] = getid3_lib::LittleEndian2Int(substr($block_data, $offset, 2)); + $info_ofr_this_block['encoder'] = $this->OptimFROGencoderNameLookup($info_ofr_this_block['raw']['encoder_id']); + $offset += 2; + + $info_ofr_this_block['raw']['compression'] = getid3_lib::LittleEndian2Int($block_data{$offset++}); + $info_ofr_this_block['compression'] = $this->OptimFROGcompressionLookup($info_ofr_this_block['raw']['compression']); + $info_ofr_this_block['speedup'] = $this->OptimFROGspeedupLookup($info_ofr_this_block['raw']['compression']); + + $getid3->info['audio']['encoder'] = 'OptimFROG '.$info_ofr_this_block['encoder']; + $getid3->info['audio']['encoder_options'] = '--mode '.$info_ofr_this_block['compression']; + + if ((($info_ofr_this_block['raw']['encoder_id'] & 0xF0) >> 4) == 7) { // v4.507 + if (preg_match('/\.ofs$/i', $getid3->filename)) { + // OptimFROG DualStream format is lossy, but as of v4.507 there is no way to tell the difference + // between lossless and lossy other than the file extension. + $getid3->info['audio']['dataformat'] = 'ofs'; + $getid3->info['audio']['lossless'] = true; + } + } + } + + $getid3->info['audio']['channels'] = $info_ofr_this_block['channels']; + $getid3->info['audio']['sample_rate'] = $info_ofr_this_block['sample_rate']; + $getid3->info['audio']['bits_per_sample'] = $this->OptimFROGbitsPerSampleTypeLookup($info_ofr_this_block['raw']['sample_type']); + break; + + + case 'COMP': + // unlike other block types, there CAN be multiple COMP blocks + + $comp_data['offset'] = $block_offset; + $comp_data['size'] = $block_size; + + if ($getid3->info['avdataoffset'] == 0) { + $getid3->info['avdataoffset'] = $block_offset; + } + + // Only interested in first 14 bytes (only first 12 needed for v4.50 alpha), not actual audio data + $block_data .= fread($getid3->fp, 14); + fseek($getid3->fp, $block_size - 14, SEEK_CUR); + + $comp_data['crc_32'] = getid3_lib::LittleEndian2Int(substr($block_data, $offset, 4)); + $offset += 4; + + $comp_data['sample_count'] = getid3_lib::LittleEndian2Int(substr($block_data, $offset, 4)); + $offset += 4; + + $comp_data['raw']['sample_type'] = getid3_lib::LittleEndian2Int($block_data{$offset++}); + $comp_data['sample_type'] = $this->OptimFROGsampleTypeLookup($comp_data['raw']['sample_type']); + + $comp_data['raw']['channel_configuration'] = getid3_lib::LittleEndian2Int($block_data{$offset++}); + $comp_data['channel_configuration'] = $this->OptimFROGchannelConfigurationLookup($comp_data['raw']['channel_configuration']); + + $comp_data['raw']['algorithm_id'] = getid3_lib::LittleEndian2Int(substr($block_data, $offset, 2)); + $offset += 2; + + if ($getid3->info['ofr']['OFR ']['size'] > 12) { + + // OFR 4.504b or higher + $comp_data['raw']['encoder_id'] = getid3_lib::LittleEndian2Int(substr($block_data, $offset, 2)); + $comp_data['encoder'] = $this->OptimFROGencoderNameLookup($comp_data['raw']['encoder_id']); + $offset += 2; + } + + if ($comp_data['crc_32'] == 0x454E4F4E) { + // ASCII value of 'NONE' - placeholder value in v4.50a + $comp_data['crc_32'] = false; + } + + $info_ofr_this_block[] = $comp_data; + break; + + case 'HEAD': + $info_ofr_this_block['offset'] = $block_offset; + $info_ofr_this_block['size'] = $block_size; + + $riff_data .= fread($getid3->fp, $block_size); + break; + + case 'TAIL': + $info_ofr_this_block['offset'] = $block_offset; + $info_ofr_this_block['size'] = $block_size; + + if ($block_size > 0) { + $riff_data .= fread($getid3->fp, $block_size); + } + break; + + case 'RECV': + // block contains no useful meta data - simply note and skip + + $info_ofr_this_block['offset'] = $block_offset; + $info_ofr_this_block['size'] = $block_size; + + fseek($getid3->fp, $block_size, SEEK_CUR); + break; + + + case 'APET': + // APEtag v2 + + $info_ofr_this_block['offset'] = $block_offset; + $info_ofr_this_block['size'] = $block_size; + $getid3->warning('APEtag processing inside OptimFROG not supported in this version ('.GETID3_VERSION.') of getID3()'); + + fseek($getid3->fp, $block_size, SEEK_CUR); + break; + + + case 'MD5 ': + // APEtag v2 + + $info_ofr_this_block['offset'] = $block_offset; + $info_ofr_this_block['size'] = $block_size; + + if ($block_size == 16) { + + $info_ofr_this_block['md5_binary'] = fread($getid3->fp, $block_size); + $info_ofr_this_block['md5_string'] = getid3_lib::PrintHexBytes($info_ofr_this_block['md5_binary'], true, false, false); + $getid3->info['md5_data_source'] = $info_ofr_this_block['md5_string']; + + } else { + + $getid3->warning('Expecting block size of 16 in "MD5 " chunk, found '.$block_size.' instead'); + fseek($getid3->fp, $block_size, SEEK_CUR); + + } + break; + + + default: + $info_ofr_this_block['offset'] = $block_offset; + $info_ofr_this_block['size'] = $block_size; + + $getid3->warning('Unhandled OptimFROG block type "'.$block_name.'" at offset '.$info_ofr_this_block['offset']); + fseek($getid3->fp, $block_size, SEEK_CUR); + break; + } + } + + if (isset($getid3->info['ofr']['TAIL']['offset'])) { + $getid3->info['avdataend'] = $getid3->info['ofr']['TAIL']['offset']; + } + + $getid3->info['playtime_seconds'] = (float)$getid3->info['ofr']['OFR ']['total_samples'] / ($getid3->info['audio']['channels'] * $getid3->info['audio']['sample_rate']); + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + + // move the data chunk after all other chunks (if any) + // so that the RIFF parser doesn't see EOF when trying + // to skip over the data chunk + + $riff_data = substr($riff_data, 0, 36).substr($riff_data, 44).substr($riff_data, 36, 8); + + // Save audio info key + $saved_info_audio = $getid3->info['audio']; + + // Instantiate riff module and analyze string + $riff = new getid3_riff($getid3); + $riff->AnalyzeString($riff_data); + + // Restore info key + $getid3->info['audio'] = $saved_info_audio; + + $getid3->info['fileformat'] = 'ofr'; + + return true; + } + + + + public static function OptimFROGsampleTypeLookup($sample_type) { + + static $lookup = array ( + 0 => 'unsigned int (8-bit)', + 1 => 'signed int (8-bit)', + 2 => 'unsigned int (16-bit)', + 3 => 'signed int (16-bit)', + 4 => 'unsigned int (24-bit)', + 5 => 'signed int (24-bit)', + 6 => 'unsigned int (32-bit)', + 7 => 'signed int (32-bit)', + 8 => 'float 0.24 (32-bit)', + 9 => 'float 16.8 (32-bit)', + 10 => 'float 24.0 (32-bit)' + ); + + return @$lookup[$sample_type]; + } + + + + public static function OptimFROGbitsPerSampleTypeLookup($sample_type) { + + static $lookup = array ( + 0 => 8, + 1 => 8, + 2 => 16, + 3 => 16, + 4 => 24, + 5 => 24, + 6 => 32, + 7 => 32, + 8 => 32, + 9 => 32, + 10 => 32 + ); + + return @$lookup[$sample_type]; + } + + + + public static function OptimFROGchannelConfigurationLookup($channel_configuration) { + + static $lookup = array ( + 0 => 'mono', + 1 => 'stereo' + ); + + return @$lookup[$channel_configuration]; + } + + + + public static function OptimFROGchannelConfigNumChannelsLookup($channel_configuration) { + + static $lookup = array ( + 0 => 1, + 1 => 2 + ); + + return @$lookup[$channel_configuration]; + } + + + + public static function OptimFROGencoderNameLookup($encoder_id) { + + // version = (encoderID >> 4) + 4500 + // system = encoderID & 0xF + + $encoder_version = number_format(((($encoder_id & 0xF0) >> 4) + 4500) / 1000, 3); + $encoder_system_id = ($encoder_id & 0x0F); + + static $lookup = array ( + 0x00 => 'Windows console', + 0x01 => 'Linux console', + 0x0F => 'unknown' + ); + return $encoder_version.' ('.(isset($lookup[$encoder_system_id]) ? $lookup[$encoder_system_id] : 'undefined encoder type (0x'.dechex($encoder_system_id).')').')'; + } + + + + public static function OptimFROGcompressionLookup($compression_id) { + + // mode = compression >> 3 + // speedup = compression & 0x07 + + $compression_mode_id = ($compression_id & 0xF8) >> 3; + //$compression_speed_up_id = ($compression_id & 0x07); + + static $lookup = array ( + 0x00 => 'fast', + 0x01 => 'normal', + 0x02 => 'high', + 0x03 => 'extra', // extranew (some versions) + 0x04 => 'best', // bestnew (some versions) + 0x05 => 'ultra', + 0x06 => 'insane', + 0x07 => 'highnew', + 0x08 => 'extranew', + 0x09 => 'bestnew' + ); + return (isset($lookup[$compression_mode_id]) ? $lookup[$compression_mode_id] : 'undefined mode (0x'.str_pad(dechex($compression_mode_id), 2, '0', STR_PAD_LEFT).')'); + } + + + + public static function OptimFROGspeedupLookup($compression_id) { + + // mode = compression >> 3 + // speedup = compression & 0x07 + + //$compression_mode_id = ($compression_id & 0xF8) >> 3; + $compression_speed_up_id = ($compression_id & 0x07); + + static $lookup = array ( + 0x00 => '1x', + 0x01 => '2x', + 0x02 => '4x' + ); + + return (isset($lookup[$compression_speed_up_id]) ? $lookup[$compression_speed_up_id] : 'undefined mode (0x'.dechex($compression_speed_up_id)); + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.rkau.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.rkau.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.rkau.php 3 Jan 2016 20:51:44 -0000 1.1.2.1 @@ -0,0 +1,101 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.rkau.php | +// | Module for analyzing RKAU Audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.rkau.php,v 1.1.2.1 2016/01/03 20:51:44 gustafn Exp $ + + + +class getid3_rkau extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $rkau_header = fread($getid3->fp, 20); + + // Magic bytes 'RKA' + + $getid3->info['fileformat'] = 'rkau'; + $getid3->info['audio']['dataformat'] = 'rkau'; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + + // Shortcut + $getid3->info['rkau'] = array (); + $info_rkau = &$getid3->info['rkau']; + + $info_rkau['raw']['version'] = getid3_lib::LittleEndian2Int(substr($rkau_header, 3, 1)); + $info_rkau['version'] = '1.'.str_pad($info_rkau['raw']['version'] & 0x0F, 2, '0', STR_PAD_LEFT); + if (($info_rkau['version'] > 1.07) || ($info_rkau['version'] < 1.06)) { + throw new getid3_exception('This version of getID3() can only parse RKAU files v1.06 and 1.07 (this file is v'.$info_rkau['version'].')'); + } + + getid3_lib::ReadSequence('LittleEndian2Int', $info_rkau, $rkau_header, 4, + array ( + 'source_bytes' => 4, + 'sample_rate' => 4, + 'channels' => 1, + 'bits_per_sample' => 1 + ) + ); + + $info_rkau['raw']['quality'] = getid3_lib::LittleEndian2Int(substr($rkau_header, 14, 1)); + + $quality = $info_rkau['raw']['quality'] & 0x0F; + + $info_rkau['lossless'] = (($quality == 0) ? true : false); + $info_rkau['compression_level'] = (($info_rkau['raw']['quality'] & 0xF0) >> 4) + 1; + if (!$info_rkau['lossless']) { + $info_rkau['quality_setting'] = $quality; + } + + $info_rkau['raw']['flags'] = getid3_lib::LittleEndian2Int(substr($rkau_header, 15, 1)); + $info_rkau['flags']['joint_stereo'] = (bool)(!($info_rkau['raw']['flags'] & 0x01)); + $info_rkau['flags']['streaming'] = (bool) ($info_rkau['raw']['flags'] & 0x02); + $info_rkau['flags']['vrq_lossy_mode'] = (bool) ($info_rkau['raw']['flags'] & 0x04); + + if ($info_rkau['flags']['streaming']) { + $getid3->info['avdataoffset'] += 20; + $info_rkau['compressed_bytes'] = getid3_lib::LittleEndian2Int(substr($rkau_header, 16, 4)); + } + else { + $getid3->info['avdataoffset'] += 16; + $info_rkau['compressed_bytes'] = $getid3->info['avdataend'] - $getid3->info['avdataoffset'] - 1; + } + // Note: compressed_bytes does not always equal what appears to be the actual number of compressed bytes, + // sometimes it's more, sometimes less. No idea why(?) + + $getid3->info['audio']['lossless'] = $info_rkau['lossless']; + $getid3->info['audio']['channels'] = $info_rkau['channels']; + $getid3->info['audio']['bits_per_sample'] = $info_rkau['bits_per_sample']; + $getid3->info['audio']['sample_rate'] = $info_rkau['sample_rate']; + + $getid3->info['playtime_seconds'] = $info_rkau['source_bytes'] / ($info_rkau['sample_rate'] * $info_rkau['channels'] * ($info_rkau['bits_per_sample'] / 8)); + $getid3->info['audio']['bitrate'] = ($info_rkau['compressed_bytes'] * 8) / $getid3->info['playtime_seconds']; + + return true; + + } + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.shorten.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.shorten.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.shorten.php 3 Jan 2016 20:51:44 -0000 1.1.2.1 @@ -0,0 +1,121 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.shorten.php | +// | Module for analyzing Shorten Audio files | +// | dependencies: module.audio-video.riff.php | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.shorten.php,v 1.1.2.1 2016/01/03 20:51:44 gustafn Exp $ + + + +class getid3_shorten extends getid3_handler +{ + + public function __construct(getID3 $getid3) { + + parent::__construct($getid3); + + if ((bool)ini_get('safe_mode')) { + throw new getid3_exception('PHP running in Safe Mode - backtick operator not available, cannot analyze Shorten files.'); + } + + if (!`head --version`) { + throw new getid3_exception('head[.exe] binary not found in path. UNIX: typically /usr/bin. Windows: typically c:\windows\system32.'); + } + + if (!`shorten -l`) { + throw new getid3_exception('shorten[.exe] binary not found in path. UNIX: typically /usr/bin. Windows: typically c:\windows\system32.'); + } + } + + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->include_module('audio-video.riff'); + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + $shn_header = fread($getid3->fp, 8); + + // Magic bytes: "ajkg" + + $getid3->info['fileformat'] = 'shn'; + $getid3->info['audio']['dataformat'] = 'shn'; + $getid3->info['audio']['lossless'] = true; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + + $getid3->info['shn']['version'] = getid3_lib::LittleEndian2Int($shn_header{4}); + + fseek($getid3->fp, $getid3->info['avdataend'] - 12, SEEK_SET); + + $seek_table_signature_test = fread($getid3->fp, 12); + + $getid3->info['shn']['seektable']['present'] = (bool)(substr($seek_table_signature_test, 4, 8) == 'SHNAMPSK'); + if ($getid3->info['shn']['seektable']['present']) { + + $getid3->info['shn']['seektable']['length'] = getid3_lib::LittleEndian2Int(substr($seek_table_signature_test, 0, 4)); + $getid3->info['shn']['seektable']['offset'] = $getid3->info['avdataend'] - $getid3->info['shn']['seektable']['length']; + fseek($getid3->fp, $getid3->info['shn']['seektable']['offset'], SEEK_SET); + $seek_table_magic = fread($getid3->fp, 4); + + if ($seek_table_magic != 'SEEK') { + + throw new getid3_exception('Expecting "SEEK" at offset '.$getid3->info['shn']['seektable']['offset'].', found "'.$seek_table_magic.'"'); + } + + $seek_table_data = fread($getid3->fp, $getid3->info['shn']['seektable']['length'] - 16); + $getid3->info['shn']['seektable']['entry_count'] = floor(strlen($seek_table_data) / 80); + } + + $commandline = 'shorten -x '.escapeshellarg(realpath($getid3->filename)).' - | head -c 64'; + $output = `$commandline`; + + if (@$output && substr($output, 12, 4) == 'fmt ') { + + $fmt_size = getid3_lib::LittleEndian2Int(substr($output, 16, 4)); + $decoded_wav_format_ex = getid3_riff::RIFFparseWAVEFORMATex(substr($output, 20, $fmt_size)); + + $getid3->info['audio']['channels'] = $decoded_wav_format_ex['channels']; + $getid3->info['audio']['bits_per_sample'] = $decoded_wav_format_ex['bits_per_sample']; + $getid3->info['audio']['sample_rate'] = $decoded_wav_format_ex['sample_rate']; + + if (substr($output, 20 + $fmt_size, 4) == 'data') { + + $getid3->info['playtime_seconds'] = getid3_lib::LittleEndian2Int(substr($output, 20 + 4 + $fmt_size, 4)) / $decoded_wav_format_ex['raw']['nAvgBytesPerSec']; + + } else { + + throw new getid3_exception('shorten failed to decode DATA chunk to expected location, cannot determine playtime'); + } + + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) / $getid3->info['playtime_seconds']) * 8; + + } else { + + throw new getid3_exception('shorten failed to decode file to WAV for parsing'); + return false; + } + + return true; + } + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.tta.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.tta.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.tta.php 3 Jan 2016 20:51:44 -0000 1.1.2.1 @@ -0,0 +1,125 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.tta.php | +// | Module for analyzing TTA Audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.tta.php,v 1.1.2.1 2016/01/03 20:51:44 gustafn Exp $ + + + +class getid3_tta extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'tta'; + $getid3->info['audio']['dataformat'] = 'tta'; + $getid3->info['audio']['lossless'] = true; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $tta_header = fread($getid3->fp, 26); + + $getid3->info['tta']['magic'] = 'TTA'; // Magic bytes + + switch ($tta_header{3}) { + + case "\x01": // TTA v1.x + case "\x02": // TTA v1.x + case "\x03": // TTA v1.x + + // "It was the demo-version of the TTA encoder. There is no released format with such header. TTA encoder v1 is not supported about a year." + $getid3->info['tta']['major_version'] = 1; + $getid3->info['avdataoffset'] += 16; + + getid3_lib::ReadSequence('LittleEndian2Int', $getid3->info['tta'], $tta_header, 4, + array ( + 'channels' => 2, + 'bits_per_sample' => 2, + 'sample_rate' => 4, + 'samples_per_channel' => 4 + ) + ); + $getid3->info['tta']['compression_level'] = ord($tta_header{3}); + + $getid3->info['audio']['encoder_options'] = '-e'.$getid3->info['tta']['compression_level']; + $getid3->info['playtime_seconds'] = $getid3->info['tta']['samples_per_channel'] / $getid3->info['tta']['sample_rate']; + break; + + case '2': // TTA v2.x + // "I have hurried to release the TTA 2.0 encoder. Format documentation is removed from our site. This format still in development. Please wait the TTA2 format, encoder v4." + $getid3->info['tta']['major_version'] = 2; + $getid3->info['avdataoffset'] += 20; + + getid3_lib::ReadSequence('LittleEndian2Int', $getid3->info['tta'], $tta_header, 4, + array ( + 'compression_level' => 2, + 'audio_format' => 2, + 'channels' => 2, + 'bits_per_sample' => 2, + 'sample_rate' => 4, + 'data_length' => 4 + ) + ); + + $getid3->info['audio']['encoder_options'] = '-e'.$getid3->info['tta']['compression_level']; + $getid3->info['playtime_seconds'] = $getid3->info['tta']['data_length'] / $getid3->info['tta']['sample_rate']; + break; + + case '1': // TTA v3.x + // "This is a first stable release of the TTA format. It will be supported by the encoders v3 or higher." + $getid3->info['tta']['major_version'] = 3; + $getid3->info['avdataoffset'] += 26; + + getid3_lib::ReadSequence('LittleEndian2Int', $getid3->info['tta'], $tta_header, 4, + array ( + 'audio_format' => 2, + 'channels' => 2, + 'bits_per_sample'=> 2, + 'sample_rate' => 4, + 'data_length' => 4, + 'crc32_footer' => -4, // string + 'seek_point' => 4 + ) + ); + + $getid3->info['playtime_seconds'] = $getid3->info['tta']['data_length'] / $getid3->info['tta']['sample_rate']; + break; + + default: + throw new getid3_exception('This version of getID3() only knows how to handle TTA v1, v2 and v3 - it may not work correctly with this file which appears to be TTA v'.$tta_header{3}); + return false; + break; + } + + $getid3->info['audio']['encoder'] = 'TTA v'.$getid3->info['tta']['major_version']; + $getid3->info['audio']['bits_per_sample'] = $getid3->info['tta']['bits_per_sample']; + $getid3->info['audio']['sample_rate'] = $getid3->info['tta']['sample_rate']; + $getid3->info['audio']['channels'] = $getid3->info['tta']['channels']; + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + + return true; + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.voc.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.voc.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.voc.php 3 Jan 2016 20:51:44 -0000 1.1.2.1 @@ -0,0 +1,240 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.voc.php | +// | Module for analyzing Creative VOC Audio files. | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.voc.php,v 1.1.2.1 2016/01/03 20:51:44 gustafn Exp $ + + + +class getid3_voc extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $original_av_data_offset = $getid3->info['avdataoffset']; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $voc_header= fread($getid3->fp, 26); + + // Magic bytes: 'Creative Voice File' + + $info_audio = &$getid3->info['audio']; + $getid3->info['voc'] = array (); + $info_voc = &$getid3->info['voc']; + + $getid3->info['fileformat'] = 'voc'; + $info_audio['dataformat'] = 'voc'; + $info_audio['bitrate_mode'] = 'cbr'; + $info_audio['lossless'] = true; + $info_audio['channels'] = 1; // might be overriden below + $info_audio['bits_per_sample'] = 8; // might be overriden below + + // byte # Description + // ------ ------------------------------------------ + // 00-12 'Creative Voice File' + // 13 1A (eof to abort printing of file) + // 14-15 Offset of first datablock in .voc file (std 1A 00 in Intel Notation) + // 16-17 Version number (minor,major) (VOC-HDR puts 0A 01) + // 18-19 2's Comp of Ver. # + 1234h (VOC-HDR puts 29 11) + + getid3_lib::ReadSequence('LittleEndian2Int', $info_voc['header'], $voc_header, 20, + array ( + 'datablock_offset' => 2, + 'minor_version' => 1, + 'major_version' => 1 + ) + ); + + do { + $block_offset = ftell($getid3->fp); + $block_data = fread($getid3->fp, 4); + $block_type = ord($block_data{0}); + $block_size = getid3_lib::LittleEndian2Int(substr($block_data, 1, 3)); + $this_block = array (); + + @$info_voc['blocktypes'][$block_type]++; + + switch ($block_type) { + + case 0: // Terminator + // do nothing, we'll break out of the loop down below + break; + + case 1: // Sound data + $block_data .= fread($getid3->fp, 2); + if ($getid3->info['avdataoffset'] <= $original_av_data_offset) { + $getid3->info['avdataoffset'] = ftell($getid3->fp); + } + fseek($getid3->fp, $block_size - 2, SEEK_CUR); + + getid3_lib::ReadSequence('LittleEndian2Int', $this_block, $block_data, 4, + array ( + 'sample_rate_id' => 1, + 'compression_type' => 1 + ) + ); + + $this_block['compression_name'] = getid3_voc::VOCcompressionTypeLookup($this_block['compression_type']); + if ($this_block['compression_type'] <= 3) { + $info_voc['compressed_bits_per_sample'] = (int)(str_replace('-bit', '', $this_block['compression_name'])); + } + + // Less accurate sample_rate calculation than the Extended block (#8) data (but better than nothing if Extended Block is not available) + if (empty($info_audio['sample_rate'])) { + // SR byte = 256 - (1000000 / sample_rate) + $info_audio['sample_rate'] = (int)floor((1000000 / (256 - $this_block['sample_rate_id'])) / $info_audio['channels']); + } + break; + + case 2: // Sound continue + case 3: // Silence + case 4: // Marker + case 6: // Repeat + case 7: // End repeat + // nothing useful, just skip + fseek($getid3->fp, $block_size, SEEK_CUR); + break; + + case 8: // Extended + $block_data .= fread($getid3->fp, 4); + + //00-01 Time Constant: + // Mono: 65536 - (256000000 / sample_rate) + // Stereo: 65536 - (256000000 / (sample_rate * 2)) + getid3_lib::ReadSequence('LittleEndian2Int', $this_block, $block_data, 4, + array ( + 'time_constant' => 2, + 'pack_method' => 1, + 'stereo' => 1 + ) + ); + $this_block['stereo'] = (bool)$this_block['stereo']; + + $info_audio['channels'] = ($this_block['stereo'] ? 2 : 1); + $info_audio['sample_rate'] = (int)floor((256000000 / (65536 - $this_block['time_constant'])) / $info_audio['channels']); + break; + + case 9: // data block that supersedes blocks 1 and 8. Used for stereo, 16 bit + $block_data .= fread($getid3->fp, 12); + if ($getid3->info['avdataoffset'] <= $original_av_data_offset) { + $getid3->info['avdataoffset'] = ftell($getid3->fp); + } + fseek($getid3->fp, $block_size - 12, SEEK_CUR); + + getid3_lib::ReadSequence('LittleEndian2Int', $this_block, $block_data, 4, + array ( + 'sample_rate' => 4, + 'bits_per_sample' => 1, + 'channels' => 1, + 'wFormat' => 2 + ) + ); + + $this_block['compression_name'] = getid3_voc::VOCwFormatLookup($this_block['wFormat']); + if (getid3_voc::VOCwFormatActualBitsPerSampleLookup($this_block['wFormat'])) { + $info_voc['compressed_bits_per_sample'] = getid3_voc::VOCwFormatActualBitsPerSampleLookup($this_block['wFormat']); + } + + $info_audio['sample_rate'] = $this_block['sample_rate']; + $info_audio['bits_per_sample'] = $this_block['bits_per_sample']; + $info_audio['channels'] = $this_block['channels']; + break; + + default: + $getid3->warning('Unhandled block type "'.$block_type.'" at offset '.$block_offset); + fseek($getid3->fp, $block_size, SEEK_CUR); + break; + } + + if (!empty($this_block)) { + $this_block['block_offset'] = $block_offset; + $this_block['block_size'] = $block_size; + $this_block['block_type_id'] = $block_type; + $info_voc['blocks'][] = $this_block; + } + + } while (!feof($getid3->fp) && ($block_type != 0)); + + // Terminator block doesn't have size field, so seek back 3 spaces + fseek($getid3->fp, -3, SEEK_CUR); + + ksort($info_voc['blocktypes']); + + if (!empty($info_voc['compressed_bits_per_sample'])) { + $getid3->info['playtime_seconds'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / ($info_voc['compressed_bits_per_sample'] * $info_audio['channels'] * $info_audio['sample_rate']); + $info_audio['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + } + + return true; + } + + + + public static function VOCcompressionTypeLookup($index) { + + static $lookup = array ( + 0 => '8-bit', + 1 => '4-bit', + 2 => '2.6-bit', + 3 => '2-bit' + ); + return (isset($lookup[$index]) ? $lookup[$index] : 'Multi DAC ('.($index - 3).') channels'); + } + + + + public static function VOCwFormatLookup($index) { + + static $lookup = array ( + 0x0000 => '8-bit unsigned PCM', + 0x0001 => 'Creative 8-bit to 4-bit ADPCM', + 0x0002 => 'Creative 8-bit to 3-bit ADPCM', + 0x0003 => 'Creative 8-bit to 2-bit ADPCM', + 0x0004 => '16-bit signed PCM', + 0x0006 => 'CCITT a-Law', + 0x0007 => 'CCITT u-Law', + 0x2000 => 'Creative 16-bit to 4-bit ADPCM' + ); + return (isset($lookup[$index]) ? $lookup[$index] : false); + } + + + + public static function VOCwFormatActualBitsPerSampleLookup($index) { + + static $lookup = array ( + 0x0000 => 8, + 0x0001 => 4, + 0x0002 => 3, + 0x0003 => 2, + 0x0004 => 16, + 0x0006 => 8, + 0x0007 => 8, + 0x2000 => 4 + ); + return (isset($lookup[$index]) ? $lookup[$index] : false); + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.vqf.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.vqf.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.vqf.php 3 Jan 2016 20:51:45 -0000 1.1.2.1 @@ -0,0 +1,164 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.vqf.php | +// | Module for analyzing VQF Audio files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.vqf.php,v 1.1.2.1 2016/01/03 20:51:45 gustafn Exp $ + + + +class getid3_vqf extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + // based loosely on code from TTwinVQ by Jurgen Faul + // http://jfaul.de/atl or http://j-faul.virtualave.net/atl/atl.html + + $getid3->info['fileformat'] = 'vqf'; + $getid3->info['audio']['dataformat'] = 'vqf'; + $getid3->info['audio']['bitrate_mode'] = 'cbr'; + $getid3->info['audio']['lossless'] = false; + + // Shortcuts + $getid3->info['vqf']['raw'] = array (); + $info_vqf = &$getid3->info['vqf']; + $info_vqf_raw = &$info_vqf['raw']; + + // Get header + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $vqf_header_data = fread($getid3->fp, 16); + + $info_vqf_raw['header_tag'] = 'TWIN'; // Magic bytes + $info_vqf_raw['version'] = substr($vqf_header_data, 4, 8); + $info_vqf_raw['size'] = getid3_lib::BigEndian2Int(substr($vqf_header_data, 12, 4)); + + while (ftell($getid3->fp) < $getid3->info['avdataend']) { + + $chunk_base_offset = ftell($getid3->fp); + $chunk_data = fread($getid3->fp, 8); + $chunk_name = substr($chunk_data, 0, 4); + + if ($chunk_name == 'DATA') { + $getid3->info['avdataoffset'] = $chunk_base_offset; + break; + } + + $chunk_size = getid3_lib::BigEndian2Int(substr($chunk_data, 4, 4)); + if ($chunk_size > ($getid3->info['avdataend'] - ftell($getid3->fp))) { + throw new getid3_exception('Invalid chunk size ('.$chunk_size.') for chunk "'.$chunk_name.'" at offset 8.'); + } + if ($chunk_size > 0) { + $chunk_data .= fread($getid3->fp, $chunk_size); + } + + switch ($chunk_name) { + + case 'COMM': + $info_vqf['COMM'] = array (); + getid3_lib::ReadSequence('BigEndian2Int', $info_vqf['COMM'], $chunk_data, 8, + array ( + 'channel_mode' => 4, + 'bitrate' => 4, + 'sample_rate' => 4, + 'security_level' => 4 + ) + ); + + $getid3->info['audio']['channels'] = $info_vqf['COMM']['channel_mode'] + 1; + $getid3->info['audio']['sample_rate'] = getid3_vqf::VQFchannelFrequencyLookup($info_vqf['COMM']['sample_rate']); + $getid3->info['audio']['bitrate'] = $info_vqf['COMM']['bitrate'] * 1000; + $getid3->info['audio']['encoder_options'] = 'CBR' . ceil($getid3->info['audio']['bitrate']/1000); + + if ($getid3->info['audio']['bitrate'] == 0) { + throw new getid3_exception('Corrupt VQF file: bitrate_audio == zero'); + } + break; + + case 'NAME': + case 'AUTH': + case '(c) ': + case 'FILE': + case 'COMT': + case 'ALBM': + $info_vqf['comments'][getid3_vqf::VQFcommentNiceNameLookup($chunk_name)][] = trim(substr($chunk_data, 8)); + break; + + case 'DSIZ': + $info_vqf['DSIZ'] = getid3_lib::BigEndian2Int(substr($chunk_data, 8, 4)); + break; + + default: + $getid3->warning('Unhandled chunk type "'.$chunk_name.'" at offset 8'); + break; + } + } + + $getid3->info['playtime_seconds'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['audio']['bitrate']; + + if (isset($info_vqf['DSIZ']) && (($info_vqf['DSIZ'] != ($getid3->info['avdataend'] - $getid3->info['avdataoffset'] - strlen('DATA'))))) { + switch ($info_vqf['DSIZ']) { + case 0: + case 1: + $getid3->warning('Invalid DSIZ value "'.$info_vqf['DSIZ'].'". This is known to happen with VQF files encoded by Ahead Nero, and seems to be its way of saying this is TwinVQF v'.($info_vqf['DSIZ'] + 1).'.0'); + $getid3->info['audio']['encoder'] = 'Ahead Nero'; + break; + + default: + $getid3->warning('Probable corrupted file - should be '.$info_vqf['DSIZ'].' bytes, actually '.($getid3->info['avdataend'] - $getid3->info['avdataoffset'] - strlen('DATA'))); + break; + } + } + + return true; + } + + + + public static function VQFchannelFrequencyLookup($frequencyid) { + + static $lookup = array ( + 11 => 11025, + 22 => 22050, + 44 => 44100 + ); + return (isset($lookup[$frequencyid]) ? $lookup[$frequencyid] : $frequencyid * 1000); + } + + + + public static function VQFcommentNiceNameLookup($shortname) { + + static $lookup = array ( + 'NAME' => 'title', + 'AUTH' => 'artist', + '(c) ' => 'copyright', + 'FILE' => 'filename', + 'COMT' => 'comment', + 'ALBM' => 'album' + ); + return (isset($lookup[$shortname]) ? $lookup[$shortname] : $shortname); + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.wavpack.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.wavpack.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.wavpack.php 3 Jan 2016 20:51:45 -0000 1.1.2.1 @@ -0,0 +1,399 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.wavpack.php | +// | module for analyzing WavPack v4.0+ Audio files | +// | dependencies: audio-video.riff | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.wavpack.php,v 1.1.2.1 2016/01/03 20:51:45 gustafn Exp $ + + +class getid3_wavpack extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->include_module('audio-video.riff'); + + $getid3->info['wavpack'] = array (); + $info_wavpack = &$getid3->info['wavpack']; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + while (true) { + + $wavpack_header = fread($getid3->fp, 32); + + if (ftell($getid3->fp) >= $getid3->info['avdataend']) { + break; + } elseif (feof($getid3->fp)) { + break; + } elseif ( + (@$info_wavpack_blockheader['total_samples'] > 0) && + (@$info_wavpack_blockheader['block_samples'] > 0) && + (!isset($info_wavpack['riff_trailer_size']) || ($info_wavpack['riff_trailer_size'] <= 0)) && + ((@$info_wavpack['config_flags']['md5_checksum'] === false) || !empty($getid3->info['md5_data_source']))) { + break; + } + + $block_header_offset = ftell($getid3->fp) - 32; + $block_header_magic = substr($wavpack_header, 0, 4); + $block_header_size = getid3_lib::LittleEndian2Int(substr($wavpack_header, 4, 4)); + + if ($block_header_magic != 'wvpk') { + throw new getid3_exception('Expecting "wvpk" at offset '.$block_header_offset.', found "'.$block_header_magic.'"'); + } + + if ((@$info_wavpack_blockheader['block_samples'] <= 0) || (@$info_wavpack_blockheader['total_samples'] <= 0)) { + + // Also, it is possible that the first block might not have + // any samples (block_samples == 0) and in this case you should skip blocks + // until you find one with samples because the other information (like + // total_samples) are not guaranteed to be correct until (block_samples > 0) + + // Finally, I have defined a format for files in which the length is not known + // (for example when raw files are created using pipes). In these cases + // total_samples will be -1 and you must seek to the final block to determine + // the total number of samples. + + + $getid3->info['audio']['dataformat'] = 'wavpack'; + $getid3->info['fileformat'] = 'wavpack'; + $getid3->info['audio']['lossless'] = true; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + + $info_wavpack['blockheader']['offset'] = $block_header_offset; + $info_wavpack['blockheader']['magic'] = $block_header_magic; + $info_wavpack['blockheader']['size'] = $block_header_size; + $info_wavpack_blockheader = &$info_wavpack['blockheader']; + + if ($info_wavpack_blockheader['size'] >= 0x100000) { + throw new getid3_exception('Expecting WavPack block size less than "0x100000", found "'.$info_wavpack_blockheader['size'].'" at offset '.$info_wavpack_blockheader['offset']); + } + + $info_wavpack_blockheader['minor_version'] = ord($wavpack_header{8}); + $info_wavpack_blockheader['major_version'] = ord($wavpack_header{9}); + + if (($info_wavpack_blockheader['major_version'] != 4) || + (($info_wavpack_blockheader['minor_version'] < 4) && + ($info_wavpack_blockheader['minor_version'] > 16))) { + throw new getid3_exception('Expecting WavPack version between "4.2" and "4.16", found version "'.$info_wavpack_blockheader['major_version'].'.'.$info_wavpack_blockheader['minor_version'].'" at offset '.$info_wavpack_blockheader['offset']); + } + + $info_wavpack_blockheader['track_number'] = ord($wavpack_header{10}); // unused + $info_wavpack_blockheader['index_number'] = ord($wavpack_header{11}); // unused + + getid3_lib::ReadSequence('LittleEndian2Int', $info_wavpack_blockheader, $wavpack_header, 12, + array ( + 'total_samples' => 4, + 'block_index' => 4, + 'block_samples' => 4, + 'flags_raw' => 4, + 'crc' => 4 + ) + ); + + + $info_wavpack_blockheader['flags']['bytes_per_sample'] = 1 + ($info_wavpack_blockheader['flags_raw'] & 0x00000003); + $info_wavpack_blockheader['flags']['mono'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000004); + $info_wavpack_blockheader['flags']['hybrid'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000008); + $info_wavpack_blockheader['flags']['joint_stereo'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000010); + $info_wavpack_blockheader['flags']['cross_decorrelation'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000020); + $info_wavpack_blockheader['flags']['hybrid_noiseshape'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000040); + $info_wavpack_blockheader['flags']['ieee_32bit_float'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000080); + $info_wavpack_blockheader['flags']['int_32bit'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000100); + $info_wavpack_blockheader['flags']['hybrid_bitrate_noise'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000200); + $info_wavpack_blockheader['flags']['hybrid_balance_noise'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000400); + $info_wavpack_blockheader['flags']['multichannel_initial'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00000800); + $info_wavpack_blockheader['flags']['multichannel_final'] = (bool) ($info_wavpack_blockheader['flags_raw'] & 0x00001000); + + $getid3->info['audio']['lossless'] = !$info_wavpack_blockheader['flags']['hybrid']; + } + + + while (!feof($getid3->fp) && (ftell($getid3->fp) < ($block_header_offset + $block_header_size + 8))) { + + $metablock = array('offset'=>ftell($getid3->fp)); + $metablockheader = fread($getid3->fp, 2); + if (feof($getid3->fp)) { + break; + } + $metablock['id'] = ord($metablockheader{0}); + $metablock['function_id'] = ($metablock['id'] & 0x3F); + $metablock['function_name'] = $this->WavPackMetablockNameLookup($metablock['function_id']); + + // The 0x20 bit in the id of the meta subblocks (which is defined as + // ID_OPTIONAL_DATA) is a permanent part of the id. The idea is that + // if a decoder encounters an id that it does not know about, it uses + // that "ID_OPTIONAL_DATA" flag to determine what to do. If it is set + // then the decoder simply ignores the metadata, but if it is zero + // then the decoder should quit because it means that an understanding + // of the metadata is required to correctly decode the audio. + + $metablock['non_decoder'] = (bool) ($metablock['id'] & 0x20); + $metablock['padded_data'] = (bool) ($metablock['id'] & 0x40); + $metablock['large_block'] = (bool) ($metablock['id'] & 0x80); + if ($metablock['large_block']) { + $metablockheader .= fread($getid3->fp, 2); + } + $metablock['size'] = getid3_lib::LittleEndian2Int(substr($metablockheader, 1)) * 2; // size is stored in words + $metablock['data'] = null; + + if ($metablock['size'] > 0) { + + switch ($metablock['function_id']) { + + case 0x21: // ID_RIFF_HEADER + case 0x22: // ID_RIFF_TRAILER + case 0x23: // ID_REPLAY_GAIN + case 0x24: // ID_CUESHEET + case 0x25: // ID_CONFIG_BLOCK + case 0x26: // ID_MD5_CHECKSUM + $metablock['data'] = fread($getid3->fp, $metablock['size']); + + if ($metablock['padded_data']) { + // padded to the nearest even byte + $metablock['size']--; + $metablock['data'] = substr($metablock['data'], 0, -1); + } + break; + + + case 0x00: // ID_DUMMY + case 0x01: // ID_ENCODER_INFO + case 0x02: // ID_DECORR_TERMS + case 0x03: // ID_DECORR_WEIGHTS + case 0x04: // ID_DECORR_SAMPLES + case 0x05: // ID_ENTROPY_VARS + case 0x06: // ID_HYBRID_PROFILE + case 0x07: // ID_SHAPING_WEIGHTS + case 0x08: // ID_FLOAT_INFO + case 0x09: // ID_INT32_INFO + case 0x0A: // ID_WV_BITSTREAM + case 0x0B: // ID_WVC_BITSTREAM + case 0x0C: // ID_WVX_BITSTREAM + case 0x0D: // ID_CHANNEL_INFO + fseek($getid3->fp, $metablock['offset'] + ($metablock['large_block'] ? 4 : 2) + $metablock['size'], SEEK_SET); + break; + + + default: + $getid3->warning('Unexpected metablock type "0x'.str_pad(dechex($metablock['function_id']), 2, '0', STR_PAD_LEFT).'" at offset '.$metablock['offset']); + fseek($getid3->fp, $metablock['offset'] + ($metablock['large_block'] ? 4 : 2) + $metablock['size'], SEEK_SET); + break; + } + + + switch ($metablock['function_id']) { + + case 0x21: // ID_RIFF_HEADER + + $original_wav_filesize = getid3_lib::LittleEndian2Int(substr($metablock['data'], 4, 4)); + + // Clone getid3 + $clone = clone $getid3; + + // Analyze clone by string + $riff = new getid3_riff($clone); + $riff->AnalyzeString($metablock['data']); + + // Import from clone and destroy + $metablock['riff'] = $clone->info['riff']; + $getid3->warnings($clone->warnings()); + unset($clone); + + // Save RIFF header - we may need it later for RIFF footer parsing + $this->riff_header = $metablock['data']; + + $metablock['riff']['original_filesize'] = $original_wav_filesize; + $info_wavpack['riff_trailer_size'] = $original_wav_filesize - $metablock['riff']['WAVE']['data'][0]['size'] - $metablock['riff']['header_size']; + + $getid3->info['audio']['sample_rate'] = $metablock['riff']['raw']['fmt ']['nSamplesPerSec']; + $getid3->info['playtime_seconds'] = $info_wavpack_blockheader['total_samples'] / $getid3->info['audio']['sample_rate']; + + // Safe RIFF header in case there's a RIFF footer later + $metablock_riff_header = $metablock['data']; + break; + + + case 0x22: // ID_RIFF_TRAILER + + $metablock_riff_footer = $metablock_riff_header.$metablock['data']; + + $start_offset = $metablock['offset'] + ($metablock['large_block'] ? 4 : 2); + + $ftell_old = ftell($getid3->fp); + + // Clone getid3 + $clone = clone $getid3; + + // Call public method that really should be private + $riff = new getid3_riff($clone); + $metablock['riff'] = $riff->ParseRIFF($start_offset, $start_offset + $metablock['size']); + unset($clone); + + fseek($getid3->fp, $ftell_old, SEEK_SET); + + if (!empty($metablock['riff']['INFO'])) { + getid3_riff::RIFFCommentsParse($metablock['riff']['INFO'], $metablock['comments']); + $getid3->info['tags']['riff'] = $metablock['comments']; + } + break; + + + case 0x23: // ID_REPLAY_GAIN + $getid3->warning('WavPack "Replay Gain" contents not yet handled by getID3() in metablock at offset '.$metablock['offset']); + break; + + + case 0x24: // ID_CUESHEET + $getid3->warning('WavPack "Cuesheet" contents not yet handled by getID3() in metablock at offset '.$metablock['offset']); + break; + + + case 0x25: // ID_CONFIG_BLOCK + $metablock['flags_raw'] = getid3_lib::LittleEndian2Int(substr($metablock['data'], 0, 3)); + + $metablock['flags']['adobe_mode'] = (bool) ($metablock['flags_raw'] & 0x000001); // "adobe" mode for 32-bit floats + $metablock['flags']['fast_flag'] = (bool) ($metablock['flags_raw'] & 0x000002); // fast mode + $metablock['flags']['very_fast_flag'] = (bool) ($metablock['flags_raw'] & 0x000004); // double fast + $metablock['flags']['high_flag'] = (bool) ($metablock['flags_raw'] & 0x000008); // high quality mode + $metablock['flags']['very_high_flag'] = (bool) ($metablock['flags_raw'] & 0x000010); // double high (not used yet) + $metablock['flags']['bitrate_kbps'] = (bool) ($metablock['flags_raw'] & 0x000020); // bitrate is kbps, not bits / sample + $metablock['flags']['auto_shaping'] = (bool) ($metablock['flags_raw'] & 0x000040); // automatic noise shaping + $metablock['flags']['shape_override'] = (bool) ($metablock['flags_raw'] & 0x000080); // shaping mode specified + $metablock['flags']['joint_override'] = (bool) ($metablock['flags_raw'] & 0x000100); // joint-stereo mode specified + $metablock['flags']['copy_time'] = (bool) ($metablock['flags_raw'] & 0x000200); // copy file-time from source + $metablock['flags']['create_exe'] = (bool) ($metablock['flags_raw'] & 0x000400); // create executable + $metablock['flags']['create_wvc'] = (bool) ($metablock['flags_raw'] & 0x000800); // create correction file + $metablock['flags']['optimize_wvc'] = (bool) ($metablock['flags_raw'] & 0x001000); // maximize bybrid compression + $metablock['flags']['quality_mode'] = (bool) ($metablock['flags_raw'] & 0x002000); // psychoacoustic quality mode + $metablock['flags']['raw_flag'] = (bool) ($metablock['flags_raw'] & 0x004000); // raw mode (not implemented yet) + $metablock['flags']['calc_noise'] = (bool) ($metablock['flags_raw'] & 0x008000); // calc noise in hybrid mode + $metablock['flags']['lossy_mode'] = (bool) ($metablock['flags_raw'] & 0x010000); // obsolete (for information) + $metablock['flags']['extra_mode'] = (bool) ($metablock['flags_raw'] & 0x020000); // extra processing mode + $metablock['flags']['skip_wvx'] = (bool) ($metablock['flags_raw'] & 0x040000); // no wvx stream w/ floats & big ints + $metablock['flags']['md5_checksum'] = (bool) ($metablock['flags_raw'] & 0x080000); // compute & store MD5 signature + $metablock['flags']['quiet_mode'] = (bool) ($metablock['flags_raw'] & 0x100000); // don't report progress % + + $info_wavpack['config_flags'] = $metablock['flags']; + + $getid3->info['audio']['encoder_options'] = trim( + ($info_wavpack_blockheader['flags']['hybrid'] ? ' -b???' : '') . + ($metablock['flags']['adobe_mode'] ? ' -a' : '') . + ($metablock['flags']['optimize_wvc'] ? ' -cc' : '') . + ($metablock['flags']['create_exe'] ? ' -e' : '') . + ($metablock['flags']['fast_flag'] ? ' -f' : '') . + ($metablock['flags']['joint_override'] ? ' -j?' : '') . + ($metablock['flags']['high_flag'] ? ' -h' : '') . + ($metablock['flags']['md5_checksum'] ? ' -m' : '') . + ($metablock['flags']['calc_noise'] ? ' -n' : '') . + ($metablock['flags']['shape_override'] ? ' -s?' : '') . + ($metablock['flags']['extra_mode'] ? ' -x?' : '') + ); + if (!$getid3->info['audio']['encoder_options']) { + unset($getid3->info['audio']['encoder_options']); + } + break; + + + case 0x26: // ID_MD5_CHECKSUM + if (strlen($metablock['data']) == 16) { + $getid3->info['md5_data_source'] = strtolower(getid3_lib::PrintHexBytes($metablock['data'], true, false, false)); + } else { + $getid3->warning('Expecting 16 bytes of WavPack "MD5 Checksum" in metablock at offset '.$metablock['offset'].', but found '.strlen($metablock['data']).' bytes'); + } + break; + + + case 0x00: // ID_DUMMY + case 0x01: // ID_ENCODER_INFO + case 0x02: // ID_DECORR_TERMS + case 0x03: // ID_DECORR_WEIGHTS + case 0x04: // ID_DECORR_SAMPLES + case 0x05: // ID_ENTROPY_VARS + case 0x06: // ID_HYBRID_PROFILE + case 0x07: // ID_SHAPING_WEIGHTS + case 0x08: // ID_FLOAT_INFO + case 0x09: // ID_INT32_INFO + case 0x0A: // ID_WV_BITSTREAM + case 0x0B: // ID_WVC_BITSTREAM + case 0x0C: // ID_WVX_BITSTREAM + case 0x0D: // ID_CHANNEL_INFO + unset($metablock); + break; + } + + } + + if (!empty($metablock)) { + $info_wavpack['metablocks'][] = $metablock; + } + + } + + } + + $getid3->info['audio']['encoder'] = 'WavPack v'.$info_wavpack_blockheader['major_version'].'.'.str_pad($info_wavpack_blockheader['minor_version'], 2, '0', STR_PAD_LEFT); + $getid3->info['audio']['bits_per_sample'] = $info_wavpack_blockheader['flags']['bytes_per_sample'] * 8; + $getid3->info['audio']['channels'] = ($info_wavpack_blockheader['flags']['mono'] ? 1 : 2); + + if (@$getid3->info['playtime_seconds']) { + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + } else { + $getid3->info['audio']['dataformat'] = 'wvc'; + } + + return true; + } + + + + public static function WavPackMetablockNameLookup($id) { + + static $lookup = array( + 0x00 => 'Dummy', + 0x01 => 'Encoder Info', + 0x02 => 'Decorrelation Terms', + 0x03 => 'Decorrelation Weights', + 0x04 => 'Decorrelation Samples', + 0x05 => 'Entropy Variables', + 0x06 => 'Hybrid Profile', + 0x07 => 'Shaping Weights', + 0x08 => 'Float Info', + 0x09 => 'Int32 Info', + 0x0A => 'WV Bitstream', + 0x0B => 'WVC Bitstream', + 0x0C => 'WVX Bitstream', + 0x0D => 'Channel Info', + 0x21 => 'RIFF header', + 0x22 => 'RIFF trailer', + 0x23 => 'Replay Gain', + 0x24 => 'Cuesheet', + 0x25 => 'Config Block', + 0x26 => 'MD5 Checksum', + ); + + return (@$lookup[$id]); + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.xiph.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.xiph.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.audio.xiph.php 3 Jan 2016 20:51:45 -0000 1.1.2.1 @@ -0,0 +1,952 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.audio.xiph.php | +// | Module for analyzing Xiph.org audio file formats: | +// | Ogg Vorbis, FLAC, OggFLAC and Speex - not Ogg Theora | +// | dependencies: module.lib.image_size.php (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.audio.xiph.php,v 1.1.2.1 2016/01/03 20:51:45 gustafn Exp $ + + + +class getid3_xiph extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + if ($getid3->option_tags_images) { + $getid3->include_module('lib.image_size'); + } + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + $magic = fread($getid3->fp, 4); + + if ($magic == 'OggS') { + return $this->ParseOgg(); + } + + if ($magic == 'fLaC') { + return $this->ParseFLAC(); + } + + } + + + + private function ParseOgg() { + + $getid3 = $this->getid3; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + $getid3->info['audio'] = $getid3->info['ogg'] = array (); + $info_ogg = &$getid3->info['ogg']; + $info_audio = &$getid3->info['audio']; + + $getid3->info['fileformat'] = 'ogg'; + + + //// Page 1 - Stream Header + + $ogg_page_info = $this->ParseOggPageHeader(); + $info_ogg['pageheader'][$ogg_page_info['page_seqno']] = $ogg_page_info; + + if (ftell($getid3->fp) >= getid3::FREAD_BUFFER_SIZE) { + throw new getid3_exception('Could not find start of Ogg page in the first '.getid3::FREAD_BUFFER_SIZE.' bytes (this might not be an Ogg file?)'); + } + + $file_data = fread($getid3->fp, $ogg_page_info['page_length']); + $file_data_offset = 0; + + + // OggFLAC + if (substr($file_data, 0, 4) == 'fLaC') { + + $info_audio['dataformat'] = 'flac'; + $info_audio['bitrate_mode'] = 'vbr'; + $info_audio['lossless'] = true; + + } + + + // Ogg Vorbis + elseif (substr($file_data, 1, 6) == 'vorbis') { + + $info_audio['dataformat'] = 'vorbis'; + $info_audio['lossless'] = false; + + $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int($file_data[0]); + $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['stream_type'] = substr($file_data, 1, 6); // hard-coded to 'vorbis' + + getid3_lib::ReadSequence('LittleEndian2Int', $info_ogg, $file_data, 7, + array ( + 'bitstreamversion' => 4, + 'numberofchannels' => 1, + 'samplerate' => 4, + 'bitrate_max' => 4, + 'bitrate_nominal' => 4, + 'bitrate_min' => 4 + ) + ); + + $n28 = getid3_lib::LittleEndian2Int($file_data{28}); + $info_ogg['blocksize_small'] = pow(2, $n28 & 0x0F); + $info_ogg['blocksize_large'] = pow(2, ($n28 & 0xF0) >> 4); + $info_ogg['stop_bit'] = $n28; + + $info_audio['channels'] = $info_ogg['numberofchannels']; + $info_audio['sample_rate'] = $info_ogg['samplerate']; + + $info_audio['bitrate_mode'] = 'vbr'; // overridden if actually abr + + if ($info_ogg['bitrate_max'] == 0xFFFFFFFF) { + unset($info_ogg['bitrate_max']); + $info_audio['bitrate_mode'] = 'abr'; + } + + if ($info_ogg['bitrate_nominal'] == 0xFFFFFFFF) { + unset($info_ogg['bitrate_nominal']); + } + + if ($info_ogg['bitrate_min'] == 0xFFFFFFFF) { + unset($info_ogg['bitrate_min']); + $info_audio['bitrate_mode'] = 'abr'; + } + } + + + // Speex + elseif (substr($file_data, 0, 8) == 'Speex ') { + + // http://www.speex.org/manual/node10.html + + $info_audio['dataformat'] = 'speex'; + $getid3->info['mime_type'] = 'audio/speex'; + $info_audio['bitrate_mode'] = 'abr'; + $info_audio['lossless'] = false; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_ogg['pageheader'][$ogg_page_info['page_seqno']], $file_data, 0, + array ( + 'speex_string' => -8, // hard-coded to 'Speex ' + 'speex_version' => -20, // string + 'speex_version_id' => 4, + 'header_size' => 4, + 'rate' => 4, + 'mode' => 4, + 'mode_bitstream_version' => 4, + 'nb_channels' => 4, + 'bitrate' => 4, + 'framesize' => 4, + 'vbr' => 4, + 'frames_per_packet' => 4, + 'extra_headers' => 4, + 'reserved1' => 4, + 'reserved2' => 4 + ) + ); + + $getid3->info['speex']['speex_version'] = trim($info_ogg['pageheader'][$ogg_page_info['page_seqno']]['speex_version']); + $getid3->info['speex']['sample_rate'] = $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['rate']; + $getid3->info['speex']['channels'] = $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['nb_channels']; + $getid3->info['speex']['vbr'] = (bool)$info_ogg['pageheader'][$ogg_page_info['page_seqno']]['vbr']; + $getid3->info['speex']['band_type'] = getid3_xiph::SpeexBandModeLookup($info_ogg['pageheader'][$ogg_page_info['page_seqno']]['mode']); + + $info_audio['sample_rate'] = $getid3->info['speex']['sample_rate']; + $info_audio['channels'] = $getid3->info['speex']['channels']; + + if ($getid3->info['speex']['vbr']) { + $info_audio['bitrate_mode'] = 'vbr'; + } + } + + // Unsupported Ogg file + else { + + throw new getid3_exception('Expecting either "Speex " or "vorbis" identifier strings, found neither'); + } + + + //// Page 2 - Comment Header + + $ogg_page_info = $this->ParseOggPageHeader(); + $info_ogg['pageheader'][$ogg_page_info['page_seqno']] = $ogg_page_info; + + switch ($info_audio['dataformat']) { + + case 'vorbis': + $file_data = fread($getid3->fp, $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['page_length']); + $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int(substr($file_data, 0, 1)); + $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['stream_type'] = substr($file_data, 1, 6); // hard-coded to 'vorbis' + $this->ParseVorbisCommentsFilepointer(); + break; + + case 'flac': + if (!$this->FLACparseMETAdata()) { + throw new getid3_exception('Failed to parse FLAC headers'); + } + break; + + case 'speex': + fseek($getid3->fp, $info_ogg['pageheader'][$ogg_page_info['page_seqno']]['page_length'], SEEK_CUR); + $this->ParseVorbisCommentsFilepointer(); + break; + } + + + //// Last Page - Number of Samples + + fseek($getid3->fp, max($getid3->info['avdataend'] - getid3::FREAD_BUFFER_SIZE, 0), SEEK_SET); + $last_chunk_of_ogg = strrev(fread($getid3->fp, getid3::FREAD_BUFFER_SIZE)); + + if ($last_OggS_postion = strpos($last_chunk_of_ogg, 'SggO')) { + fseek($getid3->fp, $getid3->info['avdataend'] - ($last_OggS_postion + strlen('SggO')), SEEK_SET); + $getid3->info['avdataend'] = ftell($getid3->fp); + $info_ogg['pageheader']['eos'] = $this->ParseOggPageHeader(); + $info_ogg['samples'] = $info_ogg['pageheader']['eos']['pcm_abs_position']; + $info_ogg['bitrate_average'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / ($info_ogg['samples'] / $info_audio['sample_rate']); + } + + if (!empty($info_ogg['bitrate_average'])) { + $info_audio['bitrate'] = $info_ogg['bitrate_average']; + } elseif (!empty($info_ogg['bitrate_nominal'])) { + $info_audio['bitrate'] = $info_ogg['bitrate_nominal']; + } elseif (!empty($info_ogg['bitrate_min']) && !empty($info_ogg['bitrate_max'])) { + $info_audio['bitrate'] = ($info_ogg['bitrate_min'] + $info_ogg['bitrate_max']) / 2; + } + if (isset($info_audio['bitrate']) && !isset($getid3->info['playtime_seconds'])) { + $getid3->info['playtime_seconds'] = (float)((($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $info_audio['bitrate']); + } + + if (isset($info_ogg['vendor'])) { + $info_audio['encoder'] = preg_replace('/^Encoded with /', '', $info_ogg['vendor']); + + // Vorbis only + if ($info_audio['dataformat'] == 'vorbis') { + + // Vorbis 1.0 starts with Xiph.Org + if (preg_match('/^Xiph.Org/', $info_audio['encoder'])) { + + if ($info_audio['bitrate_mode'] == 'abr') { + + // Set -b 128 on abr files + $info_audio['encoder_options'] = '-b '.round($info_ogg['bitrate_nominal'] / 1000); + + } elseif (($info_audio['bitrate_mode'] == 'vbr') && ($info_audio['channels'] == 2) && ($info_audio['sample_rate'] >= 44100) && ($info_audio['sample_rate'] <= 48000)) { + // Set -q N on vbr files + $info_audio['encoder_options'] = '-q '.getid3_xiph::GetQualityFromNominalBitrate($info_ogg['bitrate_nominal']); + } + } + + if (empty($info_audio['encoder_options']) && !empty($info_ogg['bitrate_nominal'])) { + $info_audio['encoder_options'] = 'Nominal bitrate: '.intval(round($info_ogg['bitrate_nominal'] / 1000)).'kbps'; + } + } + } + + return true; + } + + + + private function ParseOggPageHeader() { + + $getid3 = $this->getid3; + + // http://xiph.org/ogg/vorbis/doc/framing.html + $ogg_header['page_start_offset'] = ftell($getid3->fp); // where we started from in the file + + $file_data = fread($getid3->fp, getid3::FREAD_BUFFER_SIZE); + $file_data_offset = 0; + + while ((substr($file_data, $file_data_offset++, 4) != 'OggS')) { + if ((ftell($getid3->fp) - $ogg_header['page_start_offset']) >= getid3::FREAD_BUFFER_SIZE) { + // should be found before here + return false; + } + if ((($file_data_offset + 28) > strlen($file_data)) || (strlen($file_data) < 28)) { + if (feof($getid3->fp) || (($file_data .= fread($getid3->fp, getid3::FREAD_BUFFER_SIZE)) === false)) { + // get some more data, unless eof, in which case fail + return false; + } + } + } + + $file_data_offset += 3; // page, delimited by 'OggS' + + getid3_lib::ReadSequence('LittleEndian2Int', $ogg_header, $file_data, $file_data_offset, + array ( + 'stream_structver' => 1, + 'flags_raw' => 1, + 'pcm_abs_position' => 8, + 'stream_serialno' => 4, + 'page_seqno' => 4, + 'page_checksum' => 4, + 'page_segments' => 1 + ) + ); + + $file_data_offset += 23; + + $ogg_header['flags']['fresh'] = (bool)($ogg_header['flags_raw'] & 0x01); // fresh packet + $ogg_header['flags']['bos'] = (bool)($ogg_header['flags_raw'] & 0x02); // first page of logical bitstream (bos) + $ogg_header['flags']['eos'] = (bool)($ogg_header['flags_raw'] & 0x04); // last page of logical bitstream (eos) + + $ogg_header['page_length'] = 0; + for ($i = 0; $i < $ogg_header['page_segments']; $i++) { + $ogg_header['segment_table'][$i] = getid3_lib::LittleEndian2Int($file_data{$file_data_offset++}); + $ogg_header['page_length'] += $ogg_header['segment_table'][$i]; + } + $ogg_header['header_end_offset'] = $ogg_header['page_start_offset'] + $file_data_offset; + $ogg_header['page_end_offset'] = $ogg_header['header_end_offset'] + $ogg_header['page_length']; + fseek($getid3->fp, $ogg_header['header_end_offset'], SEEK_SET); + + return $ogg_header; + } + + + + private function ParseVorbisCommentsFilepointer() { + + $getid3 = $this->getid3; + + $original_offset = ftell($getid3->fp); + $comment_start_offset = $original_offset; + $comment_data_offset = 0; + $vorbis_comment_page = 1; + + switch ($getid3->info['audio']['dataformat']) { + + case 'vorbis': + $comment_start_offset = $getid3->info['ogg']['pageheader'][$vorbis_comment_page]['page_start_offset']; // Second Ogg page, after header block + fseek($getid3->fp, $comment_start_offset, SEEK_SET); + $comment_data_offset = 27 + $getid3->info['ogg']['pageheader'][$vorbis_comment_page]['page_segments']; + $comment_data = fread($getid3->fp, getid3_xiph::OggPageSegmentLength($getid3->info['ogg']['pageheader'][$vorbis_comment_page], 1) + $comment_data_offset); + $comment_data_offset += (strlen('vorbis') + 1); + break; + + + case 'flac': + fseek($getid3->fp, $getid3->info['flac']['VORBIS_COMMENT']['raw']['offset'] + 4, SEEK_SET); + $comment_data = fread($getid3->fp, $getid3->info['flac']['VORBIS_COMMENT']['raw']['block_length']); + break; + + + case 'speex': + $comment_start_offset = $getid3->info['ogg']['pageheader'][$vorbis_comment_page]['page_start_offset']; // Second Ogg page, after header block + fseek($getid3->fp, $comment_start_offset, SEEK_SET); + $comment_data_offset = 27 + $getid3->info['ogg']['pageheader'][$vorbis_comment_page]['page_segments']; + $comment_data = fread($getid3->fp, getid3_xiph::OggPageSegmentLength($getid3->info['ogg']['pageheader'][$vorbis_comment_page], 1) + $comment_data_offset); + break; + + + default: + return false; + } + + $vendor_size = getid3_lib::LittleEndian2Int(substr($comment_data, $comment_data_offset, 4)); + $comment_data_offset += 4; + + $getid3->info['ogg']['vendor'] = substr($comment_data, $comment_data_offset, $vendor_size); + $comment_data_offset += $vendor_size; + + $comments_count = getid3_lib::LittleEndian2Int(substr($comment_data, $comment_data_offset, 4)); + $comment_data_offset += 4; + + $getid3->info['avdataoffset'] = $comment_start_offset + $comment_data_offset; + + for ($i = 0; $i < $comments_count; $i++) { + + $getid3->info['ogg']['comments_raw'][$i]['dataoffset'] = $comment_start_offset + $comment_data_offset; + + if (ftell($getid3->fp) < ($getid3->info['ogg']['comments_raw'][$i]['dataoffset'] + 4)) { + $vorbis_comment_page++; + + $ogg_page_info = $this->ParseOggPageHeader(); + $getid3->info['ogg']['pageheader'][$ogg_page_info['page_seqno']] = $ogg_page_info; + + // First, save what we haven't read yet + $as_yet_unused_data = substr($comment_data, $comment_data_offset); + + // Then take that data off the end + $comment_data = substr($comment_data, 0, $comment_data_offset); + + // Add [headerlength] bytes of dummy data for the Ogg Page Header, just to keep absolute offsets correct + $comment_data .= str_repeat("\x00", 27 + $getid3->info['ogg']['pageheader'][$ogg_page_info['page_seqno']]['page_segments']); + $comment_data_offset += (27 + $getid3->info['ogg']['pageheader'][$ogg_page_info['page_seqno']]['page_segments']); + + // Finally, stick the unused data back on the end + $comment_data .= $as_yet_unused_data; + + $comment_data .= fread($getid3->fp, getid3_xiph::OggPageSegmentLength($getid3->info['ogg']['pageheader'][$vorbis_comment_page], 1)); + } + $getid3->info['ogg']['comments_raw'][$i]['size'] = getid3_lib::LittleEndian2Int(substr($comment_data, $comment_data_offset, 4)); + + // replace avdataoffset with position just after the last vorbiscomment + $getid3->info['avdataoffset'] = $getid3->info['ogg']['comments_raw'][$i]['dataoffset'] + $getid3->info['ogg']['comments_raw'][$i]['size'] + 4; + + $comment_data_offset += 4; + while ((strlen($comment_data) - $comment_data_offset) < $getid3->info['ogg']['comments_raw'][$i]['size']) { + + if (($getid3->info['ogg']['comments_raw'][$i]['size'] > $getid3->info['avdataend']) || ($getid3->info['ogg']['comments_raw'][$i]['size'] < 0)) { + throw new getid3_exception('Invalid Ogg comment size (comment #'.$i.', claims to be '.number_format($getid3->info['ogg']['comments_raw'][$i]['size']).' bytes) - aborting reading comments'); + } + + $vorbis_comment_page++; + + $ogg_page_info = $this->ParseOggPageHeader(); + $getid3->info['ogg']['pageheader'][$ogg_page_info['page_seqno']] = $ogg_page_info; + + // First, save what we haven't read yet + $as_yet_unused_data = substr($comment_data, $comment_data_offset); + + // Then take that data off the end + $comment_data = substr($comment_data, 0, $comment_data_offset); + + // Add [headerlength] bytes of dummy data for the Ogg Page Header, just to keep absolute offsets correct + $comment_data .= str_repeat("\x00", 27 + $getid3->info['ogg']['pageheader'][$ogg_page_info['page_seqno']]['page_segments']); + $comment_data_offset += (27 + $getid3->info['ogg']['pageheader'][$ogg_page_info['page_seqno']]['page_segments']); + + // Finally, stick the unused data back on the end + $comment_data .= $as_yet_unused_data; + + //$comment_data .= fread($getid3->fp, $getid3->info['ogg']['pageheader'][$ogg_page_info['page_seqno']]['page_length']); + $comment_data .= fread($getid3->fp, getid3_xiph::OggPageSegmentLength($getid3->info['ogg']['pageheader'][$vorbis_comment_page], 1)); + + //$filebaseoffset += $ogg_page_info['header_end_offset'] - $ogg_page_info['page_start_offset']; + } + $comment_string = substr($comment_data, $comment_data_offset, $getid3->info['ogg']['comments_raw'][$i]['size']); + $comment_data_offset += $getid3->info['ogg']['comments_raw'][$i]['size']; + + if (!$comment_string) { + + // no comment? + $getid3->warning('Blank Ogg comment ['.$i.']'); + + } elseif (strstr($comment_string, '=')) { + + $comment_exploded = explode('=', $comment_string, 2); + $getid3->info['ogg']['comments_raw'][$i]['key'] = strtoupper($comment_exploded[0]); + $getid3->info['ogg']['comments_raw'][$i]['value'] = @$comment_exploded[1]; + $getid3->info['ogg']['comments_raw'][$i]['data'] = base64_decode($getid3->info['ogg']['comments_raw'][$i]['value']); + + $getid3->info['ogg']['comments'][strtolower($getid3->info['ogg']['comments_raw'][$i]['key'])][] = $getid3->info['ogg']['comments_raw'][$i]['value']; + + if ($getid3->option_tags_images) { + $image_chunk_check = getid3_lib_image_size::get($getid3->info['ogg']['comments_raw'][$i]['data']); + $getid3->info['ogg']['comments_raw'][$i]['image_mime'] = image_type_to_mime_type($image_chunk_check[2]); + } + + if (!@$getid3->info['ogg']['comments_raw'][$i]['image_mime'] || ($getid3->info['ogg']['comments_raw'][$i]['image_mime'] == 'application/octet-stream')) { + unset($getid3->info['ogg']['comments_raw'][$i]['image_mime']); + unset($getid3->info['ogg']['comments_raw'][$i]['data']); + } + + + } else { + + $getid3->warning('[known problem with CDex >= v1.40, < v1.50b7] Invalid Ogg comment name/value pair ['.$i.']: '.$comment_string); + } + } + + + // Replay Gain Adjustment + // http://privatewww.essex.ac.uk/~djmrob/replaygain/ + if (isset($getid3->info['ogg']['comments']) && is_array($getid3->info['ogg']['comments'])) { + foreach ($getid3->info['ogg']['comments'] as $index => $commentvalue) { + switch ($index) { + case 'rg_audiophile': + case 'replaygain_album_gain': + $getid3->info['replay_gain']['album']['adjustment'] = (float)$commentvalue[0]; + unset($getid3->info['ogg']['comments'][$index]); + break; + + case 'rg_radio': + case 'replaygain_track_gain': + $getid3->info['replay_gain']['track']['adjustment'] = (float)$commentvalue[0]; + unset($getid3->info['ogg']['comments'][$index]); + break; + + case 'replaygain_album_peak': + $getid3->info['replay_gain']['album']['peak'] = (float)$commentvalue[0]; + unset($getid3->info['ogg']['comments'][$index]); + break; + + case 'rg_peak': + case 'replaygain_track_peak': + $getid3->info['replay_gain']['track']['peak'] = (float)$commentvalue[0]; + unset($getid3->info['ogg']['comments'][$index]); + break; + + case 'replaygain_reference_loudness': + $getid3->info['replay_gain']['reference_volume'] = (float)$commentvalue[0]; + unset($getid3->info['ogg']['comments'][$index]); + break; + } + } + } + + fseek($getid3->fp, $original_offset, SEEK_SET); + + return true; + } + + + + private function ParseFLAC() { + + $getid3 = $this->getid3; + + // http://flac.sourceforge.net/format.html + + $getid3->info['fileformat'] = 'flac'; + $getid3->info['audio']['dataformat'] = 'flac'; + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + $getid3->info['audio']['lossless'] = true; + + return $this->FLACparseMETAdata(); + } + + + + private function FLACparseMETAdata() { + + $getid3 = $this->getid3; + + do { + + $meta_data_block_offset = ftell($getid3->fp); + $meta_data_block_header = fread($getid3->fp, 4); + $meta_data_last_block_flag = (bool)(getid3_lib::BigEndian2Int($meta_data_block_header[0]) & 0x80); + $meta_data_block_type = getid3_lib::BigEndian2Int($meta_data_block_header[0]) & 0x7F; + $meta_data_block_length = getid3_lib::BigEndian2Int(substr($meta_data_block_header, 1, 3)); + $meta_data_block_type_text = getid3_xiph::FLACmetaBlockTypeLookup($meta_data_block_type); + + if ($meta_data_block_length < 0) { + throw new getid3_exception('corrupt or invalid METADATA_BLOCK_HEADER.BLOCK_TYPE ('.$meta_data_block_type.') at offset '.$meta_data_block_offset); + } + + $getid3->info['flac'][$meta_data_block_type_text]['raw'] = array ( + 'offset' => $meta_data_block_offset, + 'last_meta_block' => $meta_data_last_block_flag, + 'block_type' => $meta_data_block_type, + 'block_type_text' => $meta_data_block_type_text, + 'block_length' => $meta_data_block_length, + 'block_data' => @fread($getid3->fp, $meta_data_block_length) + ); + $getid3->info['avdataoffset'] = ftell($getid3->fp); + + switch ($meta_data_block_type_text) { + + case 'STREAMINFO': + if (!$this->FLACparseSTREAMINFO($getid3->info['flac'][$meta_data_block_type_text]['raw']['block_data'])) { + return false; + } + break; + + case 'PADDING': + // ignore + break; + + case 'APPLICATION': + if (!$this->FLACparseAPPLICATION($getid3->info['flac'][$meta_data_block_type_text]['raw']['block_data'])) { + return false; + } + break; + + case 'SEEKTABLE': + if (!$this->FLACparseSEEKTABLE($getid3->info['flac'][$meta_data_block_type_text]['raw']['block_data'])) { + return false; + } + break; + + case 'VORBIS_COMMENT': + $old_offset = ftell($getid3->fp); + fseek($getid3->fp, 0 - $meta_data_block_length, SEEK_CUR); + $this->ParseVorbisCommentsFilepointer($getid3->fp, $getid3->info); + fseek($getid3->fp, $old_offset, SEEK_SET); + break; + + case 'CUESHEET': + if (!$this->FLACparseCUESHEET($getid3->info['flac'][$meta_data_block_type_text]['raw']['block_data'])) { + return false; + } + break; + + case 'PICTURE': + if (!$this->FLACparsePICTURE($getid3->info['flac'][$meta_data_block_type_text]['raw']['block_data'])) { + return false; + } + break; + + default: + $getid3->warning('Unhandled METADATA_BLOCK_HEADER.BLOCK_TYPE ('.$meta_data_block_type.') at offset '.$meta_data_block_offset); + } + + } while ($meta_data_last_block_flag === false); + + + if (isset($getid3->info['flac']['STREAMINFO'])) { + $getid3->info['flac']['compressed_audio_bytes'] = $getid3->info['avdataend'] - $getid3->info['avdataoffset']; + $getid3->info['flac']['uncompressed_audio_bytes'] = $getid3->info['flac']['STREAMINFO']['samples_stream'] * $getid3->info['flac']['STREAMINFO']['channels'] * ($getid3->info['flac']['STREAMINFO']['bits_per_sample'] / 8); + $getid3->info['flac']['compression_ratio'] = $getid3->info['flac']['compressed_audio_bytes'] / $getid3->info['flac']['uncompressed_audio_bytes']; + } + + // set md5_data_source - built into flac 0.5+ + if (isset($getid3->info['flac']['STREAMINFO']['audio_signature'])) { + + if ($getid3->info['flac']['STREAMINFO']['audio_signature'] === str_repeat("\x00", 16)) { + $getid3->warning('FLAC STREAMINFO.audio_signature is null (known issue with libOggFLAC)'); + + } else { + + $getid3->info['md5_data_source'] = ''; + $md5 = $getid3->info['flac']['STREAMINFO']['audio_signature']; + for ($i = 0; $i < strlen($md5); $i++) { + $getid3->info['md5_data_source'] .= str_pad(dechex(ord($md5{$i})), 2, '00', STR_PAD_LEFT); + } + if (!preg_match('/^[0-9a-f]{32}$/', $getid3->info['md5_data_source'])) { + unset($getid3->info['md5_data_source']); + } + + } + + } + + $getid3->info['audio']['bits_per_sample'] = $getid3->info['flac']['STREAMINFO']['bits_per_sample']; + if ($getid3->info['audio']['bits_per_sample'] == 8) { + // special case + // must invert sign bit on all data bytes before MD5'ing to match FLAC's calculated value + // MD5sum calculates on unsigned bytes, but FLAC calculated MD5 on 8-bit audio data as signed + $getid3->warning('FLAC calculates MD5 data strangely on 8-bit audio, so the stored md5_data_source value will not match the decoded WAV file'); + } + if (!empty($getid3->info['ogg']['vendor'])) { + $getid3->info['audio']['encoder'] = $getid3->info['ogg']['vendor']; + } + + return true; + } + + + + private function FLACparseSTREAMINFO($meta_data_block_data) { + + $getid3 = $this->getid3; + + getid3_lib::ReadSequence('BigEndian2Int', $getid3->info['flac']['STREAMINFO'], $meta_data_block_data, 0, + array ( + 'min_block_size' => 2, + 'max_block_size' => 2, + 'min_frame_size' => 3, + 'max_frame_size' => 3 + ) + ); + + $sample_rate_channels_sample_bits_stream_samples = getid3_lib::BigEndian2Bin(substr($meta_data_block_data, 10, 8)); + + $getid3->info['flac']['STREAMINFO']['sample_rate'] = bindec(substr($sample_rate_channels_sample_bits_stream_samples, 0, 20)); + $getid3->info['flac']['STREAMINFO']['channels'] = bindec(substr($sample_rate_channels_sample_bits_stream_samples, 20, 3)) + 1; + $getid3->info['flac']['STREAMINFO']['bits_per_sample'] = bindec(substr($sample_rate_channels_sample_bits_stream_samples, 23, 5)) + 1; + $getid3->info['flac']['STREAMINFO']['samples_stream'] = bindec(substr($sample_rate_channels_sample_bits_stream_samples, 28, 36)); // bindec() returns float in case of int overrun + $getid3->info['flac']['STREAMINFO']['audio_signature'] = substr($meta_data_block_data, 18, 16); + + if (!empty($getid3->info['flac']['STREAMINFO']['sample_rate'])) { + + $getid3->info['audio']['bitrate_mode'] = 'vbr'; + $getid3->info['audio']['sample_rate'] = $getid3->info['flac']['STREAMINFO']['sample_rate']; + $getid3->info['audio']['channels'] = $getid3->info['flac']['STREAMINFO']['channels']; + $getid3->info['audio']['bits_per_sample'] = $getid3->info['flac']['STREAMINFO']['bits_per_sample']; + $getid3->info['playtime_seconds'] = $getid3->info['flac']['STREAMINFO']['samples_stream'] / $getid3->info['flac']['STREAMINFO']['sample_rate']; + $getid3->info['audio']['bitrate'] = (($getid3->info['avdataend'] - $getid3->info['avdataoffset']) * 8) / $getid3->info['playtime_seconds']; + + } else { + + throw new getid3_exception('Corrupt METAdata block: STREAMINFO'); + } + + unset($getid3->info['flac']['STREAMINFO']['raw']); + + return true; + } + + + + private function FLACparseAPPLICATION($meta_data_block_data) { + + $getid3 = $this->getid3; + + $application_id = getid3_lib::BigEndian2Int(substr($meta_data_block_data, 0, 4)); + + $getid3->info['flac']['APPLICATION'][$application_id]['name'] = getid3_xiph::FLACapplicationIDLookup($application_id); + $getid3->info['flac']['APPLICATION'][$application_id]['data'] = substr($meta_data_block_data, 4); + + unset($getid3->info['flac']['APPLICATION']['raw']); + + return true; + } + + + + private function FLACparseSEEKTABLE($meta_data_block_data) { + + $getid3 = $this->getid3; + + $offset = 0; + $meta_data_block_length = strlen($meta_data_block_data); + while ($offset < $meta_data_block_length) { + $sample_number_string = substr($meta_data_block_data, $offset, 8); + $offset += 8; + if ($sample_number_string == "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF") { + + // placeholder point + @$getid3->info['flac']['SEEKTABLE']['placeholders']++; + $offset += 10; + + } else { + + $sample_number = getid3_lib::BigEndian2Int($sample_number_string); + + $getid3->info['flac']['SEEKTABLE'][$sample_number]['offset'] = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 8)); + $offset += 8; + + $getid3->info['flac']['SEEKTABLE'][$sample_number]['samples'] = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 2)); + $offset += 2; + + } + } + + unset($getid3->info['flac']['SEEKTABLE']['raw']); + + return true; + } + + + + private function FLACparseCUESHEET($meta_data_block_data) { + + $getid3 = $this->getid3; + + $getid3->info['flac']['CUESHEET']['media_catalog_number'] = trim(substr($meta_data_block_data, 0, 128), "\0"); + $getid3->info['flac']['CUESHEET']['lead_in_samples'] = getid3_lib::BigEndian2Int(substr($meta_data_block_data, 128, 8)); + $getid3->info['flac']['CUESHEET']['flags']['is_cd'] = (bool)(getid3_lib::BigEndian2Int($meta_data_block_data[136]) & 0x80); + $getid3->info['flac']['CUESHEET']['number_tracks'] = getid3_lib::BigEndian2Int($meta_data_block_data[395]); + + $offset = 396; + + for ($track = 0; $track < $getid3->info['flac']['CUESHEET']['number_tracks']; $track++) { + + $track_sample_offset = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 8)); + $offset += 8; + + $track_number = getid3_lib::BigEndian2Int($meta_data_block_data{$offset++}); + + $getid3->info['flac']['CUESHEET']['tracks'][$track_number]['sample_offset'] = $track_sample_offset; + $getid3->info['flac']['CUESHEET']['tracks'][$track_number]['isrc'] = substr($meta_data_block_data, $offset, 12); + $offset += 12; + + $track_flags_raw = getid3_lib::BigEndian2Int($meta_data_block_data{$offset++}); + $getid3->info['flac']['CUESHEET']['tracks'][$track_number]['flags']['is_audio'] = (bool)($track_flags_raw & 0x80); + $getid3->info['flac']['CUESHEET']['tracks'][$track_number]['flags']['pre_emphasis'] = (bool)($track_flags_raw & 0x40); + + $offset += 13; // reserved + + $getid3->info['flac']['CUESHEET']['tracks'][$track_number]['index_points'] = getid3_lib::BigEndian2Int($meta_data_block_data{$offset++}); + + for ($index = 0; $index < $getid3->info['flac']['CUESHEET']['tracks'][$track_number]['index_points']; $index++) { + + $index_sample_offset = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 8)); + $offset += 8; + + $index_number = getid3_lib::BigEndian2Int($meta_data_block_data{$offset++}); + $getid3->info['flac']['CUESHEET']['tracks'][$track_number]['indexes'][$index_number] = $index_sample_offset; + + $offset += 3; // reserved + } + } + + unset($getid3->info['flac']['CUESHEET']['raw']); + + return true; + } + + + + private function FLACparsePICTURE($meta_data_block_data) { + + $getid3 = $this->getid3; + + $picture = &$getid3->info['flac']['PICTURE'][sizeof($getid3->info['flac']['PICTURE']) - 1]; + + $offset = 0; + + $picture['type'] = $this->FLACpictureTypeLookup(getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4))); + $offset += 4; + + $length = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4)); + $offset += 4; + + $picture['mime_type'] = substr($meta_data_block_data, $offset, $length); + $offset += $length; + + $length = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4)); + $offset += 4; + + $picture['description'] = substr($meta_data_block_data, $offset, $length); + $offset += $length; + + $picture['width'] = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4)); + $offset += 4; + + $picture['height'] = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4)); + $offset += 4; + + $picture['color_depth'] = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4)); + $offset += 4; + + $picture['colors_indexed'] = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4)); + $offset += 4; + + $length = getid3_lib::BigEndian2Int(substr($meta_data_block_data, $offset, 4)); + $offset += 4; + + $picture['image_data'] = substr($meta_data_block_data, $offset, $length); + $offset += $length; + + unset($getid3->info['flac']['PICTURE']['raw']); + + return true; + } + + + + public static function SpeexBandModeLookup($mode) { + + static $lookup = array ( + 0 => 'narrow', + 1 => 'wide', + 2 => 'ultra-wide' + ); + return (isset($lookup[$mode]) ? $lookup[$mode] : null); + } + + + + public static function OggPageSegmentLength($ogg_info_array, $segment_number=1) { + + for ($i = 0; $i < $segment_number; $i++) { + $segment_length = 0; + foreach ($ogg_info_array['segment_table'] as $key => $value) { + $segment_length += $value; + if ($value < 255) { + break; + } + } + } + return $segment_length; + } + + + + public static function GetQualityFromNominalBitrate($nominal_bitrate) { + + // decrease precision + $nominal_bitrate = $nominal_bitrate / 1000; + + if ($nominal_bitrate < 128) { + // q-1 to q4 + $qval = ($nominal_bitrate - 64) / 16; + } elseif ($nominal_bitrate < 256) { + // q4 to q8 + $qval = $nominal_bitrate / 32; + } elseif ($nominal_bitrate < 320) { + // q8 to q9 + $qval = ($nominal_bitrate + 256) / 64; + } else { + // q9 to q10 + $qval = ($nominal_bitrate + 1300) / 180; + } + return round($qval, 1); // 5 or 4.9 + } + + + + public static function FLACmetaBlockTypeLookup($block_type) { + + static $lookup = array ( + 0 => 'STREAMINFO', + 1 => 'PADDING', + 2 => 'APPLICATION', + 3 => 'SEEKTABLE', + 4 => 'VORBIS_COMMENT', + 5 => 'CUESHEET', + 6 => 'PICTURE' + ); + return (isset($lookup[$block_type]) ? $lookup[$block_type] : 'reserved'); + } + + + + public static function FLACapplicationIDLookup($application_id) { + + // http://flac.sourceforge.net/id.html + + static $lookup = array ( + 0x46746F6C => 'flac-tools', // 'Ftol' + 0x46746F6C => 'Sound Font FLAC', // 'SFFL' + 0x7065656D => 'Parseable Embedded Extensible Metadata (specification)', // 'peem' + 0x786D6364 => 'xmcd' + + ); + return (isset($lookup[$application_id]) ? $lookup[$application_id] : 'reserved'); + } + + + public static function FLACpictureTypeLookup($type_id) { + + static $lookup = array ( + + 0 => 'Other', + 1 => "32x32 pixels 'file icon' (PNG only)", + 2 => 'Other file icon', + 3 => 'Cover (front)', + 4 => 'Cover (back)', + 5 => 'Leaflet page', + 6 => 'Media (e.g. label side of CD)', + 7 => 'Lead artist/lead performer/soloist', + 8 => 'Artist/performer', + 9 => 'Conductor', + 10 => 'Band/Orchestra', + 11 => 'Composer', + 12 => 'Lyricist/text writer', + 13 => 'Recording Location', + 14 => 'During recording', + 15 => 'During performance', + 16 => 'Movie/video screen capture', + 17 => 'A bright coloured fish', + 18 => 'Illustration', + 19 => 'Band/artist logotype', + 20 => 'Publisher/Studio logotype' + ); + return (isset($lookup[$type_id]) ? $lookup[$type_id] : 'reserved'); + } + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.bmp.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.bmp.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.bmp.php 3 Jan 2016 20:51:45 -0000 1.1.2.1 @@ -0,0 +1,319 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.graphic.bmp.php | +// | Module for analyzing BMP graphic files. | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.graphic.bmp.php,v 1.1.2.1 2016/01/03 20:51:45 gustafn Exp $ + + + +class getid3_bmp extends getid3_handler +{ + + + public function Analyze() { + + $getid3 = $this->getid3; + + // BITMAPFILEHEADER [14 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_62uq.asp + // all versions + // WORD bfType; + // DWORD bfSize; + // WORD bfReserved1; + // WORD bfReserved2; + // DWORD bfOffBits; + + // shortcuts + $getid3->info['bmp']['header']['raw'] = array (); + $info_bmp = &$getid3->info['bmp']; + $info_bmp_header = &$info_bmp['header']; + $info_bmp_header_raw = &$info_bmp_header['raw']; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $bmp_header = fread($getid3->fp, 14 + 40); + + // Magic bytes + $info_bmp_header_raw['identifier'] = 'BM'; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_bmp_header_raw, $bmp_header, 2, + array ( + 'filesize' => 4, + 'reserved1' => 2, + 'reserved2' => 2, + 'data_offset' => 4, + 'header_size' => 4 + ) + ); + + // Check if the hardcoded-to-1 "planes" is at offset 22 or 26 + $planes22 = getid3_lib::LittleEndian2Int(substr($bmp_header, 22, 2)); + $planes26 = getid3_lib::LittleEndian2Int(substr($bmp_header, 26, 2)); + if (($planes22 == 1) && ($planes26 != 1)) { + $info_bmp['type_os'] = 'OS/2'; + $info_bmp['type_version'] = 1; + } + elseif (($planes26 == 1) && ($planes22 != 1)) { + $info_bmp['type_os'] = 'Windows'; + $info_bmp['type_version'] = 1; + } + elseif ($info_bmp_header_raw['header_size'] == 12) { + $info_bmp['type_os'] = 'OS/2'; + $info_bmp['type_version'] = 1; + } + elseif ($info_bmp_header_raw['header_size'] == 40) { + $info_bmp['type_os'] = 'Windows'; + $info_bmp['type_version'] = 1; + } + elseif ($info_bmp_header_raw['header_size'] == 84) { + $info_bmp['type_os'] = 'Windows'; + $info_bmp['type_version'] = 4; + } + elseif ($info_bmp_header_raw['header_size'] == 100) { + $info_bmp['type_os'] = 'Windows'; + $info_bmp['type_version'] = 5; + } + else { + throw new getid3_exception('Unknown BMP subtype (or not a BMP file)'); + } + + $getid3->info['fileformat'] = 'bmp'; + $getid3->info['video']['dataformat'] = 'bmp'; + $getid3->info['video']['lossless'] = true; + $getid3->info['video']['pixel_aspect_ratio'] = (float)1; + + if ($info_bmp['type_os'] == 'OS/2') { + + // OS/2-format BMP + // http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm + + // DWORD Size; /* Size of this structure in bytes */ + // DWORD Width; /* Bitmap width in pixels */ + // DWORD Height; /* Bitmap height in pixel */ + // WORD NumPlanes; /* Number of bit planes (color depth) */ + // WORD BitsPerPixel; /* Number of bits per pixel per plane */ + + getid3_lib::ReadSequence('LittleEndian2Int', $info_bmp_header_raw, $bmp_header, 18, + array ( + 'width' => 2, + 'height' => 2, + 'planes' => 2, + 'bits_per_pixel' => 2 + ) + ); + + $getid3->info['video']['resolution_x'] = $info_bmp_header_raw['width']; + $getid3->info['video']['resolution_y'] = $info_bmp_header_raw['height']; + $getid3->info['video']['codec'] = 'BI_RGB '.$info_bmp_header_raw['bits_per_pixel'].'-bit'; + $getid3->info['video']['bits_per_sample'] = $info_bmp_header_raw['bits_per_pixel']; + + if ($info_bmp['type_version'] >= 2) { + // DWORD Compression; /* Bitmap compression scheme */ + // DWORD ImageDataSize; /* Size of bitmap data in bytes */ + // DWORD XResolution; /* X resolution of display device */ + // DWORD YResolution; /* Y resolution of display device */ + // DWORD ColorsUsed; /* Number of color table indices used */ + // DWORD ColorsImportant; /* Number of important color indices */ + // WORD Units; /* Type of units used to measure resolution */ + // WORD Reserved; /* Pad structure to 4-byte boundary */ + // WORD Recording; /* Recording algorithm */ + // WORD Rendering; /* Halftoning algorithm used */ + // DWORD Size1; /* Reserved for halftoning algorithm use */ + // DWORD Size2; /* Reserved for halftoning algorithm use */ + // DWORD ColorEncoding; /* Color model used in bitmap */ + // DWORD Identifier; /* Reserved for application use */ + + getid3_lib::ReadSequence('LittleEndian2Int', $info_bmp_header_raw, $bmp_header, 26, + array ( + 'compression' => 4, + 'bmp_data_size' => 4, + 'resolution_h' => 4, + 'resolution_v' => 4, + 'colors_used' => 4, + 'colors_important' => 4, + 'resolution_units' => 2, + 'reserved1' => 2, + 'recording' => 2, + 'rendering' => 2, + 'size1' => 4, + 'size2' => 4, + 'color_encoding' => 4, + 'identifier' => 4 + ) + ); + + $info_bmp_header['compression'] = getid3_bmp::BMPcompressionOS2Lookup($info_bmp_header_raw['compression']); + $getid3->info['video']['codec'] = $info_bmp_header['compression'].' '.$info_bmp_header_raw['bits_per_pixel'].'-bit'; + } + + return true; + } + + + if ($info_bmp['type_os'] == 'Windows') { + + // Windows-format BMP + + // BITMAPINFOHEADER - [40 bytes] http://msdn.microsoft.com/library/en-us/gdi/bitmaps_1rw2.asp + // all versions + // DWORD biSize; + // LONG biWidth; + // LONG biHeight; + // WORD biPlanes; + // WORD biBitCount; + // DWORD biCompression; + // DWORD biSizeImage; + // LONG biXPelsPerMeter; + // LONG biYPelsPerMeter; + // DWORD biClrUsed; + // DWORD biClrImportant; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_bmp_header_raw, $bmp_header, 18, + array ( + 'width' => -4, //signed + 'height' => -4, //signed + 'planes' => 2, + 'bits_per_pixel' => 2, + 'compression' => 4, + 'bmp_data_size' => 4, + 'resolution_h' => -4, //signed + 'resolution_v' => -4, //signed + 'colors_used' => 4, + 'colors_important' => 4 + ) + ); + foreach (array ('width', 'height', 'resolution_h', 'resolution_v') as $key) { + $info_bmp_header_raw[$key] = getid3_lib::LittleEndian2Int($info_bmp_header_raw[$key], true); + } + + $info_bmp_header['compression'] = getid3_bmp::BMPcompressionWindowsLookup($info_bmp_header_raw['compression']); + $getid3->info['video']['resolution_x'] = $info_bmp_header_raw['width']; + $getid3->info['video']['resolution_y'] = $info_bmp_header_raw['height']; + $getid3->info['video']['codec'] = $info_bmp_header['compression'].' '.$info_bmp_header_raw['bits_per_pixel'].'-bit'; + $getid3->info['video']['bits_per_sample'] = $info_bmp_header_raw['bits_per_pixel']; + + // should only be v4+, but BMPs with type_version==1 and BI_BITFIELDS compression have been seen + if (($info_bmp['type_version'] >= 4) || ($info_bmp_header_raw['compression'] == 3)) { + + + $bmp_header .= fread($getid3->fp, 44); + + // BITMAPV4HEADER - [44 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_2k1e.asp + // Win95+, WinNT4.0+ + // DWORD bV4RedMask; + // DWORD bV4GreenMask; + // DWORD bV4BlueMask; + // DWORD bV4AlphaMask; + // DWORD bV4CSType; + // CIEXYZTRIPLE bV4Endpoints; + // DWORD bV4GammaRed; + // DWORD bV4GammaGreen; + // DWORD bV4GammaBlue; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_bmp_header_raw, $bmp_header, 54, + array ( + 'red_mask' => 4, + 'green_mask' => 4, + 'blue_mask' => 4, + 'alpha_mask' => 4, + 'cs_type' => 4, + 'ciexyz_red' => -4, //string + 'ciexyz_green' => -4, //string + 'ciexyz_blue' => -4, //string + 'gamma_red' => 4, + 'gamma_green' => 4, + 'gamma_blue' => 4 + ) + ); + + $info_bmp_header['ciexyz_red'] = getid3_bmp::FixedPoint2_30(strrev($info_bmp_header_raw['ciexyz_red'])); + $info_bmp_header['ciexyz_green'] = getid3_bmp::FixedPoint2_30(strrev($info_bmp_header_raw['ciexyz_green'])); + $info_bmp_header['ciexyz_blue'] = getid3_bmp::FixedPoint2_30(strrev($info_bmp_header_raw['ciexyz_blue'])); + + + if ($info_bmp['type_version'] >= 5) { + $bmp_header .= fread($getid3->fp, 16); + + // BITMAPV5HEADER - [16 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_7c36.asp + // Win98+, Win2000+ + // DWORD bV5Intent; + // DWORD bV5ProfileData; + // DWORD bV5ProfileSize; + // DWORD bV5Reserved; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_bmp_header_raw, $bmp_header, 98, + array ( + 'intent' => 4, + 'profile_data_offset' => 4, + 'profile_data_size' => 4, + 'reserved3' => 4 + ) + ); + + } + } + + return true; + } + + + throw new getid3_exception('Unknown BMP format in header.'); + + } + + + + public static function BMPcompressionWindowsLookup($compression_id) { + + static $lookup = array ( + 0 => 'BI_RGB', + 1 => 'BI_RLE8', + 2 => 'BI_RLE4', + 3 => 'BI_BITFIELDS', + 4 => 'BI_JPEG', + 5 => 'BI_PNG' + ); + return (isset($lookup[$compression_id]) ? $lookup[$compression_id] : 'invalid'); + } + + + + public static function BMPcompressionOS2Lookup($compression_id) { + + static $lookup = array ( + 0 => 'BI_RGB', + 1 => 'BI_RLE8', + 2 => 'BI_RLE4', + 3 => 'Huffman 1D', + 4 => 'BI_RLE24', + ); + return (isset($lookup[$compression_id]) ? $lookup[$compression_id] : 'invalid'); + } + + + public static function FixedPoint2_30($raw_data) { + + $binary_string = getid3_lib::BigEndian2Bin($raw_data); + return bindec(substr($binary_string, 0, 2)) + (float)(bindec(substr($binary_string, 2, 30)) / 1073741824); // pow(2, 30) = 1073741824 + } + + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.gif.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.gif.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.gif.php 3 Jan 2016 20:51:45 -0000 1.1.2.1 @@ -0,0 +1,92 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.graphic.gif.php | +// | Module for analyzing CompuServe GIF graphic files. | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.graphic.gif.php,v 1.1.2.1 2016/01/03 20:51:45 gustafn Exp $ + + + +class getid3_gif extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'gif'; + $getid3->info['video']['dataformat'] = 'gif'; + $getid3->info['video']['lossless'] = true; + $getid3->info['video']['pixel_aspect_ratio'] = (float)1; + + $getid3->info['gif']['header'] = array (); + $info_gif_header = &$getid3->info['gif']['header']; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $gif_header = fread($getid3->fp, 13); + + // Magic bytes + $info_gif_header['raw']['identifier'] = 'GIF'; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_gif_header['raw'], $gif_header, 3, + array ( + 'version' => -3, // string + 'width' => 2, + 'height' => 2, + 'flags' => 1, + 'bg_color_index' => 1, + 'aspect_ratio' => 1 + ) + ); + + $getid3->info['video']['resolution_x'] = $info_gif_header['raw']['width']; + $getid3->info['video']['resolution_y'] = $info_gif_header['raw']['height']; + $getid3->info['gif']['version'] = $info_gif_header['raw']['version']; + + $info_gif_header['flags']['global_color_table'] = (bool)($info_gif_header['raw']['flags'] & 0x80); + + if ($info_gif_header['raw']['flags'] & 0x80) { + // Number of bits per primary color available to the original image, minus 1 + $info_gif_header['bits_per_pixel'] = 3 * ((($info_gif_header['raw']['flags'] & 0x70) >> 4) + 1); + } else { + $info_gif_header['bits_per_pixel'] = 0; + } + + $info_gif_header['flags']['global_color_sorted'] = (bool)($info_gif_header['raw']['flags'] & 0x40); + if ($info_gif_header['flags']['global_color_table']) { + // the number of bytes contained in the Global Color Table. To determine that + // actual size of the color table, raise 2 to [the value of the field + 1] + $info_gif_header['global_color_size'] = pow(2, ($info_gif_header['raw']['flags'] & 0x07) + 1); + $getid3->info['video']['bits_per_sample'] = ($info_gif_header['raw']['flags'] & 0x07) + 1; + } else { + $info_gif_header['global_color_size'] = 0; + } + + if ($info_gif_header['raw']['aspect_ratio'] != 0) { + // Aspect Ratio = (Pixel Aspect Ratio + 15) / 64 + $info_gif_header['aspect_ratio'] = ($info_gif_header['raw']['aspect_ratio'] + 15) / 64; + } + + return true; + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.jpeg.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.jpeg.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.jpeg.php 3 Jan 2016 20:51:45 -0000 1.1.2.1 @@ -0,0 +1,62 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.graphic.jpeg.php | +// | Module for analyzing JPEG graphic files. | +// | dependencies: exif support in PHP (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.graphic.jpeg.php,v 1.1.2.1 2016/01/03 20:51:45 gustafn Exp $ + + + +class getid3_jpeg extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'jpg'; + $getid3->info['video']['dataformat'] = 'jpg'; + $getid3->info['video']['lossless'] = false; + $getid3->info['video']['bits_per_sample'] = 24; + $getid3->info['video']['pixel_aspect_ratio'] = (float)1; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + + list($getid3->info['video']['resolution_x'], $getid3->info['video']['resolution_y'], $type) = getimagesize($getid3->filename); + + if ($type != 2) { + throw new getid3_exception('File detected as JPEG, but is currupt.'); + } + + if (function_exists('exif_read_data')) { + + $getid3->info['jpg']['exif'] = exif_read_data($getid3->filename, '', true, false); + + } else { + + $getid3->warning('EXIF parsing only available when compiled with --enable-exif (or php_exif.dll enabled for Windows).'); + } + + return true; + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.pcd.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.pcd.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.pcd.php 3 Jan 2016 20:51:46 -0000 1.1.2.1 @@ -0,0 +1,56 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.graphic.pcd.php | +// | Module for analyzing PhotoCD (PCD) Image files. | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.graphic.pcd.php,v 1.1.2.1 2016/01/03 20:51:46 gustafn Exp $ + + + +class getid3_pcd extends getid3_handler +{ + + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'pcd'; + $getid3->info['video']['dataformat'] = 'pcd'; + $getid3->info['video']['lossless'] = false; + + fseek($getid3->fp, $getid3->info['avdataoffset'] + 72, SEEK_SET); + + $pcd_flags = fread($getid3->fp, 1); + $pcd_is_vertical = ((ord($pcd_flags) & 0x01) ? true : false); + + if ($pcd_is_vertical) { + $getid3->info['video']['resolution_x'] = 3072; + $getid3->info['video']['resolution_y'] = 2048; + } else { + $getid3->info['video']['resolution_x'] = 2048; + $getid3->info['video']['resolution_y'] = 3072; + } + + } + + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.png.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.png.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.png.php 3 Jan 2016 20:51:46 -0000 1.1.2.1 @@ -0,0 +1,556 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.graphic.png.php | +// | Module for analyzing PNG graphic files. | +// | dependencies: zlib support in PHP (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.graphic.png.php,v 1.1.2.1 2016/01/03 20:51:46 gustafn Exp $ + + + +class getid3_png extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['png'] = array (); + $info_png = &$getid3->info['png']; + + $getid3->info['fileformat'] = 'png'; + $getid3->info['video']['dataformat'] = 'png'; + $getid3->info['video']['lossless'] = false; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $png_filedata = fread($getid3->fp, getid3::FREAD_BUFFER_SIZE); + + // Magic bytes "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A" + + $offset = 8; + + while (((ftell($getid3->fp) - (strlen($png_filedata) - $offset)) < $getid3->info['filesize'])) { + + $chunk['data_length'] = getid3_lib::BigEndian2Int(substr($png_filedata, $offset, 4)); + $offset += 4; + while (((strlen($png_filedata) - $offset) < ($chunk['data_length'] + 4)) && (ftell($getid3->fp) < $getid3->info['filesize'])) { + $png_filedata .= fread($getid3->fp, getid3::FREAD_BUFFER_SIZE); + } + + $chunk['type_text'] = substr($png_filedata, $offset, 4); + $chunk['type_raw'] = getid3_lib::BigEndian2Int($chunk['type_text']); + $offset += 4; + + $chunk['data'] = substr($png_filedata, $offset, $chunk['data_length']); + $offset += $chunk['data_length']; + + $chunk['crc'] = getid3_lib::BigEndian2Int(substr($png_filedata, $offset, 4)); + $offset += 4; + + $chunk['flags']['ancilliary'] = (bool)($chunk['type_raw'] & 0x20000000); + $chunk['flags']['private'] = (bool)($chunk['type_raw'] & 0x00200000); + $chunk['flags']['reserved'] = (bool)($chunk['type_raw'] & 0x00002000); + $chunk['flags']['safe_to_copy'] = (bool)($chunk['type_raw'] & 0x00000020); + + // shortcut + $info_png[$chunk['type_text']] = array (); + $info_png_chunk_type_text = &$info_png[$chunk['type_text']]; + + switch ($chunk['type_text']) { + + case 'IHDR': // Image Header + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['width'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)); + $info_png_chunk_type_text['height'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)); + + getid3_lib::ReadSequence('BigEndian2Int', $info_png_chunk_type_text['raw'], $chunk['data'], 8, + array ( + 'bit_depth' => 1, + 'color_type' => 1, + 'compression_method' => 1, + 'filter_method' => 1, + 'interlace_method' => 1 + ) + ); + + $info_png_chunk_type_text['compression_method_text'] = getid3_png::PNGcompressionMethodLookup($info_png_chunk_type_text['raw']['compression_method']); + $info_png_chunk_type_text['color_type']['palette'] = (bool)($info_png_chunk_type_text['raw']['color_type'] & 0x01); + $info_png_chunk_type_text['color_type']['true_color'] = (bool)($info_png_chunk_type_text['raw']['color_type'] & 0x02); + $info_png_chunk_type_text['color_type']['alpha'] = (bool)($info_png_chunk_type_text['raw']['color_type'] & 0x04); + + $getid3->info['video']['resolution_x'] = $info_png_chunk_type_text['width']; + $getid3->info['video']['resolution_y'] = $info_png_chunk_type_text['height']; + + $getid3->info['video']['bits_per_sample'] = getid3_png::IHDRcalculateBitsPerSample($info_png_chunk_type_text['raw']['color_type'], $info_png_chunk_type_text['raw']['bit_depth']); + break; + + + case 'PLTE': // Palette + $info_png_chunk_type_text['header'] = $chunk; + $palette_offset = 0; + for ($i = 0; $i <= 255; $i++) { + $red = @getid3_lib::BigEndian2Int($chunk['data']{$palette_offset++}); + $green = @getid3_lib::BigEndian2Int($chunk['data']{$palette_offset++}); + $blue = @getid3_lib::BigEndian2Int($chunk['data']{$palette_offset++}); + $info_png_chunk_type_text[$i] = (($red << 16) | ($green << 8) | ($blue)); + } + break; + + + case 'tRNS': // Transparency + $info_png_chunk_type_text['header'] = $chunk; + switch ($info_png['IHDR']['raw']['color_type']) { + case 0: + $info_png_chunk_type_text['transparent_color_gray'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 2)); + break; + + case 2: + $info_png_chunk_type_text['transparent_color_red'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 2)); + $info_png_chunk_type_text['transparent_color_green'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2, 2)); + $info_png_chunk_type_text['transparent_color_blue'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 2)); + break; + + case 3: + for ($i = 0; $i < strlen($chunk['data']); $i++) { + $info_png_chunk_type_text['palette_opacity'][$i] = getid3_lib::BigEndian2Int($chunk['data'][$i]); + } + break; + + case 4: + case 6: + throw new getid3_exception('Invalid color_type in tRNS chunk: '.$info_png['IHDR']['raw']['color_type']); + + default: + $getid3->warning('Unhandled color_type in tRNS chunk: '.$info_png['IHDR']['raw']['color_type']); + break; + } + break; + + + case 'gAMA': // Image Gamma + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['gamma'] = getid3_lib::BigEndian2Int($chunk['data']) / 100000; + break; + + + case 'cHRM': // Primary Chromaticities + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['white_x'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)) / 100000; + $info_png_chunk_type_text['white_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)) / 100000; + $info_png_chunk_type_text['red_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 8, 4)) / 100000; + $info_png_chunk_type_text['red_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 12, 4)) / 100000; + $info_png_chunk_type_text['green_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 16, 4)) / 100000; + $info_png_chunk_type_text['green_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 20, 4)) / 100000; + $info_png_chunk_type_text['blue_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 24, 4)) / 100000; + $info_png_chunk_type_text['blue_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 28, 4)) / 100000; + break; + + + case 'sRGB': // Standard RGB Color Space + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['reindering_intent'] = getid3_lib::BigEndian2Int($chunk['data']); + $info_png_chunk_type_text['reindering_intent_text'] = getid3_png::PNGsRGBintentLookup($info_png_chunk_type_text['reindering_intent']); + break; + + + case 'iCCP': // Embedded ICC Profile + $info_png_chunk_type_text['header'] = $chunk; + list($profilename, $compressiondata) = explode("\x00", $chunk['data'], 2); + $info_png_chunk_type_text['profile_name'] = $profilename; + $info_png_chunk_type_text['compression_method'] = getid3_lib::BigEndian2Int($compressiondata[0]); + $info_png_chunk_type_text['compression_profile'] = substr($compressiondata, 1); + $info_png_chunk_type_text['compression_method_text'] = getid3_png::PNGcompressionMethodLookup($info_png_chunk_type_text['compression_method']); + break; + + + case 'tEXt': // Textual Data + $info_png_chunk_type_text['header'] = $chunk; + list($keyword, $text) = explode("\x00", $chunk['data'], 2); + $info_png_chunk_type_text['keyword'] = $keyword; + $info_png_chunk_type_text['text'] = $text; + + $info_png['comments'][$info_png_chunk_type_text['keyword']][] = $info_png_chunk_type_text['text']; + break; + + + case 'zTXt': // Compressed Textual Data + $info_png_chunk_type_text['header'] = $chunk; + list($keyword, $otherdata) = explode("\x00", $chunk['data'], 2); + $info_png_chunk_type_text['keyword'] = $keyword; + $info_png_chunk_type_text['compression_method'] = getid3_lib::BigEndian2Int(substr($otherdata, 0, 1)); + $info_png_chunk_type_text['compressed_text'] = substr($otherdata, 1); + $info_png_chunk_type_text['compression_method_text'] = getid3_png::PNGcompressionMethodLookup($info_png_chunk_type_text['compression_method']); + + if ($info_png_chunk_type_text['compression_method'] != 0) { + // unknown compression method + break; + } + + if (function_exists('gzuncompress')) { + $info_png_chunk_type_text['text'] = gzuncompress($info_png_chunk_type_text['compressed_text']); + } + else { + if (!@$this->zlib_warning) { + $getid3->warning('PHP does not have --with-zlib support - cannot gzuncompress()'); + } + $this->zlib_warning = true; + } + + + if (isset($info_png_chunk_type_text['text'])) { + $info_png['comments'][$info_png_chunk_type_text['keyword']][] = $info_png_chunk_type_text['text']; + } + break; + + + case 'iTXt': // International Textual Data + $info_png_chunk_type_text['header'] = $chunk; + list($keyword, $otherdata) = explode("\x00", $chunk['data'], 2); + $info_png_chunk_type_text['keyword'] = $keyword; + $info_png_chunk_type_text['compression'] = (bool)getid3_lib::BigEndian2Int(substr($otherdata, 0, 1)); + $info_png_chunk_type_text['compression_method'] = getid3_lib::BigEndian2Int($otherdata[1]); + $info_png_chunk_type_text['compression_method_text'] = getid3_png::PNGcompressionMethodLookup($info_png_chunk_type_text['compression_method']); + list($languagetag, $translatedkeyword, $text) = explode("\x00", substr($otherdata, 2), 3); + $info_png_chunk_type_text['language_tag'] = $languagetag; + $info_png_chunk_type_text['translated_keyword'] = $translatedkeyword; + + if ($info_png_chunk_type_text['compression']) { + + switch ($info_png_chunk_type_text['compression_method']) { + case 0: + if (function_exists('gzuncompress')) { + $info_png_chunk_type_text['text'] = gzuncompress($text); + } + else { + if (!@$this->zlib_warning) { + $getid3->warning('PHP does not have --with-zlib support - cannot gzuncompress()'); + } + $this->zlib_warning = true; + } + break; + + default: + // unknown compression method + break; + } + + } else { + + $info_png_chunk_type_text['text'] = $text; + + } + + if (isset($info_png_chunk_type_text['text'])) { + $info_png['comments'][$info_png_chunk_type_text['keyword']][] = $info_png_chunk_type_text['text']; + } + break; + + + case 'bKGD': // Background Color + $info_png_chunk_type_text['header'] = $chunk; + switch ($info_png['IHDR']['raw']['color_type']) { + case 0: + case 4: + $info_png_chunk_type_text['background_gray'] = getid3_lib::BigEndian2Int($chunk['data']); + break; + + case 2: + case 6: + $info_png_chunk_type_text['background_red'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0 * $info_png['IHDR']['raw']['bit_depth'], $info_png['IHDR']['raw']['bit_depth'])); + $info_png_chunk_type_text['background_green'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 1 * $info_png['IHDR']['raw']['bit_depth'], $info_png['IHDR']['raw']['bit_depth'])); + $info_png_chunk_type_text['background_blue'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2 * $info_png['IHDR']['raw']['bit_depth'], $info_png['IHDR']['raw']['bit_depth'])); + break; + + case 3: + $info_png_chunk_type_text['background_index'] = getid3_lib::BigEndian2Int($chunk['data']); + break; + + default: + break; + } + break; + + + case 'pHYs': // Physical Pixel Dimensions + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['pixels_per_unit_x'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)); + $info_png_chunk_type_text['pixels_per_unit_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)); + $info_png_chunk_type_text['unit_specifier'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 8, 1)); + $info_png_chunk_type_text['unit'] = getid3_png::PNGpHYsUnitLookup($info_png_chunk_type_text['unit_specifier']); + break; + + + case 'sBIT': // Significant Bits + $info_png_chunk_type_text['header'] = $chunk; + switch ($info_png['IHDR']['raw']['color_type']) { + case 0: + $info_png_chunk_type_text['significant_bits_gray'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); + break; + + case 2: + case 3: + $info_png_chunk_type_text['significant_bits_red'] = getid3_lib::BigEndian2Int($chunk['data'][0]); + $info_png_chunk_type_text['significant_bits_green'] = getid3_lib::BigEndian2Int($chunk['data'][1]); + $info_png_chunk_type_text['significant_bits_blue'] = getid3_lib::BigEndian2Int($chunk['data'][2]); + break; + + case 4: + $info_png_chunk_type_text['significant_bits_gray'] = getid3_lib::BigEndian2Int($chunk['data'][0]); + $info_png_chunk_type_text['significant_bits_alpha'] = getid3_lib::BigEndian2Int($chunk['data'][1]); + break; + + case 6: + $info_png_chunk_type_text['significant_bits_red'] = getid3_lib::BigEndian2Int($chunk['data'][0]); + $info_png_chunk_type_text['significant_bits_green'] = getid3_lib::BigEndian2Int($chunk['data'][1]); + $info_png_chunk_type_text['significant_bits_blue'] = getid3_lib::BigEndian2Int($chunk['data'][2]); + $info_png_chunk_type_text['significant_bits_alpha'] = getid3_lib::BigEndian2Int($chunk['data'][3]); + break; + + default: + break; + } + break; + + + case 'sPLT': // Suggested Palette + $info_png_chunk_type_text['header'] = $chunk; + + list($palettename, $otherdata) = explode("\x00", $chunk['data'], 2); + $info_png_chunk_type_text['palette_name'] = $palettename; + + $info_png_chunk_type_text['sample_depth_bits'] = getid3_lib::BigEndian2Int($otherdata[0]); + $info_png_chunk_type_text['sample_depth_bytes'] = $info_png_chunk_type_text['sample_depth_bits'] / 8; + + $s_plt_offset = 1; + $paletteCounter = 0; + while ($s_plt_offset < strlen($otherdata)) { + + $info_png_chunk_type_text['red'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $s_plt_offset, $info_png_chunk_type_text['sample_depth_bytes'])); + $s_plt_offset += $info_png_chunk_type_text['sample_depth_bytes']; + + $info_png_chunk_type_text['green'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $s_plt_offset, $info_png_chunk_type_text['sample_depth_bytes'])); + $s_plt_offset += $info_png_chunk_type_text['sample_depth_bytes']; + + $info_png_chunk_type_text['blue'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $s_plt_offset, $info_png_chunk_type_text['sample_depth_bytes'])); + $s_plt_offset += $info_png_chunk_type_text['sample_depth_bytes']; + + $info_png_chunk_type_text['alpha'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $s_plt_offset, $info_png_chunk_type_text['sample_depth_bytes'])); + $s_plt_offset += $info_png_chunk_type_text['sample_depth_bytes']; + + $info_png_chunk_type_text['frequency'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $s_plt_offset, 2)); + $s_plt_offset += 2; + + $paletteCounter++; + } + break; + + + case 'hIST': // Palette Histogram + $info_png_chunk_type_text['header'] = $chunk; + $h_ist_counter = 0; + while ($h_ist_counter < strlen($chunk['data'])) { + $info_png_chunk_type_text[$h_ist_counter] = getid3_lib::BigEndian2Int(substr($chunk['data'], $h_ist_counter / 2, 2)); + $h_ist_counter += 2; + } + break; + + + case 'tIME': // Image Last-Modification Time + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['year'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 2)); + $info_png_chunk_type_text['month'] = getid3_lib::BigEndian2Int($chunk['data']{2}); + $info_png_chunk_type_text['day'] = getid3_lib::BigEndian2Int($chunk['data']{3}); + $info_png_chunk_type_text['hour'] = getid3_lib::BigEndian2Int($chunk['data']{4}); + $info_png_chunk_type_text['minute'] = getid3_lib::BigEndian2Int($chunk['data']{5}); + $info_png_chunk_type_text['second'] = getid3_lib::BigEndian2Int($chunk['data']{6}); + $info_png_chunk_type_text['unix'] = gmmktime($info_png_chunk_type_text['hour'], $info_png_chunk_type_text['minute'], $info_png_chunk_type_text['second'], $info_png_chunk_type_text['month'], $info_png_chunk_type_text['day'], $info_png_chunk_type_text['year']); + break; + + + case 'oFFs': // Image Offset + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['position_x'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4), false, true); + $info_png_chunk_type_text['position_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4), false, true); + $info_png_chunk_type_text['unit_specifier'] = getid3_lib::BigEndian2Int($chunk['data'][8]); + $info_png_chunk_type_text['unit'] = getid3_png::PNGoFFsUnitLookup($info_png_chunk_type_text['unit_specifier']); + break; + + + case 'pCAL': // Calibration Of Pixel Values + $info_png_chunk_type_text['header'] = $chunk; + list($calibrationname, $otherdata) = explode("\x00", $chunk['data'], 2); + $info_png_chunk_type_text['calibration_name'] = $calibrationname; + $info_png_chunk_type_text['original_zero'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4), false, true); + $info_png_chunk_type_text['original_max'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4), false, true); + $info_png_chunk_type_text['equation_type'] = getid3_lib::BigEndian2Int($chunk['data'][8]); + $info_png_chunk_type_text['equation_type_text'] = getid3_png::PNGpCALequationTypeLookup($info_png_chunk_type_text['equation_type']); + $info_png_chunk_type_text['parameter_count'] = getid3_lib::BigEndian2Int($chunk['data'][9]); + $info_png_chunk_type_text['parameters'] = explode("\x00", substr($chunk['data'], 10)); + break; + + + case 'sCAL': // Physical Scale Of Image Subject + $info_png_chunk_type_text['header'] = $chunk; + $info_png_chunk_type_text['unit_specifier'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); + $info_png_chunk_type_text['unit'] = getid3_png::PNGsCALUnitLookup($info_png_chunk_type_text['unit_specifier']); + list($info_png_chunk_type_text['pixel_width'], $info_png_chunk_type_text['pixel_height']) = explode("\x00", substr($chunk['data'], 1)); + break; + + + case 'gIFg': // GIF Graphic Control Extension + $gIFg_counter = 0; + if (isset($info_png_chunk_type_text) && is_array($info_png_chunk_type_text)) { + $gIFg_counter = count($info_png_chunk_type_text); + } + $info_png_chunk_type_text[$gIFg_counter]['header'] = $chunk; + $info_png_chunk_type_text[$gIFg_counter]['disposal_method'] = getid3_lib::BigEndian2Int($chunk['data'][0]); + $info_png_chunk_type_text[$gIFg_counter]['user_input_flag'] = getid3_lib::BigEndian2Int($chunk['data'][1]); + $info_png_chunk_type_text[$gIFg_counter]['delay_time'] = getid3_lib::BigEndian2Int($chunk['data'][2]); + break; + + + case 'gIFx': // GIF Application Extension + $gIFx_counter = 0; + if (isset($info_png_chunk_type_text) && is_array($info_png_chunk_type_text)) { + $gIFx_counter = count($info_png_chunk_type_text); + } + $info_png_chunk_type_text[$gIFx_counter]['header'] = $chunk; + $info_png_chunk_type_text[$gIFx_counter]['application_identifier'] = substr($chunk['data'], 0, 8); + $info_png_chunk_type_text[$gIFx_counter]['authentication_code'] = substr($chunk['data'], 8, 3); + $info_png_chunk_type_text[$gIFx_counter]['application_data'] = substr($chunk['data'], 11); + break; + + + case 'IDAT': // Image Data + $idat_information_field_index = 0; + if (isset($info_png['IDAT']) && is_array($info_png['IDAT'])) { + $idat_information_field_index = count($info_png['IDAT']); + } + unset($chunk['data']); + $info_png_chunk_type_text[$idat_information_field_index]['header'] = $chunk; + break; + + + case 'IEND': // Image Trailer + $info_png_chunk_type_text['header'] = $chunk; + break; + + + default: + $info_png_chunk_type_text['header'] = $chunk; + $getid3->warning('Unhandled chunk type: '.$chunk['type_text']); + break; + } + } + + return true; + } + + + + public static function PNGsRGBintentLookup($sRGB) { + + static $lookup = array ( + 0 => 'Perceptual', + 1 => 'Relative colorimetric', + 2 => 'Saturation', + 3 => 'Absolute colorimetric' + ); + return (isset($lookup[$sRGB]) ? $lookup[$sRGB] : 'invalid'); + } + + + + public static function PNGcompressionMethodLookup($compression_method) { + + return ($compression_method == 0 ? 'deflate/inflate' : 'invalid'); + } + + + + public static function PNGpHYsUnitLookup($unit_id) { + + static $lookup = array ( + 0 => 'unknown', + 1 => 'meter' + ); + return (isset($lookup[$unit_id]) ? $lookup[$unit_id] : 'invalid'); + } + + + + public static function PNGoFFsUnitLookup($unit_id) { + + static $lookup = array ( + 0 => 'pixel', + 1 => 'micrometer' + ); + return (isset($lookup[$unit_id]) ? $lookup[$unit_id] : 'invalid'); + } + + + + public static function PNGpCALequationTypeLookup($equation_type) { + + static $lookup = array ( + 0 => 'Linear mapping', + 1 => 'Base-e exponential mapping', + 2 => 'Arbitrary-base exponential mapping', + 3 => 'Hyperbolic mapping' + ); + return (isset($lookup[$equation_type]) ? $lookup[$equation_type] : 'invalid'); + } + + + + public static function PNGsCALUnitLookup($unit_id) { + + static $lookup = array ( + 0 => 'meter', + 1 => 'radian' + ); + return (isset($lookup[$unit_id]) ? $lookup[$unit_id] : 'invalid'); + } + + + + public static function IHDRcalculateBitsPerSample($color_type, $bit_depth) { + + switch ($color_type) { + case 0: // Each pixel is a grayscale sample. + return $bit_depth; + + case 2: // Each pixel is an R,G,B triple + return 3 * $bit_depth; + + case 3: // Each pixel is a palette index; a PLTE chunk must appear. + return $bit_depth; + + case 4: // Each pixel is a grayscale sample, followed by an alpha sample. + return 2 * $bit_depth; + + case 6: // Each pixel is an R,G,B triple, followed by an alpha sample. + return 4 * $bit_depth; + } + return false; + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.tiff.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.tiff.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.graphic.tiff.php 3 Jan 2016 20:51:46 -0000 1.1.2.1 @@ -0,0 +1,215 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.graphic.tiff.php | +// | Module for analyzing TIFF graphic files. | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.graphic.tiff.php,v 1.1.2.1 2016/01/03 20:51:46 gustafn Exp $ + + + +class getid3_tiff extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + fseek($getid3->fp, $getid3->info['avdataoffset'], SEEK_SET); + $tiff_header = fread($getid3->fp, 4); + + $getid3->info['tiff']['byte_order'] = substr($tiff_header, 0, 2) == 'II' ? 'Intel' : 'Motorola'; + $endian2int = substr($tiff_header, 0, 2) == 'II' ? 'LittleEndian2Int' : 'BigEndian2Int'; + + $getid3->info['fileformat'] = 'tiff'; + $getid3->info['video']['dataformat'] = 'tiff'; + $getid3->info['video']['lossless'] = true; + $getid3->info['tiff']['ifd'] = array (); + $current_ifd = array (); + + $field_type_byte_length = array (1=>1, 2=>1, 3=>2, 4=>4, 5=>8); + + $next_ifd_offset = getid3_lib::$endian2int(fread($getid3->fp, 4)); + + while ($next_ifd_offset > 0) { + + $current_ifd['offset'] = $next_ifd_offset; + + fseek($getid3->fp, $getid3->info['avdataoffset'] + $next_ifd_offset, SEEK_SET); + $current_ifd['fieldcount'] = getid3_lib::$endian2int(fread($getid3->fp, 2)); + + for ($i = 0; $i < $current_ifd['fieldcount']; $i++) { + + // shortcut + $current_ifd['fields'][$i] = array (); + $current_ifd_fields_i = &$current_ifd['fields'][$i]; + + $current_ifd_fields_i['raw']['tag'] = getid3_lib::$endian2int(fread($getid3->fp, 2)); + $current_ifd_fields_i['raw']['type'] = getid3_lib::$endian2int(fread($getid3->fp, 2)); + $current_ifd_fields_i['raw']['length'] = getid3_lib::$endian2int(fread($getid3->fp, 4)); + $current_ifd_fields_i['raw']['offset'] = fread($getid3->fp, 4); + + switch ($current_ifd_fields_i['raw']['type']) { + case 1: // BYTE An 8-bit unsigned integer. + if ($current_ifd_fields_i['raw']['length'] <= 4) { + $current_ifd_fields_i['value'] = getid3_lib::$endian2int(substr($current_ifd_fields_i['raw']['offset'], 0, 1)); + } else { + $current_ifd_fields_i['offset'] = getid3_lib::$endian2int($current_ifd_fields_i['raw']['offset']); + } + break; + + case 2: // ASCII 8-bit bytes that store ASCII codes; the last byte must be null. + if ($current_ifd_fields_i['raw']['length'] <= 4) { + $current_ifd_fields_i['value'] = substr($current_ifd_fields_i['raw']['offset'], 3); + } else { + $current_ifd_fields_i['offset'] = getid3_lib::$endian2int($current_ifd_fields_i['raw']['offset']); + } + break; + + case 3: // SHORT A 16-bit (2-byte) unsigned integer. + if ($current_ifd_fields_i['raw']['length'] <= 2) { + $current_ifd_fields_i['value'] = getid3_lib::$endian2int(substr($current_ifd_fields_i['raw']['offset'], 0, 2)); + } else { + $current_ifd_fields_i['offset'] = getid3_lib::$endian2int($current_ifd_fields_i['raw']['offset']); + } + break; + + case 4: // LONG A 32-bit (4-byte) unsigned integer. + if ($current_ifd_fields_i['raw']['length'] <= 1) { + $current_ifd_fields_i['value'] = getid3_lib::$endian2int($current_ifd_fields_i['raw']['offset']); + } else { + $current_ifd_fields_i['offset'] = getid3_lib::$endian2int($current_ifd_fields_i['raw']['offset']); + } + break; + + case 5: // RATIONAL Two LONG_s: the first represents the numerator of a fraction, the second the denominator. + break; + } + } + + $getid3->info['tiff']['ifd'][] = $current_ifd; + $current_ifd = array (); + $next_ifd_offset = getid3_lib::$endian2int(fread($getid3->fp, 4)); + + } + + foreach ($getid3->info['tiff']['ifd'] as $ifd_id => $ifd_array) { + foreach ($ifd_array['fields'] as $key => $field_array) { + switch ($field_array['raw']['tag']) { + case 256: // ImageWidth + case 257: // ImageLength + case 258: // BitsPerSample + case 259: // Compression + if (!isset($field_array['value'])) { + fseek($getid3->fp, $field_array['offset'], SEEK_SET); + $getid3->info['tiff']['ifd'][$ifd_id]['fields'][$key]['raw']['data'] = fread($getid3->fp, $field_array['raw']['length'] * $field_type_byte_length[$field_array['raw']['type']]); + } + break; + + case 270: // ImageDescription + case 271: // Make + case 272: // Model + case 305: // Software + case 306: // DateTime + case 315: // Artist + case 316: // HostComputer + if (isset($field_array['value'])) { + $getid3->info['tiff']['ifd'][$ifd_id]['fields'][$key]['raw']['data'] = $field_array['value']; + } else { + fseek($getid3->fp, $field_array['offset'], SEEK_SET); + $getid3->info['tiff']['ifd'][$ifd_id]['fields'][$key]['raw']['data'] = fread($getid3->fp, $field_array['raw']['length'] * $field_type_byte_length[$field_array['raw']['type']]); + } + break; + } + switch ($field_array['raw']['tag']) { + case 256: // ImageWidth + $getid3->info['video']['resolution_x'] = $field_array['value']; + break; + + case 257: // ImageLength + $getid3->info['video']['resolution_y'] = $field_array['value']; + break; + + case 258: // BitsPerSample + if (isset($field_array['value'])) { + $getid3->info['video']['bits_per_sample'] = $field_array['value']; + } else { + $getid3->info['video']['bits_per_sample'] = 0; + for ($i = 0; $i < $field_array['raw']['length']; $i++) { + $getid3->info['video']['bits_per_sample'] += getid3_lib::$endian2int(substr($getid3->info['tiff']['ifd'][$ifd_id]['fields'][$key]['raw']['data'], $i * $field_type_byte_length[$field_array['raw']['type']], $field_type_byte_length[$field_array['raw']['type']])); + } + } + break; + + case 259: // Compression + $getid3->info['video']['codec'] = getid3_tiff::TIFFcompressionMethod($field_array['value']); + break; + + case 270: // ImageDescription + case 271: // Make + case 272: // Model + case 305: // Software + case 306: // DateTime + case 315: // Artist + case 316: // HostComputer + @$getid3->info['tiff']['comments'][getid3_tiff::TIFFcommentName($field_array['raw']['tag'])][] = $getid3->info['tiff']['ifd'][$ifd_id]['fields'][$key]['raw']['data']; + break; + + default: + break; + } + } + } + + return true; + } + + + + public static function TIFFcompressionMethod($id) { + + static $lookup = array ( + 1 => 'Uncompressed', + 2 => 'Huffman', + 3 => 'Fax - CCITT 3', + 5 => 'LZW', + 32773 => 'PackBits', + ); + return (isset($lookup[$id]) ? $lookup[$id] : 'unknown/invalid ('.$id.')'); + } + + + + public static function TIFFcommentName($id) { + + static $lookup = array ( + 270 => 'imagedescription', + 271 => 'make', + 272 => 'model', + 305 => 'software', + 306 => 'datetime', + 315 => 'artist', + 316 => 'hostcomputer', + ); + return (isset($lookup[$id]) ? $lookup[$id] : 'unknown/invalid ('.$id.')'); + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.lib.data_hash.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.lib.data_hash.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.lib.data_hash.php 3 Jan 2016 20:51:47 -0000 1.1.2.1 @@ -0,0 +1,196 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.lib.data-hash.php | +// | getID3() library file. | +// | dependencies: NONE. | +// +----------------------------------------------------------------------+ +// +// $Id: module.lib.data_hash.php,v 1.1.2.1 2016/01/03 20:51:47 gustafn Exp $ + + + +class getid3_lib_data_hash +{ + + private $getid3; + + + // constructer - calculate md5/sha1 data + public function __construct(getID3 $getid3, $algorithm) { + + $this->getid3 = $getid3; + + // Check algorithm + if (!preg_match('/^(md5|sha1)$/', $algorithm)) { + throw new getid3_exception('Unsupported algorithm, "'.$algorithm.'", in GetHashdata()'); + } + + + //// Handle ogg vorbis files + + if ((@$getid3->info['fileformat'] == 'ogg') && (@$getid3->info['audio']['dataformat'] == 'vorbis')) { + + // We cannot get an identical md5_data value for Ogg files where the comments + // span more than 1 Ogg page (compared to the same audio data with smaller + // comments) using the normal getID3() method of MD5'ing the data between the + // end of the comments and the end of the file (minus any trailing tags), + // because the page sequence numbers of the pages that the audio data is on + // do not match. Under normal circumstances, where comments are smaller than + // the nominal 4-8kB page size, then this is not a problem, but if there are + // very large comments, the only way around it is to strip off the comment + // tags with vorbiscomment and MD5 that file. + // This procedure must be applied to ALL Ogg files, not just the ones with + // comments larger than 1 page, because the below method simply MD5's the + // whole file with the comments stripped, not just the portion after the + // comments block (which is the standard getID3() method. + + // The above-mentioned problem of comments spanning multiple pages and changing + // page sequence numbers likely happens for OggSpeex and OggFLAC as well, but + // currently vorbiscomment only works on OggVorbis files. + + if ((bool)ini_get('safe_mode')) { + throw new getid3_exception('PHP running in Safe Mode - cannot make system call to vorbiscomment[.exe] needed for '.$algorithm.'_data.'); + } + + if (!preg_match('/^Vorbiscomment /', `vorbiscomment --version 2>&1`)) { + throw new getid3_exception('vorbiscomment[.exe] binary not found in path. UNIX: typically /usr/bin. Windows: typically c:\windows\system32.'); + } + + // Prevent user from aborting script + $old_abort = ignore_user_abort(true); + + // Create empty file + $empty = tempnam('*', 'getID3'); + touch($empty); + + // Use vorbiscomment to make temp file without comments + $temp = tempnam('*', 'getID3'); + + $command_line = 'vorbiscomment -w -c '.escapeshellarg($empty).' '.escapeshellarg(realpath($getid3->filename)).' '.escapeshellarg($temp).' 2>&1'; + + // Error from vorbiscomment + if ($vorbis_comment_error = `$command_line`) { + throw new getid3_exception('System call to vorbiscomment[.exe] failed.'); + } + + // Get hash of newly created file + $hash_function = $algorithm . '_file'; + $getid3->info[$algorithm.'_data'] = $hash_function($temp); + + // Clean up + unlink($empty); + unlink($temp); + + // Reset abort setting + ignore_user_abort($old_abort); + + // Return success + return true; + } + + //// Handle other file formats + + // Get hash from part of file + if (@$getid3->info['avdataoffset'] || (@$getid3->info['avdataend'] && @$getid3->info['avdataend'] < $getid3->info['filesize'])) { + + if ((bool)ini_get('safe_mode')) { + $getid3->warning('PHP running in Safe Mode - backtick operator not available, using slower non-system-call '.$algorithm.' algorithm.'); + $hash_function = 'hash_file_partial_safe_mode'; + } + else { + $hash_function = 'hash_file_partial'; + } + + $getid3->info[$algorithm.'_data'] = $this->$hash_function($getid3->filename, $getid3->info['avdataoffset'], $getid3->info['avdataend'], $algorithm); + } + + // Get hash from whole file - use built-in md5_file() and sha1_file() + else { + $hash_function = $algorithm . '_file'; + $getid3->info[$algorithm.'_data'] = $hash_function($getid3->filename); + } + } + + + + // Return md5/sha1sum for a file from starting position to absolute end position + // Using windows system call + private function hash_file_partial($file, $offset, $end, $algorithm) { + + // It seems that sha1sum.exe for Windows only works on physical files, does not accept piped data + // Fall back to create-temp-file method: + if ($algorithm == 'sha1' && strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { + return $this->hash_file_partial_safe_mode($file, $offset, $end, $algorithm); + } + + // Check for presence of binaries and revert to safe mode if not found + if (!`head --version`) { + return $this->hash_file_partial_safe_mode($file, $offset, $end, $algorithm); + } + + if (!`tail --version`) { + return $this->hash_file_partial_safe_mode($file, $offset, $end, $algorithm); + } + + if (!`${algorithm}sum --version`) { + return $this->hash_file_partial_safe_mode($file, $offset, $end, $algorithm); + } + + $size = $end - $offset; + $command_line = 'head -c'.$end.' '.escapeshellarg(realpath($file)).' | tail -c'.$size.' | '.$algorithm.'sum'; + return substr(`$command_line`, 0, $algorithm == 'md5' ? 32 : 40); + } + + + + // Return md5/sha1sum for a file from starting position to absolute end position + // Using slow safe_mode temp file + private function hash_file_partial_safe_mode($file, $offset, $end, $algorithm) { + + // Attempt to create a temporary file in the system temp directory - invalid dirname should force to system temp dir + if (($data_filename = tempnam('*', 'getID3')) === false) { + throw new getid3_exception('Unable to create temporary file.'); + } + + // Init + $result = false; + + // Copy parts of file + if ($fp = @fopen($file, 'rb')) { + + if ($fp_data = @fopen($data_filename, 'wb')) { + + fseek($fp, $offset, SEEK_SET); + $bytes_left_to_write = $end - $offset; + while (($bytes_left_to_write > 0) && ($buffer = fread($fp, getid3::FREAD_BUFFER_SIZE))) { + $bytes_written = fwrite($fp_data, $buffer, $bytes_left_to_write); + $bytes_left_to_write -= $bytes_written; + } + fclose($fp_data); + $hash_function = $algorithm . '_file'; + $result = $hash_function($data_filename); + + } + fclose($fp); + } + unlink($data_filename); + return $result; + } + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.lib.iconv_replacement.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.lib.iconv_replacement.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.lib.iconv_replacement.php 3 Jan 2016 20:51:47 -0000 1.1.2.1 @@ -0,0 +1,415 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.lib.iconv_replacement.php | +// | getID3() library file. | +// | dependencies: NONE, required by getid3.php if no iconv() present. | +// +----------------------------------------------------------------------+ +// +// $Id: module.lib.iconv_replacement.php,v 1.1.2.1 2016/01/03 20:51:47 gustafn Exp $ + + +class getid3_iconv_replacement +{ + + public static function iconv($in_charset, $out_charset, $string) { + + if ($in_charset == $out_charset) { + return $string; + } + + static $supported_charsets = array ( + 'ISO-8859-1' => 'iso88591', + 'UTF-8' => 'utf8', + 'UTF-16BE' => 'utf16be', + 'UTF-16LE' => 'utf16le', + 'UTF-16' => 'utf16' + ); + + // Convert + $function_name = 'iconv_' . @$supported_charsets[$in_charset] . '_' . @$supported_charsets[$out_charset]; + + if (is_callable(array('getid3_iconv_replacement', $function_name))) { + return getid3_iconv_replacement::$function_name($string); + } + + // Invalid charset used + if (!@$supported_charsets[$in_charset]) { + throw new getid3_exception('PHP does not have iconv() support - cannot use ' . $in_charset . ' charset.'); + } + + if (!@$supported_charsets[$out_charset]) { + throw new getid3_exception('PHP does not have iconv() support - cannot use ' . $out_charset . ' charset.'); + } + } + + + + public static function iconv_int_utf8($charval) { + if ($charval < 128) { + // 0bbbbbbb + $newcharstring = chr($charval); + } elseif ($charval < 2048) { + // 110bbbbb 10bbbbbb + $newcharstring = chr(($charval >> 6) | 0xC0); + $newcharstring .= chr(($charval & 0x3F) | 0x80); + } elseif ($charval < 65536) { + // 1110bbbb 10bbbbbb 10bbbbbb + $newcharstring = chr(($charval >> 12) | 0xE0); + $newcharstring .= chr(($charval >> 6) | 0xC0); + $newcharstring .= chr(($charval & 0x3F) | 0x80); + } else { + // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + $newcharstring = chr(($charval >> 18) | 0xF0); + $newcharstring .= chr(($charval >> 12) | 0xC0); + $newcharstring .= chr(($charval >> 6) | 0xC0); + $newcharstring .= chr(($charval & 0x3F) | 0x80); + } + return $newcharstring; + } + + + + // ISO-8859-1 => UTF-8 + public static function iconv_iso88591_utf8($string, $bom=false) { + if (function_exists('utf8_encode')) { + return utf8_encode($string); + } + // utf8_encode() unavailable, use getID3()'s iconv() conversions (possibly PHP is compiled without XML support) + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xEF\xBB\xBF"; + } + for ($i = 0; $i < strlen($string); $i++) { + $charval = ord($string{$i}); + $newcharstring .= getid3_iconv_replacement::iconv_int_utf8($charval); + } + return $newcharstring; + } + + + + // ISO-8859-1 => UTF-16BE + public static function iconv_iso88591_utf16be($string, $bom=false) { + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xFE\xFF"; + } + for ($i = 0; $i < strlen($string); $i++) { + $newcharstring .= "\x00".$string{$i}; + } + return $newcharstring; + } + + + + // ISO-8859-1 => UTF-16LE + public static function iconv_iso88591_utf16le($string, $bom=false) { + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xFF\xFE"; + } + for ($i = 0; $i < strlen($string); $i++) { + $newcharstring .= $string{$i}."\x00"; + } + return $newcharstring; + } + + + + // ISO-8859-1 => UTF-16 + public static function iconv_iso88591_utf16($string) { + return getid3_lib::iconv_iso88591_utf16le($string, true); + } + + + + // UTF-8 => ISO-8859-1 + public static function iconv_utf8_iso88591($string) { + if (function_exists('utf8_decode')) { + return utf8_decode($string); + } + // utf8_decode() unavailable, use getID3()'s iconv() conversions (possibly PHP is compiled without XML support) + $newcharstring = ''; + $offset = 0; + $stringlength = strlen($string); + while ($offset < $stringlength) { + if ((ord($string{$offset}) | 0x07) == 0xF7) { + // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x07) << 18) & + ((ord($string{($offset + 1)}) & 0x3F) << 12) & + ((ord($string{($offset + 2)}) & 0x3F) << 6) & + (ord($string{($offset + 3)}) & 0x3F); + $offset += 4; + } elseif ((ord($string{$offset}) | 0x0F) == 0xEF) { + // 1110bbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) & + ((ord($string{($offset + 1)}) & 0x3F) << 6) & + (ord($string{($offset + 2)}) & 0x3F); + $offset += 3; + } elseif ((ord($string{$offset}) | 0x1F) == 0xDF) { + // 110bbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x1F) << 6) & + (ord($string{($offset + 1)}) & 0x3F); + $offset += 2; + } elseif ((ord($string{$offset}) | 0x7F) == 0x7F) { + // 0bbbbbbb + $charval = ord($string{$offset}); + $offset += 1; + } else { + // error? throw some kind of warning here? + $charval = false; + $offset += 1; + } + if ($charval !== false) { + $newcharstring .= (($charval < 256) ? chr($charval) : '?'); + } + } + return $newcharstring; + } + + + + // UTF-8 => UTF-16BE + public static function iconv_utf8_utf16be($string, $bom=false) { + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xFE\xFF"; + } + $offset = 0; + $stringlength = strlen($string); + while ($offset < $stringlength) { + if ((ord($string{$offset}) | 0x07) == 0xF7) { + // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x07) << 18) & + ((ord($string{($offset + 1)}) & 0x3F) << 12) & + ((ord($string{($offset + 2)}) & 0x3F) << 6) & + (ord($string{($offset + 3)}) & 0x3F); + $offset += 4; + } elseif ((ord($string{$offset}) | 0x0F) == 0xEF) { + // 1110bbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) & + ((ord($string{($offset + 1)}) & 0x3F) << 6) & + (ord($string{($offset + 2)}) & 0x3F); + $offset += 3; + } elseif ((ord($string{$offset}) | 0x1F) == 0xDF) { + // 110bbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x1F) << 6) & + (ord($string{($offset + 1)}) & 0x3F); + $offset += 2; + } elseif ((ord($string{$offset}) | 0x7F) == 0x7F) { + // 0bbbbbbb + $charval = ord($string{$offset}); + $offset += 1; + } else { + // error? throw some kind of warning here? + $charval = false; + $offset += 1; + } + if ($charval !== false) { + $newcharstring .= (($charval < 65536) ? getid3_lib::BigEndian2String($charval, 2) : "\x00".'?'); + } + } + return $newcharstring; + } + + + + // UTF-8 => UTF-16LE + public static function iconv_utf8_utf16le($string, $bom=false) { + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xFF\xFE"; + } + $offset = 0; + $stringlength = strlen($string); + while ($offset < $stringlength) { + if ((ord($string{$offset}) | 0x07) == 0xF7) { + // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x07) << 18) & + ((ord($string{($offset + 1)}) & 0x3F) << 12) & + ((ord($string{($offset + 2)}) & 0x3F) << 6) & + (ord($string{($offset + 3)}) & 0x3F); + $offset += 4; + } elseif ((ord($string{$offset}) | 0x0F) == 0xEF) { + // 1110bbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) & + ((ord($string{($offset + 1)}) & 0x3F) << 6) & + (ord($string{($offset + 2)}) & 0x3F); + $offset += 3; + } elseif ((ord($string{$offset}) | 0x1F) == 0xDF) { + // 110bbbbb 10bbbbbb + $charval = ((ord($string{($offset + 0)}) & 0x1F) << 6) & + (ord($string{($offset + 1)}) & 0x3F); + $offset += 2; + } elseif ((ord($string{$offset}) | 0x7F) == 0x7F) { + // 0bbbbbbb + $charval = ord($string{$offset}); + $offset += 1; + } else { + // error? maybe throw some warning here? + $charval = false; + $offset += 1; + } + if ($charval !== false) { + $newcharstring .= (($charval < 65536) ? getid3_lib::LittleEndian2String($charval, 2) : '?'."\x00"); + } + } + return $newcharstring; + } + + + + // UTF-8 => UTF-16 + public static function iconv_utf8_utf16($string) { + return getid3_lib::iconv_utf8_utf16le($string, true); + } + + + + // UTF-16BE => ISO-8859-1 + public static function iconv_utf16be_iso88591($string) { + if (substr($string, 0, 2) == "\xFE\xFF") { + // strip BOM + $string = substr($string, 2); + } + $newcharstring = ''; + for ($i = 0; $i < strlen($string); $i += 2) { + $charval = getid3_lib::BigEndian2Int(substr($string, $i, 2)); + $newcharstring .= (($charval < 256) ? chr($charval) : '?'); + } + return $newcharstring; + } + + + + // UTF-16BE => UTF-8 + public static function iconv_utf16be_utf8($string) { + if (substr($string, 0, 2) == "\xFE\xFF") { + // strip BOM + $string = substr($string, 2); + } + $newcharstring = ''; + for ($i = 0; $i < strlen($string); $i += 2) { + $charval = getid3_lib::BigEndian2Int(substr($string, $i, 2)); + $newcharstring .= getid3_iconv_replacement::iconv_int_utf8($charval); + } + return $newcharstring; + } + + + + // UTF-16BE => UTF-16LE + public static function iconv_utf16be_utf16le($string) { + return getid3_iconv_replacement::iconv_utf8_utf16le(getid3_iconv_replacement::iconv_utf16be_utf8($string)); + } + + + + // UTF-16BE => UTF-16 + public static function iconv_utf16be_utf16($string) { + return getid3_iconv_replacement::iconv_utf8_utf16(getid3_iconv_replacement::iconv_utf16be_utf8($string)); + } + + + + // UTF-16LE => ISO-8859-1 + public static function iconv_utf16le_iso88591($string) { + if (substr($string, 0, 2) == "\xFF\xFE") { + // strip BOM + $string = substr($string, 2); + } + $newcharstring = ''; + for ($i = 0; $i < strlen($string); $i += 2) { + $charval = getid3_lib::LittleEndian2Int(substr($string, $i, 2)); + $newcharstring .= (($charval < 256) ? chr($charval) : '?'); + } + return $newcharstring; + } + + + + // UTF-16LE => UTF-8 + public static function iconv_utf16le_utf8($string) { + if (substr($string, 0, 2) == "\xFF\xFE") { + // strip BOM + $string = substr($string, 2); + } + $newcharstring = ''; + for ($i = 0; $i < strlen($string); $i += 2) { + $charval = getid3_lib::LittleEndian2Int(substr($string, $i, 2)); + $newcharstring .= getid3_iconv_replacement::iconv_int_utf8($charval); + } + return $newcharstring; + } + + + + // UTF-16LE => UTF-16BE + public static function iconv_utf16le_utf16be($string) { + return getid3_iconv_replacement::iconv_utf8_utf16be(getid3_iconv_replacement::iconv_utf16le_utf8($string)); + } + + + + // UTF-16LE => UTF-16 + public static function iconv_utf16le_utf16($string) { + return getid3_iconv_replacement::iconv_utf8_utf16(getid3_iconv_replacement::iconv_utf16le_utf8($string)); + } + + + + // UTF-16 => ISO-8859-1 + public static function iconv_utf16_iso88591($string) { + $bom = substr($string, 0, 2); + if ($bom == "\xFE\xFF") { + return getid3_lib::iconv_utf16be_iso88591(substr($string, 2)); + } elseif ($bom == "\xFF\xFE") { + return getid3_lib::iconv_utf16le_iso88591(substr($string, 2)); + } + return $string; + } + + + + // UTF-16 => UTF-8 + public static function iconv_utf16_utf8($string) { + $bom = substr($string, 0, 2); + if ($bom == "\xFE\xFF") { + return getid3_iconv_replacement::iconv_utf16be_utf8(substr($string, 2)); + } elseif ($bom == "\xFF\xFE") { + return getid3_iconv_replacement::iconv_utf16le_utf8(substr($string, 2)); + } + return $string; + } + + + + // UTF-16 => UTF-16BE + public static function iconv_utf16_utf16be($string) { + return getid3_iconv_replacement::iconv_utf8_utf16be(getid3_iconv_replacement::iconv_utf16_utf8($string)); + } + + + + // UTF-16 => UTF-16LE + public static function iconv_utf16_utf16le($string) { + return getid3_iconv_replacement::iconv_utf8_utf16le(getid3_iconv_replacement::iconv_utf16_utf8($string)); + } + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.lib.image_size.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.lib.image_size.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.lib.image_size.php 3 Jan 2016 20:51:47 -0000 1.1.2.1 @@ -0,0 +1,126 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.lib.data-hash.php | +// | getID3() library file. | +// | dependencies: NONE. | +// +----------------------------------------------------------------------+ +// +// $Id: module.lib.image_size.php,v 1.1.2.1 2016/01/03 20:51:47 gustafn Exp $ + + + +class getid3_lib_image_size +{ + + const GIF_SIG = "\x47\x49\x46"; // 'GIF' + const PNG_SIG = "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A"; + const JPG_SIG = "\xFF\xD8\xFF"; + const JPG_SOS = "\xDA"; // Start Of Scan - image data start + const JPG_SOF0 = "\xC0"; // Start Of Frame N + const JPG_SOF1 = "\xC1"; // N indicates which compression process + const JPG_SOF2 = "\xC2"; // Only SOF0-SOF2 are now in common use + const JPG_SOF3 = "\xC3"; // NB: codes C4 and CC are *not* SOF markers + const JPG_SOF5 = "\xC5"; + const JPG_SOF6 = "\xC6"; + const JPG_SOF7 = "\xC7"; + const JPG_SOF9 = "\xC9"; + const JPG_SOF10 = "\xCA"; + const JPG_SOF11 = "\xCB"; // NB: codes C4 and CC are *not* SOF markers + const JPG_SOF13 = "\xCD"; + const JPG_SOF14 = "\xCE"; + const JPG_SOF15 = "\xCF"; + const JPG_EOI = "\xD9"; // End Of Image (end of datastream) + + + static public function get($img_data) { + + $height = $width = $type = ''; + + if ((substr($img_data, 0, 3) == getid3_lib_image_size::GIF_SIG) && (strlen($img_data) > 10)) { + + $dim = unpack('v2dim', substr($img_data, 6, 4)); + $width = $dim['dim1']; + $height = $dim['dim2']; + $type = 1; + + } elseif ((substr($img_data, 0, 8) == getid3_lib_image_size::PNG_SIG) && (strlen($img_data) > 24)) { + + $dim = unpack('N2dim', substr($img_data, 16, 8)); + $width = $dim['dim1']; + $height = $dim['dim2']; + $type = 3; + + } elseif ((substr($img_data, 0, 3) == getid3_lib_image_size::JPG_SIG) && (strlen($img_data) > 4)) { + + ///////////////// JPG CHUNK SCAN //////////////////// + $img_pos = $type = 2; + $buffer = strlen($img_data) - 2; + while ($img_pos < strlen($img_data)) { + + // synchronize to the marker 0xFF + $img_pos = strpos($img_data, 0xFF, $img_pos) + 1; + $marker = $img_data[$img_pos]; + do { + $marker = ord($img_data[$img_pos++]); + } while ($marker == 255); + + // find dimensions of block + switch (chr($marker)) { + + // Grab width/height from SOF segment (these are acceptable chunk types) + case getid3_lib_image_size::JPG_SOF0: + case getid3_lib_image_size::JPG_SOF1: + case getid3_lib_image_size::JPG_SOF2: + case getid3_lib_image_size::JPG_SOF3: + case getid3_lib_image_size::JPG_SOF5: + case getid3_lib_image_size::JPG_SOF6: + case getid3_lib_image_size::JPG_SOF7: + case getid3_lib_image_size::JPG_SOF9: + case getid3_lib_image_size::JPG_SOF10: + case getid3_lib_image_size::JPG_SOF11: + case getid3_lib_image_size::JPG_SOF13: + case getid3_lib_image_size::JPG_SOF14: + case getid3_lib_image_size::JPG_SOF15: + $dim = unpack('n2dim', substr($img_data, $img_pos + 3, 4)); + $height = $dim['dim1']; + $width = $dim['dim2']; + break 2; // found it so exit + + case getid3_lib_image_size::JPG_EOI: + case getid3_lib_image_size::JPG_SOS: + return false; + + default: // We're not interested in other markers + $skiplen = (ord($img_data[$img_pos++]) << 8) + ord($img_data[$img_pos++]) - 2; + // if the skip is more than what we've read in, read more + $buffer -= $skiplen; + if ($buffer < 512) { // if the buffer of data is too low, read more file. + return false; + } + $img_pos += $skiplen; + break; + } + } + } + + return array ($width, $height, $type); + } // end function + + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.misc.iso.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.misc.iso.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.misc.iso.php 3 Jan 2016 20:51:47 -0000 1.1.2.1 @@ -0,0 +1,450 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.misc.iso.php | +// | Module for analyzing ISO files | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.misc.iso.php,v 1.1.2.1 2016/01/03 20:51:47 gustafn Exp $ + + + +class getid3_iso extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + $getid3->info['fileformat'] = 'iso'; + + for ($i = 16; $i <= 19; $i++) { + fseek($getid3->fp, 2048 * $i, SEEK_SET); + $iso_header = fread($getid3->fp, 2048); + if (substr($iso_header, 1, 5) == 'CD001') { + switch (ord($iso_header{0})) { + case 1: + $getid3->info['iso']['primary_volume_descriptor']['offset'] = 2048 * $i; + $this->ParsePrimaryVolumeDescriptor($iso_header); + break; + + case 2: + $getid3->info['iso']['supplementary_volume_descriptor']['offset'] = 2048 * $i; + $this->ParseSupplementaryVolumeDescriptor($iso_header); + break; + + default: + // skip + break; + } + } + } + + $this->ParsePathTable(); + + $getid3->info['iso']['files'] = array (); + foreach ($getid3->info['iso']['path_table']['directories'] as $directory_num => $directory_data) { + $getid3->info['iso']['directories'][$directory_num] = $this->ParseDirectoryRecord($directory_data); + } + + return true; + } + + + + private function ParsePrimaryVolumeDescriptor(&$iso_header) { + + $getid3 = $this->getid3; + + // ISO integer values are stored *BOTH* Little-Endian AND Big-Endian format!! + // ie 12345 == 0x3039 is stored as $39 $30 $30 $39 in a 4-byte field + + $getid3->info['iso']['primary_volume_descriptor']['raw'] = array (); + $info_iso_primaryVD = &$getid3->info['iso']['primary_volume_descriptor']; + $info_iso_primaryVD_raw = &$info_iso_primaryVD['raw']; + + $info_iso_primaryVD_raw['volume_descriptor_type'] = getid3_lib::LittleEndian2Int(substr($iso_header, 0, 1)); + $info_iso_primaryVD_raw['standard_identifier'] = substr($iso_header, 1, 5); + if ($info_iso_primaryVD_raw['standard_identifier'] != 'CD001') { + throw new getid3_exception('Expected "CD001" at offset ('.($info_iso_primaryVD['offset'] + 1).'), found "'.$info_iso_primaryVD_raw['standard_identifier'].'" instead'); + } + + getid3_lib::ReadSequence('LittleEndian2Int', $info_iso_primaryVD_raw, $iso_header, 6, + array ( + 'volume_descriptor_version' => 1, + 'IGNORE-unused_1' => 1, + 'system_identifier' => -32, // string + 'volume_identifier' => -32, // string + 'IGNORE-unused_2' => 8, + 'volume_space_size' => 4, + 'IGNORE-1' => 4, + 'IGNORE-unused_3' => 32, + 'volume_set_size' => 2, + 'IGNORE-2' => 2, + 'volume_sequence_number' => 2, + 'IGNORE-3' => 2, + 'logical_block_size' => 2, + 'IGNORE-4' => 2, + 'path_table_size' => 4, + 'IGNORE-5' => 4, + 'path_table_l_location' => 2, + 'IGNORE-6' => 2, + 'path_table_l_opt_location' => 2, + 'IGNORE-7' => 2, + 'path_table_m_location' => 2, + 'IGNORE-8' => 2, + 'path_table_m_opt_location' => 2, + 'IGNORE-9' => 2, + 'root_directory_record' => -34, // string + 'volume_set_identifier' => -128, // string + 'publisher_identifier' => -128, // string + 'data_preparer_identifier' => -128, // string + 'application_identifier' => -128, // string + 'copyright_file_identifier' => -37, // string + 'abstract_file_identifier' => -37, // string + 'bibliographic_file_identifier' => -37, // string + 'volume_creation_date_time' => -17, // string + 'volume_modification_date_time' => -17, // string + 'volume_expiration_date_time' => -17, // string + 'volume_effective_date_time' => -17, // string + 'file_structure_version' => 1, + 'IGNORE-unused_4' => 1, + 'application_data' => -512 // string + ) + ); + + $info_iso_primaryVD['system_identifier'] = trim($info_iso_primaryVD_raw['system_identifier']); + $info_iso_primaryVD['volume_identifier'] = trim($info_iso_primaryVD_raw['volume_identifier']); + $info_iso_primaryVD['volume_set_identifier'] = trim($info_iso_primaryVD_raw['volume_set_identifier']); + $info_iso_primaryVD['publisher_identifier'] = trim($info_iso_primaryVD_raw['publisher_identifier']); + $info_iso_primaryVD['data_preparer_identifier'] = trim($info_iso_primaryVD_raw['data_preparer_identifier']); + $info_iso_primaryVD['application_identifier'] = trim($info_iso_primaryVD_raw['application_identifier']); + $info_iso_primaryVD['copyright_file_identifier'] = trim($info_iso_primaryVD_raw['copyright_file_identifier']); + $info_iso_primaryVD['abstract_file_identifier'] = trim($info_iso_primaryVD_raw['abstract_file_identifier']); + $info_iso_primaryVD['bibliographic_file_identifier'] = trim($info_iso_primaryVD_raw['bibliographic_file_identifier']); + + $info_iso_primaryVD['volume_creation_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_primaryVD_raw['volume_creation_date_time']); + $info_iso_primaryVD['volume_modification_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_primaryVD_raw['volume_modification_date_time']); + $info_iso_primaryVD['volume_expiration_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_primaryVD_raw['volume_expiration_date_time']); + $info_iso_primaryVD['volume_effective_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_primaryVD_raw['volume_effective_date_time']); + + if (($info_iso_primaryVD_raw['volume_space_size'] * 2048) > $getid3->info['filesize']) { + throw new getid3_exception('Volume Space Size ('.($info_iso_primaryVD_raw['volume_space_size'] * 2048).' bytes) is larger than the file size ('.$getid3->info['filesize'].' bytes) (truncated file?)'); + } + + return true; + } + + + + private function ParseSupplementaryVolumeDescriptor(&$iso_header) { + + $getid3 = $this->getid3; + + // ISO integer values are stored Both-Endian format!! + // ie 12345 == 0x3039 is stored as $39 $30 $30 $39 in a 4-byte field + + $getid3->info['iso']['supplementary_volume_descriptor']['raw'] = array (); + $info_iso_supplementaryVD = &$getid3->info['iso']['supplementary_volume_descriptor']; + $info_iso_supplementaryVD_raw = &$info_iso_supplementaryVD['raw']; + + $info_iso_supplementaryVD_raw['volume_descriptor_type'] = getid3_lib::LittleEndian2Int(substr($iso_header, 0, 1)); + $info_iso_supplementaryVD_raw['standard_identifier'] = substr($iso_header, 1, 5); + if ($info_iso_supplementaryVD_raw['standard_identifier'] != 'CD001') { + throw new getid3_exception('Expected "CD001" at offset ('.($info_iso_supplementaryVD['offset'] + 1).'), found "'.$info_iso_supplementaryVD_raw['standard_identifier'].'" instead'); + } + + getid3_lib::ReadSequence('LittleEndian2Int', $info_iso_supplementaryVD_raw, $iso_header, 6, + array ( + 'volume_descriptor_version' => 1, + 'IGNORE-unused_1' => -1, + 'system_identifier' => -32, + 'volume_identifier' => -32, + 'IGNORE-unused_2' => -8, + 'volume_space_size' => 4, + 'IGNORE-1' => 4, + 'IGNORE-unused_3' => -32, + 'volume_set_size' => 2, + 'IGNORE-2' => 2, + 'volume_sequence_number' => 2, + 'IGNORE-3' => 2, + 'logical_block_size' => 2, + 'IGNORE-4' => 2, + 'path_table_size' => 4, + 'IGNORE-5' => 4, + 'path_table_l_location' => 2, + 'IGNORE-6' => 2, + 'path_table_l_opt_location' => 2, + 'IGNORE-7' => 2, + 'path_table_m_location' => 2, + 'IGNORE-8' => 2, + 'path_table_m_opt_location' => 2, + 'IGNORE-9' => 2, + 'root_directory_record' => -34, + 'volume_set_identifier' => -128, + 'publisher_identifier' => -128, + 'data_preparer_identifier' => -128, + 'application_identifier' => -128, + 'copyright_file_identifier' => -37, + 'abstract_file_identifier' => -37, + 'bibliographic_file_identifier' => -37, + 'volume_creation_date_time' => -17, + 'volume_modification_date_time' => -17, + 'volume_expiration_date_time' => -17, + 'volume_effective_date_time' => -17, + 'file_structure_version' => 1, + 'IGNORE-unused_4' => 1, + 'application_data' => -512 + ) + ); + + $info_iso_supplementaryVD['system_identifier'] = trim($info_iso_supplementaryVD_raw['system_identifier']); + $info_iso_supplementaryVD['volume_identifier'] = trim($info_iso_supplementaryVD_raw['volume_identifier']); + $info_iso_supplementaryVD['volume_set_identifier'] = trim($info_iso_supplementaryVD_raw['volume_set_identifier']); + $info_iso_supplementaryVD['publisher_identifier'] = trim($info_iso_supplementaryVD_raw['publisher_identifier']); + $info_iso_supplementaryVD['data_preparer_identifier'] = trim($info_iso_supplementaryVD_raw['data_preparer_identifier']); + $info_iso_supplementaryVD['application_identifier'] = trim($info_iso_supplementaryVD_raw['application_identifier']); + $info_iso_supplementaryVD['copyright_file_identifier'] = trim($info_iso_supplementaryVD_raw['copyright_file_identifier']); + $info_iso_supplementaryVD['abstract_file_identifier'] = trim($info_iso_supplementaryVD_raw['abstract_file_identifier']); + $info_iso_supplementaryVD['bibliographic_file_identifier'] = trim($info_iso_supplementaryVD_raw['bibliographic_file_identifier']); + + $info_iso_supplementaryVD['volume_creation_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_supplementaryVD_raw['volume_creation_date_time']); + $info_iso_supplementaryVD['volume_modification_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_supplementaryVD_raw['volume_modification_date_time']); + $info_iso_supplementaryVD['volume_expiration_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_supplementaryVD_raw['volume_expiration_date_time']); + $info_iso_supplementaryVD['volume_effective_date_time'] = getid3_iso::ISOtimeText2UNIXtime($info_iso_supplementaryVD_raw['volume_effective_date_time']); + + if (($info_iso_supplementaryVD_raw['volume_space_size'] * $info_iso_supplementaryVD_raw['logical_block_size']) > $getid3->info['filesize']) { + throw new getid3_exception('Volume Space Size ('.($info_iso_supplementaryVD_raw['volume_space_size'] * $info_iso_supplementaryVD_raw['logical_block_size']).' bytes) is larger than the file size ('.$getid3->info['filesize'].' bytes) (truncated file?)'); + } + + return true; + } + + + + private function ParsePathTable() { + + $getid3 = $this->getid3; + + if (!isset($getid3->info['iso']['supplementary_volume_descriptor']['raw']['path_table_l_location']) && !isset($getid3->info['iso']['primary_volume_descriptor']['raw']['path_table_l_location'])) { + return false; + } + if (isset($getid3->info['iso']['supplementary_volume_descriptor']['raw']['path_table_l_location'])) { + $path_table_location = $getid3->info['iso']['supplementary_volume_descriptor']['raw']['path_table_l_location']; + $path_table_size = $getid3->info['iso']['supplementary_volume_descriptor']['raw']['path_table_size']; + $text_encoding = 'UTF-16BE'; // Big-Endian Unicode + } + else { + $path_table_location = $getid3->info['iso']['primary_volume_descriptor']['raw']['path_table_l_location']; + $path_table_size = $getid3->info['iso']['primary_volume_descriptor']['raw']['path_table_size']; + $text_encoding = 'ISO-8859-1'; // Latin-1 + } + + if (($path_table_location * 2048) > $getid3->info['filesize']) { + throw new getid3_exception('Path Table Location specifies an offset ('.($path_table_location * 2048).') beyond the end-of-file ('.$getid3->info['filesize'].')'); + } + + $getid3->info['iso']['path_table']['offset'] = $path_table_location * 2048; + fseek($getid3->fp, $getid3->info['iso']['path_table']['offset'], SEEK_SET); + $getid3->info['iso']['path_table']['raw'] = fread($getid3->fp, $path_table_size); + + $offset = 0; + $pathcounter = 1; + while ($offset < $path_table_size) { + + $getid3->info['iso']['path_table']['directories'][$pathcounter] = array (); + $info_iso_pathtable_directories_current = &$getid3->info['iso']['path_table']['directories'][$pathcounter]; + + getid3_lib::ReadSequence('LittleEndian2Int', $info_iso_pathtable_directories_current, $getid3->info['iso']['path_table']['raw'], $offset, + array ( + 'length' => 1, + 'extended_length' => 1, + 'location_logical' => 4, + 'parent_directory' => 2, + ) + ); + + $info_iso_pathtable_directories_current['name'] = substr($getid3->info['iso']['path_table']['raw'], $offset+8, $info_iso_pathtable_directories_current['length']); + + $offset += 8 + $info_iso_pathtable_directories_current['length'] + ($info_iso_pathtable_directories_current['length'] % 2); + + $info_iso_pathtable_directories_current['name_ascii'] = $getid3->iconv($text_encoding, $getid3->encoding, $info_iso_pathtable_directories_current['name'], true); + + $info_iso_pathtable_directories_current['location_bytes'] = $info_iso_pathtable_directories_current['location_logical'] * 2048; + if ($pathcounter == 1) { + $info_iso_pathtable_directories_current['full_path'] = '/'; + } + else { + $info_iso_pathtable_directories_current['full_path'] = $getid3->info['iso']['path_table']['directories'][$info_iso_pathtable_directories_current['parent_directory']]['full_path'].$info_iso_pathtable_directories_current['name_ascii'].'/'; + } + $full_path_array[] = $info_iso_pathtable_directories_current['full_path']; + + $pathcounter++; + } + + return true; + } + + + + private function ParseDirectoryRecord($directory_data) { + + $getid3 = $this->getid3; + + $text_encoding = isset($getid3->info['iso']['supplementary_volume_descriptor']) ? 'UTF-16BE' : 'ISO-8859-1'; + + fseek($getid3->fp, $directory_data['location_bytes'], SEEK_SET); + $directory_record_data = fread($getid3->fp, 1); + + while (ord($directory_record_data{0}) > 33) { + + $directory_record_data .= fread($getid3->fp, ord($directory_record_data{0}) - 1); + + $this_directory_record = array (); + $this_directory_record['raw'] = array (); + $this_directory_record_raw = &$this_directory_record['raw']; + + getid3_lib::ReadSequence('LittleEndian2Int', $this_directory_record_raw, $directory_record_data, 0, + array ( + 'length' => 1, + 'extended_attribute_length' => 1, + 'offset_logical' => 4, + 'IGNORE-1' => 4, + 'filesize' => 4, + 'IGNORE-2' => 4, + 'recording_date_time' => -7, + 'file_flags' => 1, + 'file_unit_size' => 1, + 'interleave_gap_size' => 1, + 'volume_sequence_number' => 2, + 'IGNORE-3' => 2, + 'file_identifier_length' => 1, + ) + ); + + $this_directory_record_raw['file_identifier'] = substr($directory_record_data, 33, $this_directory_record_raw['file_identifier_length']); + + $this_directory_record['file_identifier_ascii'] = $getid3->iconv($text_encoding, $getid3->encoding, $this_directory_record_raw['file_identifier'], true); + $this_directory_record['filesize'] = $this_directory_record_raw['filesize']; + $this_directory_record['offset_bytes'] = $this_directory_record_raw['offset_logical'] * 2048; + $this_directory_record['file_flags']['hidden'] = (bool)($this_directory_record_raw['file_flags'] & 0x01); + $this_directory_record['file_flags']['directory'] = (bool)($this_directory_record_raw['file_flags'] & 0x02); + $this_directory_record['file_flags']['associated'] = (bool)($this_directory_record_raw['file_flags'] & 0x04); + $this_directory_record['file_flags']['extended'] = (bool)($this_directory_record_raw['file_flags'] & 0x08); + $this_directory_record['file_flags']['permissions'] = (bool)($this_directory_record_raw['file_flags'] & 0x10); + $this_directory_record['file_flags']['multiple'] = (bool)($this_directory_record_raw['file_flags'] & 0x80); + $this_directory_record['recording_timestamp'] = getid3_iso::ISOtime2UNIXtime($this_directory_record_raw['recording_date_time']); + + if ($this_directory_record['file_flags']['directory']) { + $this_directory_record['filename'] = $directory_data['full_path']; + } + else { + $this_directory_record['filename'] = $directory_data['full_path'].getid3_iso::ISOstripFilenameVersion($this_directory_record['file_identifier_ascii']); + $getid3->info['iso']['files'] = getid3_iso::array_merge_clobber($getid3->info['iso']['files'], getid3_iso::CreateDeepArray($this_directory_record['filename'], '/', $this_directory_record['filesize'])); + } + + $directory_record[] = $this_directory_record; + $directory_record_data = fread($getid3->fp, 1); + } + + return $directory_record; + } + + + + public static function ISOstripFilenameVersion($iso_filename) { + + // convert 'filename.ext;1' to 'filename.ext' + if (!strstr($iso_filename, ';')) { + return $iso_filename; + } + return substr($iso_filename, 0, strpos($iso_filename, ';')); + } + + + + public static function ISOtimeText2UNIXtime($iso_time) { + + if (!(int)substr($iso_time, 0, 4)) { + return false; + } + + return gmmktime((int)substr($iso_time, 8, 2), (int)substr($iso_time, 10, 2), (int)substr($iso_time, 12, 2), (int)substr($iso_time, 4, 2), (int)substr($iso_time, 6, 2), (int)substr($iso_time, 0, 4)); + } + + + + public static function ISOtime2UNIXtime($iso_time) { + + // Represented by seven bytes: + // 1: Number of years since 1900 + // 2: Month of the year from 1 to 12 + // 3: Day of the Month from 1 to 31 + // 4: Hour of the day from 0 to 23 + // 5: Minute of the hour from 0 to 59 + // 6: second of the minute from 0 to 59 + // 7: Offset from Greenwich Mean Time in number of 15 minute intervals from -48 (West) to +52 (East) + + return gmmktime(ord($iso_time[3]), ord($iso_time[4]), ord($iso_time[5]), ord($iso_time[1]), ord($iso_time[2]), ord($iso_time[0]) + 1900); + } + + + + public static function array_merge_clobber($array1, $array2) { + + // written by kc�hireability*com + // taken from http://www.php.net/manual/en/function.array-merge-recursive.php + + if (!is_array($array1) || !is_array($array2)) { + return false; + } + + $newarray = $array1; + foreach ($array2 as $key => $val) { + if (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) { + $newarray[$key] = getid3_iso::array_merge_clobber($newarray[$key], $val); + } else { + $newarray[$key] = $val; + } + } + return $newarray; + } + + + + public static function CreateDeepArray($array_path, $separator, $value) { + + // assigns $value to a nested array path: + // $foo = getid3_lib::CreateDeepArray('/path/to/my', '/', 'file.txt') + // is the same as: + // $foo = array ('path'=>array('to'=>'array('my'=>array('file.txt')))); + // or + // $foo['path']['to']['my'] = 'file.txt'; + + while ($array_path{0} == $separator) { + $array_path = substr($array_path, 1); + } + if (($pos = strpos($array_path, $separator)) !== false) { + return array (substr($array_path, 0, $pos) => getid3_iso::CreateDeepArray(substr($array_path, $pos + 1), $separator, $value)); + } + + return array ($array_path => $value); + } + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.tag.apetag.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.tag.apetag.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.tag.apetag.php 3 Jan 2016 20:51:47 -0000 1.1.2.1 @@ -0,0 +1,312 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.tag.apetag.php | +// | module for analyzing APE tags | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.tag.apetag.php,v 1.1.2.1 2016/01/03 20:51:47 gustafn Exp $ + + + +class getid3_apetag extends getid3_handler +{ + /* + ID3v1_TAG_SIZE = 128; + APETAG_HEADER_SIZE = 32; + LYRICS3_TAG_SIZE = 10; + */ + + public $option_override_end_offset = 0; + + + + public function Analyze() { + + $getid3 = $this->getid3; + + if ($this->option_override_end_offset == 0) { + + fseek($getid3->fp, 0 - 170, SEEK_END); // 170 = ID3v1_TAG_SIZE + APETAG_HEADER_SIZE + LYRICS3_TAG_SIZE + $apetag_footer_id3v1 = fread($getid3->fp, 170); // 170 = ID3v1_TAG_SIZE + APETAG_HEADER_SIZE + LYRICS3_TAG_SIZE + + // APE tag found before ID3v1 + if (substr($apetag_footer_id3v1, strlen($apetag_footer_id3v1) - 160, 8) == 'APETAGEX') { // 160 = ID3v1_TAG_SIZE + APETAG_HEADER_SIZE + $getid3->info['ape']['tag_offset_end'] = filesize($getid3->filename) - 128; // 128 = ID3v1_TAG_SIZE + } + + // APE tag found, no ID3v1 + elseif (substr($apetag_footer_id3v1, strlen($apetag_footer_id3v1) - 32, 8) == 'APETAGEX') { // 32 = APETAG_HEADER_SIZE + $getid3->info['ape']['tag_offset_end'] = filesize($getid3->filename); + } + + } + else { + + fseek($getid3->fp, $this->option_override_end_offset - 32, SEEK_SET); // 32 = APETAG_HEADER_SIZE + if (fread($getid3->fp, 8) == 'APETAGEX') { + $getid3->info['ape']['tag_offset_end'] = $this->option_override_end_offset; + } + + } + + // APE tag not found + if (!@$getid3->info['ape']['tag_offset_end']) { + return false; + } + + // Shortcut + $info_ape = &$getid3->info['ape']; + + // Read and parse footer + fseek($getid3->fp, $info_ape['tag_offset_end'] - 32, SEEK_SET); // 32 = APETAG_HEADER_SIZE + $apetag_footer_data = fread($getid3->fp, 32); + if (!($this->ParseAPEHeaderFooter($apetag_footer_data, $info_ape['footer']))) { + throw new getid3_exception('Error parsing APE footer at offset '.$info_ape['tag_offset_end']); + } + + if (isset($info_ape['footer']['flags']['header']) && $info_ape['footer']['flags']['header']) { + fseek($getid3->fp, $info_ape['tag_offset_end'] - $info_ape['footer']['raw']['tagsize'] - 32, SEEK_SET); + $info_ape['tag_offset_start'] = ftell($getid3->fp); + $apetag_data = fread($getid3->fp, $info_ape['footer']['raw']['tagsize'] + 32); + } + else { + $info_ape['tag_offset_start'] = $info_ape['tag_offset_end'] - $info_ape['footer']['raw']['tagsize']; + fseek($getid3->fp, $info_ape['tag_offset_start'], SEEK_SET); + $apetag_data = fread($getid3->fp, $info_ape['footer']['raw']['tagsize']); + } + $getid3->info['avdataend'] = $info_ape['tag_offset_start']; + + if (isset($getid3->info['id3v1']['tag_offset_start']) && ($getid3->info['id3v1']['tag_offset_start'] < $info_ape['tag_offset_end'])) { + $getid3->warning('ID3v1 tag information ignored since it appears to be a false synch in APEtag data'); + unset($getid3->info['id3v1']); + } + + $offset = 0; + if (isset($info_ape['footer']['flags']['header']) && $info_ape['footer']['flags']['header']) { + if (!$this->ParseAPEHeaderFooter(substr($apetag_data, 0, 32), $info_ape['header'])) { + throw new getid3_exception('Error parsing APE header at offset '.$info_ape['tag_offset_start']); + } + $offset = 32; + } + + // Shortcut + $getid3->info['replay_gain'] = array (); + $info_replaygain = &$getid3->info['replay_gain']; + + for ($i = 0; $i < $info_ape['footer']['raw']['tag_items']; $i++) { + $value_size = getid3_lib::LittleEndian2Int(substr($apetag_data, $offset, 4)); + $item_flags = getid3_lib::LittleEndian2Int(substr($apetag_data, $offset + 4, 4)); + $offset += 8; + + if (strstr(substr($apetag_data, $offset), "\x00") === false) { + throw new getid3_exception('Cannot find null-byte (0x00) seperator between ItemKey #'.$i.' and value. ItemKey starts ' . $offset . ' bytes into the APE tag, at file offset '.($info_ape['tag_offset_start'] + $offset)); + } + + $item_key_length = strpos($apetag_data, "\x00", $offset) - $offset; + $item_key = strtolower(substr($apetag_data, $offset, $item_key_length)); + + // Shortcut + $info_ape['items'][$item_key] = array (); + $info_ape_items_current = &$info_ape['items'][$item_key]; + + $offset += $item_key_length + 1; // skip 0x00 terminator + $info_ape_items_current['data'] = substr($apetag_data, $offset, $value_size); + $offset += $value_size; + + + $info_ape_items_current['flags'] = $this->ParseAPEtagFlags($item_flags); + + switch ($info_ape_items_current['flags']['item_contents_raw']) { + case 0: // UTF-8 + case 3: // Locator (URL, filename, etc), UTF-8 encoded + $info_ape_items_current['data'] = explode("\x00", trim($info_ape_items_current['data'])); + break; + + default: // binary data + break; + } + + switch (strtolower($item_key)) { + case 'replaygain_track_gain': + $info_replaygain['track']['adjustment'] = (float)str_replace(',', '.', $info_ape_items_current['data'][0]); // float casting will see "0,95" as zero! + $info_replaygain['track']['originator'] = 'unspecified'; + break; + + case 'replaygain_track_peak': + $info_replaygain['track']['peak'] = (float)str_replace(',', '.', $info_ape_items_current['data'][0]); // float casting will see "0,95" as zero! + $info_replaygain['track']['originator'] = 'unspecified'; + if ($info_replaygain['track']['peak'] <= 0) { + $getid3->warning('ReplayGain Track peak from APEtag appears invalid: '.$info_replaygain['track']['peak'].' (original value = "'.$info_ape_items_current['data'][0].'")'); + } + break; + + case 'replaygain_album_gain': + $info_replaygain['album']['adjustment'] = (float)str_replace(',', '.', $info_ape_items_current['data'][0]); // float casting will see "0,95" as zero! + $info_replaygain['album']['originator'] = 'unspecified'; + break; + + case 'replaygain_album_peak': + $info_replaygain['album']['peak'] = (float)str_replace(',', '.', $info_ape_items_current['data'][0]); // float casting will see "0,95" as zero! + $info_replaygain['album']['originator'] = 'unspecified'; + if ($info_replaygain['album']['peak'] <= 0) { + $getid3->warning('ReplayGain Album peak from APEtag appears invalid: '.$info_replaygain['album']['peak'].' (original value = "'.$info_ape_items_current['data'][0].'")'); + } + break; + + case 'mp3gain_undo': + list($mp3gain_undo_left, $mp3gain_undo_right, $mp3gain_undo_wrap) = explode(',', $info_ape_items_current['data'][0]); + $info_replaygain['mp3gain']['undo_left'] = intval($mp3gain_undo_left); + $info_replaygain['mp3gain']['undo_right'] = intval($mp3gain_undo_right); + $info_replaygain['mp3gain']['undo_wrap'] = (($mp3gain_undo_wrap == 'Y') ? true : false); + break; + + case 'mp3gain_minmax': + list($mp3gain_globalgain_min, $mp3gain_globalgain_max) = explode(',', $info_ape_items_current['data'][0]); + $info_replaygain['mp3gain']['globalgain_track_min'] = intval($mp3gain_globalgain_min); + $info_replaygain['mp3gain']['globalgain_track_max'] = intval($mp3gain_globalgain_max); + break; + + case 'mp3gain_album_minmax': + list($mp3gain_globalgain_album_min, $mp3gain_globalgain_album_max) = explode(',', $info_ape_items_current['data'][0]); + $info_replaygain['mp3gain']['globalgain_album_min'] = intval($mp3gain_globalgain_album_min); + $info_replaygain['mp3gain']['globalgain_album_max'] = intval($mp3gain_globalgain_album_max); + break; + + case 'tracknumber': + foreach ($info_ape_items_current['data'] as $comment) { + $info_ape['comments']['track'][] = $comment; + } + break; + + default: + foreach ($info_ape_items_current['data'] as $comment) { + $info_ape['comments'][strtolower($item_key)][] = $comment; + } + break; + } + + } + if (empty($info_replaygain)) { + unset($getid3->info['replay_gain']); + } + + return true; + } + + + + protected function ParseAPEheaderFooter($data, &$target) { + + // http://www.uni-jena.de/~pfk/mpp/sv8/apeheader.html + + if (substr($data, 0, 8) != 'APETAGEX') { + return false; + } + + // shortcut + $target['raw'] = array (); + $target_raw = &$target['raw']; + + $target_raw['footer_tag'] = 'APETAGEX'; + + getid3_lib::ReadSequence("LittleEndian2Int", $target_raw, $data, 8, + array ( + 'version' => 4, + 'tagsize' => 4, + 'tag_items' => 4, + 'global_flags' => 4 + ) + ); + $target_raw['reserved'] = substr($data, 24, 8); + + $target['tag_version'] = $target_raw['version'] / 1000; + if ($target['tag_version'] >= 2) { + + $target['flags'] = $this->ParseAPEtagFlags($target_raw['global_flags']); + } + + return true; + } + + + + protected function ParseAPEtagFlags($raw_flag_int) { + + // "Note: APE Tags 1.0 do not use any of the APE Tag flags. + // All are set to zero on creation and ignored on reading." + // http://www.uni-jena.de/~pfk/mpp/sv8/apetagflags.html + + $target['header'] = (bool) ($raw_flag_int & 0x80000000); + $target['footer'] = (bool) ($raw_flag_int & 0x40000000); + $target['this_is_header'] = (bool) ($raw_flag_int & 0x20000000); + $target['item_contents_raw'] = ($raw_flag_int & 0x00000006) >> 1; + $target['read_only'] = (bool) ($raw_flag_int & 0x00000001); + + $target['item_contents'] = getid3_apetag::APEcontentTypeFlagLookup($target['item_contents_raw']); + + return $target; + } + + + + public static function APEcontentTypeFlagLookup($content_type_id) { + + static $lookup = array ( + 0 => 'utf-8', + 1 => 'binary', + 2 => 'external', + 3 => 'reserved' + ); + return (isset($lookup[$content_type_id]) ? $lookup[$content_type_id] : 'invalid'); + } + + + + public static function APEtagItemIsUTF8Lookup($item_key) { + + static $lookup = array ( + 'title', + 'subtitle', + 'artist', + 'album', + 'debut album', + 'publisher', + 'conductor', + 'track', + 'composer', + 'comment', + 'copyright', + 'publicationright', + 'file', + 'year', + 'record date', + 'record location', + 'genre', + 'media', + 'related', + 'isrc', + 'abstract', + 'language', + 'bibliography' + ); + return in_array(strtolower($item_key), $lookup); + } + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.tag.id3v1.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.tag.id3v1.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.tag.id3v1.php 3 Jan 2016 20:51:48 -0000 1.1.2.1 @@ -0,0 +1,324 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.tag.id3v1.php | +// | module for analyzing ID3v1 tags | +// | dependencies: NONE | +// +----------------------------------------------------------------------+ +// +// $Id: module.tag.id3v1.php,v 1.1.2.1 2016/01/03 20:51:48 gustafn Exp $ + + + +class getid3_id3v1 extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + fseek($getid3->fp, -256, SEEK_END); + $pre_id3v1 = fread($getid3->fp, 128); + $id3v1_tag = fread($getid3->fp, 128); + + if (substr($id3v1_tag, 0, 3) == 'TAG') { + + $getid3->info['avdataend'] -= 128; + + // Shortcut + $getid3->info['id3v1'] = array (); + $info_id3v1 = &$getid3->info['id3v1']; + + $info_id3v1['title'] = getid3_id3v1::cutfield(substr($id3v1_tag, 3, 30)); + $info_id3v1['artist'] = getid3_id3v1::cutfield(substr($id3v1_tag, 33, 30)); + $info_id3v1['album'] = getid3_id3v1::cutfield(substr($id3v1_tag, 63, 30)); + $info_id3v1['year'] = getid3_id3v1::cutfield(substr($id3v1_tag, 93, 4)); + $info_id3v1['comment'] = substr($id3v1_tag, 97, 30); // can't remove nulls yet, track detection depends on them + $info_id3v1['genreid'] = ord(substr($id3v1_tag, 127, 1)); + + // If second-last byte of comment field is null and last byte of comment field is non-null then this is ID3v1.1 and the comment field is 28 bytes long and the 30th byte is the track number + if (($id3v1_tag{125} === "\x00") && ($id3v1_tag{126} !== "\x00")) { + $info_id3v1['track'] = ord(substr($info_id3v1['comment'], 29, 1)); + $info_id3v1['comment'] = substr($info_id3v1['comment'], 0, 28); + } + $info_id3v1['comment'] = getid3_id3v1::cutfield($info_id3v1['comment']); + + $info_id3v1['genre'] = getid3_id3v1::LookupGenreName($info_id3v1['genreid']); + if (!empty($info_id3v1['genre'])) { + unset($info_id3v1['genreid']); + } + if (empty($info_id3v1['genre']) || (@$info_id3v1['genre'] == 'Unknown')) { + unset($info_id3v1['genre']); + } + + foreach ($info_id3v1 as $key => $value) { + $key != 'comments' and $info_id3v1['comments'][$key][0] = $value; + } + + $info_id3v1['tag_offset_end'] = filesize($getid3->filename); + $info_id3v1['tag_offset_start'] = $info_id3v1['tag_offset_end'] - 128; + } + + if (substr($pre_id3v1, 0, 3) == 'TAG') { + // The way iTunes handles tags is, well, brain-damaged. + // It completely ignores v1 if ID3v2 is present. + // This goes as far as adding a new v1 tag *even if there already is one* + + // A suspected double-ID3v1 tag has been detected, but it could be that the "TAG" identifier is a legitimate part of an APE or Lyrics3 tag + if (substr($pre_id3v1, 96, 8) == 'APETAGEX') { + // an APE tag footer was found before the last ID3v1, assume false "TAG" synch + } elseif (substr($pre_id3v1, 119, 6) == 'LYRICS') { + // a Lyrics3 tag footer was found before the last ID3v1, assume false "TAG" synch + } else { + // APE and Lyrics3 footers not found - assume double ID3v1 + $getid3->warning('Duplicate ID3v1 tag detected - this has been known to happen with iTunes.'); + $getid3->info['avdataend'] -= 128; + } + } + + return true; + } + + + + public static function cutfield($str) { + + return trim(substr($str, 0, strcspn($str, "\x00"))); + } + + + + public static function ArrayOfGenres($allow_SCMPX_extended=false) { + + static $lookup = array ( + 0 => 'Blues', + 1 => 'Classic Rock', + 2 => 'Country', + 3 => 'Dance', + 4 => 'Disco', + 5 => 'Funk', + 6 => 'Grunge', + 7 => 'Hip-Hop', + 8 => 'Jazz', + 9 => 'Metal', + 10 => 'New Age', + 11 => 'Oldies', + 12 => 'Other', + 13 => 'Pop', + 14 => 'R&B', + 15 => 'Rap', + 16 => 'Reggae', + 17 => 'Rock', + 18 => 'Techno', + 19 => 'Industrial', + 20 => 'Alternative', + 21 => 'Ska', + 22 => 'Death Metal', + 23 => 'Pranks', + 24 => 'Soundtrack', + 25 => 'Euro-Techno', + 26 => 'Ambient', + 27 => 'Trip-Hop', + 28 => 'Vocal', + 29 => 'Jazz+Funk', + 30 => 'Fusion', + 31 => 'Trance', + 32 => 'Classical', + 33 => 'Instrumental', + 34 => 'Acid', + 35 => 'House', + 36 => 'Game', + 37 => 'Sound Clip', + 38 => 'Gospel', + 39 => 'Noise', + 40 => 'Alt. Rock', + 41 => 'Bass', + 42 => 'Soul', + 43 => 'Punk', + 44 => 'Space', + 45 => 'Meditative', + 46 => 'Instrumental Pop', + 47 => 'Instrumental Rock', + 48 => 'Ethnic', + 49 => 'Gothic', + 50 => 'Darkwave', + 51 => 'Techno-Industrial', + 52 => 'Electronic', + 53 => 'Pop-Folk', + 54 => 'Eurodance', + 55 => 'Dream', + 56 => 'Southern Rock', + 57 => 'Comedy', + 58 => 'Cult', + 59 => 'Gangsta Rap', + 60 => 'Top 40', + 61 => 'Christian Rap', + 62 => 'Pop/Funk', + 63 => 'Jungle', + 64 => 'Native American', + 65 => 'Cabaret', + 66 => 'New Wave', + 67 => 'Psychedelic', + 68 => 'Rave', + 69 => 'Showtunes', + 70 => 'Trailer', + 71 => 'Lo-Fi', + 72 => 'Tribal', + 73 => 'Acid Punk', + 74 => 'Acid Jazz', + 75 => 'Polka', + 76 => 'Retro', + 77 => 'Musical', + 78 => 'Rock & Roll', + 79 => 'Hard Rock', + 80 => 'Folk', + 81 => 'Folk/Rock', + 82 => 'National Folk', + 83 => 'Swing', + 84 => 'Fast-Fusion', + 85 => 'Bebob', + 86 => 'Latin', + 87 => 'Revival', + 88 => 'Celtic', + 89 => 'Bluegrass', + 90 => 'Avantgarde', + 91 => 'Gothic Rock', + 92 => 'Progressive Rock', + 93 => 'Psychedelic Rock', + 94 => 'Symphonic Rock', + 95 => 'Slow Rock', + 96 => 'Big Band', + 97 => 'Chorus', + 98 => 'Easy Listening', + 99 => 'Acoustic', + 100 => 'Humour', + 101 => 'Speech', + 102 => 'Chanson', + 103 => 'Opera', + 104 => 'Chamber Music', + 105 => 'Sonata', + 106 => 'Symphony', + 107 => 'Booty Bass', + 108 => 'Primus', + 109 => 'Porn Groove', + 110 => 'Satire', + 111 => 'Slow Jam', + 112 => 'Club', + 113 => 'Tango', + 114 => 'Samba', + 115 => 'Folklore', + 116 => 'Ballad', + 117 => 'Power Ballad', + 118 => 'Rhythmic Soul', + 119 => 'Freestyle', + 120 => 'Duet', + 121 => 'Punk Rock', + 122 => 'Drum Solo', + 123 => 'A Cappella', + 124 => 'Euro-House', + 125 => 'Dance Hall', + 126 => 'Goa', + 127 => 'Drum & Bass', + 128 => 'Club-House', + 129 => 'Hardcore', + 130 => 'Terror', + 131 => 'Indie', + 132 => 'BritPop', + 133 => 'Negerpunk', + 134 => 'Polsk Punk', + 135 => 'Beat', + 136 => 'Christian Gangsta Rap', + 137 => 'Heavy Metal', + 138 => 'Black Metal', + 139 => 'Crossover', + 140 => 'Contemporary Christian', + 141 => 'Christian Rock', + 142 => 'Merengue', + 143 => 'Salsa', + 144 => 'Trash Metal', + 145 => 'Anime', + 146 => 'JPop', + 147 => 'Synthpop', + + 255 => 'Unknown', + + 'CR' => 'Cover', + 'RX' => 'Remix' + ); + + static $lookupSCMPX = array (); + if ($allow_SCMPX_extended && empty($lookupSCMPX)) { + $lookupSCMPX = $lookup; + // http://www.geocities.co.jp/SiliconValley-Oakland/3664/alittle.html#GenreExtended + // Extended ID3v1 genres invented by SCMPX + // Note that 255 "Japanese Anime" conflicts with standard "Unknown" + $lookupSCMPX[240] = 'Sacred'; + $lookupSCMPX[241] = 'Northern Europe'; + $lookupSCMPX[242] = 'Irish & Scottish'; + $lookupSCMPX[243] = 'Scotland'; + $lookupSCMPX[244] = 'Ethnic Europe'; + $lookupSCMPX[245] = 'Enka'; + $lookupSCMPX[246] = 'Children\'s Song'; + $lookupSCMPX[247] = 'Japanese Sky'; + $lookupSCMPX[248] = 'Japanese Heavy Rock'; + $lookupSCMPX[249] = 'Japanese Doom Rock'; + $lookupSCMPX[250] = 'Japanese J-POP'; + $lookupSCMPX[251] = 'Japanese Seiyu'; + $lookupSCMPX[252] = 'Japanese Ambient Techno'; + $lookupSCMPX[253] = 'Japanese Moemoe'; + $lookupSCMPX[254] = 'Japanese Tokusatsu'; + //$lookupSCMPX[255] = 'Japanese Anime'; + } + + return ($allow_SCMPX_extended ? $lookupSCMPX : $lookup); + } + + + + public static function LookupGenreName($genre_id, $allow_SCMPX_extended=true) { + + switch ($genre_id) { + case 'RX': + case 'CR': + break; + default: + $genre_id = intval($genre_id); // to handle 3 or '3' or '03' + break; + } + $lookup = getid3_id3v1::ArrayOfGenres($allow_SCMPX_extended); + return (isset($lookup[$genre_id]) ? $lookup[$genre_id] : false); + } + + + public static function LookupGenreID($genre, $allow_SCMPX_extended=false) { + + $lookup = getid3_id3v1::ArrayOfGenres($allow_SCMPX_extended); + $lower_case_no_space_search_term = strtolower(str_replace(' ', '', $genre)); + foreach ($lookup as $key => $value) { + foreach ($lookup as $key => $value) { + if (strtolower(str_replace(' ', '', $value)) == $lower_case_no_space_search_term) { + return $key; + } + } + return false; + } + return (isset($lookup[$genre_id]) ? $lookup[$genre_id] : false); + } + +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.tag.id3v2.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.tag.id3v2.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.tag.id3v2.php 3 Jan 2016 20:51:48 -0000 1.1.2.1 @@ -0,0 +1,3280 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.tag.id3v2.php | +// | module for analyzing ID3v2 tags | +// | dependencies: module.tag.id3v1.php | +// | module.lib.image_size.php (optional) | +// | zlib support in PHP (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.tag.id3v2.php,v 1.1.2.1 2016/01/03 20:51:48 gustafn Exp $ + + + + +class getid3_id3v2 extends getid3_handler +{ + + public $option_starting_offset = 0; + + + public function Analyze() { + + $getid3 = $this->getid3; + + // dependency + $getid3->include_module('tag.id3v1'); + + if ($getid3->option_tags_images) { + $getid3->include_module('lib.image_size'); + } + + + // Overall tag structure: + // +-----------------------------+ + // | Header (10 bytes) | + // +-----------------------------+ + // | Extended Header | + // | (variable length, OPTIONAL) | + // +-----------------------------+ + // | Frames (variable length) | + // +-----------------------------+ + // | Padding | + // | (variable length, OPTIONAL) | + // +-----------------------------+ + // | Footer (10 bytes, OPTIONAL) | + // +-----------------------------+ + // + // Header + // ID3v2/file identifier "ID3" + // ID3v2 version $04 00 + // ID3v2 flags (%ab000000 in v2.2, %abc00000 in v2.3, %abcd0000 in v2.4.x) + // ID3v2 size 4 * %0xxxxxxx + + + // shortcuts + $getid3->info['id3v2']['header'] = true; + $info_id3v2 = &$getid3->info['id3v2']; + $info_id3v2['flags'] = array (); + $info_id3v2_flags = &$info_id3v2['flags']; + + + $this->fseek($this->option_starting_offset, SEEK_SET); + $header = $this->fread(10); + if (substr($header, 0, 3) == 'ID3' && strlen($header) == 10) { + + $info_id3v2['majorversion'] = ord($header{3}); + $info_id3v2['minorversion'] = ord($header{4}); + + // shortcut + $id3v2_major_version = &$info_id3v2['majorversion']; + + } else { + unset($getid3->info['id3v2']); + return false; + + } + + if ($id3v2_major_version > 4) { // this script probably won't correctly parse ID3v2.5.x and above (if it ever exists) + throw new getid3_exception('this script only parses up to ID3v2.4.x - this tag is ID3v2.'.$id3v2_major_version.'.'.$info_id3v2['minorversion']); + } + + $id3_flags = ord($header{5}); + switch ($id3v2_major_version) { + case 2: + // %ab000000 in v2.2 + $info_id3v2_flags['unsynch'] = (bool)($id3_flags & 0x80); // a - Unsynchronisation + $info_id3v2_flags['compression'] = (bool)($id3_flags & 0x40); // b - Compression + break; + + case 3: + // %abc00000 in v2.3 + $info_id3v2_flags['unsynch'] = (bool)($id3_flags & 0x80); // a - Unsynchronisation + $info_id3v2_flags['exthead'] = (bool)($id3_flags & 0x40); // b - Extended header + $info_id3v2_flags['experim'] = (bool)($id3_flags & 0x20); // c - Experimental indicator + break; + + case 4: + // %abcd0000 in v2.4 + $info_id3v2_flags['unsynch'] = (bool)($id3_flags & 0x80); // a - Unsynchronisation + $info_id3v2_flags['exthead'] = (bool)($id3_flags & 0x40); // b - Extended header + $info_id3v2_flags['experim'] = (bool)($id3_flags & 0x20); // c - Experimental indicator + $info_id3v2_flags['isfooter'] = (bool)($id3_flags & 0x10); // d - Footer present + break; + } + + $info_id3v2['headerlength'] = getid3_lib::BigEndianSyncSafe2Int(substr($header, 6, 4)) + 10; // length of ID3v2 tag in 10-byte header doesn't include 10-byte header length + + $info_id3v2['tag_offset_start'] = $this->option_starting_offset; + $info_id3v2['tag_offset_end'] = $info_id3v2['tag_offset_start'] + $info_id3v2['headerlength']; + + + // Frames + + // All ID3v2 frames consists of one frame header followed by one or more + // fields containing the actual information. The header is always 10 + // bytes and laid out as follows: + // + // Frame ID $xx xx xx xx (four characters) + // Size 4 * %0xxxxxxx + // Flags $xx xx + + $size_of_frames = $info_id3v2['headerlength'] - 10; // not including 10-byte initial header + if (@$info_id3v2['exthead']['length']) { + $size_of_frames -= ($info_id3v2['exthead']['length'] + 4); + } + + if (@$info_id3v2_flags['isfooter']) { + $size_of_frames -= 10; // footer takes last 10 bytes of ID3v2 header, after frame data, before audio + } + + if ($size_of_frames > 0) { + $frame_data = $this->fread($size_of_frames); // read all frames from file into $frame_data variable + + // if entire frame data is unsynched, de-unsynch it now (ID3v2.3.x) + if (@$info_id3v2_flags['unsynch'] && ($id3v2_major_version <= 3)) { + $frame_data = str_replace("\xFF\x00", "\xFF", $frame_data); + } + + // [in ID3v2.4.0] Unsynchronisation [S:6.1] is done on frame level, instead + // of on tag level, making it easier to skip frames, increasing the streamability + // of the tag. The unsynchronisation flag in the header [S:3.1] indicates that + // there exists an unsynchronised frame, while the new unsynchronisation flag in + // the frame header [S:4.1.2] indicates unsynchronisation. + + //$frame_data_offset = 10 + (@$info_id3v2['exthead']['length'] ? $info_id3v2['exthead']['length'] + 4 : 0); // how many bytes into the stream - start from after the 10-byte header (and extended header length+4, if present) + $frame_data_offset = 10; // how many bytes into the stream - start from after the 10-byte header + + // Extended Header + if (@$info_id3v2_flags['exthead']) { + $extended_header_offset = 0; + + if ($id3v2_major_version == 3) { + + // v2.3 definition: + //Extended header size $xx xx xx xx // 32-bit integer + //Extended Flags $xx xx + // %x0000000 %00000000 // v2.3 + // x - CRC data present + //Size of padding $xx xx xx xx + + $info_id3v2['exthead']['length'] = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, 4), 0); + $extended_header_offset += 4; + + $info_id3v2['exthead']['flag_bytes'] = 2; + $info_id3v2['exthead']['flag_raw'] = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, $info_id3v2['exthead']['flag_bytes'])); + $extended_header_offset += $info_id3v2['exthead']['flag_bytes']; + + $info_id3v2['exthead']['flags']['crc'] = (bool) ($info_id3v2['exthead']['flag_raw'] & 0x8000); + + $info_id3v2['exthead']['padding_size'] = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, 4)); + $extended_header_offset += 4; + + if ($info_id3v2['exthead']['flags']['crc']) { + $info_id3v2['exthead']['flag_data']['crc'] = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, 4)); + $extended_header_offset += 4; + } + $extended_header_offset += $info_id3v2['exthead']['padding_size']; + + } + + elseif ($id3v2_major_version == 4) { + + // v2.4 definition: + //Extended header size 4 * %0xxxxxxx // 28-bit synchsafe integer + //Number of flag bytes $01 + //Extended Flags $xx + // %0bcd0000 // v2.4 + // b - Tag is an update + // Flag data length $00 + // c - CRC data present + // Flag data length $05 + // Total frame CRC 5 * %0xxxxxxx + // d - Tag restrictions + // Flag data length $01 + + $info_id3v2['exthead']['length'] = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, 4), 1); + $extended_header_offset += 4; + + $info_id3v2['exthead']['flag_bytes'] = 1; + $info_id3v2['exthead']['flag_raw'] = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, $info_id3v2['exthead']['flag_bytes'])); + $extended_header_offset += $info_id3v2['exthead']['flag_bytes']; + + $info_id3v2['exthead']['flags']['update'] = (bool) ($info_id3v2['exthead']['flag_raw'] & 0x4000); + $info_id3v2['exthead']['flags']['crc'] = (bool) ($info_id3v2['exthead']['flag_raw'] & 0x2000); + $info_id3v2['exthead']['flags']['restrictions'] = (bool) ($info_id3v2['exthead']['flag_raw'] & 0x1000); + + if ($info_id3v2['exthead']['flags']['crc']) { + $info_id3v2['exthead']['flag_data']['crc'] = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, 5), 1); + $extended_header_offset += 5; + } + if ($info_id3v2['exthead']['flags']['restrictions']) { + // %ppqrrstt + $restrictions_raw = getid3_lib::BigEndian2Int(substr($frame_data, $extended_header_offset, 1)); + $extended_header_offset += 1; + $info_id3v2['exthead']['flags']['restrictions']['tagsize'] = ($restrictions_raw && 0xC0) >> 6; // p - Tag size restrictions + $info_id3v2['exthead']['flags']['restrictions']['textenc'] = ($restrictions_raw && 0x20) >> 5; // q - Text encoding restrictions + $info_id3v2['exthead']['flags']['restrictions']['textsize'] = ($restrictions_raw && 0x18) >> 3; // r - Text fields size restrictions + $info_id3v2['exthead']['flags']['restrictions']['imgenc'] = ($restrictions_raw && 0x04) >> 2; // s - Image encoding restrictions + $info_id3v2['exthead']['flags']['restrictions']['imgsize'] = ($restrictions_raw && 0x03) >> 0; // t - Image size restrictions + } + + } + $frame_data_offset += $extended_header_offset; + $frame_data = substr($frame_data, $extended_header_offset); + } // end extended header + + + + + + + while (isset($frame_data) && (strlen($frame_data) > 0)) { // cycle through until no more frame data is left to parse + if (strlen($frame_data) <= ($id3v2_major_version == 2 ? 6 : 10)) { + // insufficient room left in ID3v2 header for actual data - must be padding + $info_id3v2['padding']['start'] = $frame_data_offset; + $info_id3v2['padding']['length'] = strlen($frame_data); + $info_id3v2['padding']['valid'] = true; + for ($i = 0; $i < $info_id3v2['padding']['length']; $i++) { + if ($frame_data{$i} != "\x00") { + $info_id3v2['padding']['valid'] = false; + $info_id3v2['padding']['errorpos'] = $info_id3v2['padding']['start'] + $i; + $getid3->warning('Invalid ID3v2 padding found at offset '.$info_id3v2['padding']['errorpos'].' (the remaining '.($info_id3v2['padding']['length'] - $i).' bytes are considered invalid)'); + break; + } + } + break; // skip rest of ID3v2 header + } + + if ($id3v2_major_version == 2) { + // Frame ID $xx xx xx (three characters) + // Size $xx xx xx (24-bit integer) + // Flags $xx xx + + $frame_header = substr($frame_data, 0, 6); // take next 6 bytes for header + $frame_data = substr($frame_data, 6); // and leave the rest in $frame_data + $frame_name = substr($frame_header, 0, 3); + $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 3, 3)); + $frame_flags = 0; // not used for anything in ID3v2.2, just set to avoid E_NOTICEs + + + } elseif ($id3v2_major_version > 2) { + + // Frame ID $xx xx xx xx (four characters) + // Size $xx xx xx xx (32-bit integer in v2.3, 28-bit synchsafe in v2.4+) + // Flags $xx xx + + $frame_header = substr($frame_data, 0, 10); // take next 10 bytes for header + $frame_data = substr($frame_data, 10); // and leave the rest in $frame_data + + $frame_name = substr($frame_header, 0, 4); + + if ($id3v2_major_version == 3) { + $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4)); // 32-bit integer + + } else { // ID3v2.4+ + $frame_size = getid3_lib::BigEndianSyncSafe2Int(substr($frame_header, 4, 4)); // 32-bit synchsafe integer (28-bit value) + } + + if ($frame_size < (strlen($frame_data) + 4)) { + $nextFrameID = substr($frame_data, $frame_size, 4); + if (getid3_id3v2::IsValidID3v2FrameName($nextFrameID, $id3v2_major_version)) { + // next frame is OK + } elseif (($frame_name == "\x00".'MP3') || ($frame_name == "\x00\x00".'MP') || ($frame_name == ' MP3') || ($frame_name == 'MP3e')) { + // MP3ext known broken frames - "ok" for the purposes of this test + } elseif (($id3v2_major_version == 4) && (getid3_id3v2::IsValidID3v2FrameName(substr($frame_data, getid3_lib::BigEndian2Int(substr($frame_header, 4, 4)), 4), 3))) { + $getid3->warning('ID3v2 tag written as ID3v2.4, but with non-synchsafe integers (ID3v2.3 style). Older versions of (Helium2; iTunes) are known culprits of this. Tag has been parsed as ID3v2.3'); + $id3v2_major_version = 3; + $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4)); // 32-bit integer + } + } + + + $frame_flags = getid3_lib::BigEndian2Int(substr($frame_header, 8, 2)); + } + + if ((($id3v2_major_version == 2) && ($frame_name == "\x00\x00\x00")) || ($frame_name == "\x00\x00\x00\x00")) { + // padding encountered + + $info_id3v2['padding']['start'] = $frame_data_offset; + $info_id3v2['padding']['length'] = strlen($frame_header) + strlen($frame_data); + $info_id3v2['padding']['valid'] = true; + + $len = strlen($frame_data); + for ($i = 0; $i < $len; $i++) { + if ($frame_data{$i} != "\x00") { + $info_id3v2['padding']['valid'] = false; + $info_id3v2['padding']['errorpos'] = $info_id3v2['padding']['start'] + $i; + $getid3->warning('Invalid ID3v2 padding found at offset '.$info_id3v2['padding']['errorpos'].' (the remaining '.($info_id3v2['padding']['length'] - $i).' bytes are considered invalid)'); + break; + } + } + break; // skip rest of ID3v2 header + } + + if ($frame_name == 'COM ') { + $getid3->warning('error parsing "'.$frame_name.'" ('.$frame_data_offset.' bytes into the ID3v2.'.$id3v2_major_version.' tag). (ERROR: IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_major_version.'))). [Note: this particular error has been known to happen with tags edited by iTunes (versions "X v2.0.3", "v3.0.1" are known-guilty, probably others too)]'); + $frame_name = 'COMM'; + } + if (($frame_size <= strlen($frame_data)) && (getid3_id3v2::IsValidID3v2FrameName($frame_name, $id3v2_major_version))) { + + unset($parsed_frame); + $parsed_frame['frame_name'] = $frame_name; + $parsed_frame['frame_flags_raw'] = $frame_flags; + $parsed_frame['data'] = substr($frame_data, 0, $frame_size); + $parsed_frame['datalength'] = (int)($frame_size); + $parsed_frame['dataoffset'] = $frame_data_offset; + + $this->ParseID3v2Frame($parsed_frame); + $info_id3v2[$frame_name][] = $parsed_frame; + + $frame_data = substr($frame_data, $frame_size); + + } else { // invalid frame length or FrameID + + if ($frame_size <= strlen($frame_data)) { + + if (getid3_id3v2::IsValidID3v2FrameName(substr($frame_data, $frame_size, 4), $id3v2_major_version)) { + + // next frame is valid, just skip the current frame + $frame_data = substr($frame_data, $frame_size); + $getid3->warning('Next ID3v2 frame is valid, skipping current frame.'); + + } else { + + // next frame is invalid too, abort processing + throw new getid3_exception('Next ID3v2 frame is also invalid, aborting processing.'); + + } + + } elseif ($frame_size == strlen($frame_data)) { + + // this is the last frame, just skip + $getid3->warning('This was the last ID3v2 frame.'); + + } else { + + // next frame is invalid too, abort processing + $frame_data = null; + $getid3->warning('Invalid ID3v2 frame size, aborting.'); + + } + if (!getid3_id3v2::IsValidID3v2FrameName($frame_name, $id3v2_major_version)) { + + switch ($frame_name) { + + case "\x00\x00".'MP': + case "\x00".'MP3': + case ' MP3': + case 'MP3e': + case "\x00".'MP': + case ' MP': + case 'MP3': + $getid3->warning('error parsing "'.$frame_name.'" ('.$frame_data_offset.' bytes into the ID3v2.'.$id3v2_major_version.' tag). (ERROR: !IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_major_version.'))). [Note: this particular error has been known to happen with tags edited by "MP3ext (www.mutschler.de/mp3ext/)"]'); + break; + + default: + $getid3->warning('error parsing "'.$frame_name.'" ('.$frame_data_offset.' bytes into the ID3v2.'.$id3v2_major_version.' tag). (ERROR: !IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_major_version.'))).'); + break; + } + + } elseif ($frame_size > strlen(@$frame_data)){ + + throw new getid3_exception('error parsing "'.$frame_name.'" ('.$frame_data_offset.' bytes into the ID3v2.'.$id3v2_major_version.' tag). (ERROR: $frame_size ('.$frame_size.') > strlen($frame_data) ('.strlen($frame_data).')).'); + + } else { + + throw new getid3_exception('error parsing "'.$frame_name.'" ('.$frame_data_offset.' bytes into the ID3v2.'.$id3v2_major_version.' tag).'); + + } + + } + $frame_data_offset += ($frame_size + ($id3v2_major_version == 2 ? 6 : 10)); + + } + + } + + + // Footer + + // The footer is a copy of the header, but with a different identifier. + // ID3v2 identifier "3DI" + // ID3v2 version $04 00 + // ID3v2 flags %abcd0000 + // ID3v2 size 4 * %0xxxxxxx + + if (isset($info_id3v2_flags['isfooter']) && $info_id3v2_flags['isfooter']) { + $footer = fread ($getid3->fp, 10); + if (substr($footer, 0, 3) == '3DI') { + $info_id3v2['footer'] = true; + $info_id3v2['majorversion_footer'] = ord($footer{3}); + $info_id3v2['minorversion_footer'] = ord($footer{4}); + } + if ($info_id3v2['majorversion_footer'] <= 4) { + $id3_flags = ord($footer{5}); + $info_id3v2_flags['unsynch_footer'] = (bool)($id3_flags & 0x80); + $info_id3v2_flags['extfoot_footer'] = (bool)($id3_flags & 0x40); + $info_id3v2_flags['experim_footer'] = (bool)($id3_flags & 0x20); + $info_id3v2_flags['isfooter_footer'] = (bool)($id3_flags & 0x10); + + $info_id3v2['footerlength'] = getid3_lib::BigEndianSyncSafe2Int(substr($footer, 6, 4)); + } + } // end footer + + if (isset($info_id3v2['comments']['genre'])) { + foreach ($info_id3v2['comments']['genre'] as $key => $value) { + unset($info_id3v2['comments']['genre'][$key]); + $info_id3v2['comments'] = getid3_id3v2::array_merge_noclobber($info_id3v2['comments'], getid3_id3v2::ParseID3v2GenreString($value)); + } + } + + if (isset($info_id3v2['comments']['track'])) { + foreach ($info_id3v2['comments']['track'] as $key => $value) { + if (strstr($value, '/')) { + list($info_id3v2['comments']['track'][$key], $info_id3v2['comments']['totaltracks'][$key]) = explode('/', $info_id3v2['comments']['track'][$key]); + } + } + } + + // Use year from recording time if year not set + if (!isset($info_id3v2['comments']['year']) && ereg('^([0-9]{4})', @$info_id3v2['comments']['recording_time'][0], $matches)) { + $info_id3v2['comments']['year'] = array ($matches[1]); + } + + // Set avdataoffset + $getid3->info['avdataoffset'] = $info_id3v2['headerlength']; + if (isset($info_id3v2['footer'])) { + $getid3->info['avdataoffset'] += 10; + } + + return true; + } + + + + private function ParseID3v2Frame(&$parsed_frame) { + + $getid3 = $this->getid3; + + $id3v2_major_version = $getid3->info['id3v2']['majorversion']; + + $frame_name_long = getid3_id3v2::FrameNameLongLookup($parsed_frame['frame_name']); + if ($frame_name_long) { + $parsed_frame['framenamelong'] = $frame_name_long; + } + + $frame_name_short = getid3_id3v2::FrameNameShortLookup($parsed_frame['frame_name']); + if ($frame_name_short) { + $parsed_frame['framenameshort'] = $frame_name_short; + } + + if ($id3v2_major_version >= 3) { // frame flags are not part of the ID3v2.2 standard + + if ($id3v2_major_version == 3) { + + // Frame Header Flags + // %abc00000 %ijk00000 + + $parsed_frame['flags']['TagAlterPreservation'] = (bool)($parsed_frame['frame_flags_raw'] & 0x8000); // a - Tag alter preservation + $parsed_frame['flags']['FileAlterPreservation'] = (bool)($parsed_frame['frame_flags_raw'] & 0x4000); // b - File alter preservation + $parsed_frame['flags']['ReadOnly'] = (bool)($parsed_frame['frame_flags_raw'] & 0x2000); // c - Read only + $parsed_frame['flags']['compression'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0080); // i - Compression + $parsed_frame['flags']['Encryption'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0040); // j - Encryption + $parsed_frame['flags']['GroupingIdentity'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0020); // k - Grouping identity + + + } elseif ($id3v2_major_version == 4) { + + // Frame Header Flags + // %0abc0000 %0h00kmnp + + $parsed_frame['flags']['TagAlterPreservation'] = (bool)($parsed_frame['frame_flags_raw'] & 0x4000); // a - Tag alter preservation + $parsed_frame['flags']['FileAlterPreservation'] = (bool)($parsed_frame['frame_flags_raw'] & 0x2000); // b - File alter preservation + $parsed_frame['flags']['ReadOnly'] = (bool)($parsed_frame['frame_flags_raw'] & 0x1000); // c - Read only + $parsed_frame['flags']['GroupingIdentity'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0040); // h - Grouping identity + $parsed_frame['flags']['compression'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0008); // k - Compression + $parsed_frame['flags']['Encryption'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0004); // m - Encryption + $parsed_frame['flags']['Unsynchronisation'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0002); // n - Unsynchronisation + $parsed_frame['flags']['DataLengthIndicator'] = (bool)($parsed_frame['frame_flags_raw'] & 0x0001); // p - Data length indicator + + // Frame-level de-unsynchronisation - ID3v2.4 + if ($parsed_frame['flags']['Unsynchronisation']) { + $parsed_frame['data'] = str_replace("\xFF\x00", "\xFF", $parsed_frame['data']); + } + } + + // Frame-level de-compression + if ($parsed_frame['flags']['compression']) { + $parsed_frame['decompressed_size'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], 0, 4)); + + if (!function_exists('gzuncompress')) { + $getid3->warning('gzuncompress() support required to decompress ID3v2 frame "'.$parsed_frame['frame_name'].'"'); + } elseif ($decompressed_data = @gzuncompress(substr($parsed_frame['data'], 4))) { + $parsed_frame['data'] = $decompressed_data; + } else { + $getid3->warning('gzuncompress() failed on compressed contents of ID3v2 frame "'.$parsed_frame['frame_name'].'"'); + } + } + } + + + if (isset($parsed_frame['datalength']) && ($parsed_frame['datalength'] == 0)) { + + $warning = 'Frame "'.$parsed_frame['frame_name'].'" at offset '.$parsed_frame['dataoffset'].' has no data portion'; + switch ($parsed_frame['frame_name']) { + case 'WCOM': + $warning .= ' (this is known to happen with files tagged by RioPort)'; + break; + + default: + break; + } + $getid3->warning($warning); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'UFID')) || // 4.1 UFID Unique file identifier + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'UFI'))) { // 4.1 UFI Unique file identifier + + // There may be more than one 'UFID' frame in a tag, + // but only one with the same 'Owner identifier'. + //
    + // Owner identifier $00 + // Identifier + + $frame_terminator_pos = strpos($parsed_frame['data'], "\x00"); + $frame_id_string = substr($parsed_frame['data'], 0, $frame_terminator_pos); + $parsed_frame['ownerid'] = $frame_id_string; + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_terminator_pos + strlen("\x00")); + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'TXXX')) || // 4.2.2 TXXX User defined text information frame + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'TXX'))) { // 4.2.2 TXX User defined text information frame + + // There may be more than one 'TXXX' frame in each tag, + // but only one with the same description. + //
    + // Text encoding $xx + // Description $00 (00) + // Value + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_description) === 0) { + $frame_description = ''; + } + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['description'] = $frame_description; + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding))); + if (!empty($parsed_frame['framenameshort']) && !empty($parsed_frame['data'])) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = trim($getid3->iconv($parsed_frame['encoding'], 'UTF-8', $parsed_frame['data'])); + } + unset($parsed_frame['data']); + return true; + } + + + if ($parsed_frame['frame_name']{0} == 'T') { // 4.2. T??[?] Text information frame + + // There may only be one text information frame of its kind in an tag. + //
    + // Text encoding $xx + // Information + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + if (!empty($parsed_frame['framenameshort']) && !empty($parsed_frame['data'])) { + + // remove possible terminating \x00 (put by encoding id or software bug) + $string = $getid3->iconv($parsed_frame['encoding'], 'UTF-8', $parsed_frame['data']); + if ($string[strlen($string)-1] = "\x00") { + $string = substr($string, 0, strlen($string)-1); + } + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $string; + unset($string); + } + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'WXXX')) || // 4.3.2 WXXX User defined URL link frame + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'WXX'))) { // 4.3.2 WXX User defined URL link frame + + // There may be more than one 'WXXX' frame in each tag, + // but only one with the same description + //
    + // Text encoding $xx + // Description $00 (00) + // URL + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + + if (ord($frame_description) === 0) { + $frame_description = ''; + } + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding))); + + $frame_terminator_pos = strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + if ($frame_terminator_pos) { + // there are null bytes after the data - this is not according to spec + // only use data up to first null byte + $frame_urldata = (string)substr($parsed_frame['data'], 0, $frame_terminator_pos); + } else { + // no null bytes following data, just use all data + $frame_urldata = (string)$parsed_frame['data']; + } + + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['url'] = $frame_urldata; + $parsed_frame['description'] = $frame_description; + if (!empty($parsed_frame['framenameshort']) && $parsed_frame['url']) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $getid3->iconv($parsed_frame['encoding'], 'UTF-8', $parsed_frame['url']); + } + unset($parsed_frame['data']); + return true; + } + + + if ($parsed_frame['frame_name']{0} == 'W') { // 4.3. W??? URL link frames + + // There may only be one URL link frame of its kind in a tag, + // except when stated otherwise in the frame description + //
    + // URL + + $parsed_frame['url'] = trim($parsed_frame['data']); + if (!empty($parsed_frame['framenameshort']) && $parsed_frame['url']) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $parsed_frame['url']; + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version == 3) && ($parsed_frame['frame_name'] == 'IPLS')) || // 4.4 IPLS Involved people list (ID3v2.3 only) + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'IPL'))) { // 4.4 IPL Involved people list (ID3v2.2 only) + + // There may only be one 'IPL' frame in each tag + //
    + // Text encoding $xx + // People list strings + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($parsed_frame['encodingid']); + + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + if (!empty($parsed_frame['framenameshort']) && !empty($parsed_frame['data'])) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $getid3->iconv($parsed_frame['encoding'], 'UTF-8', $parsed_frame['data']); + } + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'MCDI')) || // 4.4 MCDI Music CD identifier + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'MCI'))) { // 4.5 MCI Music CD identifier + + // There may only be one 'MCDI' frame in each tag + //
    + // CD TOC + + if (!empty($parsed_frame['framenameshort']) && !empty($parsed_frame['data'])) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $parsed_frame['data']; + } + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'ETCO')) || // 4.5 ETCO Event timing codes + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'ETC'))) { // 4.6 ETC Event timing codes + + // There may only be one 'ETCO' frame in each tag + //
    + // Time stamp format $xx + // Where time stamp format is: + // $01 (32-bit value) MPEG frames from beginning of file + // $02 (32-bit value) milliseconds from beginning of file + // Followed by a list of key events in the following format: + // Type of event $xx + // Time stamp $xx (xx ...) + // The 'Time stamp' is set to zero if directly at the beginning of the sound + // or after the previous event. All events MUST be sorted in chronological order. + + $frame_offset = 0; + $parsed_frame['timestampformat'] = ord($parsed_frame['data']{$frame_offset++}); + + while ($frame_offset < strlen($parsed_frame['data'])) { + $parsed_frame['typeid'] = $parsed_frame['data']{$frame_offset++}; + $parsed_frame['type'] = getid3_id3v2::ETCOEventLookup($parsed_frame['typeid']); + $parsed_frame['timestamp'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 4)); + $frame_offset += 4; + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'MLLT')) || // 4.6 MLLT MPEG location lookup table + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'MLL'))) { // 4.7 MLL MPEG location lookup table + + // There may only be one 'MLLT' frame in each tag + //
    + // MPEG frames between reference $xx xx + // Bytes between reference $xx xx xx + // Milliseconds between reference $xx xx xx + // Bits for bytes deviation $xx + // Bits for milliseconds dev. $xx + // Then for every reference the following data is included; + // Deviation in bytes %xxx.... + // Deviation in milliseconds %xxx.... + + $frame_offset = 0; + $parsed_frame['framesbetweenreferences'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], 0, 2)); + $parsed_frame['bytesbetweenreferences'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], 2, 3)); + $parsed_frame['msbetweenreferences'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], 5, 3)); + $parsed_frame['bitsforbytesdeviation'] = getid3_lib::BigEndian2Int($parsed_frame['data'][8]); + $parsed_frame['bitsformsdeviation'] = getid3_lib::BigEndian2Int($parsed_frame['data'][9]); + $parsed_frame['data'] = substr($parsed_frame['data'], 10); + + while ($frame_offset < strlen($parsed_frame['data'])) { + $deviation_bitstream .= getid3_lib::BigEndian2Bin($parsed_frame['data']{$frame_offset++}); + } + $reference_counter = 0; + while (strlen($deviation_bitstream) > 0) { + $parsed_frame[$reference_counter]['bytedeviation'] = bindec(substr($deviation_bitstream, 0, $parsed_frame['bitsforbytesdeviation'])); + $parsed_frame[$reference_counter]['msdeviation'] = bindec(substr($deviation_bitstream, $parsed_frame['bitsforbytesdeviation'], $parsed_frame['bitsformsdeviation'])); + $deviation_bitstream = substr($deviation_bitstream, $parsed_frame['bitsforbytesdeviation'] + $parsed_frame['bitsformsdeviation']); + $reference_counter++; + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'SYTC')) || // 4.7 SYTC Synchronised tempo codes + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'STC'))) { // 4.8 STC Synchronised tempo codes + + // There may only be one 'SYTC' frame in each tag + //
    + // Time stamp format $xx + // Tempo data + // Where time stamp format is: + // $01 (32-bit value) MPEG frames from beginning of file + // $02 (32-bit value) milliseconds from beginning of file + + $frame_offset = 0; + $parsed_frame['timestampformat'] = ord($parsed_frame['data']{$frame_offset++}); + $timestamp_counter = 0; + while ($frame_offset < strlen($parsed_frame['data'])) { + $parsed_frame[$timestamp_counter]['tempo'] = ord($parsed_frame['data']{$frame_offset++}); + if ($parsed_frame[$timestamp_counter]['tempo'] == 255) { + $parsed_frame[$timestamp_counter]['tempo'] += ord($parsed_frame['data']{$frame_offset++}); + } + $parsed_frame[$timestamp_counter]['timestamp'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 4)); + $frame_offset += 4; + $timestamp_counter++; + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'USLT')) || // 4.8 USLT Unsynchronised lyric/text transcription + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'ULT'))) { // 4.9 ULT Unsynchronised lyric/text transcription + + // There may be more than one 'Unsynchronised lyrics/text transcription' frame + // in each tag, but only one with the same language and content descriptor. + //
    + // Text encoding $xx + // Language $xx xx xx + // Content descriptor $00 (00) + // Lyrics/text + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_language = substr($parsed_frame['data'], $frame_offset, 3); + $frame_offset += 3; + if ($frame_offset > strlen($parsed_frame['data'])) { + $frame_offset = strlen($parsed_frame['data']) - 1; + } + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_description) === 0) { + $frame_description = ''; + } + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding))); + + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['data'] = $parsed_frame['data']; + $parsed_frame['language'] = $frame_language; + $parsed_frame['languagename'] = getid3_id3v2::LanguageLookup($frame_language, false); + $parsed_frame['description'] = $frame_description; + if (!empty($parsed_frame['framenameshort']) && !empty($parsed_frame['data'])) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $getid3->iconv($parsed_frame['encoding'], 'UTF-8', $parsed_frame['data']); + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'SYLT')) || // 4.9 SYLT Synchronised lyric/text + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'SLT'))) { // 4.10 SLT Synchronised lyric/text + + // There may be more than one 'SYLT' frame in each tag, + // but only one with the same language and content descriptor. + //
    + // Text encoding $xx + // Language $xx xx xx + // Time stamp format $xx + // $01 (32-bit value) MPEG frames from beginning of file + // $02 (32-bit value) milliseconds from beginning of file + // Content type $xx + // Content descriptor $00 (00) + // Terminated text to be synced (typically a syllable) + // Sync identifier (terminator to above string) $00 (00) + // Time stamp $xx (xx ...) + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_language = substr($parsed_frame['data'], $frame_offset, 3); + $frame_offset += 3; + $parsed_frame['timestampformat'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['contenttypeid'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['contenttype'] = getid3_id3v2::SYTLContentTypeLookup($parsed_frame['contenttypeid']); + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['language'] = $frame_language; + $parsed_frame['languagename'] = getid3_id3v2::LanguageLookup($frame_language, false); + + $timestamp_index = 0; + $frame_remaining_data = substr($parsed_frame['data'], $frame_offset); + while (strlen($frame_remaining_data)) { + $frame_offset = 0; + $frame_terminator_pos = strpos($frame_remaining_data, getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)); + if ($frame_terminator_pos === false) { + $frame_remaining_data = ''; + } else { + if (ord(substr($frame_remaining_data, $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $parsed_frame['lyrics'][$timestamp_index]['data'] = substr($frame_remaining_data, $frame_offset, $frame_terminator_pos - $frame_offset); + + $frame_remaining_data = substr($frame_remaining_data, $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding))); + if (($timestamp_index == 0) && (ord($frame_remaining_data{0}) != 0)) { + // timestamp probably omitted for first data item + } else { + $parsed_frame['lyrics'][$timestamp_index]['timestamp'] = getid3_lib::BigEndian2Int(substr($frame_remaining_data, 0, 4)); + $frame_remaining_data = substr($frame_remaining_data, 4); + } + $timestamp_index++; + } + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'COMM')) || // 4.10 COMM Comments + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'COM'))) { // 4.11 COM Comments + + // There may be more than one comment frame in each tag, + // but only one with the same language and content descriptor. + //
    + // Text encoding $xx + // Language $xx xx xx + // Short content descrip. $00 (00) + // The actual text + + if (strlen($parsed_frame['data']) < 5) { + + $getid3->warning('Invalid data (too short) for "'.$parsed_frame['frame_name'].'" frame at offset '.$parsed_frame['dataoffset']); + return true; + } + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_language = substr($parsed_frame['data'], $frame_offset, 3); + $frame_offset += 3; + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_description) === 0) { + $frame_description = ''; + } + $frame_text = (string)substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding))); + + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['language'] = $frame_language; + $parsed_frame['languagename'] = getid3_id3v2::LanguageLookup($frame_language, false); + $parsed_frame['description'] = $frame_description; + $parsed_frame['data'] = $frame_text; + if (!empty($parsed_frame['framenameshort']) && !empty($parsed_frame['data'])) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $getid3->iconv($parsed_frame['encoding'], 'UTF-8', $parsed_frame['data']); + } + return true; + } + + + if (($id3v2_major_version >= 4) && ($parsed_frame['frame_name'] == 'RVA2')) { // 4.11 RVA2 Relative volume adjustment (2) (ID3v2.4+ only) + + // There may be more than one 'RVA2' frame in each tag, + // but only one with the same identification string + //
    + // Identification $00 + // The 'identification' string is used to identify the situation and/or + // device where this adjustment should apply. The following is then + // repeated for every channel: + // Type of channel $xx + // Volume adjustment $xx xx + // Bits representing peak $xx + // Peak volume $xx (xx ...) + + $frame_terminator_pos = strpos($parsed_frame['data'], "\x00"); + $frame_id_string = substr($parsed_frame['data'], 0, $frame_terminator_pos); + if (ord($frame_id_string) === 0) { + $frame_id_string = ''; + } + $frame_remaining_data = substr($parsed_frame['data'], $frame_terminator_pos + strlen("\x00")); + $parsed_frame['description'] = $frame_id_string; + + while (strlen($frame_remaining_data)) { + $frame_offset = 0; + $frame_channeltypeid = ord(substr($frame_remaining_data, $frame_offset++, 1)); + $parsed_frame[$frame_channeltypeid]['channeltypeid'] = $frame_channeltypeid; + $parsed_frame[$frame_channeltypeid]['channeltype'] = getid3_id3v2::RVA2ChannelTypeLookup($frame_channeltypeid); + $parsed_frame[$frame_channeltypeid]['volumeadjust'] = getid3_lib::BigEndian2Int(substr($frame_remaining_data, $frame_offset, 2), true); // 16-bit signed + $frame_offset += 2; + $parsed_frame[$frame_channeltypeid]['bitspeakvolume'] = ord(substr($frame_remaining_data, $frame_offset++, 1)); + $frame_bytespeakvolume = ceil($parsed_frame[$frame_channeltypeid]['bitspeakvolume'] / 8); + $parsed_frame[$frame_channeltypeid]['peakvolume'] = getid3_lib::BigEndian2Int(substr($frame_remaining_data, $frame_offset, $frame_bytespeakvolume)); + $frame_remaining_data = substr($frame_remaining_data, $frame_offset + $frame_bytespeakvolume); + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version == 3) && ($parsed_frame['frame_name'] == 'RVAD')) || // 4.12 RVAD Relative volume adjustment (ID3v2.3 only) + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'RVA'))) { // 4.12 RVA Relative volume adjustment (ID3v2.2 only) + + // There may only be one 'RVA' frame in each tag + //
    + // ID3v2.2 => Increment/decrement %000000ba + // ID3v2.3 => Increment/decrement %00fedcba + // Bits used for volume descr. $xx + // Relative volume change, right $xx xx (xx ...) // a + // Relative volume change, left $xx xx (xx ...) // b + // Peak volume right $xx xx (xx ...) + // Peak volume left $xx xx (xx ...) + // ID3v2.3 only, optional (not present in ID3v2.2): + // Relative volume change, right back $xx xx (xx ...) // c + // Relative volume change, left back $xx xx (xx ...) // d + // Peak volume right back $xx xx (xx ...) + // Peak volume left back $xx xx (xx ...) + // ID3v2.3 only, optional (not present in ID3v2.2): + // Relative volume change, center $xx xx (xx ...) // e + // Peak volume center $xx xx (xx ...) + // ID3v2.3 only, optional (not present in ID3v2.2): + // Relative volume change, bass $xx xx (xx ...) // f + // Peak volume bass $xx xx (xx ...) + + $frame_offset = 0; + $frame_incrdecrflags = getid3_lib::BigEndian2Bin($parsed_frame['data']{$frame_offset++}); + $parsed_frame['incdec']['right'] = (bool)substr($frame_incrdecrflags, 6, 1); + $parsed_frame['incdec']['left'] = (bool)substr($frame_incrdecrflags, 7, 1); + $parsed_frame['bitsvolume'] = ord($parsed_frame['data']{$frame_offset++}); + $frame_bytesvolume = ceil($parsed_frame['bitsvolume'] / 8); + $parsed_frame['volumechange']['right'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsed_frame['incdec']['right'] === false) { + $parsed_frame['volumechange']['right'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsed_frame['volumechange']['left'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsed_frame['incdec']['left'] === false) { + $parsed_frame['volumechange']['left'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsed_frame['peakvolume']['right'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + $parsed_frame['peakvolume']['left'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + if ($id3v2_major_version == 3) { + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_offset); + if (strlen($parsed_frame['data']) > 0) { + $parsed_frame['incdec']['rightrear'] = (bool)substr($frame_incrdecrflags, 4, 1); + $parsed_frame['incdec']['leftrear'] = (bool)substr($frame_incrdecrflags, 5, 1); + $parsed_frame['volumechange']['rightrear'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsed_frame['incdec']['rightrear'] === false) { + $parsed_frame['volumechange']['rightrear'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsed_frame['volumechange']['leftrear'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsed_frame['incdec']['leftrear'] === false) { + $parsed_frame['volumechange']['leftrear'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsed_frame['peakvolume']['rightrear'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + $parsed_frame['peakvolume']['leftrear'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + } + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_offset); + if (strlen($parsed_frame['data']) > 0) { + $parsed_frame['incdec']['center'] = (bool)substr($frame_incrdecrflags, 3, 1); + $parsed_frame['volumechange']['center'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsed_frame['incdec']['center'] === false) { + $parsed_frame['volumechange']['center'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsed_frame['peakvolume']['center'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + } + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_offset); + if (strlen($parsed_frame['data']) > 0) { + $parsed_frame['incdec']['bass'] = (bool)substr($frame_incrdecrflags, 2, 1); + $parsed_frame['volumechange']['bass'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsed_frame['incdec']['bass'] === false) { + $parsed_frame['volumechange']['bass'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsed_frame['peakvolume']['bass'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + } + } + unset($parsed_frame['data']); + return true; + } + + + if (($id3v2_major_version >= 4) && ($parsed_frame['frame_name'] == 'EQU2')) { // 4.12 EQU2 Equalisation (2) (ID3v2.4+ only) + + // There may be more than one 'EQU2' frame in each tag, + // but only one with the same identification string + //
    + // Interpolation method $xx + // $00 Band + // $01 Linear + // Identification $00 + // The following is then repeated for every adjustment point + // Frequency $xx xx + // Volume adjustment $xx xx + + $frame_offset = 0; + $frame_interpolationmethod = ord($parsed_frame['data']{$frame_offset++}); + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_id_string = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_id_string) === 0) { + $frame_id_string = ''; + } + $parsed_frame['description'] = $frame_id_string; + $frame_remaining_data = substr($parsed_frame['data'], $frame_terminator_pos + strlen("\x00")); + while (strlen($frame_remaining_data)) { + $frame_frequency = getid3_lib::BigEndian2Int(substr($frame_remaining_data, 0, 2)) / 2; + $parsed_frame['data'][$frame_frequency] = getid3_lib::BigEndian2Int(substr($frame_remaining_data, 2, 2), true); + $frame_remaining_data = substr($frame_remaining_data, 4); + } + $parsed_frame['interpolationmethod'] = $frame_interpolationmethod; + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version == 3) && ($parsed_frame['frame_name'] == 'EQUA')) || // 4.12 EQUA Equalisation (ID3v2.3 only) + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'EQU'))) { // 4.13 EQU Equalisation (ID3v2.2 only) + + // There may only be one 'EQUA' frame in each tag + //
    + // Adjustment bits $xx + // This is followed by 2 bytes + ('adjustment bits' rounded up to the + // nearest byte) for every equalisation band in the following format, + // giving a frequency range of 0 - 32767Hz: + // Increment/decrement %x (MSB of the Frequency) + // Frequency (lower 15 bits) + // Adjustment $xx (xx ...) + + $frame_offset = 0; + $parsed_frame['adjustmentbits'] = $parsed_frame['data']{$frame_offset++}; + $frame_adjustment_bytes = ceil($parsed_frame['adjustmentbits'] / 8); + + $frame_remaining_data = (string)substr($parsed_frame['data'], $frame_offset); + while (strlen($frame_remaining_data) > 0) { + $frame_frequencystr = getid3_lib::BigEndian2Bin(substr($frame_remaining_data, 0, 2)); + $frame_incdec = (bool)substr($frame_frequencystr, 0, 1); + $frame_frequency = bindec(substr($frame_frequencystr, 1, 15)); + $parsed_frame[$frame_frequency]['incdec'] = $frame_incdec; + $parsed_frame[$frame_frequency]['adjustment'] = getid3_lib::BigEndian2Int(substr($frame_remaining_data, 2, $frame_adjustment_bytes)); + if ($parsed_frame[$frame_frequency]['incdec'] === false) { + $parsed_frame[$frame_frequency]['adjustment'] *= -1; + } + $frame_remaining_data = substr($frame_remaining_data, 2 + $frame_adjustment_bytes); + } + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'RVRB')) || // 4.13 RVRB Reverb + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'REV'))) { // 4.14 REV Reverb + + // There may only be one 'RVRB' frame in each tag. + //
    + // Reverb left (ms) $xx xx + // Reverb right (ms) $xx xx + // Reverb bounces, left $xx + // Reverb bounces, right $xx + // Reverb feedback, left to left $xx + // Reverb feedback, left to right $xx + // Reverb feedback, right to right $xx + // Reverb feedback, right to left $xx + // Premix left to right $xx + // Premix right to left $xx + + $frame_offset = 0; + $parsed_frame['left'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsed_frame['right'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsed_frame['bouncesL'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['bouncesR'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['feedbackLL'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['feedbackLR'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['feedbackRR'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['feedbackRL'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['premixLR'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['premixRL'] = ord($parsed_frame['data']{$frame_offset++}); + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'APIC')) || // 4.14 APIC Attached picture + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'PIC'))) { // 4.15 PIC Attached picture + + // There may be several pictures attached to one file, + // each in their individual 'APIC' frame, but only one + // with the same content descriptor + //
    + // Text encoding $xx + // ID3v2.3+ => MIME type $00 + // ID3v2.2 => Image format $xx xx xx + // Picture type $xx + // Description $00 (00) + // Picture data + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + + if ($id3v2_major_version == 2 && strlen($parsed_frame['data']) > $frame_offset) { + $frame_imagetype = substr($parsed_frame['data'], $frame_offset, 3); + if (strtolower($frame_imagetype) == 'ima') { + // complete hack for mp3Rage (www.chaoticsoftware.com) that puts ID3v2.3-formatted + // MIME type instead of 3-char ID3v2.2-format image type (thanks xbhoff�pacbell*net) + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_mimetype = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_mimetype) === 0) { + $frame_mimetype = ''; + } + $frame_imagetype = strtoupper(str_replace('image/', '', strtolower($frame_mimetype))); + if ($frame_imagetype == 'JPEG') { + $frame_imagetype = 'JPG'; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + } else { + $frame_offset += 3; + } + } + + if ($id3v2_major_version > 2 && strlen($parsed_frame['data']) > $frame_offset) { + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_mimetype = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_mimetype) === 0) { + $frame_mimetype = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + } + + $frame_picturetype = ord($parsed_frame['data']{$frame_offset++}); + + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_description) === 0) { + $frame_description = ''; + } + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + if ($id3v2_major_version == 2) { + $parsed_frame['imagetype'] = $frame_imagetype; + } else { + $parsed_frame['mime'] = $frame_mimetype; + } + $parsed_frame['picturetypeid'] = $frame_picturetype; + $parsed_frame['picturetype'] = getid3_id3v2::APICPictureTypeLookup($frame_picturetype); + $parsed_frame['description'] = $frame_description; + $parsed_frame['data'] = substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding))); + + if ($getid3->option_tags_images) { + + $image_chunk_check = getid3_lib_image_size::get($parsed_frame['data']); + if (($image_chunk_check[2] >= 1) && ($image_chunk_check[2] <= 3)) { + $parsed_frame['image_mime'] = image_type_to_mime_type($image_chunk_check[2]); + + if ($image_chunk_check[0]) { + $parsed_frame['image_width'] = $image_chunk_check[0]; + } + + if ($image_chunk_check[1]) { + $parsed_frame['image_height'] = $image_chunk_check[1]; + } + + $parsed_frame['image_bytes'] = strlen($parsed_frame['data']); + } + } + + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'GEOB')) || // 4.15 GEOB General encapsulated object + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'GEO'))) { // 4.16 GEO General encapsulated object + + // There may be more than one 'GEOB' frame in each tag, + // but only one with the same content descriptor + //
    + // Text encoding $xx + // MIME type $00 + // Filename $00 (00) + // Content description $00 (00) + // Encapsulated object + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_mimetype = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_mimetype) === 0) { + $frame_mimetype = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_filename = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_filename) === 0) { + $frame_filename = ''; + } + $frame_offset = $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)); + + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_description) === 0) { + $frame_description = ''; + } + $frame_offset = $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)); + + $parsed_frame['objectdata'] = (string)substr($parsed_frame['data'], $frame_offset); + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['mime'] = $frame_mimetype; + $parsed_frame['filename'] = $frame_filename; + $parsed_frame['description'] = $frame_description; + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'PCNT')) || // 4.16 PCNT Play counter + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'CNT'))) { // 4.17 CNT Play counter + + // There may only be one 'PCNT' frame in each tag. + // When the counter reaches all one's, one byte is inserted in + // front of the counter thus making the counter eight bits bigger + //
    + // Counter $xx xx xx xx (xx ...) + + $parsed_frame['data'] = getid3_lib::BigEndian2Int($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'POPM')) || // 4.17 POPM Popularimeter + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'POP'))) { // 4.18 POP Popularimeter + + // There may be more than one 'POPM' frame in each tag, + // but only one with the same email address + //
    + // Email to user $00 + // Rating $xx + // Counter $xx xx xx xx (xx ...) + + $frame_offset = 0; + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_email_address = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_email_address) === 0) { + $frame_email_address = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + $frame_rating = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['data'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset)); + $parsed_frame['email'] = $frame_email_address; + $parsed_frame['rating'] = $frame_rating; + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'RBUF')) || // 4.18 RBUF Recommended buffer size + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'BUF'))) { // 4.19 BUF Recommended buffer size + + // There may only be one 'RBUF' frame in each tag + //
    + // Buffer size $xx xx xx + // Embedded info flag %0000000x + // Offset to next tag $xx xx xx xx + + $frame_offset = 0; + $parsed_frame['buffersize'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 3)); + $frame_offset += 3; + + $frame_embeddedinfoflags = getid3_lib::BigEndian2Bin($parsed_frame['data']{$frame_offset++}); + $parsed_frame['flags']['embededinfo'] = (bool)substr($frame_embeddedinfoflags, 7, 1); + $parsed_frame['nexttagoffset'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 4)); + unset($parsed_frame['data']); + return true; + } + + + if (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'CRM')) { // 4.20 Encrypted meta frame (ID3v2.2 only) + + // There may be more than one 'CRM' frame in a tag, + // but only one with the same 'owner identifier' + //
    + // Owner identifier $00 (00) + // Content/explanation $00 (00) + // Encrypted datablock + + $frame_offset = 0; + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_owner_id = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_description) === 0) { + $frame_description = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $parsed_frame['ownerid'] = $frame_owner_id; + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + $parsed_frame['description'] = $frame_description; + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'AENC')) || // 4.19 AENC Audio encryption + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'CRA'))) { // 4.21 CRA Audio encryption + + // There may be more than one 'AENC' frames in a tag, + // but only one with the same 'Owner identifier' + //
    + // Owner identifier $00 + // Preview start $xx xx + // Preview length $xx xx + // Encryption info + + $frame_offset = 0; + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_owner_id = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_owner_id) === 0) { + $frame_owner_id == ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + $parsed_frame['ownerid'] = $frame_owner_id; + $parsed_frame['previewstart'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsed_frame['previewlength'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsed_frame['encryptioninfo'] = (string)substr($parsed_frame['data'], $frame_offset); + unset($parsed_frame['data']); + return true; + } + + + if ((($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'LINK')) || // 4.20 LINK Linked information + (($id3v2_major_version == 2) && ($parsed_frame['frame_name'] == 'LNK'))) { // 4.22 LNK Linked information + + // There may be more than one 'LINK' frame in a tag, + // but only one with the same contents + //
    + // ID3v2.3+ => Frame identifier $xx xx xx xx + // ID3v2.2 => Frame identifier $xx xx xx + // URL $00 + // ID and additional data + + $frame_offset = 0; + if ($id3v2_major_version == 2) { + $parsed_frame['frameid'] = substr($parsed_frame['data'], $frame_offset, 3); + $frame_offset += 3; + } else { + $parsed_frame['frameid'] = substr($parsed_frame['data'], $frame_offset, 4); + $frame_offset += 4; + } + + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_url = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_url) === 0) { + $frame_url = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + $parsed_frame['url'] = $frame_url; + + $parsed_frame['additionaldata'] = (string)substr($parsed_frame['data'], $frame_offset); + if (!empty($parsed_frame['framenameshort']) && $parsed_frame['url']) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = utf8_encode($parsed_frame['url']); + } + unset($parsed_frame['data']); + return true; + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'POSS')) { // 4.21 POSS Position synchronisation frame (ID3v2.3+ only) + + // There may only be one 'POSS' frame in each tag + // + // Time stamp format $xx + // Position $xx (xx ...) + + $frame_offset = 0; + $parsed_frame['timestampformat'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['position'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset)); + unset($parsed_frame['data']); + return true; + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'USER')) { // 4.22 USER Terms of use (ID3v2.3+ only) + + // There may be more than one 'Terms of use' frame in a tag, + // but only one with the same 'Language' + //
    + // Text encoding $xx + // Language $xx xx xx + // The actual text + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_language = substr($parsed_frame['data'], $frame_offset, 3); + $frame_offset += 3; + $parsed_frame['language'] = $frame_language; + $parsed_frame['languagename'] = getid3_id3v2::LanguageLookup($frame_language, false); + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + if (!empty($parsed_frame['framenameshort']) && !empty($parsed_frame['data'])) { + $getid3->info['id3v2']['comments'][$parsed_frame['framenameshort']][] = $getid3->iconv($parsed_frame['encoding'], 'UTF-8', $parsed_frame['data']); + } + unset($parsed_frame['data']); + return true; + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'OWNE')) { // 4.23 OWNE Ownership frame (ID3v2.3+ only) + + // There may only be one 'OWNE' frame in a tag + //
    + // Text encoding $xx + // Price paid $00 + // Date of purch. + // Seller + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_pricepaid = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $parsed_frame['pricepaid']['currencyid'] = substr($frame_pricepaid, 0, 3); + $parsed_frame['pricepaid']['currency'] = getid3_id3v2::LookupCurrencyUnits($parsed_frame['pricepaid']['currencyid']); + $parsed_frame['pricepaid']['value'] = substr($frame_pricepaid, 3); + + $parsed_frame['purchasedate'] = substr($parsed_frame['data'], $frame_offset, 8); + if (!getid3_id3v2::IsValidDateStampString($parsed_frame['purchasedate'])) { + $parsed_frame['purchasedateunix'] = gmmktime (0, 0, 0, substr($parsed_frame['purchasedate'], 4, 2), substr($parsed_frame['purchasedate'], 6, 2), substr($parsed_frame['purchasedate'], 0, 4)); + } + $frame_offset += 8; + + $parsed_frame['seller'] = (string)substr($parsed_frame['data'], $frame_offset); + unset($parsed_frame['data']); + return true; + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'COMR')) { // 4.24 COMR Commercial frame (ID3v2.3+ only) + + // There may be more than one 'commercial frame' in a tag, + // but no two may be identical + //
    + // Text encoding $xx + // Price string $00 + // Valid until + // Contact URL $00 + // Received as $xx + // Name of seller $00 (00) + // Description $00 (00) + // Picture MIME type $00 + // Seller logo + + $frame_offset = 0; + $frame_text_encoding = ord($parsed_frame['data']{$frame_offset++}); + if ((($id3v2_major_version <= 3) && ($frame_text_encoding > 1)) || (($id3v2_major_version == 4) && ($frame_text_encoding > 3))) { + $getid3->warning('Invalid text encoding byte ('.$frame_text_encoding.') in frame "'.$parsed_frame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_price_string = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + $frame_offset = $frame_terminator_pos + strlen("\x00"); + $frame_rawpricearray = explode('/', $frame_price_string); + foreach ($frame_rawpricearray as $key => $val) { + $frame_currencyid = substr($val, 0, 3); + $parsed_frame['price'][$frame_currencyid]['currency'] = getid3_id3v2::LookupCurrencyUnits($frame_currencyid); + $parsed_frame['price'][$frame_currencyid]['value'] = substr($val, 3); + } + + $frame_date_string = substr($parsed_frame['data'], $frame_offset, 8); + $frame_offset += 8; + + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_contacturl = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $frame_received_as_id = ord($parsed_frame['data']{$frame_offset++}); + + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + + $frame_sellername = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_sellername) === 0) { + $frame_sellername = ''; + } + + $frame_offset = $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)); + + $frame_terminator_pos = @strpos($parsed_frame['data'], getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding), $frame_offset); + if (ord(substr($parsed_frame['data'], $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)), 1)) === 0) { + $frame_terminator_pos++; // @strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + + $frame_description = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_description) === 0) { + $frame_description = ''; + } + + $frame_offset = $frame_terminator_pos + strlen(getid3_id3v2::TextEncodingTerminatorLookup($frame_text_encoding)); + + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_mimetype = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $frame_sellerlogo = substr($parsed_frame['data'], $frame_offset); + + $parsed_frame['encodingid'] = $frame_text_encoding; + $parsed_frame['encoding'] = $this->TextEncodingNameLookup($frame_text_encoding); + + $parsed_frame['pricevaliduntil'] = $frame_date_string; + $parsed_frame['contacturl'] = $frame_contacturl; + $parsed_frame['receivedasid'] = $frame_received_as_id; + $parsed_frame['receivedas'] = getid3_id3v2::COMRReceivedAsLookup($frame_received_as_id); + $parsed_frame['sellername'] = $frame_sellername; + $parsed_frame['description'] = $frame_description; + $parsed_frame['mime'] = $frame_mimetype; + $parsed_frame['logo'] = $frame_sellerlogo; + unset($parsed_frame['data']); + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'ENCR')) { // 4.25 ENCR Encryption method registration (ID3v2.3+ only) + + // There may be several 'ENCR' frames in a tag, + // but only one containing the same symbol + // and only one containing the same owner identifier + //
    + // Owner identifier $00 + // Method symbol $xx + // Encryption data + + $frame_offset = 0; + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_owner_id = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_owner_id) === 0) { + $frame_owner_id = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $parsed_frame['ownerid'] = $frame_owner_id; + $parsed_frame['methodsymbol'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + return true; + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'GRID')) { // 4.26 GRID Group identification registration (ID3v2.3+ only) + + // There may be several 'GRID' frames in a tag, + // but only one containing the same symbol + // and only one containing the same owner identifier + //
    + // Owner identifier $00 + // Group symbol $xx + // Group dependent data + + $frame_offset = 0; + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_owner_id = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_owner_id) === 0) { + $frame_owner_id = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $parsed_frame['ownerid'] = $frame_owner_id; + $parsed_frame['groupsymbol'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + return true; + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'PRIV')) { // 4.27 PRIV Private frame (ID3v2.3+ only) + + // The tag may contain more than one 'PRIV' frame + // but only with different contents + //
    + // Owner identifier $00 + // The private data + + $frame_offset = 0; + $frame_terminator_pos = @strpos($parsed_frame['data'], "\x00", $frame_offset); + $frame_owner_id = substr($parsed_frame['data'], $frame_offset, $frame_terminator_pos - $frame_offset); + if (ord($frame_owner_id) === 0) { + $frame_owner_id = ''; + } + $frame_offset = $frame_terminator_pos + strlen("\x00"); + + $parsed_frame['ownerid'] = $frame_owner_id; + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + return true; + } + + + if (($id3v2_major_version >= 4) && ($parsed_frame['frame_name'] == 'SIGN')) { // 4.28 SIGN Signature frame (ID3v2.4+ only) + + // There may be more than one 'signature frame' in a tag, + // but no two may be identical + //
    + // Group symbol $xx + // Signature + + $frame_offset = 0; + $parsed_frame['groupsymbol'] = ord($parsed_frame['data']{$frame_offset++}); + $parsed_frame['data'] = (string)substr($parsed_frame['data'], $frame_offset); + return true; + } + + + if (($id3v2_major_version >= 4) && ($parsed_frame['frame_name'] == 'SEEK')) { // 4.29 SEEK Seek frame (ID3v2.4+ only) + + // There may only be one 'seek frame' in a tag + //
    + // Minimum offset to next tag $xx xx xx xx + + $frame_offset = 0; + $parsed_frame['data'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 4)); + return true; + } + + + if (($id3v2_major_version >= 4) && ($parsed_frame['frame_name'] == 'ASPI')) { // 4.30 ASPI Audio seek point index (ID3v2.4+ only) + + // There may only be one 'audio seek point index' frame in a tag + //
    + // Indexed data start (S) $xx xx xx xx + // Indexed data length (L) $xx xx xx xx + // Number of index points (N) $xx xx + // Bits per index point (b) $xx + // Then for every index point the following data is included: + // Fraction at index (Fi) $xx (xx) + + $frame_offset = 0; + $parsed_frame['datastart'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 4)); + $frame_offset += 4; + $parsed_frame['indexeddatalength'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 4)); + $frame_offset += 4; + $parsed_frame['indexpoints'] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsed_frame['bitsperpoint'] = ord($parsed_frame['data']{$frame_offset++}); + $frame_bytesperpoint = ceil($parsed_frame['bitsperpoint'] / 8); + for ($i = 0; $i < $frame_indexpoints; $i++) { + $parsed_frame['indexes'][$i] = getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, $frame_bytesperpoint)); + $frame_offset += $frame_bytesperpoint; + } + unset($parsed_frame['data']); + return true; + } + + + if (($id3v2_major_version >= 3) && ($parsed_frame['frame_name'] == 'RGAD')) { // Replay Gain Adjustment + + // http://privatewww.essex.ac.uk/~djmrob/replaygain/file_format_id3v2.html + // There may only be one 'RGAD' frame in a tag + //
    + // Peak Amplitude $xx $xx $xx $xx + // Radio Replay Gain Adjustment %aaabbbcd %dddddddd + // Audiophile Replay Gain Adjustment %aaabbbcd %dddddddd + // a - name code + // b - originator code + // c - sign bit + // d - replay gain adjustment + + $frame_offset = 0; + + $parsed_frame['peakamplitude'] = (float)getid3_lib::BigEndian2Int(substr($parsed_frame['data'], $frame_offset, 4)); + $frame_offset += 4; + + $rg_track_adjustment = decbin(substr($parsed_frame['data'], $frame_offset, 2)); + $frame_offset += 2; + + $rg_album_adjustment = decbin(substr($parsed_frame['data'], $frame_offset, 2)); + $frame_offset += 2; + + $parsed_frame['raw']['track']['name'] = bindec(substr($rg_track_adjustment, 0, 3)); + $parsed_frame['raw']['track']['originator'] = bindec(substr($rg_track_adjustment, 3, 3)); + $parsed_frame['raw']['track']['signbit'] = bindec($rg_track_adjustment[6]); + $parsed_frame['raw']['track']['adjustment'] = bindec(substr($rg_track_adjustment, 7, 9)); + $parsed_frame['raw']['album']['name'] = bindec(substr($rg_album_adjustment, 0, 3)); + $parsed_frame['raw']['album']['originator'] = bindec(substr($rg_album_adjustment, 3, 3)); + $parsed_frame['raw']['album']['signbit'] = bindec($rg_album_adjustment[6]); + $parsed_frame['raw']['album']['adjustment'] = bindec(substr($rg_album_adjustment, 7, 9)); + $parsed_frame['track']['name'] = getid3_lib_replaygain::NameLookup($parsed_frame['raw']['track']['name']); + $parsed_frame['track']['originator'] = getid3_lib_replaygain::OriginatorLookup($parsed_frame['raw']['track']['originator']); + $parsed_frame['track']['adjustment'] = getid3_lib_replaygain::AdjustmentLookup($parsed_frame['raw']['track']['adjustment'], $parsed_frame['raw']['track']['signbit']); + $parsed_frame['album']['name'] = getid3_lib_replaygain::NameLookup($parsed_frame['raw']['album']['name']); + $parsed_frame['album']['originator'] = getid3_lib_replaygain::OriginatorLookup($parsed_frame['raw']['album']['originator']); + $parsed_frame['album']['adjustment'] = getid3_lib_replaygain::AdjustmentLookup($parsed_frame['raw']['album']['adjustment'], $parsed_frame['raw']['album']['signbit']); + + $getid3->info['replay_gain']['track']['peak'] = $parsed_frame['peakamplitude']; + $getid3->info['replay_gain']['track']['originator'] = $parsed_frame['track']['originator']; + $getid3->info['replay_gain']['track']['adjustment'] = $parsed_frame['track']['adjustment']; + $getid3->info['replay_gain']['album']['originator'] = $parsed_frame['album']['originator']; + $getid3->info['replay_gain']['album']['adjustment'] = $parsed_frame['album']['adjustment']; + + unset($parsed_frame['data']); + return true; + } + + return true; + } + + + + private function TextEncodingNameLookup($encoding) { + + // Override specification - BRAINDEAD taggers + if (!$encoding) { + return $this->getid3->encoding_id3v2; + } + + // http://www.id3.org/id3v2.4.0-structure.txt + static $lookup = array ( + 0 => 'ISO-8859-1', + 1 => 'UTF-16', + 2 => 'UTF-16BE', + 3 => 'UTF-8', + 255 => 'UTF-16BE' + ); + + return (isset($lookup[$encoding]) ? $lookup[$encoding] : 'ISO-8859-1'); + } + + + + public static function ParseID3v2GenreString($genre_string) { + + // Parse genres into arrays of genreName and genreID + // ID3v2.2.x, ID3v2.3.x: '(21)' or '(4)Eurodisco' or '(51)(39)' or '(55)((I think...)' + // ID3v2.4.x: '21' $00 'Eurodisco' $00 + + $genre_string = trim($genre_string); + $return_array = array (); + if (strpos($genre_string, "\x00") !== false) { + $unprocessed = trim($genre_string); // trailing nulls will cause an infinite loop. + $genre_string = ''; + while (strpos($unprocessed, "\x00") !== false) { + // convert null-seperated v2.4-format into v2.3 ()-seperated format + $end_pos = strpos($unprocessed, "\x00"); + $genre_string .= '('.substr($unprocessed, 0, $end_pos).')'; + $unprocessed = substr($unprocessed, $end_pos + 1); + } + unset($unprocessed); + } + if (getid3_id3v1::LookupGenreID($genre_string)) { + + $return_array['genre'][] = $genre_string; + + } else { + + while (strpos($genre_string, '(') !== false) { + + $start_pos = strpos($genre_string, '('); + $end_pos = strpos($genre_string, ')'); + if (substr($genre_string, $start_pos + 1, 1) == '(') { + $genre_string = substr($genre_string, 0, $start_pos).substr($genre_string, $start_pos + 1); + $end_pos--; + } + $element = substr($genre_string, $start_pos + 1, $end_pos - ($start_pos + 1)); + $genre_string = substr($genre_string, 0, $start_pos).substr($genre_string, $end_pos + 1); + + if (getid3_id3v1::LookupGenreName($element)) { // $element is a valid genre id/abbreviation + + if (empty($return_array['genre']) || !in_array(getid3_id3v1::LookupGenreName($element), $return_array['genre'])) { // avoid duplicate entires + $return_array['genre'][] = getid3_id3v1::LookupGenreName($element); + } + } else { + + if (empty($return_array['genre']) || !in_array($element, $return_array['genre'])) { // avoid duplicate entires + $return_array['genre'][] = $element; + } + } + } + } + if ($genre_string) { + if (empty($return_array['genre']) || !in_array($genre_string, $return_array['genre'])) { // avoid duplicate entires + $return_array['genre'][] = $genre_string; + } + } + + return $return_array; + } + + + + public static function LookupCurrencyUnits($currency_id) { + + static $lookup = array ( + 'AED' => 'Dirhams', + 'AFA' => 'Afghanis', + 'ALL' => 'Leke', + 'AMD' => 'Drams', + 'ANG' => 'Guilders', + 'AOA' => 'Kwanza', + 'ARS' => 'Pesos', + 'ATS' => 'Schillings', + 'AUD' => 'Dollars', + 'AWG' => 'Guilders', + 'AZM' => 'Manats', + 'BAM' => 'Convertible Marka', + 'BBD' => 'Dollars', + 'BDT' => 'Taka', + 'BEF' => 'Francs', + 'BGL' => 'Leva', + 'BHD' => 'Dinars', + 'BIF' => 'Francs', + 'BMD' => 'Dollars', + 'BND' => 'Dollars', + 'BOB' => 'Bolivianos', + 'BRL' => 'Brazil Real', + 'BSD' => 'Dollars', + 'BTN' => 'Ngultrum', + 'BWP' => 'Pulas', + 'BYR' => 'Rubles', + 'BZD' => 'Dollars', + 'CAD' => 'Dollars', + 'CDF' => 'Congolese Francs', + 'CHF' => 'Francs', + 'CLP' => 'Pesos', + 'CNY' => 'Yuan Renminbi', + 'COP' => 'Pesos', + 'CRC' => 'Colones', + 'CUP' => 'Pesos', + 'CVE' => 'Escudos', + 'CYP' => 'Pounds', + 'CZK' => 'Koruny', + 'DEM' => 'Deutsche Marks', + 'DJF' => 'Francs', + 'DKK' => 'Kroner', + 'DOP' => 'Pesos', + 'DZD' => 'Algeria Dinars', + 'EEK' => 'Krooni', + 'EGP' => 'Pounds', + 'ERN' => 'Nakfa', + 'ESP' => 'Pesetas', + 'ETB' => 'Birr', + 'EUR' => 'Euro', + 'FIM' => 'Markkaa', + 'FJD' => 'Dollars', + 'FKP' => 'Pounds', + 'FRF' => 'Francs', + 'GBP' => 'Pounds', + 'GEL' => 'Lari', + 'GGP' => 'Pounds', + 'GHC' => 'Cedis', + 'GIP' => 'Pounds', + 'GMD' => 'Dalasi', + 'GNF' => 'Francs', + 'GRD' => 'Drachmae', + 'GTQ' => 'Quetzales', + 'GYD' => 'Dollars', + 'HKD' => 'Dollars', + 'HNL' => 'Lempiras', + 'HRK' => 'Kuna', + 'HTG' => 'Gourdes', + 'HUF' => 'Forints', + 'IDR' => 'Rupiahs', + 'IEP' => 'Pounds', + 'ILS' => 'New Shekels', + 'IMP' => 'Pounds', + 'INR' => 'Rupees', + 'IQD' => 'Dinars', + 'IRR' => 'Rials', + 'ISK' => 'Kronur', + 'ITL' => 'Lire', + 'JEP' => 'Pounds', + 'JMD' => 'Dollars', + 'JOD' => 'Dinars', + 'JPY' => 'Yen', + 'KES' => 'Shillings', + 'KGS' => 'Soms', + 'KHR' => 'Riels', + 'KMF' => 'Francs', + 'KPW' => 'Won', + 'KWD' => 'Dinars', + 'KYD' => 'Dollars', + 'KZT' => 'Tenge', + 'LAK' => 'Kips', + 'LBP' => 'Pounds', + 'LKR' => 'Rupees', + 'LRD' => 'Dollars', + 'LSL' => 'Maloti', + 'LTL' => 'Litai', + 'LUF' => 'Francs', + 'LVL' => 'Lati', + 'LYD' => 'Dinars', + 'MAD' => 'Dirhams', + 'MDL' => 'Lei', + 'MGF' => 'Malagasy Francs', + 'MKD' => 'Denars', + 'MMK' => 'Kyats', + 'MNT' => 'Tugriks', + 'MOP' => 'Patacas', + 'MRO' => 'Ouguiyas', + 'MTL' => 'Liri', + 'MUR' => 'Rupees', + 'MVR' => 'Rufiyaa', + 'MWK' => 'Kwachas', + 'MXN' => 'Pesos', + 'MYR' => 'Ringgits', + 'MZM' => 'Meticais', + 'NAD' => 'Dollars', + 'NGN' => 'Nairas', + 'NIO' => 'Gold Cordobas', + 'NLG' => 'Guilders', + 'NOK' => 'Krone', + 'NPR' => 'Nepal Rupees', + 'NZD' => 'Dollars', + 'OMR' => 'Rials', + 'PAB' => 'Balboa', + 'PEN' => 'Nuevos Soles', + 'PGK' => 'Kina', + 'PHP' => 'Pesos', + 'PKR' => 'Rupees', + 'PLN' => 'Zlotych', + 'PTE' => 'Escudos', + 'PYG' => 'Guarani', + 'QAR' => 'Rials', + 'ROL' => 'Lei', + 'RUR' => 'Rubles', + 'RWF' => 'Rwanda Francs', + 'SAR' => 'Riyals', + 'SBD' => 'Dollars', + 'SCR' => 'Rupees', + 'SDD' => 'Dinars', + 'SEK' => 'Kronor', + 'SGD' => 'Dollars', + 'SHP' => 'Pounds', + 'SIT' => 'Tolars', + 'SKK' => 'Koruny', + 'SLL' => 'Leones', + 'SOS' => 'Shillings', + 'SPL' => 'Luigini', + 'SRG' => 'Guilders', + 'STD' => 'Dobras', + 'SVC' => 'Colones', + 'SYP' => 'Pounds', + 'SZL' => 'Emalangeni', + 'THB' => 'Baht', + 'TJR' => 'Rubles', + 'TMM' => 'Manats', + 'TND' => 'Dinars', + 'TOP' => 'Pa\'anga', + 'TRL' => 'Liras', + 'TTD' => 'Dollars', + 'TVD' => 'Tuvalu Dollars', + 'TWD' => 'New Dollars', + 'TZS' => 'Shillings', + 'UAH' => 'Hryvnia', + 'UGX' => 'Shillings', + 'USD' => 'Dollars', + 'UYU' => 'Pesos', + 'UZS' => 'Sums', + 'VAL' => 'Lire', + 'VEB' => 'Bolivares', + 'VND' => 'Dong', + 'VUV' => 'Vatu', + 'WST' => 'Tala', + 'XAF' => 'Francs', + 'XAG' => 'Ounces', + 'XAU' => 'Ounces', + 'XCD' => 'Dollars', + 'XDR' => 'Special Drawing Rights', + 'XPD' => 'Ounces', + 'XPF' => 'Francs', + 'XPT' => 'Ounces', + 'YER' => 'Rials', + 'YUM' => 'New Dinars', + 'ZAR' => 'Rand', + 'ZMK' => 'Kwacha', + 'ZWD' => 'Zimbabwe Dollars' + ); + + return @$lookup[$currency_id]; + } + + + + public static function LookupCurrencyCountry($currency_id) { + + static $lookup = array ( + 'AED' => 'United Arab Emirates', + 'AFA' => 'Afghanistan', + 'ALL' => 'Albania', + 'AMD' => 'Armenia', + 'ANG' => 'Netherlands Antilles', + 'AOA' => 'Angola', + 'ARS' => 'Argentina', + 'ATS' => 'Austria', + 'AUD' => 'Australia', + 'AWG' => 'Aruba', + 'AZM' => 'Azerbaijan', + 'BAM' => 'Bosnia and Herzegovina', + 'BBD' => 'Barbados', + 'BDT' => 'Bangladesh', + 'BEF' => 'Belgium', + 'BGL' => 'Bulgaria', + 'BHD' => 'Bahrain', + 'BIF' => 'Burundi', + 'BMD' => 'Bermuda', + 'BND' => 'Brunei Darussalam', + 'BOB' => 'Bolivia', + 'BRL' => 'Brazil', + 'BSD' => 'Bahamas', + 'BTN' => 'Bhutan', + 'BWP' => 'Botswana', + 'BYR' => 'Belarus', + 'BZD' => 'Belize', + 'CAD' => 'Canada', + 'CDF' => 'Congo/Kinshasa', + 'CHF' => 'Switzerland', + 'CLP' => 'Chile', + 'CNY' => 'China', + 'COP' => 'Colombia', + 'CRC' => 'Costa Rica', + 'CUP' => 'Cuba', + 'CVE' => 'Cape Verde', + 'CYP' => 'Cyprus', + 'CZK' => 'Czech Republic', + 'DEM' => 'Germany', + 'DJF' => 'Djibouti', + 'DKK' => 'Denmark', + 'DOP' => 'Dominican Republic', + 'DZD' => 'Algeria', + 'EEK' => 'Estonia', + 'EGP' => 'Egypt', + 'ERN' => 'Eritrea', + 'ESP' => 'Spain', + 'ETB' => 'Ethiopia', + 'EUR' => 'Euro Member Countries', + 'FIM' => 'Finland', + 'FJD' => 'Fiji', + 'FKP' => 'Falkland Islands (Malvinas)', + 'FRF' => 'France', + 'GBP' => 'United Kingdom', + 'GEL' => 'Georgia', + 'GGP' => 'Guernsey', + 'GHC' => 'Ghana', + 'GIP' => 'Gibraltar', + 'GMD' => 'Gambia', + 'GNF' => 'Guinea', + 'GRD' => 'Greece', + 'GTQ' => 'Guatemala', + 'GYD' => 'Guyana', + 'HKD' => 'Hong Kong', + 'HNL' => 'Honduras', + 'HRK' => 'Croatia', + 'HTG' => 'Haiti', + 'HUF' => 'Hungary', + 'IDR' => 'Indonesia', + 'IEP' => 'Ireland (Eire)', + 'ILS' => 'Israel', + 'IMP' => 'Isle of Man', + 'INR' => 'India', + 'IQD' => 'Iraq', + 'IRR' => 'Iran', + 'ISK' => 'Iceland', + 'ITL' => 'Italy', + 'JEP' => 'Jersey', + 'JMD' => 'Jamaica', + 'JOD' => 'Jordan', + 'JPY' => 'Japan', + 'KES' => 'Kenya', + 'KGS' => 'Kyrgyzstan', + 'KHR' => 'Cambodia', + 'KMF' => 'Comoros', + 'KPW' => 'Korea', + 'KWD' => 'Kuwait', + 'KYD' => 'Cayman Islands', + 'KZT' => 'Kazakstan', + 'LAK' => 'Laos', + 'LBP' => 'Lebanon', + 'LKR' => 'Sri Lanka', + 'LRD' => 'Liberia', + 'LSL' => 'Lesotho', + 'LTL' => 'Lithuania', + 'LUF' => 'Luxembourg', + 'LVL' => 'Latvia', + 'LYD' => 'Libya', + 'MAD' => 'Morocco', + 'MDL' => 'Moldova', + 'MGF' => 'Madagascar', + 'MKD' => 'Macedonia', + 'MMK' => 'Myanmar (Burma)', + 'MNT' => 'Mongolia', + 'MOP' => 'Macau', + 'MRO' => 'Mauritania', + 'MTL' => 'Malta', + 'MUR' => 'Mauritius', + 'MVR' => 'Maldives (Maldive Islands)', + 'MWK' => 'Malawi', + 'MXN' => 'Mexico', + 'MYR' => 'Malaysia', + 'MZM' => 'Mozambique', + 'NAD' => 'Namibia', + 'NGN' => 'Nigeria', + 'NIO' => 'Nicaragua', + 'NLG' => 'Netherlands (Holland)', + 'NOK' => 'Norway', + 'NPR' => 'Nepal', + 'NZD' => 'New Zealand', + 'OMR' => 'Oman', + 'PAB' => 'Panama', + 'PEN' => 'Peru', + 'PGK' => 'Papua New Guinea', + 'PHP' => 'Philippines', + 'PKR' => 'Pakistan', + 'PLN' => 'Poland', + 'PTE' => 'Portugal', + 'PYG' => 'Paraguay', + 'QAR' => 'Qatar', + 'ROL' => 'Romania', + 'RUR' => 'Russia', + 'RWF' => 'Rwanda', + 'SAR' => 'Saudi Arabia', + 'SBD' => 'Solomon Islands', + 'SCR' => 'Seychelles', + 'SDD' => 'Sudan', + 'SEK' => 'Sweden', + 'SGD' => 'Singapore', + 'SHP' => 'Saint Helena', + 'SIT' => 'Slovenia', + 'SKK' => 'Slovakia', + 'SLL' => 'Sierra Leone', + 'SOS' => 'Somalia', + 'SPL' => 'Seborga', + 'SRG' => 'Suriname', + 'STD' => 'S�o Tome and Principe', + 'SVC' => 'El Salvador', + 'SYP' => 'Syria', + 'SZL' => 'Swaziland', + 'THB' => 'Thailand', + 'TJR' => 'Tajikistan', + 'TMM' => 'Turkmenistan', + 'TND' => 'Tunisia', + 'TOP' => 'Tonga', + 'TRL' => 'Turkey', + 'TTD' => 'Trinidad and Tobago', + 'TVD' => 'Tuvalu', + 'TWD' => 'Taiwan', + 'TZS' => 'Tanzania', + 'UAH' => 'Ukraine', + 'UGX' => 'Uganda', + 'USD' => 'United States of America', + 'UYU' => 'Uruguay', + 'UZS' => 'Uzbekistan', + 'VAL' => 'Vatican City', + 'VEB' => 'Venezuela', + 'VND' => 'Viet Nam', + 'VUV' => 'Vanuatu', + 'WST' => 'Samoa', + 'XAF' => 'Communaut� Financi�re Africaine', + 'XAG' => 'Silver', + 'XAU' => 'Gold', + 'XCD' => 'East Caribbean', + 'XDR' => 'International Monetary Fund', + 'XPD' => 'Palladium', + 'XPF' => 'Comptoirs Fran�ais du Pacifique', + 'XPT' => 'Platinum', + 'YER' => 'Yemen', + 'YUM' => 'Yugoslavia', + 'ZAR' => 'South Africa', + 'ZMK' => 'Zambia', + 'ZWD' => 'Zimbabwe' + ); + + return @$lookup[$currency_id]; + } + + + + public static function LanguageLookup($language_code, $case_sensitive=false) { + + if (!$case_sensitive) { + $language_code = strtolower($language_code); + } + + // http://www.id3.org/id3v2.4.0-structure.txt + // [4. ID3v2 frame overview] + // The three byte language field, present in several frames, is used to + // describe the language of the frame's content, according to ISO-639-2 + // [ISO-639-2]. The language should be represented in lower case. If the + // language is not known the string "XXX" should be used. + + + // ISO 639-2 - http://www.id3.org/iso639-2.html + + static $lookup = array ( + 'XXX' => 'unknown', + 'xxx' => 'unknown', + 'aar' => 'Afar', + 'abk' => 'Abkhazian', + 'ace' => 'Achinese', + 'ach' => 'Acoli', + 'ada' => 'Adangme', + 'afa' => 'Afro-Asiatic (Other)', + 'afh' => 'Afrihili', + 'afr' => 'Afrikaans', + 'aka' => 'Akan', + 'akk' => 'Akkadian', + 'alb' => 'Albanian', + 'ale' => 'Aleut', + 'alg' => 'Algonquian Languages', + 'amh' => 'Amharic', + 'ang' => 'English, Old (ca. 450-1100)', + 'apa' => 'Apache Languages', + 'ara' => 'Arabic', + 'arc' => 'Aramaic', + 'arm' => 'Armenian', + 'arn' => 'Araucanian', + 'arp' => 'Arapaho', + 'art' => 'Artificial (Other)', + 'arw' => 'Arawak', + 'asm' => 'Assamese', + 'ath' => 'Athapascan Languages', + 'ava' => 'Avaric', + 'ave' => 'Avestan', + 'awa' => 'Awadhi', + 'aym' => 'Aymara', + 'aze' => 'Azerbaijani', + 'bad' => 'Banda', + 'bai' => 'Bamileke Languages', + 'bak' => 'Bashkir', + 'bal' => 'Baluchi', + 'bam' => 'Bambara', + 'ban' => 'Balinese', + 'baq' => 'Basque', + 'bas' => 'Basa', + 'bat' => 'Baltic (Other)', + 'bej' => 'Beja', + 'bel' => 'Byelorussian', + 'bem' => 'Bemba', + 'ben' => 'Bengali', + 'ber' => 'Berber (Other)', + 'bho' => 'Bhojpuri', + 'bih' => 'Bihari', + 'bik' => 'Bikol', + 'bin' => 'Bini', + 'bis' => 'Bislama', + 'bla' => 'Siksika', + 'bnt' => 'Bantu (Other)', + 'bod' => 'Tibetan', + 'bra' => 'Braj', + 'bre' => 'Breton', + 'bua' => 'Buriat', + 'bug' => 'Buginese', + 'bul' => 'Bulgarian', + 'bur' => 'Burmese', + 'cad' => 'Caddo', + 'cai' => 'Central American Indian (Other)', + 'car' => 'Carib', + 'cat' => 'Catalan', + 'cau' => 'Caucasian (Other)', + 'ceb' => 'Cebuano', + 'cel' => 'Celtic (Other)', + 'ces' => 'Czech', + 'cha' => 'Chamorro', + 'chb' => 'Chibcha', + 'che' => 'Chechen', + 'chg' => 'Chagatai', + 'chi' => 'Chinese', + 'chm' => 'Mari', + 'chn' => 'Chinook jargon', + 'cho' => 'Choctaw', + 'chr' => 'Cherokee', + 'chu' => 'Church Slavic', + 'chv' => 'Chuvash', + 'chy' => 'Cheyenne', + 'cop' => 'Coptic', + 'cor' => 'Cornish', + 'cos' => 'Corsican', + 'cpe' => 'Creoles and Pidgins, English-based (Other)', + 'cpf' => 'Creoles and Pidgins, French-based (Other)', + 'cpp' => 'Creoles and Pidgins, Portuguese-based (Other)', + 'cre' => 'Cree', + 'crp' => 'Creoles and Pidgins (Other)', + 'cus' => 'Cushitic (Other)', + 'cym' => 'Welsh', + 'cze' => 'Czech', + 'dak' => 'Dakota', + 'dan' => 'Danish', + 'del' => 'Delaware', + 'deu' => 'German', + 'din' => 'Dinka', + 'div' => 'Divehi', + 'doi' => 'Dogri', + 'dra' => 'Dravidian (Other)', + 'dua' => 'Duala', + 'dum' => 'Dutch, Middle (ca. 1050-1350)', + 'dut' => 'Dutch', + 'dyu' => 'Dyula', + 'dzo' => 'Dzongkha', + 'efi' => 'Efik', + 'egy' => 'Egyptian (Ancient)', + 'eka' => 'Ekajuk', + 'ell' => 'Greek, Modern (1453-)', + 'elx' => 'Elamite', + 'eng' => 'English', + 'enm' => 'English, Middle (ca. 1100-1500)', + 'epo' => 'Esperanto', + 'esk' => 'Eskimo (Other)', + 'esl' => 'Spanish', + 'est' => 'Estonian', + 'eus' => 'Basque', + 'ewe' => 'Ewe', + 'ewo' => 'Ewondo', + 'fan' => 'Fang', + 'fao' => 'Faroese', + 'fas' => 'Persian', + 'fat' => 'Fanti', + 'fij' => 'Fijian', + 'fin' => 'Finnish', + 'fiu' => 'Finno-Ugrian (Other)', + 'fon' => 'Fon', + 'fra' => 'French', + 'fre' => 'French', + 'frm' => 'French, Middle (ca. 1400-1600)', + 'fro' => 'French, Old (842- ca. 1400)', + 'fry' => 'Frisian', + 'ful' => 'Fulah', + 'gaa' => 'Ga', + 'gae' => 'Gaelic (Scots)', + 'gai' => 'Irish', + 'gay' => 'Gayo', + 'gdh' => 'Gaelic (Scots)', + 'gem' => 'Germanic (Other)', + 'geo' => 'Georgian', + 'ger' => 'German', + 'gez' => 'Geez', + 'gil' => 'Gilbertese', + 'glg' => 'Gallegan', + 'gmh' => 'German, Middle High (ca. 1050-1500)', + 'goh' => 'German, Old High (ca. 750-1050)', + 'gon' => 'Gondi', + 'got' => 'Gothic', + 'grb' => 'Grebo', + 'grc' => 'Greek, Ancient (to 1453)', + 'gre' => 'Greek, Modern (1453-)', + 'grn' => 'Guarani', + 'guj' => 'Gujarati', + 'hai' => 'Haida', + 'hau' => 'Hausa', + 'haw' => 'Hawaiian', + 'heb' => 'Hebrew', + 'her' => 'Herero', + 'hil' => 'Hiligaynon', + 'him' => 'Himachali', + 'hin' => 'Hindi', + 'hmo' => 'Hiri Motu', + 'hun' => 'Hungarian', + 'hup' => 'Hupa', + 'hye' => 'Armenian', + 'iba' => 'Iban', + 'ibo' => 'Igbo', + 'ice' => 'Icelandic', + 'ijo' => 'Ijo', + 'iku' => 'Inuktitut', + 'ilo' => 'Iloko', + 'ina' => 'Interlingua (International Auxiliary language Association)', + 'inc' => 'Indic (Other)', + 'ind' => 'Indonesian', + 'ine' => 'Indo-European (Other)', + 'ine' => 'Interlingue', + 'ipk' => 'Inupiak', + 'ira' => 'Iranian (Other)', + 'iri' => 'Irish', + 'iro' => 'Iroquoian uages', + 'isl' => 'Icelandic', + 'ita' => 'Italian', + 'jav' => 'Javanese', + 'jaw' => 'Javanese', + 'jpn' => 'Japanese', + 'jpr' => 'Judeo-Persian', + 'jrb' => 'Judeo-Arabic', + 'kaa' => 'Kara-Kalpak', + 'kab' => 'Kabyle', + 'kac' => 'Kachin', + 'kal' => 'Greenlandic', + 'kam' => 'Kamba', + 'kan' => 'Kannada', + 'kar' => 'Karen', + 'kas' => 'Kashmiri', + 'kat' => 'Georgian', + 'kau' => 'Kanuri', + 'kaw' => 'Kawi', + 'kaz' => 'Kazakh', + 'kha' => 'Khasi', + 'khi' => 'Khoisan (Other)', + 'khm' => 'Khmer', + 'kho' => 'Khotanese', + 'kik' => 'Kikuyu', + 'kin' => 'Kinyarwanda', + 'kir' => 'Kirghiz', + 'kok' => 'Konkani', + 'kom' => 'Komi', + 'kon' => 'Kongo', + 'kor' => 'Korean', + 'kpe' => 'Kpelle', + 'kro' => 'Kru', + 'kru' => 'Kurukh', + 'kua' => 'Kuanyama', + 'kum' => 'Kumyk', + 'kur' => 'Kurdish', + 'kus' => 'Kusaie', + 'kut' => 'Kutenai', + 'lad' => 'Ladino', + 'lah' => 'Lahnda', + 'lam' => 'Lamba', + 'lao' => 'Lao', + 'lat' => 'Latin', + 'lav' => 'Latvian', + 'lez' => 'Lezghian', + 'lin' => 'Lingala', + 'lit' => 'Lithuanian', + 'lol' => 'Mongo', + 'loz' => 'Lozi', + 'ltz' => 'Letzeburgesch', + 'lub' => 'Luba-Katanga', + 'lug' => 'Ganda', + 'lui' => 'Luiseno', + 'lun' => 'Lunda', + 'luo' => 'Luo (Kenya and Tanzania)', + 'mac' => 'Macedonian', + 'mad' => 'Madurese', + 'mag' => 'Magahi', + 'mah' => 'Marshall', + 'mai' => 'Maithili', + 'mak' => 'Macedonian', + 'mak' => 'Makasar', + 'mal' => 'Malayalam', + 'man' => 'Mandingo', + 'mao' => 'Maori', + 'map' => 'Austronesian (Other)', + 'mar' => 'Marathi', + 'mas' => 'Masai', + 'max' => 'Manx', + 'may' => 'Malay', + 'men' => 'Mende', + 'mga' => 'Irish, Middle (900 - 1200)', + 'mic' => 'Micmac', + 'min' => 'Minangkabau', + 'mis' => 'Miscellaneous (Other)', + 'mkh' => 'Mon-Kmer (Other)', + 'mlg' => 'Malagasy', + 'mlt' => 'Maltese', + 'mni' => 'Manipuri', + 'mno' => 'Manobo Languages', + 'moh' => 'Mohawk', + 'mol' => 'Moldavian', + 'mon' => 'Mongolian', + 'mos' => 'Mossi', + 'mri' => 'Maori', + 'msa' => 'Malay', + 'mul' => 'Multiple Languages', + 'mun' => 'Munda Languages', + 'mus' => 'Creek', + 'mwr' => 'Marwari', + 'mya' => 'Burmese', + 'myn' => 'Mayan Languages', + 'nah' => 'Aztec', + 'nai' => 'North American Indian (Other)', + 'nau' => 'Nauru', + 'nav' => 'Navajo', + 'nbl' => 'Ndebele, South', + 'nde' => 'Ndebele, North', + 'ndo' => 'Ndongo', + 'nep' => 'Nepali', + 'new' => 'Newari', + 'nic' => 'Niger-Kordofanian (Other)', + 'niu' => 'Niuean', + 'nla' => 'Dutch', + 'nno' => 'Norwegian (Nynorsk)', + 'non' => 'Norse, Old', + 'nor' => 'Norwegian', + 'nso' => 'Sotho, Northern', + 'nub' => 'Nubian Languages', + 'nya' => 'Nyanja', + 'nym' => 'Nyamwezi', + 'nyn' => 'Nyankole', + 'nyo' => 'Nyoro', + 'nzi' => 'Nzima', + 'oci' => 'Langue d\'Oc (post 1500)', + 'oji' => 'Ojibwa', + 'ori' => 'Oriya', + 'orm' => 'Oromo', + 'osa' => 'Osage', + 'oss' => 'Ossetic', + 'ota' => 'Turkish, Ottoman (1500 - 1928)', + 'oto' => 'Otomian Languages', + 'paa' => 'Papuan-Australian (Other)', + 'pag' => 'Pangasinan', + 'pal' => 'Pahlavi', + 'pam' => 'Pampanga', + 'pan' => 'Panjabi', + 'pap' => 'Papiamento', + 'pau' => 'Palauan', + 'peo' => 'Persian, Old (ca 600 - 400 B.C.)', + 'per' => 'Persian', + 'phn' => 'Phoenician', + 'pli' => 'Pali', + 'pol' => 'Polish', + 'pon' => 'Ponape', + 'por' => 'Portuguese', + 'pra' => 'Prakrit uages', + 'pro' => 'Provencal, Old (to 1500)', + 'pus' => 'Pushto', + 'que' => 'Quechua', + 'raj' => 'Rajasthani', + 'rar' => 'Rarotongan', + 'roa' => 'Romance (Other)', + 'roh' => 'Rhaeto-Romance', + 'rom' => 'Romany', + 'ron' => 'Romanian', + 'rum' => 'Romanian', + 'run' => 'Rundi', + 'rus' => 'Russian', + 'sad' => 'Sandawe', + 'sag' => 'Sango', + 'sah' => 'Yakut', + 'sai' => 'South American Indian (Other)', + 'sal' => 'Salishan Languages', + 'sam' => 'Samaritan Aramaic', + 'san' => 'Sanskrit', + 'sco' => 'Scots', + 'scr' => 'Serbo-Croatian', + 'sel' => 'Selkup', + 'sem' => 'Semitic (Other)', + 'sga' => 'Irish, Old (to 900)', + 'shn' => 'Shan', + 'sid' => 'Sidamo', + 'sin' => 'Singhalese', + 'sio' => 'Siouan Languages', + 'sit' => 'Sino-Tibetan (Other)', + 'sla' => 'Slavic (Other)', + 'slk' => 'Slovak', + 'slo' => 'Slovak', + 'slv' => 'Slovenian', + 'smi' => 'Sami Languages', + 'smo' => 'Samoan', + 'sna' => 'Shona', + 'snd' => 'Sindhi', + 'sog' => 'Sogdian', + 'som' => 'Somali', + 'son' => 'Songhai', + 'sot' => 'Sotho, Southern', + 'spa' => 'Spanish', + 'sqi' => 'Albanian', + 'srd' => 'Sardinian', + 'srr' => 'Serer', + 'ssa' => 'Nilo-Saharan (Other)', + 'ssw' => 'Siswant', + 'ssw' => 'Swazi', + 'suk' => 'Sukuma', + 'sun' => 'Sudanese', + 'sus' => 'Susu', + 'sux' => 'Sumerian', + 'sve' => 'Swedish', + 'swa' => 'Swahili', + 'swe' => 'Swedish', + 'syr' => 'Syriac', + 'tah' => 'Tahitian', + 'tam' => 'Tamil', + 'tat' => 'Tatar', + 'tel' => 'Telugu', + 'tem' => 'Timne', + 'ter' => 'Tereno', + 'tgk' => 'Tajik', + 'tgl' => 'Tagalog', + 'tha' => 'Thai', + 'tib' => 'Tibetan', + 'tig' => 'Tigre', + 'tir' => 'Tigrinya', + 'tiv' => 'Tivi', + 'tli' => 'Tlingit', + 'tmh' => 'Tamashek', + 'tog' => 'Tonga (Nyasa)', + 'ton' => 'Tonga (Tonga Islands)', + 'tru' => 'Truk', + 'tsi' => 'Tsimshian', + 'tsn' => 'Tswana', + 'tso' => 'Tsonga', + 'tuk' => 'Turkmen', + 'tum' => 'Tumbuka', + 'tur' => 'Turkish', + 'tut' => 'Altaic (Other)', + 'twi' => 'Twi', + 'tyv' => 'Tuvinian', + 'uga' => 'Ugaritic', + 'uig' => 'Uighur', + 'ukr' => 'Ukrainian', + 'umb' => 'Umbundu', + 'und' => 'Undetermined', + 'urd' => 'Urdu', + 'uzb' => 'Uzbek', + 'vai' => 'Vai', + 'ven' => 'Venda', + 'vie' => 'Vietnamese', + 'vol' => 'Volap�k', + 'vot' => 'Votic', + 'wak' => 'Wakashan Languages', + 'wal' => 'Walamo', + 'war' => 'Waray', + 'was' => 'Washo', + 'wel' => 'Welsh', + 'wen' => 'Sorbian Languages', + 'wol' => 'Wolof', + 'xho' => 'Xhosa', + 'yao' => 'Yao', + 'yap' => 'Yap', + 'yid' => 'Yiddish', + 'yor' => 'Yoruba', + 'zap' => 'Zapotec', + 'zen' => 'Zenaga', + 'zha' => 'Zhuang', + 'zho' => 'Chinese', + 'zul' => 'Zulu', + 'zun' => 'Zuni' + ); + + return @$lookup[$language_code]; + } + + + + public static function ETCOEventLookup($index) { + + if (($index >= 0x17) && ($index <= 0xDF)) { + return 'reserved for future use'; + } + if (($index >= 0xE0) && ($index <= 0xEF)) { + return 'not predefined synch 0-F'; + } + if (($index >= 0xF0) && ($index <= 0xFC)) { + return 'reserved for future use'; + } + + static $lookup = array ( + 0x00 => 'padding (has no meaning)', + 0x01 => 'end of initial silence', + 0x02 => 'intro start', + 0x03 => 'main part start', + 0x04 => 'outro start', + 0x05 => 'outro end', + 0x06 => 'verse start', + 0x07 => 'refrain start', + 0x08 => 'interlude start', + 0x09 => 'theme start', + 0x0A => 'variation start', + 0x0B => 'key change', + 0x0C => 'time change', + 0x0D => 'momentary unwanted noise (Snap, Crackle & Pop)', + 0x0E => 'sustained noise', + 0x0F => 'sustained noise end', + 0x10 => 'intro end', + 0x11 => 'main part end', + 0x12 => 'verse end', + 0x13 => 'refrain end', + 0x14 => 'theme end', + 0x15 => 'profanity', + 0x16 => 'profanity end', + 0xFD => 'audio end (start of silence)', + 0xFE => 'audio file ends', + 0xFF => 'one more byte of events follows' + ); + + return @$lookup[$index]; + } + + + + public static function SYTLContentTypeLookup($index) { + + static $lookup = array ( + 0x00 => 'other', + 0x01 => 'lyrics', + 0x02 => 'text transcription', + 0x03 => 'movement/part name', // (e.g. 'Adagio') + 0x04 => 'events', // (e.g. 'Don Quijote enters the stage') + 0x05 => 'chord', // (e.g. 'Bb F Fsus') + 0x06 => 'trivia/\'pop up\' information', + 0x07 => 'URLs to webpages', + 0x08 => 'URLs to images' + ); + + return @$lookup[$index]; + } + + + + public static function APICPictureTypeLookup($index, $return_array=false) { + + static $lookup = array ( + 0x00 => 'Other', + 0x01 => '32x32 pixels \'file icon\' (PNG only)', + 0x02 => 'Other file icon', + 0x03 => 'Cover (front)', + 0x04 => 'Cover (back)', + 0x05 => 'Leaflet page', + 0x06 => 'Media (e.g. label side of CD)', + 0x07 => 'Lead artist/lead performer/soloist', + 0x08 => 'Artist/performer', + 0x09 => 'Conductor', + 0x0A => 'Band/Orchestra', + 0x0B => 'Composer', + 0x0C => 'Lyricist/text writer', + 0x0D => 'Recording Location', + 0x0E => 'During recording', + 0x0F => 'During performance', + 0x10 => 'Movie/video screen capture', + 0x11 => 'A bright coloured fish', + 0x12 => 'Illustration', + 0x13 => 'Band/artist logotype', + 0x14 => 'Publisher/Studio logotype' + ); + + if ($return_array) { + return $lookup; + } + return @$lookup[$index]; + } + + + + public static function COMRReceivedAsLookup($index) { + + static $lookup = array ( + 0x00 => 'Other', + 0x01 => 'Standard CD album with other songs', + 0x02 => 'Compressed audio on CD', + 0x03 => 'File over the Internet', + 0x04 => 'Stream over the Internet', + 0x05 => 'As note sheets', + 0x06 => 'As note sheets in a book with other sheets', + 0x07 => 'Music on other media', + 0x08 => 'Non-musical merchandise' + ); + + return (isset($lookup[$index]) ? $lookup[$index] : ''); + } + + + + public static function RVA2ChannelTypeLookup($index) { + + static $lookup = array ( + 0x00 => 'Other', + 0x01 => 'Master volume', + 0x02 => 'Front right', + 0x03 => 'Front left', + 0x04 => 'Back right', + 0x05 => 'Back left', + 0x06 => 'Front centre', + 0x07 => 'Back centre', + 0x08 => 'Subwoofer' + ); + + return @$lookup[$index]; + } + + + + public static function FrameNameLongLookup($frame_name) { + + static $lookup = array ( + 'AENC' => 'Audio encryption', + 'APIC' => 'Attached picture', + 'ASPI' => 'Audio seek point index', + 'BUF' => 'Recommended buffer size', + 'CNT' => 'Play counter', + 'COM' => 'Comments', + 'COMM' => 'Comments', + 'COMR' => 'Commercial frame', + 'CRA' => 'Audio encryption', + 'CRM' => 'Encrypted meta frame', + 'ENCR' => 'Encryption method registration', + 'EQU' => 'Equalisation', + 'EQU2' => 'Equalisation (2)', + 'EQUA' => 'Equalisation', + 'ETC' => 'Event timing codes', + 'ETCO' => 'Event timing codes', + 'GEO' => 'General encapsulated object', + 'GEOB' => 'General encapsulated object', + 'GRID' => 'Group identification registration', + 'IPL' => 'Involved people list', + 'IPLS' => 'Involved people list', + 'LINK' => 'Linked information', + 'LNK' => 'Linked information', + 'MCDI' => 'Music CD identifier', + 'MCI' => 'Music CD Identifier', + 'MLL' => 'MPEG location lookup table', + 'MLLT' => 'MPEG location lookup table', + 'OWNE' => 'Ownership frame', + 'PCNT' => 'Play counter', + 'PIC' => 'Attached picture', + 'POP' => 'Popularimeter', + 'POPM' => 'Popularimeter', + 'POSS' => 'Position synchronisation frame', + 'PRIV' => 'Private frame', + 'RBUF' => 'Recommended buffer size', + 'REV' => 'Reverb', + 'RVA' => 'Relative volume adjustment', + 'RVA2' => 'Relative volume adjustment (2)', + 'RVAD' => 'Relative volume adjustment', + 'RVRB' => 'Reverb', + 'SEEK' => 'Seek frame', + 'SIGN' => 'Signature frame', + 'SLT' => 'Synchronised lyric/text', + 'STC' => 'Synced tempo codes', + 'SYLT' => 'Synchronised lyric/text', + 'SYTC' => 'Synchronised tempo codes', + 'TAL' => 'Album/Movie/Show title', + 'TALB' => 'Album/Movie/Show title', + 'TBP' => 'BPM (Beats Per Minute)', + 'TBPM' => 'BPM (beats per minute)', + 'TCM' => 'Composer', + 'TCO' => 'Content type', + 'TCOM' => 'Composer', + 'TCON' => 'Content type', + 'TCOP' => 'Copyright message', + 'TCR' => 'Copyright message', + 'TDA' => 'Date', + 'TDAT' => 'Date', + 'TDEN' => 'Encoding time', + 'TDLY' => 'Playlist delay', + 'TDOR' => 'Original release time', + 'TDRC' => 'Recording time', + 'TDRL' => 'Release time', + 'TDTG' => 'Tagging time', + 'TDY' => 'Playlist delay', + 'TEN' => 'Encoded by', + 'TENC' => 'Encoded by', + 'TEXT' => 'Lyricist/Text writer', + 'TFLT' => 'File type', + 'TFT' => 'File type', + 'TIM' => 'Time', + 'TIME' => 'Time', + 'TIPL' => 'Involved people list', + 'TIT1' => 'Content group description', + 'TIT2' => 'Title/songname/content description', + 'TIT3' => 'Subtitle/Description refinement', + 'TKE' => 'Initial key', + 'TKEY' => 'Initial key', + 'TLA' => 'Language(s)', + 'TLAN' => 'Language(s)', + 'TLE' => 'Length', + 'TLEN' => 'Length', + 'TMCL' => 'Musician credits list', + 'TMED' => 'Media type', + 'TMOO' => 'Mood', + 'TMT' => 'Media type', + 'TOA' => 'Original artist(s)/performer(s)', + 'TOAL' => 'Original album/movie/show title', + 'TOF' => 'Original filename', + 'TOFN' => 'Original filename', + 'TOL' => 'Original Lyricist(s)/text writer(s)', + 'TOLY' => 'Original lyricist(s)/text writer(s)', + 'TOPE' => 'Original artist(s)/performer(s)', + 'TOR' => 'Original release year', + 'TORY' => 'Original release year', + 'TOT' => 'Original album/Movie/Show title', + 'TOWN' => 'File owner/licensee', + 'TP1' => 'Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group', + 'TP2' => 'Band/Orchestra/Accompaniment', + 'TP3' => 'Conductor/Performer refinement', + 'TP4' => 'Interpreted, remixed, or otherwise modified by', + 'TPA' => 'Part of a set', + 'TPB' => 'Publisher', + 'TPE1' => 'Lead performer(s)/Soloist(s)', + 'TPE2' => 'Band/orchestra/accompaniment', + 'TPE3' => 'Conductor/performer refinement', + 'TPE4' => 'Interpreted, remixed, or otherwise modified by', + 'TPOS' => 'Part of a set', + 'TPRO' => 'Produced notice', + 'TPUB' => 'Publisher', + 'TRC' => 'ISRC (International Standard Recording Code)', + 'TRCK' => 'Track number/Position in set', + 'TRD' => 'Recording dates', + 'TRDA' => 'Recording dates', + 'TRK' => 'Track number/Position in set', + 'TRSN' => 'Internet radio station name', + 'TRSO' => 'Internet radio station owner', + 'TSI' => 'Size', + 'TSIZ' => 'Size', + 'TSOA' => 'Album sort order', + 'TSOP' => 'Performer sort order', + 'TSOT' => 'Title sort order', + 'TSRC' => 'ISRC (international standard recording code)', + 'TSS' => 'Software/hardware and settings used for encoding', + 'TSSE' => 'Software/Hardware and settings used for encoding', + 'TSST' => 'Set subtitle', + 'TT1' => 'Content group description', + 'TT2' => 'Title/Songname/Content description', + 'TT3' => 'Subtitle/Description refinement', + 'TXT' => 'Lyricist/text writer', + 'TXX' => 'User defined text information frame', + 'TXXX' => 'User defined text information frame', + 'TYE' => 'Year', + 'TYER' => 'Year', + 'UFI' => 'Unique file identifier', + 'UFID' => 'Unique file identifier', + 'ULT' => 'Unsychronised lyric/text transcription', + 'USER' => 'Terms of use', + 'USLT' => 'Unsynchronised lyric/text transcription', + 'WAF' => 'Official audio file webpage', + 'WAR' => 'Official artist/performer webpage', + 'WAS' => 'Official audio source webpage', + 'WCM' => 'Commercial information', + 'WCOM' => 'Commercial information', + 'WCOP' => 'Copyright/Legal information', + 'WCP' => 'Copyright/Legal information', + 'WOAF' => 'Official audio file webpage', + 'WOAR' => 'Official artist/performer webpage', + 'WOAS' => 'Official audio source webpage', + 'WORS' => 'Official Internet radio station homepage', + 'WPAY' => 'Payment', + 'WPB' => 'Publishers official webpage', + 'WPUB' => 'Publishers official webpage', + 'WXX' => 'User defined URL link frame', + 'WXXX' => 'User defined URL link frame', + 'TFEA' => 'Featured Artist', + 'TSTU' => 'Recording Studio', + 'rgad' => 'Replay Gain Adjustment' + ); + + return @$lookup[$frame_name]; + + // Last three: + // from Helium2 [www.helium2.com] + // from http://privatewww.essex.ac.uk/~djmrob/replaygain/file_format_id3v2.html + } + + + public static function FrameNameShortLookup($frame_name) { + + static $lookup = array ( + 'COM' => 'comment', + 'COMM' => 'comment', + 'TAL' => 'album', + 'TALB' => 'album', + 'TBP' => 'bpm', + 'TBPM' => 'bpm', + 'TCM' => 'composer', + 'TCO' => 'genre', + 'TCOM' => 'composer', + 'TCON' => 'genre', + 'TCOP' => 'copyright', + 'TCR' => 'copyright', + 'TEN' => 'encoded_by', + 'TENC' => 'encoded_by', + 'TEXT' => 'lyricist', + 'TIT1' => 'description', + 'TIT2' => 'title', + 'TIT3' => 'subtitle', + 'TLA' => 'language', + 'TLAN' => 'language', + 'TLE' => 'length', + 'TLEN' => 'length', + 'TMOO' => 'mood', + 'TOA' => 'original_artist', + 'TOAL' => 'original_album', + 'TOF' => 'original_filename', + 'TOFN' => 'original_filename', + 'TOL' => 'original_lyricist', + 'TOLY' => 'original_lyricist', + 'TOPE' => 'original_artist', + 'TOT' => 'original_album', + 'TP1' => 'artist', + 'TP2' => 'band', + 'TP3' => 'conductor', + 'TP4' => 'remixer', + 'TPB' => 'publisher', + 'TPE1' => 'artist', + 'TPE2' => 'band', + 'TPE3' => 'conductor', + 'TPE4' => 'remixer', + 'TPUB' => 'publisher', + 'TRC' => 'isrc', + 'TRCK' => 'track', + 'TRK' => 'track', + 'TSI' => 'size', + 'TSIZ' => 'size', + 'TSRC' => 'isrc', + 'TSS' => 'encoder_settings', + 'TSSE' => 'encoder_settings', + 'TSST' => 'subtitle', + 'TT1' => 'description', + 'TT2' => 'title', + 'TT3' => 'subtitle', + 'TXT' => 'lyricist', + 'TXX' => 'text', + 'TXXX' => 'text', + 'TYE' => 'year', + 'TYER' => 'year', + 'UFI' => 'unique_file_identifier', + 'UFID' => 'unique_file_identifier', + 'ULT' => 'unsychronised_lyric', + 'USER' => 'terms_of_use', + 'USLT' => 'unsynchronised lyric', + 'WAF' => 'url_file', + 'WAR' => 'url_artist', + 'WAS' => 'url_source', + 'WCOP' => 'copyright', + 'WCP' => 'copyright', + 'WOAF' => 'url_file', + 'WOAR' => 'url_artist', + 'WOAS' => 'url_source', + 'WORS' => 'url_station', + 'WPB' => 'url_publisher', + 'WPUB' => 'url_publisher', + 'WXX' => 'url_user', + 'WXXX' => 'url_user', + 'TFEA' => 'featured_artist', + 'TSTU' => 'studio' + ); + + return @$lookup[$frame_name]; + } + + + + public static function TextEncodingTerminatorLookup($encoding) { + + // http://www.id3.org/id3v2.4.0-structure.txt + // Frames that allow different types of text encoding contains a text encoding description byte. Possible encodings: + // $00 ISO-8859-1. Terminated with $00. + // $01 UTF-16 encoded Unicode with BOM. All strings in the same frame SHALL have the same byteorder. Terminated with $00 00. + // $02 UTF-16BE encoded Unicode without BOM. Terminated with $00 00. + // $03 UTF-8 encoded Unicode. Terminated with $00. + + static $lookup = array ( + 0 => "\x00", + 1 => "\x00\x00", + 2 => "\x00\x00", + 3 => "\x00", + 255 => "\x00\x00" + ); + + return @$lookup[$encoding]; + } + + + + public static function IsValidID3v2FrameName($frame_name, $id3v2_major_version) { + + switch ($id3v2_major_version) { + case 2: + return preg_match('/[A-Z][A-Z0-9]{2}/', $frame_name); + + case 3: + case 4: + return preg_match('/[A-Z][A-Z0-9]{3}/', $frame_name); + } + return false; + } + + + + public static function IsValidDateStampString($date_stamp) { + + if (strlen($date_stamp) != 8) { + return false; + } + if ((int)$date_stamp) { + return false; + } + + $year = substr($date_stamp, 0, 4); + $month = substr($date_stamp, 4, 2); + $day = substr($date_stamp, 6, 2); + if (!$year || !$month || !$day || $month > 12 || $day > 31 ) { + return false; + } + if (($day > 30) && (($month == 4) || ($month == 6) || ($month == 9) || ($month == 11))) { + return false; + } + if (($day > 29) && ($month == 2)) { + return false; + } + return true; + } + + + + public static function array_merge_noclobber($array1, $array2) { + if (!is_array($array1) || !is_array($array2)) { + return false; + } + $newarray = $array1; + foreach ($array2 as $key => $val) { + if (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) { + $newarray[$key] = getid3_id3v2::array_merge_noclobber($newarray[$key], $val); + } elseif (!isset($newarray[$key])) { + $newarray[$key] = $val; + } + } + return $newarray; + } + + +} + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.tag.lyrics3.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.tag.lyrics3.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Backend/Assets/getid3/module.tag.lyrics3.php 3 Jan 2016 20:51:48 -0000 1.1.2.1 @@ -0,0 +1,270 @@ + | +// | Allan Hansen | +// +----------------------------------------------------------------------+ +// | module.tag.lyrics3.php | +// | module for analyzing Lyrics3 tags | +// | dependencies: module.tag.apetag.php (optional) | +// +----------------------------------------------------------------------+ +// +// $Id: module.tag.lyrics3.php,v 1.1.2.1 2016/01/03 20:51:48 gustafn Exp $ + + +class getid3_lyrics3 extends getid3_handler +{ + + public function Analyze() { + + $getid3 = $this->getid3; + + fseek($getid3->fp, (0 - 128 - 9 - 6), SEEK_END); // end - ID3v1 - LYRICSEND - [Lyrics3size] + $lyrics3_id3v1 = fread($getid3->fp, 128 + 9 + 6); + $lyrics3_lsz = substr($lyrics3_id3v1, 0, 6); // Lyrics3size + $lyrics3_end = substr($lyrics3_id3v1, 6, 9); // LYRICSEND or LYRICS200 + $id3v1_tag = substr($lyrics3_id3v1, 15, 128); // ID3v1 + + // Lyrics3v1, ID3v1, no APE + if ($lyrics3_end == 'LYRICSEND') { + + $lyrics3_size = 5100; + $lyrics3_offset = filesize($getid3->filename) - 128 - $lyrics3_size; + $lyrics3_version = 1; + } + + // Lyrics3v2, ID3v1, no APE + elseif ($lyrics3_end == 'LYRICS200') { + + // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200' + $lyrics3_size = $lyrics3_lsz + 6 + strlen('LYRICS200'); + $lyrics3_offset = filesize($getid3->filename) - 128 - $lyrics3_size; + $lyrics3_version = 2; + } + + // Lyrics3v1, no ID3v1, no APE + elseif (substr(strrev($lyrics3_id3v1), 0, 9) == 'DNESCIRYL') { // strrev('LYRICSEND') = 'DNESCIRYL' + + $lyrics3_size = 5100; + $lyrics3_offset = filesize($getid3->filename) - $lyrics3_size; + $lyrics3_version = 1; + $lyrics3_offset = filesize($getid3->filename) - $lyrics3_size; + } + + // Lyrics3v2, no ID3v1, no APE + elseif (substr(strrev($lyrics3_id3v1), 0, 9) == '002SCIRYL') { // strrev('LYRICS200') = '002SCIRYL' + + $lyrics3_size = strrev(substr(strrev($lyrics3_id3v1), 9, 6)) + 15; // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200' // 15 = 6 + strlen('LYRICS200') + $lyrics3_offset = filesize($getid3->filename) - $lyrics3_size; + $lyrics3_version = 2; + } + + elseif (isset($getid3->info['ape']['tag_offset_start']) && ($getid3->info['ape']['tag_offset_start'] > 15)) { + + fseek($getid3->fp, $getid3->info['ape']['tag_offset_start'] - 15, SEEK_SET); + $lyrics3_lsz = fread($getid3->fp, 6); + $lyrics3_end = fread($getid3->fp, 9); + + + // Lyrics3v1, APE, maybe ID3v1 + if ($lyrics3_end == 'LYRICSEND') { + + $lyrics3_size = 5100; + $lyrics3_offset = $getid3->info['ape']['tag_offset_start'] - $lyrics3_size; + $getid3->info['avdataend'] = $lyrics3_offset; + $lyrics3_version = 1; + $getid3->warning('APE tag located after Lyrics3, will probably break Lyrics3 compatability'); + } + + + // Lyrics3v2, APE, maybe ID3v1 + elseif ($lyrics3_end == 'LYRICS200') { + + $lyrics3_size = $lyrics3_lsz + 15; // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200' + $lyrics3_offset = $getid3->info['ape']['tag_offset_start'] - $lyrics3_size; + $lyrics3_version = 2; + $getid3->warning('APE tag located after Lyrics3, will probably break Lyrics3 compatability'); + + } + } + + + //// GetLyrics3Data() + + + if (isset($lyrics3_offset)) { + + $getid3->info['avdataend'] = $lyrics3_offset; + + if ($lyrics3_size <= 0) { + return false; + } + + fseek($getid3->fp, $lyrics3_offset, SEEK_SET); + $raw_data = fread($getid3->fp, $lyrics3_size); + + if (substr($raw_data, 0, 11) != 'LYRICSBEGIN') { + if (strpos($raw_data, 'LYRICSBEGIN') !== false) { + + $getid3->warning('"LYRICSBEGIN" expected at '.$lyrics3_offset.' but actually found at '.($lyrics3_offset + strpos($raw_data, 'LYRICSBEGIN')).' - this is invalid for Lyrics3 v'.$lyrics3_version); + $getid3->info['avdataend'] = $lyrics3_offset + strpos($raw_data, 'LYRICSBEGIN'); + $parsed_lyrics3['tag_offset_start'] = $getid3->info['avdataend']; + $raw_data = substr($raw_data, strpos($raw_data, 'LYRICSBEGIN')); + $lyrics3_size = strlen($raw_data); + } + else { + throw new getid3_exception('"LYRICSBEGIN" expected at '.$lyrics3_offset.' but found "'.substr($raw_data, 0, 11).'" instead.'); + } + + } + + $parsed_lyrics3['raw']['lyrics3version'] = $lyrics3_version; + $parsed_lyrics3['raw']['lyrics3tagsize'] = $lyrics3_size; + $parsed_lyrics3['tag_offset_start'] = $lyrics3_offset; + $parsed_lyrics3['tag_offset_end'] = $lyrics3_offset + $lyrics3_size; + + switch ($lyrics3_version) { + + case 1: + if (substr($raw_data, strlen($raw_data) - 9, 9) == 'LYRICSEND') { + $parsed_lyrics3['raw']['LYR'] = trim(substr($raw_data, 11, strlen($raw_data) - 11 - 9)); + getid3_lyrics3::Lyrics3LyricsTimestampParse($parsed_lyrics3); + } + else { + throw new getid3_exception('"LYRICSEND" expected at '.(ftell($getid3->fp) - 11 + $lyrics3_size - 9).' but found "'.substr($raw_data, strlen($raw_data) - 9, 9).'" instead.'); + } + break; + + case 2: + if (substr($raw_data, strlen($raw_data) - 9, 9) == 'LYRICS200') { + $parsed_lyrics3['raw']['unparsed'] = substr($raw_data, 11, strlen($raw_data) - 11 - 9 - 6); // LYRICSBEGIN + LYRICS200 + LSZ + $raw_data = $parsed_lyrics3['raw']['unparsed']; + while (strlen($raw_data) > 0) { + $fieldname = substr($raw_data, 0, 3); + $fieldsize = (int)substr($raw_data, 3, 5); + $parsed_lyrics3['raw'][$fieldname] = substr($raw_data, 8, $fieldsize); + $raw_data = substr($raw_data, 3 + 5 + $fieldsize); + } + + if (isset($parsed_lyrics3['raw']['IND'])) { + $i = 0; + foreach (array ('lyrics', 'timestamps', 'inhibitrandom') as $flagname) { + if (strlen($parsed_lyrics3['raw']['IND']) > ++$i) { + $parsed_lyrics3['flags'][$flagname] = getid3_lyrics3::IntString2Bool(substr($parsed_lyrics3['raw']['IND'], $i, 1)); + } + } + } + + foreach (array ('ETT'=>'title', 'EAR'=>'artist', 'EAL'=>'album', 'INF'=>'comment', 'AUT'=>'author') as $key => $value) { + if (isset($parsed_lyrics3['raw'][$key])) { + $parsed_lyrics3['comments'][$value][] = trim($parsed_lyrics3['raw'][$key]); + } + } + + if (isset($parsed_lyrics3['raw']['IMG'])) { + foreach (explode("\r\n", $parsed_lyrics3['raw']['IMG']) as $key => $image_string) { + if (strpos($image_string, '||') !== false) { + $imagearray = explode('||', $image_string); + $parsed_lyrics3['images'][$key]['filename'] = @$imagearray[0]; + $parsed_lyrics3['images'][$key]['description'] = @$imagearray[1]; + $parsed_lyrics3['images'][$key]['timestamp'] = getid3_lyrics3::Lyrics3Timestamp2Seconds(@$imagearray[2]); + } + } + } + + if (isset($parsed_lyrics3['raw']['LYR'])) { + getid3_lyrics3::Lyrics3LyricsTimestampParse($parsed_lyrics3); + } + } + else { + throw new getid3_exception('"LYRICS200" expected at '.(ftell($getid3->fp) - 11 + $lyrics3_size - 9).' but found "'.substr($raw_data, strlen($raw_data) - 9, 9).'" instead.'); + } + break; + + default: + throw new getid3_exception('Cannot process Lyrics3 version '.$lyrics3_version.' (only v1 and v2)'); + } + + if (isset($getid3->info['id3v1']['tag_offset_start']) && ($getid3->info['id3v1']['tag_offset_start'] < $parsed_lyrics3['tag_offset_end'])) { + $getid3->warning('ID3v1 tag information ignored since it appears to be a false synch in Lyrics3 tag data'); + unset($getid3->info['id3v1']); + } + + $getid3->info['lyrics3'] = $parsed_lyrics3; + + + // Check for APE tag after lyrics3 + if (!@$getid3->info['ape'] && $getid3->option_tag_apetag && class_exists('getid3_apetag')) { + $apetag = new getid3_apetag($getid3); + $apetag->option_override_end_offset = $getid3->info['lyrics3']['tag_offset_start']; + $apetag->Analyze(); + } + } + + return true; + } + + + + + public static function Lyrics3Timestamp2Seconds($rawtimestamp) { + if (ereg('^\\[([0-9]{2}):([0-9]{2})\\]$', $rawtimestamp, $regs)) { + return (int)(($regs[1] * 60) + $regs[2]); + } + return false; + } + + + + public static function Lyrics3LyricsTimestampParse(&$lyrics3_data) { + + $lyrics_array = explode("\r\n", $lyrics3_data['raw']['LYR']); + foreach ($lyrics_array as $key => $lyric_line) { + + while (ereg('^(\\[[0-9]{2}:[0-9]{2}\\])', $lyric_line, $regs)) { + $this_line_timestamps[] = getid3_lyrics3::Lyrics3Timestamp2Seconds($regs[0]); + $lyric_line = str_replace($regs[0], '', $lyric_line); + } + $no_timestamp_lyrics_array[$key] = $lyric_line; + if (@is_array($this_line_timestamps)) { + sort($this_line_timestamps); + foreach ($this_line_timestamps as $timestampkey => $timestamp) { + if (isset($lyrics3_data['synchedlyrics'][$timestamp])) { + // timestamps only have a 1-second resolution, it's possible that multiple lines + // could have the same timestamp, if so, append + $lyrics3_data['synchedlyrics'][$timestamp] .= "\r\n".$lyric_line; + } else { + $lyrics3_data['synchedlyrics'][$timestamp] = $lyric_line; + } + } + } + unset($this_line_timestamps); + $regs = array (); + } + $lyrics3_data['unsynchedlyrics'] = implode("\r\n", $no_timestamp_lyrics_array); + if (isset($lyrics3_data['synchedlyrics']) && is_array($lyrics3_data['synchedlyrics'])) { + ksort($lyrics3_data['synchedlyrics']); + } + return true; + } + + + + public static function IntString2Bool($char) { + + return $char == '1' ? true : ($char == '0' ? false : null); + } +} + + +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Css/Additions.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Css/Additions.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Css/Additions.css 3 Jan 2016 20:51:48 -0000 1.1.2.1 @@ -0,0 +1,96 @@ +/* Overlay */ +div.fm-overlay { + position: absolute; + left: 0; + top: 0; + display: none; + + z-index: 999; + background: #aaa; +} + +/* Dialog */ +div.fm-overlay-dialog { + z-index: 1999; + background: #fff; +} + +div.fm-dialog { + position: absolute; + display: none; + z-index: 2000; + + width: 229px; + padding-bottom: 40px; + + color: #bebebe; + font-family: Tahoma, sans-serif; + font-size: 12px; + background: rgba(0, 0, 0, 0.8); + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + box-shadow: rgba(0, 0, 0, 0.3) 0 0 10px; + -moz-box-shadow: rgba(0, 0, 0, 0.3) 0 0 10px; + -webkit-box-shadow: rgba(0, 0, 0, 0.3) 0 0 10px; +} + +div.fm-dialog-engine-trident { + background: #000; +} + +div.fm-dialog-engine-trident4 { width: 249px; } + +div.fm-dialog a { color: #aaa; } +div.fm-dialog a:hover { text-decoration: none; } +div.fm-dialog div { margin: 10px; } + +div.fm-dialog input, div.fm-dialog select { + width: 94%; + margin: 20px 2%; + padding: 2px 1%; + border: 1px solid #bebebe; + background: #fff; + + color: #333; + font-family: Tahoma, sans-serif; + font-size: 12px; +} + +div.fm-dialog-engine-trident4 input, div.fm-dialog-engine-trident5 input { + width: 80%; +} + +div.fm-dialog button { + position: absolute; + bottom: 15px; + right: 15px; + + width: auto; + height: 22px; + padding: 2px; + border: 1px solid #bebebe; + + cursor: pointer; + color: #333; + text-shadow: #eee 1px 1px 1px; + + font-family: Tahoma, sans-serif; + letter-spacing: 0; + font-size: 12px; + font-weight: normal; + margin: 0; + background: url(../Assets/button.png) repeat-x; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} +div.fm-dialog-engine-trident4 button, div.fm-dialog-engine-trident5 button { + padding: 0 .25em; + overflow: visible; +} + +div.fm-dialog button.fm-dialog-decline { + right: auto; + left: 15px; +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Css/FileManager.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Css/FileManager.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Css/FileManager.css 3 Jan 2016 20:51:48 -0000 1.1.2.1 @@ -0,0 +1,559 @@ +div.filemanager-container { display: none; } +div.filemanager * { outline: 0; } +div.filemanager a img { border: 0 } + +div.filemanager-container, div.filemanager, div.filemanager button, div.filemanager label, div.filemanager h1 { + width: auto; + margin: 0; + + font-family: Tahoma, sans-serif; + font-size: 12px; + font-weight: normal; + text-transform: none; + letter-spacing: 0; +} + +div.filemanager { + background: #eee; + + position: absolute; + z-index: 1001; + width: 800px; + height: 450px; + + box-shadow: rgba(0, 0, 0, 0.3) 0 0 40px; + -moz-box-shadow: rgba(0, 0, 0, 0.3) 0 0 40px; + -webkit-box-shadow: rgba(0, 0, 0, 0.3) 0 0 40px; +} + +div.filemanager div.filemanager-menu { + position: absolute; + height: 30px; + left: 30%; + width: 70%; + bottom: 0; + line-height: 30px; + + border-top: 1px solid #bebebe; + background: url(../Assets/menu.png) repeat-x; +} + +div.filemanager button { + cursor: pointer; + height: 22px; + line-height: 22px; + margin: 4px 5px; + padding: 0 2px; + + color: #333; + text-shadow: #eee 1px 1px 1px; + + clear: none; + background: url(../Assets/button.png) repeat-x; + border: 1px solid #a1aeb9; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} +div.filemanager-engine-trident4 button, div.filemanager-engine-trident5 button { + padding: 0 .25em; + overflow: visible; +} + +div.filemanager-menu button { + float: right; +} + +div.filemanager button:hover, div.filemanager button.hover, div.filemanager button:focus { + border: 1px solid #5f676e; +} + +div.filemanager button.disabled, div.filemanager button.disabled:hover, div.filemanager button.disabled:focus { + cursor: default; + color: #666; + text-shadow: none; + background: url(../Assets/button_disabled.png) repeat-x; + border-color: #bababa; +} + +div.filemanager button.filemanager-open { + font-weight: bold; +} + +div.filemanager-menu label { + cursor: pointer; + float: right; + width: auto; + height: auto; + line-height: 30px; + + font-size: 11px; +} + +div.filemanager-menu div.loader { + float: left; + width: 16px; + height: 16px; + margin: 8px 0; + background: url(../Assets/loader.gif) no-repeat; +} + +div.filemanager ul { + margin: 0; + padding: 0; + position: relative; + line-height: 1.8em; + overflow: auto; + overflow-x: hidden; + zoom: 1; +} + +div.filemanager ul li { + background: none; + list-style-image: none; + list-style-type: none; + list-style: none; + line-height: 1.8em; + margin: 0; + padding: 0; + height: 21px; + white-space: nowrap; +} + +div.filemanager ul.filemanager-browser { + left: 0px; + top: 0px; + height: 100%; + width: 30%; + + border: 0; + border-right: 1px solid #bebebe; + background: url(../Assets/filelist.png) repeat-x #c1c7cf; +} + +div.filemanager-container span.fi { + height: 21px; + line-height: 1.8em; + padding-left: 5px; + color: #000; + text-decoration: none; + display: block; + white-space: nowrap; + cursor: pointer; +} + +div.filemanager-container span.fi span { + white-space: nowrap; + display: block; + width: 65%; + overflow: hidden; +} + +div.filemanager-container span.drag span, div.filemanager-engine-trident4 ul li span.fi span, div.filemanager-engine-trident5 ul li span.fi span, div.filemanager-engine-presto ul li span.fi span, div.filemanager ul li:hover span.fi span { + overflow: hidden; +} + +div.filemanager ul li span.dir { + background-color: transparent; +} + +div.filemanager ul li span.droppable { + background-color: #99b7e7; +} + +ul.filemanager-browser a, ul.filemanager-browser span { + position: relative; +} + +div.filemanager ul li a.selected, div.filemanager ul li span.selected { + background: url(../Assets/filelist_selected.png) repeat-x; + color: #eee; + outline: none; +} + +div.filemanager-container span.fi img { + display: block; + float: left; + margin: 3px 3px 0 0; +} + +div.filemanager-container span.fi img.browser-icon { + float: right; +} + +div.filemanager-container span.move img.browser-icon { + display: none; +} + +div.filemanager span.notice { + position: absolute; + bottom: 16px; + left: 16px; +} + +div.filemanager div.filemanager-close { + position: absolute; + right: -10px; + top: -10px; + height: 20px; + width: 20px; + + cursor: pointer; + background: url(../Assets/button.png) repeat-x; + border: 1px solid #a1aeb9; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + border-radius: 10px; +} +div.filemanager div.filemanager-close img { + padding: 2px; +} + +div.filemanager-infos { + position: absolute; + left: 30%; + top: 0; + width: 70%; + line-height: 1.6em; + overflow: auto; +} + +div.filemanager-head { + height: 32px; + overflow: hidden; +} + +img.filemanager-icon { + float: left; + margin: 10px 12px; +} + +div.filemanager h1 { + margin: 0; + padding: 0; + width: 80%; + height: 32px; + line-height: 32px; + + color: #333; + font-size: 20px; + letter-spacing: 1px; + overflow: hidden; + white-space: nowrap; + background-color: transparent; +} + +div.filemanager h2 { + margin: 0; + border-top: 1px solid #bebebe; + font-size: 14px; + font-weight: bold; + padding: 2px 0 0 5px; + clear: both; +} + +div.filemanager dl { + margin: 5px 0; + width: 100%; + clear: both; + overflow: auto; +} + +div.filemanager dt, div.filemanager dd { + float: left; + line-height: 20px; + font-size: 11px; +} + +div.filemanager dt { + clear: both; + width: 22%; + margin-left: 5%; + font-weight: bold; +} + +div.filemanager dd { + width: 60%; + white-space: nowrap; + overflow: auto; +} + +div.filemanager div.margin { + margin-left: 15px; +} + +div.filemanager dd.filemanager-dir a.icon { + border: 1px solid #bebebe; + padding: 2px 5px 2px 20px; + text-decoration: none; + background: #eee url(../Assets/Icons/dir.png) 2px 0 no-repeat; + color: #000; + + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +div.filemanager dd.filemanager-dir a.icon:hover { + text-decoration: none; + background-color: #fff; +} + +div.filemanager dd.filemanager-dir a.selected, div.filemanager dd.filemanager-dir a.selected:hover { + margin: 0 1px; + background-color: transparent; + border: none; + cursor: auto; +} + +div.filemanager-preview { + margin-top: 5px; +} + +div.filemanager-preview img.preview { + margin: 0 auto 1em; + display: block; + max-height: 100px; + background: transparent; +} + +div.filemanager-engine-trident4 div.filemanager-preview img.preview { + height: 100px; +} + +div.filemanager-preview ul, div.filemanager-uploader ul, div.filemanager-preview div.textpreview { + border: 1px solid #bebebe; + background: #fff; + + padding: 2px; + margin: 1em auto; + + width: 490px; + height: 220px; + overflow: auto; +} + +div.filemanager-preview div.textpreview { + font: 9px Verdana, Arial, Helvetica, sans-serif; +} + +div.filemanager-preview div.object { + width: 200px; + height: 20px; + border: 1px solid #bebebe; + margin: 0 0 1em 190px; + overflow: hidden; +} + +div.filemanager-container img.browser-add { + position: absolute; + width: 16px; + height: 16px; + z-index: 1010; +} +/* UPLOAD */ + +div.filemanager-container .file span { + padding: 0 5px 0 0; +} + +div.filemanager-container .file .file-size { + color: #666; +} + +div.filemanager-container .file .file-cancel { + cursor: pointer; + padding-left: 5px; + float: right; +} +div.filemanager-container .file .file-progress { + margin-top: 5px; + float: right; + width: 125px; + height: 12px; + background-image: url(../Assets/progress.gif); +} + +div.filemanager div.checkbox { + float: left; + height: 12px; + width: 16px; + margin: 10px 3px 0; + background: url(../Assets/checkbox.png) no-repeat; +} + +div.filemanager div.checkboxChecked { + background-position: 0 -12px; +} + +/* SELECTED FILE */ +div.selected-file img { + vertical-align: bottom; + padding: 0 3px 0 0; +} +div.selected-file span { + line-height: 16px; +} +div.selected-file .file-cancel { + cursor: pointer; + padding: 0 0 0 5px; +} + + +/* GALLERY */ +div.filemanager button.filemanager-serialize { + font-weight: bold; +} + +div.filemanager-gallery { + position: absolute; + z-index: 1000; + width: 750px; + height: 144px; + display: none; + + font-family: Tahoma, sans-serif; + font-size: 12px; + + border: 1px solid #bebebe; + border-top: 0; + background: #eee; + + border-radius-bottomleft: 5px; + -moz-border-radius-bottomleft: 5px; + -webkit-border-radius-bottomleft: 5px; + + border-radius-bottomright: 5px; + -moz-border-radius-bottomright: 5px; + -webkit-border-radius-bottomright: 5px; + + box-shadow: rgba(0, 0, 0, 0.3) 0 0 40px; + -moz-box-shadow: rgba(0, 0, 0, 0.3) 0 0 40px; + -webkit-box-shadow: rgba(0, 0, 0, 0.3) 0 0 40px; +} + +div.filemanager-gallery div.howto { + position: absolute; + z-index: 1002; + left: 50px; + top: 60px; + + color: #666; + font-size: 18px; + font-style: italic; +} + +div.filemanager-gallery ul { + height: 121px; + + margin: 7px 6px; + padding: 4px; + + overflow: auto; + overflow-x: hidden; + border: 1px solid #bebebe; + background: #f2f2f2; +} + +div.filemanager-gallery ul.droppable { + background-color: #99b7e7; +} + +div.filemanager-gallery ul li { + position: relative; + float: left; + margin: 0; + width: 79px; + height: 60px; + + list-style: none; + + background: url(../Assets/loader.gif) center center no-repeat; +} + +div.filemanager-gallery ul li img { + padding: 2px; + width: 75px; + height: 56px; + cursor: pointer; +} + +div.filemanager-gallery ul li img.filemanager-remove { + position: absolute; + right: -7px; + top: -7px; + width: 16px; + height: 16px; +} + +div.filemanager-wrapper { + position: absolute; + z-index: 1020; + width: 222px; + height: 250px; + + font-family: Tahoma, sans-serif; + font-size: 12px; + + border: 1px solid #bebebe; + background: #eee; + + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +div.filemanager-wrapper div.img { + width: 210px; + height: 160px; + margin: 5px; + + border: 1px solid #bebebe; + background: #fff; +} + +div.filemanager-wrapper span { + display: block; + margin: 3px 8px 1px; + font-weight: bold; +} + +div.filemanager-wrapper input { + width: 210px; + margin: 3px 5px 0; + + border: 1px solid #bebebe; + background: #fff; +} + +div.filemanager-wrapper button { + margin: 3px 7px; +} + +img.filemanager-clone { + cursor: pointer; +} + +/* TIPS */ +.tip-filebrowser { + z-index: 1201; +} +.tip-filebrowser .tip { + background: #000; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + +.tip-filebrowser .tip-title { + color: #fff; + font-size: 11px; + padding: 1px 4px; + line-height: 21px; + text-align: center; + font-weight: bold; +} + +.tip-filebrowser .tip-text { + display: none; +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/index.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/index.html 3 Jan 2016 20:51:49 -0000 1.1.2.1 @@ -0,0 +1,188 @@ + + + + Testground + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    FileManager Demo

    +
    + +
    +
    + +
    + + +
    + + +
    +
    +
    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/manager.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/manager.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/manager.php 3 Jan 2016 20:51:49 -0000 1.1.2.1 @@ -0,0 +1,19 @@ + 'Files/', + 'assetBasePath' => '../Assets', + 'upload' => false, + 'destroy' => false, +)); + +$browser->fireEvent(!empty($_GET['event']) ? $_GET['event'] : null); Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/mootools-core.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/mootools-core.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/mootools-core.js 3 Jan 2016 20:51:49 -0000 1.1.2.1 @@ -0,0 +1,4225 @@ +/* +--- + +script: Core.js + +description: The core of MooTools, contains all the base functions and the Native and Hash implementations. Required by all the other scripts. + +license: MIT-style license. + +copyright: Copyright (c) 2006-2008 [Valerio Proietti](http://mad4milk.net/). + +authors: The MooTools production team (http://mootools.net/developers/) + +inspiration: +- Class implementation inspired by [Base.js](http://dean.edwards.name/weblog/2006/03/base/) Copyright (c) 2006 Dean Edwards, [GNU Lesser General Public License](http://opensource.org/licenses/lgpl-license.php) +- Some functionality inspired by [Prototype.js](http://prototypejs.org) Copyright (c) 2005-2007 Sam Stephenson, [MIT License](http://opensource.org/licenses/mit-license.php) + +provides: [Mootools, Native, Hash.base, Array.each, $util] + +... +*/ + +var MooTools = { + 'version': '1.2.4', + 'build': '0d9113241a90b9cd5643b926795852a2026710d4' +}; + +var Native = function(options){ + options = options || {}; + var name = options.name; + var legacy = options.legacy; + var protect = options.protect; + var methods = options.implement; + var generics = options.generics; + var initialize = options.initialize; + var afterImplement = options.afterImplement || function(){}; + var object = initialize || legacy; + generics = generics !== false; + + object.constructor = Native; + object.$family = {name: 'native'}; + if (legacy && initialize) object.prototype = legacy.prototype; + object.prototype.constructor = object; + + if (name){ + var family = name.toLowerCase(); + object.prototype.$family = {name: family}; + Native.typize(object, family); + } + + var add = function(obj, name, method, force){ + if (!protect || force || !obj.prototype[name]) obj.prototype[name] = method; + if (generics) Native.genericize(obj, name, protect); + afterImplement.call(obj, name, method); + return obj; + }; + + object.alias = function(a1, a2, a3){ + if (typeof a1 == 'string'){ + var pa1 = this.prototype[a1]; + if ((a1 = pa1)) return add(this, a2, a1, a3); + } + for (var a in a1) this.alias(a, a1[a], a2); + return this; + }; + + object.implement = function(a1, a2, a3){ + if (typeof a1 == 'string') return add(this, a1, a2, a3); + for (var p in a1) add(this, p, a1[p], a2); + return this; + }; + + if (methods) object.implement(methods); + + return object; +}; + +Native.genericize = function(object, property, check){ + if ((!check || !object[property]) && typeof object.prototype[property] == 'function') object[property] = function(){ + var args = Array.prototype.slice.call(arguments); + return object.prototype[property].apply(args.shift(), args); + }; +}; + +Native.implement = function(objects, properties){ + for (var i = 0, l = objects.length; i < l; i++) objects[i].implement(properties); +}; + +Native.typize = function(object, family){ + if (!object.type) object.type = function(item){ + return ($type(item) === family); + }; +}; + +(function(){ + var natives = {'Array': Array, 'Date': Date, 'Function': Function, 'Number': Number, 'RegExp': RegExp, 'String': String}; + for (var n in natives) new Native({name: n, initialize: natives[n], protect: true}); + + var types = {'boolean': Boolean, 'native': Native, 'object': Object}; + for (var t in types) Native.typize(types[t], t); + + var generics = { + 'Array': ["concat", "indexOf", "join", "lastIndexOf", "pop", "push", "reverse", "shift", "slice", "sort", "splice", "toString", "unshift", "valueOf"], + 'String': ["charAt", "charCodeAt", "concat", "indexOf", "lastIndexOf", "match", "replace", "search", "slice", "split", "substr", "substring", "toLowerCase", "toUpperCase", "valueOf"] + }; + for (var g in generics){ + for (var i = generics[g].length; i--;) Native.genericize(natives[g], generics[g][i], true); + } +})(); + +var Hash = new Native({ + + name: 'Hash', + + initialize: function(object){ + if ($type(object) == 'hash') object = $unlink(object.getClean()); + for (var key in object) this[key] = object[key]; + return this; + } + +}); + +Hash.implement({ + + forEach: function(fn, bind){ + for (var key in this){ + if (this.hasOwnProperty(key)) fn.call(bind, this[key], key, this); + } + }, + + getClean: function(){ + var clean = {}; + for (var key in this){ + if (this.hasOwnProperty(key)) clean[key] = this[key]; + } + return clean; + }, + + getLength: function(){ + var length = 0; + for (var key in this){ + if (this.hasOwnProperty(key)) length++; + } + return length; + } + +}); + +Hash.alias('forEach', 'each'); + +Array.implement({ + + forEach: function(fn, bind){ + for (var i = 0, l = this.length; i < l; i++) fn.call(bind, this[i], i, this); + } + +}); + +Array.alias('forEach', 'each'); + +function $A(iterable){ + if (iterable.item){ + var l = iterable.length, array = new Array(l); + while (l--) array[l] = iterable[l]; + return array; + } + return Array.prototype.slice.call(iterable); +}; + +function $arguments(i){ + return function(){ + return arguments[i]; + }; +}; + +function $chk(obj){ + return !!(obj || obj === 0); +}; + +function $clear(timer){ + clearTimeout(timer); + clearInterval(timer); + return null; +}; + +function $defined(obj){ + return (obj != undefined); +}; + +function $each(iterable, fn, bind){ + var type = $type(iterable); + ((type == 'arguments' || type == 'collection' || type == 'array') ? Array : Hash).each(iterable, fn, bind); +}; + +function $empty(){}; + +function $extend(original, extended){ + for (var key in (extended || {})) original[key] = extended[key]; + return original; +}; + +function $H(object){ + return new Hash(object); +}; + +function $lambda(value){ + return ($type(value) == 'function') ? value : function(){ + return value; + }; +}; + +function $merge(){ + var args = Array.slice(arguments); + args.unshift({}); + return $mixin.apply(null, args); +}; + +function $mixin(mix){ + for (var i = 1, l = arguments.length; i < l; i++){ + var object = arguments[i]; + if ($type(object) != 'object') continue; + for (var key in object){ + var op = object[key], mp = mix[key]; + mix[key] = (mp && $type(op) == 'object' && $type(mp) == 'object') ? $mixin(mp, op) : $unlink(op); + } + } + return mix; +}; + +function $pick(){ + for (var i = 0, l = arguments.length; i < l; i++){ + if (arguments[i] != undefined) return arguments[i]; + } + return null; +}; + +function $random(min, max){ + return Math.floor(Math.random() * (max - min + 1) + min); +}; + +function $splat(obj){ + var type = $type(obj); + return (type) ? ((type != 'array' && type != 'arguments') ? [obj] : obj) : []; +}; + +var $time = Date.now || function(){ + return +new Date; +}; + +function $try(){ + for (var i = 0, l = arguments.length; i < l; i++){ + try { + return arguments[i](); + } catch(e){} + } + return null; +}; + +function $type(obj){ + if (obj == undefined) return false; + if (obj.$family) return (obj.$family.name == 'number' && !isFinite(obj)) ? false : obj.$family.name; + if (obj.nodeName){ + switch (obj.nodeType){ + case 1: return 'element'; + case 3: return (/\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace'; + } + } else if (typeof obj.length == 'number'){ + if (obj.callee) return 'arguments'; + else if (obj.item) return 'collection'; + } + return typeof obj; +}; + +function $unlink(object){ + var unlinked; + switch ($type(object)){ + case 'object': + unlinked = {}; + for (var p in object) unlinked[p] = $unlink(object[p]); + break; + case 'hash': + unlinked = new Hash(object); + break; + case 'array': + unlinked = []; + for (var i = 0, l = object.length; i < l; i++) unlinked[i] = $unlink(object[i]); + break; + default: return object; + } + return unlinked; +}; + + +/* +--- + +script: Browser.js + +description: The Browser Core. Contains Browser initialization, Window and Document, and the Browser Hash. + +license: MIT-style license. + +requires: +- /Native +- /$util + +provides: [Browser, Window, Document, $exec] + +... +*/ + +var Browser = $merge({ + + Engine: {name: 'unknown', version: 0}, + + Platform: {name: (window.orientation != undefined) ? 'ipod' : (navigator.platform.match(/mac|win|linux/i) || ['other'])[0].toLowerCase()}, + + Features: {xpath: !!(document.evaluate), air: !!(window.runtime), query: !!(document.querySelector)}, + + Plugins: {}, + + Engines: { + + presto: function(){ + return (!window.opera) ? false : ((arguments.callee.caller) ? 960 : ((document.getElementsByClassName) ? 950 : 925)); + }, + + trident: function(){ + return (!window.ActiveXObject) ? false : ((window.XMLHttpRequest) ? ((document.querySelectorAll) ? 6 : 5) : 4); + }, + + webkit: function(){ + return (navigator.taintEnabled) ? false : ((Browser.Features.xpath) ? ((Browser.Features.query) ? 525 : 420) : 419); + }, + + gecko: function(){ + return (!document.getBoxObjectFor && window.mozInnerScreenX == null) ? false : ((document.getElementsByClassName) ? 19 : 18); + } + + } + +}, Browser || {}); + +Browser.Platform[Browser.Platform.name] = true; + +Browser.detect = function(){ + + for (var engine in this.Engines){ + var version = this.Engines[engine](); + if (version){ + this.Engine = {name: engine, version: version}; + this.Engine[engine] = this.Engine[engine + version] = true; + break; + } + } + + return {name: engine, version: version}; + +}; + +Browser.detect(); + +Browser.Request = function(){ + return $try(function(){ + return new XMLHttpRequest(); + }, function(){ + return new ActiveXObject('MSXML2.XMLHTTP'); + }, function(){ + return new ActiveXObject('Microsoft.XMLHTTP'); + }); +}; + +Browser.Features.xhr = !!(Browser.Request()); + +Browser.Plugins.Flash = (function(){ + var version = ($try(function(){ + return navigator.plugins['Shockwave Flash'].description; + }, function(){ + return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version'); + }) || '0 r0').match(/\d+/g); + return {version: parseInt(version[0] || 0 + '.' + version[1], 10) || 0, build: parseInt(version[2], 10) || 0}; +})(); + +function $exec(text){ + if (!text) return text; + if (window.execScript){ + window.execScript(text); + } else { + var script = document.createElement('script'); + script.setAttribute('type', 'text/javascript'); + script[(Browser.Engine.webkit && Browser.Engine.version < 420) ? 'innerText' : 'text'] = text; + document.head.appendChild(script); + document.head.removeChild(script); + } + return text; +}; + +Native.UID = 1; + +var $uid = (Browser.Engine.trident) ? function(item){ + return (item.uid || (item.uid = [Native.UID++]))[0]; +} : function(item){ + return item.uid || (item.uid = Native.UID++); +}; + +var Window = new Native({ + + name: 'Window', + + legacy: (Browser.Engine.trident) ? null: window.Window, + + initialize: function(win){ + $uid(win); + if (!win.Element){ + win.Element = $empty; + if (Browser.Engine.webkit) win.document.createElement("iframe"); //fixes safari 2 + win.Element.prototype = (Browser.Engine.webkit) ? window["[[DOMElement.prototype]]"] : {}; + } + win.document.window = win; + return $extend(win, Window.Prototype); + }, + + afterImplement: function(property, value){ + window[property] = Window.Prototype[property] = value; + } + +}); + +Window.Prototype = {$family: {name: 'window'}}; + +new Window(window); + +var Document = new Native({ + + name: 'Document', + + legacy: (Browser.Engine.trident) ? null: window.Document, + + initialize: function(doc){ + $uid(doc); + doc.head = doc.getElementsByTagName('head')[0]; + doc.html = doc.getElementsByTagName('html')[0]; + if (Browser.Engine.trident && Browser.Engine.version <= 4) $try(function(){ + doc.execCommand("BackgroundImageCache", false, true); + }); + if (Browser.Engine.trident) doc.window.attachEvent('onunload', function(){ + doc.window.detachEvent('onunload', arguments.callee); + doc.head = doc.html = doc.window = null; + }); + return $extend(doc, Document.Prototype); + }, + + afterImplement: function(property, value){ + document[property] = Document.Prototype[property] = value; + } + +}); + +Document.Prototype = {$family: {name: 'document'}}; + +new Document(document); + + +/* +--- + +script: Array.js + +description: Contains Array Prototypes like each, contains, and erase. + +license: MIT-style license. + +requires: +- /$util +- /Array.each + +provides: [Array] + +... +*/ + +Array.implement({ + + every: function(fn, bind){ + for (var i = 0, l = this.length; i < l; i++){ + if (!fn.call(bind, this[i], i, this)) return false; + } + return true; + }, + + filter: function(fn, bind){ + var results = []; + for (var i = 0, l = this.length; i < l; i++){ + if (fn.call(bind, this[i], i, this)) results.push(this[i]); + } + return results; + }, + + clean: function(){ + return this.filter($defined); + }, + + indexOf: function(item, from){ + var len = this.length; + for (var i = (from < 0) ? Math.max(0, len + from) : from || 0; i < len; i++){ + if (this[i] === item) return i; + } + return -1; + }, + + map: function(fn, bind){ + var results = []; + for (var i = 0, l = this.length; i < l; i++) results[i] = fn.call(bind, this[i], i, this); + return results; + }, + + some: function(fn, bind){ + for (var i = 0, l = this.length; i < l; i++){ + if (fn.call(bind, this[i], i, this)) return true; + } + return false; + }, + + associate: function(keys){ + var obj = {}, length = Math.min(this.length, keys.length); + for (var i = 0; i < length; i++) obj[keys[i]] = this[i]; + return obj; + }, + + link: function(object){ + var result = {}; + for (var i = 0, l = this.length; i < l; i++){ + for (var key in object){ + if (object[key](this[i])){ + result[key] = this[i]; + delete object[key]; + break; + } + } + } + return result; + }, + + contains: function(item, from){ + return this.indexOf(item, from) != -1; + }, + + extend: function(array){ + for (var i = 0, j = array.length; i < j; i++) this.push(array[i]); + return this; + }, + + getLast: function(){ + return (this.length) ? this[this.length - 1] : null; + }, + + getRandom: function(){ + return (this.length) ? this[$random(0, this.length - 1)] : null; + }, + + include: function(item){ + if (!this.contains(item)) this.push(item); + return this; + }, + + combine: function(array){ + for (var i = 0, l = array.length; i < l; i++) this.include(array[i]); + return this; + }, + + erase: function(item){ + for (var i = this.length; i--; i){ + if (this[i] === item) this.splice(i, 1); + } + return this; + }, + + empty: function(){ + this.length = 0; + return this; + }, + + flatten: function(){ + var array = []; + for (var i = 0, l = this.length; i < l; i++){ + var type = $type(this[i]); + if (!type) continue; + array = array.concat((type == 'array' || type == 'collection' || type == 'arguments') ? Array.flatten(this[i]) : this[i]); + } + return array; + }, + + hexToRgb: function(array){ + if (this.length != 3) return null; + var rgb = this.map(function(value){ + if (value.length == 1) value += value; + return value.toInt(16); + }); + return (array) ? rgb : 'rgb(' + rgb + ')'; + }, + + rgbToHex: function(array){ + if (this.length < 3) return null; + if (this.length == 4 && this[3] == 0 && !array) return 'transparent'; + var hex = []; + for (var i = 0; i < 3; i++){ + var bit = (this[i] - 0).toString(16); + hex.push((bit.length == 1) ? '0' + bit : bit); + } + return (array) ? hex : '#' + hex.join(''); + } + +}); + + +/* +--- + +script: Function.js + +description: Contains Function Prototypes like create, bind, pass, and delay. + +license: MIT-style license. + +requires: +- /Native +- /$util + +provides: [Function] + +... +*/ + +Function.implement({ + + extend: function(properties){ + for (var property in properties) this[property] = properties[property]; + return this; + }, + + create: function(options){ + var self = this; + options = options || {}; + return function(event){ + var args = options.arguments; + args = (args != undefined) ? $splat(args) : Array.slice(arguments, (options.event) ? 1 : 0); + if (options.event) args = [event || window.event].extend(args); + var returns = function(){ + return self.apply(options.bind || null, args); + }; + if (options.delay) return setTimeout(returns, options.delay); + if (options.periodical) return setInterval(returns, options.periodical); + if (options.attempt) return $try(returns); + return returns(); + }; + }, + + run: function(args, bind){ + return this.apply(bind, $splat(args)); + }, + + pass: function(args, bind){ + return this.create({bind: bind, arguments: args}); + }, + + bind: function(bind, args){ + return this.create({bind: bind, arguments: args}); + }, + + bindWithEvent: function(bind, args){ + return this.create({bind: bind, arguments: args, event: true}); + }, + + attempt: function(args, bind){ + return this.create({bind: bind, arguments: args, attempt: true})(); + }, + + delay: function(delay, bind, args){ + return this.create({bind: bind, arguments: args, delay: delay})(); + }, + + periodical: function(periodical, bind, args){ + return this.create({bind: bind, arguments: args, periodical: periodical})(); + } + +}); + + +/* +--- + +script: Number.js + +description: Contains Number Prototypes like limit, round, times, and ceil. + +license: MIT-style license. + +requires: +- /Native +- /$util + +provides: [Number] + +... +*/ + +Number.implement({ + + limit: function(min, max){ + return Math.min(max, Math.max(min, this)); + }, + + round: function(precision){ + precision = Math.pow(10, precision || 0); + return Math.round(this * precision) / precision; + }, + + times: function(fn, bind){ + for (var i = 0; i < this; i++) fn.call(bind, i, this); + }, + + toFloat: function(){ + return parseFloat(this); + }, + + toInt: function(base){ + return parseInt(this, base || 10); + } + +}); + +Number.alias('times', 'each'); + +(function(math){ + var methods = {}; + math.each(function(name){ + if (!Number[name]) methods[name] = function(){ + return Math[name].apply(null, [this].concat($A(arguments))); + }; + }); + Number.implement(methods); +})(['abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'exp', 'floor', 'log', 'max', 'min', 'pow', 'sin', 'sqrt', 'tan']); + + +/* +--- + +script: String.js + +description: Contains String Prototypes like camelCase, capitalize, test, and toInt. + +license: MIT-style license. + +requires: +- /Native + +provides: [String] + +... +*/ + +String.implement({ + + test: function(regex, params){ + return ((typeof regex == 'string') ? new RegExp(regex, params) : regex).test(this); + }, + + contains: function(string, separator){ + return (separator) ? (separator + this + separator).indexOf(separator + string + separator) > -1 : this.indexOf(string) > -1; + }, + + trim: function(){ + return this.replace(/^\s+|\s+$/g, ''); + }, + + clean: function(){ + return this.replace(/\s+/g, ' ').trim(); + }, + + camelCase: function(){ + return this.replace(/-\D/g, function(match){ + return match.charAt(1).toUpperCase(); + }); + }, + + hyphenate: function(){ + return this.replace(/[A-Z]/g, function(match){ + return ('-' + match.charAt(0).toLowerCase()); + }); + }, + + capitalize: function(){ + return this.replace(/\b[a-z]/g, function(match){ + return match.toUpperCase(); + }); + }, + + escapeRegExp: function(){ + return this.replace(/([-.*+?^${}()|[\]\/\\])/g, '\\$1'); + }, + + toInt: function(base){ + return parseInt(this, base || 10); + }, + + toFloat: function(){ + return parseFloat(this); + }, + + hexToRgb: function(array){ + var hex = this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); + return (hex) ? hex.slice(1).hexToRgb(array) : null; + }, + + rgbToHex: function(array){ + var rgb = this.match(/\d{1,3}/g); + return (rgb) ? rgb.rgbToHex(array) : null; + }, + + stripScripts: function(option){ + var scripts = ''; + var text = this.replace(/]*>([\s\S]*?)<\/script>/gi, function(){ + scripts += arguments[1] + '\n'; + return ''; + }); + if (option === true) $exec(scripts); + else if ($type(option) == 'function') option(scripts, text); + return text; + }, + + substitute: function(object, regexp){ + return this.replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){ + if (match.charAt(0) == '\\') return match.slice(1); + return (object[name] != undefined) ? object[name] : ''; + }); + } + +}); + + +/* +--- + +script: Hash.js + +description: Contains Hash Prototypes. Provides a means for overcoming the JavaScript practical impossibility of extending native Objects. + +license: MIT-style license. + +requires: +- /Hash.base + +provides: [Hash] + +... +*/ + +Hash.implement({ + + has: Object.prototype.hasOwnProperty, + + keyOf: function(value){ + for (var key in this){ + if (this.hasOwnProperty(key) && this[key] === value) return key; + } + return null; + }, + + hasValue: function(value){ + return (Hash.keyOf(this, value) !== null); + }, + + extend: function(properties){ + Hash.each(properties || {}, function(value, key){ + Hash.set(this, key, value); + }, this); + return this; + }, + + combine: function(properties){ + Hash.each(properties || {}, function(value, key){ + Hash.include(this, key, value); + }, this); + return this; + }, + + erase: function(key){ + if (this.hasOwnProperty(key)) delete this[key]; + return this; + }, + + get: function(key){ + return (this.hasOwnProperty(key)) ? this[key] : null; + }, + + set: function(key, value){ + if (!this[key] || this.hasOwnProperty(key)) this[key] = value; + return this; + }, + + empty: function(){ + Hash.each(this, function(value, key){ + delete this[key]; + }, this); + return this; + }, + + include: function(key, value){ + if (this[key] == undefined) this[key] = value; + return this; + }, + + map: function(fn, bind){ + var results = new Hash; + Hash.each(this, function(value, key){ + results.set(key, fn.call(bind, value, key, this)); + }, this); + return results; + }, + + filter: function(fn, bind){ + var results = new Hash; + Hash.each(this, function(value, key){ + if (fn.call(bind, value, key, this)) results.set(key, value); + }, this); + return results; + }, + + every: function(fn, bind){ + for (var key in this){ + if (this.hasOwnProperty(key) && !fn.call(bind, this[key], key)) return false; + } + return true; + }, + + some: function(fn, bind){ + for (var key in this){ + if (this.hasOwnProperty(key) && fn.call(bind, this[key], key)) return true; + } + return false; + }, + + getKeys: function(){ + var keys = []; + Hash.each(this, function(value, key){ + keys.push(key); + }); + return keys; + }, + + getValues: function(){ + var values = []; + Hash.each(this, function(value){ + values.push(value); + }); + return values; + }, + + toQueryString: function(base){ + var queryString = []; + Hash.each(this, function(value, key){ + if (base) key = base + '[' + key + ']'; + var result; + switch ($type(value)){ + case 'object': result = Hash.toQueryString(value, key); break; + case 'array': + var qs = {}; + value.each(function(val, i){ + qs[i] = val; + }); + result = Hash.toQueryString(qs, key); + break; + default: result = key + '=' + encodeURIComponent(value); + } + if (value != undefined) queryString.push(result); + }); + + return queryString.join('&'); + } + +}); + +Hash.alias({keyOf: 'indexOf', hasValue: 'contains'}); + + +/* +--- + +script: Event.js + +description: Contains the Event Class, to make the event object cross-browser. + +license: MIT-style license. + +requires: +- /Window +- /Document +- /Hash +- /Array +- /Function +- /String + +provides: [Event] + +... +*/ + +var Event = new Native({ + + name: 'Event', + + initialize: function(event, win){ + win = win || window; + var doc = win.document; + event = event || win.event; + if (event.$extended) return event; + this.$extended = true; + var type = event.type; + var target = event.target || event.srcElement; + while (target && target.nodeType == 3) target = target.parentNode; + + if (type.test(/key/)){ + var code = event.which || event.keyCode; + var key = Event.Keys.keyOf(code); + if (type == 'keydown'){ + var fKey = code - 111; + if (fKey > 0 && fKey < 13) key = 'f' + fKey; + } + key = key || String.fromCharCode(code).toLowerCase(); + } else if (type.match(/(click|mouse|menu)/i)){ + doc = (!doc.compatMode || doc.compatMode == 'CSS1Compat') ? doc.html : doc.body; + var page = { + x: event.pageX || event.clientX + doc.scrollLeft, + y: event.pageY || event.clientY + doc.scrollTop + }; + var client = { + x: (event.pageX) ? event.pageX - win.pageXOffset : event.clientX, + y: (event.pageY) ? event.pageY - win.pageYOffset : event.clientY + }; + if (type.match(/DOMMouseScroll|mousewheel/)){ + var wheel = (event.wheelDelta) ? event.wheelDelta / 120 : -(event.detail || 0) / 3; + } + var rightClick = (event.which == 3) || (event.button == 2); + var related = null; + if (type.match(/over|out/)){ + switch (type){ + case 'mouseover': related = event.relatedTarget || event.fromElement; break; + case 'mouseout': related = event.relatedTarget || event.toElement; + } + if (!(function(){ + while (related && related.nodeType == 3) related = related.parentNode; + return true; + }).create({attempt: Browser.Engine.gecko})()) related = false; + } + } + + return $extend(this, { + event: event, + type: type, + + page: page, + client: client, + rightClick: rightClick, + + wheel: wheel, + + relatedTarget: related, + target: target, + + code: code, + key: key, + + shift: event.shiftKey, + control: event.ctrlKey, + alt: event.altKey, + meta: event.metaKey + }); + } + +}); + +Event.Keys = new Hash({ + 'enter': 13, + 'up': 38, + 'down': 40, + 'left': 37, + 'right': 39, + 'esc': 27, + 'space': 32, + 'backspace': 8, + 'tab': 9, + 'delete': 46 +}); + +Event.implement({ + + stop: function(){ + return this.stopPropagation().preventDefault(); + }, + + stopPropagation: function(){ + if (this.event.stopPropagation) this.event.stopPropagation(); + else this.event.cancelBubble = true; + return this; + }, + + preventDefault: function(){ + if (this.event.preventDefault) this.event.preventDefault(); + else this.event.returnValue = false; + return this; + } + +}); + + +/* +--- + +script: Class.js + +description: Contains the Class Function for easily creating, extending, and implementing reusable Classes. + +license: MIT-style license. + +requires: +- /$util +- /Native +- /Array +- /String +- /Function +- /Number +- /Hash + +provides: [Class] + +... +*/ + +function Class(params){ + + if (params instanceof Function) params = {initialize: params}; + + var newClass = function(){ + Object.reset(this); + if (newClass._prototyping) return this; + this._current = $empty; + var value = (this.initialize) ? this.initialize.apply(this, arguments) : this; + delete this._current; delete this.caller; + return value; + }.extend(this); + + newClass.implement(params); + + newClass.constructor = Class; + newClass.prototype.constructor = newClass; + + return newClass; + +}; + +Function.prototype.protect = function(){ + this._protected = true; + return this; +}; + +Object.reset = function(object, key){ + + if (key == null){ + for (var p in object) Object.reset(object, p); + return object; + } + + delete object[key]; + + switch ($type(object[key])){ + case 'object': + var F = function(){}; + F.prototype = object[key]; + var i = new F; + object[key] = Object.reset(i); + break; + case 'array': object[key] = $unlink(object[key]); break; + } + + return object; + +}; + +new Native({name: 'Class', initialize: Class}).extend({ + + instantiate: function(F){ + F._prototyping = true; + var proto = new F; + delete F._prototyping; + return proto; + }, + + wrap: function(self, key, method){ + if (method._origin) method = method._origin; + + return function(){ + if (method._protected && this._current == null) throw new Error('The method "' + key + '" cannot be called.'); + var caller = this.caller, current = this._current; + this.caller = current; this._current = arguments.callee; + var result = method.apply(this, arguments); + this._current = current; this.caller = caller; + return result; + }.extend({_owner: self, _origin: method, _name: key}); + + } + +}); + +Class.implement({ + + implement: function(key, value){ + + if ($type(key) == 'object'){ + for (var p in key) this.implement(p, key[p]); + return this; + } + + var mutator = Class.Mutators[key]; + + if (mutator){ + value = mutator.call(this, value); + if (value == null) return this; + } + + var proto = this.prototype; + + switch ($type(value)){ + + case 'function': + if (value._hidden) return this; + proto[key] = Class.wrap(this, key, value); + break; + + case 'object': + var previous = proto[key]; + if ($type(previous) == 'object') $mixin(previous, value); + else proto[key] = $unlink(value); + break; + + case 'array': + proto[key] = $unlink(value); + break; + + default: proto[key] = value; + + } + + return this; + + } + +}); + +Class.Mutators = { + + Extends: function(parent){ + + this.parent = parent; + this.prototype = Class.instantiate(parent); + + this.implement('parent', function(){ + var name = this.caller._name, previous = this.caller._owner.parent.prototype[name]; + if (!previous) throw new Error('The method "' + name + '" has no parent.'); + return previous.apply(this, arguments); + }.protect()); + + }, + + Implements: function(items){ + $splat(items).each(function(item){ + if (item instanceof Function) item = Class.instantiate(item); + this.implement(item); + }, this); + + } + +}; + + +/* +--- + +script: Class.Extras.js + +description: Contains Utility Classes that can be implemented into your own Classes to ease the execution of many common tasks. + +license: MIT-style license. + +requires: +- /Class + +provides: [Chain, Events, Options] + +... +*/ + +var Chain = new Class({ + + $chain: [], + + chain: function(){ + this.$chain.extend(Array.flatten(arguments)); + return this; + }, + + callChain: function(){ + return (this.$chain.length) ? this.$chain.shift().apply(this, arguments) : false; + }, + + clearChain: function(){ + this.$chain.empty(); + return this; + } + +}); + +var Events = new Class({ + + $events: {}, + + addEvent: function(type, fn, internal){ + type = Events.removeOn(type); + if (fn != $empty){ + this.$events[type] = this.$events[type] || []; + this.$events[type].include(fn); + if (internal) fn.internal = true; + } + return this; + }, + + addEvents: function(events){ + for (var type in events) this.addEvent(type, events[type]); + return this; + }, + + fireEvent: function(type, args, delay){ + type = Events.removeOn(type); + if (!this.$events || !this.$events[type]) return this; + this.$events[type].each(function(fn){ + fn.create({'bind': this, 'delay': delay, 'arguments': args})(); + }, this); + return this; + }, + + removeEvent: function(type, fn){ + type = Events.removeOn(type); + if (!this.$events[type]) return this; + if (!fn.internal) this.$events[type].erase(fn); + return this; + }, + + removeEvents: function(events){ + var type; + if ($type(events) == 'object'){ + for (type in events) this.removeEvent(type, events[type]); + return this; + } + if (events) events = Events.removeOn(events); + for (type in this.$events){ + if (events && events != type) continue; + var fns = this.$events[type]; + for (var i = fns.length; i--; i) this.removeEvent(type, fns[i]); + } + return this; + } + +}); + +Events.removeOn = function(string){ + return string.replace(/^on([A-Z])/, function(full, first){ + return first.toLowerCase(); + }); +}; + +var Options = new Class({ + + setOptions: function(){ + this.options = $merge.run([this.options].extend(arguments)); + if (!this.addEvent) return this; + for (var option in this.options){ + if ($type(this.options[option]) != 'function' || !(/^on[A-Z]/).test(option)) continue; + this.addEvent(option, this.options[option]); + delete this.options[option]; + } + return this; + } + +}); + + +/* +--- + +script: Element.js + +description: One of the most important items in MooTools. Contains the dollar function, the dollars function, and an handful of cross-browser, time-saver methods to let you easily work with HTML Elements. + +license: MIT-style license. + +requires: +- /Window +- /Document +- /Array +- /String +- /Function +- /Number +- /Hash + +provides: [Element, Elements, $, $$, Iframe] + +... +*/ + +var Element = new Native({ + + name: 'Element', + + legacy: window.Element, + + initialize: function(tag, props){ + var konstructor = Element.Constructors.get(tag); + if (konstructor) return konstructor(props); + if (typeof tag == 'string') return document.newElement(tag, props); + return document.id(tag).set(props); + }, + + afterImplement: function(key, value){ + Element.Prototype[key] = value; + if (Array[key]) return; + Elements.implement(key, function(){ + var items = [], elements = true; + for (var i = 0, j = this.length; i < j; i++){ + var returns = this[i][key].apply(this[i], arguments); + items.push(returns); + if (elements) elements = ($type(returns) == 'element'); + } + return (elements) ? new Elements(items) : items; + }); + } + +}); + +Element.Prototype = {$family: {name: 'element'}}; + +Element.Constructors = new Hash; + +var IFrame = new Native({ + + name: 'IFrame', + + generics: false, + + initialize: function(){ + var params = Array.link(arguments, {properties: Object.type, iframe: $defined}); + var props = params.properties || {}; + var iframe = document.id(params.iframe); + var onload = props.onload || $empty; + delete props.onload; + props.id = props.name = $pick(props.id, props.name, iframe ? (iframe.id || iframe.name) : 'IFrame_' + $time()); + iframe = new Element(iframe || 'iframe', props); + var onFrameLoad = function(){ + var host = $try(function(){ + return iframe.contentWindow.location.host; + }); + if (!host || host == window.location.host){ + var win = new Window(iframe.contentWindow); + new Document(iframe.contentWindow.document); + $extend(win.Element.prototype, Element.Prototype); + } + onload.call(iframe.contentWindow, iframe.contentWindow.document); + }; + var contentWindow = $try(function(){ + return iframe.contentWindow; + }); + ((contentWindow && contentWindow.document.body) || window.frames[props.id]) ? onFrameLoad() : iframe.addListener('load', onFrameLoad); + return iframe; + } + +}); + +var Elements = new Native({ + + initialize: function(elements, options){ + options = $extend({ddup: true, cash: true}, options); + elements = elements || []; + if (options.ddup || options.cash){ + var uniques = {}, returned = []; + for (var i = 0, l = elements.length; i < l; i++){ + var el = document.id(elements[i], !options.cash); + if (options.ddup){ + if (uniques[el.uid]) continue; + uniques[el.uid] = true; + } + if (el) returned.push(el); + } + elements = returned; + } + return (options.cash) ? $extend(elements, this) : elements; + } + +}); + +Elements.implement({ + + filter: function(filter, bind){ + if (!filter) return this; + return new Elements(Array.filter(this, (typeof filter == 'string') ? function(item){ + return item.match(filter); + } : filter, bind)); + } + +}); + +Document.implement({ + + newElement: function(tag, props){ + if (Browser.Engine.trident && props){ + ['name', 'type', 'checked'].each(function(attribute){ + if (!props[attribute]) return; + tag += ' ' + attribute + '="' + props[attribute] + '"'; + if (attribute != 'checked') delete props[attribute]; + }); + tag = '<' + tag + '>'; + } + return document.id(this.createElement(tag)).set(props); + }, + + newTextNode: function(text){ + return this.createTextNode(text); + }, + + getDocument: function(){ + return this; + }, + + getWindow: function(){ + return this.window; + }, + + id: (function(){ + + var types = { + + string: function(id, nocash, doc){ + id = doc.getElementById(id); + return (id) ? types.element(id, nocash) : null; + }, + + element: function(el, nocash){ + $uid(el); + if (!nocash && !el.$family && !(/^object|embed$/i).test(el.tagName)){ + var proto = Element.Prototype; + for (var p in proto) el[p] = proto[p]; + }; + return el; + }, + + object: function(obj, nocash, doc){ + if (obj.toElement) return types.element(obj.toElement(doc), nocash); + return null; + } + + }; + + types.textnode = types.whitespace = types.window = types.document = $arguments(0); + + return function(el, nocash, doc){ + if (el && el.$family && el.uid) return el; + var type = $type(el); + return (types[type]) ? types[type](el, nocash, doc || document) : null; + }; + + })() + +}); + +if (window.$ == null) Window.implement({ + $: function(el, nc){ + return document.id(el, nc, this.document); + } +}); + +Window.implement({ + + $$: function(selector){ + if (arguments.length == 1 && typeof selector == 'string') return this.document.getElements(selector); + var elements = []; + var args = Array.flatten(arguments); + for (var i = 0, l = args.length; i < l; i++){ + var item = args[i]; + switch ($type(item)){ + case 'element': elements.push(item); break; + case 'string': elements.extend(this.document.getElements(item, true)); + } + } + return new Elements(elements); + }, + + getDocument: function(){ + return this.document; + }, + + getWindow: function(){ + return this; + } + +}); + +Native.implement([Element, Document], { + + getElement: function(selector, nocash){ + return document.id(this.getElements(selector, true)[0] || null, nocash); + }, + + getElements: function(tags, nocash){ + tags = tags.split(','); + var elements = []; + var ddup = (tags.length > 1); + tags.each(function(tag){ + var partial = this.getElementsByTagName(tag.trim()); + (ddup) ? elements.extend(partial) : elements = partial; + }, this); + return new Elements(elements, {ddup: ddup, cash: !nocash}); + } + +}); + +(function(){ + +var collected = {}, storage = {}; +var props = {input: 'checked', option: 'selected', textarea: (Browser.Engine.webkit && Browser.Engine.version < 420) ? 'innerHTML' : 'value'}; + +var get = function(uid){ + return (storage[uid] || (storage[uid] = {})); +}; + +var clean = function(item, retain){ + if (!item) return; + var uid = item.uid; + if (Browser.Engine.trident){ + if (item.clearAttributes){ + var clone = retain && item.cloneNode(false); + item.clearAttributes(); + if (clone) item.mergeAttributes(clone); + } else if (item.removeEvents){ + item.removeEvents(); + } + if ((/object/i).test(item.tagName)){ + for (var p in item){ + if (typeof item[p] == 'function') item[p] = $empty; + } + Element.dispose(item); + } + } + if (!uid) return; + collected[uid] = storage[uid] = null; +}; + +var purge = function(){ + Hash.each(collected, clean); + if (Browser.Engine.trident) $A(document.getElementsByTagName('object')).each(clean); + if (window.CollectGarbage) CollectGarbage(); + collected = storage = null; +}; + +var walk = function(element, walk, start, match, all, nocash){ + var el = element[start || walk]; + var elements = []; + while (el){ + if (el.nodeType == 1 && (!match || Element.match(el, match))){ + if (!all) return document.id(el, nocash); + elements.push(el); + } + el = el[walk]; + } + return (all) ? new Elements(elements, {ddup: false, cash: !nocash}) : null; +}; + +var attributes = { + 'html': 'innerHTML', + 'class': 'className', + 'for': 'htmlFor', + 'defaultValue': 'defaultValue', + 'text': (Browser.Engine.trident || (Browser.Engine.webkit && Browser.Engine.version < 420)) ? 'innerText' : 'textContent' +}; +var bools = ['compact', 'nowrap', 'ismap', 'declare', 'noshade', 'checked', 'disabled', 'readonly', 'multiple', 'selected', 'noresize', 'defer']; +var camels = ['value', 'type', 'defaultValue', 'accessKey', 'cellPadding', 'cellSpacing', 'colSpan', 'frameBorder', 'maxLength', 'readOnly', 'rowSpan', 'tabIndex', 'useMap']; + +bools = bools.associate(bools); + +Hash.extend(attributes, bools); +Hash.extend(attributes, camels.associate(camels.map(String.toLowerCase))); + +var inserters = { + + before: function(context, element){ + if (element.parentNode) element.parentNode.insertBefore(context, element); + }, + + after: function(context, element){ + if (!element.parentNode) return; + var next = element.nextSibling; + (next) ? element.parentNode.insertBefore(context, next) : element.parentNode.appendChild(context); + }, + + bottom: function(context, element){ + element.appendChild(context); + }, + + top: function(context, element){ + var first = element.firstChild; + (first) ? element.insertBefore(context, first) : element.appendChild(context); + } + +}; + +inserters.inside = inserters.bottom; + +Hash.each(inserters, function(inserter, where){ + + where = where.capitalize(); + + Element.implement('inject' + where, function(el){ + inserter(this, document.id(el, true)); + return this; + }); + + Element.implement('grab' + where, function(el){ + inserter(document.id(el, true), this); + return this; + }); + +}); + +Element.implement({ + + set: function(prop, value){ + switch ($type(prop)){ + case 'object': + for (var p in prop) this.set(p, prop[p]); + break; + case 'string': + var property = Element.Properties.get(prop); + (property && property.set) ? property.set.apply(this, Array.slice(arguments, 1)) : this.setProperty(prop, value); + } + return this; + }, + + get: function(prop){ + var property = Element.Properties.get(prop); + return (property && property.get) ? property.get.apply(this, Array.slice(arguments, 1)) : this.getProperty(prop); + }, + + erase: function(prop){ + var property = Element.Properties.get(prop); + (property && property.erase) ? property.erase.apply(this) : this.removeProperty(prop); + return this; + }, + + setProperty: function(attribute, value){ + var key = attributes[attribute]; + if (value == undefined) return this.removeProperty(attribute); + if (key && bools[attribute]) value = !!value; + (key) ? this[key] = value : this.setAttribute(attribute, '' + value); + return this; + }, + + setProperties: function(attributes){ + for (var attribute in attributes) this.setProperty(attribute, attributes[attribute]); + return this; + }, + + getProperty: function(attribute){ + var key = attributes[attribute]; + var value = (key) ? this[key] : this.getAttribute(attribute, 2); + return (bools[attribute]) ? !!value : (key) ? value : value || null; + }, + + getProperties: function(){ + var args = $A(arguments); + return args.map(this.getProperty, this).associate(args); + }, + + removeProperty: function(attribute){ + var key = attributes[attribute]; + (key) ? this[key] = (key && bools[attribute]) ? false : '' : this.removeAttribute(attribute); + return this; + }, + + removeProperties: function(){ + Array.each(arguments, this.removeProperty, this); + return this; + }, + + hasClass: function(className){ + return this.className.contains(className, ' '); + }, + + addClass: function(className){ + if (!this.hasClass(className)) this.className = (this.className + ' ' + className).clean(); + return this; + }, + + removeClass: function(className){ + this.className = this.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)'), '$1'); + return this; + }, + + toggleClass: function(className){ + return this.hasClass(className) ? this.removeClass(className) : this.addClass(className); + }, + + adopt: function(){ + Array.flatten(arguments).each(function(element){ + element = document.id(element, true); + if (element) this.appendChild(element); + }, this); + return this; + }, + + appendText: function(text, where){ + return this.grab(this.getDocument().newTextNode(text), where); + }, + + grab: function(el, where){ + inserters[where || 'bottom'](document.id(el, true), this); + return this; + }, + + inject: function(el, where){ + inserters[where || 'bottom'](this, document.id(el, true)); + return this; + }, + + replaces: function(el){ + el = document.id(el, true); + el.parentNode.replaceChild(this, el); + return this; + }, + + wraps: function(el, where){ + el = document.id(el, true); + return this.replaces(el).grab(el, where); + }, + + getPrevious: function(match, nocash){ + return walk(this, 'previousSibling', null, match, false, nocash); + }, + + getAllPrevious: function(match, nocash){ + return walk(this, 'previousSibling', null, match, true, nocash); + }, + + getNext: function(match, nocash){ + return walk(this, 'nextSibling', null, match, false, nocash); + }, + + getAllNext: function(match, nocash){ + return walk(this, 'nextSibling', null, match, true, nocash); + }, + + getFirst: function(match, nocash){ + return walk(this, 'nextSibling', 'firstChild', match, false, nocash); + }, + + getLast: function(match, nocash){ + return walk(this, 'previousSibling', 'lastChild', match, false, nocash); + }, + + getParent: function(match, nocash){ + return walk(this, 'parentNode', null, match, false, nocash); + }, + + getParents: function(match, nocash){ + return walk(this, 'parentNode', null, match, true, nocash); + }, + + getSiblings: function(match, nocash){ + return this.getParent().getChildren(match, nocash).erase(this); + }, + + getChildren: function(match, nocash){ + return walk(this, 'nextSibling', 'firstChild', match, true, nocash); + }, + + getWindow: function(){ + return this.ownerDocument.window; + }, + + getDocument: function(){ + return this.ownerDocument; + }, + + getElementById: function(id, nocash){ + var el = this.ownerDocument.getElementById(id); + if (!el) return null; + for (var parent = el.parentNode; parent != this; parent = parent.parentNode){ + if (!parent) return null; + } + return document.id(el, nocash); + }, + + getSelected: function(){ + return new Elements($A(this.options).filter(function(option){ + return option.selected; + })); + }, + + getComputedStyle: function(property){ + if (this.currentStyle) return this.currentStyle[property.camelCase()]; + var computed = this.getDocument().defaultView.getComputedStyle(this, null); + return (computed) ? computed.getPropertyValue([property.hyphenate()]) : null; + }, + + toQueryString: function(){ + var queryString = []; + this.getElements('input, select, textarea', true).each(function(el){ + if (!el.name || el.disabled || el.type == 'submit' || el.type == 'reset' || el.type == 'file') return; + var value = (el.tagName.toLowerCase() == 'select') ? Element.getSelected(el).map(function(opt){ + return opt.value; + }) : ((el.type == 'radio' || el.type == 'checkbox') && !el.checked) ? null : el.value; + $splat(value).each(function(val){ + if (typeof val != 'undefined') queryString.push(el.name + '=' + encodeURIComponent(val)); + }); + }); + return queryString.join('&'); + }, + + clone: function(contents, keepid){ + contents = contents !== false; + var clone = this.cloneNode(contents); + var clean = function(node, element){ + if (!keepid) node.removeAttribute('id'); + if (Browser.Engine.trident){ + node.clearAttributes(); + node.mergeAttributes(element); + node.removeAttribute('uid'); + if (node.options){ + var no = node.options, eo = element.options; + for (var j = no.length; j--;) no[j].selected = eo[j].selected; + } + } + var prop = props[element.tagName.toLowerCase()]; + if (prop && element[prop]) node[prop] = element[prop]; + }; + + if (contents){ + var ce = clone.getElementsByTagName('*'), te = this.getElementsByTagName('*'); + for (var i = ce.length; i--;) clean(ce[i], te[i]); + } + + clean(clone, this); + return document.id(clone); + }, + + destroy: function(){ + Element.empty(this); + Element.dispose(this); + clean(this, true); + return null; + }, + + empty: function(){ + $A(this.childNodes).each(function(node){ + Element.destroy(node); + }); + return this; + }, + + dispose: function(){ + return (this.parentNode) ? this.parentNode.removeChild(this) : this; + }, + + hasChild: function(el){ + el = document.id(el, true); + if (!el) return false; + if (Browser.Engine.webkit && Browser.Engine.version < 420) return $A(this.getElementsByTagName(el.tagName)).contains(el); + return (this.contains) ? (this != el && this.contains(el)) : !!(this.compareDocumentPosition(el) & 16); + }, + + match: function(tag){ + return (!tag || (tag == this) || (Element.get(this, 'tag') == tag)); + } + +}); + +Native.implement([Element, Window, Document], { + + addListener: function(type, fn){ + if (type == 'unload'){ + var old = fn, self = this; + fn = function(){ + self.removeListener('unload', fn); + old(); + }; + } else { + collected[this.uid] = this; + } + if (this.addEventListener) this.addEventListener(type, fn, false); + else this.attachEvent('on' + type, fn); + return this; + }, + + removeListener: function(type, fn){ + if (this.removeEventListener) this.removeEventListener(type, fn, false); + else this.detachEvent('on' + type, fn); + return this; + }, + + retrieve: function(property, dflt){ + var storage = get(this.uid), prop = storage[property]; + if (dflt != undefined && prop == undefined) prop = storage[property] = dflt; + return $pick(prop); + }, + + store: function(property, value){ + var storage = get(this.uid); + storage[property] = value; + return this; + }, + + eliminate: function(property){ + var storage = get(this.uid); + delete storage[property]; + return this; + } + +}); + +window.addListener('unload', purge); + +})(); + +Element.Properties = new Hash; + +Element.Properties.style = { + + set: function(style){ + this.style.cssText = style; + }, + + get: function(){ + return this.style.cssText; + }, + + erase: function(){ + this.style.cssText = ''; + } + +}; + +Element.Properties.tag = { + + get: function(){ + return this.tagName.toLowerCase(); + } + +}; + +Element.Properties.html = (function(){ + var wrapper = document.createElement('div'); + + var translations = { + table: [1, '', '
    '], + select: [1, ''], + tbody: [2, '', '
    '], + tr: [3, '', '
    '] + }; + translations.thead = translations.tfoot = translations.tbody; + + var html = { + set: function(){ + var html = Array.flatten(arguments).join(''); + var wrap = Browser.Engine.trident && translations[this.get('tag')]; + if (wrap){ + var first = wrapper; + first.innerHTML = wrap[1] + html + wrap[2]; + for (var i = wrap[0]; i--;) first = first.firstChild; + this.empty().adopt(first.childNodes); + } else { + this.innerHTML = html; + } + } + }; + + html.erase = html.set; + + return html; +})(); + +if (Browser.Engine.webkit && Browser.Engine.version < 420) Element.Properties.text = { + get: function(){ + if (this.innerText) return this.innerText; + var temp = this.ownerDocument.newElement('div', {html: this.innerHTML}).inject(this.ownerDocument.body); + var text = temp.innerText; + temp.destroy(); + return text; + } +}; + + +/* +--- + +script: Element.Event.js + +description: Contains Element methods for dealing with events. This file also includes mouseenter and mouseleave custom Element Events. + +license: MIT-style license. + +requires: +- /Element +- /Event + +provides: [Element.Event] + +... +*/ + +Element.Properties.events = {set: function(events){ + this.addEvents(events); +}}; + +Native.implement([Element, Window, Document], { + + addEvent: function(type, fn){ + var events = this.retrieve('events', {}); + events[type] = events[type] || {'keys': [], 'values': []}; + if (events[type].keys.contains(fn)) return this; + events[type].keys.push(fn); + var realType = type, custom = Element.Events.get(type), condition = fn, self = this; + if (custom){ + if (custom.onAdd) custom.onAdd.call(this, fn); + if (custom.condition){ + condition = function(event){ + if (custom.condition.call(this, event)) return fn.call(this, event); + return true; + }; + } + realType = custom.base || realType; + } + var defn = function(){ + return fn.call(self); + }; + var nativeEvent = Element.NativeEvents[realType]; + if (nativeEvent){ + if (nativeEvent == 2){ + defn = function(event){ + event = new Event(event, self.getWindow()); + if (condition.call(self, event) === false) event.stop(); + }; + } + this.addListener(realType, defn); + } + events[type].values.push(defn); + return this; + }, + + removeEvent: function(type, fn){ + var events = this.retrieve('events'); + if (!events || !events[type]) return this; + var pos = events[type].keys.indexOf(fn); + if (pos == -1) return this; + events[type].keys.splice(pos, 1); + var value = events[type].values.splice(pos, 1)[0]; + var custom = Element.Events.get(type); + if (custom){ + if (custom.onRemove) custom.onRemove.call(this, fn); + type = custom.base || type; + } + return (Element.NativeEvents[type]) ? this.removeListener(type, value) : this; + }, + + addEvents: function(events){ + for (var event in events) this.addEvent(event, events[event]); + return this; + }, + + removeEvents: function(events){ + var type; + if ($type(events) == 'object'){ + for (type in events) this.removeEvent(type, events[type]); + return this; + } + var attached = this.retrieve('events'); + if (!attached) return this; + if (!events){ + for (type in attached) this.removeEvents(type); + this.eliminate('events'); + } else if (attached[events]){ + while (attached[events].keys[0]) this.removeEvent(events, attached[events].keys[0]); + attached[events] = null; + } + return this; + }, + + fireEvent: function(type, args, delay){ + var events = this.retrieve('events'); + if (!events || !events[type]) return this; + events[type].keys.each(function(fn){ + fn.create({'bind': this, 'delay': delay, 'arguments': args})(); + }, this); + return this; + }, + + cloneEvents: function(from, type){ + from = document.id(from); + var fevents = from.retrieve('events'); + if (!fevents) return this; + if (!type){ + for (var evType in fevents) this.cloneEvents(from, evType); + } else if (fevents[type]){ + fevents[type].keys.each(function(fn){ + this.addEvent(type, fn); + }, this); + } + return this; + } + +}); + +Element.NativeEvents = { + click: 2, dblclick: 2, mouseup: 2, mousedown: 2, contextmenu: 2, //mouse buttons + mousewheel: 2, DOMMouseScroll: 2, //mouse wheel + mouseover: 2, mouseout: 2, mousemove: 2, selectstart: 2, selectend: 2, //mouse movement + keydown: 2, keypress: 2, keyup: 2, //keyboard + focus: 2, blur: 2, change: 2, reset: 2, select: 2, submit: 2, //form elements + load: 1, unload: 1, beforeunload: 2, resize: 1, move: 1, DOMContentLoaded: 1, readystatechange: 1, //window + error: 1, abort: 1, scroll: 1 //misc +}; + +(function(){ + +var $check = function(event){ + var related = event.relatedTarget; + if (related == undefined) return true; + if (related === false) return false; + return ($type(this) != 'document' && related != this && related.prefix != 'xul' && !this.hasChild(related)); +}; + +Element.Events = new Hash({ + + mouseenter: { + base: 'mouseover', + condition: $check + }, + + mouseleave: { + base: 'mouseout', + condition: $check + }, + + mousewheel: { + base: (Browser.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel' + } + +}); + +})(); + + +/* +--- + +script: Element.Style.js + +description: Contains methods for interacting with the styles of Elements in a fashionable way. + +license: MIT-style license. + +requires: +- /Element + +provides: [Element.Style] + +... +*/ + +Element.Properties.styles = {set: function(styles){ + this.setStyles(styles); +}}; + +Element.Properties.opacity = { + + set: function(opacity, novisibility){ + if (!novisibility){ + if (opacity == 0){ + if (this.style.visibility != 'hidden') this.style.visibility = 'hidden'; + } else { + if (this.style.visibility != 'visible') this.style.visibility = 'visible'; + } + } + if (!this.currentStyle || !this.currentStyle.hasLayout) this.style.zoom = 1; + if (Browser.Engine.trident) this.style.filter = (opacity == 1) ? '' : 'alpha(opacity=' + opacity * 100 + ')'; + this.style.opacity = opacity; + this.store('opacity', opacity); + }, + + get: function(){ + return this.retrieve('opacity', 1); + } + +}; + +Element.implement({ + + setOpacity: function(value){ + return this.set('opacity', value, true); + }, + + getOpacity: function(){ + return this.get('opacity'); + }, + + setStyle: function(property, value){ + switch (property){ + case 'opacity': return this.set('opacity', parseFloat(value)); + case 'float': property = (Browser.Engine.trident) ? 'styleFloat' : 'cssFloat'; + } + property = property.camelCase(); + if ($type(value) != 'string'){ + var map = (Element.Styles.get(property) || '@').split(' '); + value = $splat(value).map(function(val, i){ + if (!map[i]) return ''; + return ($type(val) == 'number') ? map[i].replace('@', Math.round(val)) : val; + }).join(' '); + } else if (value == String(Number(value))){ + value = Math.round(value); + } + this.style[property] = value; + return this; + }, + + getStyle: function(property){ + switch (property){ + case 'opacity': return this.get('opacity'); + case 'float': property = (Browser.Engine.trident) ? 'styleFloat' : 'cssFloat'; + } + property = property.camelCase(); + var result = this.style[property]; + if (!$chk(result)){ + result = []; + for (var style in Element.ShortStyles){ + if (property != style) continue; + for (var s in Element.ShortStyles[style]) result.push(this.getStyle(s)); + return result.join(' '); + } + result = this.getComputedStyle(property); + } + if (result){ + result = String(result); + var color = result.match(/rgba?\([\d\s,]+\)/); + if (color) result = result.replace(color[0], color[0].rgbToHex()); + } + if (Browser.Engine.presto || (Browser.Engine.trident && !$chk(parseInt(result, 10)))){ + if (property.test(/^(height|width)$/)){ + var values = (property == 'width') ? ['left', 'right'] : ['top', 'bottom'], size = 0; + values.each(function(value){ + size += this.getStyle('border-' + value + '-width').toInt() + this.getStyle('padding-' + value).toInt(); + }, this); + return this['offset' + property.capitalize()] - size + 'px'; + } + if ((Browser.Engine.presto) && String(result).test('px')) return result; + if (property.test(/(border(.+)Width|margin|padding)/)) return '0px'; + } + return result; + }, + + setStyles: function(styles){ + for (var style in styles) this.setStyle(style, styles[style]); + return this; + }, + + getStyles: function(){ + var result = {}; + Array.flatten(arguments).each(function(key){ + result[key] = this.getStyle(key); + }, this); + return result; + } + +}); + +Element.Styles = new Hash({ + left: '@px', top: '@px', bottom: '@px', right: '@px', + width: '@px', height: '@px', maxWidth: '@px', maxHeight: '@px', minWidth: '@px', minHeight: '@px', + backgroundColor: 'rgb(@, @, @)', backgroundPosition: '@px @px', color: 'rgb(@, @, @)', + fontSize: '@px', letterSpacing: '@px', lineHeight: '@px', clip: 'rect(@px @px @px @px)', + margin: '@px @px @px @px', padding: '@px @px @px @px', border: '@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)', + borderWidth: '@px @px @px @px', borderStyle: '@ @ @ @', borderColor: 'rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)', + zIndex: '@', 'zoom': '@', fontWeight: '@', textIndent: '@px', opacity: '@' +}); + +Element.ShortStyles = {margin: {}, padding: {}, border: {}, borderWidth: {}, borderStyle: {}, borderColor: {}}; + +['Top', 'Right', 'Bottom', 'Left'].each(function(direction){ + var Short = Element.ShortStyles; + var All = Element.Styles; + ['margin', 'padding'].each(function(style){ + var sd = style + direction; + Short[style][sd] = All[sd] = '@px'; + }); + var bd = 'border' + direction; + Short.border[bd] = All[bd] = '@px @ rgb(@, @, @)'; + var bdw = bd + 'Width', bds = bd + 'Style', bdc = bd + 'Color'; + Short[bd] = {}; + Short.borderWidth[bdw] = Short[bd][bdw] = All[bdw] = '@px'; + Short.borderStyle[bds] = Short[bd][bds] = All[bds] = '@'; + Short.borderColor[bdc] = Short[bd][bdc] = All[bdc] = 'rgb(@, @, @)'; +}); + + +/* +--- + +script: Element.Dimensions.js + +description: Contains methods to work with size, scroll, or positioning of Elements and the window object. + +license: MIT-style license. + +credits: +- Element positioning based on the [qooxdoo](http://qooxdoo.org/) code and smart browser fixes, [LGPL License](http://www.gnu.org/licenses/lgpl.html). +- Viewport dimensions based on [YUI](http://developer.yahoo.com/yui/) code, [BSD License](http://developer.yahoo.com/yui/license.html). + +requires: +- /Element + +provides: [Element.Dimensions] + +... +*/ + +(function(){ + +Element.implement({ + + scrollTo: function(x, y){ + if (isBody(this)){ + this.getWindow().scrollTo(x, y); + } else { + this.scrollLeft = x; + this.scrollTop = y; + } + return this; + }, + + getSize: function(){ + if (isBody(this)) return this.getWindow().getSize(); + return {x: this.offsetWidth, y: this.offsetHeight}; + }, + + getScrollSize: function(){ + if (isBody(this)) return this.getWindow().getScrollSize(); + return {x: this.scrollWidth, y: this.scrollHeight}; + }, + + getScroll: function(){ + if (isBody(this)) return this.getWindow().getScroll(); + return {x: this.scrollLeft, y: this.scrollTop}; + }, + + getScrolls: function(){ + var element = this, position = {x: 0, y: 0}; + while (element && !isBody(element)){ + position.x += element.scrollLeft; + position.y += element.scrollTop; + element = element.parentNode; + } + return position; + }, + + getOffsetParent: function(){ + var element = this; + if (isBody(element)) return null; + if (!Browser.Engine.trident) return element.offsetParent; + while ((element = element.parentNode) && !isBody(element)){ + if (styleString(element, 'position') != 'static') return element; + } + return null; + }, + + getOffsets: function(){ + if (this.getBoundingClientRect){ + var bound = this.getBoundingClientRect(), + html = document.id(this.getDocument().documentElement), + htmlScroll = html.getScroll(), + elemScrolls = this.getScrolls(), + elemScroll = this.getScroll(), + isFixed = (styleString(this, 'position') == 'fixed'); + + return { + x: bound.left.toInt() + elemScrolls.x - elemScroll.x + ((isFixed) ? 0 : htmlScroll.x) - html.clientLeft, + y: bound.top.toInt() + elemScrolls.y - elemScroll.y + ((isFixed) ? 0 : htmlScroll.y) - html.clientTop + }; + } + + var element = this, position = {x: 0, y: 0}; + if (isBody(this)) return position; + + while (element && !isBody(element)){ + position.x += element.offsetLeft; + position.y += element.offsetTop; + + if (Browser.Engine.gecko){ + if (!borderBox(element)){ + position.x += leftBorder(element); + position.y += topBorder(element); + } + var parent = element.parentNode; + if (parent && styleString(parent, 'overflow') != 'visible'){ + position.x += leftBorder(parent); + position.y += topBorder(parent); + } + } else if (element != this && Browser.Engine.webkit){ + position.x += leftBorder(element); + position.y += topBorder(element); + } + + element = element.offsetParent; + } + if (Browser.Engine.gecko && !borderBox(this)){ + position.x -= leftBorder(this); + position.y -= topBorder(this); + } + return position; + }, + + getPosition: function(relative){ + if (isBody(this)) return {x: 0, y: 0}; + var offset = this.getOffsets(), + scroll = this.getScrolls(); + var position = { + x: offset.x - scroll.x, + y: offset.y - scroll.y + }; + var relativePosition = (relative && (relative = document.id(relative))) ? relative.getPosition() : {x: 0, y: 0}; + return {x: position.x - relativePosition.x, y: position.y - relativePosition.y}; + }, + + getCoordinates: function(element){ + if (isBody(this)) return this.getWindow().getCoordinates(); + var position = this.getPosition(element), + size = this.getSize(); + var obj = { + left: position.x, + top: position.y, + width: size.x, + height: size.y + }; + obj.right = obj.left + obj.width; + obj.bottom = obj.top + obj.height; + return obj; + }, + + computePosition: function(obj){ + return { + left: obj.x - styleNumber(this, 'margin-left'), + top: obj.y - styleNumber(this, 'margin-top') + }; + }, + + setPosition: function(obj){ + return this.setStyles(this.computePosition(obj)); + } + +}); + + +Native.implement([Document, Window], { + + getSize: function(){ + if (Browser.Engine.presto || Browser.Engine.webkit){ + var win = this.getWindow(); + return {x: win.innerWidth, y: win.innerHeight}; + } + var doc = getCompatElement(this); + return {x: doc.clientWidth, y: doc.clientHeight}; + }, + + getScroll: function(){ + var win = this.getWindow(), doc = getCompatElement(this); + return {x: win.pageXOffset || doc.scrollLeft, y: win.pageYOffset || doc.scrollTop}; + }, + + getScrollSize: function(){ + var doc = getCompatElement(this), min = this.getSize(); + return {x: Math.max(doc.scrollWidth, min.x), y: Math.max(doc.scrollHeight, min.y)}; + }, + + getPosition: function(){ + return {x: 0, y: 0}; + }, + + getCoordinates: function(){ + var size = this.getSize(); + return {top: 0, left: 0, bottom: size.y, right: size.x, height: size.y, width: size.x}; + } + +}); + +// private methods + +var styleString = Element.getComputedStyle; + +function styleNumber(element, style){ + return styleString(element, style).toInt() || 0; +}; + +function borderBox(element){ + return styleString(element, '-moz-box-sizing') == 'border-box'; +}; + +function topBorder(element){ + return styleNumber(element, 'border-top-width'); +}; + +function leftBorder(element){ + return styleNumber(element, 'border-left-width'); +}; + +function isBody(element){ + return (/^(?:body|html)$/i).test(element.tagName); +}; + +function getCompatElement(element){ + var doc = element.getDocument(); + return (!doc.compatMode || doc.compatMode == 'CSS1Compat') ? doc.html : doc.body; +}; + +})(); + +//aliases +Element.alias('setPosition', 'position'); //compatability + +Native.implement([Window, Document, Element], { + + getHeight: function(){ + return this.getSize().y; + }, + + getWidth: function(){ + return this.getSize().x; + }, + + getScrollTop: function(){ + return this.getScroll().y; + }, + + getScrollLeft: function(){ + return this.getScroll().x; + }, + + getScrollHeight: function(){ + return this.getScrollSize().y; + }, + + getScrollWidth: function(){ + return this.getScrollSize().x; + }, + + getTop: function(){ + return this.getPosition().y; + }, + + getLeft: function(){ + return this.getPosition().x; + } + +}); + + +/* +--- + +script: Selectors.js + +description: Adds advanced CSS-style querying capabilities for targeting HTML Elements. Includes pseudo selectors. + +license: MIT-style license. + +requires: +- /Element + +provides: [Selectors] + +... +*/ + +Native.implement([Document, Element], { + + getElements: function(expression, nocash){ + expression = expression.split(','); + var items, local = {}; + for (var i = 0, l = expression.length; i < l; i++){ + var selector = expression[i], elements = Selectors.Utils.search(this, selector, local); + if (i != 0 && elements.item) elements = $A(elements); + items = (i == 0) ? elements : (items.item) ? $A(items).concat(elements) : items.concat(elements); + } + return new Elements(items, {ddup: (expression.length > 1), cash: !nocash}); + } + +}); + +Element.implement({ + + match: function(selector){ + if (!selector || (selector == this)) return true; + var tagid = Selectors.Utils.parseTagAndID(selector); + var tag = tagid[0], id = tagid[1]; + if (!Selectors.Filters.byID(this, id) || !Selectors.Filters.byTag(this, tag)) return false; + var parsed = Selectors.Utils.parseSelector(selector); + return (parsed) ? Selectors.Utils.filter(this, parsed, {}) : true; + } + +}); + +var Selectors = {Cache: {nth: {}, parsed: {}}}; + +Selectors.RegExps = { + id: (/#([\w-]+)/), + tag: (/^(\w+|\*)/), + quick: (/^(\w+|\*)$/), + splitter: (/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g), + combined: (/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g) +}; + +Selectors.Utils = { + + chk: function(item, uniques){ + if (!uniques) return true; + var uid = $uid(item); + if (!uniques[uid]) return uniques[uid] = true; + return false; + }, + + parseNthArgument: function(argument){ + if (Selectors.Cache.nth[argument]) return Selectors.Cache.nth[argument]; + var parsed = argument.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/); + if (!parsed) return false; + var inta = parseInt(parsed[1], 10); + var a = (inta || inta === 0) ? inta : 1; + var special = parsed[2] || false; + var b = parseInt(parsed[3], 10) || 0; + if (a != 0){ + b--; + while (b < 1) b += a; + while (b >= a) b -= a; + } else { + a = b; + special = 'index'; + } + switch (special){ + case 'n': parsed = {a: a, b: b, special: 'n'}; break; + case 'odd': parsed = {a: 2, b: 0, special: 'n'}; break; + case 'even': parsed = {a: 2, b: 1, special: 'n'}; break; + case 'first': parsed = {a: 0, special: 'index'}; break; + case 'last': parsed = {special: 'last-child'}; break; + case 'only': parsed = {special: 'only-child'}; break; + default: parsed = {a: (a - 1), special: 'index'}; + } + + return Selectors.Cache.nth[argument] = parsed; + }, + + parseSelector: function(selector){ + if (Selectors.Cache.parsed[selector]) return Selectors.Cache.parsed[selector]; + var m, parsed = {classes: [], pseudos: [], attributes: []}; + while ((m = Selectors.RegExps.combined.exec(selector))){ + var cn = m[1], an = m[2], ao = m[3], av = m[5], pn = m[6], pa = m[7]; + if (cn){ + parsed.classes.push(cn); + } else if (pn){ + var parser = Selectors.Pseudo.get(pn); + if (parser) parsed.pseudos.push({parser: parser, argument: pa}); + else parsed.attributes.push({name: pn, operator: '=', value: pa}); + } else if (an){ + parsed.attributes.push({name: an, operator: ao, value: av}); + } + } + if (!parsed.classes.length) delete parsed.classes; + if (!parsed.attributes.length) delete parsed.attributes; + if (!parsed.pseudos.length) delete parsed.pseudos; + if (!parsed.classes && !parsed.attributes && !parsed.pseudos) parsed = null; + return Selectors.Cache.parsed[selector] = parsed; + }, + + parseTagAndID: function(selector){ + var tag = selector.match(Selectors.RegExps.tag); + var id = selector.match(Selectors.RegExps.id); + return [(tag) ? tag[1] : '*', (id) ? id[1] : false]; + }, + + filter: function(item, parsed, local){ + var i; + if (parsed.classes){ + for (i = parsed.classes.length; i--; i){ + var cn = parsed.classes[i]; + if (!Selectors.Filters.byClass(item, cn)) return false; + } + } + if (parsed.attributes){ + for (i = parsed.attributes.length; i--; i){ + var att = parsed.attributes[i]; + if (!Selectors.Filters.byAttribute(item, att.name, att.operator, att.value)) return false; + } + } + if (parsed.pseudos){ + for (i = parsed.pseudos.length; i--; i){ + var psd = parsed.pseudos[i]; + if (!Selectors.Filters.byPseudo(item, psd.parser, psd.argument, local)) return false; + } + } + return true; + }, + + getByTagAndID: function(ctx, tag, id){ + if (id){ + var item = (ctx.getElementById) ? ctx.getElementById(id, true) : Element.getElementById(ctx, id, true); + return (item && Selectors.Filters.byTag(item, tag)) ? [item] : []; + } else { + return ctx.getElementsByTagName(tag); + } + }, + + search: function(self, expression, local){ + var splitters = []; + + var selectors = expression.trim().replace(Selectors.RegExps.splitter, function(m0, m1, m2){ + splitters.push(m1); + return ':)' + m2; + }).split(':)'); + + var items, filtered, item; + + for (var i = 0, l = selectors.length; i < l; i++){ + + var selector = selectors[i]; + + if (i == 0 && Selectors.RegExps.quick.test(selector)){ + items = self.getElementsByTagName(selector); + continue; + } + + var splitter = splitters[i - 1]; + + var tagid = Selectors.Utils.parseTagAndID(selector); + var tag = tagid[0], id = tagid[1]; + + if (i == 0){ + items = Selectors.Utils.getByTagAndID(self, tag, id); + } else { + var uniques = {}, found = []; + for (var j = 0, k = items.length; j < k; j++) found = Selectors.Getters[splitter](found, items[j], tag, id, uniques); + items = found; + } + + var parsed = Selectors.Utils.parseSelector(selector); + + if (parsed){ + filtered = []; + for (var m = 0, n = items.length; m < n; m++){ + item = items[m]; + if (Selectors.Utils.filter(item, parsed, local)) filtered.push(item); + } + items = filtered; + } + + } + + return items; + + } + +}; + +Selectors.Getters = { + + ' ': function(found, self, tag, id, uniques){ + var items = Selectors.Utils.getByTagAndID(self, tag, id); + for (var i = 0, l = items.length; i < l; i++){ + var item = items[i]; + if (Selectors.Utils.chk(item, uniques)) found.push(item); + } + return found; + }, + + '>': function(found, self, tag, id, uniques){ + var children = Selectors.Utils.getByTagAndID(self, tag, id); + for (var i = 0, l = children.length; i < l; i++){ + var child = children[i]; + if (child.parentNode == self && Selectors.Utils.chk(child, uniques)) found.push(child); + } + return found; + }, + + '+': function(found, self, tag, id, uniques){ + while ((self = self.nextSibling)){ + if (self.nodeType == 1){ + if (Selectors.Utils.chk(self, uniques) && Selectors.Filters.byTag(self, tag) && Selectors.Filters.byID(self, id)) found.push(self); + break; + } + } + return found; + }, + + '~': function(found, self, tag, id, uniques){ + while ((self = self.nextSibling)){ + if (self.nodeType == 1){ + if (!Selectors.Utils.chk(self, uniques)) break; + if (Selectors.Filters.byTag(self, tag) && Selectors.Filters.byID(self, id)) found.push(self); + } + } + return found; + } + +}; + +Selectors.Filters = { + + byTag: function(self, tag){ + return (tag == '*' || (self.tagName && self.tagName.toLowerCase() == tag)); + }, + + byID: function(self, id){ + return (!id || (self.id && self.id == id)); + }, + + byClass: function(self, klass){ + return (self.className && self.className.contains && self.className.contains(klass, ' ')); + }, + + byPseudo: function(self, parser, argument, local){ + return parser.call(self, argument, local); + }, + + byAttribute: function(self, name, operator, value){ + var result = Element.prototype.getProperty.call(self, name); + if (!result) return (operator == '!='); + if (!operator || value == undefined) return true; + switch (operator){ + case '=': return (result == value); + case '*=': return (result.contains(value)); + case '^=': return (result.substr(0, value.length) == value); + case '$=': return (result.substr(result.length - value.length) == value); + case '!=': return (result != value); + case '~=': return result.contains(value, ' '); + case '|=': return result.contains(value, '-'); + } + return false; + } + +}; + +Selectors.Pseudo = new Hash({ + + // w3c pseudo selectors + + checked: function(){ + return this.checked; + }, + + empty: function(){ + return !(this.innerText || this.textContent || '').length; + }, + + not: function(selector){ + return !Element.match(this, selector); + }, + + contains: function(text){ + return (this.innerText || this.textContent || '').contains(text); + }, + + 'first-child': function(){ + return Selectors.Pseudo.index.call(this, 0); + }, + + 'last-child': function(){ + var element = this; + while ((element = element.nextSibling)){ + if (element.nodeType == 1) return false; + } + return true; + }, + + 'only-child': function(){ + var prev = this; + while ((prev = prev.previousSibling)){ + if (prev.nodeType == 1) return false; + } + var next = this; + while ((next = next.nextSibling)){ + if (next.nodeType == 1) return false; + } + return true; + }, + + 'nth-child': function(argument, local){ + argument = (argument == undefined) ? 'n' : argument; + var parsed = Selectors.Utils.parseNthArgument(argument); + if (parsed.special != 'n') return Selectors.Pseudo[parsed.special].call(this, parsed.a, local); + var count = 0; + local.positions = local.positions || {}; + var uid = $uid(this); + if (!local.positions[uid]){ + var self = this; + while ((self = self.previousSibling)){ + if (self.nodeType != 1) continue; + count ++; + var position = local.positions[$uid(self)]; + if (position != undefined){ + count = position + count; + break; + } + } + local.positions[uid] = count; + } + return (local.positions[uid] % parsed.a == parsed.b); + }, + + // custom pseudo selectors + + index: function(index){ + var element = this, count = 0; + while ((element = element.previousSibling)){ + if (element.nodeType == 1 && ++count > index) return false; + } + return (count == index); + }, + + even: function(argument, local){ + return Selectors.Pseudo['nth-child'].call(this, '2n+1', local); + }, + + odd: function(argument, local){ + return Selectors.Pseudo['nth-child'].call(this, '2n', local); + }, + + selected: function(){ + return this.selected; + }, + + enabled: function(){ + return (this.disabled === false); + } + +}); + + +/* +--- + +script: DomReady.js + +description: Contains the custom event domready. + +license: MIT-style license. + +requires: +- /Element.Event + +provides: [DomReady] + +... +*/ + +Element.Events.domready = { + + onAdd: function(fn){ + if (Browser.loaded) fn.call(this); + } + +}; + +(function(){ + + var domready = function(){ + if (Browser.loaded) return; + Browser.loaded = true; + window.fireEvent('domready'); + document.fireEvent('domready'); + }; + + window.addEvent('load', domready); + + if (Browser.Engine.trident){ + var temp = document.createElement('div'); + (function(){ + ($try(function(){ + temp.doScroll(); // Technique by Diego Perini + return document.id(temp).inject(document.body).set('html', 'temp').dispose(); + })) ? domready() : arguments.callee.delay(50); + })(); + } else if (Browser.Engine.webkit && Browser.Engine.version < 525){ + (function(){ + (['loaded', 'complete'].contains(document.readyState)) ? domready() : arguments.callee.delay(50); + })(); + } else { + document.addEvent('DOMContentLoaded', domready); + } + +})(); + + +/* +--- + +script: JSON.js + +description: JSON encoder and decoder. + +license: MIT-style license. + +See Also: + +requires: +- /Array +- /String +- /Number +- /Function +- /Hash + +provides: [JSON] + +... +*/ + +var JSON = new Hash(this.JSON && { + stringify: JSON.stringify, + parse: JSON.parse +}).extend({ + + $specialChars: {'\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"' : '\\"', '\\': '\\\\'}, + + $replaceChars: function(chr){ + return JSON.$specialChars[chr] || '\\u00' + Math.floor(chr.charCodeAt() / 16).toString(16) + (chr.charCodeAt() % 16).toString(16); + }, + + encode: function(obj){ + switch ($type(obj)){ + case 'string': + return '"' + obj.replace(/[\x00-\x1f\\"]/g, JSON.$replaceChars) + '"'; + case 'array': + return '[' + String(obj.map(JSON.encode).clean()) + ']'; + case 'object': case 'hash': + var string = []; + Hash.each(obj, function(value, key){ + var json = JSON.encode(value); + if (json) string.push(JSON.encode(key) + ':' + json); + }); + return '{' + string + '}'; + case 'number': case 'boolean': return String(obj); + case false: return 'null'; + } + return null; + }, + + decode: function(string, secure){ + if ($type(string) != 'string' || !string.length) return null; + if (secure && !(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''))) return null; + return eval('(' + string + ')'); + } + +}); + +Native.implement([Hash, Array, String, Number], { + + toJSON: function(){ + return JSON.encode(this); + } + +}); + + +/* +--- + +script: Cookie.js + +description: Class for creating, reading, and deleting browser Cookies. + +license: MIT-style license. + +credits: +- Based on the functions by Peter-Paul Koch (http://quirksmode.org). + +requires: +- /Options + +provides: [Cookie] + +... +*/ + +var Cookie = new Class({ + + Implements: Options, + + options: { + path: false, + domain: false, + duration: false, + secure: false, + document: document + }, + + initialize: function(key, options){ + this.key = key; + this.setOptions(options); + }, + + write: function(value){ + value = encodeURIComponent(value); + if (this.options.domain) value += '; domain=' + this.options.domain; + if (this.options.path) value += '; path=' + this.options.path; + if (this.options.duration){ + var date = new Date(); + date.setTime(date.getTime() + this.options.duration * 24 * 60 * 60 * 1000); + value += '; expires=' + date.toGMTString(); + } + if (this.options.secure) value += '; secure'; + this.options.document.cookie = this.key + '=' + value; + return this; + }, + + read: function(){ + var value = this.options.document.cookie.match('(?:^|;)\\s*' + this.key.escapeRegExp() + '=([^;]*)'); + return (value) ? decodeURIComponent(value[1]) : null; + }, + + dispose: function(){ + new Cookie(this.key, $merge(this.options, {duration: -1})).write(''); + return this; + } + +}); + +Cookie.write = function(key, value, options){ + return new Cookie(key, options).write(value); +}; + +Cookie.read = function(key){ + return new Cookie(key).read(); +}; + +Cookie.dispose = function(key, options){ + return new Cookie(key, options).dispose(); +}; + + +/* +--- + +script: Swiff.js + +description: Wrapper for embedding SWF movies. Supports External Interface Communication. + +license: MIT-style license. + +credits: +- Flash detection & Internet Explorer + Flash Player 9 fix inspired by SWFObject. + +requires: +- /Options +- /$util + +provides: [Swiff] + +... +*/ + +var Swiff = new Class({ + + Implements: [Options], + + options: { + id: null, + height: 1, + width: 1, + container: null, + properties: {}, + params: { + quality: 'high', + allowScriptAccess: 'always', + wMode: 'transparent', + swLiveConnect: true + }, + callBacks: {}, + vars: {} + }, + + toElement: function(){ + return this.object; + }, + + initialize: function(path, options){ + this.instance = 'Swiff_' + $time(); + + this.setOptions(options); + options = this.options; + var id = this.id = options.id || this.instance; + var container = document.id(options.container); + + Swiff.CallBacks[this.instance] = {}; + + var params = options.params, vars = options.vars, callBacks = options.callBacks; + var properties = $extend({height: options.height, width: options.width}, options.properties); + + var self = this; + + for (var callBack in callBacks){ + Swiff.CallBacks[this.instance][callBack] = (function(option){ + return function(){ + return option.apply(self.object, arguments); + }; + })(callBacks[callBack]); + vars[callBack] = 'Swiff.CallBacks.' + this.instance + '.' + callBack; + } + + params.flashVars = Hash.toQueryString(vars); + if (Browser.Engine.trident){ + properties.classid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; + params.movie = path; + } else { + properties.type = 'application/x-shockwave-flash'; + properties.data = path; + } + var build = ''; + } + build += ''; + this.object = ((container) ? container.empty() : new Element('div')).set('html', build).firstChild; + }, + + replaces: function(element){ + element = document.id(element, true); + element.parentNode.replaceChild(this.toElement(), element); + return this; + }, + + inject: function(element){ + document.id(element, true).appendChild(this.toElement()); + return this; + }, + + remote: function(){ + return Swiff.remote.apply(Swiff, [this.toElement()].extend(arguments)); + } + +}); + +Swiff.CallBacks = {}; + +Swiff.remote = function(obj, fn){ + var rs = obj.CallFunction('' + __flash__argumentsToXML(arguments, 2) + ''); + return eval(rs); +}; + + +/* +--- + +script: Fx.js + +description: Contains the basic animation logic to be extended by all other Fx Classes. + +license: MIT-style license. + +requires: +- /Chain +- /Events +- /Options + +provides: [Fx] + +... +*/ + +var Fx = new Class({ + + Implements: [Chain, Events, Options], + + options: { + /* + onStart: $empty, + onCancel: $empty, + onComplete: $empty, + */ + fps: 50, + unit: false, + duration: 500, + link: 'ignore' + }, + + initialize: function(options){ + this.subject = this.subject || this; + this.setOptions(options); + this.options.duration = Fx.Durations[this.options.duration] || this.options.duration.toInt(); + var wait = this.options.wait; + if (wait === false) this.options.link = 'cancel'; + }, + + getTransition: function(){ + return function(p){ + return -(Math.cos(Math.PI * p) - 1) / 2; + }; + }, + + step: function(){ + var time = $time(); + if (time < this.time + this.options.duration){ + var delta = this.transition((time - this.time) / this.options.duration); + this.set(this.compute(this.from, this.to, delta)); + } else { + this.set(this.compute(this.from, this.to, 1)); + this.complete(); + } + }, + + set: function(now){ + return now; + }, + + compute: function(from, to, delta){ + return Fx.compute(from, to, delta); + }, + + check: function(){ + if (!this.timer) return true; + switch (this.options.link){ + case 'cancel': this.cancel(); return true; + case 'chain': this.chain(this.caller.bind(this, arguments)); return false; + } + return false; + }, + + start: function(from, to){ + if (!this.check(from, to)) return this; + this.from = from; + this.to = to; + this.time = 0; + this.transition = this.getTransition(); + this.startTimer(); + this.onStart(); + return this; + }, + + complete: function(){ + if (this.stopTimer()) this.onComplete(); + return this; + }, + + cancel: function(){ + if (this.stopTimer()) this.onCancel(); + return this; + }, + + onStart: function(){ + this.fireEvent('start', this.subject); + }, + + onComplete: function(){ + this.fireEvent('complete', this.subject); + if (!this.callChain()) this.fireEvent('chainComplete', this.subject); + }, + + onCancel: function(){ + this.fireEvent('cancel', this.subject).clearChain(); + }, + + pause: function(){ + this.stopTimer(); + return this; + }, + + resume: function(){ + this.startTimer(); + return this; + }, + + stopTimer: function(){ + if (!this.timer) return false; + this.time = $time() - this.time; + this.timer = $clear(this.timer); + return true; + }, + + startTimer: function(){ + if (this.timer) return false; + this.time = $time() - this.time; + this.timer = this.step.periodical(Math.round(1000 / this.options.fps), this); + return true; + } + +}); + +Fx.compute = function(from, to, delta){ + return (to - from) * delta + from; +}; + +Fx.Durations = {'short': 250, 'normal': 500, 'long': 1000}; + + +/* +--- + +script: Fx.CSS.js + +description: Contains the CSS animation logic. Used by Fx.Tween, Fx.Morph, Fx.Elements. + +license: MIT-style license. + +requires: +- /Fx +- /Element.Style + +provides: [Fx.CSS] + +... +*/ + +Fx.CSS = new Class({ + + Extends: Fx, + + //prepares the base from/to object + + prepare: function(element, property, values){ + values = $splat(values); + var values1 = values[1]; + if (!$chk(values1)){ + values[1] = values[0]; + values[0] = element.getStyle(property); + } + var parsed = values.map(this.parse); + return {from: parsed[0], to: parsed[1]}; + }, + + //parses a value into an array + + parse: function(value){ + value = $lambda(value)(); + value = (typeof value == 'string') ? value.split(' ') : $splat(value); + return value.map(function(val){ + val = String(val); + var found = false; + Fx.CSS.Parsers.each(function(parser, key){ + if (found) return; + var parsed = parser.parse(val); + if ($chk(parsed)) found = {value: parsed, parser: parser}; + }); + found = found || {value: val, parser: Fx.CSS.Parsers.String}; + return found; + }); + }, + + //computes by a from and to prepared objects, using their parsers. + + compute: function(from, to, delta){ + var computed = []; + (Math.min(from.length, to.length)).times(function(i){ + computed.push({value: from[i].parser.compute(from[i].value, to[i].value, delta), parser: from[i].parser}); + }); + computed.$family = {name: 'fx:css:value'}; + return computed; + }, + + //serves the value as settable + + serve: function(value, unit){ + if ($type(value) != 'fx:css:value') value = this.parse(value); + var returned = []; + value.each(function(bit){ + returned = returned.concat(bit.parser.serve(bit.value, unit)); + }); + return returned; + }, + + //renders the change to an element + + render: function(element, property, value, unit){ + element.setStyle(property, this.serve(value, unit)); + }, + + //searches inside the page css to find the values for a selector + + search: function(selector){ + if (Fx.CSS.Cache[selector]) return Fx.CSS.Cache[selector]; + var to = {}; + Array.each(document.styleSheets, function(sheet, j){ + var href = sheet.href; + if (href && href.contains('://') && !href.contains(document.domain)) return; + var rules = sheet.rules || sheet.cssRules; + Array.each(rules, function(rule, i){ + if (!rule.style) return; + var selectorText = (rule.selectorText) ? rule.selectorText.replace(/^\w+/, function(m){ + return m.toLowerCase(); + }) : null; + if (!selectorText || !selectorText.test('^' + selector + '$')) return; + Element.Styles.each(function(value, style){ + if (!rule.style[style] || Element.ShortStyles[style]) return; + value = String(rule.style[style]); + to[style] = (value.test(/^rgb/)) ? value.rgbToHex() : value; + }); + }); + }); + return Fx.CSS.Cache[selector] = to; + } + +}); + +Fx.CSS.Cache = {}; + +Fx.CSS.Parsers = new Hash({ + + Color: { + parse: function(value){ + if (value.match(/^#[0-9a-f]{3,6}$/i)) return value.hexToRgb(true); + return ((value = value.match(/(\d+),\s*(\d+),\s*(\d+)/))) ? [value[1], value[2], value[3]] : false; + }, + compute: function(from, to, delta){ + return from.map(function(value, i){ + return Math.round(Fx.compute(from[i], to[i], delta)); + }); + }, + serve: function(value){ + return value.map(Number); + } + }, + + Number: { + parse: parseFloat, + compute: Fx.compute, + serve: function(value, unit){ + return (unit) ? value + unit : value; + } + }, + + String: { + parse: $lambda(false), + compute: $arguments(1), + serve: $arguments(0) + } + +}); + + +/* +--- + +script: Fx.Tween.js + +description: Formerly Fx.Style, effect to transition any CSS property for an element. + +license: MIT-style license. + +requires: +- /Fx.CSS + +provides: [Fx.Tween, Element.fade, Element.highlight] + +... +*/ + +Fx.Tween = new Class({ + + Extends: Fx.CSS, + + initialize: function(element, options){ + this.element = this.subject = document.id(element); + this.parent(options); + }, + + set: function(property, now){ + if (arguments.length == 1){ + now = property; + property = this.property || this.options.property; + } + this.render(this.element, property, now, this.options.unit); + return this; + }, + + start: function(property, from, to){ + if (!this.check(property, from, to)) return this; + var args = Array.flatten(arguments); + this.property = this.options.property || args.shift(); + var parsed = this.prepare(this.element, this.property, args); + return this.parent(parsed.from, parsed.to); + } + +}); + +Element.Properties.tween = { + + set: function(options){ + var tween = this.retrieve('tween'); + if (tween) tween.cancel(); + return this.eliminate('tween').store('tween:options', $extend({link: 'cancel'}, options)); + }, + + get: function(options){ + if (options || !this.retrieve('tween')){ + if (options || !this.retrieve('tween:options')) this.set('tween', options); + this.store('tween', new Fx.Tween(this, this.retrieve('tween:options'))); + } + return this.retrieve('tween'); + } + +}; + +Element.implement({ + + tween: function(property, from, to){ + this.get('tween').start(arguments); + return this; + }, + + fade: function(how){ + var fade = this.get('tween'), o = 'opacity', toggle; + how = $pick(how, 'toggle'); + switch (how){ + case 'in': fade.start(o, 1); break; + case 'out': fade.start(o, 0); break; + case 'show': fade.set(o, 1); break; + case 'hide': fade.set(o, 0); break; + case 'toggle': + var flag = this.retrieve('fade:flag', this.get('opacity') == 1); + fade.start(o, (flag) ? 0 : 1); + this.store('fade:flag', !flag); + toggle = true; + break; + default: fade.start(o, arguments); + } + if (!toggle) this.eliminate('fade:flag'); + return this; + }, + + highlight: function(start, end){ + if (!end){ + end = this.retrieve('highlight:original', this.getStyle('background-color')); + end = (end == 'transparent') ? '#fff' : end; + } + var tween = this.get('tween'); + tween.start('background-color', start || '#ffff88', end).chain(function(){ + this.setStyle('background-color', this.retrieve('highlight:original')); + tween.callChain(); + }.bind(this)); + return this; + } + +}); + + +/* +--- + +script: Fx.Morph.js + +description: Formerly Fx.Styles, effect to transition any number of CSS properties for an element using an object of rules, or CSS based selector rules. + +license: MIT-style license. + +requires: +- /Fx.CSS + +provides: [Fx.Morph] + +... +*/ + +Fx.Morph = new Class({ + + Extends: Fx.CSS, + + initialize: function(element, options){ + this.element = this.subject = document.id(element); + this.parent(options); + }, + + set: function(now){ + if (typeof now == 'string') now = this.search(now); + for (var p in now) this.render(this.element, p, now[p], this.options.unit); + return this; + }, + + compute: function(from, to, delta){ + var now = {}; + for (var p in from) now[p] = this.parent(from[p], to[p], delta); + return now; + }, + + start: function(properties){ + if (!this.check(properties)) return this; + if (typeof properties == 'string') properties = this.search(properties); + var from = {}, to = {}; + for (var p in properties){ + var parsed = this.prepare(this.element, p, properties[p]); + from[p] = parsed.from; + to[p] = parsed.to; + } + return this.parent(from, to); + } + +}); + +Element.Properties.morph = { + + set: function(options){ + var morph = this.retrieve('morph'); + if (morph) morph.cancel(); + return this.eliminate('morph').store('morph:options', $extend({link: 'cancel'}, options)); + }, + + get: function(options){ + if (options || !this.retrieve('morph')){ + if (options || !this.retrieve('morph:options')) this.set('morph', options); + this.store('morph', new Fx.Morph(this, this.retrieve('morph:options'))); + } + return this.retrieve('morph'); + } + +}; + +Element.implement({ + + morph: function(props){ + this.get('morph').start(props); + return this; + } + +}); + + +/* +--- + +script: Fx.Transitions.js + +description: Contains a set of advanced transitions to be used with any of the Fx Classes. + +license: MIT-style license. + +credits: +- Easing Equations by Robert Penner, , modified and optimized to be used with MooTools. + +requires: +- /Fx + +provides: [Fx.Transitions] + +... +*/ + +Fx.implement({ + + getTransition: function(){ + var trans = this.options.transition || Fx.Transitions.Sine.easeInOut; + if (typeof trans == 'string'){ + var data = trans.split(':'); + trans = Fx.Transitions; + trans = trans[data[0]] || trans[data[0].capitalize()]; + if (data[1]) trans = trans['ease' + data[1].capitalize() + (data[2] ? data[2].capitalize() : '')]; + } + return trans; + } + +}); + +Fx.Transition = function(transition, params){ + params = $splat(params); + return $extend(transition, { + easeIn: function(pos){ + return transition(pos, params); + }, + easeOut: function(pos){ + return 1 - transition(1 - pos, params); + }, + easeInOut: function(pos){ + return (pos <= 0.5) ? transition(2 * pos, params) / 2 : (2 - transition(2 * (1 - pos), params)) / 2; + } + }); +}; + +Fx.Transitions = new Hash({ + + linear: $arguments(0) + +}); + +Fx.Transitions.extend = function(transitions){ + for (var transition in transitions) Fx.Transitions[transition] = new Fx.Transition(transitions[transition]); +}; + +Fx.Transitions.extend({ + + Pow: function(p, x){ + return Math.pow(p, x[0] || 6); + }, + + Expo: function(p){ + return Math.pow(2, 8 * (p - 1)); + }, + + Circ: function(p){ + return 1 - Math.sin(Math.acos(p)); + }, + + Sine: function(p){ + return 1 - Math.sin((1 - p) * Math.PI / 2); + }, + + Back: function(p, x){ + x = x[0] || 1.618; + return Math.pow(p, 2) * ((x + 1) * p - x); + }, + + Bounce: function(p){ + var value; + for (var a = 0, b = 1; 1; a += b, b /= 2){ + if (p >= (7 - 4 * a) / 11){ + value = b * b - Math.pow((11 - 6 * a - 11 * p) / 4, 2); + break; + } + } + return value; + }, + + Elastic: function(p, x){ + return Math.pow(2, 10 * --p) * Math.cos(20 * p * Math.PI * (x[0] || 1) / 3); + } + +}); + +['Quad', 'Cubic', 'Quart', 'Quint'].each(function(transition, i){ + Fx.Transitions[transition] = new Fx.Transition(function(p){ + return Math.pow(p, [i + 2]); + }); +}); + + +/* +--- + +script: Request.js + +description: Powerful all purpose Request Class. Uses XMLHTTPRequest. + +license: MIT-style license. + +requires: +- /Element +- /Chain +- /Events +- /Options +- /Browser + +provides: [Request] + +... +*/ + +var Request = new Class({ + + Implements: [Chain, Events, Options], + + options: {/* + onRequest: $empty, + onComplete: $empty, + onCancel: $empty, + onSuccess: $empty, + onFailure: $empty, + onException: $empty,*/ + url: '', + data: '', + headers: { + 'X-Requested-With': 'XMLHttpRequest', + 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' + }, + async: true, + format: false, + method: 'post', + link: 'ignore', + isSuccess: null, + emulation: true, + urlEncoded: true, + encoding: 'utf-8', + evalScripts: false, + evalResponse: false, + noCache: false + }, + + initialize: function(options){ + this.xhr = new Browser.Request(); + this.setOptions(options); + this.options.isSuccess = this.options.isSuccess || this.isSuccess; + this.headers = new Hash(this.options.headers); + }, + + onStateChange: function(){ + if (this.xhr.readyState != 4 || !this.running) return; + this.running = false; + this.status = 0; + $try(function(){ + this.status = this.xhr.status; + }.bind(this)); + this.xhr.onreadystatechange = $empty; + if (this.options.isSuccess.call(this, this.status)){ + this.response = {text: this.xhr.responseText, xml: this.xhr.responseXML}; + this.success(this.response.text, this.response.xml); + } else { + this.response = {text: null, xml: null}; + this.failure(); + } + }, + + isSuccess: function(){ + return ((this.status >= 200) && (this.status < 300)); + }, + + processScripts: function(text){ + if (this.options.evalResponse || (/(ecma|java)script/).test(this.getHeader('Content-type'))) return $exec(text); + return text.stripScripts(this.options.evalScripts); + }, + + success: function(text, xml){ + this.onSuccess(this.processScripts(text), xml); + }, + + onSuccess: function(){ + this.fireEvent('complete', arguments).fireEvent('success', arguments).callChain(); + }, + + failure: function(){ + this.onFailure(); + }, + + onFailure: function(){ + this.fireEvent('complete').fireEvent('failure', this.xhr); + }, + + setHeader: function(name, value){ + this.headers.set(name, value); + return this; + }, + + getHeader: function(name){ + return $try(function(){ + return this.xhr.getResponseHeader(name); + }.bind(this)); + }, + + check: function(){ + if (!this.running) return true; + switch (this.options.link){ + case 'cancel': this.cancel(); return true; + case 'chain': this.chain(this.caller.bind(this, arguments)); return false; + } + return false; + }, + + send: function(options){ + if (!this.check(options)) return this; + this.running = true; + + var type = $type(options); + if (type == 'string' || type == 'element') options = {data: options}; + + var old = this.options; + options = $extend({data: old.data, url: old.url, method: old.method}, options); + var data = options.data, url = String(options.url), method = options.method.toLowerCase(); + + switch ($type(data)){ + case 'element': data = document.id(data).toQueryString(); break; + case 'object': case 'hash': data = Hash.toQueryString(data); + } + + if (this.options.format){ + var format = 'format=' + this.options.format; + data = (data) ? format + '&' + data : format; + } + + if (this.options.emulation && !['get', 'post'].contains(method)){ + var _method = '_method=' + method; + data = (data) ? _method + '&' + data : _method; + method = 'post'; + } + + if (this.options.urlEncoded && method == 'post'){ + var encoding = (this.options.encoding) ? '; charset=' + this.options.encoding : ''; + this.headers.set('Content-type', 'application/x-www-form-urlencoded' + encoding); + } + + if (this.options.noCache){ + var noCache = 'noCache=' + new Date().getTime(); + data = (data) ? noCache + '&' + data : noCache; + } + + var trimPosition = url.lastIndexOf('/'); + if (trimPosition > -1 && (trimPosition = url.indexOf('#')) > -1) url = url.substr(0, trimPosition); + + if (data && method == 'get'){ + url = url + (url.contains('?') ? '&' : '?') + data; + data = null; + } + + this.xhr.open(method.toUpperCase(), url, this.options.async); + + this.xhr.onreadystatechange = this.onStateChange.bind(this); + + this.headers.each(function(value, key){ + try { + this.xhr.setRequestHeader(key, value); + } catch (e){ + this.fireEvent('exception', [key, value]); + } + }, this); + + this.fireEvent('request'); + this.xhr.send(data); + if (!this.options.async) this.onStateChange(); + return this; + }, + + cancel: function(){ + if (!this.running) return this; + this.running = false; + this.xhr.abort(); + this.xhr.onreadystatechange = $empty; + this.xhr = new Browser.Request(); + this.fireEvent('cancel'); + return this; + } + +}); + +(function(){ + +var methods = {}; +['get', 'post', 'put', 'delete', 'GET', 'POST', 'PUT', 'DELETE'].each(function(method){ + methods[method] = function(){ + var params = Array.link(arguments, {url: String.type, data: $defined}); + return this.send($extend(params, {method: method})); + }; +}); + +Request.implement(methods); + +})(); + +Element.Properties.send = { + + set: function(options){ + var send = this.retrieve('send'); + if (send) send.cancel(); + return this.eliminate('send').store('send:options', $extend({ + data: this, link: 'cancel', method: this.get('method') || 'post', url: this.get('action') + }, options)); + }, + + get: function(options){ + if (options || !this.retrieve('send')){ + if (options || !this.retrieve('send:options')) this.set('send', options); + this.store('send', new Request(this.retrieve('send:options'))); + } + return this.retrieve('send'); + } + +}; + +Element.implement({ + + send: function(url){ + var sender = this.get('send'); + sender.send({data: this, url: url || sender.options.url}); + return this; + } + +}); + + +/* +--- + +script: Request.JSON.js + +description: Extends the basic Request Class with additional methods for sending and receiving JSON data. + +license: MIT-style license. + +requires: +- /Request JSON + +provides: [Request.HTML] + +... +*/ + +Request.JSON = new Class({ + + Extends: Request, + + options: { + secure: true + }, + + initialize: function(options){ + this.parent(options); + this.headers.extend({'Accept': 'application/json', 'X-Request': 'JSON'}); + }, + + success: function(text){ + this.response.json = JSON.decode(text, this.options.secure); + this.onSuccess(this.response.json, text); + } + +}); Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/mootools-more.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/mootools-more.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/mootools-more.js 3 Jan 2016 20:51:49 -0000 1.1.2.1 @@ -0,0 +1,789 @@ +//MooTools More, . Copyright (c) 2006-2009 Aaron Newton , Valerio Proietti & the MooTools team , MIT Style License. + +/* +--- + +script: More.js + +description: MooTools More + +license: MIT-style license + +authors: +- Guillermo Rauch +- Thomas Aylott +- Scott Kyle + +requires: +- core:1.2.4/MooTools + +provides: [MooTools.More] + +... +*/ + +MooTools.More = { + 'version': '1.2.4.2dev', + 'build': '%build%' +}; + +/* +--- + +script: Element.Delegation.js + +description: Extends the Element native object to include the delegate method for more efficient event management. + +credits: +- "Event checking based on the work of Daniel Steigerwald. License: MIT-style license. Copyright: Copyright (c) 2008 Daniel Steigerwald, daniel.steigerwald.cz" + +license: MIT-style license + +authors: +- Aaron Newton +- Daniel Steigerwald + +requires: +- core:1.2.4/Element.Event +- core:1.2.4/Selectors +- /MooTools.More + +provides: [Element.Delegation] + +... +*/ +(function(addEvent, removeEvent){ + + var match = /(.*?):relay\(([^)]+)\)$/, + combinators = /[+>~\s]/, + splitType = function(type){ + var bits = type.match(match); + return !bits ? {event: type} : { + event: bits[1], + selector: bits[2] + }; + }, + check = function(e, selector){ + var t = e.target; + if (combinators.test(selector = selector.trim())){ + var els = this.getElements(selector); + for (var i = els.length; i--; ){ + var el = els[i]; + if (t == el || el.hasChild(t)) return el; + } + } else { + for ( ; t && t != this; t = t.parentNode){ + if (Element.match(t, selector)) return document.id(t); + } + } + return null; + }; + + Element.implement({ + + addEvent: function(type, fn){ + var splitted = splitType(type); + if (splitted.selector){ + var monitors = this.retrieve('$moo:delegateMonitors', {}); + if (!monitors[type]){ + var monitor = function(e){ + var el = check.call(this, e, splitted.selector); + if (el) this.fireEvent(type, [e, el], 0, el); + }.bind(this); + monitors[type] = monitor; + addEvent.call(this, splitted.event, monitor); + } + } + return addEvent.apply(this, arguments); + }, + + removeEvent: function(type, fn){ + var splitted = splitType(type); + if (splitted.selector){ + var events = this.retrieve('events'); + if (!events || !events[type] || (fn && !events[type].keys.contains(fn))) return this; + + if (fn) removeEvent.apply(this, [type, fn]); + else removeEvent.apply(this, type); + + events = this.retrieve('events'); + if (events && events[type] && events[type].keys.length == 0){ + var monitors = this.retrieve('$moo:delegateMonitors', {}); + removeEvent.apply(this, [splitted.event, monitors[type]]); + delete monitors[type]; + } + return this; + } + + return removeEvent.apply(this, arguments); + }, + + fireEvent: function(type, args, delay, bind){ + var events = this.retrieve('events'); + if (!events || !events[type]) return this; + events[type].keys.each(function(fn){ + fn.create({bind: bind || this, delay: delay, arguments: args})(); + }, this); + return this; + } + + }); + +})(Element.prototype.addEvent, Element.prototype.removeEvent); + +/* +--- + +script: Drag.js + +description: The base Drag Class. Can be used to drag and resize Elements using mouse events. + +license: MIT-style license + +authors: +- Valerio Proietti +- Tom Occhinno +- Jan Kassens + +requires: +- core:1.2.4/Events +- core:1.2.4/Options +- core:1.2.4/Element.Event +- core:1.2.4/Element.Style +- /MooTools.More + +provides: [Drag] + +*/ + +var Drag = new Class({ + + Implements: [Events, Options], + + options: {/* + onBeforeStart: $empty(thisElement), + onStart: $empty(thisElement, event), + onSnap: $empty(thisElement) + onDrag: $empty(thisElement, event), + onCancel: $empty(thisElement), + onComplete: $empty(thisElement, event),*/ + snap: 6, + unit: 'px', + grid: false, + style: true, + limit: false, + handle: false, + invert: false, + preventDefault: false, + modifiers: {x: 'left', y: 'top'} + }, + + initialize: function(){ + var params = Array.link(arguments, {'options': Object.type, 'element': $defined}); + this.element = document.id(params.element); + this.document = this.element.getDocument(); + this.setOptions(params.options || {}); + var htype = $type(this.options.handle); + this.handles = ((htype == 'array' || htype == 'collection') ? $$(this.options.handle) : document.id(this.options.handle)) || this.element; + this.mouse = {'now': {}, 'pos': {}}; + this.value = {'start': {}, 'now': {}}; + + this.selection = (Browser.Engine.trident) ? 'selectstart' : 'mousedown'; + + this.bound = { + start: this.start.bind(this), + check: this.check.bind(this), + drag: this.drag.bind(this), + stop: this.stop.bind(this), + cancel: this.cancel.bind(this), + eventStop: $lambda(false) + }; + this.attach(); + }, + + attach: function(){ + this.handles.addEvent('mousedown', this.bound.start); + return this; + }, + + detach: function(){ + this.handles.removeEvent('mousedown', this.bound.start); + return this; + }, + + start: function(event){ + if (event.rightClick) return; + if (this.options.preventDefault) event.preventDefault(); + this.mouse.start = event.page; + this.fireEvent('beforeStart', this.element); + var limit = this.options.limit; + this.limit = {x: [], y: []}; + for (var z in this.options.modifiers){ + if (!this.options.modifiers[z]) continue; + if (this.options.style) this.value.now[z] = this.element.getStyle(this.options.modifiers[z]).toInt(); + else this.value.now[z] = this.element[this.options.modifiers[z]]; + if (this.options.invert) this.value.now[z] *= -1; + this.mouse.pos[z] = event.page[z] - this.value.now[z]; + if (limit && limit[z]){ + for (var i = 2; i--; i){ + if ($chk(limit[z][i])) this.limit[z][i] = $lambda(limit[z][i])(); + } + } + } + if ($type(this.options.grid) == 'number') this.options.grid = {x: this.options.grid, y: this.options.grid}; + this.document.addEvents({mousemove: this.bound.check, mouseup: this.bound.cancel}); + this.document.addEvent(this.selection, this.bound.eventStop); + }, + + check: function(event){ + if (this.options.preventDefault) event.preventDefault(); + var distance = Math.round(Math.sqrt(Math.pow(event.page.x - this.mouse.start.x, 2) + Math.pow(event.page.y - this.mouse.start.y, 2))); + if (distance > this.options.snap){ + this.cancel(); + this.document.addEvents({ + mousemove: this.bound.drag, + mouseup: this.bound.stop + }); + this.fireEvent('start', [this.element, event]).fireEvent('snap', this.element); + } + }, + + drag: function(event){ + if (this.options.preventDefault) event.preventDefault(); + this.mouse.now = event.page; + for (var z in this.options.modifiers){ + if (!this.options.modifiers[z]) continue; + this.value.now[z] = this.mouse.now[z] - this.mouse.pos[z]; + if (this.options.invert) this.value.now[z] *= -1; + if (this.options.limit && this.limit[z]){ + if ($chk(this.limit[z][1]) && (this.value.now[z] > this.limit[z][1])){ + this.value.now[z] = this.limit[z][1]; + } else if ($chk(this.limit[z][0]) && (this.value.now[z] < this.limit[z][0])){ + this.value.now[z] = this.limit[z][0]; + } + } + if (this.options.grid[z]) this.value.now[z] -= ((this.value.now[z] - (this.limit[z][0]||0)) % this.options.grid[z]); + if (this.options.style) { + this.element.setStyle(this.options.modifiers[z], this.value.now[z] + this.options.unit); + } else { + this.element[this.options.modifiers[z]] = this.value.now[z]; + } + } + this.fireEvent('drag', [this.element, event]); + }, + + cancel: function(event){ + this.document.removeEvent('mousemove', this.bound.check); + this.document.removeEvent('mouseup', this.bound.cancel); + if (event){ + this.document.removeEvent(this.selection, this.bound.eventStop); + this.fireEvent('cancel', this.element); + } + }, + + stop: function(event){ + this.document.removeEvent(this.selection, this.bound.eventStop); + this.document.removeEvent('mousemove', this.bound.drag); + this.document.removeEvent('mouseup', this.bound.stop); + if (event) this.fireEvent('complete', [this.element, event]); + } + +}); + +Element.implement({ + + makeResizable: function(options){ + var drag = new Drag(this, $merge({modifiers: {x: 'width', y: 'height'}}, options)); + this.store('resizer', drag); + return drag.addEvent('drag', function(){ + this.fireEvent('resize', drag); + }.bind(this)); + } + +}); + + +/* +--- + +script: Drag.Move.js + +description: A Drag extension that provides support for the constraining of draggables to containers and droppables. + +license: MIT-style license + +authors: +- Valerio Proietti +- Tom Occhinno +- Jan Kassens +- Aaron Newton +- Scott Kyle + +requires: +- core:1.2.4/Element.Dimensions +- /Drag + +provides: [Drag.Move] + +... +*/ + +Drag.Move = new Class({ + + Extends: Drag, + + options: {/* + onEnter: $empty(thisElement, overed), + onLeave: $empty(thisElement, overed), + onDrop: $empty(thisElement, overed, event),*/ + droppables: [], + container: false, + precalculate: false, + includeMargins: true, + checkDroppables: true + }, + + initialize: function(element, options){ + this.parent(element, options); + element = this.element; + + this.droppables = $$(this.options.droppables); + this.container = document.id(this.options.container); + + if (this.container && $type(this.container) != 'element') + this.container = document.id(this.container.getDocument().body); + + var styles = element.getStyles('left', 'top', 'position'); + if (styles.left == 'auto' || styles.top == 'auto') + element.setPosition(element.getPosition(element.getOffsetParent())); + + if (styles.position == 'static') + element.setStyle('position', 'absolute'); + + this.addEvent('start', this.checkDroppables, true); + + this.overed = null; + }, + + start: function(event){ + if (this.container) this.options.limit = this.calculateLimit(); + + if (this.options.precalculate){ + this.positions = this.droppables.map(function(el){ + return el.getCoordinates(); + }); + } + + this.parent(event); + }, + + calculateLimit: function(){ + var offsetParent = this.element.getOffsetParent(), + containerCoordinates = this.container.getCoordinates(offsetParent), + containerBorder = {}, + elementMargin = {}, + elementBorder = {}, + containerMargin = {}, + offsetParentPadding = {}; + + ['top', 'right', 'bottom', 'left'].each(function(pad){ + containerBorder[pad] = this.container.getStyle('border-' + pad).toInt(); + elementBorder[pad] = this.element.getStyle('border-' + pad).toInt(); + elementMargin[pad] = this.element.getStyle('margin-' + pad).toInt(); + containerMargin[pad] = this.container.getStyle('margin-' + pad).toInt(); + offsetParentPadding[pad] = offsetParent.getStyle('padding-' + pad).toInt(); + }, this); + + var width = this.element.offsetWidth + elementMargin.left + elementMargin.right, + height = this.element.offsetHeight + elementMargin.top + elementMargin.bottom, + left = 0, + top = 0, + right = containerCoordinates.right - containerBorder.right - width, + bottom = containerCoordinates.bottom - containerBorder.bottom - height; + + if (this.options.includeMargins){ + left += elementMargin.left; + top += elementMargin.top; + } else { + right += elementMargin.right; + bottom += elementMargin.bottom; + } + + if (this.element.getStyle('position') == 'relative'){ + var coords = this.element.getCoordinates(offsetParent); + coords.left -= this.element.getStyle('left').toInt(); + coords.top -= this.element.getStyle('top').toInt(); + + left += containerBorder.left - coords.left; + top += containerBorder.top - coords.top; + right += elementMargin.left - coords.left; + bottom += elementMargin.top - coords.top; + + if (this.container != offsetParent){ + left += containerMargin.left + offsetParentPadding.left; + top += (Browser.Engine.trident4 ? 0 : containerMargin.top) + offsetParentPadding.top; + } + } else { + left -= elementMargin.left; + top -= elementMargin.top; + + if (this.container == offsetParent){ + right -= containerBorder.left; + bottom -= containerBorder.top; + } else { + left += containerCoordinates.left + containerBorder.left; + top += containerCoordinates.top + containerBorder.top; + } + } + + return { + x: [left, right], + y: [top, bottom] + }; + }, + + checkAgainst: function(el, i){ + el = (this.positions) ? this.positions[i] : el.getCoordinates(); + var now = this.mouse.now; + return (now.x > el.left && now.x < el.right && now.y < el.bottom && now.y > el.top); + }, + + checkDroppables: function(){ + var overed = this.droppables.filter(this.checkAgainst, this).getLast(); + if (this.overed != overed){ + if (this.overed) this.fireEvent('leave', [this.element, this.overed]); + if (overed) this.fireEvent('enter', [this.element, overed]); + this.overed = overed; + } + }, + + drag: function(event){ + this.parent(event); + if (this.options.checkDroppables && this.droppables.length) this.checkDroppables(); + }, + + stop: function(event){ + this.checkDroppables(); + this.fireEvent('drop', [this.element, this.overed, event]); + this.overed = null; + return this.parent(event); + } + +}); + +Element.implement({ + + makeDraggable: function(options){ + var drag = new Drag.Move(this, options); + this.store('dragger', drag); + return drag; + } + +}); + + +/* +--- + +script: Assets.js + +description: Provides methods to dynamically load JavaScript, CSS, and Image files into the document. + +license: MIT-style license + +authors: +- Valerio Proietti + +requires: +- core:1.2.4/Element.Event +- /MooTools.More + +provides: [Assets] + +... +*/ + +var Asset = { + + javascript: function(source, properties){ + properties = $extend({ + onload: $empty, + document: document, + check: $lambda(true) + }, properties); + + var script = new Element('script', {src: source, type: 'text/javascript'}); + + var load = properties.onload.bind(script), + check = properties.check, + doc = properties.document; + delete properties.onload; + delete properties.check; + delete properties.document; + + script.addEvents({ + load: load, + readystatechange: function(){ + if (['loaded', 'complete'].contains(this.readyState)) load(); + } + }).set(properties); + + if (Browser.Engine.webkit419) var checker = (function(){ + if (!$try(check)) return; + $clear(checker); + load(); + }).periodical(50); + + return script.inject(doc.head); + }, + + css: function(source, properties){ + return new Element('link', $merge({ + rel: 'stylesheet', + media: 'screen', + type: 'text/css', + href: source + }, properties)).inject(document.head); + }, + + image: function(source, properties){ + properties = $merge({ + onload: $empty, + onabort: $empty, + onerror: $empty + }, properties); + var image = new Image(); + var element = document.id(image) || new Element('img'); + ['load', 'abort', 'error'].each(function(name){ + var type = 'on' + name; + var event = properties[type]; + delete properties[type]; + image[type] = function(){ + if (!image) return; + if (!element.parentNode){ + element.width = image.width; + element.height = image.height; + } + image = image.onload = image.onabort = image.onerror = null; + event.delay(1, element, element); + element.fireEvent(name, element, 1); + }; + }); + image.src = element.src = source; + if (image && image.complete) image.onload.delay(1); + return element.set(properties); + }, + + images: function(sources, options){ + options = $merge({ + onComplete: $empty, + onProgress: $empty, + onError: $empty, + properties: {} + }, options); + sources = $splat(sources); + var images = []; + var counter = 0; + return new Elements(sources.map(function(source){ + return Asset.image(source, $extend(options.properties, { + onload: function(){ + options.onProgress.call(this, counter, sources.indexOf(source)); + counter++; + if (counter == sources.length) options.onComplete(); + }, + onerror: function(){ + options.onError.call(this, counter, sources.indexOf(source)); + counter++; + if (counter == sources.length) options.onComplete(); + } + })); + })); + } + +}; + +/* +--- + +script: Tips.js + +description: Class for creating nice tips that follow the mouse cursor when hovering an element. + +license: MIT-style license + +authors: +- Valerio Proietti +- Christoph Pojer + +requires: +- core:1.2.4/Options +- core:1.2.4/Events +- core:1.2.4/Element.Event +- core:1.2.4/Element.Style +- core:1.2.4/Element.Dimensions +- /MooTools.More + +provides: [Tips] + +... +*/ + +(function(){ + +var read = function(option, element){ + return (option) ? ($type(option) == 'function' ? option(element) : element.get(option)) : ''; +}; + +this.Tips = new Class({ + + Implements: [Events, Options], + + options: { + /* + onAttach: $empty(element), + onDetach: $empty(element), + */ + onShow: function(){ + this.tip.setStyle('display', 'block'); + }, + onHide: function(){ + this.tip.setStyle('display', 'none'); + }, + title: 'title', + text: function(element){ + return element.get('rel') || element.get('href'); + }, + showDelay: 100, + hideDelay: 100, + className: 'tip-wrap', + offset: {x: 16, y: 16}, + fixed: false + }, + + initialize: function(){ + var params = Array.link(arguments, {options: Object.type, elements: $defined}); + this.setOptions(params.options); + document.id(this); + + if (params.elements) this.attach(params.elements); + }, + + toElement: function(){ + if (this.tip) return this.tip; + + this.container = new Element('div', {'class': 'tip'}); + return this.tip = new Element('div', { + 'class': this.options.className, + styles: { + display: 'none', + position: 'absolute', + top: 0, + left: 0 + } + }).adopt( + new Element('div', {'class': 'tip-top'}), + this.container, + new Element('div', {'class': 'tip-bottom'}) + ).inject(document.body); + }, + + attach: function(elements){ + $$(elements).each(function(element){ + var title = read(this.options.title, element), + text = read(this.options.text, element); + + element.erase('title').store('tip:native', title).retrieve('tip:title', title); + element.retrieve('tip:text', text); + this.fireEvent('attach', [element]); + + var events = ['enter', 'leave']; + if (!this.options.fixed) events.push('move'); + + events.each(function(value){ + var event = element.retrieve('tip:' + value); + if (!event) event = this['element' + value.capitalize()].bindWithEvent(this, element); + + element.store('tip:' + value, event).addEvent('mouse' + value, event); + }, this); + }, this); + + return this; + }, + + detach: function(elements){ + $$(elements).each(function(element){ + ['enter', 'leave', 'move'].each(function(value){ + element.removeEvent('mouse' + value, element.retrieve('tip:' + value)).eliminate('tip:' + value); + }); + + this.fireEvent('detach', [element]); + + if (this.options.title == 'title'){ // This is necessary to check if we can revert the title + var original = element.retrieve('tip:native'); + if (original) element.set('title', original); + } + }, this); + + return this; + }, + + elementEnter: function(event, element){ + this.container.empty(); + + ['title', 'text'].each(function(value){ + var content = element.retrieve('tip:' + value); + if (content) this.fill(new Element('div', {'class': 'tip-' + value}).inject(this.container), content); + }, this); + + $clear(this.timer); + this.timer = this.show.delay(this.options.showDelay, this, element); + this.position((this.options.fixed) ? {page: element.getPosition()} : event); + }, + + elementLeave: function(event, element){ + $clear(this.timer); + this.timer = this.hide.delay(this.options.hideDelay, this, element); + this.fireForParent(event, element); + }, + + fireForParent: function(event, element) { + parentNode = element.getParent(); + if (parentNode == document.body) return; + if (parentNode.retrieve('tip:enter')) parentNode.fireEvent('mouseenter', event); + else return this.fireForParent(event, parentNode); // Why was this reversed in the original? + }, + + elementMove: function(event, element){ + this.position(event); + }, + + position: function(event){ + var size = window.getSize(), scroll = window.getScroll(), + tip = {x: this.tip.offsetWidth, y: this.tip.offsetHeight}, + props = {x: 'left', y: 'top'}, + obj = {}; + + for (var z in props){ + obj[props[z]] = event.page[z] + this.options.offset[z]; + if ((obj[props[z]] + tip[z] - scroll[z]) > size[z]) obj[props[z]] = event.page[z] - this.options.offset[z] - tip[z]; + } + + this.tip.setStyles(obj); + }, + + fill: function(element, contents){ + if(typeof contents == 'string') element.set('html', contents); + else element.adopt(contents); + }, + + show: function(element){ + this.fireEvent('show', [element]); + }, + + hide: function(element){ + this.fireEvent('hide', [element]); + } + +}); + +})(); \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/selectImage.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/selectImage.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/selectImage.php 3 Jan 2016 20:51:50 -0000 1.1.2.1 @@ -0,0 +1,13 @@ + 'Files/', + 'assetBasePath' => '../Assets', + 'upload' => false, + 'destroy' => false, + 'filter' => 'image/', +)); + +$browser->fireEvent(!empty($_GET['event']) ? $_GET['event'] : null); \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/tinymce.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/tinymce.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/tinymce.html 3 Jan 2016 20:51:50 -0000 1.1.2.1 @@ -0,0 +1,116 @@ + + + + Testground + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    FileManager Demo

    +
    + + +
    +
    +
    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/Files/Test/smurfs.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Demos/Files/Test/smurfs.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.br.js 3 Jan 2016 20:51:50 -0000 1.1.2.1 @@ -0,0 +1,72 @@ +/* +Script: Language.br.js + MooTools FileManager - Language Strings in Brazilian Portuguese + +Translation: + [Fabiana Pires](http://twitter.com/nervosinha) +*/ + +FileManager.Language.br = { + more: 'Detalhes', + width: 'Largura:', + height: 'Altura:', + + ok: 'Ok', + open: 'Selecione o arquivo', + upload: 'Upload', + create: 'Criar pasta', + createdir: 'Por favor especifique o nome da pasta:', + cancel: 'Cancelar', + + information: 'Informa��o', + type: 'Tipo:', + size: 'Tamanho:', + dir: 'Caminho:', + modified: '�ltima modifica��o:', + preview: 'Pr�-visualiza��o', + close: 'Fechar', + destroy: 'Apagar', + destroyfile: 'Tem certeza que deseja apagar este arquivo?', + + rename: 'Renomear', + renamefile: 'Por favor especifique o novo nome do arquivo:', + + download: 'Download', + nopreview: 'Pr�-visualiza��o indispon�vel', + + title: 'T�tulo:', + artist: 'Artista:', + album: 'Album:', + length: 'Tamanho:', + bitrate: 'Bitrate:', + + deselect: 'Desfazer', + + nodestroy: 'Apagar arquivos est� desabilitado neste servidor.', + + 'upload.disabled': 'N�o � permitido enviar arquivos neste servidor.', + 'upload.authenticated': 'Voc� n�o est� autenticado para enviar arquivos neste servidor.', + 'upload.path': 'A pasta especificada n�o existe. Por favor contate o administrador do site.', + 'upload.exists': 'A pasta especificada j� existe. Por favor contate o administrador do site.', + 'upload.mime': 'O tipo de arquivo especificado n�o � permitido.', + 'upload.extension': 'O arquivo enviado � de tipo desconhecido ou proibido.', + 'upload.size': 'O tamanho do arquivo enviado � muito grande para ser processado neste servidor. Por favor, envie um arquivo menor.', + 'upload.partial': 'O arquivo enviado foi corrompido, por favor envie o arquivo novamente.', + 'upload.nofile': 'N�o existe arquivo especificado para ser enviado.', + 'upload.default': 'Erro no envio do arquivo.', + + /* FU */ + uploader: { + unknown: 'Erro desconhecido', + sizeLimitMin: 'N�o � permitido anexar "${name}" (${size}), o tamanho m�nimo para o arquivo � de ${size_min}!', + sizeLimitMax: 'N�o � permitido anexar "${name}" (${size}), o tamanho m�ximo para o arquivo � de ${size_max}!' + }, + + flash: { + hidden: 'Para habilitar o uploader, desbloqueie a fun��o em seu browser e recarregue a p�gina (veja Adblock).', + disabled: 'Para habilitar o uploader, habilite o arquivo Flash e recarregue a p�gina (veja Flashblock).', + flash: 'Para enviar arquivos � necess�rio instalar o Adobe Flash Player.' + }, + + resizeImages: 'Redimensionar imagens grandes ao enviar' +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.cs.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.cs.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.cs.js 3 Jan 2016 20:51:50 -0000 1.1.2.1 @@ -0,0 +1,73 @@ +/* +Script: Language.cs.js + MooTools FileManager - Language Strings in Czech + +Translation: + [Matěj Grabovský](http://mgrabovsky.is-game.com) +*/ + +FileManager.Language.cs = { + more: 'Podrobnosti', + width: 'Šířka:', + height: 'Výška:', + + ok: 'Ok', + open: 'Vybrat soubor', + upload: 'Nahrát', + create: 'Vytvořit složku', + createdir: 'Prosím zadejte název složky:', + cancel: 'Storno', + + information: 'Informace', + type: 'Typ:', + size: 'Velikost:', + dir: 'Cesta:', + modified: 'Naposledy změněno:', + preview: 'Náhled', + close: 'Zavřít', + destroy: 'Smazat', + destroyfile: 'Určitě chcete smazat tento soubor?', + + rename: 'Přejmenovat', + renamefile: 'Prosím zadejte název nového souboru:', + + download: 'Stáhnout', + nopreview: 'Náhled není dostupný', + + title: 'Název:', + artist: 'Umělec:', + album: 'Album:', + length: 'Délka:', + bitrate: 'Přenosová rychlost:', + + deselect: 'Odstranit z výběru', + + nodestroy: 'Mazání souborů je na tomto serveru zakázáno.', + + 'upload.disabled': 'Nahrávání souborů je na tomto serveru zakázáno.', + 'upload.authenticated': 'Nemáte právo nahrávat soubory.', + 'upload.path': 'Specifikovaná složka pro nahrávání neexistuje. Prosím kontaktujte správce těchto stránek.', + 'upload.exists': 'Specifikovaný soubor již existuje. Prosím kontaktujte správce těchto stránek.', + 'upload.mime': 'Specifikovaný typ souboru není povolen.', + 'upload.extension': 'Nahrávaný soubor má neznámou nebo zakázanou příponu.', + 'upload.size': 'Velikost nahrávaného souboru je přílíš velká. Prosím nahrajte menší soubor.', + 'upload.partial': 'Nahrávaný soubor byl nahrán jen zčásti. Prosím nahrajte ho znovu.', + 'upload.nofile': 'Nebyl vybrán žádný soubor pro nahrání.', + 'upload.default': 'Něco se nepovedlo při nahrávání souboru.', + + /* FU */ + uploader: { + unknown: 'Neznámá chyba', + duplicate: 'Nelze přidat soubor „${name}“ (${size}), byl již přidán!', + sizeLimitMin: 'Nelze přidat soubor „${name}“ (${size}), minimální povolená velikost souboru je ${size_min}!', + sizeLimitMax: 'Nelze přidat soubor „${name}“ (${size}), maximální povolená velikost souboru je ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'Pokud chcete nahrávat soubory, musíte mít nainstalovaný Adobe Flash' + }, + + resizeImages: 'Změnšit velké obrázky při nahrávání' +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.da.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.da.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.da.js 3 Jan 2016 20:51:51 -0000 1.1.2.1 @@ -0,0 +1,73 @@ +/* +Script: Language.da.js + MooTools FileManager - Language Strings in Danish + +Translation: + Jan Ebsen +*/ + +FileManager.Language.da = { + more: 'Detaljer', + width: 'Bredde:', + height: 'Højde:', + + ok: 'Ok', + open: 'Vælg fil', + upload: 'Upload', + create: 'Opret mappe', + createdir: 'Angiv venligst mappe navn:', + cancel: 'Anuller', + + information: 'Information', + type: 'Type:', + size: 'Størrelse:', + dir: 'Sti:', + modified: 'Sidst ændret:', + preview: 'Miniature', + close: 'Luk', + destroy: 'Slet', + destroyfile: 'Er du sikker på du vil slette denne fil?', + + rename: 'Omdøb', + renamefile: 'Skriv nyt filnavn:', + + download: 'Download', + nopreview: 'Ingen miniature tilgængelig', + + title: 'Titel:', + artist: 'Kunstner:', + album: 'Album:', + length: 'Længde:', + bitrate: 'Bitrate:', + + deselect: 'Fravælg', + + nodestroy: 'Det er ikke muligt at slette filer på serveren.', + + 'upload.disabled': 'Det er ikke muligt at uploade filer på serveren.', + 'upload.authenticated': 'Du har ikke rettigheder til at uploade filer.', + 'upload.path': 'Upload mappen findes ikke. Kontakt venligst sidens administrator.', + 'upload.exists': 'Upload mappen findes allerede. Kontakt venligst sidens administrator.', + 'upload.mime': 'Fil-typen er ikke tilladt.', + 'upload.extension': 'Filen er af en ukendt, eller ulovlig type.', + 'upload.size': 'Filen er for stor, upload venligst en mindre fil.', + 'upload.partial': 'Filen blev kun delvist uploaded, prøv venligst igen.', + 'upload.nofile': 'Der er ikke angivet nogen fil til upload.', + 'upload.default': 'Noget gik galt med fil-uploaderen.', + + /* FU */ + uploader: { + unknown: 'Ukendt fejl', + duplicate: 'Du kan ikke tilføje "${name}" (${size}), den er allerede tilføjet!', + sizeLimitMin: 'Du kan ikke tilføje "${name}" (${size}), mindst tilladte filstørrelse er ${size_min}!', + sizeLimitMax: 'Du kan ikke tilføje "${name}" (${size}), højst tilladte filstørrelse er ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'For at uploade filer skal du installere Adobe Flash.' + }, + + resizeImages: 'Scaler store billeder ved upload' +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.de.js 3 Jan 2016 20:51:51 -0000 1.1.2.1 @@ -0,0 +1,80 @@ +/* +Script: Language.de.js + MooTools FileManager - Language Strings in German + +Translation: + [Christoph Pojer](http://cpojer.net) +*/ + +FileManager.Language.de = { + more: 'Details', + width: 'Breite:', + height: 'Höhe:', + + ok: 'Ok', + open: 'Datei wählen', + upload: 'Datei hochladen', + create: 'Ordner erstellen', + createdir: 'Bitte gib einen Ordnernamen ein:', + cancel: 'Abbrechen', + + information: 'Information', + type: 'Typ:', + size: 'Größe:', + dir: 'Verzeichnis:', + modified: 'Zuletzt bearbeitet:', + preview: 'Vorschau', + close: 'Schließen', + destroy: 'Löschen', + destroyfile: 'Bist du sicher, dass du diese Datei löschen möchtest?', + + rename: 'Umbenennen', + renamefile: 'Gib einen neuen Dateinamen ein:', + + download: 'Download', + nopreview: 'Keine Vorschau verfügbar', + + title: 'Titel:', + artist: 'Artist:', + album: 'Album:', + length: 'Länge:', + bitrate: 'Bitrate:', + + deselect: 'Entfernen', + + nodestroy: 'Dateien löschen wurde auf diesem Server deaktiviert.', + + 'upload.disabled': 'Der Datei-Upload wurde auf diesem Server deaktiviert.', + 'upload.authenticated': 'Upload fehlgeschlagen: Du bist nicht authentifiziert.', + 'upload.path': 'Der angegebene Upload-Ordner existiert nicht. Bitte kontaktiere den Administrator dieser Website.', + 'upload.exists': 'Der angegebene Upload-Speicherort existiert bereits. Bitte kontaktiere den Administrator dieser Website.', + 'upload.mime': 'Der angegebene Dateityp ist nicht erlaubt.', + 'upload.extension': 'Die Datei hat eine unbekannte oder unerlaubte Datei-Erweiterung.', + 'upload.size': 'Die Datei, die du hochgeladen hast, ist zu groß um sie auf diesem Server zu verarbeiten. Bitte lade eine kleinere Datei hoch.', + 'upload.partial': 'Die Datei wurde nur teilweise hochgeladen. Bitte lade sie erneut hoch.', + 'upload.nofile': 'Es wurde keine Datei hochgeladen.', + 'upload.default': 'Der Datei-Upload ist fehlgeschlagen.', + + /* FU */ + uploader: { + unknown: 'Unbekannter Fehler', + sizeLimitMin: 'Die Datei "${name}" (${size}), ist zu klein. Minimaldateigröße: ${size_min}!', + sizeLimitMax: 'Die Datei "${name}" (${size}), ist zu groß. Dateigrößen-Limit: ${size_max}!' + }, + + flash: { + hidden: 'Um den Uploader benutzen zu können, muss er im Browser freigegeben werden und die Seite muss neu geladen werden (Adblock).', + disabled: 'Um den Uploader benutzen zu können, muss die geblockte Flash Datei freigegeben werden und die Seite muss neu geladen werden (Flashblock).', + flash: 'Um Dateien hochzuladen muss Adobe Flash installiert werden.' + }, + + resizeImages: 'Große Bilder bei Upload verkleinern', + + serialize: 'Galerie speichern', + gallery: { + text: 'Bildtext', + save: 'Speichern', + remove: 'Entfernen', + drag: 'Verschiebe Bilder in diesen Bereich um eine Galerie zu erstellen...' + } +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.en.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.en.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.en.js 3 Jan 2016 20:51:51 -0000 1.1.2.1 @@ -0,0 +1,80 @@ +/* +Script: Language.en.js + MooTools FileManager - Language Strings in English + +Translation: + [Christoph Pojer](http://cpojer.net) +*/ + +FileManager.Language.en = { + more: 'Details', + width: 'Width:', + height: 'Height:', + + ok: 'Ok', + open: 'Select file', + upload: 'Upload', + create: 'Create folder', + createdir: 'Please specify a folder name:', + cancel: 'Cancel', + + information: 'Information', + type: 'Type:', + size: 'Size:', + dir: 'Path:', + modified: 'Created:', + preview: 'Preview', + close: 'Close', + destroy: 'Delete', + destroyfile: 'Are you sure to delete this file?', + + rename: 'Rename', + renamefile: 'Please enter a new file name:', + + download: 'Download', + nopreview: 'No preview available', + + title: 'Title:', + artist: 'Artist:', + album: 'Album:', + length: 'Length:', + bitrate: 'Bitrate:', + + deselect: 'Deselect', + + nodestroy: 'Deleting files has been disabled on this Server.', + + 'upload.disabled': 'Uploading has been disabled on this Server.', + 'upload.authenticated': 'You are not authenticated to upload files.', + 'upload.path': 'The specified Upload-Folder does not exist. Please contact the administrator of this Website.', + 'upload.exists': 'The specified Upload-Location does already exist. Please contact the administrator of this Website.', + 'upload.mime': 'The specified file-type is not allowed.', + 'upload.extension': 'The uploaded file has an unknown or forbidden file extension.', + 'upload.size': 'The size of the file you uploaded is too big to be processed on this server. Please upload a smaller file.', + 'upload.partial': 'The file you uploaded was only partially uploaded, please upload the file again.', + 'upload.nofile': 'There was no file specified to be uploaded.', + 'upload.default': 'Something went wrong with the File-Upload.', + + /* FU */ + uploader: { + unknown: 'Unknown Error', + sizeLimitMin: 'You can not attach "${name}" (${size}), the file size minimum is ${size_min}!', + sizeLimitMax: 'You can not attach "${name}" (${size}), the file size limit is ${size_max}!' + }, + + flash: { + hidden: 'To enable the embedded uploader, unblock it in your browser and refresh (see Adblock).', + disabled: 'To enable the embedded uploader, enable the blocked Flash movie and refresh (see Flashblock).', + flash: 'In order to upload files you need to install Adobe Flash.' + }, + + resizeImages: 'Resize big images on upload', + + serialize: 'Save gallery', + gallery: { + text: 'Image caption', + save: 'Save', + remove: 'Remove from gallery', + drag: 'Drag items here to create a gallery...' + } +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.es.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.es.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.es.js 3 Jan 2016 20:51:51 -0000 1.1.2.1 @@ -0,0 +1,73 @@ +/* +Script: Language.es.js + MooTools FileManager - Language Strings in Spanish + +Translation: + [Sergio Rubio](http://rubiojr.netcorex.org) +*/ + +FileManager.Language.es = { + more: 'Detalles', + width: 'Anchura:', + height: 'Altura:', + + ok: 'Ok', + open: 'Seleccionar Fichero', + upload: 'Subir ficheros', + create: 'Crear carpeta', + createdir: 'Especifica el nombre de la carpeta:', + cancel: 'Cancelar', + + information: 'Información', + type: 'Tipo:', + size: 'Tamaño:', + dir: 'Ruta:', + modified: 'Última modificación:', + preview: 'Previsualización', + close: 'Cerrar', + destroy: 'Borrar', + destroyfile: '¿Seguro que deseas borrar el fichero?', + + rename: 'Renombrar', + renamefile: 'Especifica un nuevo nombre para el fichero:', + + download: 'Descargar', + nopreview: 'No hay previsualizacion disponible', + + title: 'Título:', + artist: 'Artista:', + album: 'Album:', + length: 'Duración:', + bitrate: 'Bitrate:', + + deselect: 'Desmarcar', + + nodestroy: 'El borrado de ficheros ha sido deshabilitado.', + + 'upload.disabled': 'La carga de archivos ha sido deshabilitada.', + 'upload.authenticated': 'Necesitas autorización para subir ficheros.', + 'upload.path': 'La carpeta destino especificada no existe. Contacta con el administrador del sitio web.', + 'upload.exists': 'El la ruta destino ya existe. Por favor, contacta con el administrador del sitio web.', + 'upload.mime': 'No se permite subir el tipo de fichero especificado.', + 'upload.extension': 'El fichero subido tienen una extensión no permitida o desconocida.', + 'upload.size': 'El tamaño del fichero que intentas subir es demasiado grande para ser procesado por el servidor. Por favor, sube un fichero mas pequeño.', + 'upload.partial': 'El fichero se ha subido parcialmente, por favor, sube el fichero de nuevo.', + 'upload.nofile': 'No se especificó el fichero a subir.', + 'upload.default': 'Algo falló durante la carga del fichero.', + + /* FU */ + uploader: { + unknown: 'Error desconocido', + duplicate: 'No se puede subir "${name}" (${size}), ya ha sido añadido!', + sizeLimitMin: 'No se puede subir "${name}" (${size}), el tamaño mínimo de fichero es ${size_min}!', + sizeLimitMax: 'No se puede subir "${name}" (${size}), el tamaño máximo de fichero es ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'Para poder subir ficheros necesitas instalar Adobe Flash.' + }, + + resizeImages: 'Redimensionar las imágenes grandes al subirlas' +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.fi.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.fi.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.fi.js 3 Jan 2016 20:51:51 -0000 1.1.2.1 @@ -0,0 +1,73 @@ +/* +Script: Language.fi.js + MooTools FileManager - Language Strings in Finnish + +Translation: + [Jabis Sevón](http://pumppumedia.com) +*/ + +FileManager.Language.fi = { + more: 'Lisätiedot', + width: 'Leveys:', + height: 'Korkeus:', + + ok: 'Ok', + open: 'Valitse tiedosto', + upload: 'Lähetä', + create: 'Luo kansio', + createdir: 'Kansion nimi:', + cancel: 'Peruuta', + + information: 'Tiedot', + type: 'Tyyppi:', + size: 'Koko:', + dir: 'Polku:', + modified: 'Viimeksi muokattu:', + preview: 'Esikatselu', + close: 'Sulje', + destroy: 'Poista', + destroyfile: 'Haluatko varmasti poistaa tiedoston?', + + rename: 'Nimeä uudelleen', + renamefile: 'Syötä tiedoston uusi nimi:', + + download: 'Lataa', + nopreview: 'Esikatselua ei voida näyttää', + + title: 'Kappaleen nimi:', + artist: 'Artisti:', + album: 'Albumi:', + length: 'Pituus:', + bitrate: 'Bitrate:', + + deselect: 'Poista valinta', + + nodestroy: 'Tiedostojen poisto otettu käytöstä.', + + 'upload.disabled': 'Tiedostojen lähetys otettu käytöstä.', + 'upload.authenticated': 'Sinulla ei ole oikeuksia tiedostojen lähettämiseen.', + 'upload.path': 'Määritettyä kansiota ei löydy. Ole hyvä ja ota yhteyttä sivuston ylläpitäjään.', + 'upload.exists': 'Tiedosto on jo olemassa - siirto peruttu. Ole hyvä ja ota yhteyttä sivuston ylläpitäjään.', + 'upload.mime': 'Tiedostotyyppi ei ole sallittujen listalla - siirto peruttu.', + 'upload.extension': 'Tiedostopääte tuntematon, tai ei sallittujen listalla - siirto peruttu.', + 'upload.size': 'Tiedostokoko liian suuri palvelimelle. Ole hyvä ja siirrä pienempiä tiedostoja.', + 'upload.partial': 'Tiedonsiirto onnistui vain osittain - siirto epäonnistui. Ole hyvä ja siirrä tiedosto uudestaan', + 'upload.nofile': 'Tiedostoa ei määritetty.', + 'upload.default': 'Tiedonsiirto epäonnistui tunnistamattomasta syystä.', + + /* FU */ + uploader: { + unknown: 'Tunnistamaton virhe', + duplicate: 'Et voi lisätä seuraavaa tiedostoa: "${name}" (${size}), koska se on jo siirtolistalla!', + sizeLimitMin: 'Et voi lisätä seuraavaa tiedostoa: "${name}" (${size}). Tiedostojen minimikoko on ${size_min}!', + sizeLimitMax: 'Et voi lisätä seuraavaa tiedostoa: "${name}" (${size}). Tiedostojen maksimikoko on ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'Käyttääksesi FileManageria, tarvitset Adobe Flash Playerin. Lataa tästä.' + }, + + resizeImages: 'Pienennä liian suuret kuvat automaattisesti siirron yhteydessä' +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.fr.js 3 Jan 2016 20:51:52 -0000 1.1.2.1 @@ -0,0 +1,73 @@ +/* +Script: Language.fr.js + MooTools FileManager - Language Strings in French + +Translation: + [Samuel Sanchez](http://www.kromack.com) +*/ + +FileManager.Language.fr = { + more: 'Détails', + width: 'Largeur :', + height: 'Hauteur :', + + ok: 'Ok', + open: 'Sélectionner un fichier', + upload: 'Téléverser', + create: 'Créer un dossier', + createdir: 'Merci de spécifier un nom de dossier :', + cancel: 'Annuler', + + information: 'Informations', + type: 'Type :', + size: 'Taille :', + dir: 'Chemin :', + modified: 'Modifié le :', + preview: 'Aperçu', + close: 'Fermer', + destroy: 'Supprimer', + destroyfile: 'Voulez-vous vraiment supprimer ce fichier ?', + + rename: 'Renommer', + renamefile: 'Merci de spécifier un nouveau nom de fichier :', + + download: 'Télécharger', + nopreview: 'Aucun aperçu disponible', + + title: 'Titre :', + artist: 'Artiste :', + album: 'Album :', + length: 'Durée :', + bitrate: 'Débit :', + + deselect: 'Désélectionner', + + nodestroy: 'La suppression de fichier a été désactivée sur ce serveur.', + + 'upload.disabled': 'Le téléversement de fichier a été désactivé sur ce serveur.', + 'upload.authenticated': 'Vous n\'êtes pas authentifié et ne pouvez pas téléverser de fichier.', + 'upload.path': 'Le répertoire de téléversement spécifié n\'existe pas. Merci de contacter l\'administrateur de ce site Internet.', + 'upload.exists': 'Le chemin de téléversement spécifié existe déjà. Merci de contacter l\'administrateur de ce site Internet.', + 'upload.mime': 'Le type de fichier spécifié n\'est pas autorisé.', + 'upload.extension': 'Le fichier téléversé a une extension inconnue ou interdite.', + 'upload.size': 'La taille de votre fichier est trop grande pour être téléversée sur ce serveur. Merci de sélectionner un fichier moins lourd.', + 'upload.partial': 'Le fichier a été partiellement téléversé, merci de recommencer l\'opération.', + 'upload.nofile': 'Aucun fichier n\'a été spécifié.', + 'upload.default': 'Une erreur s\'est produite.', + + /* FU */ + uploader: { + unknown: 'Erreur inconnue', + duplicate: 'Vous ne pouvez pas ajouter "${name}" (${size}), car l\'élément est déjà ajoutée !', + sizeLimitMin: 'Vous ne pouvez pas ajouter "${name}" (${size}), la taille minimale des fichiers est de ${size_min}!', + sizeLimitMax: 'Vous ne pouvez pas ajouter "${name}" (${size}), la taille maximale des fichiers est de ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'Dans le but de téléverser des fichiers, vous devez installer Adobe Flash.' + }, + + resizeImages: 'Redimensionner les images pendant le téléversement' +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.it.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.it.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.it.js 3 Jan 2016 20:51:52 -0000 1.1.2.1 @@ -0,0 +1,80 @@ +/* +Script: Language.it.js + MooTools FileManager - Language Strings in English + +Translation: + Moreno Monga +*/ + +FileManager.Language.it = { + more: 'Dettagli', + width: 'Larghezza:', + height: 'Altezza:', + + ok: 'Ok', + open: 'Seleziona file', + upload: 'Upload', + create: 'Crea cartella', + createdir: 'Specifica il nome della cartella:', + cancel: 'Annulla', + + information: 'Informazioni', + type: 'Tipo:', + size: 'Dimensione:', + dir: 'Percorso:', + modified: 'Ultima modifica:', + preview: 'Anteprima', + close: 'Chiudi', + destroy: 'Cancella', + destroyfile: 'Sei sicuro di voler cancellare questo file?', + + rename: 'Rinomina', + renamefile: 'Scrivi un nuovo nome per il file:', + + download: 'Download', + nopreview: 'Non sono disponibili anteprime', + + title: 'Titolo:', + artist: 'Artista:', + album: 'Album:', + length: 'Lunghezza:', + bitrate: 'Bitrate:', + + deselect: 'Deseleziona', + + nodestroy: 'La cancellazioni dei file è disabilitata.', + + 'upload.disabled': 'L Upload dei file è disabilitato.', + 'upload.authenticated': 'Non sei autorizzato a fare l upload dei file.', + 'upload.path': 'La cartella degli upload non esiste. Contattare il webmaster.', + 'upload.exists': 'La cartella specificata per gli upload esiste già. Contattare il webmaster.', + 'upload.mime': 'Il tipo del file specificato non è consentito.', + 'upload.extension': 'Il tipo di file che si vuole caricare non è consentito o è sconosciuto.', + 'upload.size': 'La dimensione del file è troppo grande per essere processato. Ricarica un file con dimensioni ridotte.', + 'upload.partial': 'Il file è stato parzialmente caricato. Per favore, prova a ricaricarlo.', + 'upload.nofile': 'Non è stato specificato alcun file da caricare.', + 'upload.default': 'Mi spiace, l operazione non è andata a buon fine.', + + /* FU */ + uploader: { + unknown: 'Errore sconosciuto', + sizeLimitMin: 'Non puoi caricare "${name}" (${size}), la dimensione minima del file è ${size_min}!', + sizeLimitMax: 'Non puoi caricare "${name}" (${size}), la dimensione massima del file è ${size_max}!' + }, + + flash: { + hidden: 'To enable the embedded uploader, unblock it in your browser and refresh (see Adblock).', + disabled: 'To enable the embedded uploader, enable the blocked Flash movie and refresh (see Flashblock).', + flash: 'In order to upload files you need to install Adobe Flash.' + }, + + resizeImages: 'Ridimensiona immagini grandi', + + serialize: 'Salva galleria', + gallery: { + text: 'Titolo immagine', + save: 'Salva', + remove: 'Rimuovi dalla galleria', + drag: 'Sposta gli oggetti qui per creare una galleria...' + } +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.nl.js 3 Jan 2016 20:51:52 -0000 1.1.2.1 @@ -0,0 +1,72 @@ +/* +Script: Language.nl.js + MooTools FileManager - Language Strings in Dutch + +Translation: + [Dave De Vos](http://wnz.be) +*/ + +FileManager.Language.nl = { + more: 'Details', + width: 'Breedte:', + height: 'Hoogte:', + + ok: 'Ok', + open: 'Kies bestand', + upload: 'Uploaden', + create: 'Maak map', + createdir: 'Geef een map-naam op:', + cancel: 'Annuleren', + + information: 'Informatie', + type: 'Type:', + size: 'Grootte:', + dir: 'Locatie:', + modified: 'Laatste wijziging:', + preview: 'Voorbeeld', + close: 'Sluiten', + destroy: 'Verwijderen', + destroyfile: 'Ben je zeker dat je dit bestand wil verwijderen?', + + rename: 'Naam wijzigen', + renamefile: 'Geef een nieuwe bestandsnaam op:', + + download: 'Downloaden', + nopreview: 'G��n voorbeeld beschikbaar', + + title: 'Titel:', + artist: 'Artiest:', + album: 'Album:', + length: 'Lengte:', + bitrate: 'Bitrate:', + + deselect: 'Deselecteren', + + nodestroy: 'Het is niet mogelijk bestanden te verwijderen op deze server.', + + 'upload.disabled': 'Uploaden is uitgeschakeld op deze server.', + 'upload.authenticated': 'Je hebt geen toelating om bestanden te uploaden.', + 'upload.path': 'Deze upload-map bestaat niet. Contacteer de beheerder van deze website voor hulp.', + 'upload.exists': 'Deze upload-locatie bestaat reeds. Contacteer de beheerder van deze website voor hulp.', + 'upload.mime': 'Dit bestandstype is niet toegelaten.', + 'upload.extension': 'Het verstuurde bestand heeft een onbekende of niet-toegelaten extensie.', + 'upload.size': 'Het verstuurde bestand is te groot voor verwerking. Probeer opnieuw met een kleiner bestand.', + 'upload.partial': 'Het bestand dat je verstuurde werd slechts gedeeltelijk ontvangen, probeer het bestand opnieuw te versturen.', + 'upload.nofile': 'Er werd g��n bestand verstuurd.', + 'upload.default': 'Er ging iets fout bij het uploaden van het bestand.', + + /* FU */ + uploader: { + unknown: 'Onbekende fout', + sizeLimitMin: 'Je kan het bestand "${name}" (${size}) niet toevoegen, de minimum bestandsgrootte voor upload is ${size_min}!', + sizeLimitMax: 'Je kan het bestand "${name}" (${size}) niet toevoegen, de minimum bestandsgrootte voor upload is ${size_max}!' + }, + + flash: { + hidden: 'Om de ingebouwde uploader in te schakelen, deblokkeer deze in je browser en vernieuw de pagina (zie Adblock).', + disabled: 'Om de ingebouwde uploader in te schakelen, schakel het geblokkeerde Flash-component in en vernieuw de pagina (zie Flashblock).', + flash: 'Om bestanden te kunnen uploaden dien je Adobe Flash te installeren.' + }, + + resizeImages: 'Pas de dimensies van grote afbeeldingen aan' +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.pl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.pl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.pl.js 3 Jan 2016 20:51:52 -0000 1.1.2.1 @@ -0,0 +1,72 @@ +/* +Script: Language.pl.js + MooTools FileManager - Language Strings in Polish + +Translation: + [Marek Kalucki](http://www.webdeco.pl) +*/ + +FileManager.Language.pl = { + more: 'Szczegóły', + width: 'Szerokość:', + height: 'Wysokość:', + + ok: 'Ok', + open: 'Wybierz plik', + upload: 'Wyślij', + create: 'Stwórz folder', + createdir: 'Podaj nazwe folderu:', + cancel: 'Anuluj', + + information: 'Informacje', + type: 'Typ:', + size: 'Rozmiar:', + dir: 'Ścieżka:', + modified: 'Ost. modyfikacja:', + preview: 'Podgląd', + close: 'Zamknij', + destroy: 'Usuń', + destroyfile: 'Na pewno chcesz usunąć ten plik?', + + rename: 'Zmień nazwe', + renamefile: 'Podaj nową nazwę pliku:', + + download: 'Ściągnij', + nopreview: 'Podgląd niedostępny', + + title: 'Tytuł:', + artist: 'Wykonawca:', + album: 'Płyta:', + length: 'Długość:', + bitrate: 'Bitrate:', + + deselect: 'Odznacz', + + nodestroy: 'Usuwanie plików z serwera zostało wyłączone.', + + 'upload.disabled': 'Wysyłanie plików na serwer zostało wyłączone.', + 'upload.authenticated': 'Nie jesteś upoważniony do wysyłania plików na serwer.', + 'upload.path': 'Folder do wysyłania plików nie istnieje. Skontaktuj się z administratorem.', + 'upload.exists': 'Folder do wysyłania plików istnieje. Skontaktuj się z administratorem.', + 'upload.mime': 'Typ wybranego pliku jest niedozwolony.', + 'upload.extension': 'Wysyłany plik ma nieznane lub niedozwolone rozszerzenie.', + 'upload.size': 'Rozmiar wysyłanego pliku jest zbyt duży. Wyślij mniejszy plik (jeśli wysyłasz obrazy-zmniejsz obraz na swoim komputerze i ponów wysyłanie).', + 'upload.partial': 'Plik nie został wysłany w całości. Ponów próbę wysyłki pliku.', + 'upload.nofile': 'Nie wybrano pliku do wysyłki.', + 'upload.default': 'Wystąpił błąd w trakcie wysyłki.', + + /* FU */ + uploader: { + unknown: 'Wystąpił nieznany błąd.', + sizeLimitMin: 'Nie można wybrać "${name}" (${size}), minimalny rozmiar pliku to ${size_min}!', + sizeLimitMax: 'Nie można wybrać "${name}" (${size}), maksymalny rozmiar pliku to ${size_max}!' + }, + + flash: { + hidden: 'Aby włączyć wysyłanie plików, odblokuj go w swojej przeglądarce i odśwież stronę (prawdopodobnie wysyłanie plików jest blokowane przez wtyczkę Adblock).', + disabled: 'Aby włączyć wysyłanie plików, odblokuj obiekt flash i odśwież stronę (prawdopodobnie wysyłanie plików blokowane jest przez wtyczkę Flashblock).', + flash: 'Aby wysyłać pliki na serwer, należy zainstalować w przeglądarce wtyczkę Adobe Flash.' + }, + + resizeImages: 'Zmniejsz duże obrazy w trakcie wysyłania' +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.pt.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.pt.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.pt.js 3 Jan 2016 20:51:52 -0000 1.1.2.1 @@ -0,0 +1,80 @@ +/* +Script: Language.pt.js + MooTools FileManager - Language Strings in European Portuguese + +Translation: + [Alexandre Rocha](http://twitter.com/procy0n) +*/ + +FileManager.Language.en = { + more: 'Detalhes', + width: 'Largura:', + height: 'Altura:', + + ok: 'Ok', + open: 'Seleccionar ficheiro', + upload: 'Enviar', + create: 'Criar pasta', + createdir: 'Por favor especifique o nome da pasta:', + cancel: 'Cancelar', + + information: 'Informação', + type: 'Tipo:', + size: 'Tamanho:', + dir: 'Caminho:', + modified: 'Última modificação:', + preview: 'Pré-visualizar', + close: 'Fechar', + destroy: 'Apagar', + destroyfile: 'Tem a certeza que quer apagar este ficheiro?', + + rename: 'Renomear', + renamefile: 'Por favor introduza o novo nome do ficheiro:', + + download: 'Descarregar', + nopreview: 'Pré-visualização não disponível', + + title: 'Título:', + artist: 'Artista:', + album: 'Album:', + length: 'Duração:', + bitrate: 'Taxa de bits:', + + deselect: 'Desfazer', + + nodestroy: 'Apagamento de ficheiros desactivado neste servidor.', + + 'upload.disabled': 'Envio de ficheiros desactivado neste servidor.', + 'upload.authenticated': 'Não está autenticado para o envio de ficheiros.', + 'upload.path': 'A pasta especificada para envio de ficheiros não existe. Por favor contacte o administrador do site.', + 'upload.exists': 'O caminho especificado já existe. Por favor contacte o administrador do site.', + 'upload.mime': 'Tipo de ficheiro especificado não permitido.', + 'upload.extension': 'Extensão do ficheiro enviado desconhecido ou não permitido.', + 'upload.size': 'Tamanho do ficheiro demasiado grande para ser processado neste servidor. Por favor envie um ficheiro mais pequeno.', + 'upload.partial': 'Envio incompleto do ficheiro, por favor tente novamente.', + 'upload.nofile': 'Nenhum ficheiro seleccionado para enviar.', + 'upload.default': 'Erro no envio do ficheiro.', + + /* FU */ + uploader: { + unknown: 'Erro desconhecido', + sizeLimitMin: 'Não é permitido anexar "${name}" (${size}), o tamanho mínimo do ficheiro é de${size_min}!', + sizeLimitMax: 'Não é permitido anexar "${name}" (${size}), o tamanho máximo do ficheiro é de ${size_max}!' + }, + + flash: { + hidden: 'Para activar o envio, desbloqueie-o no navegador e recarregue a página (ver Adblock).', + disabled: 'Para activar o envio, active o ficheiro Flash e recarregue a página (ver Flashblock).', + flash: 'Para enviar ficheiros precisa de instalar Adobe Flash.' + }, + + resizeImages: 'Redimensionar imagens grandes ao enviar', + + serialize: 'Guardar galeria', + gallery: { + text: 'Legenda da imagem', + save: 'Guardar', + remove: 'Remover da galeria', + drag: 'Arraste os items para criar a galeria...' + } +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.ru.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.ru.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.ru.js 3 Jan 2016 20:51:52 -0000 1.1.2.1 @@ -0,0 +1,72 @@ +/* +Script: Language.ru.js + MooTools FileManager - Language Strings in Russian + +Translation: + [Ilya V. Goryachev](http://cok-studio.ru/) +*/ + +FileManager.Language.ru = { + more: 'Подробнее', + width: 'Ширина:', + height: 'Высота:', + + ok: 'Ok', + open: 'Выбрать файл', + upload: 'Загрузка', + create: 'Создать папку', + createdir: 'Пожалуйста укажите имя папки:', + cancel: 'Отмена', + + information: 'Информация', + type: 'Тип:', + size: 'Размер:', + dir: 'Путь:', + modified: 'Последнее изменение:', + preview: 'Предпросмотр', + close: 'Закрыть', + destroy: 'Удалить', + destroyfile: 'Уверены, что хотите удалить этот файл?', + + rename: 'Переименовать', + renamefile: 'Пожалуйста укажите имя файла:', + + download: 'Скачать', + nopreview: 'Предпросмотр недоступен', + + title: 'Название:', + artist: 'Исполнитель:', + album: 'Альбом:', + length: 'Продолжительность:', + bitrate: 'Битрэйт:', + + deselect: 'Снять выделение', + + nodestroy: 'Удаление файлов отключено на сервере.', + + 'upload.disabled': 'Загрузка файлов отключена на сервере.', + 'upload.authenticated': 'Вам не разрешено загружать файлы.', + 'upload.path': 'Указанная директория для загрузки файлов не существует. Пожалуйста обратитесь к администратору сайта.', + 'upload.exists': 'Указанная директория для загрузки файлов уже существует. Пожалуйста обратитесь к администратору сайта', + 'upload.mime': 'Такой тип файла не поддерживается.', + 'upload.extension': 'Загруженный файл не опознан или такое расширение не разрешено.', + 'upload.size': 'Размер загружаемого файла слишком велик. Пожалуйста загрузите файл поменьше.', + 'upload.partial': 'Файл был загружен частично, пожалуйста загрузите этот файл еще раз.', + 'upload.nofile': 'Не указаны файлы для загрузки.', + 'upload.default': 'При загрузке файлов что-то пошло не так.', + + /* FU */ + uploader: { + unknown: 'Неизвестная ошибка', + sizeLimitMin: 'Невозможно прикрепить файл "${name}" (${size}), минимальный размер фала ${size_min}!', + sizeLimitMax: 'Невозможно прикрепить файл "${name}" (${size}), максимальный размер файла ${size_max}!' + }, + + flash: { + hidden: 'Чтобы включить embedded загрузчик, разблокируйте подключаемые элементы в вашем браузере (см. Блокировку рекламы).', + disabled: 'Чтобы включить embedded загрузчик, снимите блокировку флеш и обновите страницу (см. Блокировка флеш).', + flash: 'Чтобы загружать файлы, Вам необходимо установить Adobe Flash.' + }, + + resizeImages: 'Менять размер больших изображений при загрузке' +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.se.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.se.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.se.js 3 Jan 2016 20:51:53 -0000 1.1.2.1 @@ -0,0 +1,73 @@ +/* +Script: Language.se.js + MooTools FileManager - Language Strings in Swedish + +Translation: + [Marcus *xintron* Carlsson](http://xintron.se) +*/ + +FileManager.Language.se = { + more: 'Detaljer', + width: 'Bredd:', + height: 'Höjd:', + + ok: 'Ok', + open: 'Välj fil', + upload: 'Ladda upp', + create: 'Skapa mapp', + createdir: 'Vänligen ange ett mapp-namn:', + cancel: 'Avbryt', + + information: 'Information', + type: 'Typ:', + size: 'Storlek:', + dir: 'Sökväg:', + modified: 'Senast ändad:', + preview: 'Förhandsgranska', + close: 'Stäng', + destroy: 'Ta bort', + destroyfile: 'Är du säker på att du vill ta bort filen?', + + rename: 'Döp om', + renamefile: 'Vänligen ange ett nytt filnamn:', + + download: 'Ladda ner', + nopreview: 'Ingen förhandsgranskning tillgänglig', + + title: 'Titel:', + artist: 'Artist:', + album: 'Album:', + length: 'Längd:', + bitrate: 'Bitrate:', + + deselect: 'Avmarkera', + + nodestroy: 'Funktionen ta bort filer är avstängd på denna server.', + + 'upload.disabled': 'Uppladdning är avstängt på denna server.', + 'upload.authenticated': 'Du har inte behörighet att ladda upp filer.', + 'upload.path': 'Den angivna uppladdnings-mappen existerar inte. Vänligen kontakta serveradministratören.', + 'upload.exists': 'Den angivna uppladdnings-mappen existerar redan. Vänligen kontakta serveradministratören.', + 'upload.mime': 'Denna filtyp accepteras inte på denna server.', + 'upload.extension': 'Den uppladdade filen har en okänd eller förbjuden filändelse.', + 'upload.size': 'Filen är för stor för denna server. Vänligen ladda upp en mindre fil.', + 'upload.partial': 'Ett fel uppstod och hela filen kunde inte laddas upp. Vänligen försök igen.', + 'upload.nofile': 'Du måste välja en fil att ladda upp.', + 'upload.default': 'Ett fel inträffade under uppladdningen.', + + /* FU */ + uploader: { + unknown: 'Okänt fel', + duplicate: 'Du kan inte ladda upp "${name}" (${size}), filen existerar redan!', + sizeLimitMin: 'Du kan inte ladda upp "${name}" (${size}), minsta storlek som accepteras är ${size_min}!', + sizeLimitMax: 'Du kan inte ladda upp "${name}" (${size}), filens storlek får inte överstiga ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'För att kunna ladda upp filer behöver du ha Adobe Flash installerat.' + }, + + resizeImages: 'Ändra storleken på bilden under uppladdningen' +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Additions.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Additions.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Additions.js 3 Jan 2016 20:51:53 -0000 1.1.2.1 @@ -0,0 +1,206 @@ +/* +--- +description: FileManager Additions + +authors: + - Christoph Pojer + +requires: + core/1.2.4: '*' + +provides: + - filemanager.additions + +license: + MIT-style license + +contains: + - Element.appearOn: Can be used to show an element when another one is hovered: $(myElement).appearOn(myWrapper) + - Element.center: Centers an element + - Dialog, Overlay: Classes used by the FileManager +... +*/ + +(function(){ + +Element.implement({ + + appearOn: function(el) { + + var params = Array.link($A(arguments).erase(arguments[0]), {options: Object.type, opacity: $defined}), + opacity = $type(params.opacity) == 'array' ? [params.opacity[0] || 1, params.opacity[1] || 0] : [params.opacity || 1, 0]; + + this.set({ + opacity: opacity[1], + tween: params.options || {duration: 500} + }); + + $$(el).addEvents({ + mouseenter: this.fade.bind(this, opacity[0]), + mouseleave: this.fade.bind(this, opacity[1]) + }); + + return this; + }, + + center: function(offsets){ + var scroll = document.getScroll(), + offset = document.getSize(), + size = this.getSize(), + values = {x: 'left', y: 'top'}; + + if (!offsets) offsets = {}; + + for (var z in values){ + var style = scroll[z] + (offset[z] - size[z]) / 2 + (offsets[z] || 0); + this.setStyle(values[z], style < 10 ? 10 : style); + } + + return this; + } + +}); + +this.Dialog = new Class({ + + Implements: [Options, Events], + + options: { + /*onShow: $empty, + onOpen: $empty, + onConfirm: $empty, + onDecline: $empty, + onClose: $empty,*/ + request: null, + buttons: ['confirm', 'decline'], + language: {} + }, + + initialize: function(text, options){ + this.setOptions(options); + + this.el = new Element('div', { + 'class': 'fm-dialog fm-dialog-engine-' + Browser.Engine.name + ' fm-dialog-engine-' + Browser.Engine.name + (Browser.Engine.trident ? Browser.Engine.version : ''), + opacity: 0, + tween: {duration: 250} + }).adopt([ + $type(text) == 'string' ? new Element('div', {text: text}) : text + ]); + + if (this.options.content) this.el.getElement('div').adopt(this.options.content); + + Array.each(this.options.buttons, function(v){ + new Element('button', {'class': 'fm-dialog-' + v, text: this.options.language[v]}).addEvent('click', (function(e){ + if (e) e.stop(); + this.fireEvent(v).fireEvent('close'); + this.overlay.hide(); + this.destroy(); + }).bind(this)).inject(this.el); + }, this); + + this.overlay = new Overlay({ + 'class': 'fm-overlay fm-overlay-dialog', + events: {click: this.fireEvent.bind(this, ['close'])}, + tween: {duration: 250} + }); + + this.bound = { + scroll: (function(){ + if (!this.el) this.destroy(); + else this.el.center(); + }).bind(this), + keyesc: (function(e){ + if (e.key == 'esc') this.fireEvent('close').destroy(); + }).bind(this) + }; + + this.show(); + }, + + show: function(){ + this.overlay.show(); + var self = this.fireEvent('open'); + this.el.setStyle('display', 'block').inject(document.body).center().fade(1).get('tween').chain(function(){ + var button = this.element.getElement('button.fm-dialog-confirm') || this.element.getElement('button'); + if (button) button.focus(); + self.fireEvent('show'); + }); + + window.addEvents({ + scroll: this.bound.scroll, + resize: this.bound.scroll, + keyup: this.bound.keyesc + }); + }, + + destroy: function(){ + if (this.el) this.el.fade(0).get('tween').chain((function(){ + this.overlay.destroy(); + this.el.destroy(); + }).bind(this)); + + window.removeEvent('scroll', this.bound.scroll).removeEvent('resize', this.bound.scroll).removeEvent('keyup', this.bound.keyesc); + } + +}); + +this.Overlay = new Class({ + + initialize: function(options){ + this.el = new Element('div', $extend({ + 'class': 'fm-overlay' + }, options)).inject(document.body); + }, + + show: function(){ + this.objects = $$('object, select, embed').filter(function(el){ + return el.id == 'SwiffFileManagerUpload' || el.style.visibility == 'hidden' ? false : !!(el.style.visibility = 'hidden'); + }); + + this.resize = (function(){ + if (!this.el) this.destroy(); + else this.el.setStyles({ + width: document.getScrollWidth(), + height: document.getScrollHeight() + }); + }).bind(this); + + this.resize(); + + this.el.setStyles({ + opacity: 0, + display: 'block' + }).get('tween').pause().start('opacity', 0.5); + + window.addEvent('resize', this.resize); + + return this; + }, + + hide: function(){ + this.el.fade(0).get('tween').chain((function(){ + this.revertObjects(); + this.el.setStyle('display', 'none'); + }).bind(this)); + + window.removeEvent('resize', this.resize); + + return this; + }, + + destroy: function(){ + this.revertObjects().el.destroy(); + }, + + revertObjects: function(){ + if (this.objects && this.objects.length) + this.objects.each(function(el){ + el.style.visibility = 'visible'; + }); + + return this; + } + +}); + +})(); \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.TinyMCE.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.TinyMCE.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.TinyMCE.js 3 Jan 2016 20:51:53 -0000 1.1.2.1 @@ -0,0 +1,56 @@ +/* +--- +description: FileManager.TinyMCE +longdescription: MooTools FileManager for integration with [TinyMCE](http://tinymce.moxiecode.com/) + +authors: + - Christoph Pojer + +requires: + core/1.2.4: '*' + +provides: + - filemanager.tinymce + +license: + MIT-style license + +Usage: + - Pass this to the "file_browser_callback"-option of TinyMCE: FileManager.TinyMCE(function(){ return {FileManagerOptions}; }); + - See the Demo for an example. +... +*/ + +FileManager.TinyMCE = function(options){ + return function(field, url, type, win){ + var manager = new FileManager($extend({ + onComplete: function(path){ + if (!win.document) return; + win.document.getElementById(field).value = path; + if (win.ImageDialog) win.ImageDialog.showPreviewImage(path, 1); + this.container.destroy(); + } + }, options(type))); + manager.dragZIndex = 400002; + manager.SwiffZIndex = 400003; + manager.el.setStyle('zIndex', 400001); + manager.overlay.el.setStyle('zIndex', 400000); + document.id(manager.tips).setStyle('zIndex', 400010); + manager.show(); + return manager; + }; +}; + +FileManager.implement('SwiffZIndex', 400003); + +var Dialog = new Class({ + + Extends: Dialog, + + initialize: function(text, options){ + this.parent(text, options); + this.el.setStyle('zIndex', 400010); + this.overlay.el.setStyle('zIndex', 400009); + } + +}); \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.js 3 Jan 2016 20:51:53 -0000 1.1.2.1 @@ -0,0 +1,736 @@ +/* +--- +description: FileManager + +authors: + - Christoph Pojer + +requires: + core/1.2.4: '*' + more/1.2.4.2: [Drag, Drag.Move, Tips, Assets, Element.Delegation] + +provides: + - filemanager + +license: + MIT-style license + +version: + 1.0 + +todo: + - Add Scroller.js (optional) for Drag&Drop in the Filelist + +inspiration: + - Loosely based on a Script by [Yannick Croissant](http://dev.k1der.net/dev/brooser-un-browser-de-fichier-pour-mootools/) + +options: + - url: (string) The base url to the Backend FileManager, without QueryString + - baseURL: (string) Absolute URL to the FileManager files + - assetBasePath: (string) The path to all images and swf files + - selectable: (boolean, defaults to *false*) If true, provides a button to select a file + - language: (string, defaults to *en*) The language used for the FileManager + - hideOnClick: (boolean, defaults to *false*) When true, hides the FileManager when the area outside of it is clicked + - directory: (string) Can be used to load a subfolder instead of the base folder + +events: + - onComplete(path, file): fired when a file gets selected via the "Select file" button + - onModify(file): fired when a file gets renamed/deleted or modified in another way + - onShow: fired when the FileManager opens + - onHide: event fired when FileManager closes + - onPreview: event fired when the user clicks an image in the preview + - onDetails: event fired when the details are updated after user picking a file + - onHidePreview: event fired when the "preview" is hidden (usually, user uploading file, or changing directory) +... +*/ + +var FileManager = new Class({ + + Implements: [Options, Events], + + Request: null, + Directory: null, + Current: null, + + options: { + /*onComplete: $empty, + onModify: $empty, + onShow: $empty, + onHide: $empty, + onPreview: $empty, + onDetails: $empty, // Xinha: Fired when an item is picked form the files list, supplied object (eg {width: 123, height:456} ) + onHidePreview: $empty, // Xinha: Fired when the preview is hidden (eg when uploading) */ + directory: '', + url: null, + baseURL: '', + assetBasePath: null, + selectable: false, + hideOnClick: false, + language: 'en' + }, + + hooks: { + show: {}, + cleanup: {} + }, + + initialize: function(options){ + this.setOptions(options); + this.options.assetBasePath = this.options.assetBasePath.replace(/(\/|\\)*$/, '/'); + this.dragZIndex = 1300; + this.droppables = []; + this.Directory = this.options.directory; + + this.language = $unlink(FileManager.Language.en); + if (this.options.language != 'en') this.language = $merge(this.language, FileManager.Language[this.options.language]); + + this.container = new Element('div', {'class': 'filemanager-container filemanager-engine-' + Browser.Engine.name + (Browser.Engine.trident ? Browser.Engine.version : '')}); + this.el = new Element('div', {'class': 'filemanager'}).inject(this.container); + this.menu = new Element('div', {'class': 'filemanager-menu'}).inject(this.el); + this.loader = new Element('div', {'class': 'loader', opacity: 0, tween: {duration: 200}}).inject(this.menu); + + var self = this; + this.relayClick = function(e){ + if(e) e.stop(); + var file = this.retrieve('file'); + if (this.retrieve('block') && !Browser.Engine.trident){ + this.eliminate('block'); + return; + } + + if (file.mime == 'text/directory'){ + this.addClass('selected'); + self.load(self.Directory + '/' + file.name); + return; + } + + + if (self.Current) self.Current.removeClass('selected'); + self.Current = this.addClass('selected'); // NB: Also sets self.Current + + // Xinha: We need to have Current assigned before fillInfo because fillInfo adds to it + self.fillInfo(file); + self.switchButton(); + }; + this.browser = new Element('ul', {'class': 'filemanager-browser'}).addEvents({ + click: (function(){ + // return self.deselect(); + }), + 'click:relay(li span.fi)': this.relayClick + }).inject(this.el); + + if (this.options.upload) this.addMenuButton('create'); // Xinha: Create directory permission = upload + if (this.options.selectable) this.addMenuButton('open'); + + this.info = new Element('div', {'class': 'filemanager-infos', opacity: 0}).inject(this.el); + + var head = new Element('div', {'class': 'filemanager-head'}).adopt([ + new Element('img', {'class': 'filemanager-icon'}), + new Element('h1') + ]); + + // Xinha: We need to groupt he headers and lists togethor because we will + // use some CSS to reorganise a bit. So we create "infoarea" which + // will contain the h2 and list for the "Information", that is + // modification date, size, directory etc... + var infoarea = new Element('div', {'class': 'filemanager-info-area'}); + + this.info.adopt([head, infoarea.adopt(new Element('h2', {text: this.language.information}))]); + + new Element('dl').adopt([ + new Element('dt', {text: this.language.modified}), + new Element('dd', {'class': 'filemanager-modified'}), + new Element('dt', {text: this.language.type}), + new Element('dd', {'class': 'filemanager-type'}), + new Element('dt', {text: this.language.size}), + new Element('dd', {'class': 'filemanager-size'}), + new Element('dt', {text: this.language.dir}), + new Element('dd', {'class': 'filemanager-dir'}) + ]).inject(infoarea); + + this.preview = new Element('div', {'class': 'filemanager-preview'}).addEvent('click:relay(img.preview)', function(){ + self.fireEvent('preview', [this.get('src')]); + }); + + // Xinha: We need to group the headers and lists togethor because we will + // use some CSS to reorganise a bit. So we create "filemanager-preview-area" which + // will contain the h2 for the preview and also the preview content returned from + // Backend/FileManager.php + this.info.adopt((new Element('div', {'class': 'filemanager-preview-area'})).adopt([ + new Element('h2', {'class': 'filemanager-headline', text: this.language.preview}), + this.preview + ])); + + this.closeIcon = new Element('div', { + 'class': 'filemanager-close', + title: this.language.close, + events: {click: this.hide.bind(this)} + }).adopt(new Asset.image(this.options.assetBasePath + 'destroy.png')).inject(this.el); + + this.tips = new Tips({ + className: 'tip-filebrowser', + offsets: {x: 15, y: 0}, + text: null, + showDelay: 50, + hideDelay: 50, + onShow: function(){ + this.tip.set('tween', {duration: 250}).setStyle('display', 'block').fade(1); + }, + onHide: function(){ + this.tip.fade(0).get('tween').chain(function(){ + this.element.setStyle('display', 'none'); + }); + } + }); + this.tips.attach(this.closeIcon.appearOn(this.closeIcon, [1, 0.8]).appearOn(this.el, 0.8)); + + this.imageadd = new Asset.image(this.options.assetBasePath + 'add.png', { + 'class': 'browser-add' + }).set('opacity', 0).inject(this.container); + + this.container.inject(document.body); + this.overlay = new Overlay(this.options.hideOnClick ? { + events: {click: this.hide.bind(this)} + } : null); + + this.bound = { + keydown: (function(e){ + if (e.control || e.meta) this.imageadd.fade(1); + }).bind(this), + keyup: (function(){ + this.imageadd.fade(0); + }).bind(this), + keyesc: (function(e){ + if (e.key=='esc') this.hide(); + }).bind(this), + scroll: (function(){ + this.el.center(this.offsets); + this.fireEvent('scroll'); + }).bind(this) + }; + }, + + show: function(e){ + if (e) e.stop(); + + this.load(this.Directory); + this.overlay.show(); + + this.info.set('opacity', 0); + + (function(){ + this.container.setStyles({ + opacity: 0, + display: 'block' + }); + + this.el.center(this.offsets); + this.fireEvent('show'); + this.container.set('opacity', 1); + this.fireHooks('show'); + + window.addEvents({ + scroll: this.bound.scroll, + resize: this.bound.scroll, + keyup: this.bound.keyesc + }); + }).delay(500, this); + }, + + hide: function(e){ + if (e) e.stop(); + + this.overlay.hide(); + this.tips.hide(); + this.browser.empty(); + this.container.setStyle('display', 'none'); + + this.fireHooks('cleanup').fireEvent('hide'); + window.removeEvent('scroll', this.bound.scroll).removeEvent('resize', this.bound.scroll).removeEvent('keyup', this.bound.keyesc); + }, + + open: function(e){ + e.stop(); + + if (!this.Current) return false; + + this.fireEvent('complete', [ + // Xinha: The URL path returned by normal MootoolsFileManager is odd, it includes the last component + // of the base directory, that is, if your base is /foo/bar/images then we get something like + // images/narf.jpg. + // To work around this we take the URL which was worked out by Backend/FileManager.php + // and return that as the url. + this.normalize(this.Current.file_data ? this.Current.file_data.url : this.Directory + '/' + this.Current.retrieve('file').name), + this.Current.retrieve('file') + ]); + this.hide(); + }, + + create: function(e){ + e.stop(); + + var self = this; + new Dialog(this.language.createdir, { + language: { + confirm: this.language.create, + decline: this.language.cancel + }, + content: [ + new Element('input', {'class': 'createDirectory'}) + ], + onOpen: this.onDialogOpen.bind(this), + onClose: this.onDialogClose.bind(this), + onShow: function(){ + var self = this; + this.el.getElement('input').addEvent('keyup', function(e){ + if (e.key == 'enter') self.el.getElement('button-confirm').fireEvent('click'); + }).focus(); + }, + onConfirm: function(){ + new FileManager.Request({ + url: self.options.url + '?event=create', + onSuccess: self.fill.bind(self), + data: { + file: this.el.getElement('input').get('value'), + directory: self.Directory + } + }, self).post(); + } + }); + }, + + deselect: function(el){ + if (el && this.Current != el) return; + + if (el) this.fillInfo(); + if (this.Current) this.Current.removeClass('selected'); + this.Current = null; + + this.switchButton(); + }, + + /* XINHA: We add a callback capability which will be called whe the loading is completed. + * NOTE: For some reason, MFM wants the dir to include the last component of the prefix + * eg if your images_dir is /fancy/images and you want to load /fancy/images/foo/bar you must pass + * images/foo/bar -- crazy annoying + */ + + load: function(dir, nofade, callback){ + this.deselect(); + if (!nofade) this.info.fade(0); + + if (this.Request) this.Request.cancel(); + + this.Request = new FileManager.Request({ + url: this.options.url, + onSuccess: (function(j){ + this.fill(j, nofade); + if(callback) callback(j); + }).bind(this), + data: { + directory: dir + } + }, this).post(); + }, + + destroy: function(e, file){ + e.stop(); + this.tips.hide(); + + var self = this; + new Dialog(this.language.destroyfile, { + language: { + confirm: this.language.destroy, + decline: this.language.cancel + }, + onOpen: this.onDialogOpen.bind(this), + onClose: this.onDialogClose.bind(this), + onConfirm: function(){ + new FileManager.Request({ + url: self.options.url + '?event=destroy', + data: { + file: file.name, + directory: self.Directory + }, + onSuccess: function(j){ + if (!j || j.content!='destroyed'){ + new Dialog(self.language.nodestroy, {language: {confirm: self.language.ok}, buttons: ['confirm']}); + return; + } + + self.fireEvent('modify', [$unlink(file)]); + file.element.getParent().fade(0).get('tween').chain(function(){ + self.deselect(file.element); + this.element.destroy(); + }); + } + }, self).post(); + } + }); + + }, + + rename: function(e, file){ + e.stop(); + this.tips.hide(); + + var name = file.name; + if (file.mime != 'text/directory') name = name.replace(/\..*$/, ''); + + var self = this; + new Dialog(this.language.renamefile, { + language: { + confirm: this.language.rename, + decline: this.language.cancel + }, + content: [ + new Element('input', {'class': 'rename', value: name}) + ], + onOpen: this.onDialogOpen.bind(this), + onClose: this.onDialogClose.bind(this), + onShow: function(){ + var self = this; + this.el.getElement('input').addEvent('keyup', function(e){ + if (e.key=='enter') self.el.getElement('button-confirm').fireEvent('click'); + }).focus(); + }, + onConfirm: function(){ + new FileManager.Request({ + url: self.options.url + '?event=move', + onSuccess: (function(j){ + if (!j || !j.name) return; + + self.fireEvent('modify', [$unlink(file)]); + + file.element.getElement('span').set('text', j.name); + file.name = j.name; + self.fillInfo(file); + }).bind(this), + data: { + file: file.name, + name: this.el.getElement('input').get('value'), + directory: self.Directory + } + }, self).post(); + } + }); + }, + + fill: function(j, nofade){ + this.Directory = j.path; + this.CurrentDir = j.dir; + if (!nofade) this.fillInfo(j.dir); + this.browser.empty(); + + if (!j.files) return; + + var els = [[], []]; + $each(j.files, function(file){ + file.dir = j.path; + var el = file.element = new Element('span', {'class': 'fi', href: '#'}).adopt( + new Asset.image(this.options.assetBasePath + 'Icons/' + file.icon + '.png'), + new Element('span', {text: file.name}) + ).store('file', file); + + var icons = []; + if (file.mime!='text/directory') + icons.push(new Asset.image(this.options.assetBasePath + 'disk.png', {title: this.language.download}).addClass('browser-icon').addEvent('click', (function(e){ + this.tips.hide(); + e.stop(); + window.open(this.options.baseURL + this.normalize(this.Directory + '/' + file.name)); + }).bind(this)).inject(el, 'top')); + + if (file.name != '..') + ['rename', 'destroy'].each(function(v){ + icons.push(new Asset.image(this.options.assetBasePath + v + '.png', {title: this.language[v]}).addClass('browser-icon').addEvent('click', this[v].bindWithEvent(this, [file])).injectTop(el)); + }, this); + + els[file.mime == 'text/directory' ? 1 : 0].push(el); + if (file.name == '..') el.set('opacity', 0.7); + el.inject(new Element('li').inject(this.browser)).store('parent', el.getParent()); + icons = $$(icons.map(function(icon){ return icon.appearOn(icon, [1, 0.7]); })).appearOn(el.getParent('li'), 0.7); + }, this); + this.CurrentFiles = j.files; // XINHA - fillInfo() will use this to find a pre-selected file + + var self = this, revert = function(el){ + el.set('opacity', 1).store('block', true).removeClass('drag').removeClass('move').setStyles({ + opacity: 1, + zIndex: '', + position: 'relative', + width: 'auto', + left: 0, + top: 0 + }).inject(el.retrieve('parent')); + // el.getElements('img.browser-icon').set('opacity', 0); // XINHA - NOT REQUIRED? + + document.removeEvents('keydown', self.bound.keydown).removeEvents('keyup', self.bound.keydown); + self.imageadd.fade(0); + + self.relayClick.apply(el); + }; + + if(0) // This (drag to move into subdirectory) is breaking IE, we don't need it that badly + // See: http://github.com/cpojer/mootools-filemanager/issues#issue/11 + $$(els[0]).makeDraggable({ + droppables: $$(this.droppables, els[1]), + + onDrag: function(el, e){ + self.imageadd.setStyles({ + left: e.page.x + 15, + top: e.page.y + 15 + }); + }, + + onBeforeStart: function(el){ + self.deselect(); + self.tips.hide(); + var position = el.getPosition(); + el.addClass('drag').setStyles({ + zIndex: self.dragZIndex, + position: 'absolute', + width: el.getWidth() - el.getStyle('paddingLeft').toInt(), + left: position.x, + top: position.y + }).inject(self.container); + }, + + onCancel: revert, + + onStart: function(el){ + el.set('opacity', 0.7).addClass('move'); + document.addEvents({ + keydown: self.bound.keydown, + keyup: self.bound.keyup + }); + }, + + onEnter: function(el, droppable){ + droppable.addClass('droppable'); + }, + + onLeave: function(el, droppable){ + droppable.removeClass('droppable'); + }, + + onDrop: function(el, droppable, e){ + revert(el); + + if (e.control || e.meta || !droppable) el.setStyles({left: 0, top: 0}); + if (!droppable && !e.control && !e.meta) return; + + var dir; + if (droppable){ + droppable.addClass('selected').removeClass('droppable'); + (function(){ droppable.removeClass('selected'); }).delay(300); + if (self.onDragComplete(el, droppable)) return; + + dir = droppable.retrieve('file'); + } + var file = el.retrieve('file'); + + new FileManager.Request({ + url: self.options.url + '?event=move', + data: { + file: file.name, + directory: self.Directory, + newDirectory: dir ? dir.dir + '/' + dir.name : self.Directory, + copy: e.control || e.meta ? 1 : 0 + }, + onSuccess: function(){ + if (!dir) self.load(self.Directory); + } + }, self).post(); + + self.fireEvent('modify', [$unlink(file)]); + + if (!e.control && !e.meta) + el.fade(0).get('tween').chain(function(){ + self.deselect(el); + el.getParent().destroy(); + }); + } + }); + + $$(els).setStyles({left: 0, top: 0}); + + this.tips.attach(this.browser.getElements('img.browser-icon')); + }, + + fillInfo: function(file, path){ + if (!file) file = this.CurrentDir; + if (!path) path = this.Directory; + + if (!file) return; + + /* XINHA: In order to facilitate pre-selecting an image/file for modification, we can pass in a filename (just the basename) + as file and we will search in the current files for it. You must have done a load first, and call the fillInfo as a result of the load. + YourImageManager.load('path/to/dir', true, function() { YourImageManager.fillInfo('file.jpg'); }); + */ + var self = this; + if(typeof file == 'string') + { + if(this.CurrentFiles) + { + this.CurrentFiles.each(function(f) + { + if(typeof file != 'string') return; + if(f.name == file) + { + file = f; + if(file.element) + { + self.Current = file.element.addClass('selected'); + self.switchButton(); + } + + } + }); + } + } + + var size = this.size(file.size); + + this.info.fade(1).getElement('img').set({ + src: this.options.assetBasePath + 'Icons/' + file.icon + '.png', + alt: file.mime + }); + + this.fireHooks('cleanup'); + this.preview.empty(); + + // Xinha: We need to remove our custom attributes form when the preview is hidden + this.fireEvent('hidePreview'); + + this.info.getElement('h1').set('text', file.name); + this.info.getElement('dd.filemanager-modified').set('text', file.date); + this.info.getElement('dd.filemanager-type').set('text', file.mime); + this.info.getElement('dd.filemanager-size').set('text', !size[0] && size[1] == 'Bytes' ? '-' : (size.join(' ') + (size[1] != 'Bytes' ? ' (' + file.size + ' Bytes)' : ''))); + this.info.getElement('h2.filemanager-headline').setStyle('display', file.mime == 'text/directory' ? 'none' : 'block'); + + var text = [], pre = []; + + path.split('/').each(function(v){ + if (!v) return; + + pre.push(v); + text.push(new Element('a', { + 'class': 'icon', + href: '#', + text: v + }).addEvent('click', (function(e, dir){ + e.stop(); + + this.load(dir); + }).bindWithEvent(this, [pre.join('/')])) + ); + text.push(new Element('span', {text: ' / '})); + }, this); + + text.pop(); + text[text.length-1].addClass('selected').removeEvents('click').addEvent('click', function(e){ e.stop(); }); + + this.info.getElement('dd.filemanager-dir').empty().adopt(new Element('span', {text: '/ '}), text); + + if (file.mime=='text/directory') return; + + if (this.Request) this.Request.cancel(); + + this.Request = new FileManager.Request({ + url: this.options.url + '?event=detail', + onSuccess: (function(j){ + var prev = this.preview.removeClass('filemanager-loading').set('html', j && j.content ? j.content.substitute(this.language, /\\?\$\{([^{}]+)\}/g) : '').getElement('img.prev'); + if (prev) prev.addEvent('load', function(){ + this.setStyle('background', 'none'); + }); + + var els = this.preview.getElements('button'); + if (els) els.addEvent('click', function(e){ + e.stop(); + window.open(this.get('value')); + }); + + // Xinha: We need to add in a form for setting the attributes of images etc, + // so we add this event and pass it the information we have about the item + // as returned by Backend/FileManager.php + this.fireEvent('details', [j]); + + // Xinha: We also want to hold onto the data so we can access it + // when selecting the image. + if(this.Current) this.Current.file_data = j; + }).bind(this), + data: { + directory: this.Directory, + file: file.name + } + }, this).post(); + }, + + size: function(size){ + var tab = ['Bytes', 'KB', 'MB', 'GB', 'TB']; + for(var i = 0; size > 1024; i++) + size = size/1024; + + return [Math.round(size), tab[i]]; + }, + + normalize: function(str){ + return str.replace(/\/+/g, '/'); + }, + + switchButton: function(){ + var chk = !!this.Current; + var el = this.menu.getElement('button.filemanager-open'); + if (el) el.set('disabled', !chk)[(chk ? 'remove' : 'add') + 'Class']('disabled'); + }, + + addMenuButton: function(name){ + var el = new Element('button', { + 'class': 'filemanager-' + name, + text: this.language[name] + }).inject(this.menu, 'top'); + if (this[name]) el.addEvent('click', this[name].bind(this)); + return el; + }, + + fireHooks: function(hook){ + var args = Array.slice(arguments, 1); + for(var key in this.hooks[hook]) this.hooks[hook][key].apply(this, args); + return this; + }, + + onRequest: function(){ this.loader.set('opacity', 1); }, + onComplete: function(){ this.loader.fade(0); }, + onDialogOpen: $empty, + onDialogClose: $empty, + onDragComplete: $lambda(false) + +}); + +FileManager.Request = new Class({ + + Extends: Request.JSON, + + initialize: function(options, filebrowser){ + // Xinha: We need ALL requests from the FileManager to have our authorisation data on it + // normal MootoolsFileManager only has the flash send it :-( + if(filebrowser) + { + options.url += (options.url.match(/\?/) ? '&' : '?') +Hash.toQueryString(filebrowser.options.uploadAuthData); + } + + // Xinha: We also need to clean up the url because our backend already includes a query string + // and MootoolsFileManager adds ?event=..... indiscriminately, our query string always + // ends in an ampersand, so we can just clean up '&?event=' to be '&event=' + options.url = options.url.replace(/&\?event=/, '&event='); + + this.parent(options); + + if (filebrowser) this.addEvents({ + request: filebrowser.onRequest.bind(filebrowser), + complete: filebrowser.onComplete.bind(filebrowser) + }); + } + +}); + +FileManager.Language = {}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Gallery.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Gallery.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Gallery.js 3 Jan 2016 20:51:53 -0000 1.1.2.1 @@ -0,0 +1,305 @@ +/* +--- +description: FileManager.Gallery +longdescription: Adds functionality to create a gallery out of a list of images + +authors: + - Christoph Pojer + +requires: + core/1.2.4: '*' + +provides: + - filemanager.gallery + +license: + MIT-style license +... +*/ + +(function(){ + +FileManager.Gallery = new Class({ + + Extends: FileManager, + + initialize: function(options){ + this.offsets = {y: -72}; + this.parent(options); + + var show = function(){ + this.galleryContainer.setStyles({ + opacity: 0, + display: 'block' + }); + + var size = this.el.getSize(), + pos = this.el.getPosition(); + + this.galleryContainer.setStyles({ + top: pos.y + size.y - 1, + left: pos.x + (size.x - this.galleryContainer.getWidth()) / 2, + opacity: 1 + }); + + this.hideClone(); + this.wrapper.setStyle('display', 'none'); + + if (this.howto){ + var self = this; + (function(){ + if (self.howto && self.howto.fade) self.howto.fade(0).get('tween').chain(function(){ + this.element.destroy(); + self.howto = null; + }); + }).delay(2000); + } + }; + + this.addEvents({ + + scroll: show, + show: (function(){ + show.apply(this); + this.populate(); + }), + + hide: function(){ + this.gallery.empty(); + + this.captions = {}; + this.files = []; + + this.hideClone(); + this.wrapper.setStyle('display', 'none'); + }, + + modify: function(file){ + var name = this.normalize(file.dir + '/' + file.name); + var el = (this.gallery.getElements('li').filter(function(el){ + var f = el.retrieve('file'); + return name == this.normalize(f.dir + '/' + f.name); + }, this) || null)[0]; + + if (el) this.erasePicture(name, el); + } + }); + + this.addMenuButton('serialize'); + this.galleryContainer = new Element('div', {'class': 'filemanager-gallery'}).inject(this.container); + this.gallery = new Element('ul').inject(this.galleryContainer); + + var timer, removeClone = this.removeClone.bind(this); + + this.input = new Element('input', {name: 'imgCaption'}).addEvent('keyup', function(e){ + if (e.key == 'enter') removeClone(e); + }); + this.wrapper = new Element('div', { + 'class': 'filemanager-wrapper', + tween: {duration: 200}, + opacity: 0, + events: { + mouseenter: function(){ + $clear(timer); + }, + mouseleave: function(e){ + timer = (function(){ + removeClone(e); + }).delay(500); + } + } + }).adopt( + new Element('span', {text: this.language.gallery.text}), + this.input, + new Element('div', {'class': 'img'}), + new Element('button', {text: this.language.gallery.save}).addEvent('click', removeClone) + ).inject(document.body); + + this.droppables.push(this.gallery); + + this.captions = {}; + this.files = []; + this.animation = {}; + + this.howto = new Element('div', {'class': 'howto', text: this.language.gallery.drag}).inject(this.galleryContainer); + this.switchButton(); + }, + + onDragComplete: function(el, droppable){ + if (!droppable || droppable != this.gallery) return false; + + var file; + if ($type(el) == 'string'){ + var part = el.split('/'); + file = { + name: part.pop(), + dir: part.join('/') + }; + }else{ + el.setStyles({left: '', top: ''}); + file = el.retrieve('file'); + } + + var self = this, name = this.normalize(file.dir + '/' + file.name); + + if (this.files.contains(name)) return true; + this.files.push(name); + + var img = new Asset.image(this.options.assetBasePath + 'destroy.png').set({ + 'class': 'filemanager-remove', + title: this.language.gallery.remove, + events: {click: this.removePicture} + }).store('gallery', this); + + var li = new Element('li').store('file', file).adopt( + img, + new Asset.image(this.options.baseURL + name, { + onload: function(){ + var el = this; + li.setStyle('background', 'none').addEvent('click', function(e){ + if (e) e.stop(); + + var pos = el.getCoordinates(); + pos.left += el.getStyle('paddingLeft').toInt(); + pos.top += el.getStyle('paddingTop').toInt(); + + self.hideClone(); + self.animation = { + from: { + width: 75, + height: 56, + left: pos.left, + top: pos.top + }, + to: { + width: 200, + height: 150, + left: pos.left - 75, + top: pos.top + pos.height - 150 + } + }; + + self.hideClone(); + self.input.removeEvents('blur').addEvent('blur', function(){ + self.captions[name] = this.get('value') || ''; + }); + + li.set('opacity', 0); + self.clone = el.clone(); + self.clone.store('file', file).store('parent', li).addClass('filemanager-clone').setStyles(self.animation.from).set({ + morph: {link: 'chain'}, + styles: { + position: 'absolute', + zIndex: 1100 + }, + events: { + click: function(e){ + self.fireEvent('preview', [self.options.baseURL + name, self.captions[name], li]); + } + } + }).inject(document.body).morph(self.animation.to).get('morph').chain(function(){ + self.input.set('value', self.captions[name] || ''); + self.wrapper.setStyles({ + opacity: 0, + display: 'block', + left: self.animation.to.left - 12, + top: self.animation.to.top - 53 + }).fade(1).get('tween').chain(function(){ + self.input.focus(); + }); + }); + }); + } + }) + ).inject(this.gallery); + + this.tips.attach(img.appearOn(li)); + this.switchButton(); + + return true; + }, + + removeClone: function(e){ + if (!this.clone || (e.relatedTarget && ([this.clone, this.wrapper].contains(e.relatedTarget) || this.wrapper.hasChild(e.relatedTarget)))) return; + if (this.clone.get('morph').timer) return; + + var file = this.clone.retrieve('file'); + if (!file) return; + + this.captions[this.normalize(file.dir + '/' + file.name)] = this.input.get('value') || ''; + + this.clone.morph(this.animation.from).get('morph').clearChain().chain((function(){ + this.clone.retrieve('parent').set('opacity', 1); + this.clone.destroy(); + }).bind(this)); + + this.wrapper.fade(0).get('tween').chain(function(){ + this.element.setStyle('display', 'none'); + }); + }, + + hideClone: function(){ + if (!this.clone) return; + + this.clone.get('morph').cancel(); + var parent = this.clone.retrieve('parent'); + if (parent) parent.set('opacity', 1); + this.clone.destroy(); + this.wrapper.setStyles({ + opacity: 0, + display: 'none' + }); + }, + + removePicture: function(e){ + if(e) e.stop(); + + var self = this.retrieve('gallery'), + parent = this.getParent('li'), + file = parent.retrieve('file'), + name = self.normalize(file.dir + '/' + file.name); + + self.erasePicture(name, parent); + }, + + erasePicture: function(name, element){ + this.captions[name] = ''; + this.files.erase(name); + this.tips.hide(); + + var self = this; + element.set('tween', {duration: 250}).removeEvents('click').fade(0).get('tween').chain(function(){ + this.element.destroy(); + self.switchButton(); + }); + }, + + switchButton: function(){ + var chk = !!this.gallery.getChildren().length; + + this.menu.getElement('button.filemanager-serialize').set('disabled', !chk)[(chk ? 'remove' : 'add') + 'Class']('disabled'); + }, + + populate: function(data){ + Hash.each(data || {}, function(v, i){ + this.captions[i] = v; + + this.onDragComplete(i, this.gallery); + }, this); + }, + + serialize: function(e){ + if(e) e.stop(); + + var serialized = {}; + this.files.each(function(v){ + serialized[v] = this.captions[v] || ''; + }, this); + + this.hide(); + this.fireEvent('complete', [serialized]); + } + +}); + +})(); \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader.js 3 Jan 2016 20:51:53 -0000 1.1.2.1 @@ -0,0 +1,238 @@ +/* +--- +description: FileManager Uploader +longdescription: Implements Upload functionality into the FileManager based on [FancyUpload](http://digitarald.de) + +authors: + - Christoph Pojer + +requires: + core/1.2.4: '*' + +provides: + - filemanager.uploader + +license: + MIT-style license + +options: + - upload: (boolean, defaults to *true*) + - uploadAuthData: (object) Data to be send with the GET-Request of an Upload as Flash ignores authenticated clients + - resizeImages: (boolean, defaults to *true*) Whether to show the option to resize big images or not +... +*/ + +FileManager.implement({ + + options: { + resizeImages: true, + upload: true, + uploadAuthData: {} + }, + + hooks: { + show: { + upload: function(){ + this.startUpload(); + } + }, + + cleanup: { + upload: function(){ + if (!this.options.upload || !this.upload) return; + + if (this.upload.uploader) this.upload.uploader.set('opacity', 0).dispose(); + } + } + }, + + onDialogOpen: function(){ + if (this.swf && this.swf.box) this.swf.box.setStyle('visibility', 'hidden'); + }, + + onDialogClose: function(){ + if (this.swf && this.swf.box) this.swf.box.setStyle('visibility', 'visible'); + }, + + startUpload: function(){ + if (!this.options.upload || this.swf) return; + + var self = this; + this.upload = { + button: this.addMenuButton('upload').inject(this.menu, 'bottom').addEvents({ + click: function(){ + return false; + }, + mouseenter: function(){ + this.addClass('hover'); + }, + mouseleave: function(){ + this.removeClass('hover'); + this.blur(); + }, + mousedown: function(){ + this.focus(); + } + }), + list: new Element('ul', {'class': 'filemanager-uploader-list'}), + uploader: new Element('div', {opacity: 0, 'class': 'filemanager-uploader-area'}).adopt( + new Element('h2', {text: this.language.upload}), + new Element('div', {'class': 'filemanager-uploader'}) + ) + }; + this.upload.uploader.getElement('div').adopt(this.upload.list); + this.closeIcon.appearOn(this.upload.button, 0.8); + + if (this.options.resizeImages){ + var resizer = new Element('div', {'class': 'checkbox'}), + check = (function(){ this.toggleClass('checkboxChecked'); }).bind(resizer); + check(); + this.upload.label = new Element('label').adopt( + resizer, new Element('span', {text: this.language.resizeImages}) + ).addEvent('click', check).inject(this.menu); + } + + var File = new Class({ + + Extends: Swiff.Uploader.File, + + initialize: function(base, data){ + this.parent(base, data); + this.setOptions({ + url: self.options.url + (self.options.url.indexOf('?') == -1 ? '?' : '&') + Hash.toQueryString($merge({}, self.options.uploadAuthData, { + event: 'upload', + directory: self.normalize(self.Directory), + resize: self.options.resizeImages && resizer.hasClass('checkboxChecked') ? 1 : 0 + })) + }); + }, + + render: function(){ + if (this.invalid){ + var message = self.language.uploader.unknown, sub = { + name: this.name, + size: Swiff.Uploader.formatUnit(this.size, 'b') + }; + + if (self.language.uploader[this.validationError]) + message = self.language.uploader[this.validationError]; + + if (this.validationError == 'sizeLimitMin') + sub.size_min = Swiff.Uploader.formatUnit(this.base.options.fileSizeMin, 'b'); + else if (this.validationError == 'sizeLimitMax') + sub.size_max = Swiff.Uploader.formatUnit(this.base.options.fileSizeMax, 'b'); + + new Dialog(new Element('div', {html: message.substitute(sub, /\\?\$\{([^{}]+)\}/g)}) , {language: {confirm: self.language.ok}, buttons: ['confirm']}); + return this; + } + + this.addEvents({ + open: this.onOpen, + remove: this.onRemove, + requeue: this.onRequeue, + progress: this.onProgress, + stop: this.onStop, + complete: this.onComplete + }); + + this.ui = {}; + this.ui.icon = new Asset.image(self.options.assetBasePath+'Icons/' + this.extension + '.png', { + onerror: function(){ new Asset.image(self.options.assetBasePath + 'Icons/default.png').replaces(this); } + }); + this.ui.element = new Element('li', {'class': 'file', id: 'file-' + this.id}); + this.ui.title = new Element('span', {'class': 'file-title', text: this.name}); + this.ui.size = new Element('span', {'class': 'file-size', text: Swiff.Uploader.formatUnit(this.size, 'b')}); + + var file = this; + this.ui.cancel = new Asset.image(self.options.assetBasePath+'cancel.png', {'class': 'file-cancel', title: self.language.cancel}).addEvent('click', function(){ + file.remove(); + self.tips.hide(); + self.tips.detach(this); + }); + self.tips.attach(this.ui.cancel); + + var progress = new Element('img', {'class': 'file-progress', src: self.options.assetBasePath+'bar.gif'}); + + this.ui.element.adopt( + this.ui.cancel, + progress, + this.ui.icon, + this.ui.title, + this.ui.size + ).inject(self.upload.list).highlight(); + + this.ui.progress = new Fx.ProgressBar(progress).set(0); + + this.base.reposition(); + + return this.parent(); + }, + + onOpen: function(){ + this.ui.element.addClass('file-running'); + }, + + onRemove: function(){ + this.ui = this.ui.element.destroy(); + }, + + onProgress: function(){ + this.ui.progress.start(this.progress.percentLoaded); + }, + + onStop: function(){ + this.remove(); + }, + + onComplete: function(){ + this.ui.progress = this.ui.progress.cancel().element.destroy(); + this.ui.cancel = this.ui.cancel.destroy(); + + var response = JSON.decode(this.response.text); + if (!response.status) + new Dialog(('' + response.error).substitute(self.language, /\\?\$\{([^{}]+)\}/g) , {language: {confirm: self.language.ok}, buttons: ['confirm']}); + + this.ui.element.set('tween', {duration: 2000}).highlight(response.status ? '#e6efc2' : '#f0c2c2'); + (function(){ + this.ui.element.setStyle('overflow', 'hidden').morph({ + opacity: 0, + height: 0 + }).get('morph').chain(function(){ + this.element.destroy(); + if (!self.upload.list.getElements('li').length) + self.upload.uploader.fade(0).get('tween').chain(function(){ + self.fillInfo(); + }); + }); + }).delay(5000, this); + } + + }); + + this.swf = new Swiff.Uploader({ + id: 'SwiffFileManagerUpload', + path: this.options.assetBasePath + 'Swiff.Uploader.swf', + queued: false, + target: this.upload.button, + allowDuplicates: true, + instantStart: true, + fileClass: File, + fileSizeMax: 25 * 1024 * 1024, + zIndex: this.SwiffZIndex || 9999, + onSelectSuccess: function(){ + self.fillInfo(); + self.info.getElement('h2.filemanager-headline').setStyle('display', 'none'); + self.info.adopt(self.upload.uploader); + self.upload.uploader.fade(1); + }, + onComplete: function(){ + self.load(self.Directory, true); + }, + onFail: function(error){ + $$(self.upload.button, self.upload.label).dispose(); + new Dialog(new Element('div', {html: self.language.flash[error] || self.language.flash.flash}), {language: {confirm: self.language.ok}, buttons: ['confirm']}); + } + }); + } + +}); \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Fx.ProgressBar.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Fx.ProgressBar.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Fx.ProgressBar.js 3 Jan 2016 20:51:53 -0000 1.1.2.1 @@ -0,0 +1,78 @@ +/* +--- +description: Fx.Progressbar + +authors: + - Harald Kirschner + +requires: + core/1.2.4: '*' + +provides: + - filemanager.swiff.progressbar + +license: + MIT-style license +... +*/ + +Fx.ProgressBar = new Class({ + + Extends: Fx, + + options: { + text: null, + url: null, + transition: Fx.Transitions.Circ.easeOut, + fit: true, + link: 'cancel' + }, + + initialize: function(element, options) { + this.element = $(element); + this.parent(options); + + var url = this.options.url; + if (url) { + this.element.setStyles({ + 'background-image': 'url(' + url + ')', + 'background-repeat': 'no-repeat' + }); + } + + if (this.options.fit) { + url = url || this.element.getStyle('background-image').replace(/^url\(["']?|["']?\)$/g, ''); + if (url) { + var fill = new Image(); + fill.onload = function() { + this.fill = fill.width; + fill = fill.onload = null; + this.set(this.now || 0); + }.bind(this); + fill.src = url; + if (!this.fill && fill.width) fill.onload(); + } + } else { + this.set(0); + } + }, + + start: function(to, total) { + return this.parent(this.now, (arguments.length == 1) ? to.limit(0, 100) : to / total * 100); + }, + + set: function(to) { + this.now = to; + var css = (this.fill) + ? (((this.fill / -2) + (to / 100) * (this.element.width || 1) || 0).round() + 'px') + : ((100 - to) + '%'); + + this.element.setStyle('backgroundPosition', css + ' 0px').title = Math.round(to) + '%'; + + var text = $(this.options.text); + if (text) text.set('text', Math.round(to) + '%'); + + return this; + } + +}); \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Swiff.Uploader.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Swiff.Uploader.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Swiff.Uploader.js 3 Jan 2016 20:51:54 -0000 1.1.2.1 @@ -0,0 +1,494 @@ +/* +--- +description: Swiff.Uploader + +authors: + - Harald Kirschner + +requires: + core/1.2.4: '*' + +provides: + - filemanager.swiff.uploader + +license: + MIT-style license +... +*/ + +Swiff.Uploader = new Class({ + + Extends: Swiff, + + Implements: Events, + + options: { + path: 'Swiff.Uploader.swf', + + target: null, + zIndex: 9999, + + height: 30, + width: 100, + callBacks: null, + params: { + wMode: 'opaque', + menu: 'false', + allowScriptAccess: 'always' + }, + + typeFilter: null, + multiple: true, + queued: true, + verbose: false, + + url: null, + method: null, + data: null, + mergeData: true, + fieldName: null, + + fileSizeMin: 1, + fileSizeMax: null, // Official limit is 100 MB for FileReference, but I tested up to 2Gb! + allowDuplicates: false, + timeLimit: (Browser.Platform.linux) ? 0 : 30, + + buttonImage: null, + policyFile: null, + + fileListMax: 0, + fileListSizeMax: 0, + + instantStart: false, + appendCookieData: false, + + fileClass: null + /* + onLoad: $empty, + onFail: $empty, + onStart: $empty, + onQueue: $empty, + onComplete: $empty, + onBrowse: $empty, + onDisabledBrowse: $empty, + onCancel: $empty, + onSelect: $empty, + onSelectSuccess: $empty, + onSelectFail: $empty, + + onButtonEnter: $empty, + onButtonLeave: $empty, + onButtonDown: $empty, + onButtonDisable: $empty, + + onFileStart: $empty, + onFileStop: $empty, + onFileRequeue: $empty, + onFileOpen: $empty, + onFileProgress: $empty, + onFileComplete: $empty, + onFileRemove: $empty, + + onBeforeStart: $empty, + onBeforeStop: $empty, + onBeforeRemove: $empty + */ + }, + + initialize: function(options) { + // protected events to control the class, added + // before setting options (which adds own events) + this.addEvent('load', this.initializeSwiff, true) + .addEvent('select', this.processFiles, true) + .addEvent('complete', this.update, true) + .addEvent('fileRemove', function(file) { + this.fileList.erase(file); + }.bind(this), true); + + this.setOptions(options); + + // callbacks are no longer in the options, every callback + // is fired as event, this is just compat + if (this.options.callBacks) { + Hash.each(this.options.callBacks, function(fn, name) { + this.addEvent(name, fn); + }, this); + } + + this.options.callBacks = { + fireCallback: this.fireCallback.bind(this) + }; + + var path = this.options.path; + if (!path.contains('?')) path += '?noCache=' + $time(); // cache in IE + + // container options for Swiff class + this.options.container = this.box = new Element('span', {'class': 'swiff-uploader-box'}).inject(document.id(this.options.container) || document.body); + + // target + this.target = document.id(this.options.target); + if (this.target) { + var scroll = window.getScroll(); + this.box.setStyles({ + position: 'absolute', + visibility: 'visible', + zIndex: this.options.zIndex, + overflow: 'hidden', + height: 1, width: 1, + top: scroll.y, left: scroll.x + }); + + // we force wMode to transparent for the overlay effect + this.parent(path, { + params: { + wMode: 'transparent' + }, + height: '100%', + width: '100%' + }); + + this.target.addEvent('mouseenter', this.reposition.bind(this, [])); + + // button interactions, relayed to to the target + this.addEvents({ + buttonEnter: this.targetRelay.bind(this, ['mouseenter']), + buttonLeave: this.targetRelay.bind(this, ['mouseleave']), + buttonDown: this.targetRelay.bind(this, ['mousedown']), + buttonDisable: this.targetRelay.bind(this, ['disable']) + }); + + this.reposition(); + window.addEvent('resize', this.reposition.bind(this, [])); + } else { + this.parent(path); + } + + this.inject(this.box); + + this.fileList = []; + + this.size = this.uploading = this.bytesLoaded = this.percentLoaded = 0; + + if (Browser.Plugins.Flash.version < 9) { + this.fireEvent('fail', ['flash']); + } else { + this.verifyLoad.delay(1000, this); + } + }, + + verifyLoad: function() { + if (this.loaded) return; + if (!this.object.parentNode) { + this.fireEvent('fail', ['disabled']); + } else if (this.object.style.display == 'none') { + this.fireEvent('fail', ['hidden']); + } else if (!this.object.offsetWidth) { + this.fireEvent('fail', ['empty']); + } + }, + + fireCallback: function(name, args) { + // file* callbacks are relayed to the specific file + if (name.substr(0, 4) == 'file') { + // updated queue data is the second argument + if (args.length > 1) this.update(args[1]); + var data = args[0]; + + var file = this.findFile(data.id); + this.fireEvent(name, file || data, 5); + if (file) { + var fire = name.replace(/^file([A-Z])/, function($0, $1) { + return $1.toLowerCase(); + }); + file.update(data).fireEvent(fire, [data], 10); + } + } else { + this.fireEvent(name, args, 5); + } + }, + + update: function(data) { + // the data is saved right to the instance + $extend(this, data); + this.fireEvent('queue', [this], 10); + return this; + }, + + findFile: function(id) { + for (var i = 0; i < this.fileList.length; i++) { + if (this.fileList[i].id == id) return this.fileList[i]; + } + return null; + }, + + initializeSwiff: function() { + // extracted options for the swf + this.remote('initialize', { + width: this.options.width, + height: this.options.height, + typeFilter: this.options.typeFilter, + multiple: this.options.multiple, + queued: this.options.queued, + url: this.options.url, + method: this.options.method, + data: this.options.data, + mergeData: this.options.mergeData, + fieldName: this.options.fieldName, + verbose: this.options.verbose, + fileSizeMin: this.options.fileSizeMin, + fileSizeMax: this.options.fileSizeMax, + allowDuplicates: this.options.allowDuplicates, + timeLimit: this.options.timeLimit, + buttonImage: this.options.buttonImage, + policyFile: this.options.policyFile + }); + + this.loaded = true; + + this.appendCookieData(); + }, + + targetRelay: function(name) { + if (this.target) this.target.fireEvent(name); + }, + + reposition: function(coords) { + // update coordinates, manual or automatically + coords = coords || (this.target && this.target.offsetHeight) + ? this.target.getCoordinates(this.box.getOffsetParent()) + : {top: window.getScrollTop(), left: 0, width: 40, height: 40}; + this.box.setStyles(coords); + this.fireEvent('reposition', [coords, this.box, this.target]); + }, + + setOptions: function(options) { + if (options) { + if (options.url) options.url = Swiff.Uploader.qualifyPath(options.url); + if (options.buttonImage) options.buttonImage = Swiff.Uploader.qualifyPath(options.buttonImage); + this.parent(options); + if (this.loaded) this.remote('setOptions', options); + } + return this; + }, + + setEnabled: function(status) { + this.remote('setEnabled', status); + }, + + start: function() { + this.fireEvent('beforeStart'); + this.remote('start'); + }, + + stop: function() { + this.fireEvent('beforeStop'); + this.remote('stop'); + }, + + remove: function() { + this.fireEvent('beforeRemove'); + this.remote('remove'); + }, + + fileStart: function(file) { + this.remote('fileStart', file.id); + }, + + fileStop: function(file) { + this.remote('fileStop', file.id); + }, + + fileRemove: function(file) { + this.remote('fileRemove', file.id); + }, + + fileRequeue: function(file) { + this.remote('fileRequeue', file.id); + }, + + appendCookieData: function() { + var append = this.options.appendCookieData; + if (!append) return; + + var hash = {}; + document.cookie.split(/;\s*/).each(function(cookie) { + cookie = cookie.split('='); + if (cookie.length == 2) { + hash[decodeURIComponent(cookie[0])] = decodeURIComponent(cookie[1]); + } + }); + + var data = this.options.data || {}; + if ($type(append) == 'string') data[append] = hash; + else $extend(data, hash); + + this.setOptions({data: data}); + }, + + processFiles: function(successraw, failraw, queue) { + var cls = this.options.fileClass || Swiff.Uploader.File; + + var fail = [], success = []; + + if (successraw) { + successraw.each(function(data) { + var ret = new cls(this, data); + if (!ret.validate()) { + ret.remove.delay(10, ret); + fail.push(ret); + } else { + this.size += data.size; + this.fileList.push(ret); + success.push(ret); + ret.render(); + } + }, this); + + this.fireEvent('selectSuccess', [success], 10); + } + + if (failraw || fail.length) { + fail.extend((failraw) ? failraw.map(function(data) { + return new cls(this, data); + }, this) : []).each(function(file) { + file.invalidate().render(); + }); + + this.fireEvent('selectFail', [fail], 10); + } + + this.update(queue); + + if (this.options.instantStart && success.length) this.start(); + } + +}); + +$extend(Swiff.Uploader, { + + STATUS_QUEUED: 0, + STATUS_RUNNING: 1, + STATUS_ERROR: 2, + STATUS_COMPLETE: 3, + STATUS_STOPPED: 4, + + log: function() { + if (window.console && console.info) console.info.apply(console, arguments); + }, + + unitLabels: { + b: [{min: 1, unit: 'B'}, {min: 1024, unit: 'kB'}, {min: 1048576, unit: 'MB'}, {min: 1073741824, unit: 'GB'}], + s: [{min: 1, unit: 's'}, {min: 60, unit: 'm'}, {min: 3600, unit: 'h'}, {min: 86400, unit: 'd'}] + }, + + formatUnit: function(base, type, join) { + var labels = Swiff.Uploader.unitLabels[(type == 'bps') ? 'b' : type]; + var append = (type == 'bps') ? '/s' : ''; + var i, l = labels.length, value; + + if (base < 1) return '0 ' + labels[0].unit + append; + + if (type == 's') { + var units = []; + + for (i = l - 1; i >= 0; i--) { + value = Math.floor(base / labels[i].min); + if (value) { + units.push(value + ' ' + labels[i].unit); + base -= value * labels[i].min; + if (!base) break; + } + } + + return (join === false) ? units : units.join(join || ', '); + } + + for (i = l - 1; i >= 0; i--) { + value = labels[i].min; + if (base >= value) break; + } + + return (base / value).toFixed(1) + ' ' + labels[i].unit + append; + } + +}); + +Swiff.Uploader.qualifyPath = (function() { + + var anchor; + + return function(path) { + (anchor || (anchor = new Element('a'))).href = path; + return anchor.href; + }; + +})(); + +Swiff.Uploader.File = new Class({ + + Implements: Events, + + initialize: function(base, data) { + this.base = base; + this.update(data); + }, + + update: function(data) { + return $extend(this, data); + }, + + validate: function() { + var options = this.base.options; + + if (options.fileListMax && this.base.fileList.length >= options.fileListMax) { + this.validationError = 'fileListMax'; + return false; + } + + if (options.fileListSizeMax && (this.base.size + this.size) > options.fileListSizeMax) { + this.validationError = 'fileListSizeMax'; + return false; + } + + return true; + }, + + invalidate: function() { + this.invalid = true; + this.base.fireEvent('fileInvalid', this, 10); + return this.fireEvent('invalid', this, 10); + }, + + render: function() { + return this; + }, + + setOptions: function(options) { + if (options) { + if (options.url) options.url = Swiff.Uploader.qualifyPath(options.url); + this.base.remote('fileSetOptions', this.id, options); + this.options = $merge(this.options, options); + } + return this; + }, + + start: function() { + this.base.fileStart(this); + return this; + }, + + stop: function() { + this.base.fileStop(this); + return this; + }, + + remove: function() { + this.base.fileRemove(this); + return this; + }, + + requeue: function() { + this.base.fileRequeue(this); + } + +}); Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/note-server.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/note-server.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/note-server.js 3 Jan 2016 20:51:54 -0000 1.1.2.1 @@ -0,0 +1,93 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/NoteServer/note-server.js */ +function NoteServer(_1){ +this.editor=_1; +var _2=_1.config; +var _3=this; +_2.registerButton({id:"insertscore",tooltip:this._lc("Insert GUIDO Music Notation"),image:_1.imgURL("note.gif","NoteServer"),textMode:false,action:function(_4){ +_3.buttonPress(_4); +}}); +_2.addToolbarElement("insertscore","insertimage",1); +} +NoteServer._pluginInfo={name:"NoteServer",version:"1.1",developer:"Richard Christophe",developer_url:"http://piano-go.chez.tiscali.fr/guido.html",c_owner:"Richard Christophe",sponsor:"",sponsor_url:"",license:"htmlArea"}; +NoteServer.prototype._lc=function(_5){ +return Xinha._lc(_5,"NoteServer"); +}; +NoteServer.prototype.buttonPress=function(_6){ +_6._popupDialog("plugin://NoteServer/codenote",function(_7){ +if(!_7){ +return false; +}else{ +IncludeGuido(_6,_7); +} +},null); +}; +var noteserveraddress="clef.cs.ubc.ca"; +var htmlbase="/salieri/nview"; +var versionstring=""; +function GetGIFURL(_8,_9,_a){ +_8=escape(_8); +_8=_8.replace(/\//g,"%2F"); +if(!_9){ +_9="1.0"; +} +if(!_a){ +_a="1"; +} +var _b="http://"+noteserveraddress+"/scripts/salieri"+versionstring+"/gifserv.pl?"+"pagewidth=21"+"&pageheight=29.7"+"&zoomfactor="+_9+"&pagesizeadjust=yes"+"&outputformat=gif87"+"&pagenum="+_a+"&gmndata="+_8; +return _b; +} +function GetMIDIURL(_c){ +_c=escape(_c); +_c=_c.replace(/\//g,"%2F"); +var _d="http://"+noteserveraddress+"/scripts/salieri"+versionstring+"/midserv.pl?"+"gmndata="+_c; +return _d; +} +function GetAPPLETURL(_e,_f){ +_e=escape(_e); +_e=_e.replace(/\//g,"%2F"); +var _10=""+""+""+""+""+""+""+""; +return _10; +} +function IncludeGuido(_11,_12){ +if(!_12["f_zoom"]){ +zoom=""; +} +var _13=GetGIFURL(_12["f_code"],_12["f_zoom"],""); +var _14=GetMIDIURL(_12["f_code"]); +var _15="
    "; +if(_12["f_applet"]==false){ +if(((navigator.userAgent.toLowerCase().indexOf("msie")!=-1)&&(navigator.userAgent.toLowerCase().indexOf("opera")==-1))){ +_11.focusEditor(); +_11.insertHTML(""); +}else{ +img=new Image(); +img.src=_13; +var doc=_11._doc; +var sel=_11._getSelection(); +var _18=_11._createRange(sel); +_11._doc.execCommand("insertimage",false,img.src); +} +}else{ +var _19=GetAPPLETURL(_12["f_code"],_12["f_zoom"]); +_15=_15+_19+"
    "; +} +if(_12["f_affcode"]){ +_15=_15+Xinha._lc("GUIDO Code","NoteServer")+" : "+_12["f_code"]+"
    "; +} +if(_12["f_midi"]){ +_15=_15+""+Xinha._lc("MIDI File","NoteServer")+"
    "; +} +_11.focusEditor(); +_11.insertHTML(_15); +} +function IncludeGuidoStringAsApplet(_1a,_1b,_1c){ +_1b=escape(_1b); +_1b=_1b.replace(/\//g,"%2F"); +var _1d=""+""+""+""+""+""+""+""; +alert(_1d); +_1a.focusEditor(); +_1a.insertHTML(_1d); +} + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/img/note.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/img/note.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/de.js 3 Jan 2016 20:51:54 -0000 1.1.2.1 @@ -0,0 +1,21 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 | ISO-8859-1 +// Sponsored by http://www.systemconcept.de +// Author: Holger Hees, +// (c) systemconcept.de 2004 +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Insert GUIDO Music Notation": "Einfügung einer GUIDO Musik-Tonfolge", + "Guido code": "Guido code", + "Options": "Einstellungen", + "Format": "Format", + "Image in applet": "Bild im Applet", + "Zoom": "Zoom", + "MIDI File": "MIDI Datei", + "Image Preview": "Bild Voransicht", + "Source Code": "Quell-Code", + "Preview": "Voransicht", + "Add MIDI link to allow students to hear the music": "MIDI-Link hinzufügen um Studenten das hören der Musik zu ermöglichen", + "Add GUIDO Code in a textbox on the page": "GUIDO Code in einer Textbox auf der Seite anzeigen" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/fr.js 3 Jan 2016 20:51:54 -0000 1.1.2.1 @@ -0,0 +1,16 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Insert GUIDO Music Notation": "Insérer une partition musicale GUIDO", + "Guido code": "Code Guido", + "Options": "Options", + "Format": "Format", + "Image in applet": "Image dans une applet", + "Zoom": "Zoom", + "MIDI File": "Fichier MIDI", + "Image Preview": "Aperçu de l'image", + "Source Code": "Code source", + "Preview": "Aperçu ", + "Add MIDI link to allow students to hear the music": "Ajouter un lien MIDI pour permettre aux étudiants d'écouter la partition", + "Add GUIDO Code in a textbox on the page": "Ajouter le code source GUIDO dans un cadre" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/ja.js 3 Jan 2016 20:51:55 -0000 1.1.2.1 @@ -0,0 +1,18 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +// This string is for auto detection of multi-encoding editor : 国際化文字検出用文字列 +{ + "Insert GUIDO Music Notation": "GUIDO Music Notationの挿入", + "Guido code": "GUIDOコード", + "Options": "オプション", + "Format": "フォーマット", + "Image in applet": "アプレット画像", + "Zoom": "拡大率:", + "MIDI File": "MIDIファイル", + "Image Preview": "画像プレビュー", + "Source Code": "ソースコード", + "Preview": "表示", + "Add MIDI link to allow students to hear the music": "MIDIへのリンクを追加し、楽曲を聴かせてもよい", + "Add GUIDO Code in a textbox on the page": "ページ内のテキストボックスにGUIDOコードを追加", + "With Mozilla, the applet will not be visible in editor, but only in Web page after submitting.": "Mozillaではエディタ内にアプレットは表示されませんが、送信後のWebページ内では有効です。" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/nb.js 3 Jan 2016 20:51:55 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Insert GUIDO Music Notation": "Sett inn GUIDO-noter", + "Guido code": "GUIDO-kode", + "Options": "Muligheter", + "Format": "Format", + "Image in applet": "Bilde i applet", + "Zoom": "Forstørr", + "MIDI File": "MIDIfil", + "Image Preview": "Bilde forhåndsvisning", + "Source Code": "Kildekode", + "Preview": "Preview", + "Add MIDI link to allow students to hear the music": "Legg til MIDI-link for at studenter kan høre musikken", + "Add GUIDO Code in a textbox on the page": "Sett inn GUIDO-kode i et tekstfelt på siden" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/nl.js 3 Jan 2016 20:51:55 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Insert GUIDO Music Notation": "GUIDO muziek notatie invoegen", + "Guido code": "GUIDO-code", + "Options": "Opties", + "Format": "Indeling", + "Image in applet": "Afbeelding in applet", + "Zoom": "Vergroot/verklein", + "MIDI File": "MIDI bestand", + "Image Preview": "Afbeeldingsvoorbeeld", + "Source Code": "Broncode", + "Preview": "Voorbeeld", + "Add MIDI link to allow students to hear the music": "MIDI link invoegen om de muziek te beluisteren", + "Add GUIDO Code in a textbox on the page": "GUIDO code in een tekstgebied op de pagina invoegen" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/no.js 3 Jan 2016 20:51:55 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Insert GUIDO Music Notation": "Sett inn GUIDO-noter", + "Guido code": "GUIDO-kode", + "Options": "Muligheter", + "Format": "Format", + "Image in applet": "Bilde i applet", + "Zoom": "Forstørr", + "MIDI File": "MIDIfil", + "Image Preview": "Bilde forhåndsvisning", + "Source Code": "Kildekode", + "Preview": "Preview", + "Add MIDI link to allow students to hear the music": "Legg til MIDI-link for at studenter kan høre musikken", + "Add GUIDO Code in a textbox on the page": "Sett inn GUIDO-kode i et tekstfelt på siden" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/lang/pt_br.js 3 Jan 2016 20:51:55 -0000 1.1.2.1 @@ -0,0 +1,37 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt) +{ + "Add GUIDO Code in a textbox on the page": "Adicionar código GUIDO em uma caixa de texto na página", + "Add MIDI link to allow students to hear the music": "Adicionar um link MIDI para permitir que os estudantes escutem a música", + "Cancel": "Cancelar", + "Format": "Formato", + "GUIDO Code": "Código GUIDO", + "Guido code": "Código Guido", + "Image Preview": "Visualização da Imagem", + "Image in applet": "Imagem em Applet", + "Insert GUIDO Music Notation": "Inserir Notação GUIDO de Música", + "MIDI File": "Arquivo MIDI", + "OK": "OK", + "Options": "Opções", + "Preview": "Visualização", + "Preview the image in a new window": "Visualizar imagem em uma nova janela", + "Source Code": "Codigo Fonte", + "With Mozilla, the applet will not be visible in editor, but only in Web page after submitting.": "Com Mozilla, o applet não estará visível no editor, somente na Página Web depois do envio.", + "Zoom": "Ampliação", + "Zoom :": "Ampliação :" +} + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/popups/codenote.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/popups/codenote.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/NoteServer/popups/codenote.html 3 Jan 2016 20:51:56 -0000 1.1.2.1 @@ -0,0 +1,162 @@ + + + + +Insert GUIDO Music Notation + + + + + + + + +
    Insert GUIDO Music Notation
    + +Guido code : +

    + +
    +
    +Options + Add MIDI link to allow students to hear the music +
    + Add GUIDO Code in a textbox on the page +
    +
    + +
    +Format + Image in applet +
    + Zoom : + +
    +
    + +
    + + + + + + + + + + +
    + Image Preview:
    + +
    +
    +
    + +
    +

    Sample Guido Codes:

    +

    Code Sample 1 or type [ do re mi fa sol la si ] | Code Sample 2

    +

    Resources:

    +

    The Guido Specification (PDF) | (HTML)

    +

    GUIDO Music Notation Format Site | Guido Note Server | SourceForge Homepage

    +
    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/oacs-attach.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/oacs-attach.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/oacs-attach.css 3 Jan 2016 20:51:56 -0000 1.1.2.1 @@ -0,0 +1,20 @@ +/* styles for the LearnAtWU /HTMLArea */ +ilink { + background-image:url(/resources/acs-subsite/action-link-marker.png); + padding-left:12px; + background-repeat:no-repeat; + background-position:left; + border-bottom:1px dotted red; + color:red; + display:inline; +} + +keyref { + background-image:url(/resources/acs-subsite/action-link-marker.png); + padding-left:12px; + background-repeat:no-repeat; + background-position:left; + border-bottom:1px dotted green; + color:green; + display:inline; +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/oacs-attach.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/oacs-attach.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/oacs-attach.js 3 Jan 2016 20:51:56 -0000 1.1.2.1 @@ -0,0 +1,319 @@ +// File-Selector Plugin for xinha +// Developed in the Learn@WU Project of the +// Vienna University of Economics and Business Administration +// www.wu-wien.ac.at +// +// Authors: G�nter Ernst guenter.ernst@wu-wien.ac.at +// Gustaf Neumann (cleanup and addons) +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +// + +// HTMLArea.loadStyle("oacs-attach.css", "OacsAttach"); + +OacsAttach._pluginInfo = { + name : "OacsAttach", + version : "0.2", + developer : "Guenter Ernst", + developer_url : "http://learn.wu-wien.ac.at", + c_owner : "Guenter Ernst", + sponsor : "Wirtschaftsuniversit�t Wien", + sponsor_url : "http://www.wu-wien.ac.at", + license : "htmlArea" +}; + +function OacsAttach(editor) { + var args = arguments; + this.editor = editor; + var ArgsString = args[1].toString(); + var additionalArgs = ArgsString.split(","); + OacsAttach.package_id = this.editor.config.package_id; + if (!this.editor.config.attach_parent_id) { + OacsAttach.attach_parent_id = OacsAttach.package_id; + } else { + OacsAttach.attach_parent_id = this.editor.config.attach_parent_id; + } + OacsAttach.folder_id = this.editor.config.folder_id; + OacsAttach.file_types = this.editor.config.file_types; + OacsAttach.fullscreen_mode = additionalArgs[1]; + if (this.editor.config.key) { + OacsAttach.key = this.editor.config.key; + } else { + OacsAttach.key = ''; + } + var cfg = editor.config; + var tt = OacsAttach.I18N; + var bl = OacsAttach.btnList; + var self = this; + + //alert(this.editor.config.fs_package_id); + + // register the toolbar buttons provided by this plugin + for (var i = 0; i < bl.length; ++i) { + var btn = bl[i]; + var id = "LW-" + btn[0]; + cfg.registerButton(id, HTMLArea._lc(btn[1], "OacsAttach"), editor.imgURL(btn[0] + ".gif", "OacsAttach"), false, + function(editor, id) { + // dispatch button press event + self.buttonPress(editor, id); + }); + + switch (id) { + case "LW-insert-ilink": + cfg.addToolbarElement(id, "createlink", +1); + break; + case "LW-insert-image": + cfg.addToolbarElement(id, "insertimage", +1); + break; + } + } + cfg.hideSomeButtons(" insertimage "); + cfg.pageStyle = "@import url(" + _editor_url + + "plugins/OacsAttach/oacs-attach.css) screen; " +}; + +OacsAttach.btnList = [ + ["insert-ilink", "Insert Internal Link"], + ["insert-image", "Insert Image"] + ]; + +OacsAttach.prototype.buttonPress = function(editor, id) { + OacsAttach.editor = editor; + switch (id) { + case "LW-insert-ilink": + this.insertInternalLink(); + break; + case "LW-insert-image": + this.insertImage(); + break; + case "LW-close": + window.close(); + break; + } +}; + +// Called when the user clicks on "InsertLink" button. If the link is already +// there, it will just modify it's properties. +OacsAttach.prototype.insertInternalLink = function(link) { + var editor = OacsAttach.editor; // for nested functions + var outparam = null; + + if (typeof link == "undefined") { + link = editor.getParentElement(); + if (link && !/^a$/i.test(link.tagName)) + link = null; + } + if (link) { + outparam = { + f_href : HTMLArea.is_ie ? editor.stripBaseURL(link.href) : + link.getAttribute("href"), + f_title : link.title, + f_target : link.target, + f_usetarget : link.f_usetarget + }; + } else { + f_title = editor.getSelectedHTML(); + outparam = { + f_href : '', + f_title : f_title, + f_target : '', + f_usetarget : '' + }; + } + + // normally, allow-tcl-page is turned of, so the link shows under /resources + // the tcl source code, but not the result. + // var PopupUrl = _editor_url + + // "/acs-templating/scripts/xinha/insert-image.tcl?fs_package_id=" + + // fs_package_id; + + var PopupUrl = "/acs-templating/scripts/xinha/attach-file?package_id=" + OacsAttach.package_id; + if (typeof OacsAttach.key != "undefinied") { + PopupUrl = PopupUrl + "&parent_id=" + OacsAttach.key; + } else if (typeof OacsAttach.attach_parent_id != "undefined") { + PopupUrl = PopupUrl + "&parent_id=" + OacsAttach.attach_parent_id; + } + if (typeof OacsAttach.fs_package_id != "undefined") { + PopupUrl = PopupUrl + "&fs_package_id=" + OacsAttach.fs_package_id; + } + if (typeof OacsAttach.folder_id != "undefined") { + PopupUrl = PopupUrl + "&folder_id=" + OacsAttach.folder_id; + } + if (typeof OacsAttach.file_types != "undefined") { + PopupUrl = PopupUrl + "&file_types=" + OacsAttach.file_types; + } + + Dialog(PopupUrl, function(param) { + if (!param) { // user must have pressed Cancel + return false; + } + var ilink = editor._doc.createElement("a"); + ilink.href = param.f_href.trim(); + ilink.innerHTML = param.f_title.trim(); + ilink.title = param.f_title.trim(); + ilink.setAttribute("target", param.f_target.trim()); + //ilink.setAttribute("use_target",param.f_usetarget.trim()); + if (!link || link == null) { + if (HTMLArea.is_ie) { + editor.insertHTML(ilink.outerHTML); + } else { + editor.insertNodeAtSelection(ilink); + } + } else { + var parent = link.parentNode; + parent.replaceChild(ilink, link); + } + }, outparam); +}; + + +OacsAttach.prototype.insertInternalLinkTlf = function(link) { + var editor = OacsAttach.editor; + var outparam = null; + + if (typeof link == "undefined") { + link = editor.getParentElement(); + if (link && /^a$/i.test(link.tagName)) { + alert("This is an external link and cannot be edited"); + return false; + } + if (link && ((/^ilink$/i.test(link.tagName)== false) && + (/^keyref$/i.test(link.tagName) == false) )) + link = null; + } + + + if (link) { + outparam = { + f_title : link.getAttribute("title"), + f_area : link.getAttribute("area"), + f_restype : link.getAttribute("restype"), + f_shortname : link.getAttribute("shortname"), + f_presentation: link.getAttribute("presentation"), + f_label : link.innerHTML + }; + } + + var PopupUrl = "/acs-templating/scripts/xinha/attach-file?package_id=" + OacsAttach.package_id; + if (typeof OacsAttach.key != "undefinied") { + PopupUrl = PopupUrl + "&parent_id=" + OacsAttach.key; + } else if (typeof OacsAttach.attach_parent_id != "undefined") { + PopupUrl = PopupUrl + "&parent_id=" + OacsAttach.attach_parent_id; + } + if (typeof OacsAttach.fs_package_id != "undefined") { + PopupUrl = PopupUrl + "&fs_package_id=" + OacsAttach.fs_package_id; + } + if (typeof OacsAttach.folder_id != "undefined") { + PopupUrl = PopupUrl + "&folder_id=" + OacsAttach.folder_id; + } + + Dialog(PopupUrl, function(param) { + if (!param) + return false; + + // create new ilink + var iLinkTagName; + if (param.f_restype.trim()== "glo") { + iLinkTagName = "keyref"; + } else { + iLinkTagName = "ilink"; + } + + var iLink = editor._doc.createElement(iLinkTagName); + iLink.innerHTML = param.f_title.trim(); + iLink.title = param.f_title.trim(); + iLink.setAttribute("area", param.f_area.trim()); + iLink.setAttribute("shortname",param.f_shortname.trim()); + iLink.setAttribute("restype",param.f_restype.trim()); + + // + if (!link || link == null) { + if (HTMLArea.is_ie) { + editor.insertHTML(iLink.outerHTML); + } else { + editor.insertNodeAtSelection(iLink); + } + } else { + var iLinkParent = link.parentNode; + iLinkParent.replaceChild(iLink, link); + } + // var selection = editor._getSelection(); + // selection.removeAllRanges(); + editor.updateToolbar(); + }, outparam); +}; + + +// Called when the user clicks on "InsertImage" button. If an image is already +// there, it will just modify it's properties. +OacsAttach.prototype.insertImage = function(image) { + var editor = OacsAttach.editor; // for nested functions + var fs_package_id = OacsAttach.fs_package_id; + var outparam = null; + if (typeof image == "undefined") { + image = editor.getParentElement(); + if (image && !/^img$/i.test(image.tagName)) + image = null; + } + if (image) outparam = { + f_url : HTMLArea.is_ie ? editor.stripBaseURL(image.src) : + image.getAttribute("src"), + f_alt : image.alt, + f_border : image.border, + f_align : image.align, + f_vert : image.vspace, + f_horiz : image.hspace + }; + + // normally, allow tcl page is turned of, so the link shows under /resources + // the source code, but not the result. + // var PopupUrl = _editor_url + + // "/acs-templating/scripts/xinha/insert-image.tcl?fs_package_id=" + + // fs_package_id; + + var PopupUrl = "/acs-templating/scripts/xinha/attach-image?package_id=" + OacsAttach.package_id; + if (typeof OacsAttach.key != "undefinied") { + PopupUrl = PopupUrl + "&parent_id=" + OacsAttach.key; + } else if (typeof OacsAttach.attach_parent_id != "undefined") { + PopupUrl = PopupUrl + "&parent_id=" + OacsAttach.attach_parent_id; + } + if (typeof OacsAttach.folder_id != "undefined") { + PopupUrl = PopupUrl + "&folder_id=" + OacsAttach.folder_id; + } + + Dialog(PopupUrl, function(param) { + if (!param) { // user must have pressed Cancel + return false; + } + var img = image; + if (!img) { + var sel = editor._getSelection(); + var range = editor._createRange(sel); + editor._doc.execCommand("insertimage", false, param.f_url); + if (HTMLArea.is_ie) { + img = range.parentElement(); + // wonder if this works... + if (img.tagName.toLowerCase() != "img") { + img = img.previousSibling; + } + } else { + img = range.startContainer.previousSibling; + } + } else { + img.src = param.f_url; + } + if (img) { + for (field in param) { + var value = param[field]; + switch (field) { + case "f_alt" : img.alt = value; break; + case "f_border" : img.border = parseInt(value || "0"); break; + case "f_align" : img.align = value; break; + case "f_vert" : img.vspace = parseInt(value || "0"); break; + case "f_horiz" : img.hspace = parseInt(value || "0"); break; + } + } + } + }, outparam); +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/img/close.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/img/close.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/img/insert-ilink.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/img/insert-ilink.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/img/insert-image.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/img/insert-image.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/img/qmark.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/img/qmark.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/img/up.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsAttach/img/up.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/OacsFs.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/OacsFs.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/OacsFs.js 3 Jan 2016 20:51:57 -0000 1.1.2.1 @@ -0,0 +1,349 @@ +// File-Selector Plugin for xinha +// Developed in the Learn@WU Project of the +// Vienna University of Economics and Business Administration +// www.wu-wien.ac.at +// +// Authors: G�nter Ernst guenter.ernst@wu-wien.ac.at +// Gustaf Neumann (cleanup and addons) +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +// + +// HTMLArea.loadStyle("oacs-fs.css", "OacsFs"); + +OacsFs._pluginInfo = { + name : "OacsFs", + version : "0.4", + developer : "Guenter Ernst, Gustaf Neumann", + developer_url : "http://learn.wu-wien.ac.at", + c_owner : "Guenter Ernst", + sponsor : "Wirtschaftsuniversitaet Wien", + sponsor_url : "http://www.wu-wien.ac.at", + license : "htmlArea" +}; + +function OacsFs(editor) { + var args = arguments; + this.editor = editor; + var ArgsString = args[1].toString(); + var additionalArgs = ArgsString.split(","); + OacsFs.fs_package_id = this.editor.config.fs_package_id; + OacsFs.package_id = this.editor.config.package_id; + OacsFs.folder_id = this.editor.config.folder_id; + OacsFs.file_types = this.editor.config.file_types; + OacsFs.script_dir = this.editor.config.script_dir; + OacsFs.wiki_p = this.editor.config.wiki_p; + OacsFs.fullscreen_mode = additionalArgs[1]; + + if (typeof OacsFs.script_dir == "undefined") { + // if no script dir is specified, use xowiki as a fallback + OacsFs.script_dir = "/xowiki"; + } + + if (OacsFs.wiki_p) { + // if wiki_p is specified, add inser-wlink to the list of icon buttons + OacsFs.btnList.push(["insert-wlink", "Insert Wiki Link"]); + } + + var cfg = editor.config; + var tt = OacsFs.I18N; + var bl = OacsFs.btnList; + var self = this; + + //alert(this.editor.config.fs_package_id); + //alert("length=" + bl.length); + + // register the toolbar buttons provided by this plugin + for (var i = 0; i < bl.length; ++i) { + var btn = bl[i]; + var id = "LW-" + btn[0]; + + cfg.registerButton(id, HTMLArea._lc(btn[1], "OacsFs"), editor.imgURL(btn[0] + ".gif", "OacsFs"), false, + function(editor, id) { + // dispatch button press event + self.buttonPress(editor, id); + }); + + switch (id) { + case "LW-insert-ilink": + cfg.addToolbarElement(id, "createlink", +1); + break; + case "LW-insert-image": + cfg.addToolbarElement(id, "insertimage", +1); + break; + case "LW-insert-wlink": + cfg.addToolbarElement(id, "createlink", +1); + break; + } + } + + cfg.hideSomeButtons(" insertimage "); + cfg.pageStyle = "@import url(" + _editor_url + + "plugins/OacsFs/oacs-fs.css) screen; " +}; + +OacsFs.btnList = [ + ["insert-ilink", "Insert Internal Link"], + ["insert-image", "Insert Image"] + ]; + +OacsFs.prototype.buttonPress = function(editor, id) { + OacsFs.editor = editor; + switch (id) { + case "LW-insert-ilink": + this.insertInternalLink(); + break; + case "LW-insert-image": + this.insertImage(); + break; + case "LW-insert-wlink": + this.insertWlink(); + break; + case "LW-close": + window.close(); + break; + } +}; + +// Called when the user clicks on "InsertLink" button. If the link is already +// there, it will just modify it's properties. +OacsFs.prototype.insertInternalLink = function(link) { + var editor = OacsFs.editor; // for nested functions + var outparam = null; + + if (typeof link == "undefined") { + link = editor.getParentElement(); + if (link && !/^a$/i.test(link.tagName)) + link = null; + } + if (link) { + outparam = { + f_href : HTMLArea.is_ie ? editor.stripBaseURL(link.href) : + link.getAttribute("href"), + f_title : link.title, + f_target : link.target, + f_usetarget : link.f_usetarget + }; + } else { + outparam = { + f_href : '', + f_title : '', + f_target : '', + f_usetarget : '' + }; + } + + // normally, allow-tcl-page is turned of, so the link shows under /resources + // the tcl source code, but not the result. + // var PopupUrl = _editor_url + + // "plugins/OacsFs/popups/insert-image.tcl?fs_package_id=" + + // fs_package_id; + + var PopupUrl = OacsFs.script_dir + "/xinha/insert-ilink?"; + if (typeof OacsFs.fs_package_id != "undefined") { + PopupUrl = PopupUrl + "&fs_package_id=" + OacsFs.fs_package_id; + } + if (typeof OacsFs.folder_id != "undefined") { + PopupUrl = PopupUrl + "&folder_id=" + OacsFs.folder_id; + } + if (typeof OacsFs.file_types != "undefined") { + PopupUrl = PopupUrl + "&file_types=" + OacsFs.file_types; + } + + Dialog(PopupUrl, function(param) { + if (!param) { // user must have pressed Cancel + return false; + } + var ilink = editor._doc.createElement("a"); + ilink.href = param.f_href.trim(); + ilink.innerHTML = param.f_title.trim(); + ilink.title = param.f_title.trim(); + ilink.setAttribute("target", param.f_target.trim()); + //ilink.setAttribute("use_target",param.f_usetarget.trim()); + + if (!link || link == null) { + if (HTMLArea.is_ie) { + editor.insertHTML(ilink.outerHTML); + } else { + editor.insertNodeAtSelection(ilink); + } + } else { + var parent = link.parentNode; + parent.replaceChild(ilink, link); + } + }, outparam); +}; + + +OacsFs.prototype.insertInternalLinkTlf = function(link) { + var editor = OacsFs.editor; + var outparam = null; + + if (typeof link == "undefined") { + link = editor.getParentElement(); + if (link && /^a$/i.test(link.tagName)) { + alert("This is an external link and cannot be edited"); + return false; + } + if (link && ((/^ilink$/i.test(link.tagName)== false) && + (/^keyref$/i.test(link.tagName) == false) )) + link = null; + } + + + if (link) { + outparam = { + f_title : link.getAttribute("title"), + f_area : link.getAttribute("area"), + f_restype : link.getAttribute("restype"), + f_shortname : link.getAttribute("shortname"), + f_presentation: link.getAttribute("presentation"), + f_label : link.innerHTML + }; + } + + + var PopupUrl = OacsFs.script_dir + "/xinha/insert-ilink?"; + if (typeof OacsFs.fs_package_id != "undefined") { + PopupUrl = PopupUrl + "&fs_package_id=" + OacsFs.fs_package_id; + } + if (typeof OacsFs.folder_id != "undefined") { + PopupUrl = PopupUrl + "&folder_id=" + OacsFs.folder_id; + } + + Dialog(PopupUrl, function(param) { + if (!param) + return false; + + // create new ilink + var iLinkTagName; + if (param.f_restype.trim()== "glo") { + iLinkTagName = "keyref"; + } else { + iLinkTagName = "ilink"; + } + + var iLink = editor._doc.createElement(iLinkTagName); + iLink.innerHTML = param.f_title.trim(); + iLink.title = param.f_title.trim(); + iLink.setAttribute("area", param.f_area.trim()); + iLink.setAttribute("shortname",param.f_shortname.trim()); + iLink.setAttribute("restype",param.f_restype.trim()); + + // + if (!link || link == null) { + if (HTMLArea.is_ie) { + editor.insertHTML(iLink.outerHTML); + } else { + editor.insertNodeAtSelection(iLink); + } + } else { + var iLinkParent = link.parentNode; + iLinkParent.replaceChild(iLink, link); + } + // var selection = editor._getSelection(); + // selection.removeAllRanges(); + editor.updateToolbar(); + }, outparam); +}; + + +// Called when the user clicks on "InsertImage" button. If an image is already +// there, it will just modify it's properties. +OacsFs.prototype.insertImage = function(image) { + var editor = OacsFs.editor; // for nested functions + var fs_package_id = OacsFs.fs_package_id; + var outparam = null; + if (typeof image == "undefined") { + image = editor.getParentElement(); + if (image && !/^img$/i.test(image.tagName)) + image = null; + } + if (image) outparam = { + f_url : HTMLArea.is_ie ? editor.stripBaseURL(image.src) : + image.getAttribute("src"), + f_alt : image.alt, + f_border : image.border, + f_align : image.align, + f_vert : image.vspace, + f_horiz : image.hspace + }; + + // normally, allow tcl page is turned of, so the link shows under /resources + // the source code, but not the result. + // var PopupUrl = _editor_url + + // "plugins/OacsFs/popups/insert-image.tcl?fs_package_id=" + + // fs_package_id; + + var PopupUrl = OacsFs.script_dir + "/xinha/insert-image?"; + if (typeof OacsFs.fs_package_id != "undefined") { + PopupUrl = PopupUrl + "&fs_package_id=" + OacsFs.fs_package_id; + } + if (typeof OacsFs.folder_id != "undefined") { + PopupUrl = PopupUrl + "&folder_id=" + OacsFs.folder_id; + } + + Dialog(PopupUrl, function(param) { + if (!param) { // user must have pressed Cancel + return false; + } + var img = image; + if (!img) { + var sel = editor._getSelection(); + var range = editor._createRange(sel); + editor._doc.execCommand("insertimage", false, param.f_url); + if (HTMLArea.is_ie) { + img = range.parentElement(); + // wonder if this works... + if (img.tagName.toLowerCase() != "img") { + img = img.previousSibling; + } + } else { + img = range.startContainer.previousSibling; + } + } else { + img.src = param.f_url; + } + for (field in param) { + var value = param[field]; + switch (field) { + case "f_alt" : img.alt = value; break; + case "f_border" : img.border = parseInt(value || "0"); break; + case "f_align" : img.align = value; break; + case "f_vert" : img.vspace = parseInt(value || "0"); break; + case "f_horiz" : img.hspace = parseInt(value || "0"); break; + } + } + }, outparam); +}; + +// Called when the user clicks on "InserWikiLink" button. +OacsFs.prototype.insertWlink = function(link) { + var editor = OacsFs.editor; // for nested functions + var PopupUrl = OacsFs.script_dir + "/xinha/insert-wlink?"; + + // Check, if we have a package_id. Without a package_id, we do not + // know from which directory we should list the wiki links. + + if (typeof OacsFs.package_id == "undefined" || !OacsFs.wiki_p) { + alert("One can only insert Wiki links from inside a Wiki"); + } else { + PopupUrl = PopupUrl + "&package_id=" + OacsFs.package_id; + Dialog(PopupUrl, function(page) { + if (!page) { // user must have pressed Cancel + return false; + } + + // If there is a selection, use the selection as label, + // otherwise use the title of the wiki page. + var selection = editor._getSelection(); + var label = selection != "" ? selection : page.label; + + // Insert the page name and the label in wiki syntax + editor.insertHTML("[[" + page.name + + ((label != "") ? ("|" + label) : "") + + "]]"); + },null); + } +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/fullscreen.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/fullscreen.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/fullscreen.adp 3 Jan 2016 20:51:57 -0000 1.1.2.1 @@ -0,0 +1,123 @@ + + + + Fullscreen HTMLArea + + + + + + + + + +
    + +
    + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/fullscreen.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/fullscreen.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/fullscreen.tcl 3 Jan 2016 20:51:58 -0000 1.1.2.1 @@ -0,0 +1,28 @@ +ad_page_contract { + +} { + textarea_id:naturalnum,notnull + community_id:naturalnum,notnull +} + +# select the correct language file for htmlarea + +switch [lang::user::language -site_wide] { + en - + de { + set htmlarea_lang_file [lang::user::language -site_wide] + } + default { + set htmlarea_lang_file "en" + } +} + + + +ad_return_template + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/oacs-fs.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/oacs-fs.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/oacs-fs.css 3 Jan 2016 20:51:58 -0000 1.1.2.1 @@ -0,0 +1,20 @@ +/* styles for the LearnAtWU /HTMLArea */ +ilink { + background-image:url(/resources/acs-subsite/action-link-marker.png); + padding-left:12px; + background-repeat:no-repeat; + background-position:left; + border-bottom:1px dotted red; + color:red; + display:inline; +} + +keyref { + background-image:url(/resources/acs-subsite/action-link-marker.png); + padding-left:12px; + background-repeat:no-repeat; + background-position:left; + border-bottom:1px dotted green; + color:green; + display:inline; +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/img/close.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/img/close.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/img/insert-ilink.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/img/insert-ilink.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/img/insert-image.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/img/insert-image.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/img/insert-wlink.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/img/insert-wlink.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/img/qmark.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/img/qmark.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/img/up.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/img/up.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/lang/de.js 3 Jan 2016 20:51:59 -0000 1.1.2.1 @@ -0,0 +1,4 @@ +// empty +{ +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/lang/empty =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/lang/empty,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/lang/empty 3 Jan 2016 20:51:59 -0000 1.1.2.1 @@ -0,0 +1 @@ \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/lang/en.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/lang/en.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/lang/en.js 3 Jan 2016 20:51:59 -0000 1.1.2.1 @@ -0,0 +1,2 @@ +// empty +{}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/blank.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/blank.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/blank.html 3 Jan 2016 20:52:00 -0000 1.1.2.1 @@ -0,0 +1 @@ \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/file-selector.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/file-selector.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/file-selector.adp 3 Jan 2016 20:52:00 -0000 1.1.2.1 @@ -0,0 +1,161 @@ + + + @HTML_Title@ + + + + + + + + + +
    @HTML_Title@
    +
    @HTML_Context@
    + +
    + @HTML_Legend@ + + + +
    @folder_name@
    +
    + +
    +
    + + + + + + + + + + + +
    +
    + @HTML_Preview@ + +
    +
    + +
    + @HTML_UploadTitle@ + + + + + + + + + +
    + + + + + + +
    @formerror.upload_file@
    +
    +
    + +
    +
    +
    +
    +
    +
    + + +
    +
    + + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/file-selector.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/file-selector.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/file-selector.tcl 3 Jan 2016 20:52:00 -0000 1.1.2.1 @@ -0,0 +1,310 @@ +ad_page_contract { + @author Guenter Ernst guenter.ernst@wu-wien.ac.at + @author Gustaf Neumann neumann@wu-wien.ac.at + @creation-date 13.10.2005 + @cvs-id $Id: file-selector.tcl,v 1.1.2.1 2016/01/03 20:52:00 gustafn Exp $ +} { + {fs_package_id:naturalnum,notnull,optional} + {folder_id:naturalnum,optional} + {orderby:token,optional} + {selector_type "image"} + {file_types "*"} +} + +if {![info exists fs_package_id]} { + # we have not filestore package_id. This must be the first call. + if {[info exists folder_id]} { + # get package_id from folder_id + foreach {fs_package_id root_folder_id} \ + [fs::get_folder_package_and_root $folder_id] break + } else { + # get package_id from package name + set key file-storage + set id [apm_version_id_from_package_key $key] + set mount_url [site_node::get_children -all -package_key $key -node_id $id] + array set site_node [site_node::get -url $mount_url] + set fs_package_id $site_node(package_id) + } +} + +if {![info exists folder_id]} { + set folder_id [fs_get_root_folder -package_id $fs_package_id] + set root_folder_id $folder_id +} + +if {![fs_folder_p $folder_id]} { + ad_complain [_ file-storage.lt_The_specified_folder__1] + return +} + +# now we have at least a valid folder_id and a valid fs_package_id +if {![info exists root_folder_id]} { + set root_folder_id [fs_get_root_folder -package_id $fs_package_id] +} + +set fs_url [site_node::get_url_from_object_id -object_id $fs_package_id] + +# # Don't allow delete if root folder +set root_folder_p [expr {$folder_id == $root_folder_id}] + +set user_id [ad_conn user_id] +permission::require_permission \ + -party_id $user_id -object_id $folder_id \ + -privilege "read" + +set up_url {} + +if { !$root_folder_p} { + set parent_folder_id [fs::get_parent -item_id $folder_id] + set up_name [fs::get_object_name -object_id $parent_folder_id] + set up_url [export_vars -base file-selector \ + {fs_package_id {folder_id $parent_folder_id} + selector_type file_types}] +} + + +# if user has write permission, create image upload form, +if {[permission::permission_p -party_id $user_id -object_id $folder_id \ + -privilege "write"]} { + set write_p 1 + ad_form \ + -name upload_form \ + -mode edit \ + -export {fs_package_id folder_id orderby selector_type file_types} \ + -html { enctype multipart/form-data } \ + -form { + {upload_file:file(file) {html {size 30}} } + {ok_btn:text(submit) {label "[_ acs-templating.HTMLArea_SelectUploadBtn]"} + } + } \ + -on_submit { + # check file name + if {$upload_file eq ""} { + template::form::set_error upload_form upload_file \ + [_ acs-templating.HTMLArea_SpecifyUploadFilename] + break + } + + if {[info exists folder_size]} { + # check quota + set maximum_folder_size [parameter::get -parameter "MaximumFolderSize"] + if { $maximum_folder_size ne "" } { + if { $folder_size + [file size ${upload_file.tmpfile}] > $maximum_folder_size } { + template::form::set_error upload_form upload_file \ + [_ file-storage.out_of_space] + break + } + } + } + + set file_name [template::util::file::get_property filename $upload_file] + set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] + set mime_type [template::util::file::get_property mime_type $upload_file] + + if {$selector_type eq "image" && ![string match "image/*" $mime_type]} { + template::form::set_error upload_form upload_file \ + [_ acs-templating.HTMLArea_SelectImageUploadNoImage] + break + } + + set existing_file_id [fs::get_item_id -name $file_name -folder_id $folder_id] + + if {$existing_file_id ne ""} { + # write new revision + fs::add_file \ + -name $file_name \ + -item_id $existing_file_id \ + -parent_id $folder_id \ + -tmp_filename $upload_tmpfile \ + -creation_user $user_id \ + -creation_ip [ad_conn peeraddr] \ + -package_id $fs_package_id + } else { + # write file + fs::add_file \ + -name $file_name \ + -parent_id $folder_id \ + -tmp_filename $upload_tmpfile \ + -creation_user $user_id \ + -creation_ip [ad_conn peeraddr] \ + -package_id $fs_package_id + } + + } +} else { + set write_p 0 +} + + +# display the contents + +set folder_name [lang::util::localize [fs::get_object_name -object_id $folder_id]] +set content_size_total 0 + +set folder_path [db_exec_plsql get_folder_path { + select content_item__get_path(:folder_id, :root_folder_id) +}] + + +# -pass_to_urls {c} + +template::list::create \ + -name contents \ + -multirow contents \ + -pass_properties {fs_package_id selector_type folder_id} \ + -key object_id \ + -html {width 100%}\ + -filters {folder_id {} file_types {} selector_type {} fs_package_id {}} \ + -elements { + name { + label "[_ file-storage.Name]" + display_template { + + + + + + + #file-storage.@contents.type@# + onclick="selectImage('@contents.object_id@','@contents.file_url@','@contents.type@');return false;">@contents.name@ + } + orderby_desc {name desc} + orderby_asc {name asc} + html {nowrap ""} + } + content_size_pretty { + label "[_ file-storage.Size]" + orderby_desc {content_size desc} + orderby_asc {content_size asc} + } + type { + label "[_ file-storage.Type]" + orderby_desc {type desc} + orderby_asc {type asc} + } + last_modified_pretty { + label "[_ file-storage.Last_Modified]" + orderby_desc {last_modified_ansi desc} + orderby_asc {last_modified_ansi asc} + html {nowrap ""} + } + } + +set order_by_clause [expr {([info exists orderby] && $orderby ne "") ? + [template::list::orderby_clause -orderby -name contents] : + " order by fs_objects.sort_key, fs_objects.name asc"}] + + +if {$selector_type eq "image"} { + set file_types "image/%" +} +set filter_clause [expr {$file_types eq "*" ? "" : + "and (type like '$file_types' or type = 'folder')" }] + +set fs_sql "select object_id, name, live_revision, type, title, + to_char(last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, + content_size, url, sort_key, file_upload_name, + case + when :folder_path is null + then fs_objects.name + else :folder_path || '/' || name + end as file_url, + case + when last_modified >= (now() - cast('99999' as interval)) + then 1 + else 0 + end as new_p + from fs_objects + where parent_id = :folder_id + and exists (select 1 + from acs_object_party_privilege_map m + where m.object_id = fs_objects.object_id + and m.party_id = :user_id + and m.privilege = 'read') + $filter_clause + $order_by_clause" + +db_multirow -extend { + icon last_modified_pretty content_size_pretty + properties_link properties_url folder_p title +} contents get_fs_contents $fs_sql { + set last_modified_ansi [lc_time_system_to_conn $last_modified_ansi] + set last_modified_pretty [lc_time_fmt $last_modified_ansi "%x %X"] + set content_size_pretty [lc_numeric $content_size] + + if {$type eq "folder"} { + # append content_size_pretty " [_ file-storage.items]" + set content_size_pretty "" + } else { + append content_size_pretty " [_ file-storage.bytes]" + } + if {$title eq ""} {set title $name} + + set file_upload_name [fs::remove_special_file_system_characters \ + -string $file_upload_name] + + if { $content_size ne "" } { + incr content_size_total $content_size + } + + set name [lang::util::localize $name] + + switch -- $type { + folder { + set folder_p 1 + set icon /resources/file-storage/folder.gif + set file_url [export_vars -base file-selector \ + {fs_package_id {folder_id $object_id} + selector_type file_types}] + } + url { + set folder_p 1 + set icon /resources/url-button.gif + set file_url $fs_url/$url + } + default { + set folder_p 0 + set icon /resources/file-storage/file.gif + set file_url ${fs_url}view/$file_url + } + } + + + # We need to encode the hashes in any i18n message keys (.LRN plays + # this trick on some of its folders). If we don't, the hashes will cause + # the path to be chopped off (by ns_conn url) at the leftmost hash. + regsub -all {\#} $file_url {%23} file_url +} + +set HTML_NothingSelected [_ acs-templating.HTMLArea_SelectImageNothingSelected] +switch $selector_type { + "image" { + set HTML_Title [_ acs-templating.HTMLArea_SelectImageTitle] + set HTML_Legend [_ acs-templating.HTMLArea_SelectImage] + set HTML_Preview [_ acs-templating.HTMLArea_SelectImagePreview] + set HTML_UploadTitle [_ acs-templating.HTMLArea_SelectImageUploadTitle] + set HTML_Context "COMMUNITY NAME" + } + "file" { + set HTML_Title [_ acs-templating.HTMLArea_SelectFileTitle] + set HTML_Legend [_ acs-templating.HTMLArea_SelectFile] + set HTML_Preview [_ acs-templating.HTMLArea_SelectImagePreview] + set HTML_UploadTitle [_ acs-templating.HTMLArea_SelectFileUploadTitle] + set HTML_Context "COMMUNITY NAME" + } +} + + +ad_return_template + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/insert-ilink.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/insert-ilink.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/insert-ilink.adp 3 Jan 2016 20:52:00 -0000 1.1.2.1 @@ -0,0 +1,210 @@ + + + #acs-templating.HTMLArea_InsertModifyLink# + + + + + + + + + + + +
    #acs-templating.HTMLArea_InsertModifyLink#
    +
    +
    + + + + + + + + + + + + + + + +
    URL:
    Title (tooltip):
    Target: + + + + + + #acs-templating.HTMLArea_OpenFileStorage# + + +
      + + +
    + + + +
    + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/insert-ilink.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/insert-ilink.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/insert-ilink.tcl 3 Jan 2016 20:52:00 -0000 1.1.2.1 @@ -0,0 +1,23 @@ +ad_page_contract { + @author Guenter Ernst guenter.ernst@wu-wien.ac.at, + @author Gustaf Neumann neumann@wu-wien.ac.at + @creation-date 13.07.2004 + @cvs-id $Id: insert-ilink.tcl,v 1.1.2.1 2016/01/03 20:52:00 gustafn Exp $ +} { + {fs_package_id:naturalnum,optional} + {folder_id:naturalnum,optional} + {file_types *} +} + +set selector_type "file" +set file_selector_link [export_vars -base file-selector \ + {fs_package_id folder_id selector_type file_types}] +set fs_found 1 + +ad_return_template + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/insert-image.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/insert-image.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/insert-image.adp 3 Jan 2016 20:52:01 -0000 1.1.2.1 @@ -0,0 +1,235 @@ + + + #acs-templating.HTMLArea_InsertImageTitle# + + + + + + + + + + + +
    #acs-templating.HTMLArea_InsertImageTitle#
    + +
    + +
    + + + + + + + + + + + + + + +
    #acs-templating.HTMLArea_ImageURL# + +
    #acs-templating.HTMLArea_ImageAlternateText#
    + + + + + #acs-templating.HTMLArea_OpenFileStorage# +
    +
    +

    + + + + + + +
    +
    + Layout + + + + + + + + + + +
    #acs-templating.HTMLArea_ImageAlignment# + +
    #acs-templating.HTMLArea_ImageBorderSize#
    +
    +
    +
    + #acs-templating.HTMLArea_ImageSpacing# + + + + + + + + + + +
    #acs-templating.HTMLArea_ImageSpacingHorizontal#
    #acs-templating.HTMLArea_ImageSpacingVertical#
    +
    +
    + + + + + + + +
    + Image Preview:
    + +
    +
    + +
    +

    + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/insert-image.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/insert-image.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/OacsFs/popups/insert-image.tcl 3 Jan 2016 20:52:01 -0000 1.1.2.1 @@ -0,0 +1,20 @@ +ad_page_contract { + @author Guenter Ernst guenter.ernst@wu-wien.ac.at, + @author Gustaf Neumann neumann@wu-wien.ac.at + @creation-date 13.07.2004 + @cvs-id $Id: insert-image.tcl,v 1.1.2.1 2016/01/03 20:52:01 gustafn Exp $ +} { + {fs_package_id:naturalnum,optional} + {folder_id:naturalnum,optional} +} + +set selector_type "image" +set file_selector_link [export_vars -base file-selector \ + {fs_package_id folder_id selector_type}] +set fs_found 1 + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSFixed/PSFixed.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSFixed/PSFixed.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSFixed/PSFixed.js 3 Jan 2016 20:52:01 -0000 1.1.2.1 @@ -0,0 +1,147 @@ +/** + * PSFixed PSFixed.js file. + * This plugin is a fake persistent storage backed. It is configured with a + * fixed list of stored objects and presents them to the user for insertion. + * A sample config is below: + * + * PSFixed.config = { + * 'xinha.png': { + * $type: 'image', + * URL: 'http://trac.xinha.org/chrome/common/trac_banner.png' + * }, + * 'browser': { + * $type: 'folder', + * 'firefox.png': { + * $type: 'image', + * URL: 'http://www.mozilla.com/img/tignish/firefox/vs-firefox-logo.png' + * } + * } + * } + */ +(function() { +var PSFixed = window.PSFixed = function PSFixed(editor) { + this.editor = editor; +} + +PSFixed._pluginInfo = { + name : "PSFixed", + version : "2.0", + developer : "Douglas Mayle", + developer_url : "http://xinha.org", + license : "BSD" +}; + +PSFixed.prototype.onGenerateOnce = function () { + // We use _prepareDialog to asynchronously load the dialog markup and then + // perform necessary processing. + this._registerBackend(); +}; + +PSFixed.prototype._registerBackend = function(timeWaited) { + var editor = this.editor; + var self = this; + + if (!timeWaited) { + timeWaited = 0; + } + + // Retry over a period of ten seconds to register. We back off exponentially + // to limit resouce usage in the case of misconfiguration. + var registerTimeout = 10000; + + if (timeWaited > registerTimeout) { + // This is most likely a configuration error. We're loaded and + // PersistentStorage is not. + return; + } + + if (!editor.plugins['PersistentStorage'] || + !editor.plugins['PersistentStorage'].instance || + !editor.plugins['PersistentStorage'].instance.ready) { + + window.setTimeout(function() {self._registerBackend(timeWaited ? timeWaited*2 : 50);}, timeWaited ? timeWaited : 50); + return; + } + editor.plugins['PersistentStorage'].instance.registerBackend('PSFixed', this); +} + +PSFixed.prototype.loadData = function (asyncCallback) { + // We don't expect the user to set the type on the root folder, so we set it + // ourselves. + if (!this.config.$type) { + this.config.$type = 'folder'; + } + asyncCallback(this.config); +} + +var treeRecurse = function treeRecurse(tree, callback, root) { + if (typeof root == 'undefined') { + root = '/'; + callback('/', '', tree); + } + + for (var key in tree) { + callback(root, key, tree[key]); + + if (tree[key].$type == 'folder') { + treeRecurse(tree[key], callback, root + key + '/'); + } + } +}; + +PSFixed.prototype.getFilters = function(dirTree) { + var filters = []; + + treeRecurse(dirTree, function(path, key, value) { + if (value.$type != 'folder') { + return; + } + + var filePath = key.length ? path + key + '/' : path; + filters.push({ + value: filePath, + display: filePath + }); + }); + + return filters; +} + +PSFixed.prototype.getMetadata = function(dirTree, filterPath) { + var editor = this.editor; + var self = this; + + var metadata = []; + + treeRecurse(dirTree, function(path, key, value) { + if (!value.$type || !key) { + // This is a builtin property of objects, not one returned by the + // backend. + return; + } + + if (path != filterPath) { + return; + } + + if (value.$type == 'folder') { + metadata.push({ + URL: self.editor.imgURL('folder.gif', 'PersistentStorage'), + name: key, + key: path + key, + $type: value.$type + }); + } else { + metadata.push({ + URL: value.URL, + name: key, + key: path + key, + $type: value.$type + }); + } + }); + + return metadata; +} + +})(); Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSLocal/PSLocal.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSLocal/PSLocal.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSLocal/PSLocal.js 3 Jan 2016 20:52:01 -0000 1.1.2.1 @@ -0,0 +1,355 @@ +/** + * PSLocal PSLocal.js file. + * This plugin is a Gears based local persistent storage backend. + */ +(function() { +var PSLocal = window.PSLocal = function PSLocal(editor) { + this.editor = editor; + + this.config = { + capabilities: { + directory_operations: true, + file_operations: true, + image_operations: false, + upload_operations: true, + import_operations: false, + user_publish: false, + shared_publish: false, + user_storage: true + }, + displayName: 'Local' + } +} + +PSLocal._pluginInfo = { + name : "PSLocal", + version : "2.0", + developer : "Douglas Mayle", + developer_url : "http://xinha.org", + license : "BSD" +}; + +PSLocal.prototype.onGenerateOnce = function () { + // We use _prepareBackend to asynchronously load the Gears backend. + this._prepareBackend(); +}; + +PSLocal.prototype._showGearsButton = function() { + var self = this; + var editor = this.editor; + + editor.config.registerButton({ + id : 'localstorage', + tooltip : Xinha._lc( 'Learn About Local Storage', 'PSLocal' ), + image : [_editor_url + editor.config.imgURL + 'ed_buttons_main.png',2,8], + textMode : true, + action : function() { self.learnDialog(); } + } + ); + editor.config.addToolbarElement('localstorage', 'fullscreen', 1); + + // Since this is after the editor load, we have to trigger an udate manually... + editor._rebuildToolbar(); +} + +PSLocal.prototype._prepareBackend = function() { + var self = this; + var editor = this.editor; + + if (!this.gears_init) { + this.gears_init = true; + Xinha._loadback(Xinha.getPluginDir("PSLocal") + "/gears_init.js", + function() { + self._prepareBackend(); + }); + return; + } + + if (!window.google || !google.gears) { + // No gears, so no need to register. We'll register a button, however, to + // enable users to learn about the support we offer. + this._showGearsButton(); + return; + } + + if (!google.gears.factory.hasPermission) { + if (!google.gears.factory.getPermission('Xinha', editor.imgURL('/images/xinha-small-icon.gif'), Xinha._lc( 'Enable Gears in order to use local document storage and configuration.', 'PSLocal' ))) { + // The user has denied access to Gears. We'll give them a UI to allow + // them to change their mind. + this._showGearsButton(); + return; + } + } + + this.workerPool = google.gears.factory.create('beta.workerpool', '1.0'); + + this.remoteStorageWorker = this.workerPool.createWorkerFromUrl("http://xinhadocs.org/worker.js"); + + this._registerBackend(); +} + +PSLocal.prototype.learnDialog = function(timeWaited) { + var self = this; + var editor = this.editor; + + if (!this.html) { + Xinha._getback(Xinha.getPluginDir("PSLocal") + "/dialog.html", + function(getback) { + self.html = getback; + self.learnDialog(); + }); + return; + } + + if (this.dialog) { + this.dialog.show(); + return; + } + + this.dialog = new Xinha.Dialog(editor, this.html, "PersistentStorage", + {width: 700, + closeOnEscape: true, + resizable: true, + centered: true, + modal: true + }); + + var link = this.dialog.getElementById('GearsLink'); + + // Tack on our URL so that Google will return here after installation. + link.href += location.href; + + var button = this.dialog.getElementById("confirm"); + if (window.google && google.gears) { + Xinha._addClass(this.dialog.getElementById('InstallText'), 'hidden'); + // The user has gears installed, but has denied us access to it, so we'll + // give them the option to change their mind. + button.value = Xinha._lc('Enable', 'PSLocal'); + + button.onclick = function() { + // The user gave us permission, so we'll reload the page. + if (confirm(Xinha._lc('This will reload the page, causing you to lose any unsaved work. Press "OK" to reload.', 'PSLocal' ))) { + window.location.reload(true); + } + } + } else { + Xinha._addClass(this.dialog.getElementById('EnableText'), 'hidden'); + // Gears isn't installed, so we'll build the dialog to prompt installation. + button.value = Xinha._lc('Install', 'PSLocal'); + + button.onclick = function() { + location.href = link.href; + } + } + + var cancel = this.dialog.getElementById('cancel'); + cancel.onclick = function() { + self.dialog.hide(); + } + + this.dialog.show(); +} + +PSLocal.prototype._registerBackend = function(timeWaited) { + var editor = this.editor; + var self = this; + + if (!timeWaited) { + timeWaited = 0; + } + + // Retry over a period of ten seconds to register. We back off exponentially + // to limit resouce usage in the case of misconfiguration. + var registerTimeout = 10000; + + if (timeWaited > registerTimeout) { + // This is most likely a configuration error. We're loaded and + // PersistentStorage is not. + return; + } + + if (!editor.plugins['PersistentStorage'] || + !editor.plugins['PersistentStorage'].instance || + !editor.plugins['PersistentStorage'].instance.ready) { + + window.setTimeout(function() {self._registerBackend(timeWaited ? timeWaited*2 : 50);}, timeWaited ? timeWaited : 50); + return; + } + var PS = editor.plugins['PersistentStorage'].instance; + var self = this; + + this.config.thumbURL = this.editor.imgURL('images/tango/32x32/places/folder.png'); + this.loadDocument({URL:'', name:'config.js', key:'/config.js'}, function(json) { + var userconfig = json ? eval('(' + json + ')') : false; + PS.registerBackend('PSLocal', self, self.config, userconfig); + }); +} + +PSLocal.prototype.loadDocument = function(entry, asyncCallback) { + + this.workerPool.onmessage = function(a, b, message) { + if (!message.body || !message.body.authorized) { + // Fail + asyncCallback(''); + } + + if (message.body.response) { + asyncCallback(message.body.response); + } else if (entry.URL) { + Xinha._getback(entry.URL, + function(documentSource) { + asyncCallback(documentSource); + }); + } else { + // Oops, no data :-( + asyncCallback(''); + } + } + + this.workerPool.sendMessage({func: 'loadDocument', entry: entry}, this.remoteStorageWorker); +} + +PSLocal.prototype.loadData = function (asyncCallback) { + this.workerPool.onmessage = function(a, b, message) { + if (!message.body || !message.body.authorized) { + // Fail + asyncCallback(''); + } + + asyncCallback({dirs: message.body.dirs, files: message.body.files}); + } + + this.workerPool.sendMessage({func: 'loadData'}, this.remoteStorageWorker); +} + +PSLocal.prototype.getFilters = function(filedata) { + // Clear out the previous directory listing. + var filters = [], paths = {}; + var dirList = filedata.dirs; + + for (var index=0; index 2) { + pathpart = pathpart.slice(0,pathpart.length-1).join('/'); + } else { + pathpart = '/'; + } + + var filepart = fileList[index].fullpath.split('/').slice(-1)[0]; + if (filterPath == pathpart) { + metadata.push({ + URL: fileList[index].url, + thumbURL: editor.imgURL('images/tango/32x32/mimetypes/text-x-generic.png'), + name: filepart, + key: fileList[index].fullpath, + $type: fileList[index].filetype + }); + } + } + + var dirList = filedata.dirs; + + for (var index=0; index 1 && dirList[index].split('/').length == 2; + } else { + // Chop the last component of the directory and compare against the filter. + var matches = dirList[index].split('/').slice(0,-1).join('/') == filterPath; + } + if (matches) { + metadata.push({ + name: dirList[index].split('/').slice(-1), + key: dirList[index], + $type: 'folder' + }); + } + } + + return metadata; +} + +PSLocal.prototype.saveDocument = function(parentpath, filename, documentSource, asyncCallback) { + this.workerPool.onmessage = function(a, b, message) { + if (!message.body || !message.body.authorized) { + // Fail + asyncCallback(false); + } + + if (asyncCallback) { + asyncCallback(message.body.response); + } + } + + this.workerPool.sendMessage({func: 'saveDocument', parentpath: parentpath, filename: filename, content:documentSource}, this.remoteStorageWorker); +} +PSLocal.prototype.deleteEntry = function(entry, asyncCallback) { + this.workerPool.onmessage = function(a, b, message) { + if (!message.body || !message.body.authorized) { + // Fail + asyncCallback(false); + } + + if (asyncCallback) { + asyncCallback(message.body.response); + } + } + + this.workerPool.sendMessage({func: 'deleteEntry', entry: entry}, this.remoteStorageWorker); +} + +PSLocal.prototype.makeFolder = function(currentPath, folderName, asyncCallback) { + this.workerPool.onmessage = function(a, b, message) { + if (!message.body || !message.body.authorized) { + // Fail + asyncCallback(false); + } + + if (asyncCallback) { + asyncCallback(true); + } + } + + this.workerPool.sendMessage({func: 'makeFolder', parentpath: currentPath, dirname: folderName}, this.remoteStorageWorker); +} + +PSLocal.prototype.copyEntry = function(entry, asyncCallback) { + this.workerPool.onmessage = function(a, b, message) { + if (!message.body || !message.body.authorized) { + // Fail + asyncCallback(false); + } + + if (asyncCallback) { + asyncCallback(message.body.response, message.body.entry); + } + } + + this.workerPool.sendMessage({func: 'copyEntry', entry: entry}, this.remoteStorageWorker); +} + +})(); Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSLocal/dialog.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSLocal/dialog.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSLocal/dialog.html 3 Jan 2016 20:52:02 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +

    Enabling Local Storage

    +

    Xinha uses Google Gears to enable local document storage. With Gears installed, you can save drafts of your documents on your hard drive, configure Xinha to look the way you want, and carry this information wherever you use Xinha on the web.

    +

    To learn more about Gears, and enable this functionality on your system, please see http://gears.google.com or click "Install" below.

    +

    To enable Gears for this website, click "Enable" to reload the page then enable Gears.. Since the page will be refreshed, please be sure to save any unfinished work.

    + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSLocal/gears_init.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSLocal/gears_init.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSLocal/gears_init.js 3 Jan 2016 20:52:02 -0000 1.1.2.1 @@ -0,0 +1,86 @@ +// Copyright 2007, Google Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// 3. Neither the name of Google Inc. nor the names of its contributors may be +// used to endorse or promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Sets up google.gears.*, which is *the only* supported way to access Gears. +// +// Circumvent this file at your own risk! +// +// In the future, Gears may automatically define google.gears.* without this +// file. Gears may use these objects to transparently fix bugs and compatibility +// issues. Applications that use the code below will continue to work seamlessly +// when that happens. + +(function() { + // We are already defined. Hooray! + if (window.google && google.gears) { + return; + } + + var factory = null; + + // Firefox + if (typeof GearsFactory != 'undefined') { + factory = new GearsFactory(); + } else { + // IE + try { + factory = new ActiveXObject('Gears.Factory'); + // privateSetGlobalObject is only required and supported on WinCE. + if (factory.getBuildInfo().indexOf('ie_mobile') != -1) { + factory.privateSetGlobalObject(this); + } + } catch (e) { + // Safari + if ((typeof navigator.mimeTypes != 'undefined') + && navigator.mimeTypes["application/x-googlegears"]) { + factory = document.createElement("object"); + factory.style.display = "none"; + factory.width = 0; + factory.height = 0; + factory.type = "application/x-googlegears"; + document.documentElement.appendChild(factory); + } + } + } + + // *Do not* define any objects if Gears is not installed. This mimics the + // behavior of Gears defining the objects in the future. + if (!factory) { + return; + } + + // Now set up the objects, being careful not to overwrite anything. + // + // Note: In Internet Explorer for Windows Mobile, you can't add properties to + // the window object. However, global objects are automatically added as + // properties of the window object in all browsers. + if (!window.google) { + google = {}; + } + + if (!google.gears) { + google.gears = {factory: factory}; + } +})(); Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/PSServer.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/PSServer.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/PSServer.js 3 Jan 2016 20:52:02 -0000 1.1.2.1 @@ -0,0 +1,282 @@ +/** + * PSServer PSServer.js file. + * This plugin is a server based persistent storage backend. + */ +(function() { +var PSServer = window.PSServer = function PSServer(editor) { + this.editor = editor; +} + +PSServer._pluginInfo = { + name : "PSServer", + version : "2.0", + developer : "Douglas Mayle", + developer_url : "http://xinha.org", + license : "MIT" +}; + +PSServer.prototype.onGenerateOnce = function () { + // We use _loadConfig to asynchronously load the config and then register the + // backend. + this._loadConfig(); +}; + +PSServer.prototype._loadConfig = function() { + var self = this; + if (!this._serverConfig) { + Xinha._getback(Xinha.getPluginDir("PSServer") + "/config.inc.php", + function(config) { + self._serverConfig = eval('(' + config + ')'); + self._serverConfig.user_affinity = 20; + self._serverConfig.displayName = 'Server'; + self._loadConfig(); + }); + return; + } + + this._registerBackend(); +} + +PSServer.prototype._registerBackend = function(timeWaited) { + var editor = this.editor; + var self = this; + + if (!timeWaited) { + timeWaited = 0; + } + + // Retry over a period of ten seconds to register. We back off exponentially + // to limit resouce usage in the case of misconfiguration. + var registerTimeout = 10000; + + if (timeWaited > registerTimeout) { + // This is most likely a configuration error. We're loaded and + // PersistentStorage is not. + return; + } + + if (!editor.plugins['PersistentStorage'] || + !editor.plugins['PersistentStorage'].instance || + !editor.plugins['PersistentStorage'].instance.ready) { + + window.setTimeout(function() {self._registerBackend(timeWaited ? timeWaited*2 : 50);}, timeWaited ? timeWaited : 50); + return; + } + editor.plugins['PersistentStorage'].instance.registerBackend('PSServer', this, this._serverConfig); +} + +PSServer.prototype.loadData = function (asyncCallback) { + var self = this; + Xinha._getback(Xinha.getPluginDir("PSServer") + "/backend.php?directory&listing", + function(json) { + self.dirTree = eval('(' + json + ')'); + asyncCallback(self.dirTree); + }); +} + +var treeRecurse = function treeRecurse(tree, callback, root) { + if (typeof root == 'undefined') { + root = '/'; + callback('/', '', tree); + } + + for (var key in tree) { + callback(root, key, tree[key]); + + if (tree[key].$type == 'folder') { + treeRecurse(tree[key], callback, root + key + '/'); + } + } +}; + +PSServer.prototype.getFilters = function(dirTree) { + // Clear out the previous directory listing. + var filters = []; + + treeRecurse(dirTree, function(path, key, value) { + if (value.$type != 'folder') { + return; + } + + var filePath = key.length ? path + key + '/' : path; + var filePathDisplay = key.length ? path + key + '/' : path; + if (filePathDisplay.length > 1) { + filePathDisplay = filePathDisplay.substring(0, filePathDisplay.length-1); + } + filters.push({ + value: filePath, + display: filePathDisplay + }); + }); + + return filters; +} + +PSServer.prototype.loadDocument = function(entry, asyncCallback) { + + Xinha._getback(entry.URL, + function(documentSource) { + asyncCallback(documentSource); + }); +} +PSServer.prototype.getMetadata = function(dirTree, pathFilter, typeFilter) { + var editor = this.editor; + var self = this; + + var metadata = []; + + var typeKeys = {}; + for (var index=0; index + // File: + // + // + var iframeID = dialog.createId('importFrame'); + + var form = document.createElement('form'); + form.setAttribute('enctype', 'multipart/form-data'); + form.setAttribute('method', 'post'); + form.setAttribute('action', Xinha.getPluginDir("PSServer") + "/backend.php?upload&replace=true&"); + + var fileentry = document.createElement('input'); + fileentry.setAttribute('type', 'file'); + fileentry.setAttribute('name', 'filedata'); + + var submitbutton = document.createElement('input'); + submitbutton.setAttribute('type', 'submit'); + submitbutton.setAttribute('value',Xinha._lc('Import', 'PSServer')); + + var filetext = document.createTextNode(Xinha._lc('File: ', 'PSServer')); + filetext = form.appendChild(filetext); + + fileentry = form.appendChild(fileentry); + + submitbutton = form.appendChild(submitbutton); + + form = element.appendChild(form); + form.setAttribute('target', iframeID); + + // The iframe must be added to the document after the form has been, or the targeting fails. + var iframe = document.createElement('iframe'); + iframe.setAttribute('src', 'about:blank'); + iframe.style.display = 'none'; + iframe.id = iframe.name = iframeID; + iframe.onload = function() { + var docCheck = iframe.contentDocument || iframe.contentWindow; + if (docCheck.location.href == 'about:blank') { + return; + } + // What to do on import? Add an entry to the UI, I guess... + alert('Add entry here'); + } + iframe = element.appendChild(iframe); + +} + +PSServer.prototype.saveDocument = function(path, filename, documentSource, asyncCallback) { + Xinha._postback(Xinha.getPluginDir("PSServer") + "/backend.php?upload&replace=true&filedata=" + escape(documentSource)+"&filename="+escape(path + filename), + null, + function(response) { + asyncCallback(true); + }, + function(response) { + asyncCallback(false); + }); +} + +PSServer.prototype.makeFolder = function(currentPath, folderName, asyncCallback) { + Xinha._postback(Xinha.getPluginDir("PSServer") + "/backend.php?directory&create&dirname="+escape(currentPath + '/' + folderName), + null, + function(response) { + asyncCallback(true); + }, + function(response) { + asyncCallback(false); + }); +} + +PSServer.prototype.deleteEntry = function(entry, asyncCallback) { + Xinha._postback(Xinha.getPluginDir("PSServer") + "/backend.php?file&delete&filename="+escape(entry.key), + null, + function(response) { + asyncCallback(true); + }, + function(response) { + asyncCallback(false); + }); +} + +PSServer.prototype.moveEntry = function(entry, container, asyncCallback) { + Xinha._postback(Xinha.getPluginDir("PSServer") + "/backend.php?file&rename&filename="+escape(entry.key)+'&newname='+escape(container.key + '/' + entry.name), + null, + function(json) { + asyncCallback(true); + }, + function(json) { + asyncCallback(false); + }); +} + +PSServer.prototype.copyEntry = function(entry, asyncCallback) { + Xinha._postback(Xinha.getPluginDir("PSServer") + "/backend.php?file©&filename="+escape(entry.key), + null, + function(json) { + var newentry = eval('(' + json + ')'); + asyncCallback(true, newentry); + }, + function(json) { + var newentry = eval('(' + json + ')'); + asyncCallback(false, newentry); + }); +} + +})(); Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/backend.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/backend.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/backend.php 3 Jan 2016 20:52:02 -0000 1.1.2.1 @@ -0,0 +1,830 @@ + + * @version 1.0 + * @package PersistentStorage + * + */ + +/** + * Config file + */ +require_once('config.inc.php'); + + +// Strip slashes if MQGPC is on +set_magic_quotes_runtime(0); +if(get_magic_quotes_gpc()) +{ + $to_clean = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE); + while(count($to_clean)) + { + $cleaning =& $to_clean[array_pop($junk = array_keys($to_clean))]; + unset($to_clean[array_pop($junk = array_keys($to_clean))]); + foreach(array_keys($cleaning) as $k) + { + if(is_array($cleaning[$k])) + { + $to_clean[] =& $cleaning[$k]; + } + else + { + $cleaning[$k] = stripslashes($cleaning[$k]); + } + } + } +} + +// Set the return headers for a JSON response. +header('Cache-Control: no-cache, must-revalidate'); +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +//header('Content-type: application/json'); + + +/**#@+ + * Constants + * + * Since this is being used as part of a web interface, we'll set some rather + * conservative limits to keep from overloading the user or the backend. + */ + +/** + * This is the maximum folder depth to present to the user + */ +define('MAX_DEPTH', 10); + +/** + * This is the maximum number of file entries per folder to show to the user, + */ +define('MAX_FILES_PER_FOLDER', 50); + +/** + * This array contains the default HTTP Response messages + * + */ +$HTTP_ERRORS = array( + 'HTTP_SUCCESS_OK' => array('code' => 200, 'message' => 'OK'), + 'HTTP_SUCCESS_CREATED' => array('code' => 201, 'message' => 'Created'), + 'HTTP_SUCCESS_ACCEPTED' => array('code' => 202, 'message' => 'Accepted'), + 'HTTP_SUCCESS_NON_AUTHORITATIVE' => array('code' => 203, 'message' => 'Non-Authoritative Information'), + 'HTTP_SUCCESS_NO_CONTENT' => array('code' => 204, 'message' => 'No Content'), + 'HTTP_SUCCESS_RESET_CONTENT' => array('code' => 205, 'message' => 'Reset Content'), + 'HTTP_SUCCESS_PARTIAL_CONTENT' => array('code' => 206, 'message' => 'Partial Content'), + + 'HTTP_REDIRECTION_MULTIPLE_CHOICES' => array('code' => 300, 'message' => 'Multiple Choices'), + 'HTTP_REDIRECTION_PERMANENT' => array('code' => 301, 'message' => 'Moved Permanently'), + 'HTTP_REDIRECTION_FOUND' => array('code' => 302, 'message' => 'Found'), + 'HTTP_REDIRECTION_SEE_OTHER' => array('code' => 303, 'message' => 'See Other'), + 'HTTP_REDIRECTION_NOT_MODIFIED' => array('code' => 304, 'message' => 'Not Modified'), + 'HTTP_REDIRECTION_USE_PROXY' => array('code' => 305, 'message' => 'Use Proxy'), + 'HTTP_REDIRECTION_UNUSED' => array('code' => 306, 'message' => '(Unused)'), + 'HTTP_REDIRECTION_TEMPORARY' => array('code' => 307, 'message' => 'Temporary Redirect'), + + 'HTTP_CLIENT_BAD_REQUEST' => array('code' => 400, 'message' => 'Bad Request'), + 'HTTP_CLIENT_UNAUTHORIZED' => array('code' => 401, 'message' => 'Unauthorized'), + 'HTTP_CLIENT_PAYMENT_REQUIRED' => array('code' => 402, 'message' => 'Payment Required'), + 'HTTP_CLIENT_FORBIDDEN' => array('code' => 403, 'message' => 'Forbidden'), + 'HTTP_CLIENT_NOT_FOUND' => array('code' => 404, 'message' => 'Not Found'), + 'HTTP_CLIENT_METHOD_NOT_ALLOWED' => array('code' => 405, 'message' => 'Method Not Allowed'), + 'HTTP_CLIENT_NOT_ACCEPTABLE' => array('code' => 406, 'message' => 'Not Acceptable'), + 'HTTP_CLIENT_PROXY_AUTH_REQUIRED' => array('code' => 407, 'message' => 'Proxy Authentication Required'), + 'HTTP_CLIENT_REQUEST_TIMEOUT' => array('code' => 408, 'message' => 'Request Timeout'), + 'HTTP_CLIENT_CONFLICT' => array('code' => 409, 'message' => 'Conflict'), + 'HTTP_CLIENT_GONE' => array('code' => 410, 'message' => 'Gone'), + 'HTTP_CLIENT_LENGTH_REQUIRED' => array('code' => 411, 'message' => 'Length Required'), + 'HTTP_CLIENT_PRECONDITION_FAILED' => array('code' => 412, 'message' => 'Precondition Failed'), + 'HTTP_CLIENT_REQUEST_TOO_LARGE' => array('code' => 413, 'message' => 'Request Entity Too Large'), + 'HTTP_CLIENT_REQUEST_URI_TOO_LARGE' => array('code' => 414, 'message' => 'Request-URI Too Long'), + 'HTTP_CLIENT_UNSUPPORTED_MEDIA_TYPE' => array('code' => 415, 'message' => 'Unsupported Media Type'), + 'HTTP_CLIENT_REQUESTED_RANGE_NOT_POSSIBLE' => array('code' => 416, 'message' => 'Requested Range Not Satisfiable'), + 'HTTP_CLIENT_EXPECTATION_FAILED' => array('code' => 417, 'message' => 'Expectation Failed'), + + 'HTTP_SERVER_INTERNAL' => array('code' => 500, 'message' => 'Internal Server Error'), + 'HTTP_SERVER_NOT_IMPLEMENTED' => array('code' => 501, 'message' => 'Not Implemented'), + 'HTTP_SERVER_BAD_GATEWAY' => array('code' => 502, 'message' => 'Bad Gateway'), + 'HTTP_SERVER_SERVICE_UNAVAILABLE' => array('code' => 503, 'message' => 'Service Unavailable'), + 'HTTP_SERVER_GATEWAY_TIMEOUT' => array('code' => 504, 'message' => 'Gateway Timeout'), + 'HTTP_SERVER_UNSUPPORTED_VERSION' => array('code' => 505, 'message' => 'HTTP Version not supported') + ); + +/** + * This is a regular expression used to detect reserved or dangerous filenames. + * Most NTFS special filenames begin with a dollar sign ('$'), and most Unix + * special filenames begin with a period (.), so we'll keep them out of this + * list and just prevent those two characters in the first position. The rest + * of the special filenames are included below. + */ +define('RESERVED_FILE_NAMES', 'pagefile\.sys|a\.out|core'); +/** + * This is a regular expression used to detect invalid file names. It's more + * strict than necessary, to be valid multi-platform, but not posix-strict + * because we want to allow unicode filenames. We do, however, allow path + * seperators in the filename because the file could exist in a subdirectory. + */ +define('INVALID_FILE_NAME','^[.$]|^(' . RESERVED_FILE_NAMES . ')$|[?%*:|"<>]'); +/**#@-*/ + +function main($arguments) { + $config = get_config(true); + + // Trigger authentication if it's configured. + if ($config['capabilities']['user_storage'] && empty($_SERVER['PHP_AUTH_USER'])) { + header('WWW-Authenticate: Basic realm="Xinha Persistent Storage"'); + header('HTTP/1.0 401 Unauthorized'); + echo "You must login in order to use Persistent Storage"; + exit; + } + if (!input_valid($arguments, $config['capabilities'])) { + http_error_exit(); + } + if (!method_valid($arguments)) { + http_error_exit('HTTP_CLIENT_METHOD_NOT_ALLOWED'); + } + if (!dispatch($arguments)) { + http_error_exit(); + } + exit(); +} + +main($_REQUEST + $_FILES); +// ************************************************************ +// ************************************************************ +// Helper Functions +// ************************************************************ +// ************************************************************ + +/** + * Take the call and properly dispatch it to the methods below. This method + * assumes valid input. + */ +function dispatch($arguments) { + if (array_key_exists('file', $arguments)) { + if (array_key_exists('rename', $arguments)) { + if (!file_directory_rename($arguments['filename'], $arguments['newname'], working_directory())) { + http_error_exit('HTTP_CLIENT_FORBIDDEN'); + } + return true; + } + if (array_key_exists('copy', $arguments)) { + if (!$newentry = file_copy($arguments['filename'], working_directory())) { + http_error_exit('HTTP_CLIENT_FORBIDDEN'); + } + echo json_encode($newentry); + return true; + } + if (array_key_exists('delete', $arguments)) { + if (!file_delete($arguments['filename'], working_directory())) { + http_error_exit('HTTP_CLIENT_FORBIDDEN'); + } + return true; + } + } + if (array_key_exists('directory', $arguments)) { + if (array_key_exists('listing', $arguments)) { + echo json_encode(directory_listing()); + return true; + } + if (array_key_exists('create', $arguments)) { + if (!directory_create($arguments['dirname'], working_directory())) { + http_error_exit('HTTP_CLIENT_FORBIDDEN'); + } + return true; + } + if (array_key_exists('delete', $arguments)) { + if (!directory_delete($arguments['dirname'], working_directory())) { + http_error_exit('HTTP_CLIENT_FORBIDDEN'); + } + return true; + } + if (array_key_exists('rename', $arguments)) { + if (!file_directory_rename($arguments['dirname'], $arguments['newname'], working_directory())) { + http_error_exit('HTTP_CLIENT_FORBIDDEN'); + } + return true; + } + } + if (array_key_exists('image', $arguments)) { + } + if (array_key_exists('upload', $arguments)) { + store_uploaded_file($arguments['filename'], $arguments['filedata'], working_directory()); + return true; + } + + return false; +} + +/** + * Validation of the HTTP Method. For operations that make changes we require + * POST. To err on the side of safety, we'll only allow GET for known safe + * operations. This way, if the API is extended, and the method is not + * updated, we will not accidentally expose non-idempotent methods to GET. + * This method can only correctly validate the operation if the input is + * already known to be valid. + * + * @param array $arguments The arguments array received by the page. + * @return boolean Whether or not the HTTP method is correct for the given input. + */ +function method_valid($arguments) { + // We assume that the only + $method = $_SERVER['REQUEST_METHOD']; + + if ($method == 'GET') { + if (array_key_exists('directory', $arguments) && array_key_exists('listing', $arguments)) { + return true; + } + + return false; + } + + if ($method == 'POST') { + return true; + } + return false; +} + +/** + * Validation of the user input. We'll verify what we receive from the user, + * and send an error in the case of malformed input. + * + * Some examples of the URLS associated with this API: + * ** File Operations ** + * ?file&delete&filename='' + * ?file©&filename='' + * ?file&rename&filename=''&newname='' + * + * ** Directory Operations ** + * ?directory&listing + * ?directory&create&dirname='' + * ?directory&delete&dirname='' + * ?directory&rename&dirname=''&newname='' + * + * ** Image Operations ** + * ?image&filename=''&[scale|rotate|convert] + * + * ** Upload ** + * ?upload&filedata=[binary|text]&filename=''&replace=[true|false] + * + * @param array $arguments The arguments array received by the page. + * @param array $capabilities The capabilities config array used to limit operations. + * @return boolean Whether or not the input received is valid. + */ +function input_valid($arguments, $capabilities) { + // This is going to be really ugly code because it's basically a DFA for + // parsing arguments. To make things a little clearer, I'll put a + // pseudo-BNF for each block to show the decision structure. + // + // file[empty] filename[valid] (delete[empty] | copy[empty] | (rename[empty] newname[valid])) + if ($capabilities['file_operations'] && + array_key_exists('file', $arguments) && + empty($arguments['file']) && + array_key_exists('filename', $arguments) && + !ereg(INVALID_FILE_NAME, $arguments['filename'])) { + + if (array_key_exists('delete', $arguments) && + empty($arguments['delete']) && + 3 == count($arguments)) { + + return true; + } + + if (array_key_exists('copy', $arguments) && + empty($arguments['copy']) && + 3 == count($arguments)) { + + return true; + } + + if (array_key_exists('rename', $arguments) && + empty($arguments['rename']) && + 4 == count($arguments)) { + + if (array_key_exists('newname', $arguments) && + !ereg(INVALID_FILE_NAME, $arguments['newname'])) { + + return true; + } + } + + return false; + } elseif (array_key_exists('file', $arguments)) { + // This isn't necessary because we'll fall through to false, but I'd + // rather return earlier than later. + return false; + } + + // directory[empty] (listing[empty] | (dirname[valid] (create[empty] | delete[empty] | (rename[empty] newname[valid])))) + if ($capabilities['directory_operations'] && + array_key_exists('directory', $arguments) && + empty($arguments['directory'])) { + + if (array_key_exists('listing', $arguments) && + empty($arguments['listing']) && + 2 == count($arguments)) { + + return true; + } + + if (array_key_exists('dirname', $arguments) && + !ereg(INVALID_FILE_NAME, $arguments['dirname'])) { + + if (array_key_exists('create', $arguments) && + empty($arguments['create']) && + 3 == count($arguments)) { + + return true; + } + + if (array_key_exists('delete', $arguments) && + empty($arguments['delete']) && + 3 == count($arguments)) { + + return true; + } + + if (array_key_exists('rename', $arguments) && + empty($arguments['rename']) && + 4 == count($arguments)) { + + if (array_key_exists('newname', $arguments) && + !ereg(INVALID_FILE_NAME, $arguments['newname'])) { + + return true; + } + } + } + + return false; + } elseif (array_key_exists('directory', $arguments)) { + // This isn't necessary because we'll fall through to false, but I'd + // rather return earlier than later. + return false; + } + + // image[empty] filename[valid] ((scale[empty] dimensions[valid]) | (rotate[empty] angle[valid]) | (convert[empty] imagetype[valid])) + if ($capabilities['image_operations'] && + array_key_exists('image', $arguments) && + empty($arguments['image']) && + array_key_exists('filename', $arguments) && + !ereg(INVALID_FILE_NAME, $arguments['filename']) && + 4 == count($arguments)) { + + if (array_key_exists('scale', $arguments) && + empty($arguments['scale']) && + !ereg(INVALID_FILE_NAME, $arguments['dimensions'])) { + // TODO: FIX REGEX + http_error_exit(); + + return true; + } + + if (array_key_exists('rotate', $arguments) && + empty($arguments['rotate']) && + !ereg(INVALID_FILE_NAME, $arguments['angle'])) { + // TODO: FIX REGEX + http_error_exit(); + + return true; + } + + if (array_key_exists('convert', $arguments) && + empty($arguments['convert']) && + !ereg(INVALID_FILE_NAME, $arguments['imagetype'])) { + // TODO: FIX REGEX + http_error_exit(); + + return true; + } + + return false; + } elseif (array_key_exists('image', $arguments)) { + // This isn't necessary because we'll fall through to false, but I'd + // rather return earlier than later. + return false; + } + + // upload[empty] filedata[binary|text] replace[true|false] filename[valid]? + if ($capabilities['upload_operations'] && + array_key_exists('upload', $arguments) && + empty($arguments['upload']) && + array_key_exists('filedata', $arguments) && + !empty($arguments['filedata']) && + array_key_exists('replace', $arguments) && + ereg('true|false', $arguments['replace'])) { + + if (4 == count($arguments) && + array_key_exists('filename', $arguments) && + !ereg(INVALID_FILE_NAME, $arguments['filename'])) { + + return true; + } + + if (3 == count($arguments)) { + + return true; + } + + return false; + } elseif (array_key_exists('upload', $arguments)) { + // This isn't necessary because we'll fall through to false, but I'd + // rather return earlier than later. + return false; + } + + + return false; +} + +/** + * HTTP level error handling. + * @param integer $code The HTTP error code to return to the client. This defaults to 400. + * @param string $message Error message to send to the client. This defaults to the standard HTTP error messages. + */ +function http_error_exit($error = 'HTTP_CLIENT_BAD_REQUEST', $message='') { + global $HTTP_ERRORS; + $message = !empty($message) ? $message : "HTTP/1.0 {$HTTP_ERRORS[$error]['code']} {$HTTP_ERRORS[$error]['message']}"; + header($message); + exit($message); +} + +/** + * Process the config and return the absolute directory we should be working with, + * @return string contains the path of the directory all file operations are limited to. + */ +function working_directory() { + $config = get_config(true); + return realpath(getcwd() . DIRECTORY_SEPARATOR . $config['storage_dir'] . DIRECTORY_SEPARATOR); +} + +/** + * Check to see if the supplied filename is inside + */ +function directory_contains($container_directory, $checkfile) { + + // Get the canonical directory and canonical filename. We add a directory + // seperator to prevent the user from sidestepping into a sibling directory + // that starts with the same prefix. (e.g. from /home/john to + // /home/johnson) + $container_directory = realpath($container_directory) + DIRECTORY_SEPARATOR; + $checkfile = realpath($checkfile); + + // Now that we have the canonical versions, we can do a string comparison + // to see if checkfile is inside of container_directory. + if (strlen($checkfile) <= strlen($container_directory)) { + // We don't consider the directory to be inside of itself. This + // prevents users from trying to perform operations on the container + // directory itself. + return false; + } + + // PHP equivalent of string.startswith() + return substr($checkfile, 0, strlen($container_directory)) == $container_directory; +} + +/**#@+ + * Directory Operations + * {@internal ***************************************************************** + * **************************************************************************}} + */ + +/** + * Return a directory listing as a PHP array. + * @param string $directory The directory to return a listing of. + * @param integer $depth The private argument used to limit recursion depth. + * @return array representing the directory structure. + */ + +function directory_listing($directory='', $depth=1) { + // We return an empty array if the directory is empty + $result = array('$type'=>'folder'); + + // We won't recurse below MAX_DEPTH. + if ($depth > MAX_DEPTH) { + return $result; + } + + $path = empty($directory) ? working_directory() : $directory; + + // We'll open the directory to check each of the entries + if ($dir = opendir($path)) { + + // We'll keep track of how many file we process. + $count = 0; + + // For each entry in the file + while (($file = readdir($dir)) !== false) { + + // Limit the number of files we process in this folder + $count += 1; + if ($count > MAX_FILES_PER_FOLDER) { + return $result; + } + + // Ignore hidden files (this includes special files '.' and '..') + if (strlen($file) && ($file[0] == '.')) { + continue; + } + + $filepath = $path . DIRECTORY_SEPARATOR . $file; + + if (filetype($filepath) == 'dir') { + // We'll recurse and add those results + $result[$file] = directory_listing($filepath, $depth + 1); + } else { + // We'll check to see if we can read any image information from + // the file. If so, we know it's an image, and we can return + // it's metadata. + $imageinfo = @getimagesize($filepath); + if ($imageinfo) { + + $result[$file] = array('$type'=>'image','metadata'=>array( + 'width'=>$imageinfo[0], + 'height'=>$imageinfo[1], + 'mimetype'=>$imageinfo['mime'] + )); + + } elseif ($extension = strrpos($file, '.')) { + $extension = substr($file, $extension); + if (($extension == '.htm') || ($extension == '.html')) { + $result[$file] = array('$type'=>'html'); + } else { + $result[$file] = array('$type'=>'text'); + } + } else { + $result[$file] = array('$type'=>'document'); + } + } + } + + closedir($dir); + } + return $result; +} + +/** + * Create a directory, limiting operations to the chroot directory. + * @param string $dirname The path to the directory, relative to $chroot. + * @param string $chroot Only directories inside this directory or its subdirectories can be affected. + * @return boolean Returns TRUE if successful, and FALSE otherwise. + */ +function directory_create($dirname, $chroot) { + // If chroot is empty, then we will not perform the operation. + if (empty($chroot)) { + return false; + } + + // We have to take the dirname of the parent directory first, since + // realpath just returns false if the directory doesn't already exist on + // the filesystem. + $createparent = realpath(dirname($chroot . DIRECTORY_SEPARATOR . $dirname)); + $createsub = basename($chroot . DIRECTORY_SEPARATOR . $dirname); + + // The bailout rules for directories that don't exist are complicated + // because of having to work around realpath. If the parent directory is + // the same as the chroot, it won't be contained. For this case, we'll + // check to see if the chroot and the parent are the same and allow it only + // if the sub portion of dirname is not-empty. + if (!directory_contains($chroot, $createparent) && + !(($chroot == $createparent) && !empty($createsub))) { + return false; + } + + return @mkdir($createparent . DIRECTORY_SEPARATOR . $createsub); +} + +/** + * Delete a directory, limiting operations to the chroot directory. + * @param string $dirname The path to the directory, relative to $chroot. + * @param string $chroot Only directories inside this directory or its subdirectories can be affected. + * @return boolean Returns TRUE if successful, and FALSE otherwise. + */ +function directory_delete($dirname, $chroot) { + // If chroot is empty, then we will not perform the operation. + if (empty($chroot)) { + return false; + } + + // $dirname is relative to $chroot. + $dirname = realpath($chroot . DIRECTORY_SEPARATOR . $dirname); + + // Limit directory operations to the supplied directory. + if (!directory_contains($chroot, $dirname)) { + return false; + } + + return @rmdir($dirname); +} + + +/**#@-*/ +/**#@+ + * File Operations + * {@internal ***************************************************************** + * **************************************************************************}} + */ + +/** + * Rename a file or directory, limiting operations to the chroot directory. + * @param string $filename The path to the file or directory, relative to $chroot. + * @param string $renameto The path to the renamed file or directory, relative to $chroot. + * @param string $chroot Only files and directories inside this directory or its subdirectories can be affected. + * @return boolean Returns TRUE if successful, and FALSE otherwise. + */ +function file_directory_rename($filename, $renameto, $chroot) { + // If chroot is empty, then we will not perform the operation. + if (empty($chroot)) { + return false; + } + + // $filename is relative to $chroot. + $filename = realpath($chroot . DIRECTORY_SEPARATOR . $filename); + + // We have to take the dirname of the renamed file or directory first, + // since realpath just returns false if the file or direcotry doesn't + // already exist on the filesystem. + $renameparent = realpath(dirname($chroot . DIRECTORY_SEPARATOR . $renameto)); + $renamefile = basename($chroot . DIRECTORY_SEPARATOR . $renameto); + + // Limit file operations to the supplied directory. + if (!directory_contains($chroot, $filename)) { + return false; + } + + // The bailout rules for the renamed file or directory are more complicated + // because of having to work around realpath. If the renamed parent + // directory is the same as the chroot, it won't be contained. For this + // case, we'll check to see if they're the same and allow it only if the + // file portion of renameto is not-empty. + if (!directory_contains($chroot, $renameparent) && + !(($chroot == $renameparent) && !empty($renamefile))) { + return false; + } + + return @rename($filename, $renameparent . DIRECTORY_SEPARATOR . $renamefile); +} + + +/** + * Copy a file, limiting operations to the chroot directory. + * @param string $filename The path to the file, relative to $chroot. + * @param string $chroot Only files inside this directory or its subdirectories can be affected. + * @return boolean Returns TRUE if successful, and FALSE otherwise. + */ +function file_copy($filename, $chroot) { + // If chroot is empty, then we will not perform the operation. + if (empty($chroot)) { + return false; + } + + // $filename is relative to $chroot. + $filename = realpath($chroot . DIRECTORY_SEPARATOR . $filename); + + // Limit file operations to the supplied directory. + if (!directory_contains($chroot, $filename)) { + return false; + } + + // The PHP copy function blindly copies over existing files. We don't wish + // this to happen, so we have to perform the copy a bit differently. If we + // do a check to make sure the file exists, there's always the chance of a + // race condition where someone else creates the file in between the check + // and the copy. The only safe way to ensure we don't overwrite an + // existing file is to call fopen in create-only mode (mode 'x'). If it + // succeeds, the file did not exist before, and we've successfully created + // it, meaning we own the file. After that, we can safely copy over our + // own file. + for ($count=1; $countarray('$type'=>'image')); + } + } + + return false; +} + +/** + * Delete a file, limiting operations to the chroot directory. + * @param string $filename The path to the file, relative to $chroot. + * @param string $chroot Only files inside this directory or its subdirectories can be affected. + * @return boolean Returns TRUE if successful, and FALSE otherwise. + */ +function file_delete($filename, $chroot) { + // If chroot is empty, then we will not perform the operation. + if (empty($chroot)) { + return false; + } + + // $filename is relative to $chroot. + $filename = realpath($chroot . DIRECTORY_SEPARATOR . $filename); + + // Limit file operations to the supplied directory. + if (!directory_contains($chroot, $filename)) { + return false; + } + + return @unlink($filename); +} +/**#@-*/ +/**#@+ + * Upload Operations + * {@internal ***************************************************************** + * **************************************************************************}} + */ + +function store_uploaded_file($filename, $filedata, $chroot) { + + // If chroot is empty, then we will not perform the operation. + if (empty($chroot)) { + return false; + } + + // If the filename is empty, it was possibly supplied as part of the + // upload. + $filename = empty($filename) ? $filedata['name'] : $filename; + + // We have to take the dirname of the parent directory first, since + // realpath just returns false if the directory doesn't already exist on + // the filesystem. + $uploadparent = realpath(dirname($chroot . DIRECTORY_SEPARATOR . $filename)); + $uploadfile = basename($chroot . DIRECTORY_SEPARATOR . $filename); + + // The bailout rules for directories that don't exist are complicated + // because of having to work around realpath. If the parent directory is + // the same as the chroot, it won't be contained. For this case, we'll + // check to see if the chroot and the parent are the same and allow it only + // if the sub portion of dirname is not-empty. + if (!directory_contains($chroot, $uploadparent) && + !(($chroot == $uploadparent) && !empty($uploadfile))) { + return false; + } + + $target_path = $uploadparent . DIRECTORY_SEPARATOR . $uploadfile; + + if (is_array($filedata)) { + // We've received the file as an upload, so it's been saved to a temp + // directory. We'll move it to where it belongs. + + if(move_uploaded_file($filedata['tmp_name'], $target_path)) { + return true; + } + } elseif ($file = @fopen($target_path, 'w')) { + // We've received the file as data. We'll create/open the file and + // save the data. + @fwrite($file, $filedata); + @fclose($file); + return true; + } + + return false; +} + +/**#@-*/ + +?> Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/config.inc.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/config.inc.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/config.inc.php 3 Jan 2016 20:52:02 -0000 1.1.2.1 @@ -0,0 +1,194 @@ + + * @version 1.0 + * @package PersistentStorage + */ + +/** + * If this file is being requested over the web, we display a JSON version of + * the publicly viewable config info. + */ +if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { + echo json_encode(get_config()); +} + +/** + * Gets the configuration information used by this package. + * {@source } + * @param boolean $getprivates Return private configuration info merged with the public. + * @returns array The configuration information for this package. + */ +function get_config($getprivates=False) { + + // We set up two different settings array, so that we can have settings + // that won't be shown to the public. + $Private = array(); + $Public = array(); + + /** + * For demo purposes, we can lie to the frontend and pretend to have user + * storage. Since we don't have a password mechanism, this simulation will + * accept any password. + */ + $Private['simulate_user_auth'] = false; + + /** + * The capabilities array contains directives about what major options to + * allow or disallow. + */ + $Public['capabilities'] = array( + // Allow directory operations (e.g. rename, create, delete directories) + 'directory_operations' => true, + // Allow file operations (e.g. copy, rename, delete files) + 'file_operations' => true, + // Allow image operations (e.g. scale, rotate, convert images) + 'image_operations' => true, + // Allow file uploads + 'upload_operations' => true, + // Stored files have a published URL + 'shared_publish' => true, + // By default, if the user is authenticated, we enable user storage. + // Set to false to disable. + 'user_storage' => !empty($_SERVER['PHP_AUTH_USER']) || $Private['simulate_user_auth'] + ); + + /** + * Directory exposed to user operations. Be sure that the web server has + * read and write access to this directory. + */ + $Private['storage_dir'] = 'demo_images'; + + /** + * The URL that the storage directory is exposed as. By default, we try + * and guess based on the URL used to access this page. Also, since we + * allow user upload, this directory should not be executable by the + * server. A sample .htaccess file is included in demo_images. + */ + $Private['storage_url'] = str_replace( array("backend.php","manager.php"), + "", $_SERVER["PHP_SELF"] ) . $Private['storage_dir']; + + /* + Possible values: true, false + + TRUE - If PHP on the web server is in safe mode, set this to true. + SAFE MODE restrictions: directory creation will not be possible, + only the GD library can be used, other libraries require + Safe Mode to be off. + + FALSE - Set to false if PHP on the web server is not in safe mode. + */ + $Private['safe_mode'] = ini_get('safe_mode'); + + /** + * If PHP Safe Mode is on than only the GD image library will function, so + * we force the default + */ + if ($Private['safe_mode']) { + @define('IMAGE_CLASS', 'GD'); + } else { + /* + Possible values: 'GD', 'IM', or 'NetPBM' + + The image manipulation library to use, either GD or ImageMagick or NetPBM. + */ + @define('IMAGE_CLASS', 'GD'); + + /* + After defining which library to use, if it is NetPBM or IM, you need to + specify where the binary for the selected library are. And of course + your server and PHP must be able to execute them (i.e. safe mode is OFF). + GD does not require the following definition. + */ + @define('IMAGE_TRANSFORM_LIB_PATH', '/usr/bin/'); + } + + /* + The prefix for thumbnail files, something like .thumb will do. The + thumbnails files will be named as "prefix_imagefile.ext", that is, + prefix + orginal filename. + */ + $Private['thumbnail_prefix'] = 't_'; + + /** + * The thumbnail array groups all of the configuration related to thumbnail + * operations. + */ + $Private['thumbnails'] = array( + // The prefix to apply to all created thumbnails. + 'prefix' => 't_', + // A subdirectory to keep thumbnails in. If this is empty, thumbnails + // will be stored alongside the files. + 'directory' => '', + // Whether or not to filter thumbnails from the directory listing. + 'filter' => true, + // Filetypes which we restrict thumbnail operations to. + 'filetypes' => array("jpg", "gif", "png", "bmp"), + // What pixel sizes to save the thumbnails as. + 'width' => 84, + 'height' => 84 + ); + + + /** + * Resized prefix + * + * The prefix for resized files, something like .resized will do. The + * resized files will be named _x_ + * resized files are created when one changes the dimensions of an image + * in the image manager selection dialog - the image is scaled when the + * user clicks the ok button. + */ + + $Private['resized_prefix'] = '.resized'; + + // ------------------------------------------------------------------------- + + /** + * Resized Directory + * + * Resized images may also be stored in a directory, except in safe mode. + */ + + $Private['resized_dir'] = ''; + + /* Maximum upload file size + + Possible values: number, "max" + + number - maximum size in Kilobytes. + + "max" - the maximum allowed by the server (the value is retrieved from the server configuration). + */ + $Private['max_filesize_kb_image'] = 200; + + $Private['max_filesize_kb_link'] = 5000; + + /* Maximum upload folder size in Megabytes. Use 0 to disable limit */ + $Private['max_foldersize_mb'] = 0; + + /* + Allowed extensions that can be shown and allowed to upload. + Available icons are for "doc,fla,gif,gz,html,jpg,js,mov,pdf,php,png,ppt,rar,txt,xls,zip" + -Changed by AFRU. + */ + + $Private['allowed_image_extensions'] = array("jpg","gif","png","bmp"); + $Private['allowed_link_extensions'] = array("jpg","gif","js","php","pdf","zip","txt","psd","png","html","swf","xml","xls","doc"); + + + /* + Image Editor temporary filename prefix. + */ + $Private['tmp_prefix'] = '.editor_'; + + + // Config variables are finished, this returns our data to the caller. + if ($getprivates) { + return $Public+$Private; + } + + return $Public; +} +?> Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/demo_images/.htaccess =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/demo_images/.htaccess,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/demo_images/.htaccess 3 Jan 2016 20:52:02 -0000 1.1.2.1 @@ -0,0 +1,2 @@ +php_flag engine off +AddType text/html .html .htm .shtml .php .php3 .phtml .phtm .pl .py .cgi \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/demo_images/bikerpeep.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/demo_images/bikerpeep.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/demo_images/wesnoth078.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/demo_images/wesnoth078.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/demo_images/linux/linux.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PSServer/demo_images/linux/linux.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/PasteText.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/PasteText.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/PasteText.js 3 Jan 2016 20:52:03 -0000 1.1.2.1 @@ -0,0 +1,140 @@ +// Paste Plain Text plugin for Xinha + +// Distributed under the same terms as Xinha itself. +// This notice MUST stay intact for use (see license.txt). + +function PasteText(editor) { + this.editor = editor; + var cfg = editor.config; + var self = this; + + cfg.registerButton({ + id : "pastetext", + tooltip : this._lc("Paste as Plain Text"), + image : editor.imgURL("ed_paste_text.gif", "PasteText"), + textMode : false, + action : function() { self.show(); } + }); + + cfg.addToolbarElement("pastetext", ["paste", "killword"], 1); +} + +PasteText._pluginInfo = { + name : "PasteText", + version : "1.2", + developer : "Michael Harris", + developer_url : "http://www.jonesadvisorygroup.com", + c_owner : "Jones Advisory Group", + sponsor : "Jones International University", + sponsor_url : "http://www.jonesinternational.edu", + license : "htmlArea" +}; + +PasteText.prototype._lc = function(string) { + return Xinha._lc(string, 'PasteText'); +}; + +Xinha.Config.prototype.PasteText = +{ + showParagraphOption : true, + newParagraphDefault :true +} + +PasteText.prototype.onGenerateOnce = function() +{ + var self = PasteText; + if (self.loading) return; + self.loading = true; + Xinha._getback(Xinha.getPluginDir("PasteText") + '/popups/paste_text.html', function(getback) { self.html = getback;}); +}; + +PasteText.prototype._prepareDialog = function() +{ + var self = this; + var editor = this.editor; + + var self = this; + +/// Now we have everything we need, so we can build the dialog. + this.dialog = new Xinha.Dialog(editor, PasteText.html, 'PasteText',{width:350}) + + // Connect the OK and Cancel buttons + this.dialog.getElementById('ok').onclick = function() {self.apply();} + + this.dialog.getElementById('cancel').onclick = function() { self.dialog.hide()}; + + // do some tweaking + if (editor.config.PasteText.showParagraphOption) + { + this.dialog.getElementById("paragraphOption").style.display = ""; + } + if (editor.config.PasteText.newParagraphDefault) + { + this.dialog.getElementById("insertParagraphs").checked = true; + } + + // we can setup a custom function that cares for sizes etc. when the dialog is resized + this.dialog.onresize = function () + { + this.getElementById("inputArea").style.height = + parseInt(this.height,10) // the actual height of the dialog + - this.getElementById('h1').offsetHeight // the title bar + - this.getElementById('buttons').offsetHeight // the buttons + - parseInt(this.rootElem.style.paddingBottom,10) // we have a padding at the bottom, gotta take this into acount + + 'px'; // don't forget this ;) + + this.getElementById("inputArea").style.width =(this.width - 2) + 'px'; // and the width + + } +}; + +PasteText.prototype.show = function() +{ + if (!this.dialog) this._prepareDialog(); + + // here we can pass values to the dialog + // each property pair consists of the "name" of the input we want to populate, and the value to be set + var inputs = + { + inputArea : '' // we want the textarea always to be empty on showing + } + // now calling the show method of the Xinha.Dialog object to set the values and show the actual dialog + this.dialog.show(inputs); + + // Init the sizes (only if we have set up the custom resize function) + this.dialog.onresize(); + + this.dialog.getElementById("inputArea").focus(); +}; + +// and finally ... take some action +PasteText.prototype.apply = function() +{ + // the hide method of the dialog object returns the values of the inputs AND hides the dialog + // could also use this.dialog.getValues() here and hide it at the end + var returnValues = this.dialog.hide(); + + var html = returnValues.inputArea; + var insertParagraphs = returnValues.insertParagraphs; + html = html.replace(//g, ">"); + if ( returnValues.insertParagraphs) + { + html = html.replace(/\t/g,"    "); + html = html.replace(/\n/g,"

    "); + html="

    " + html + "

    "; + if (Xinha.is_ie) + { + this.editor.insertHTML(html); + } + else + { + this.editor.execCommand("inserthtml",false,html); + } + } + else + { + html = html.replace(/\n/g,"
    "); + this.editor.insertHTML(html); + } +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/paste-text.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/paste-text.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/paste-text.js 3 Jan 2016 20:52:03 -0000 1.1.2.1 @@ -0,0 +1,42 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/PasteText/paste-text.js */ +function PasteText(_1){ +this.editor=_1; +var _2=_1.config; +var _3=this; +_2.registerButton({id:"pastetext",tooltip:this._lc("Paste as Plain Text"),image:_1.imgURL("ed_paste_text.gif","PasteText"),textMode:false,action:function(_4){ +_3.buttonPress(_4); +}}); +_2.addToolbarElement("pastetext",["paste","killword"],1); +} +PasteText._pluginInfo={name:"PasteText",version:"1.2",developer:"Michael Harris",developer_url:"http://www.jonesadvisorygroup.com",c_owner:"Jones Advisory Group",sponsor:"Jones International University",sponsor_url:"http://www.jonesinternational.edu",license:"htmlArea"}; +PasteText.prototype._lc=function(_5){ +return Xinha._lc(_5,"PasteText"); +}; +Xinha.Config.prototype.PasteText={showParagraphOption:true,newParagraphDefault:true}; +PasteText.prototype.buttonPress=function(_6){ +var _6=this.editor; +var _7=_6.config.PasteText; +var _8=function(_9){ +var _a=_9.text; +var _b=_9.insertParagraphs; +_a=_a.replace(//g,">"); +if(_9.insertParagraphs){ +_a=_a.replace(/\t/g,"    "); +_a=_a.replace(/\n/g,"

    "); +_a="

    "+_a+"

    "; +if(Xinha.is_ie){ +_6.insertHTML(_a); +}else{ +_6.execCommand("inserthtml",false,_a); +} +}else{ +_a=_a.replace(/\n/g,"
    "); +_6.insertHTML(_a); +} +}; +Dialog(Xinha.getPluginDir("PasteText")+"/popups/paste_text.html",_8,_7); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/img/ed_paste_text.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/img/ed_paste_text.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/de.js 3 Jan 2016 20:52:04 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +{ + "Paste as Plain Text": "unformatierten Text einfügen", + "Insert text in new paragraph" : "Neue Absätze eifügen" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/es.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/es.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/es.js 3 Jan 2016 20:52:04 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants + +// LANG: "es", ENCODING: UTF-8 +{ + "Paste as Plain Text" : "Paste as Plain Text" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/fr.js 3 Jan 2016 20:52:04 -0000 1.1.2.1 @@ -0,0 +1,5 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Paste as Plain Text": "Copier comme texte pur" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/ja.js 3 Jan 2016 20:52:04 -0000 1.1.2.1 @@ -0,0 +1,5 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Paste as Plain Text": "プレーンテキストとして貼り付け" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/nb.js 3 Jan 2016 20:52:04 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Paste as Plain Text": "Lim inn som ren tekst" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/nl.js 3 Jan 2016 20:52:05 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Paste as Plain Text": "Kopieer als platte tekst (geen opmaak)" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/no.js 3 Jan 2016 20:52:05 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Paste as Plain Text": "Lim inn som ren tekst" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/pl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/pl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/pl.js 3 Jan 2016 20:52:05 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "pl", ENCODING: UTF-8 +// translated: Krzysztof Kotowicz, http://www.eskot.krakow.pl/portfolio/, koto@webworkers.pl +{ + "Paste as Plain Text": "Wklej jako czysty tekst" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/pt_br.js 3 Jan 2016 20:52:06 -0000 1.1.2.1 @@ -0,0 +1,21 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt) +{ + "Cancel": "Cancelar", + "OK": "OK", + "Paste Text": "Colar Texto", + "Paste as Plain Text": "Colar um texto básico" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/ru.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/ru.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/lang/ru.js 3 Jan 2016 20:52:06 -0000 1.1.2.1 @@ -0,0 +1,5 @@ +// I18N constants +// LANG: "ru", ENCODING: UTF-8 +{ + "Paste as Plain Text": "Вставить как обычный текст" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/popups/paste_text.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/popups/paste_text.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PasteText/popups/paste_text.html 3 Jan 2016 20:52:06 -0000 1.1.2.1 @@ -0,0 +1,9 @@ +

    Paste as Plain Text

    + +
    + + + +
    Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PersistentStorage/PersistentStorage.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PersistentStorage/PersistentStorage.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PersistentStorage/PersistentStorage.js 3 Jan 2016 20:52:06 -0000 1.1.2.1 @@ -0,0 +1,1135 @@ +/** + * @fileOverview PersistentStorage PersistentStorage.js file. + * This plugin is a rethinking of the ExtendFileManager plugin written and + * designed by Wei Zhuo, Afru, Krzysztof Kotowicz, Raimund Meyer. + * + * @author Douglas Mayle + * @version 1.0 + */ + +/** + * The global namespace + * @name window + */ +(function($) { +/** + * @name PersistentStorage + * @class Provides an interface for persistant storage options to the user. + * @param editor A reference to the Xinha Editor this plugin instance is attached to. + */ +var PersistentStorage = window.PersistentStorage = function (editor) { + /** + * @memberOf Xinha + */ + this.editor = editor; + var self = this; +} + +/** + * Plugin Metadata + * @namespace + * @static + */ +PersistentStorage._pluginInfo = { + /** Plugin name */ + name : "PersistentStorage", + /** Plugin version */ + version : "1.0", + /** Plugin author */ + developer : "Douglas Mayle", + /** Plugin author's website */ + developer_url : "http://douglas.mayle.org", + /** Plugin license */ + license : "BSD" +}; + +/** + * The list of backend modules registered with this instance. + */ +PersistentStorage.prototype._backends = {}; + +/** + * The list of user config files received from backends. + */ +PersistentStorage.prototype._userconfigs = []; + +/** + * The name of the currently active backend. + */ +PersistentStorage.prototype._activeBackend = ''; + +/** + * The value of the type filter that's currently in effect. + */ +PersistentStorage.prototype._typeFilter = ''; + +/** + * The currently displayed view type. + */ +PersistentStorage.prototype._viewType = 'thumbnail'; + +/** + * On Xinha activation, this get's called so that we can prepare any resources + * we need to function. + */ +PersistentStorage.prototype.onGenerateOnce = function () { + // We use _prepareDialog to asynchronously load the dialog markup and then + // perform necessary processing. + this._prepareDialog(); +}; + +function addClass(element, className) { + var classRegex = new RegExp(' ?' + className + ' ?'); + + if (!classRegex.test(element.className)) { + element.className += ' ' + className; + } +} + +function removeClass(element, className) { + var classRegex = new RegExp(' ?' + className + ' ?'); + + if (classRegex.test(element.className)) { + element.className = element.className.replace(classRegex, ' '); + } +} + +function toggleClass(element, className) { + var classRegex = new RegExp(' ?' + className + ' ?'); + + if (classRegex.test(element.className)) { + element.className = element.className.replace(classRegex, ' '); + } else { + element.className += ' ' + className; + } +} + +/** + * Once we're sure we have a backend that supports document functionality, + * we'll load the interface that exposes it. + */ +PersistentStorage.prototype._registerDocumentUI = function () { + if (this._documentEnabled) { + // No need to repeated rebuild the UI. + return; + } + + this._documentEnabled = true; + var self = this; + + var editor = this.editor; + + editor.config.registerButton({ + id : 'newdocument', + tooltip : Xinha._lc( 'New Document', 'PersistentStorage' ), + image : [_editor_url + editor.config.imgURL + 'ed_buttons_main.png',0,5], + textMode : true, + action : function() { self.newDocument(); } + } + ); + editor.config.registerButton({ + id : 'opendocument', + tooltip : Xinha._lc( 'Open Document', 'PersistentStorage' ), + image : [_editor_url + editor.config.imgURL + 'ed_buttons_main.png',1,5], + textMode : true, + action : function() { self.openDialog(); } + } + ); + editor.config.registerButton({ + id : 'savedocument', + tooltip : Xinha._lc( 'Save Document', 'PersistentStorage' ), + image : [_editor_url + editor.config.imgURL + 'ed_buttons_main.png',9,1], + textMode : true, + action : function() { self.saveDialog(); } + } + ); + editor.config.addToolbarElement('newdocument', 'fullscreen', 1); + editor.config.addToolbarElement('opendocument', 'newdocument', 1); + editor.config.addToolbarElement('savedocument', 'opendocument', 1); + + // Since this is after the editor load, we have to trigger an udate manually... + editor._rebuildToolbar(); +}; + +/** + * Backend storage plugins should call this method so that they can be exposed + * to the user. Because of possible quirks in plugin loading, you should use + * the following example code when registering. + * @param name The name of the module + * @param module The module instance + * @param config Configuration information that tells us about the module + * @param user_config AN object representing the user configuration loaded from + * this module. + * @example + + * PSBackend.prototype.onGenerateOnce = function () { + * // Register with the Persistent Storage plugin. + * this._registerBackend(); + * }; + * PSBackend.prototype._registerBackend = function(timeWaited) { + * var editor = this.editor; + * var self = this; + * + * if (!timeWaited) { + * timeWaited = 0; + * } + * + * // Retry over a period of ten seconds to register. We back off exponentially + * // to limit resouce usage in the case of misconfiguration. + * var registerTimeout = 10000; + * + * if (timeWaited > registerTimeout) { + * // This is most likely a configuration error. We're loaded and + * // PersistentStorage is not. + * return; + * } + * + * if (!editor.plugins['PersistentStorage'] || + * !editor.plugins['PersistentStorage'].instance || + * !editor.plugins['PersistentStorage'].instance.ready) { + * + * window.setTimeout(function() { + * self._registerBackend(timeWaited ? timeWaited*2 : 50); + * }, timeWaited ? timeWaited : 50); + * + * return; + * } + * var PS = editor.plugins['PersistentStorage'].instance; + * + * // Support user configuration. This loading should be moved into PersistentStorage... + * this.loadDocument({URL:'', name:'config.js', key:'/config.js'}, function(json) { + * var userconfig = json ? eval('(' + json + ')') : false; + * PS.registerBackend('PSLocal', self, self.config, userconfig); + * }); + */ +PersistentStorage.prototype.registerBackend = function (name, module, config, user_config) { + this._backends[name] = {module: module, config: config, name: name}; + + // TODO I'd like something more than just whoever calls back first wins for ordering. + if (!this._activeBackend) { + this.setBackend(name); + } + + if (config.capabilities.upload_operations && + config.capabilities.file_operations) { + this._registerDocumentUI(); + } + + // Handle user configuration + if (user_config) { + this._userconfigs.push(user_config); + this.configureUser(); + } + + this.updatePlacesDisplay(); +} + +/** + * Go through the list of user configs and reconfigure Xinha. + */ +PersistentStorage.prototype.configureUser = function () { + // Temp code does not handle user affinity + var self = this; + for (var index=0; index # # *(Delete) * *(Delete) * *(Delete) * *(Delete) * # * + * * # \/ # # *********** *********** *********** *********** # * + * * # Gears # # # * + * * # # ############################################################## * + * * # # * + * * # # *Import-(Collapsed)******************************************* * + * * # # * + * * # # #File Name -or- File Details################################## * + * * # # # # * + * * # # # # * + * * # # # # * + * * # # # # * + * * ######### ############################################################## * + * * * + * **************************************************************************** + */ + +PersistentStorage.prototype.showDialog = function (options) { + // Create a reference to this PS instance to allow for asynchronous + // continuation (if we're not ready.) + var self = this; + + if (!this.ready) { + window.setTimeout(function() {self.showDialog(options);}, 80); + return; + } + + // We hide and show the various elements of the dialog depending on usage. + removeClass(this.dialog.getElementById("WWW"), 'hidden'); + addClass(this.dialog.getElementById("namefield"), 'hidden'); + addClass(this.dialog.getElementById("placeWww"), 'hidden'); + addClass(this.dialog.getElementById("placeBackend"), 'hidden'); + + switch (options.styleFor) { + case 'link': + removeClass(this.dialog.getElementById("placeWww"), 'hidden'); + this.updatePlacesDisplay('shared_publish'); + break; + case 'insertion': + removeClass(this.dialog.getElementById("placeBackend"), 'hidden'); + this.updatePlacesDisplay('shared_publish'); + break; + case 'documentsave': + addClass(this.dialog.getElementById("WWW"), 'hidden'); + removeClass(this.dialog.getElementById("namefield"), 'hidden'); + removeClass(this.dialog.getElementById("placeBackend"), 'hidden'); + this.updatePlacesDisplay('file_operations'); + break; + case 'documentload': + addClass(this.dialog.getElementById("WWW"), 'hidden'); + removeClass(this.dialog.getElementById("placeBackend"), 'hidden'); + this.updatePlacesDisplay('file_operations'); + break; + } + + var directories = this.dialog.getElementById("filters"); + var fileBrowser = this.dialog.getElementById("fileList"); + + // Store the type filter so that view updates will correctly filter the contents. + this._typeFilter = options.typeFilter; + + var module = this._backends[this._activeBackend].module; + + this.updateFileBrowser(); +} + +/** + * Take the list of filters and build the contents of the select element. + * @param filters {Filter[]} An array of filter choices to display to the user. + * @param filters[n].value The unique key that represents this filter to the backend. + * @param filters[n].display {String} A text string to display to the user to + * represent the given filter. + * @param select {HTMLElement} The select node to update. + */ +PersistentStorage.prototype.displayFilters = function(filters, viewFilter) { + // Clear out the previous directory listing. + var select = this.dialog.getElementById("filters"); + while (select.lastChild) { + select.removeChild(select.lastChild); + } + + // For each element in the array, we extract out the display text and the + // value and put them into an option element to add to the select element. + for (var index=0; index
    Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PreserveScripts/PreserveScripts.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PreserveScripts/PreserveScripts.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PreserveScripts/PreserveScripts.js 3 Jan 2016 20:52:07 -0000 1.1.2.1 @@ -0,0 +1,68 @@ +/*------------------------------------------*\ +PreserveScripts for Xinha +____________________ +Replace blocks of of PHP or JavaScript with icons in the editor, this way making it possible to edit sourcecode containing PHP, +and preventing Javascript from being accidentally deleted because it's normally invisible + +\*------------------------------------------*/ + +function PreserveScripts(editor) { + this.editor = editor; +} + +PreserveScripts._pluginInfo = { + name : "PreserveScripts", + version : "1.0", + developer : "Raimund Meyer", + developer_url : "http://x-webservice.net", + c_owner : "Raimund Meyer", + sponsor : "", + sponsor_url : "", + license : "LGPL" +} +Xinha.Config.prototype.PreserveScripts = +{ + 'preservePHP' : true, + 'preserveJS' : true +} +PreserveScripts.prototype.inwardHtml = function(html) +{ + var s = this; + var c = s.editor.config.PreserveScripts; + this.storage = {}; //empty the cache + var i = 1; + html = html.replace(/\n?<\?(php)?(\s|[^\s])*?\?>\n?/ig, + function(m) + { + if ( c.preservePHP ) // if config set to false wipe out php completely, otherwise ugly fragments may remain + { + s.storage['PreserveScripts_'+i] = m; + var r = ''; + i++; + return r; + } + else + { + return ''; + } + }); + if ( c.preserveJS ) + { + html = html.replace(/\n?\n?/g, + function(m) + { + s.storage['PreserveScripts_'+i] = m; + var r = ''; + i++; + return r; + }); + } + return html; +} + +PreserveScripts.prototype.outwardHtml = function(html) +{ + var s = this; + html = html.replace(/]*id="(PreserveScripts_\d+)"[^>]*>/g,function(m0,m1){return s.storage[m1];}); + return html; +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PreserveScripts/js.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PreserveScripts/js.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PreserveScripts/php.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PreserveScripts/php.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PreserveScripts/php.svg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PreserveScripts/php.svg,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PreserveScripts/php.svg 3 Jan 2016 20:52:08 -0000 1.1.2.1 @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + PHP + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PreserveScripts/preserve-scripts.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PreserveScripts/preserve-scripts.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/PreserveScripts/preserve-scripts.js 3 Jan 2016 20:52:08 -0000 1.1.2.1 @@ -0,0 +1,41 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/PreserveScripts/preserve-scripts.js */ +function PreserveScripts(_1){ +this.editor=_1; +} +PreserveScripts._pluginInfo={name:"PreserveScripts",version:"1.0",developer:"Raimund Meyer",developer_url:"http://x-webservice.net",c_owner:"Raimund Meyer",sponsor:"",sponsor_url:"",license:"LGPL"}; +Xinha.Config.prototype.PreserveScripts={"preservePHP":true,"preserveJS":true}; +PreserveScripts.prototype.inwardHtml=function(_2){ +var s=this; +var c=s.editor.config.PreserveScripts; +this.storage={}; +var i=1; +_2=_2.replace(/\n?<\?php(\s|[^\s])*?\?>\n?/ig,function(m){ +if(c.preservePHP){ +s.storage["PreserveScripts_"+i]=m; +var r=""; +i++; +return r; +}else{ +return ""; +} +}); +if(c.preserveJS){ +_2=_2.replace(/\n?\n?/g,function(m){ +s.storage["PreserveScripts_"+i]=m; +var r=""; +i++; +return r; +}); +} +return _2; +}; +PreserveScripts.prototype.outwardHtml=function(_a){ +var s=this; +_a=_a.replace(/]*id="(PreserveScripts_\d+)"[^>]*>/g,function(m0,m1){ +return s.storage[m1]; +}); +return _a; +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/QuickTag.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/QuickTag.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/QuickTag.js 3 Jan 2016 20:52:08 -0000 1.1.2.1 @@ -0,0 +1,53 @@ +/*---------------------------------------*\ + Quick Tag Editor Plugin for HTMLArea-3.0 + ----------------------------------------- + author: Cau guanabara + e-mail: caugb@ibest.com.br +\*---------------------------------------*/ + +function QuickTag(editor) { + var cfg = editor.config; + var self = this; + + cfg.registerButton({ + id : "quickeditor", + tooltip : this._lc("Quick Tag Editor"), + image : editor.imgURL("ed_quicktag.gif", "QuickTag"), + textMode : false, + action : function(editor) { + self.buttonPress(editor); + } + }); + cfg.addToolbarElement("quickeditor", "htmlmode", 1); +} + +QuickTag.prototype.buttonPress = function(editor) { +var self = this; +var sel = editor.getSelectedHTML().replace(/(<[^>]*>| |\n|\r)/g,""); +var param = new Object(); +param.editor = editor; + + if(/\w/.test(sel)) + editor._popupDialog("plugin://QuickTag/quicktag", function(p) { self.setTag(editor, p); }, param); + else + alert(this._lc('You have to select some text')); +}; + +QuickTag.prototype.setTag = function(editor, param) { +editor.surroundHTML(param.tagopen,param.tagclose); +}; + +QuickTag._pluginInfo = { +name : "QuickTag", +version : "1.0 - beta", +developer : "Cau Guanabara", +developer_url : "mailto:caugb@ibest.com.br", +c_owner : "Cau Guanabara", +sponsor : "Independent production", +sponsor_url : "http://www.netflash.com.br/gb/HA3-rc1/examples/quick-tag.html", +license : "htmlArea" +}; + +QuickTag.prototype._lc = function(string) { + return Xinha._lc(string, 'QuickTag'); +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/quick-tag.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/quick-tag.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/quick-tag.js 3 Jan 2016 20:52:08 -0000 1.1.2.1 @@ -0,0 +1,32 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/QuickTag/quick-tag.js */ +function QuickTag(_1){ +var _2=_1.config; +var _3=this; +_2.registerButton({id:"quickeditor",tooltip:this._lc("Quick Tag Editor"),image:_1.imgURL("ed_quicktag.gif","QuickTag"),textMode:false,action:function(_4){ +_3.buttonPress(_4); +}}); +_2.addToolbarElement("quickeditor","htmlmode",1); +} +QuickTag.prototype.buttonPress=function(_5){ +var _6=this; +var _7=_5.getSelectedHTML().replace(/(<[^>]*>| |\n|\r)/g,""); +var _8=new Object(); +_8.editor=_5; +if(/\w/.test(_7)){ +_5._popupDialog("plugin://QuickTag/quicktag",function(p){ +_6.setTag(_5,p); +},_8); +}else{ +alert(this._lc("You have to select some text")); +} +}; +QuickTag.prototype.setTag=function(_a,_b){ +_a.surroundHTML(_b.tagopen,_b.tagclose); +}; +QuickTag._pluginInfo={name:"QuickTag",version:"1.0 - beta",developer:"Cau Guanabara",developer_url:"mailto:caugb@ibest.com.br",c_owner:"Cau Guanabara",sponsor:"Independent production",sponsor_url:"http://www.netflash.com.br/gb/HA3-rc1/examples/quick-tag.html",license:"htmlArea"}; +QuickTag.prototype._lc=function(_c){ +return Xinha._lc(_c,"QuickTag"); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/tag-lib.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/tag-lib.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/tag-lib.js 3 Jan 2016 20:52:08 -0000 1.1.2.1 @@ -0,0 +1,356 @@ +/* + TAG Library for QuickTag Plugin + ------------------------------- + + allTags = All tags that appears in the first dropdown ('TAGS') {'caption': 'value'} + tagLib = The tags with options (just to check if current TAG have options) {'[TAG]': true} + subTagLib = Complements for some tags that needs it (TABLE) + {'[TAG]': {'op': 'after tag open', 'cl': 'before tag close'}} + opTag_all = Common attributes to all TAGS {'caption': 'value'} + opAtt_all = Options for the common attributes {'attribute': {'caption': 'value'}} + opTag_[TAG] = Attributes for [TAG] {'caption': 'value'} + opAtt_[TAG] = Options for the [TAG] attributes {'attribute': {'caption': 'value'}} + +*/ + +var allTags = { +'a': 'a', +'a (full)': 'a href="" target=""', +'address': 'address', +'b': 'b', +'big': 'big', +'blockquote': 'blockquote', +'code': 'code', +'div': 'div', +'em': 'em', +'fieldset': 'fieldset', +'font': 'font', +'font (full)': 'font face="" size="" color=""', +'h1': 'h1', +'h2': 'h2', +'h3': 'h3', +'h4': 'h4', +'h5': 'h5', +'h6': 'h6', +'i': 'i', +'legend': 'legend', +'li': 'li', +'ol': 'ol', +'ul': 'ul', +'p': 'p', +'pre': 'pre', +'small': 'small', +'span': 'span', +'strong': 'strong', +'sub': 'sub', +'sup': 'sup', +'table': 'table' +}; + +// tags with options +var tagLib = { +'a': true, +'div': true, +'font': true, +'h1': true, +'h2': true, +'h3': true, +'h4': true, +'h5': true, +'h6': true, +'p': true, +'table': true +}; +// tags that needs some complement +var subTagLib = {'table': {'op': '', + 'cl': ''} +}; + +var opTag_a = { +'href': 'href="', +'name': 'name="', +'target': 'target="' +}; +var opAtt_a = { +'href': {'http://': 'http://', + 'https://': 'https://', + 'ftp://': 'ftp://', + 'mailto:': 'mailto:', + '#': '#"'}, +'target': {'_top': '_top"', + '_self': '_self"', + '_parent': '_parent"', + '_blank': '_blank"'} +}; + +var opTag_font = { +'face': 'face="', +'size': 'size="', +'color': 'color="' +}; +var opAtt_font = { +'face': {'Verdana': 'Verdana"', + 'Arial': 'Arial"', + 'Tahoma': 'Tahoma"', + 'Courier New': 'Courier New"', + 'Times New Roman': 'Times New Roman"'}, +'size': {'1': '1"','2': '2"','3': '3"','4': '4"','5': '5"','6': '6"', + '+1': '+1"','+2': '+2"','+3': '+3"','+4': '+4"','+5': '+5"','+6': '+6"', + '-1': '-1"','-2': '-2"','-3': '-3"','-4': '-4"','-5': '-5"','-6': '-6"'} +}; + +var opTag_div = { +'align': 'align="' +}; +var opAtt_div = { +'align': {'center': 'center"', + 'left': 'left"', + 'right': 'right"', + 'justify': 'justify"'} +}; + +var opTag_h = { +'align': 'align="' +}; +var opAtt_h = { +'align': {'center': 'center"', + 'left': 'left"', + 'right': 'right"', + 'justify': 'justify"'} +}; + +var opTag_p = { +'align': 'align="' +}; +var opAtt_p = { +'align': {'center': 'center"', + 'left': 'left"', + 'right': 'right"', + 'justify': 'justify"'} +}; + +var opTag_table = { +'align': 'align="', +'width': 'width="', +'height': 'height="', +'cellpadding': 'cellpadding="', +'cellspacing': 'cellspacing="', +'background': 'background="', +'bgcolor': 'bgcolor="', +'border': 'border="', +'bordercolor': 'bordercolor="', +'bordercolorlight': 'bordercolorlight="', +'bordercolordark': 'bordercolordark="' +}; +var opAtt_table = { +'align': {'center': 'center"', + 'left': 'left"', + 'right': 'right"'} +}; + +// for all tags +var opTag_all = { +'class': 'class="', +'dir': 'dir="', +'id': 'id="', +'lang': 'lang="', +'onFocus': 'onFocus="', +'onBlur': 'onBlur="', +'onClick': 'onClick="', +'onDblClick': 'onDblClick="', +'onMouseDown': 'onMouseDown="', +'onMouseUp': 'onMouseUp="', +'onMouseOver': 'onMouseOver="', +'onMouseMove': 'onMouseMove="', +'onMouseOut': 'onMouseOut="', +'onKeyPress': 'onKeyPress="', +'onKeyDown': 'onKeyDown="', +'onKeyUp': 'onKeyUp="', +'style': 'style="', +'title': 'title="' +}; +var opAtt_all = { +'class': {}, +'dir': {'rtl': 'rtl"','ltr': 'ltr"'}, +'lang': {'Afrikaans ': 'af"', + 'Albanian ': 'sq"', + 'Arabic ': 'ar"', + 'Basque ': 'eu"', + 'Breton ': 'br"', + 'Bulgarian ': 'bg"', + 'Belarusian ': 'be"', + 'Catalan ': 'ca"', + 'Chinese ': 'zh"', + 'Croatian ': 'hr"', + 'Czech ': 'cs"', + 'Danish ': 'da"', + 'Dutch ': 'nl"', + 'English ': 'en"', + 'Estonian ': 'et"', + 'Faeroese ': 'fo"', + 'Farsi ': 'fa"', + 'Finnish ': 'fi"', + 'French ': 'fr"', + 'Gaelic ': 'gd"', + 'German ': 'de"', + 'Greek ': 'el"', + 'Hebrew ': 'he"', + 'Hindi ': 'hi"', + 'Hungarian ': 'hu"', + 'Icelandic ': 'is"', + 'Indonesian ': 'id"', + 'Italian ': 'it"', + 'Japanese ': 'ja"', + 'Korean ': 'ko"', + 'Latvian ': 'lv"', + 'Lithuanian ': 'lt"', + 'Macedonian ': 'mk"', + 'Malaysian ': 'ms"', + 'Maltese ': 'mt"', + 'Norwegian ': 'no"', + 'Polish ': 'pl"', + 'Portuguese ': 'pt"', + 'Rhaeto-Romanic ': 'rm"', + 'Romanian ': 'ro"', + 'Russian ': 'ru"', + 'Sami ': 'sz"', + 'Serbian ': 'sr"', + 'Setswana ': 'tn"', + 'Slovak ': 'sk"', + 'Slovenian ': 'sl"', + 'Spanish ': 'es"', + 'Sutu ': 'sx"', + 'Swedish ': 'sv"', + 'Thai ': 'th"', + 'Tsonga ': 'ts"', + 'Turkish ': 'tr"', + 'Ukrainian ': 'uk"', + 'Urdu ': 'ur"', + 'Vietnamese ': 'vi"', + 'Xhosa ': 'xh"', + 'Yiddish ': 'yi"', + 'Zulu': 'zu"'}, +'style': {'azimuth': 'azimuth: ', + 'background': 'background: ', + 'background-attachment': 'background-attachment: ', + 'background-color': 'background-color: ', + 'background-image': 'background-image: ', + 'background-position': 'background-position: ', + 'background-repeat': 'background-repeat: ', + 'border': 'border: ', + 'border-bottom': 'border-bottom: ', + 'border-left': 'border-left: ', + 'border-right': 'border-right: ', + 'border-top': 'border-top: ', + 'border-bottom-color': 'border-bottom-color: ', + 'border-left-color': 'border-left-color: ', + 'border-right-color': 'border-right-color: ', + 'border-top-color': 'border-top-color: ', + 'border-bottom-style': 'border-bottom-style: ', + 'border-left-style': 'border-left-style: ', + 'border-right-style': 'border-right-style: ', + 'border-top-style': 'border-top-style: ', + 'border-bottom-width': 'border-bottom-width: ', + 'border-left-width': 'border-left-width: ', + 'border-right-width': 'border-right-width: ', + 'border-top-width': 'border-top-width: ', + 'border-collapse': 'border-collapse: ', + 'border-color': 'border-color: ', + 'border-style': 'border-style: ', + 'border-width': 'border-width: ', + 'bottom': 'bottom: ', + 'caption-side': 'caption-side: ', + 'cell-spacing': 'cell-spacing: ', + 'clear': 'clear: ', + 'clip': 'clip: ', + 'color': 'color: ', + 'column-span': 'column-span: ', + 'content': 'content: ', + 'cue': 'cue: ', + 'cue-after': 'cue-after: ', + 'cue-before': 'cue-before: ', + 'cursor': 'cursor: ', + 'direction': 'direction: ', + 'display': 'display: ', + 'elevation': 'elevation: ', + 'filter': 'filter: ', + 'float': 'float: ', + 'font-family': 'font-family: ', + 'font-size': 'font-size: ', + 'font-size-adjust': 'font-size-adjust: ', + 'font-style': 'font-style: ', + 'font-variant': 'font-variant: ', + 'font-weight': 'font-weight: ', + 'height': 'height: ', + '!important': '!important: ', + 'left': 'left: ', + 'letter-spacing': 'letter-spacing: ', + 'line-height': 'line-height: ', + 'list-style': 'list-style: ', + 'list-style-image': 'list-style-image: ', + 'list-style-position': 'list-style-position: ', + 'list-style-type': 'list-style-type: ', + 'margin': 'margin: ', + 'margin-bottom': 'margin-bottom: ', + 'margin-left': 'margin-left: ', + 'margin-right': 'margin-right: ', + 'margin-top': 'margin-top: ', + 'marks': 'marks: ', + 'max-height': 'max-height: ', + 'min-height': 'min-height: ', + 'max-width': 'max-width: ', + 'min-width': 'min-width: ', + 'orphans': 'orphans: ', + 'overflow': 'overflow: ', + 'padding': 'padding: ', + 'padding-bottom': 'padding-bottom: ', + 'padding-left': 'padding-left: ', + 'padding-right': 'padding-right: ', + 'padding-top': 'padding-top: ', + 'page-break-after': 'page-break-after: ', + 'page-break-before': 'page-break-before: ', + 'pause': 'pause: ', + 'pause-after': 'pause-after: ', + 'pause-before': 'pause-before: ', + 'pitch': 'pitch: ', + 'pitch-range': 'pitch-range: ', + 'play-during': 'play-during: ', + 'position': 'position: ', + 'richness': 'richness: ', + 'right': 'right: ', + 'row-span': 'row-span: ', + 'size': 'size: ', + 'speak': 'speak: ', + 'speak-date': 'speak-date: ', + 'speak-header': 'speak-header: ', + 'speak-numeral': 'speak-numeral: ', + 'speak-punctuation': 'speak-punctuation: ', + 'speak-time': 'speak-time: ', + 'speech-rate': 'speech-rate: ', + 'stress': 'stress: ', + 'table-layout': 'table-layout: ', + 'text-align': 'text-align: ', + 'text-decoration': 'text-decoration: ', + 'text-indent': 'text-indent: ', + 'text-shadow': 'text-shadow: ', + 'text-transform': 'text-transform: ', + 'top': 'top: ', + 'vertical-align': 'vertical-align: ', + 'visibility': 'visibility: ', + 'voice-family': 'voice-family: ', + 'volume': 'volume: ', + 'white-space': 'white-space: ', + 'widows': 'widows: ', + 'width': 'width: ', + 'word-spacing': 'word-spacing: ', + 'z-index': 'z-index: ' } +}; + +// add the common items to all objects +for(var i in tagLib) { +i = i.replace(/^h[1-6]$/,"h"); // h1 .. h6 + for(var j in opTag_all) + eval('opTag_'+i+'["'+j+'"] = opTag_all["'+j+'"];'); + for(var j in opAtt_all) + eval('opAtt_'+i+'["'+j+'"] = opAtt_all["'+j+'"];'); +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/img/ed_quicktag.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/img/ed_quicktag.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/de.js 3 Jan 2016 20:52:09 -0000 1.1.2.1 @@ -0,0 +1,16 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +{ + "Quick Tag Editor": "Quick TAG Editor", + "Enter the TAG you want to insert": "Enter the TAG you want to insert", + "You have to select some text": "You have to select some text", + "There are some unclosed quote": "There are some unclosed quote", + "This attribute already exists in the TAG": "This attribute already exists in the TAG", + "No CSS class avaiable": "No CSS classes avaiable", + "OPTIONS": "OPTIONS", + "ATTRIBUTES": "ATTRIBUTES", + "TAGs": "TAGs", + "Colors": "Colors", + "Ok": "Ok", + "Cancel": "Cancel" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/fr.js 3 Jan 2016 20:52:09 -0000 1.1.2.1 @@ -0,0 +1,16 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Quick Tag Editor": "Editeur rapide de balise", + "Enter the TAG you want to insert": "Entrez la balise que vous voulez insérer", + "You have to select some text": "Vous devez sélectionner du texte", + "There are some unclosed quote": "Il y a des apostrophes mal fermées", + "This attribute already exists in the TAG": "Cet attribute existe déjà sur cette balise", + "No CSS class avaiable": "Pas de classe CSS accessible", + "OPTIONS": "OPTIONS", + "ATTRIBUTES": "ATTRIBUTS", + "TAGs": "Balises", + "Colors": "Couleurs", + "Ok": "OK", + "Cancel": "Annuler" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/ja.js 3 Jan 2016 20:52:09 -0000 1.1.2.1 @@ -0,0 +1,16 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Quick Tag Editor": "クイックタグエディタ", + "Enter the TAG you want to insert": "挿入したいタグを入力", + "You have to select some text": "テキストを選択しなければなりません", + "There are some unclosed quote": "閉じていない引用符があります", + "This attribute already exists in the TAG": "タグにはすでに同じ属性があります", + "No CSS class avaiable": "CSSクラスがありません", + "OPTIONS": "選択肢", + "ATTRIBUTES": "属性", + "TAGs": "タグ", + "Colors": "色", + "Ok": "OK", + "Cancel": "中止" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/nb.js 3 Jan 2016 20:52:10 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Quick Tag Editor": "Kjapp TAGG-Editor", + "Enter the TAG you want to insert": "Skriv inn taggen du vil ønsker å sette inn", + "You have to select some text": "Du må velge noe tekst", + "There are some unclosed quote": "Det mangler et hermetegn", + "This attribute already exists in the TAG": "Denne attributten eksisterer allerede i taggen", + "No CSS class avaiable": "Ingen CSS klasse tilgjengelig", + "OPTIONS": "EGENSKAPER", + "ATTRIBUTES": "ATTRIBUTTER", + "TAGs": "TAGGer", + "Colors": "Farger", + "Ok": "OK", + "Cancel": "Avbryt" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/nl.js 3 Jan 2016 20:52:10 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Quick Tag Editor": "Quick Tag Editor", + "Enter the TAG you want to insert": "Voer de Tag naam in", + "You have to select some text": "Selecteer tekst", + "There are some unclosed quote": "Er zijn niet gesloten quotes", + "This attribute already exists in the TAG": "Dit attribuut bestaat al in de tag", + "No CSS class avaiable": "Geen CSS class beschikbaar", + "OPTIONS": "OPTIES", + "ATTRIBUTES": "ATTRIBUTEN", + "TAGs": "TAGs", + "Colors": "Kleuren", + "Ok": "Ok", + "Cancel": "Annuleren" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/no.js 3 Jan 2016 20:52:10 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Quick Tag Editor": "Kjapp TAGG-Editor", + "Enter the TAG you want to insert": "Skriv inn taggen du vil ønsker å sette inn", + "You have to select some text": "Du må velge noe tekst", + "There are some unclosed quote": "Det mangler et hermetegn", + "This attribute already exists in the TAG": "Denne attributten eksisterer allerede i taggen", + "No CSS class avaiable": "Ingen CSS klasse tilgjengelig", + "OPTIONS": "EGENSKAPER", + "ATTRIBUTES": "ATTRIBUTTER", + "TAGs": "TAGGer", + "Colors": "Farger", + "Ok": "OK", + "Cancel": "Avbryt" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/pl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/pl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/pl.js 3 Jan 2016 20:52:10 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +// I18N constants +// LANG: "pl", ENCODING: UTF-8 +// translated: Krzysztof Kotowicz, http://www.eskot.krakow.pl/portfolio/, koto@webworkers.pl +{ + "Quick Tag Editor": "Edytor Quick Tag", + "Enter the TAG you want to insert": "Podaj TAG, który chcesz wstawić", + "You have to select some text": "Musisz zaznaczyć tekst.", + "There are some unclosed quote": "Są jakieś niezamknięte cudzysłowia", + "This attribute already exists in the TAG": "TAG posiada już ten atrybut", + "No CSS class avaiable": "Brak dostępnych klas CSS", + "OPTIONS": "OPCJE", + "ATTRIBUTES": "ATRYBUTY", + "TAGs": "TAGi", + "Colors": "Kolory", + "Ok": "Ok", + "Cancel": "Anuluj" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/lang/pt_br.js 3 Jan 2016 20:52:10 -0000 1.1.2.1 @@ -0,0 +1,30 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt) + +{ + "Quick Tag Editor": "Editor Rápido", + "Enter the TAG you want to insert": "Entre com a TAG que deseja inserir", + "You have to select some text": "É preciso selecionar algum texto", + "No CSS class avaiable": "Não há classes CSS disponível", + "There are some unclosed quote": "Há uma ou mais aspas sem fechamento", + "This attribute already exists in the TAG": "Esse atributo já existe na TAG", + "OPTIONS": "OPÇÕES", + "ATTRIBUTES": "ATRIBUTOS", + "TAGs": "TAGs", + "Colors": "Cores", + "Ok": "Ok", + "Cancel": "Cancelar" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/popups/quicktag.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/popups/quicktag.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/QuickTag/popups/quicktag.html 3 Jan 2016 20:52:11 -0000 1.1.2.1 @@ -0,0 +1,354 @@ + + +Quick Tag Editor + + + + + + +
    +
    Quick Tag Editor
    +
    + + + + + + +
    + < + + > +
    +
    +
    +
    + + + +
    +
    +
    +
    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveOnBlur/SaveOnBlur.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveOnBlur/SaveOnBlur.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveOnBlur/SaveOnBlur.js 3 Jan 2016 20:52:11 -0000 1.1.2.1 @@ -0,0 +1,47 @@ +/** Save the content of the editor to the text area when blurring (losing focus). + * + * @author Peter Siewert + * @see Ticket #1433 + */ + +SaveOnBlur._pluginInfo = { + name:"SaveOnBlur", + version:"1.0", + developer:"Peter Siewert", + developer_url:"http://xinha.org", + sponsor:"", + sponsor_url:"", + license:"htmlArea" +}; + +function SaveOnBlur(editor){ + this.editor=editor; +} + +SaveOnBlur.prototype.onKeyPress=function(){ + this.queue_xinha_update_textarea(); + return false; +}; + +SaveOnBlur.prototype.onMouseDown=function(){ + this.queue_xinha_update_textarea(); + return false; +}; + +SaveOnBlur.prototype.queue_xinha_update_textarea = function() +{ + var blurry = this; + + if(!this._attach_blur) + { + + Xinha._addEvent(this.editor._iframe, 'blur', function(){ blurry.xinha_update_textarea(); }); // IE + Xinha._addEvent(this.editor._doc, 'blur', function(){ blurry.xinha_update_textarea(); }); // GECKO + this._attach_blur = 1; + } +} + +SaveOnBlur.prototype.xinha_update_textarea = function() +{ + this.editor._textArea.value=this.editor.outwardHtml(this.editor.getHTML()); +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/README.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/README.txt,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/README.txt 3 Jan 2016 20:52:11 -0000 1.1.2.1 @@ -0,0 +1,15 @@ +SaveSubmit for Xinha + +developed by Raimund Meyer (ray) xinha @ raimundmeyer.de + +Registers a button for submiting the Xinha form using asynchronous +postback for sending the data to the server + +Usage: This should be a drop-in replacement for a normal submit button. +While saving a message is displayed to inform the user what's going on. +On successful transmission the output of the target script is shown, so it should print some information +about the success of saving. + +ATTENTION: The data sent by this method is always UTF-8 encoded, regardless of the actual charset used. So, if you +are using a different encoding you have to convert on the server side. + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/SaveSubmit.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/SaveSubmit.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/SaveSubmit.js 3 Jan 2016 20:52:12 -0000 1.1.2.1 @@ -0,0 +1,159 @@ +/*------------------------------------------*\ +SaveSubmit for Xinha +____________________ + +See README.txt for information + +\*------------------------------------------*/ + +function SaveSubmit(editor) { + this.editor = editor; + this.changed = false; + var self = this; + var cfg = editor.config; + this.textarea = this.editor._textArea; + + cfg.registerIcon('savesubmitchanged', Xinha.getPluginDir("SaveSubmit")+"/img/ed_save_red.gif"); + cfg.registerIcon('savesubmitunchanged', Xinha.getPluginDir("SaveSubmit")+"/img/ed_save_green.gif"); + + cfg.registerButton({ + id : "savesubmit", + tooltip : self._lc("Save"), + image : cfg.iconList.savesubmitunchanged, + textMode : false, + action : function() { + self.save(); + } + }); + cfg.addToolbarElement("savesubmit", "popupeditor", -1); +} + +SaveSubmit.prototype._lc = function(string) { + return Xinha._lc(string, 'SaveSubmit'); +} + +SaveSubmit._pluginInfo = { + name : "SaveSubmit", + version : "1.0", + developer : "Raimund Meyer", + developer_url : "http://x-webservice.net", + c_owner : "Raimund Meyer", + sponsor : "", + sponsor_url : "", + license : "htmlArea" +} + +SaveSubmit.prototype.onKeyPress = function(ev) { + if ( ev.ctrlKey && this.editor.getKey(ev) == 's') { + this.save(this.editor); + Xinha._stopEvent(ev); + return true; + } + else { + if (!this.changed) { + if (this.getChanged()) this.setChanged(); + return false; + } + } +} +SaveSubmit.prototype.onExecCommand = function (cmd) { + if (this.changed && cmd == 'undo') { + if (this.initial_html == this.editor.getInnerHTML()) this.setUnChanged(); + return false; + } +} +SaveSubmit.prototype.onUpdateToolbar = function () { + if (!this.initial_html) this.initial_html = this.editor.getInnerHTML(); + if (!this.changed) { + if (this.getChanged()) this.setChanged(); + return false; + } +} +SaveSubmit.prototype.getChanged = function() { + if (this.initial_html === null) this.initial_html = this.editor.getInnerHTML(); + if (this.initial_html != this.editor.getInnerHTML() && this.changed == false) { + this.changed = true; + return true; + } + else return false; +} +SaveSubmit.prototype.setChanged = function() { + this.editor._toolbarObjects.savesubmit.swapImage(this.editor.config.iconList.savesubmitchanged); + this.editor.updateToolbar(); +} +SaveSubmit.prototype.setUnChanged = function() { + this.changed = false; + this.editor._toolbarObjects.savesubmit.swapImage(this.editor.config.iconList.savesubmitunchanged); +} +SaveSubmit.prototype.changedReset = function() { + this.initial_html = null; + this.setUnChanged(); +} + +SaveSubmit.prototype.save = function() { + this.buildMessage(); + var editor = this.editor; + var self =this; + var form = editor._textArea.form; + form.onsubmit(); + + var name, value, content =''; + + for (var i=0;i0) ? '&' : '') + form.elements[i].name + '=' + encodeURIComponent(form.elements[i].value); + } + var url = editor._textArea.form.action || window.location.href; + Xinha._postback(url, content, function(getback) { + + if (getback) { + self.setMessage(getback); + //self.setMessage(self._lc("Ready")); + self.changedReset(); + } + removeMessage = function() { self.removeMessage()} ; + window.setTimeout("removeMessage()",1000); + }); +} + +SaveSubmit.prototype.setMessage = function(string) { + var textarea = this.textarea; + if ( !document.getElementById("message_sub_" + textarea.id)) { return ; } + var elt = document.getElementById("message_sub_" + textarea.id); + elt.innerHTML = Xinha._lc(string, 'SaveSubmit'); +} + +SaveSubmit.prototype.removeMessage = function() { + var textarea = this.textarea; + if (!document.getElementById("message_" + textarea.id)) { return ; } + document.body.removeChild(document.getElementById("message_" + textarea.id)); +} + +//ripped mokhet's loading message function +SaveSubmit.prototype.buildMessage = function() { + + var textarea = this.textarea; + var htmlarea = this.editor._htmlArea; + var loading_message = document.createElement("div"); + loading_message.id = "message_" + textarea.id; + loading_message.className = "loading"; + loading_message.style.width = htmlarea.offsetWidth +'px' ;//(this.editor._iframe.offsetWidth != 0) ? this.editor._iframe.offsetWidth +'px' : this.editor._initial_ta_size.w; + + loading_message.style.left = Xinha.findPosX(htmlarea) + 'px'; + loading_message.style.top = (Xinha.findPosY(htmlarea) + parseInt(htmlarea.offsetHeight) / 2) - 50 + 'px'; + + var loading_main = document.createElement("div"); + loading_main.className = "loading_main"; + loading_main.id = "loading_main_" + textarea.id; + loading_main.appendChild(document.createTextNode(this._lc("Saving..."))); + + var loading_sub = document.createElement("div"); + loading_sub.className = "loading_sub"; + loading_sub.id = "message_sub_" + textarea.id; + loading_sub.appendChild(document.createTextNode(this._lc("in progress"))); + loading_message.appendChild(loading_main); + loading_message.appendChild(loading_sub); + document.body.appendChild(loading_message); +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/save-submit.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/save-submit.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/save-submit.js 3 Jan 2016 20:52:12 -0000 1.1.2.1 @@ -0,0 +1,137 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/SaveSubmit/save-submit.js */ +function SaveSubmit(_1){ +this.editor=_1; +this.changed=false; +var _2=this; +var _3=_1.config; +this.textarea=this.editor._textArea; +this.image_changed=Xinha.getPluginDir("SaveSubmit")+"/img/ed_save_red.gif"; +this.image_unchanged=Xinha.getPluginDir("SaveSubmit")+"/img/ed_save_green.gif"; +_3.registerButton({id:"savesubmit",tooltip:_2._lc("Save"),image:this.image_unchanged,textMode:false,action:function(){ +_2.save(); +}}); +_3.addToolbarElement("savesubmit","popupeditor",-1); +} +SaveSubmit.prototype._lc=function(_4){ +return Xinha._lc(_4,"SaveSubmit"); +}; +SaveSubmit._pluginInfo={name:"SaveSubmit",version:"1.0",developer:"Raimund Meyer",developer_url:"http://rheinauf.de",c_owner:"Raimund Meyer",sponsor:"",sponsor_url:"",license:"htmlArea"}; +SaveSubmit.prototype.onGenerateOnce=function(){ +this.initial_html=this.editor.getInnerHTML(); +}; +SaveSubmit.prototype.onKeyPress=function(ev){ +if(ev.ctrlKey&&this.editor.getKey(ev)=="s"){ +this.save(this.editor); +Xinha._stopEvent(ev); +return true; +}else{ +if(!this.changed){ +if(this.getChanged()){ +this.setChanged(); +} +return false; +} +} +}; +SaveSubmit.prototype.onExecCommand=function(_6){ +if(this.changed&&_6=="undo"){ +if(this.initial_html==this.editor.getInnerHTML()){ +this.setUnChanged(); +} +return false; +} +}; +SaveSubmit.prototype.onUpdateToolbar=function(){ +if(!this.changed){ +if(this.getChanged()){ +this.setChanged(); +} +return false; +} +}; +SaveSubmit.prototype.getChanged=function(){ +if(this.initial_html===null){ +this.initial_html=this.editor.getInnerHTML(); +} +if(this.initial_html!=this.editor.getInnerHTML()&&this.changed==false){ +this.changed=true; +return true; +}else{ +return false; +} +}; +SaveSubmit.prototype.setChanged=function(){ +this.editor._toolbarObjects.savesubmit.swapImage(this.image_changed); +this.editor.updateToolbar(); +}; +SaveSubmit.prototype.setUnChanged=function(){ +this.changed=false; +this.editor._toolbarObjects.savesubmit.swapImage(this.image_unchanged); +}; +SaveSubmit.prototype.changedReset=function(){ +this.initial_html=null; +this.setUnChanged(); +}; +SaveSubmit.prototype.save=function(){ +this.buildMessage(); +var _7=this.editor; +var _8=this; +var _9=_7._textArea.form; +_9.onsubmit(); +var _a,value,content=""; +for(var i=0;i<_9.elements.length;i++){ +if((_9.elements[i].type=="checkbox"||_9.elements[i].type=="radio")&&!_9.elements[i].checked){ +continue; +} +content+=((i>0)?"&":"")+_9.elements[i].name+"="+encodeURIComponent(_9.elements[i].value); +} +Xinha._postback(_7._textArea.form.action,content,function(_c){ +if(_c){ +_8.setMessage(_c); +_8.changedReset(); +} +removeMessage=function(){ +_8.removeMessage(); +}; +window.setTimeout("removeMessage()",1000); +}); +}; +SaveSubmit.prototype.setMessage=function(_d){ +var _e=this.textarea; +if(!document.getElementById("message_sub_"+_e.id)){ +return; +} +var _f=document.getElementById("message_sub_"+_e.id); +_f.innerHTML=Xinha._lc(_d,"SaveSubmit"); +}; +SaveSubmit.prototype.removeMessage=function(){ +var _10=this.textarea; +if(!document.getElementById("message_"+_10.id)){ +return; +} +document.body.removeChild(document.getElementById("message_"+_10.id)); +}; +SaveSubmit.prototype.buildMessage=function(){ +var _11=this.textarea; +var _12=this.editor._htmlArea; +var _13=document.createElement("div"); +_13.id="message_"+_11.id; +_13.className="loading"; +_13.style.width=_12.offsetWidth+"px"; +_13.style.left=Xinha.findPosX(_12)+"px"; +_13.style.top=(Xinha.findPosY(_12)+parseInt(_12.offsetHeight)/2)-50+"px"; +var _14=document.createElement("div"); +_14.className="loading_main"; +_14.id="loading_main_"+_11.id; +_14.appendChild(document.createTextNode(this._lc("Saving..."))); +var _15=document.createElement("div"); +_15.className="loading_sub"; +_15.id="message_sub_"+_11.id; +_15.appendChild(document.createTextNode(this._lc("in progress"))); +_13.appendChild(_14); +_13.appendChild(_15); +document.body.appendChild(_13); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/img/ed_save_green.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/img/ed_save_green.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/img/ed_save_red.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/img/ed_save_red.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/de.js 3 Jan 2016 20:52:12 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +{ + "Save": "Speichern", + "Saving...": "Speichern...", + "in progress": "in Arbeit", + "Ready": "Fertig" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/fr.js 3 Jan 2016 20:52:13 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Save": "Enregistrer", + "Saving...": "Enregistrement...", + "in progress": "en cours", + "Ready": "Prêt" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/ja.js 3 Jan 2016 20:52:13 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Save": "保存", + "Saving...": "保存中...", + "in progress": "処理中", + "Ready": "レディ" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/nl.js 3 Jan 2016 20:52:13 -0000 1.1.2.1 @@ -0,0 +1,9 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Save": "Opslaan", + "Saving...": "Bezig met opslaan...", + "in progress": "bezig met opslaan...", + "Ready": "Klaar" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/pt_br.js 3 Jan 2016 20:52:13 -0000 1.1.2.1 @@ -0,0 +1,21 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt) +{ + "Save": "Salvar", + "Saving...": "Gravando...", + "in progress": "em processo", + "Ready": "Pronto" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/ru.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/ru.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SaveSubmit/lang/ru.js 3 Jan 2016 20:52:13 -0000 1.1.2.1 @@ -0,0 +1,9 @@ +// I18N constants +// LANG: "ru", ENCODING: UTF-8 +// Simple job done by Alexey Kirpichnikov +{ + "Save": "Сохранить", + "Saving...": "Сохранение...", + "in progress": "пожалуйста, ждите", + "Ready": "Готово" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/SetId.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/SetId.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/SetId.js 3 Jan 2016 20:52:14 -0000 1.1.2.1 @@ -0,0 +1,88 @@ +function SetId(editor) { + this.editor = editor; + var cfg = editor.config; + var self = this; + + // register the toolbar buttons provided by this plugin + cfg.registerButton({ + id : "setid", + tooltip : this._lc("Set Id and Name"), + image : editor.imgURL("set-id.gif", "SetId"), + textMode : false, + action : function(editor) { + self.buttonPress(editor); + } + }); + cfg.addToolbarElement("setid", "createlink", 1); +} + +SetId._pluginInfo = { + name : "SetId", + version : "2.0", + developer : "Udo Schmal", + developer_url : "http://www.schaffrath-neuemedien.de", + c_owner : "Udo Schmal", + sponsor : "L.N.Schaffrath NeueMedien", + sponsor_url : "http://www.schaffrath-neuemedien.de", + license : "htmlArea" +}; + +SetId.prototype._lc = function(string) { + return Xinha._lc(string, 'SetId'); +}; + + +SetId.prototype.onGenerate = function() { + this.editor.addEditorStylesheet(Xinha.getPluginDir("SetId") + '/set-id.css'); +}; + +SetId.prototype.buttonPress = function(editor) { + var outparam = null; + var html = editor.getSelectedHTML(); + var sel = editor._getSelection(); + var range = editor._createRange(sel); + var node = editor._activeElement(sel); + if (node) + outparam = { name : node.id }; + else + outparam = { name : '' }; + + editor._popupDialog( "plugin://SetId/set_id", function( param ) { + if ( param ) { + var name = param["name"]; + if (name == "" || name == null) { + if (node) { + node.removeAttribute("name"); + node.removeAttribute("id"); + node.removeAttribute("title"); + if (node.className == "hasid") { + node.removeAttribute("class"); + } + } + return; + } + try { + var doc = editor._doc; + if (!node) { + node = doc.createElement("span"); + node.id = name; + node.name = name; + node.title = name; + node.className = "hasid"; + node.innerHTML = html; + if (Xinha.is_ie) { + range.pasteHTML(node.outerHTML); + } else { + editor.insertNodeAtSelection(node); + } + } else { + node.id = name; + node.name = name; + node.title = name; + node.className = "hasid"; + } + } + catch (e) { } + } + }, outparam); +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/set-id.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/set-id.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/set-id.css 3 Jan 2016 20:52:14 -0000 1.1.2.1 @@ -0,0 +1,7 @@ +.hasid { + background-image: url(img/set-id.gif); + background-repeat: no-repeat; + background-position: left top; + padding-left: 19px; + border: 1px dotted blue; +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/set-id.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/set-id.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/set-id.js 3 Jan 2016 20:52:14 -0000 1.1.2.1 @@ -0,0 +1,71 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/SetId/set-id.js */ +function SetId(_1){ +this.editor=_1; +var _2=_1.config; +var _3=this; +_2.registerButton({id:"setid",tooltip:this._lc("Set Id and Name"),image:_1.imgURL("set-id.gif","SetId"),textMode:false,action:function(_4){ +_3.buttonPress(_4); +}}); +_2.addToolbarElement("setid","createlink",1); +} +SetId._pluginInfo={name:"SetId",version:"2.0",developer:"Udo Schmal",developer_url:"http://www.schaffrath-neuemedien.de",c_owner:"Udo Schmal",sponsor:"L.N.Schaffrath NeueMedien",sponsor_url:"http://www.schaffrath-neuemedien.de",license:"htmlArea"}; +SetId.prototype._lc=function(_5){ +return Xinha._lc(_5,"SetId"); +}; +SetId.prototype.onGenerate=function(){ +this.editor.addEditorStylesheet(Xinha.getPluginDir("SetId")+"/set-id.css"); +}; +SetId.prototype.buttonPress=function(_6){ +var _7=null; +var _8=_6.getSelectedHTML(); +var _9=_6._getSelection(); +var _a=_6._createRange(_9); +var _b=_6._activeElement(_9); +if(_b){ +_7={name:_b.id}; +}else{ +_7={name:""}; +} +_6._popupDialog("plugin://SetId/set_id",function(_c){ +if(_c){ +var _d=_c["name"]; +if(_d==""||_d==null){ +if(_b){ +_b.removeAttribute("name"); +_b.removeAttribute("id"); +_b.removeAttribute("title"); +if(_b.className=="hasid"){ +_b.removeAttribute("class"); +} +} +return; +} +try{ +var _e=_6._doc; +if(!_b){ +_b=_e.createElement("span"); +_b.id=_d; +_b.name=_d; +_b.title=_d; +_b.className="hasid"; +_b.innerHTML=_8; +if(Xinha.is_ie){ +_a.pasteHTML(_b.outerHTML); +}else{ +_6.insertNodeAtSelection(_b); +} +}else{ +_b.id=_d; +_b.name=_d; +_b.title=_d; +_b.className="hasid"; +} +} +catch(e){ +} +} +},_7); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/img/placeholder.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/img/placeholder.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/img/set-id.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/img/set-id.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/de.js 3 Jan 2016 20:52:15 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// translated: Raimund Meyer xinha@ray-of-light.org +{ + "Set Id and Name": "Objekt ID und Name einfügen", + "Name/Id": "Name (ID)", + "Delete": "Löschen" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/ja.js 3 Jan 2016 20:52:15 -0000 1.1.2.1 @@ -0,0 +1,9 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Set Id and Name": "IDと名前の設定", + "Name/Id": "名前/ID", + "Delete": "削除", + "Set ID/Name": "IDと名前の設定", + "ID/Name:": "ID/名前:" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/nb.js 3 Jan 2016 20:52:15 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Set Id and Name": "Sett ID og navn", + "Name/Id": "Navn (ID)", + "Delete": "Slett" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/nl.js 3 Jan 2016 20:52:15 -0000 1.1.2.1 @@ -0,0 +1,10 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Set Id and Name": "ID en Naam instellen", + "Name/Id": "Naam/ID", + "Delete": "Verwijderen", + "Set ID/Name": "ID/Naam instellen", + "ID/Name:": "ID/Naam:" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/no.js 3 Jan 2016 20:52:15 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Set Id and Name": "Sett ID og navn", + "Name/Id": "Navn (ID)", + "Delete": "Slett" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/lang/pt_br.js 3 Jan 2016 20:52:15 -0000 1.1.2.1 @@ -0,0 +1,25 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Cancel": "Cancelar", + "Delete": "Apagar", + "ID/Name:": "ID/Nome:", + "OK": "OK", + "Set ID/Name": "Definir ID/Nome", + "Set Id and Name": "Definir Id e Nome", + "Set Id/Name": "Definir Id/Nome", + "Name/Id": "Nome/Id" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/popups/set_id.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/popups/set_id.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SetId/popups/set_id.html 3 Jan 2016 20:52:16 -0000 1.1.2.1 @@ -0,0 +1,58 @@ + + + Set Id/Name + + + + + + +
    Set ID/Name
    +
    + + + + + +
    ID/Name:
    + +
    + + + +
    +
    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/SmartReplace.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/SmartReplace.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/SmartReplace.js 3 Jan 2016 20:52:16 -0000 1.1.2.1 @@ -0,0 +1,344 @@ +/*------------------------------------------*\ + SmartReplace for Xinha + _______________________ + +\*------------------------------------------*/ + +function SmartReplace(editor) { + this.editor = editor; + + var cfg = editor.config; + var self = this; + + cfg.registerButton + ({ + id : "smartreplace", + tooltip : this._lc("SmartReplace"), + image : [_editor_url +'iconsets/Tango/ed_buttons_main.png',3,8], + textMode : false, + action : function(e, objname, obj) { self.buttonPress(null, obj); } + }); + cfg.addToolbarElement("smartreplace", "htmlmode", 1); +} + +SmartReplace._pluginInfo = { + name : "SmartReplace", + version : "1.0", + developer : "Raimund Meyer", + developer_url : "http://x-webservice.net", + c_owner : "Raimund Meyer", + sponsor : "", + sponsor_url : "", + license : "htmlArea" +}; + +SmartReplace.prototype._lc = function(string) { + return Xinha._lc(string, 'SmartReplace'); +}; + +Xinha.Config.prototype.SmartReplace = +{ + 'defaultActive' : true, + 'quotes' : null//[String.fromCharCode(187),String.fromCharCode(171),String.fromCharCode(8250),String.fromCharCode(8249)] +} +SmartReplace.prototype.toggleActivity = function(newState) +{ + if (typeof newState != 'undefined') + { + this.active = newState; + } + else + { + this.active = this.active ? false : true; + } + this.editor._toolbarObjects.smartreplace.state("active", this.active); +} + +SmartReplace.prototype.onUpdateToolbar = function() { + this.editor._toolbarObjects.smartreplace.state("active", this.active); +} + +SmartReplace.prototype.onGenerate = function() { + this.active = this.editor.config.SmartReplace.defaultActive; + this.editor._toolbarObjects.smartreplace.state("active", this.active); + + var self = this; + Xinha._addEvent( + self.editor._doc, + "keypress", + function (event) + { + return self.keyEvent(Xinha.is_ie ? self.editor._iframe.contentWindow.event : event); + }); + + var quotes = this.editor.config.SmartReplace.quotes; + + if (quotes && typeof quotes == 'object') + { + this.openingQuotes = quotes[0]; + this.closingQuotes = quotes[1]; + this.openingQuote = quotes[2]; + this.closingQuote = quotes[3]; + } + else + { + this.openingQuotes = this._lc("OpeningDoubleQuotes"); + this.closingQuote = this._lc("ClosingSingleQuote"); + this.closingQuotes = this._lc("ClosingDoubleQuotes"); + this.openingQuote = this._lc("OpeningSingleQuote"); + } + + if (this.openingQuotes == 'OpeningDoubleQuotes') //If nothing else is defined, English style as default + { + this.openingQuotes = String.fromCharCode(8220); + this.closingQuotes = String.fromCharCode(8221); + this.openingQuote = String.fromCharCode(8216); + this.closingQuote = String.fromCharCode(8217); + } +}; + +SmartReplace.prototype.keyEvent = function(ev) +{ + if ( !this.active) return true; + var editor = this.editor; + var charCode = Xinha.is_ie ? ev.keyCode : ev.which; + + var key = String.fromCharCode(charCode); + + if ( key == '"' || key == "'") + { + Xinha._stopEvent(ev); + return this.smartQuotes(key); + } + if (charCode == 32) //space bar + { + return this.smartReplace(ev, 2, /^\s-/, ' '+String.fromCharCode(8211), false); // space-space -> dash + } + if ( key == '.' ) // ... -> ellipsis + { + return this.smartReplace(ev, 2, /\.\./, String.fromCharCode(8230), true); + } + return true; +} + +SmartReplace.prototype.smartQuotes = function(kind) +{ + if (kind == "'") + { + var opening = this.openingQuote; + var closing = this.closingQuote; + } + else + { + var opening = this.openingQuotes; + var closing = this.closingQuotes; + } + + var editor = this.editor; + + var sel = editor.getSelection(); + + if (Xinha.is_ie) + { + var r = editor.createRange(sel); + if (r.text !== '') + { + r.text = ''; + } + r.moveStart('character', -1); + + if(r.text.match(/\S/)) + { + r.moveStart('character', +1); + r.text = closing; + } + else + { + r.moveStart('character', +1); + r.text = opening; + } + } + else + { + var r = editor.createRange(sel); + + if (!r.collapsed) + { + editor.insertNodeAtSelection(document.createTextNode('')); + } + if (r.startOffset > 0) r.setStart(r.startContainer, r.startOffset -1); + + + if(r.toString().match(/[^\s\xA0]/)) + {; + r.collapse(false); + editor.insertNodeAtSelection(document.createTextNode(closing)); + } + else + { + editor.insertNodeAtSelection(document.createTextNode(r.toString()[0]+opening)); + } + editor.getSelection().collapseToEnd(); + } + return false; +} + +SmartReplace.prototype.smartReplace = function(ev, lookback, re, replace, stopEvent) +{ + var editor = this.editor; + var sel = this.editor.getSelection(); + var r = this.editor.createRange(sel); + + if (Xinha.is_ie) + { + r.moveStart('character', -lookback); + + if(r.text.match(re)) + { + r.text = replace; + if (stopEvent) + { + Xinha._stopEvent(ev); + return false + } + } + } + else + { + if (r.startOffset > 1) r.setStart(r.startContainer, r.startOffset -lookback); + + if(r.toString().match(re)) + { + this.editor.insertNodeAtSelection(document.createTextNode(replace)); + r.deleteContents(); + r.collapse(true); + if (stopEvent) + { + Xinha._stopEvent(ev); + return false + } + } + editor.getSelection().collapseToEnd(); + } + return true; +} + +SmartReplace.prototype.replaceAll = function() +{ + var doubleQuotes = [ + '"', + String.fromCharCode(8220), + String.fromCharCode(8221), + String.fromCharCode(8222), + String.fromCharCode(187), + String.fromCharCode(171) + + ]; + var singleQuotes = [ + "'", + String.fromCharCode(8216), + String.fromCharCode(8217), + String.fromCharCode(8218), + String.fromCharCode(8250), + String.fromCharCode(8249) + ]; + + var html = this.editor.getHTML(); + var reOpeningDouble = new RegExp ('(\\s|^|>)('+doubleQuotes.join('|')+')(\\S)','g'); + html = html.replace(reOpeningDouble,'$1'+this.openingQuotes+'$3'); + + var reOpeningSingle = new RegExp ('(\\s|^|>)('+singleQuotes.join('|')+')(\\S)','g'); + html = html.replace(reOpeningSingle,'$1'+this.openingQuote+'$3'); + + var reClosingDouble = new RegExp ('(\\S)('+doubleQuotes.join('|')+')','g'); + html = html.replace(reClosingDouble,'$1'+this.closingQuotes); + + var reClosingSingle = new RegExp ('(\\S)('+singleQuotes.join('|')+')','g'); + html = html.replace(reClosingSingle,'$1'+this.closingQuote); + + var reDash = new RegExp ('( | )(-)( | )','g'); + html = html.replace(reDash,' '+String.fromCharCode(8211)+' '); + + this.editor.setHTML(html); +} + +SmartReplace.prototype.buttonPress = function(opts, obj) +{ + var self = this; + + if ( this.dialog.rootElem.style.display != 'none') + { + return this.dialog.hide(); + } + var doOK = function() + { + var opts = self.dialog.hide(); + self.toggleActivity((opts.enable) ? true : false); + if (opts.convert) + { + self.replaceAll(); + self.dialog.getElementById("convert").checked = false; + } + } + var inputs = + { + enable : self.active ? "on" : '', + convert: '' + }; + this.show(inputs, doOK); +}; + +SmartReplace.prototype.onGenerateOnce = function() +{ + this._prepareDialog(); +}; + +SmartReplace.prototype._prepareDialog = function() +{ + var self = this; + var editor = this.editor; + + if(!this.html) + { + Xinha._getback( Xinha.getPluginDir("SmartReplace") + '/dialog.html', function(getback) { self.html = getback; self._prepareDialog(); }); + return; + } + + // Now we have everything we need, so we can build the dialog. + this.dialog = new Xinha.Dialog(editor, this.html, 'SmartReplace',{},{modal:false}); + this.dialog.attachToPanel('top'); + + this.dialog.getElementById('enable').onchange = function () + { + self.toggleActivity(this.checked); + } + this.dialog.getElementById('convert').onchange = function () + { + self.dialog.getElementById('ok').style.display = ( this.checked ) ? '' : 'none'; + } + this.dialog.getElementById('ok').onclick = function () + { + self.replaceAll(); + self.dialog.getElementById('convert').checked = false; + this.style.display = 'none'; + } + this.ready = true; +}; + +SmartReplace.prototype.show = function(inputs) +{ + if(!this.ready) + { + var self = this; + window.setTimeout(function() {self.show(inputs,ok,cancel);},100); + return; + } + + // Connect the OK and Cancel buttons + var self = this; + + this.dialog.show(inputs); + + // Init the sizes + this.dialog.onresize(); +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/dialog.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/dialog.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/dialog.html 3 Jan 2016 20:52:16 -0000 1.1.2.1 @@ -0,0 +1,16 @@ +

    SmartReplace Settings

    +
    + + + + + + + + + +
    Enable automatic replacements
    Convert all quotes and dashes in the current document
    +
    +
    + +
    Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/readme.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/readme.txt,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/readme.txt 3 Jan 2016 20:52:16 -0000 1.1.2.1 @@ -0,0 +1,15 @@ +One irritating thing with text processing is the total absence of some typographic essentials on the keyboard -- "real" (typographic) quotes and the dash, typically miss-typed as inch or second sign (") and the hyphon(-). + +This plugin lends the good old Word behaviour to Xinha, as ",', and - get converted to their respective typographic correct relatives while typing. +It also replaces ... with the ellipsis sign (which is three dots combined in one glyph that is considered typographically better). + + Configuration (to change the quote style from default English): + * through language file (see lang/de.js) + * through a config variable (an array that holds four values: opening single quote, closing single quote, opening double quote, closing double quote) + + Additional config option: + * disable automatic replacement by default + + Additional features: + * can be switched on/off + * convert all quotes/dashes in a document that still has the boring "/- stuff \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/smart-replace.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/smart-replace.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/smart-replace.js 3 Jan 2016 20:52:16 -0000 1.1.2.1 @@ -0,0 +1,249 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/SmartReplace/smart-replace.js */ +function SmartReplace(_1){ +this.editor=_1; +var _2=_1.config; +var _3=this; +_2.registerButton({id:"smartreplace",tooltip:this._lc("SmartReplace"),image:Xinha.getPluginDir("SmartReplace")+"/img/smartquotes.gif",textMode:false,action:function(e,_5,_6){ +_3.buttonPress(null,_6); +}}); +_2.addToolbarElement("smartreplace","htmlmode",1); +} +SmartReplace._pluginInfo={name:"SmartReplace",version:"1.0",developer:"Raimund Meyer",developer_url:"http://x-webservice.net",c_owner:"Raimund Meyer",sponsor:"",sponsor_url:"",license:"LGPL"}; +SmartReplace.prototype._lc=function(_7){ +return Xinha._lc(_7,"SmartReplace"); +}; +Xinha.Config.prototype.SmartReplace={"defaultActive":true,"quotes":null}; +SmartReplace.prototype.toggleActivity=function(_8){ +if(typeof _8!="undefined"){ +this.active=_8; +}else{ +this.active=this.active?false:true; +} +this.editor._toolbarObjects.smartreplace.state("active",this.active); +}; +SmartReplace.prototype.onUpdateToolbar=function(){ +this.editor._toolbarObjects.smartreplace.state("active",this.active); +}; +SmartReplace.prototype.onGenerate=function(){ +this.active=this.editor.config.SmartReplace.defaultActive; +this.editor._toolbarObjects.smartreplace.state("active",this.active); +var _9=this; +Xinha._addEvent(_9.editor._doc,"keypress",function(_a){ +return _9.keyEvent(Xinha.is_ie?_9.editor._iframe.contentWindow.event:_a); +}); +var _b=this.editor.config.SmartReplace.quotes; +if(_b&&typeof _b=="object"){ +this.openingQuotes=_b[0]; +this.closingQuotes=_b[1]; +this.openingQuote=_b[2]; +this.closingQuote=_b[3]; +}else{ +this.openingQuotes=this._lc("OpeningDoubleQuotes"); +this.closingQuote=this._lc("ClosingSingleQuote"); +this.closingQuotes=this._lc("ClosingDoubleQuotes"); +this.openingQuote=this._lc("OpeningSingleQuote"); +} +if(this.openingQuotes=="OpeningDoubleQuotes"){ +this.openingQuotes=String.fromCharCode(8220); +this.closingQuotes=String.fromCharCode(8221); +this.openingQuote=String.fromCharCode(8216); +this.closingQuote=String.fromCharCode(8217); +} +}; +SmartReplace.prototype.keyEvent=function(ev){ +if(!this.active){ +return true; +} +var _d=this.editor; +var _e=Xinha.is_ie?ev.keyCode:ev.which; +var _f=String.fromCharCode(_e); +if(_f=="\""||_f=="'"){ +Xinha._stopEvent(ev); +return this.smartQuotes(_f); +} +if(_e==32){ +return this.smartReplace(ev,2,/^\s-/," \ufffd\ufffd\ufffd",false); +} +if(_f=="."){ +return this.smartReplace(ev,2,/\.\./,"\ufffd\ufffd\ufffd",true); +} +return true; +}; +SmartReplace.prototype.smartQuotes=function(_10){ +if(_10=="'"){ +var _11=this.openingQuote; +var _12=this.closingQuote; +}else{ +var _11=this.openingQuotes; +var _12=this.closingQuotes; +} +var _13=this.editor; +var sel=_13.getSelection(); +if(Xinha.is_ie){ +var r=_13.createRange(sel); +if(r.text!==""){ +r.text=""; +} +r.moveStart("character",-1); +if(r.text.match(/\S/)){ +r.moveStart("character",+1); +r.text=_12; +}else{ +r.moveStart("character",+1); +r.text=_11; +} +}else{ +var r=_13.createRange(sel); +if(!r.collapsed){ +_13.insertNodeAtSelection(document.createTextNode("")); +} +if(r.startOffset>0){ +r.setStart(r.startContainer,r.startOffset-1); +} +if(r.toString().match(/[^\s\xA0]/)){ +r.collapse(false); +_13.insertNodeAtSelection(document.createTextNode(_12)); +}else{ +_13.insertNodeAtSelection(document.createTextNode(_11)); +} +_13.getSelection().collapseToEnd(); +} +return false; +}; +SmartReplace.prototype.smartReplace=function(ev,_17,re,_19,_1a){ +var _1b=this.editor; +var sel=this.editor.getSelection(); +var r=this.editor.createRange(sel); +if(Xinha.is_ie){ +r.moveStart("character",-_17); +if(r.text.match(re)){ +r.text=_19; +if(_1a){ +Xinha._stopEvent(ev); +return false; +} +} +}else{ +if(r.startOffset>1){ +r.setStart(r.startContainer,r.startOffset-_17); +} +if(r.toString().match(re)){ +this.editor.insertNodeAtSelection(document.createTextNode(_19)); +r.deleteContents(); +r.collapse(true); +if(_1a){ +Xinha._stopEvent(ev); +return false; +} +} +_1b.getSelection().collapseToEnd(); +} +return true; +}; +SmartReplace.prototype.replaceAll=function(){ +var _1e=[""",String.fromCharCode(8220),String.fromCharCode(8221),String.fromCharCode(8222),String.fromCharCode(187),String.fromCharCode(171)]; +var _1f=["'",String.fromCharCode(8216),String.fromCharCode(8217),String.fromCharCode(8218),String.fromCharCode(8250),String.fromCharCode(8249)]; +var _20=this.editor.getHTML(); +var _21=new RegExp("(\\s|^|>)("+_1e.join("|")+")(\\S)","g"); +_20=_20.replace(_21,"$1"+this.openingQuotes+"$3"); +var _22=new RegExp("(\\s|^|>)("+_1f.join("|")+")(\\S)","g"); +_20=_20.replace(_22,"$1"+this.openingQuote+"$3"); +var _23=new RegExp("(\\S)("+_1e.join("|")+")","g"); +_20=_20.replace(_23,"$1"+this.closingQuotes); +var _24=new RegExp("(\\S)("+_1f.join("|")+")","g"); +_20=_20.replace(_24,"$1"+this.closingQuote); +var _25=new RegExp("( | )(-)( | )","g"); +_20=_20.replace(_25," "+String.fromCharCode(8211)+" "); +this.editor.setHTML(_20); +}; +SmartReplace.prototype.dialog=function(){ +var _26=this; +var _27=function(_28){ +_26.toggleActivity(_28.enable); +if(_28.convert){ +_26.replaceAll(); +} +}; +var _29=this; +Dialog(Xinha.getPluginDir("SmartReplace")+"/popups/dialog.html",_27,_29); +}; +SmartReplace.prototype.buttonPress=function(_2a,obj){ +var _2c=this; +if(this._dialog.dialog.rootElem.style.display!="none"){ +return this._dialog.hide(); +} +var _2d=function(){ +var _2e=_2c._dialog.hide(); +_2c.toggleActivity((_2e.enable)?true:false); +if(_2e.convert){ +_2c.replaceAll(); +_2c._dialog.dialog.getElementById("convert").checked=false; +} +}; +var _2f={enable:_2c.active?"on":"",convert:""}; +this._dialog.show(_2f,_2d); +}; +SmartReplace.prototype.onGenerateOnce=function(){ +if(!this._dialog){ +this._dialog=new SmartReplace.Dialog(this); +} +}; +SmartReplace.Dialog=function(_30){ +this.Dialog_nxtid=0; +this.mainPluginObject=_30; +this.id={}; +this.ready=false; +this.files=false; +this.html=false; +this.dialog=false; +this._prepareDialog(); +}; +SmartReplace.Dialog.prototype._prepareDialog=function(){ +var _31=this; +var _32=this.mainPluginObject.editor; +if(this.html==false){ +Xinha._getback(Xinha.getPluginDir("SmartReplace")+"/dialog.html",function(_33){ +_31.html=_33; +_31._prepareDialog(); +}); +return; +} +this.dialog=new Xinha.Dialog(_32,this.html,"SmartReplace"); +this.ready=true; +}; +SmartReplace.Dialog.prototype._lc=SmartReplace.prototype._lc; +SmartReplace.Dialog.prototype.show=function(_34,ok,_36){ +if(!this.ready){ +var _37=this; +window.setTimeout(function(){ +_37.show(_34,ok,_36); +},100); +return; +} +var _38=this.dialog; +var _37=this; +if(ok){ +this.dialog.getElementById("ok").onclick=ok; +}else{ +this.dialog.getElementById("ok").onclick=function(){ +_37.hide(); +}; +} +if(_36){ +this.dialog.getElementById("cancel").onclick=_36; +}else{ +this.dialog.getElementById("cancel").onclick=function(){ +_37.hide(); +}; +} +this.mainPluginObject.editor.disableToolbar(["fullscreen","smartreplace"]); +this.dialog.show(_34); +this.dialog.onresize(); +}; +SmartReplace.Dialog.prototype.hide=function(){ +this.mainPluginObject.editor.enableToolbar(); +return this.dialog.hide(); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/img/SmartReplace.svg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/img/SmartReplace.svg,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/img/SmartReplace.svg 3 Jan 2016 20:52:17 -0000 1.1.2.1 @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/img/smartquotes.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/img/smartquotes.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/img/smartquotes.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/img/smartquotes.png,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/de.js 3 Jan 2016 20:52:17 -0000 1.1.2.1 @@ -0,0 +1,19 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +{ + "SmartReplace Settings" : "SmartReplace Einstellungen", + "Enable automatic replacements" : "Automatische Ersetzung aktivieren", + "Convert all quotes and dashes in the current document": "Alle Anführungszeichen und Gedankenstriche umwandeln", + + "OpeningDoubleQuotes": "„", + "ClosingDoubleQuotes": "“", + "OpeningSingleQuote": "‚", + "ClosingSingleQuote": "‘" + + /* + "OpeningDoubleQuotes": "»", + "ClosingDoubleQuotes": "«", + "OpeningSingleQuote": "›", + "ClosingSingleQuote": "‹" +*/ +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/fr.js 3 Jan 2016 20:52:17 -0000 1.1.2.1 @@ -0,0 +1,13 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "SmartReplace Settings" : "Paramètres SmartReplace", + "Enable automatic replacements" : "Activer le remplacement automatique", + "Convert all quotes and dashes in the current document": "Convertir tous les guillemets et tirets dans le document actuel", + + "OpeningDoubleQuotes": "»", + "ClosingDoubleQuotes": "«", + "OpeningSingleQuote": "", + "ClosingSingleQuote": "" + +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/ja.js 3 Jan 2016 20:52:18 -0000 1.1.2.1 @@ -0,0 +1,19 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "SmartReplace Settings" : "SmartReplace設定", + "Enable automatic replacements" : "自動置換の有効化", + "Convert all quotes and dashes in the current document": "文書内の引用符とダッシュをすべて変換", + + "OpeningDoubleQuotes": "„", + "ClosingDoubleQuotes": "“", + "OpeningSingleQuote": "‚", + "ClosingSingleQuote": "‘" + + /* + "OpeningDoubleQuotes": "»", + "ClosingDoubleQuotes": "«", + "OpeningSingleQuote": "›", + "ClosingSingleQuote": "‹" +*/ +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/nl.js 3 Jan 2016 20:52:18 -0000 1.1.2.1 @@ -0,0 +1,20 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "SmartReplace Settings" : "SmartReplace Instellingen", + "Enable automatic replacements" : "Automatisch vervangen inschakelen", + "Convert all quotes and dashes in the current document": "Converteer alle quotes en schuine strepen", + + "OpeningDoubleQuotes": "„", + "ClosingDoubleQuotes": "“", + "OpeningSingleQuote": "‚", + "ClosingSingleQuote": "‘" + + /* + "OpeningDoubleQuotes": "»", + "ClosingDoubleQuotes": "«", + "OpeningSingleQuote": "›", + "ClosingSingleQuote": "‹" +*/ +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/lang/pt_br.js 3 Jan 2016 20:52:18 -0000 1.1.2.1 @@ -0,0 +1,24 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +{ + "Cancel": "Cancelar", + "Convert all quotes and dashes in the current document": "Converter todas as citações e hífens no documento atual", + "Enable automatic replacements": "Ativar substituições automáticas", + "OK": "OK", + "SmartReplace": "Substituição Rápida", + "SmartReplace Settings": "Configurações da Substituição Rápida" +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/popups/dialog.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/popups/dialog.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SmartReplace/popups/dialog.html 3 Jan 2016 20:52:18 -0000 1.1.2.1 @@ -0,0 +1,66 @@ + + + + + SmartReplace Settings + + + + + + + + +
    SmartReplace Settings
    +
    + + + + + + + + + +
    Enable automatic replacements
    Convert all quotes and dashes in the current document
    + +
    + + +
    +
    + + \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/README =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/README,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/README 3 Jan 2016 20:52:19 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +ExecCGI Note: +If you intend to use the perl (.cgi) backend then you will need to have the ExecCGI option enabled for this directory (if you are using Apache), you may be able to do this by adding a file called .htaccess in this directory, with the below contents. + +## EXAMPLE .htaccess +Options +ExecCGI +#################### + +It is however recommended that you use the PHP backend where possible. \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/SpellChecker.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/SpellChecker.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/SpellChecker.js 3 Jan 2016 20:52:19 -0000 1.1.2.1 @@ -0,0 +1,73 @@ +// Spell Checker Plugin for HTMLArea-3.0 +// Sponsored by www.americanbible.org +// Implementation by Mihai Bazon, http://dynarch.com/mishoo/ +// +// (c) dynarch.com 2003. +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +// +// $Id: SpellChecker.js,v 1.1.2.1 2016/01/03 20:52:19 gustafn Exp $ + +Xinha.Config.prototype.SpellChecker = { 'backend': 'php', 'personalFilesDir' : '', 'defaultDictionary' : 'en_GB', 'utf8_to_entities' : true }; + +function SpellChecker(editor) { + this.editor = editor; + + var cfg = editor.config; + var bl = SpellChecker.btnList; + var self = this; + + // see if we can find the mode switch button, insert this before that + var id = "SC-spell-check"; + cfg.registerButton(id, this._lc("Spell-check"), editor.imgURL("spell-check.gif", "SpellChecker"), false, + function(editor, id) { + // dispatch button press event + self.buttonPress(editor, id); + }); + + cfg.addToolbarElement("SC-spell-check", "htmlmode", 1); +} + +SpellChecker._pluginInfo = { + name : "SpellChecker", + version : "1.0", + developer : "Mihai Bazon", + developer_url : "http://dynarch.com/mishoo/", + c_owner : "Mihai Bazon", + sponsor : "American Bible Society", + sponsor_url : "http://www.americanbible.org", + license : "htmlArea" +}; + +SpellChecker.prototype._lc = function(string) { + return Xinha._lc(string, 'SpellChecker'); +}; + +SpellChecker.btnList = [ + null, // separator + ["spell-check"] + ]; + +SpellChecker.prototype.buttonPress = function(editor, id) { + switch (id) { + case "SC-spell-check": + SpellChecker.editor = editor; + SpellChecker.init = true; + var uiurl = Xinha.getPluginDir("SpellChecker") + "/spell-check-ui.html"; + var win; + if (Xinha.is_ie) { + win = window.open(uiurl, "SC_spell_checker", + "toolbar=no,location=no,directories=no,status=no,menubar=no," + + "scrollbars=no,resizable=yes,width=600,height=450"); + } else { + win = window.open(uiurl, "SC_spell_checker", + "toolbar=no,menubar=no,personalbar=no,width=600,height=450," + + "scrollbars=no,resizable=yes"); + } + win.focus(); + break; + } +}; + +// this needs to be global, it's accessed from spell-check-ui.html +SpellChecker.editor = null; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/aspell_setup.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/aspell_setup.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/aspell_setup.php 3 Jan 2016 20:52:19 -0000 1.1.2.1 @@ -0,0 +1,123 @@ + (int)$aVer[1], 'minor' => (int)$aVer[2], 'release' => (int)@$aVer[3]); + if($aVer['major'] >= 0 && $aVer['minor'] >= 60) + { + $aspell_args .= ' -H --encoding=utf-8'; + } + elseif(preg_match('/--encoding/', shell_exec('aspell 2>&1'))) + { + $aspell_args .= ' --mode=none --add-filter=sgml --encoding=utf-8'; + } + else + { + $aspell_args .= ' --mode=none --add-filter=sgml'; + } + + // Personal dictionaries + $p_dicts_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'personal_dicts'; + + if(isset($_REQUEST['p_dicts_path']) && file_exists($_REQUEST['p_dicts_path']) && is_writable($_REQUEST['p_dicts_path'])) + { + if(!isset($_REQUEST['p_dicts_name'])) + { + if(isset($_COOKIE['SpellChecker_p_dicts_name'])) + { + $_REQUEST['p_dicts_name'] = $_COOKIE['SpellChecker_p_dicts_name']; + } + else + { + $_REQUEST['p_dicts_name'] = uniqid('dict'); + setcookie('SpellChecker_p_dicts_name', $_REQUEST['p_dicts_name'], time() + 60*60*24*365*10); + } + } + $p_dict_path = $_REQUEST['p_dicts_path'] . DIRECTORY_SEPARATOR . preg_replace('/[^a-z0-9_]/i', '', $_REQUEST['p_dicts_name']); + + if(!file_exists($p_dict_path)) + { + // since there is a single directory for all users this could end up containing + // quite a few subdirectories. To prevent a DOS situation we'll limit the + // total directories created to 2000 (arbitrary). Adjust to suit your installation. + + $count = 0; + + if( $dir = @opendir( $p_dicts_path ) ) + { + + while( FALSE !== ($file = readdir($dir)) ) + { + $count++; + } + } + + // TODO: make this a config value. + + if ( $count > 2000 ) + { + + // either very heavy use or a DOS attempt + + die(); + + } + + mkdir($p_dict_path); + chmod($p_dict_path, 02770); + } + + if(file_exists($p_dict_path) && is_writable($p_dict_path)) + { + // Good To Go! + $aspell_args .= ' --home-dir=' . $p_dict_path ; + } + } + +// as an additional precaution check the aspell_args for illegal +// characters + $aspell_args = preg_replace( "/[|><;\$]+/", '', $aspell_args ); + $aspelldictionaries = "$aspell dump dicts"; + $aspellcommand = "$aspell $aspell_args < $temptext"; + + +?> Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/readme-tech.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/readme-tech.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/readme-tech.html 3 Jan 2016 20:52:19 -0000 1.1.2.1 @@ -0,0 +1,114 @@ + + + + HTMLArea Spell Checker + + + +

    HTMLArea Spell Checker

    + +

    The HTMLArea Spell Checker subsystem consists of the following + files:

    + +
      + +
    • spell-checker.js — the spell checker plugin interface for + HTMLArea
    • + +
    • spell-checker-ui.html — the HTML code for the user + interface
    • + +
    • spell-checker-ui.js — functionality of the user + interface
    • + +
    • spell-checker-logic.cgi — Perl CGI script that checks a text + given through POST for spelling errors
    • + +
    • spell-checker-style.css — style for mispelled words
    • + +
    • lang/en.js — main language file (English).
    • + +
    + +

    Process overview

    + +

    + When an end-user clicks the "spell-check" button in the HTMLArea + editor, a new window is opened with the URL of "spell-check-ui.html". + This window initializes itself with the text found in the editor (uses + window.opener.SpellChecker.editor global variable) and it + submits the text to the server-side script "spell-check-logic.cgi". + The target of the FORM is an inline frame which is used both to + display the text and correcting. +

    + +

    + Further, spell-check-logic.cgi calls Aspell for each portion of plain + text found in the given HTML. It rebuilds an HTML file that contains + clear marks of which words are incorrect, along with suggestions for + each of them. This file is then loaded in the inline frame. Upon + loading, a JavaScript function from "spell-check-ui.js" is called. + This function will retrieve all mispelled words from the HTML of the + iframe and will setup the user interface so that it allows correction. +

    + +

    The server-side script (spell-check-logic.cgi)

    + +

    + Unicode safety — the program is + Unicode safe. HTML entities are expanded into their corresponding + Unicode characters. These characters will be matched as part of the + word passed to Aspell. All texts passed to Aspell are in Unicode + (when appropriate). However, Aspell seems to not support Unicode + yet (thread concerning Aspell and Unicode). + This mean that words containing Unicode + characters that are not in 0..255 are likely to be reported as "mispelled" by Aspell. +

    + +

    + Update: though I've never seen it mentioned + anywhere, it looks that Aspell does, in fact, speak + Unicode. Or else, maybe Text::Aspell does + transparent conversion; anyway, this new version of our + SpellChecker plugin is, as tests show so far, fully + Unicode-safe... well, probably the only freeware + Web-based spell-checker which happens to have Unicode support. +

    + +

    + The Perl Unicode manual (man perluniintro) states: +

    + +
    + + Starting from Perl 5.6.0, Perl has had the capacity to handle Unicode + natively. Perl 5.8.0, however, is the first recommended release for + serious Unicode work. The maintenance release 5.6.1 fixed many of the + problems of the initial Unicode implementation, but for example regular + expressions still do not work with Unicode in 5.6.1. + +
    + +

    In other words, do not assume that this script is + Unicode-safe on Perl interpreters older than 5.8.0.

    + +

    The following Perl modules are required:

    + + + +

    Of these, only Text::Aspell might need to be installed manually. The + others are likely to be available by default in most Perl distributions.

    + +
    +
    Mihai Bazon
    + + Last modified: Fri Jan 30 19:14:11 EET 2004 + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-logic.cgi =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-logic.cgi,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-logic.cgi 3 Jan 2016 20:52:19 -0000 1.1.2.1 @@ -0,0 +1,210 @@ +#! /usr/bin/perl -w + +# Spell Checker Plugin for HTMLArea-3.0 +# Sponsored by www.americanbible.org +# Implementation by Mihai Bazon, http://dynarch.com/mishoo/ +# +# (c) dynarch.com 2003. +# Distributed under the same terms as HTMLArea itself. +# This notice MUST stay intact for use (see license.txt). +# +# $Id: spell-check-logic.cgi,v 1.1.2.1 2016/01/03 20:52:19 gustafn Exp $ + +use strict; +use utf8; +use Encode; +use Text::Aspell; +use XML::DOM; +use CGI; + +my $TIMER_start = undef; +eval { + use Time::HiRes qw( gettimeofday tv_interval ); + $TIMER_start = [gettimeofday()]; +}; +# use POSIX qw( locale_h ); + +binmode STDIN, ':utf8'; +binmode STDOUT, ':utf8'; + +my $debug = 0; + +my $speller = new Text::Aspell; +my $cgi = new CGI; + +my $total_words = 0; +my $total_mispelled = 0; +my $total_suggestions = 0; +my $total_words_suggested = 0; + +# FIXME: report a nice error... +die "Can't create speller!" unless $speller; + +my $dict = $cgi->param('dictionary') || $cgi->cookie('dictionary') || 'en'; + +# add configurable option for this +$speller->set_option('lang', $dict); +$speller->set_option('encoding', 'UTF-8'); +#setlocale(LC_CTYPE, $dict); + +# ultra, fast, normal, bad-spellers +# bad-spellers seems to cause segmentation fault +$speller->set_option('sug-mode', 'normal'); + +my %suggested_words = (); +keys %suggested_words = 128; + +my $file_content = decode('UTF-8', $cgi->param('content')); +$file_content = parse_with_dom($file_content); + +my $ck_dictionary = $cgi->cookie(-name => 'dictionary', + -value => $dict, + -expires => '+30d'); + +print $cgi->header(-type => 'text/html; charset: utf-8', + -cookie => $ck_dictionary); + +my $js_suggested_words = make_js_hash(\%suggested_words); +my $js_spellcheck_info = make_js_hash_from_array + ([ + [ 'Total words' , $total_words ], + [ 'Mispelled words' , $total_mispelled . ' in dictionary \"'.$dict.'\"' ], + [ 'Total suggestions' , $total_suggestions ], + [ 'Total words suggested' , $total_words_suggested ], + [ 'Spell-checked in' , defined $TIMER_start ? (tv_interval($TIMER_start) . ' seconds') : 'n/a' ] + ]); + +print qq^ + + + + + + +^; + +print $file_content; +if ($cgi->param('init') eq '1') { + my @dicts = $speller->dictionary_info(); + my $dictionaries = ''; + foreach my $i (@dicts) { + next if $i->{jargon}; + my $name = $i->{name}; + if ($name eq $dict) { + $name = '@'.$name; + } + $dictionaries .= ',' . $name; + } + $dictionaries =~ s/^,//; + print qq^
    $dictionaries
    ^; +} + +print ''; + +# Perl is beautiful. +sub spellcheck { + my $node = shift; + my $doc = $node->getOwnerDocument; + my $check = sub { # called for each word in the text + # input is in UTF-8 + my $word = shift; + my $already_suggested = defined $suggested_words{$word}; + ++$total_words; + if (!$already_suggested && $speller->check($word)) { + return undef; + } else { + # we should have suggestions; give them back to browser in UTF-8 + ++$total_mispelled; + if (!$already_suggested) { + # compute suggestions for this word + my @suggestions = $speller->suggest($word); + my $suggestions = decode($speller->get_option('encoding'), join(',', @suggestions)); + $suggested_words{$word} = $suggestions; + ++$total_suggestions; + $total_words_suggested += scalar @suggestions; + } + # HA-spellcheck-error + my $err = $doc->createElement('span'); + $err->setAttribute('class', 'HA-spellcheck-error'); + my $tmp = $doc->createTextNode; + $tmp->setNodeValue($word); + $err->appendChild($tmp); + return $err; + } + }; + while ($node->getNodeValue =~ /([\p{IsWord}']+)/) { + my $word = $1; + my $before = $`; + my $after = $'; + my $df = &$check($word); + if (!$df) { + $before .= $word; + } + { + my $parent = $node->getParentNode; + my $n1 = $doc->createTextNode; + $n1->setNodeValue($before); + $parent->insertBefore($n1, $node); + $parent->insertBefore($df, $node) if $df; + $node->setNodeValue($after); + } + } +}; + +sub check_inner_text { + my $node = shift; + my $text = ''; + for (my $i = $node->getFirstChild; defined $i; $i = $i->getNextSibling) { + if ($i->getNodeType == TEXT_NODE) { + spellcheck($i); + } + } +}; + +sub parse_with_dom { + my ($text) = @_; + $text = ''.$text.''; + + my $parser = new XML::DOM::Parser; + if ($debug) { + open(FOO, '>:utf8', '/tmp/foo'); + print FOO $text; + close FOO; + } + my $doc = $parser->parse($text); + my $nodes = $doc->getElementsByTagName('*'); + my $n = $nodes->getLength; + + for (my $i = 0; $i < $n; ++$i) { + my $node = $nodes->item($i); + if ($node->getNodeType == ELEMENT_NODE) { + check_inner_text($node); + } + } + + my $ret = $doc->toString; + $ret =~ s{(.*)}{$1}sg; + return $ret; +}; + +sub make_js_hash { + my ($hash) = @_; + my $js_hash = ''; + while (my ($key, $val) = each %$hash) { + $js_hash .= ',' if $js_hash; + $js_hash .= '"'.$key.'":"'.$val.'"'; + } + return $js_hash; +}; + +sub make_js_hash_from_array { + my ($array) = @_; + my $js_hash = ''; + foreach my $i (@$array) { + $js_hash .= ',' if $js_hash; + $js_hash .= '"'.$i->[0].'":"'.$i->[1].'"'; + } + return $js_hash; +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-logic.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-logic.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-logic.php 3 Jan 2016 20:52:20 -0000 1.1.2.1 @@ -0,0 +1,171 @@ + + + + +'; + +// Lets define some values outside the condition below, in case we have an empty +// document. +$textarray = array(); +$varlines = ''; + +echo ' +'; + +foreach ($textarray as $key=>$value) +{ + echo $value; +} + +$dictionaries = str_replace(chr(10),",", shell_exec($aspelldictionaries)); +if(ereg(",$",$dictionaries)) + $dictionaries = ereg_replace(",$","",$dictionaries); +echo '
    '.$dictionaries.'
    '; + +echo ''; +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-savedicts.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-savedicts.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-savedicts.php 3 Jan 2016 20:52:20 -0000 1.1.2.1 @@ -0,0 +1,38 @@ +&1'); + unlink($temptext); + } +?> \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-style.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-style.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-style.css 3 Jan 2016 20:52:20 -0000 1.1.2.1 @@ -0,0 +1,10 @@ +.HA-spellcheck-error { border-bottom: 1px dashed #f00; cursor: default; } +.HA-spellcheck-same { background-color: #cef; color: #000; } +.HA-spellcheck-hover { background-color: #433; color: white; } +.HA-spellcheck-fixed { border-bottom: 1px dashed #0b8; } +.HA-spellcheck-current { background-color: #9be; color: #000; } +.HA-spellcheck-suggestions { display: none; } + +#HA-spellcheck-dictionaries { display: none; } + +a:link, a:visited { color: #55e; } Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-ui.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-ui.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-ui.html 3 Jan 2016 20:52:21 -0000 1.1.2.1 @@ -0,0 +1,125 @@ + + + + + Spell Checker + + + + + + + + + +
    + + + + + + + + + + + + + +
    +
    Dictionary + + +
    + Please wait. Calling spell checker. +
    +
    + +
    +
    Original word
    +
    pliz weit ;-)
    +
    + +
    +
    Replace with
    +
    +
    +
    +
    + +
    +
    +
    Suggestions
    +
    + +
    +
    + +
    +
    + + +
    +
    +
    + + + + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-ui.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-ui.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-check-ui.js 3 Jan 2016 20:52:21 -0000 1.1.2.1 @@ -0,0 +1,454 @@ +// Spell Checker Plugin for HTMLArea-3.0 +// Sponsored by www.americanbible.org +// Implementation by Mihai Bazon, http://dynarch.com/mishoo/ +// +// (c) dynarch.com 2003. +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +// +// $Id: spell-check-ui.js,v 1.1.2.1 2016/01/03 20:52:21 gustafn Exp $ + +// internationalization file was already loaded in parent ;-) +var SpellChecker = window.opener.SpellChecker; + +var Xinha = window.opener.Xinha; + +var _editor_url = window.opener._editor_url; + +var is_ie = Xinha.is_ie; +var editor = SpellChecker.editor; +var frame = null; +var currentElement = null; +var wrongWords = null; +var modified = false; +var allWords = {}; +var fixedWords = []; +var suggested_words = {}; + +var to_p_dict = []; // List of words to add to personal dictionary. +var to_r_list = []; // List of words to add to replacement list. + +function _lc(string) { + return Xinha._lc(string, 'SpellChecker'); +} + +function makeCleanDoc(leaveFixed) { + // document.getElementById("status").innerHTML = 'Please wait: rendering valid HTML'; + var words = wrongWords.concat(fixedWords); + for (var i = words.length; --i >= 0;) { + var el = words[i]; + if (!(leaveFixed && /HA-spellcheck-fixed/.test(el.className))) { + if(el.firstChild) + el.parentNode.insertBefore(el.firstChild, el); + el.parentNode.removeChild(el); + } else + el.className = "HA-spellcheck-fixed"; + } + // we should use innerHTML here, but IE6's implementation fucks up the + // HTML to such extent that our poor Perl parser doesn't understand it + // anymore. + return Xinha.getHTML(frame.contentWindow.document.body, true, editor); +} + +function recheckClicked() { + document.getElementById("status").innerHTML = _lc("Please wait: changing dictionary to") + ': "' + document.getElementById("f_dictionary").value + '".'; + var field = document.getElementById("f_content"); + field.value = makeCleanDoc(true); + field.form.submit(); +} + +function saveClicked() { + if (modified) { + editor.setHTML(makeCleanDoc(false)); + } + + if(to_p_dict.length || to_r_list.length && editor.config.SpellChecker.backend == 'php') + { + var data = {}; + for(var i = 0;i < to_p_dict.length;i++) + { + data['to_p_dict[' + i + ']'] = to_p_dict[i]; + } + for(var i = 0;i < to_r_list.length;i++) + { + data['to_r_list[' + i + '][0]'] = to_r_list[i][0]; + data['to_r_list[' + i + '][1]'] = to_r_list[i][1]; + } + // var win = window; + window.opener.Xinha._postback(Xinha.getPluginDir("SpellChecker") + '/spell-check-savedicts.php', data); + window.close(); + } + else + { + window.close(); + } + return false; +} + +function cancelClicked() { + var ok = true; + if (modified) { + ok = confirm(_lc("This will drop changes and quit spell checker. Please confirm.")); + } + if (ok) { + window.close(); + } + return false; +} + +function replaceWord(el) { + var replacement = document.getElementById("v_replacement").value; + var this_word_modified = (el.innerHTML != replacement); + if (this_word_modified) + modified = true; + if (el) { + el.className = el.className.replace(/\s*HA-spellcheck-(hover|fixed)\s*/g, " "); + } + el.className += " HA-spellcheck-fixed"; + el.__msh_fixed = true; + if (!this_word_modified) { + return false; + } + to_r_list.push([el.innerHTML, replacement]); + el.innerHTML = replacement; +} + +function replaceClicked() { + replaceWord(currentElement); + var start = currentElement.__msh_id; + var index = start; + do { + ++index; + if (index == wrongWords.length) { + index = 0; + } + } while ((index != start) && wrongWords[index].__msh_fixed); + if (index == start) { + index = 0; + alert(_lc("Finished list of mispelled words")); + } + wrongWords[index].__msh_wordClicked(true); + return false; +} + +function revertClicked() { + document.getElementById("v_replacement").value = currentElement.__msh_origWord; + replaceWord(currentElement); + currentElement.className = "HA-spellcheck-error HA-spellcheck-current"; + return false; +} + +function replaceAllClicked() { + var replacement = document.getElementById("v_replacement").value; + var ok = true; + var spans = allWords[currentElement.__msh_origWord]; + if (spans.length == 0) { + alert("An impossible condition just happened. Call FBI. ;-)"); + } else if (spans.length == 1) { + replaceClicked(); + return false; + } + /* + var message = "The word \"" + currentElement.__msh_origWord + "\" occurs " + spans.length + " times.\n"; + if (replacement == currentElement.__msh_origWord) { + ok = confirm(message + "Ignore all occurrences?"); + } else { + ok = confirm(message + "Replace all occurrences with \"" + replacement + "\"?"); + } + */ + if (ok) { + for (var i = 0; i < spans.length; ++i) { + if (spans[i] != currentElement) { + replaceWord(spans[i]); + } + } + // replace current element the last, so that we jump to the next word ;-) + replaceClicked(); + } + return false; +} + +function ignoreClicked() { + document.getElementById("v_replacement").value = currentElement.__msh_origWord; + replaceClicked(); + return false; +} + +function ignoreAllClicked() { + document.getElementById("v_replacement").value = currentElement.__msh_origWord; + replaceAllClicked(); + return false; +} + +function learnClicked() { + to_p_dict.push(currentElement.__msh_origWord); + return ignoreAllClicked(); +} + +function internationalizeWindow() { + var types = ["div", "span", "button"]; + for (var i = 0; i < types.length; ++i) { + var tag = types[i]; + var els = document.getElementsByTagName(tag); + for (var j = els.length; --j >= 0;) { + var el = els[j]; + if (el.childNodes.length == 1 && /\S/.test(el.innerHTML)) { + var txt = el.innerHTML; + el.innerHTML = _lc(txt); + } + } + } +} + +function initDocument() { + internationalizeWindow(); + modified = false; + frame = document.getElementById("i_framecontent"); + var field = document.getElementById("f_content"); + field.value = Xinha.getHTML(editor._doc.body, false, editor); + var dict = document.getElementById("f_dictionary"); + if(typeof editor.config.SpellChecker.defaultDictionary != "undefined" + && editor.config.SpellChecker.defaultDictionary != "") { + dict.value = editor.config.SpellChecker.defaultDictionary; + } else { + dict.value = "en_GB"; + } + if(editor.config.SpellChecker.backend == 'php') + { + field.form.action = Xinha.getPluginDir("SpellChecker") + '/spell-check-logic.php'; + } + if(editor.config.SpellChecker.utf8_to_entities) + { + document.getElementById('utf8_to_entities').value = 1; + } + else + { + document.getElementById('utf8_to_entities').value = 0; + } + field.form.submit(); + document.getElementById("f_init").value = "0"; + + // assign some global event handlers + + var select = document.getElementById("v_suggestions"); + select.onchange = function() { + document.getElementById("v_replacement").value = this.value; + }; + if (is_ie) { + select.attachEvent("ondblclick", replaceClicked); + } else { + select.addEventListener("dblclick", replaceClicked, true); + } + + document.getElementById("b_replace").onclick = replaceClicked; + if(editor.config.SpellChecker.backend == 'php') + { + document.getElementById("b_learn").onclick = learnClicked; + } + else + { + document.getElementById("b_learn").parentNode.removeChild(document.getElementById("b_learn")); + } + document.getElementById("b_replall").onclick = replaceAllClicked; + document.getElementById("b_ignore").onclick = ignoreClicked; + document.getElementById("b_ignall").onclick = ignoreAllClicked; + document.getElementById("b_recheck").onclick = recheckClicked; + document.getElementById("b_revert").onclick = revertClicked; + document.getElementById("b_info").onclick = displayInfo; + + document.getElementById("b_ok").onclick = saveClicked; + document.getElementById("b_cancel").onclick = cancelClicked; + + select = document.getElementById("v_dictionaries"); + select.onchange = function() { + document.getElementById("f_dictionary").value = this.value; + }; +} + +function getAbsolutePos(el) { + var r = { x: el.offsetLeft, y: el.offsetTop }; + if (el.offsetParent) { + var tmp = getAbsolutePos(el.offsetParent); + r.x += tmp.x; + r.y += tmp.y; + } + return r; +} + +function wordClicked(scroll) { + var self = this; + if (scroll) (function() { + var pos = getAbsolutePos(self); + var ws = { x: frame.offsetWidth - 4, + y: frame.offsetHeight - 4 }; + var wp = { x: frame.contentWindow.document.body.scrollLeft, + y: frame.contentWindow.document.body.scrollTop }; + pos.x -= Math.round(ws.x/2); + if (pos.x < 0) pos.x = 0; + pos.y -= Math.round(ws.y/2); + if (pos.y < 0) pos.y = 0; + frame.contentWindow.scrollTo(pos.x, pos.y); + })(); + if (currentElement) { + var a = allWords[currentElement.__msh_origWord]; + currentElement.className = currentElement.className.replace(/\s*HA-spellcheck-current\s*/g, " "); + for (var i = 0; i < a.length; ++i) { + var el = a[i]; + if (el != currentElement) { + el.className = el.className.replace(/\s*HA-spellcheck-same\s*/g, " "); + } + } + } + currentElement = this; + this.className += " HA-spellcheck-current"; + var a = allWords[currentElement.__msh_origWord]; + for (var i = 0; i < a.length; ++i) { + var el = a[i]; + if (el != currentElement) { + el.className += " HA-spellcheck-same"; + } + } + // document.getElementById("b_replall").disabled = (a.length <= 1); + // document.getElementById("b_ignall").disabled = (a.length <= 1); + var txt; + if (a.length == 1) { + txt = "one occurrence"; + } else if (a.length == 2) { + txt = "two occurrences"; + } else { + txt = a.length + " occurrences"; + } + var suggestions = suggested_words[this.__msh_origWord]; + if (suggestions) + suggestions = suggestions.split(/,/); + else + suggestions = []; + var select = document.getElementById("v_suggestions"); + document.getElementById("statusbar").innerHTML = "Found " + txt + + ' for word "' + currentElement.__msh_origWord + '"'; + for (var i = select.length; --i >= 0;) { + select.remove(i); + } + for (var i = 0; i < suggestions.length; ++i) { + var txt = suggestions[i]; + var option = document.createElement("option"); + option.value = txt; + option.appendChild(document.createTextNode(txt)); + select.appendChild(option); + } + document.getElementById("v_currentWord").innerHTML = this.__msh_origWord; + if (suggestions.length > 0) { + select.selectedIndex = 0; + select.onchange(); + } else { + document.getElementById("v_replacement").value = this.innerHTML; + } + select.style.display = "none"; + select.style.display = "block"; + return false; +} + +function wordMouseOver() { + this.className += " HA-spellcheck-hover"; +} + +function wordMouseOut() { + this.className = this.className.replace(/\s*HA-spellcheck-hover\s*/g, " "); +} + +function displayInfo() { + var info = frame.contentWindow.spellcheck_info; + if (!info) + alert("No information available"); + else { + var txt = "** Document information **"; + for (var i in info) { + txt += "\n" + i + " : " + info[i]; + } + alert(txt); + } + return false; +} + +function finishedSpellChecking() { + // initialization of global variables + currentElement = null; + wrongWords = null; + allWords = {}; + fixedWords = []; + suggested_words = frame.contentWindow.suggested_words; + + document.getElementById("status").innerHTML = "Xinha Spell Checker (info)"; + var doc = frame.contentWindow.document; + var spans = doc.getElementsByTagName("span"); + var sps = []; + var id = 0; + for (var i = 0; i < spans.length; ++i) { + var el = spans[i]; + if (/HA-spellcheck-error/.test(el.className)) { + sps.push(el); + el.__msh_wordClicked = wordClicked; + el.onclick = function(ev) { + ev || (ev = window.event); + ev && Xinha._stopEvent(ev); + return this.__msh_wordClicked(false); + }; + el.onmouseover = wordMouseOver; + el.onmouseout = wordMouseOut; + el.__msh_id = id++; + var txt = (el.__msh_origWord = el.firstChild.data); + el.__msh_fixed = false; + if (typeof allWords[txt] == "undefined") { + allWords[txt] = [el]; + } else { + allWords[txt].push(el); + } + } else if (/HA-spellcheck-fixed/.test(el.className)) { + fixedWords.push(el); + } + } + + var dicts = doc.getElementById("HA-spellcheck-dictionaries"); + if (dicts) { + dicts.parentNode.removeChild(dicts); + dicts = dicts.innerHTML.split(/,/); + var select = document.getElementById("v_dictionaries"); + for (var i = select.length; --i >= 0;) { + select.remove(i); + } + var activeDictionary = document.getElementById("f_dictionary").value; + for (var i = 0; i < dicts.length; ++i) { + var txt = dicts[i]; + var option = document.createElement("option"); + if(txt == activeDictionary) { + option.selected = true; + } + option.value = txt; + option.appendChild(document.createTextNode(txt)); + select.appendChild(option); + } + } + + wrongWords = sps; + if (sps.length == 0) { + if (!modified) { + alert(_lc("No mispelled words found with the selected dictionary.")); + // window.close(); + } else { + alert(_lc("No mispelled words found with the selected dictionary.")); + } + return false; + } + (currentElement = sps[0]).__msh_wordClicked(true); + var as = doc.getElementsByTagName("a"); + for (var i = as.length; --i >= 0;) { + var a = as[i]; + a.onclick = function() { + if (confirm(_lc("Please confirm that you want to open this link") + ":\n" + + this.href + "\n" + _lc("I will open it in a new page."))) { + window.open(this.href); + } + return false; + }; + } +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-checker.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-checker.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/spell-checker.js 3 Jan 2016 20:52:21 -0000 1.1.2.1 @@ -0,0 +1,38 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/SpellChecker/spell-checker.js */ +Xinha.Config.prototype.SpellChecker={"backend":"php","personalFilesDir":"","defaultDictionary":"en_GB","utf8_to_entities":true}; +function SpellChecker(_1){ +this.editor=_1; +var _2=_1.config; +var bl=SpellChecker.btnList; +var _4=this; +var id="SC-spell-check"; +_2.registerButton(id,this._lc("Spell-check"),_1.imgURL("spell-check.gif","SpellChecker"),false,function(_6,id){ +_4.buttonPress(_6,id); +}); +_2.addToolbarElement("SC-spell-check","htmlmode",1); +} +SpellChecker._pluginInfo={name:"SpellChecker",version:"1.0",developer:"Mihai Bazon",developer_url:"http://dynarch.com/mishoo/",c_owner:"Mihai Bazon",sponsor:"American Bible Society",sponsor_url:"http://www.americanbible.org",license:"htmlArea"}; +SpellChecker.prototype._lc=function(_8){ +return Xinha._lc(_8,"SpellChecker"); +}; +SpellChecker.btnList=[null,["spell-check"]]; +SpellChecker.prototype.buttonPress=function(_9,id){ +switch(id){ +case "SC-spell-check": +SpellChecker.editor=_9; +SpellChecker.init=true; +var _b=Xinha.getPluginDir("SpellChecker")+"/spell-check-ui.html"; +var _c; +if(Xinha.is_ie){ +_c=window.open(_b,"SC_spell_checker","toolbar=no,location=no,directories=no,status=no,menubar=no,"+"scrollbars=no,resizable=yes,width=600,height=450"); +}else{ +_c=window.open(_b,"SC_spell_checker","toolbar=no,menubar=no,personalbar=no,width=600,height=450,"+"scrollbars=no,resizable=yes"); +} +_c.focus(); +break; +} +}; +SpellChecker.editor=null; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/img/he-spell-check.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/img/he-spell-check.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/img/spell-check.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/img/spell-check.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/cz.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/cz.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/cz.js 3 Jan 2016 20:52:22 -0000 1.1.2.1 @@ -0,0 +1,26 @@ +// I18N constants +// LANG: "cz", ENCODING: UTF-8 +// Author: Jiri Löw, +{ + "Please confirm that you want to open this link": "Prosím potvrďte otevření tohoto odkazu", + "Cancel": "Zrušit", + "Dictionary": "Slovník", + "Finished list of mispelled words": "Dokončen seznam chybných slov", + "I will open it in a new page.": "Bude otevřen jej v nové stránce.", + "Ignore all": "Ignorovat vše", + "Ignore": "Ignorovat", + "No mispelled words found with the selected dictionary.": "Podle zvoleného slovníku nebyla nalezena žádná chybná slova.", + "Spell check complete, didn't find any mispelled words. Closing now...": "Kontrola správnosti slov dokončena, nebyla nalezena žádná chybná slova. Ukončování ...", + "OK": "OK", + "Original word": "Původní slovo", + "Please wait. Calling spell checker.": "Prosím čekejte. Komunikuace s kontrolou správnosti slov.", + "Please wait: changing dictionary to": "Prosím čekejte: změna adresáře na", + "This will drop changes and quit spell checker. Please confirm.": "Změny budou zrušeny a kontrola správnosti slov ukončena. Prosím potvrďte.", + "Re-check": "Překontrolovat", + "Replace all": "Zaměnit všechno", + "Replace with": "Zaměnit za", + "Replace": "Zaměnit", + "Spell-check": "Kontrola správnosti slov", + "Suggestions": "Doporučení", + "One moment...": "strpení prosím ;-)" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/da.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/da.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/da.js 3 Jan 2016 20:52:22 -0000 1.1.2.1 @@ -0,0 +1,26 @@ +// I18N constants +// LANG: "da", ENCODING: UTF-8 +// Author: Steen Sønderup, +{ + "Please confirm that you want to open this link": "Vil du følge dette link?", + "Cancel": "Ann uler", + "Dictionary": "Ordbog", + "Finished list of mispelled words": "Listen med stavefejl er gennemgået", + "I will open it in a new page.": "Jeg vil åbne det i en ny side.", + "Ignore all": "Ignorer alle", + "Ignore": "Ignorer", + "No mispelled words found with the selected dictionary.": "Der blev ikke fundet nogle stavefejl med den valgte ordbog.", + "Spell check complete, didn't find any mispelled words. Closing now...": "Stavekontrollen er gennemført, der blev ikke fundet nogle stavefejl. Lukker...", + "OK": "OK", + "Original word": "Oprindeligt ord", + "Please wait. Calling spell checker.": "Vent venligst. Henter stavekontrol.", + "Please wait: changing dictionary to": "Vent venligst: skifter ordbog til", + "This will drop changes and quit spell checker. Please confirm.": "Alle dine ændringer vil gå tabt, vil du fortsætte?", + "Re-check": "Tjek igen", + "Replace all": "Erstat alle", + "Replace with": "Erstat med", + "Replace": "Erstat", + "Spell-check": "Stavekontrol", + "Suggestions": "Forslag", + "One moment...": "Vent venligst" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/de.js 3 Jan 2016 20:52:23 -0000 1.1.2.1 @@ -0,0 +1,26 @@ +// I18N constants +// LANG: "en", ENCODING: UTF-8 +// Author: Broxx, +{ + "Please confirm that you want to open this link": "Wollen Sie diesen Link oeffnen", + "Cancel": "Abbrechen", + "Dictionary": "Woerterbuch", + "Finished list of mispelled words": "Liste der nicht bekannten Woerter", + "I will open it in a new page.": "Wird auf neuer Seite geoeffnet", + "Ignore all": "Alle ignorieren", + "Ignore": "Ignorieren", + "No mispelled words found with the selected dictionary.": "Keine falschen Woerter mit gewaehlten Woerterbuch gefunden", + "Spell check complete, didn't find any mispelled words. Closing now...": "Rechtsschreibpruefung wurde ohne Fehler fertiggestellt. Wird nun geschlossen...", + "OK": "OK", + "Original word": "Original Wort", + "Please wait. Calling spell checker.": "Bitte warten. Woerterbuch wird durchsucht.", + "Please wait: changing dictionary to": "Bitte warten: Woerterbuch wechseln zu", + "This will drop changes and quit spell checker. Please confirm.": "Aenderungen werden nicht uebernommen. Bitte bestaettigen.", + "Re-check": "Neuueberpruefung", + "Replace all": "Alle ersetzen", + "Replace with": "Ersetzen mit", + "Replace": "Ersetzen", + "Spell-check": "Ueberpruefung", + "Suggestions": "Vorschlag", + "One moment...": "Bitte warten..." +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/fr.js 3 Jan 2016 20:52:23 -0000 1.1.2.1 @@ -0,0 +1,26 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Please confirm that you want to open this link": "Veuillez confirmer l'ouverture de ce lien", + "Cancel": "Annuler", + "Dictionary": "Dictionnaire", + "Finished list of mispelled words": "Liste des mots mal orthographiés", + "I will open it in a new page.": "Ouverture dans une nouvelle fenêtre", + "Ignore all": "Tout ignorer", + "Ignore": "Ignorer", + "No mispelled words found with the selected dictionary.": "Aucune erreur orthographique avec le dictionnaire sélectionné.", + "Spell check complete, didn't find any mispelled words. Closing now...": "Vérification terminée, aucune erreur orthographique détectée. Fermeture en cours...", + "OK": "OK", + "Original word": "Mot original", + "Please wait. Calling spell checker.": "Veuillez patienter. Appel du correcteur.", + "Please wait: changing dictionary to": "Veuillez patienter. Changement du dictionnaire vers", + "This will drop changes and quit spell checker. Please confirm.": "Ceci fermera la fenêtre et annulera les modifications. Veuillez confirmer.", + "Re-check": "Vérifier encore", + "Replace all": "Tout remplacer", + "Replace with": "Remplacer par", + "Replace": "Remplacer", + "Revert": "Annuler", + "Spell-check": "Correction", + "Suggestions": "Suggestions", + "One moment...": "Veuillez patienter" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/he.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/he.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/he.js 3 Jan 2016 20:52:23 -0000 1.1.2.1 @@ -0,0 +1,27 @@ +// I18N constants +// LANG: "en", ENCODING: UTF-8 +// Author: Mihai Bazon, http://dynarch.com/mishoo +{ + "Please confirm that you want to open this link": "אנא אשר שברצונך לפתוח קישור זה", + "Cancel": "ביטול", + "Dictionary": "מילון", + "Finished list of mispelled words": "הסתיימה רשימת המילים המאויתות באופן שגוי", + "I will open it in a new page.": "אני אפתח את זה בחלון חדש.", + "Ignore all": "התעלם מהכל", + "Ignore": "התעלם", + "No mispelled words found with the selected dictionary.": "לא נמצאו מילים מאויתות באופן שגוי עם המילון הנבחר.", + "Spell check complete, didn't find any mispelled words. Closing now...": "בדיקת האיות נסתיימה, לא נמצאו מילים מאויתות באופן שגוי. נסגר כעת...", + "OK": "אישור", + "Original word": "המילה המקורית", + "Please wait. Calling spell checker.": "אנא המתן. קורא לבודק איות.", + "Please wait: changing dictionary to": "אנא המתן: מחליף מילון ל-", + "This will drop changes and quit spell checker. Please confirm.": "זה יבטל את השינויים ויצא מבודק האיות. אנא אשר.", + "Re-check": "בדוק מחדש", + "Replace all": "החלף הכל", + "Replace with": "החלף ב-", + "Replace": "החלף", + "Revert": "החזר שינויים", + "Spell-check": "בדיקת איות", + "Suggestions": "הצעות", + "One moment...": "ענא המטן ;-)" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/hu.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/hu.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/hu.js 3 Jan 2016 20:52:23 -0000 1.1.2.1 @@ -0,0 +1,26 @@ +// I18N constants +// LANG: "hu", ENCODING: UTF-8 +// Author: Miklós Somogyi, +{ + "Please confirm that you want to open this link": "Megerősítés", + "Cancel": "Mégsem", + "Dictionary": "Szótár", + "Finished list of mispelled words": "A tévesztett szavak listájának vége", + "I will open it in a new page.": "Megnyitás új lapon", + "Ignore all": "Minden elvetése", + "Ignore": "Elvetés", + "No mispelled words found with the selected dictionary.": "A választott szótár szerint nincs tévesztett szó.", + "Spell check complete, didn't find any mispelled words. Closing now...": "A helyesírásellenőrzés kész, tévesztett szó nem fordult elő. Bezárás...", + "OK": "Rendben", + "Original word": "Eredeti szó", + "Please wait. Calling spell checker.": "Kis türelmet, a helyesírásellenőrző hívása folyamatban.", + "Please wait: changing dictionary to": "Kis türelmet, szótár cseréje", + "This will drop changes and quit spell checker. Please confirm.": "Kilépés a változások eldobásával. Jóváhagyja?", + "Re-check": "Újraellenőrzés", + "Replace all": "Mind cseréje", + "Replace with": "Csere a következőre:", + "Replace": "Csere", + "Spell-check": "Helyesírásellenőrzés", + "Suggestions": "Tippek", + "One moment...": "Kis türelmet ;-)" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/ja.js 3 Jan 2016 20:52:23 -0000 1.1.2.1 @@ -0,0 +1,28 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Please confirm that you want to open this link": "本当にこのリンクを開きますか", + "Cancel": "中止", + "Dictionary": "辞書", + "Finished list of mispelled words": "つづり間違単語の一覧", + "I will open it in a new page.": "新しいページで開きます。", + "Ignore all": "すべて無視", + "Ignore": "無視", + "No mispelled words found with the selected dictionary.": "選択された辞書にはつづり間違い単語がありません。", + "Spell check complete, didn't find any mispelled words. Closing now...": "スペルチェックが完了しましたが、つづり間違い単語はありませんでした。すぐに閉じます...", + "OK": "OK", + "Original word": "元の単語", + "Please wait. Calling spell checker.": "しばらくお待ちください。スペルチェッカーを呼び出しています。", + "Please wait: changing dictionary to": "しばらくお待ちください: 辞書を切り替えています", + "This will drop changes and quit spell checker. Please confirm.": "変更を破棄してスペルチェッカーを終了します。よろしいいですか。", + "Re-check": "再チェック", + "Replace all": "すべて置換", + "Replace with": "これに置換", + "Replace": "置換", + "Revert": "戻す", + "Spell-check": "スペルチェック", + "Suggestions": "候補", + "One moment...": "あともう少し...", + "Info": "情報", + "Learn": "学習" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/nb.js 3 Jan 2016 20:52:24 -0000 1.1.2.1 @@ -0,0 +1,26 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Please confirm that you want to open this link": "Ønsker du å åpne denne lenken", + "Cancel": "Avbryt", + "Dictionary": "Ordliste", + "Finished list of mispelled words": "Ferdig med liste over feilstavede ord", + "I will open it in a new page.": "Åpnes i ny side", + "Ignore all": "Ignorer alle", + "Ignore": "Ignorer", + "No mispelled words found with the selected dictionary.": "Ingen feilstavede ord funnet med den valgte ordlisten", + "Spell check complete, didn't find any mispelled words. Closing now...": "Stavekontroll fullført, ingen feilstavede ord ble funnet, stavekontroll avsluttes.", + "OK": "OK", + "Original word": "Opprinnelig ord", + "Please wait. Calling spell checker.": "Vennligst vent, kaller opp stavekontrollprogrammet", + "Please wait: changing dictionary to": "Vennligst vent, endrer ordliste til", + "This will drop changes and quit spell checker. Please confirm.": "Dette vil droppe endringene og avbryte stavekontrollen, vennligst bekreft.", + "Re-check": "Kjør stavekontroll på nytt", + "Replace all": "Erstatt alle", + "Replace with": "Erstatt med", + "Replace": "Erstatt", + "Spell-check": "Stavekontroll", + "Suggestions": "Forslag", + "One moment...": "Et øyeblikk..." +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/nl.js 3 Jan 2016 20:52:24 -0000 1.1.2.1 @@ -0,0 +1,27 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: A.H van den Broek http://www.kontaktfm.nl, tonbroek@kontaktfm.nl +{ + "Please confirm that you want to open this link": "Weet u zeker dat u deze link wilt openen?", + "Cancel": "Annuleer", + "Dictionary": "Woordenboek", + "Finished list of mispelled words": "klaar met de lijst van fouten woorden", + "I will open it in a new page.": "Ik zal het in een nieuwe pagina openen.", + "Ignore all": "alles overslaan", + "Ignore": "Overslaan", + "No mispelled words found with the selected dictionary.": "Geen fouten gevonden met dit woordenboek.", + "Spell check complete, didn't find any mispelled words. Closing now...": "Spell checking is klaar, geen fouten gevonden. spell checking word gesloten...", + "OK": "OK", + "Original word": "Originele woord", + "Please wait. Calling spell checker.": "Even wachten. spell checker wordt geladen.", + "Please wait: changing dictionary to": "even wachten: woordenboek wordt veranderd naar", + "This will drop changes and quit spell checker. Please confirm.": "Dit zal alle veranderingen annuleren en de spell checker sluiten. Weet u het zeker?", + "Re-check": "Opnieuw", + "Replace all": "Alles vervangen", + "Replace with": "Vervangen met", + "Replace": "Vervangen", + "Revert": "Omkeren", + "Spell-check": "Spell-check", + "Suggestions": "Suggestie", + "One moment...": "Even wachten ;-)" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/no.js 3 Jan 2016 20:52:24 -0000 1.1.2.1 @@ -0,0 +1,26 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Please confirm that you want to open this link": "Ønsker du å åpne denne lenken", + "Cancel": "Avbryt", + "Dictionary": "Ordliste", + "Finished list of mispelled words": "Ferdig med liste over feilstavede ord", + "I will open it in a new page.": "Åpnes i ny side", + "Ignore all": "Ignorer alle", + "Ignore": "Ignorer", + "No mispelled words found with the selected dictionary.": "Ingen feilstavede ord funnet med den valgte ordlisten", + "Spell check complete, didn't find any mispelled words. Closing now...": "Stavekontroll fullført, ingen feilstavede ord ble funnet, stavekontroll avsluttes.", + "OK": "OK", + "Original word": "Opprinnelig ord", + "Please wait. Calling spell checker.": "Vennligst vent, kaller opp stavekontrollprogrammet", + "Please wait: changing dictionary to": "Vennligst vent, endrer ordliste til", + "This will drop changes and quit spell checker. Please confirm.": "Dette vil droppe endringene og avbryte stavekontrollen, vennligst bekreft.", + "Re-check": "Kjør stavekontroll på nytt", + "Replace all": "Erstatt alle", + "Replace with": "Erstatt med", + "Replace": "Erstatt", + "Spell-check": "Stavekontroll", + "Suggestions": "Forslag", + "One moment...": "Et øyeblikk..." +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/pt_br.js 3 Jan 2016 20:52:24 -0000 1.1.2.1 @@ -0,0 +1,44 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +{ + "Cancel": "Cancelar", + "Dictionary": "Dicionário", + "Finished list of mispelled words": "Finalizada lista de palavras desconhecidas", + "HTMLArea Spell Checker": "Dicionário HTMLArea", + "I will open it in a new page.": "Será aberto em uma nova página", + "Ignore": "Ignorar", + "Ignore all": "Ignorar todas", + "Info": "Informação", + "Learn": "Aprender", + "No mispelled words found with the selected dictionary.": "Nenhuma palavra desconhecida foi encontrada no dicionário selecionado", + "OK": "OK", + "Original word": "Palavra Original", + "Please confirm that you want to open this link": "Por favor, confirme se deseja abrir este link", + "Please wait. Calling spell checker.": "Por favor, aguarde. Chamando dicionário.", + "Please wait: changing dictionary to": "Por favor, aguarde: mudando dicionário para", + "Re-check": "Re-verificar", + "Replace": "Substituir", + "Replace all": "Substituir tudo", + "Replace with": "Substituir com", + "Revert": "Reverter", + "Spell Checker": "Dicionário", + "Spell-check": "Dicionário", + "Suggestions": "Sugestões", + "This will drop changes and quit spell checker. Please confirm.": "Isso desfará as mudanças e finalizará o dicionário. Por favor, confirme.", + "pliz weit ;-)": "Por favor, aguarde...", + "One moment...": "Um momento..." +} Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/ro.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/ro.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SpellChecker/lang/ro.js 3 Jan 2016 20:52:24 -0000 1.1.2.1 @@ -0,0 +1,26 @@ +// I18N constants +// LANG: "ro", ENCODING: UTF-8 +// Author: Mihai Bazon, http://dynarch.com/mishoo +{ + "Please confirm that you want to open this link": "Vă rog confirmaţi că vreţi să deschideţi acest link", + "Cancel": "Anulează", + "Dictionary": "Dicţionar", + "Finished list of mispelled words": "Am terminat lista de cuvinte greşite", + "I will open it in a new page.": "O voi deschide într-o altă fereastră.", + "Ignore all": "Ignoră toate", + "Ignore": "Ignoră", + "No mispelled words found with the selected dictionary.": "Nu am găsit nici un cuvânt greşit cu acest dicţionar.", + "Spell check complete, didn't find any mispelled words. Closing now...": "Am terminat, nu am detectat nici o greşeală. Acum închid fereastra...", + "OK": "OK", + "Original word": "Cuvântul original", + "Please wait. Calling spell checker.": "Vă rog aşteptaţi. Apelez spell-checker-ul.", + "Please wait: changing dictionary to": "Vă rog aşteptaţi. Schimb dicţionarul cu", + "This will drop changes and quit spell checker. Please confirm.": "Doriţi să renunţaţi la modificări şi să închid spell-checker-ul?", + "Re-check": "Scanează", + "Replace all": "Înlocuieşte toate", + "Replace with": "Înlocuieşte cu", + "Replace": "Înlocuieşte", + "Spell-check": "Detectează greşeli", + "Suggestions": "Sugestii", + "One moment...": "va rog ashteptatzi ;-)" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/Stylist.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/Stylist.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/Stylist.js 3 Jan 2016 20:52:25 -0000 1.1.2.1 @@ -0,0 +1,709 @@ +/** + * Add an empty css_style to Config object's prototype + * the format is { '.className' : 'Description' } + */ + +Xinha.Config.prototype.css_style = { }; + +/** + * This method loads an external stylesheet and uses it in the stylist + * + * @param string URL to the stylesheet + * @param hash Alternate descriptive names for your classes + * { '.fooclass': 'Foo Description' } + * @param bool If set true then @import rules in the stylesheet are skipped, + * otherwise they will be incorporated if possible. + */ + +Xinha.Config.prototype.stylistLoadStylesheet = function(url, altnames, skip_imports) +{ + if(!altnames) altnames = { }; + var newStyles = Xinha.ripStylesFromCSSFile(url, skip_imports); + for(var i in newStyles) + { + if(altnames[i]) + { + this.css_style[i] = altnames[i]; + } + else + { + this.css_style[i] = newStyles[i]; + } + } + + for(var x = 0; x < this.pageStyleSheets.length; x++) + { + if(this.pageStyleSheets[x] == url) return; + } + this.pageStyleSheets[this.pageStyleSheets.length] = url; +}; + +/** + * This method takes raw style definitions and uses them in the stylist + * + * @param string CSS + * + * @param hash Alternate descriptive names for your classes + * { '.fooclass': 'Foo Description' } + * + * @param bool If set true then @import rules in the stylesheet are skipped, + * otherwise they will be incorporated if possible. + * + * @param string If skip_imports is false, this string should contain + * the "URL" of the stylesheet these styles came from (doesn't matter + * if it exists or not), it is used when resolving relative URLs etc. + * If not provided, it defaults to Xinha.css in the Xinha root. + */ + +Xinha.Config.prototype.stylistLoadStyles = function(styles, altnames, skip_imports, imports_relative_to) +{ + if(!altnames) altnames = { }; + var newStyles = Xinha.ripStylesFromCSSString(styles, skip_imports); + for(var i in newStyles) + { + if(altnames[i]) + { + this.css_style[i] = altnames[i]; + } + else + { + this.css_style[i] = newStyles[i]; + } + } + this.pageStyle += styles; +}; + + + +/** + * Fill the stylist panel with styles that may be applied to the current selection. Styles + * are supplied in the css_style property of the Xinha.Config object, which is in the format + * { '.className' : 'Description' } + * classes that are defined on a specific tag (eg 'a.email_link') are only shown in the panel + * when an element of that type is selected. + * classes that are defined with selectors/psuedoclasses (eg 'a.email_link:hover') are never + * shown (if you have an 'a.email_link' without the pseudoclass it will be shown of course) + * multiple classes (eg 'a.email_link.staff_member') are shown as a single class, and applied + * to the element as multiple classes (class="email_link staff_member") + * you may click a class name in the stylist panel to add it, and click again to remove it + * you may add multiple classes to any element + * spans will be added where no single _and_entire_ element is selected + */ +Xinha.prototype._fillStylist = function() +{ + if(!this.plugins.Stylist.instance.dialog) return false; + var main = this.plugins.Stylist.instance.dialog.main; + main.innerHTML = ''; + + var may_apply = true; + var sel = this._getSelection(); + + // What is applied + // var applied = this._getAncestorsClassNames(this._getSelection()); + + // Get an active element + var active_elem = this._activeElement(sel); + + for(var x in this.config.css_style) + { + var tag = null; + var className = x.trim(); + var applicable = true; + var apply_to = active_elem; + + if(applicable && /[^a-zA-Z0-9_.-]/.test(className)) + { + applicable = false; // Only basic classes are accepted, no selectors, etc.. presumed + // that if you have a.foo:visited you'll also have a.foo + // alert('complex'); + } + + if(className.indexOf('.') < 0) + { + // No class name, just redefines a tag + applicable = false; + } + + if(applicable && (className.indexOf('.') > 0)) + { + // requires specific html tag + tag = className.substring(0, className.indexOf('.')).toLowerCase(); + className = className.substring(className.indexOf('.'), className.length); + + // To apply we must have an ancestor tag that is the right type + if(active_elem != null && active_elem.tagName.toLowerCase() == tag) + { + applicable = true; + apply_to = active_elem; + } + else + { + if(this._getFirstAncestor(this._getSelection(), [tag]) != null) + { + applicable = true; + apply_to = this._getFirstAncestor(this._getSelection(), [tag]); + } + else + { + // alert (this._getFirstAncestor(this._getSelection(), tag)); + // If we don't have an ancestor, but it's a div/span/p/hx stle, we can make one + if(( tag == 'div' || tag == 'span' || tag == 'p' + || (tag.substr(0,1) == 'h' && tag.length == 2 && tag != 'hr'))) + { + if(!this._selectionEmpty(this._getSelection())) + { + applicable = true; + apply_to = 'new'; + } + else + { + // See if we can get a paragraph or header that can be converted + apply_to = this._getFirstAncestor(sel, ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'h7']); + if(apply_to != null) + { + applicable = true; + } + else + { + applicable = false; + } + } + } + else + { + applicable = false; + } + } + } + } + + if(applicable) + { + // Remove the first . + className = className.substring(className.indexOf('.'), className.length); + + // Replace any futher ones with spaces (for multiple class definitions) + className = className.replace('.', ' '); + + if(apply_to == null) + { + if(this._selectionEmpty(this._getSelection())) + { + // Get the previous element and apply to that + apply_to = this._getFirstAncestor(this._getSelection(), null); + } + else + { + apply_to = 'new'; + tag = 'span'; + } + } + } + + var applied = (this._ancestorsWithClasses(sel, tag, className).length > 0 ? true : false); + var applied_to = this._ancestorsWithClasses(sel, tag, className); + + if(applicable) + { + var anch = document.createElement('a'); + anch.onfocus = function () { this.blur() } // prevent dotted line around link that causes horizontal scrollbar + anch._stylist_className = className.trim(); + anch._stylist_applied = applied; + anch._stylist_appliedTo = applied_to; + anch._stylist_applyTo = apply_to; + anch._stylist_applyTag = tag; + + anch.innerHTML = this.config.css_style[x]; + anch.href = 'javascript:void(0)'; + var editor = this; + anch.onclick = function() + { + if(this._stylist_applied == true) + { + editor._stylistRemoveClasses(this._stylist_className, this._stylist_appliedTo); + } + else + { + editor._stylistAddClasses(this._stylist_applyTo, this._stylist_applyTag, this._stylist_className); + } + return false; + } + + anch.style.display = 'block'; + anch.style.paddingLeft = '3px'; + anch.style.paddingTop = '1px'; + anch.style.paddingBottom = '1px'; + anch.style.textDecoration = 'none'; + + if(applied) + { + anch.style.background = 'Highlight'; + anch.style.color = 'HighlightText'; + } + anch.style.position = 'relative'; + main.appendChild(anch); + } + } +}; + + +/** + * Add the given classes (space seperated list) to the currently selected element + * (will add a span if none selected) + */ +Xinha.prototype._stylistAddClasses = function(el, tag, classes) + { + if(el == 'new') + { + this.insertHTML('<' + tag + ' class="' + classes + '">' + this.getSelectedHTML() + ''); + } + else + { + if(tag != null && el.tagName.toLowerCase() != tag) + { + // Have to change the tag! + var new_el = this.switchElementTag(el, tag); + + if(typeof el._stylist_usedToBe != 'undefined') + { + new_el._stylist_usedToBe = el._stylist_usedToBe; + new_el._stylist_usedToBe[new_el._stylist_usedToBe.length] = {'tagName' : el.tagName, 'className' : el.getAttribute('class')}; + } + else + { + new_el._stylist_usedToBe = [{'tagName' : el.tagName, 'className' : el.getAttribute('class')}]; + } + + Xinha.addClasses(new_el, classes); + } + else + { + Xinha._addClasses(el, classes); + } + } + this.focusEditor(); + this.updateToolbar(); + }; + +/** + * Remove the given classes (space seperated list) from the given elements (array of elements) + */ +Xinha.prototype._stylistRemoveClasses = function(classes, from) + { + for(var x = 0; x < from.length; x++) + { + this._stylistRemoveClassesFull(from[x], classes); + } + this.focusEditor(); + this.updateToolbar(); + }; + +Xinha.prototype._stylistRemoveClassesFull = function(el, classes) +{ + if(el != null) + { + var thiers = el.className.trim().split(' '); + var new_thiers = [ ]; + var ours = classes.split(' '); + for(var x = 0; x < thiers.length; x++) + { + var exists = false; + for(var i = 0; exists == false && i < ours.length; i++) + { + if(ours[i] == thiers[x]) + { + exists = true; + } + } + if(exists == false) + { + new_thiers[new_thiers.length] = thiers[x]; + } + } + + if(new_thiers.length == 0 && el._stylist_usedToBe && el._stylist_usedToBe.length > 0 && el._stylist_usedToBe[el._stylist_usedToBe.length - 1].className != null) + { + // Revert back to what we were IF the classes are identical + var last_el = el._stylist_usedToBe[el._stylist_usedToBe.length - 1]; + var last_classes = Xinha.arrayFilter(last_el.className.trim().split(' '), function(c) { if (c == null || c.trim() == '') { return false;} return true; }); + + if( + (new_thiers.length == 0) + || + ( + Xinha.arrayContainsArray(new_thiers, last_classes) + && Xinha.arrayContainsArray(last_classes, new_thiers) + ) + ) + { + el = this.switchElementTag(el, last_el.tagName); + new_thiers = last_classes; + } + else + { + // We can't rely on the remembered tags any more + el._stylist_usedToBe = [ ]; + } + } + + if( new_thiers.length > 0 + || el.tagName.toLowerCase() != 'span' + || (el.id && el.id != '') + ) + { + el.className = new_thiers.join(' ').trim(); + } + else + { + // Must be a span with no classes and no id, so we can splice it out + var prnt = el.parentNode; + var tmp; + while (el.hasChildNodes()) + { + if (el.firstChild.nodeType == 1) + { + // if el.firstChild is an element, we've got to recurse to make sure classes are + // removed from it and and any of its children. + this._stylistRemoveClassesFull(el.firstChild, classes); + } + tmp = el.removeChild(el.firstChild); + prnt.insertBefore(tmp, el); + } + prnt.removeChild(el); + } + } +}; + +/** + * Change the tag of an element + */ +Xinha.prototype.switchElementTag = function(el, tag) +{ + var prnt = el.parentNode; + var new_el = this._doc.createElement(tag); + + if(Xinha.is_ie || el.hasAttribute('id')) new_el.setAttribute('id', el.getAttribute('id')); + if(Xinha.is_ie || el.hasAttribute('style')) new_el.setAttribute('style', el.getAttribute('style')); + + var childs = el.childNodes; + for(var x = 0; x < childs.length; x++) + { + new_el.appendChild(childs[x].cloneNode(true)); + } + + prnt.insertBefore(new_el, el); + new_el._stylist_usedToBe = [el.tagName]; + prnt.removeChild(el); + this.selectNodeContents(new_el); + return new_el; +}; + +Xinha.prototype._getAncestorsClassNames = function(sel) +{ + // Scan upwards to find a block level element that we can change or apply to + var prnt = this._activeElement(sel); + if(prnt == null) + { + prnt = (Xinha.is_ie ? this._createRange(sel).parentElement() : this._createRange(sel).commonAncestorContainer); + } + + var classNames = [ ]; + while(prnt) + { + if(prnt.nodeType == 1) + { + var classes = prnt.className.trim().split(' '); + for(var x = 0; x < classes.length; x++) + { + classNames[classNames.length] = classes[x]; + } + + if(prnt.tagName.toLowerCase() == 'body') break; + if(prnt.tagName.toLowerCase() == 'table' ) break; + } + prnt = prnt.parentNode; + } + + return classNames; +}; + +Xinha.prototype._ancestorsWithClasses = function(sel, tag, classes) +{ + var ancestors = [ ]; + var prnt = this._activeElement(sel); + if(prnt == null) + { + try + { + prnt = (Xinha.is_ie ? this._createRange(sel).parentElement() : this._createRange(sel).commonAncestorContainer); + } + catch(e) + { + return ancestors; + } + } + var search_classes = classes.trim().split(' '); + + while(prnt) + { + if(prnt.nodeType == 1 && prnt.className) + { + if(tag == null || prnt.tagName.toLowerCase() == tag) + { + var classes = prnt.className.trim().split(' '); + var found_all = true; + for(var i = 0; i < search_classes.length; i++) + { + var found_class = false; + for(var x = 0; x < classes.length; x++) + { + if(search_classes[i] == classes[x]) + { + found_class = true; + break; + } + } + + if(!found_class) + { + found_all = false; + break; + } + } + + if(found_all) ancestors[ancestors.length] = prnt; + } + if(prnt.tagName.toLowerCase() == 'body') break; + if(prnt.tagName.toLowerCase() == 'table' ) break; + } + prnt = prnt.parentNode; + } + + return ancestors; +}; + + +Xinha.ripStylesFromCSSFile = function(URL, skip_imports) +{ + var css = Xinha._geturlcontent(URL); + + return Xinha.ripStylesFromCSSString(css, skip_imports, URL); +}; + +Xinha.ripStylesFromCSSString = function(css, skip_imports, imports_relative_to) +{ + if(!skip_imports) + { + if(!imports_relative_to) + { + imports_relative_to = _editor_url + 'Xinha.css' + } + + var seen = { }; + + function resolve_imports(css, url) + { + seen[url] = true; // protects against infinite recursion + + var RE_atimport = '@import\\s*(url\\()?["\'](.*)["\'].*'; + var imports = css.match(new RegExp(RE_atimport,'ig')); + var m, file, re = new RegExp(RE_atimport,'i'); + + if (imports) + { + var path = url.replace(/\?.*$/,'').split("/"); + path.pop(); + path = path.join('/'); + for (var i=0;i 0) ? main.offsetHeight - args.panel.offsetHeight : 0) + 'px'; + dialog.rootElem.style.height = caption.offsetHeight + "px"; + editor.sizeEditor(); + break; + case 'hide': + stylist.resize(); + break; + } + } + ); + editor.notifyOn('before_resize', + function() + { + if (!dialog.attached) + { + return; + } + dialog.rootElem.style.height = caption.offsetHeight + "px"; + } + ); + editor.notifyOn('resize', + function() + { + if (!dialog.attached) + { + return; + } + stylist.resize(); + } + ); +} +Stylist.prototype.resize = function() +{ + var editor = this.editor; + var rootElem = this.dialog.rootElem; + + if (rootElem.style.display == 'none') return; + + var panelContainer = rootElem.parentNode; + + var newSize = panelContainer.offsetHeight; + for (var i=0; i < panelContainer.childNodes.length;++i) + { + if (panelContainer.childNodes[i] == rootElem || !panelContainer.childNodes[i].offsetHeight) + { + continue; + } + newSize -= panelContainer.childNodes[i].offsetHeight; + } + rootElem.style.height = newSize-5 + 'px'; + this.dialog.main.style.height = newSize - this.dialog.captionBar.offsetHeight -5 + 'px'; +} + +Stylist.prototype.onUpdateToolbar = function() +{ + if(this.dialog) + { + if(this._timeoutID) + { + window.clearTimeout(this._timeoutID); + } + + var e = this.editor; + this._timeoutID = window.setTimeout(function() { e._fillStylist(); }, 250); + } +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/de.js 3 Jan 2016 20:52:25 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// Author: Mihai Bazon, http://dynarch.com/mishoo +{ + "Styles": "Stile" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/fr.js 3 Jan 2016 20:52:25 -0000 1.1.2.1 @@ -0,0 +1,5 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Styles": "Styles" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/ja.js 3 Jan 2016 20:52:25 -0000 1.1.2.1 @@ -0,0 +1,5 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Styles": "スタイル" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/nb.js 3 Jan 2016 20:52:25 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Styles": "Stiler" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/nl.js 3 Jan 2016 20:52:26 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Styles": "Style" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/no.js 3 Jan 2016 20:52:26 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Styles": "Stiler" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/pl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/pl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/pl.js 3 Jan 2016 20:52:26 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +// I18N constants +// LANG: "pl", ENCODING: UTF-8 +// translated: Krzysztof Kotowicz koto@webworkers.pl +{ + "Styles": "Style" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/pt_br.js 3 Jan 2016 20:52:26 -0000 1.1.2.1 @@ -0,0 +1,18 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Styles": "Estilos" +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/ru.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/ru.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/Stylist/lang/ru.js 3 Jan 2016 20:52:26 -0000 1.1.2.1 @@ -0,0 +1,5 @@ +// I18N constants +// LANG: "ru", ENCODING: UTF-8 +{ + "Styles": "Стили" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/SuperClean.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/SuperClean.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/SuperClean.js 3 Jan 2016 20:52:27 -0000 1.1.2.1 @@ -0,0 +1,128 @@ +/** superClean combines HTMLTidy, Word Cleaning and font stripping into a single function + * it works a bit differently in how it asks for parameters */ + +function SuperClean(editor, args) +{ + this.editor = editor; + var superclean = this; + editor._superclean_on = false; + editor.config.registerButton('superclean', this._lc("Clean up HTML"), [_editor_url +'iconsets/Tango/ed_buttons_main.png',6,4], true, function(e, objname, obj) { superclean._superClean(null, obj); }); + + // See if we can find 'killword' and replace it with superclean + editor.config.addToolbarElement("superclean", "killword", 0); +} + +SuperClean._pluginInfo = +{ + name : "SuperClean", + version : "1.0", + developer: "James Sleeman, Niko Sams", + developer_url: "http://www.gogo.co.nz/", + c_owner : "Gogo Internet Services", + license : "htmlArea", + sponsor : "Gogo Internet Services", + sponsor_url : "http://www.gogo.co.nz/" +}; + +SuperClean.prototype._lc = function(string) { + return Xinha._lc(string, 'SuperClean'); +}; + +Xinha.Config.prototype.SuperClean = +{ + // set to the URL of a handler for html tidy, this handler + // (see tidy.php for an example) must that a single post variable + // "content" which contains the HTML to tidy, and return javascript like + // editor.setHTML('Tidied Html') + // it's called through XMLHTTPRequest + 'tidy_handler': Xinha.getPluginDir("SuperClean") + '/tidy.php', + + // set additional arguments needed for the tidy request + 'tidy_args' : {}, + + //avaliable filters (these are built-in filters) + // You can either use + // 'filter_name' : "Label/Description String" + // or 'filter_name' : {label: "Label", checked: true/false, filterFunction: function(html) { ... return html;} } + // filterFunction in the second format above is optional. + + 'filters': { 'tidy': Xinha._lc('General tidy up and correction of some problems.', 'SuperClean'), + 'word_clean': Xinha._lc('Clean bad HTML from Microsoft Word', 'SuperClean'), + 'remove_faces': Xinha._lc('Remove custom typefaces (font "styles").', 'SuperClean'), + 'remove_sizes': Xinha._lc('Remove custom font sizes.', 'SuperClean'), + 'remove_colors': Xinha._lc('Remove custom text colors.', 'SuperClean'), + 'remove_lang': Xinha._lc('Remove lang attributes.', 'SuperClean'), + 'remove_fancy_quotes': {label:Xinha._lc('Replace directional quote marks with non-directional quote marks.', 'SuperClean'), checked:false} + //additional custom filters (defined in plugins/SuperClean/filters/word.js) + //'paragraph': 'remove paragraphs'}, + //'word': 'exteded Word-Filter' }, + }, + //if false all filters are applied, if true a dialog asks what filters should be used + 'show_dialog': false +}; + +SuperClean.filterFunctions = { }; + + +SuperClean.prototype.onGenerateOnce = function() +{ + + if(this.editor.config.tidy_handler) + { + //for backwards compatibility + this.editor.config.SuperClean.tidy_handler = this.editor.config.tidy_handler; + this.editor.config.tidy_handler = null; + } + if(!this.editor.config.SuperClean.tidy_handler && this.editor.config.filters.tidy) { + //unset tidy-filter if no tidy_handler + this.editor.config.filters.tidy = null; + } + SuperClean.loadAssets(); + this.loadFilters(); +}; + +SuperClean.prototype.onUpdateToolbar = function() +{ + if (!(SuperClean.methodsReady && SuperClean.html)) + { + this.editor._toolbarObjects.superclean.state("enabled", false); + } + else this.onUpdateToolbar = null; +}; + +SuperClean.loadAssets = function() +{ + var self = SuperClean; + if (self.loading) return; + self.loading = true; + Xinha._getback(Xinha.getPluginDir("SuperClean") + '/pluginMethods.js', function(getback) { eval(getback); self.methodsReady = true; }); + Xinha._getback( Xinha.getPluginDir("SuperClean") + '/dialog.html', function(getback) { self.html = getback; } ); +}; + +SuperClean.prototype.loadFilters = function() +{ + var sc = this; + //load the filter-functions + for(var filter in this.editor.config.SuperClean.filters) + { + if (/^(remove_colors|remove_sizes|remove_faces|remove_lang|word_clean|remove_fancy_quotes|tidy)$/.test(filter)) continue; //skip built-in functions + + if(!SuperClean.filterFunctions[filter]) + { + var filtDetail = this.editor.config.SuperClean.filters[filter]; + if(typeof filtDetail.filterFunction != 'undefined') + { + SuperClean.filterFunctions[filter] = filterFunction; + } + else + { + Xinha._getback(Xinha.getPluginDir("SuperClean") + '/filters/'+filter+'.js', + function(func) { + eval('SuperClean.filterFunctions.'+filter+'='+func+';'); + sc.loadFilters(); + }); + } + return; + } + } +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/dialog.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/dialog.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/dialog.html 3 Jan 2016 20:52:27 -0000 1.1.2.1 @@ -0,0 +1,13 @@ +

    Clean up HTML

    +
    + Please select from the following cleaning options... + +
    + + + + +
    + + +
    \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/pluginMethods.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/pluginMethods.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/pluginMethods.js 3 Jan 2016 20:52:27 -0000 1.1.2.1 @@ -0,0 +1,275 @@ +SuperClean.prototype._superClean = function(opts, obj) +{ + if(this.editor.config.SuperClean.show_dialog && !this._dialog) + { + this._dialog = new SuperClean.Dialog(this); + } + var superclean = this; + + // Do the clean if we got options + var doOK = function() + { + superclean._dialog.dialog.getElementById("main").style.display = "none"; + superclean._dialog.dialog.getElementById("waiting").style.display = ""; + superclean._dialog.dialog.getElementById("buttons").style.display = "none"; + + var opts = superclean._dialog.dialog.getValues(); + var editor = superclean.editor; + + if(opts.word_clean) editor._wordClean(); + var D = editor.getEditorContent(); + + for(var filter in editor.config.SuperClean.filters) + { + if(filter=='tidy' || filter=='word_clean') continue; + if(opts[filter]) + { + D = SuperClean.filterFunctions[filter](D, editor); + } + } + + D = D.replace(/(style|class)="\s*"/gi, ''); + D = D.replace(/<(font|span)\s*>/gi, ''); + + editor.setEditorContent(D); + + if(opts.tidy) + { + var callback = function(javascriptResponse) + { + eval("var response = " + javascriptResponse); + switch (response.action) + { + case 'setHTML': + editor.setEditorContent(response.value); + superclean._dialog.hide(); + break; + case 'alert': + superclean._dialog.dialog.getElementById("buttons").style.display = ""; + superclean._dialog.dialog.getElementById("ok").style.display = "none"; + superclean._dialog.dialog.getElementById("waiting").style.display = "none"; + superclean._dialog.dialog.getElementById("alert").style.display = ""; + superclean._dialog.dialog.getElementById("alert").innerHTML = superclean._lc(response.value); + break; + default: // make the dialog go away if sth goes wrong, who knows... + superclean._dialog.hide(); + break; + } + } + + var args = editor.config.SuperClean.tidy_args; + if ( typeof args != 'object' ) + { + args = {}; + } + args['content'] = editor.getInnerHTML(); + + Xinha._postback(editor.config.SuperClean.tidy_handler, args, callback); + } + else + { + superclean._dialog.hide(); + } + return true; + } + + if(this.editor.config.SuperClean.show_dialog) + { + var inputs = {}; + this._dialog.show(inputs, doOK); + } + else + { + var editor = this.editor; + var html = editor.getEditorContent(); + for(var filter in editor.config.SuperClean.filters) + { + if(filter=='tidy') continue; //call tidy last + html = SuperClean.filterFunctions[filter](html, editor); + } + + html = html.replace(/(style|class)="\s*"/gi, ''); + html = html.replace(/<(font|span)\s*>/gi, ''); + + editor.setEditorContent(html); + + if(editor.config.SuperClean.filters.tidy) + { + SuperClean.filterFunctions.tidy(html, editor); + } + } +}; + +SuperClean.filterFunctions.remove_colors = function(D) +{ + D = D.replace(/color="?[^" >]*"?/gi, ''); + // { (stops jedit's fold breaking) + D = D.replace(/([^-])color:[^;}"']+;?/gi, '$1'); + return(D); +}; +SuperClean.filterFunctions.remove_sizes = function(D) +{ + D = D.replace(/size="?[^" >]*"?/gi, ''); + // { (stops jedit's fold breaking) + D = D.replace(/font-size:[^;}"']+;?/gi, ''); + return(D); +}; +SuperClean.filterFunctions.remove_faces = function(D) +{ + D = D.replace(/face="?[^" >]*"?/gi, ''); + // { (stops jedit's fold breaking) + D = D.replace(/font-family:[^;}"']+;?/gi, ''); + return(D); +}; +SuperClean.filterFunctions.remove_lang = function(D) +{ + D = D.replace(/lang="?[^" >]*"?/gi, ''); + return(D); +}; +SuperClean.filterFunctions.word_clean = function(html, editor) +{ + editor.setHTML(html); + editor._wordClean(); + return editor.getInnerHTML(); +}; + +SuperClean.filterFunctions.remove_fancy_quotes = function(D) +{ + D = D.replace(new RegExp(String.fromCharCode(8216),"g"),"'"); + D = D.replace(new RegExp(String.fromCharCode(8217),"g"),"'"); + D = D.replace(new RegExp(String.fromCharCode(8218),"g"),"'"); + D = D.replace(new RegExp(String.fromCharCode(8219),"g"),"'"); + D = D.replace(new RegExp(String.fromCharCode(8220),"g"),"\""); + D = D.replace(new RegExp(String.fromCharCode(8221),"g"),"\""); + D = D.replace(new RegExp(String.fromCharCode(8222),"g"),"\""); + D = D.replace(new RegExp(String.fromCharCode(8223),"g"),"\""); + return D; +}; + +SuperClean.filterFunctions.tidy = function(html, editor) +{ + var callback = function(javascriptResponse) + { + eval("var response = " + javascriptResponse); + switch (response.action) + { + case 'setHTML': + editor.setEditorContent(response.value); + break; + case 'alert': + alert(Xinha._lc(response.value, 'SuperClean')); + break; + } + } + + var args = editor.config.SuperClean.tidy_args; + if ( typeof args != 'object' ) + { + args = {}; + } + args['content'] = html; + + Xinha._postback(editor.config.SuperClean.tidy_handler, args, callback); +}; + + +SuperClean.Dialog = function (SuperClean) +{ + var lDialog = this; + this.Dialog_nxtid = 0; + this.SuperClean = SuperClean; + this.id = { }; // This will be filled below with a replace, nifty + + this.ready = false; + this.dialog = false; + + // load the dTree script + this._prepareDialog(); + +}; + +SuperClean.Dialog.prototype._prepareDialog = function() +{ + var lDialog = this; + var SuperClean = this.SuperClean; + + var html = window.SuperClean.html; + + var htmlFilters = ""; + for(var filter in this.SuperClean.editor.config.SuperClean.filters) + { + htmlFilters += "
    \n"; + var filtDetail = this.SuperClean.editor.config.SuperClean.filters[filter]; + if(typeof filtDetail.label == 'undefined') + { + htmlFilters += " \n"; + htmlFilters += " \n"; + } + else + { + htmlFilters += " \n"; + htmlFilters += " \n"; + } + htmlFilters += "
    \n"; + } + html = html.replace('', htmlFilters); + + + // Now we have everything we need, so we can build the dialog. + var dialog = this.dialog = new Xinha.Dialog(SuperClean.editor, html, 'SuperClean',{width:400}); + + this.ready = true; +}; + +SuperClean.Dialog.prototype._lc = SuperClean.prototype._lc; + +SuperClean.Dialog.prototype.show = function(inputs, ok, cancel) +{ + if(!this.ready) + { + var lDialog = this; + window.setTimeout(function() {lDialog.show(inputs,ok,cancel);},100); + return; + } + + // Connect the OK and Cancel buttons + var dialog = this.dialog; + var lDialog = this; + if(ok) + { + this.dialog.getElementById('ok').onclick = ok; + } + else + { + this.dialog.getElementById('ok').onclick = function() {lDialog.hide();}; + } + + if(cancel) + { + this.dialog.getElementById('cancel').onclick = cancel; + } + else + { + this.dialog.getElementById('cancel').onclick = function() { lDialog.hide()}; + } + + // Show the dialog + this.SuperClean.editor.disableToolbar(['fullscreen','SuperClean']); + + this.dialog.show(inputs); + + // Init the sizes + this.dialog.onresize(); +}; + +SuperClean.Dialog.prototype.hide = function() +{ + var ret = this.dialog.hide(); + this.SuperClean.editor.enableToolbar(); + this.dialog.getElementById("main").style.display = ""; + this.dialog.getElementById("buttons").style.display = ""; + this.dialog.getElementById("waiting").style.display = "none"; + this.dialog.getElementById("alert").style.display = "none"; + this.dialog.getElementById("ok").style.display = ""; + return ret; +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/super-clean.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/super-clean.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/super-clean.js 3 Jan 2016 20:52:27 -0000 1.1.2.1 @@ -0,0 +1,214 @@ +/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ +/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ +/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/SuperClean/super-clean.js */ +function SuperClean(_1,_2){ +this.editor=_1; +var _3=this; +_1._superclean_on=false; +_1.config.registerButton("superclean",this._lc("Clean up HTML"),_1.imgURL("ed_superclean.gif","SuperClean"),true,function(e,_5,_6){ +_3._superClean(null,_6); +}); +_1.config.addToolbarElement("superclean","killword",0); +} +SuperClean._pluginInfo={name:"SuperClean",version:"1.0",developer:"James Sleeman, Niko Sams",developer_url:"http://www.gogo.co.nz/",c_owner:"Gogo Internet Services",license:"htmlArea",sponsor:"Gogo Internet Services",sponsor_url:"http://www.gogo.co.nz/"}; +SuperClean.prototype._lc=function(_7){ +return Xinha._lc(_7,"SuperClean"); +}; +SuperClean.prototype._superClean=function(_8,_9){ +var _a=this; +var _b=function(){ +var _c=_a._dialog.hide(); +var _d=_a.editor; +if(_c.word_clean){ +_d._wordClean(); +} +var D=_d.getInnerHTML(); +for(var _f in _d.config.SuperClean.filters){ +if(_f=="tidy"||_f=="word_clean"){ +continue; +} +if(_c[_f]){ +D=SuperClean.filterFunctions[_f](D,_d); +} +} +D=D.replace(/(style|class)="\s*"/gi,""); +D=D.replace(/<(font|span)\s*>/gi,""); +_d.setHTML(D); +if(_c.tidy){ +var _10=function(_11){ +eval("var response = "+_11); +switch(response.action){ +case "setHTML": +_d.setHTML(response.value); +break; +case "alert": +alert(_a._lc(response.value)); +break; +} +}; +Xinha._postback(_d.config.SuperClean.tidy_handler,{"content":_d.getInnerHTML()},_10); +} +return true; +}; +if(this.editor.config.SuperClean.show_dialog){ +var _12={}; +this._dialog.show(_12,_b); +}else{ +var _13=this.editor; +var _14=_13.getInnerHTML(); +for(var _15 in _13.config.SuperClean.filters){ +if(_15=="tidy"){ +continue; +} +_14=SuperClean.filterFunctions[_15](_14,_13); +} +_14=_14.replace(/(style|class)="\s*"/gi,""); +_14=_14.replace(/<(font|span)\s*>/gi,""); +_13.setHTML(_14); +if(_13.config.SuperClean.filters.tidy){ +SuperClean.filterFunctions.tidy(_14,_13); +} +} +}; +Xinha.Config.prototype.SuperClean={"tidy_handler":Xinha.getPluginDir("SuperClean")+"/tidy.php","filters":{"tidy":Xinha._lc("General tidy up and correction of some problems.","SuperClean"),"word_clean":Xinha._lc("Clean bad HTML from Microsoft Word","SuperClean"),"remove_faces":Xinha._lc("Remove custom typefaces (font \"styles\").","SuperClean"),"remove_sizes":Xinha._lc("Remove custom font sizes.","SuperClean"),"remove_colors":Xinha._lc("Remove custom text colors.","SuperClean"),"remove_lang":Xinha._lc("Remove lang attributes.","SuperClean"),"remove_fancy_quotes":{label:Xinha._lc("Replace directional quote marks with non-directional quote marks.","SuperClean"),checked:false}},"show_dialog":true}; +SuperClean.filterFunctions={}; +SuperClean.filterFunctions.remove_colors=function(D){ +D=D.replace(/color="?[^" >]*"?/gi,""); +D=D.replace(/([^-])color:[^;}"']+;?/gi,"$1"); +return (D); +}; +SuperClean.filterFunctions.remove_sizes=function(D){ +D=D.replace(/size="?[^" >]*"?/gi,""); +D=D.replace(/font-size:[^;}"']+;?/gi,""); +return (D); +}; +SuperClean.filterFunctions.remove_faces=function(D){ +D=D.replace(/face="?[^" >]*"?/gi,""); +D=D.replace(/font-family:[^;}"']+;?/gi,""); +return (D); +}; +SuperClean.filterFunctions.remove_lang=function(D){ +D=D.replace(/lang="?[^" >]*"?/gi,""); +return (D); +}; +SuperClean.filterFunctions.word_clean=function(_1a,_1b){ +_1b.setHTML(_1a); +_1b._wordClean(); +return _1b.getInnerHTML(); +}; +SuperClean.filterFunctions.remove_fancy_quotes=function(D){ +D=D.replace(new RegExp(String.fromCharCode(8216),"g"),"'"); +D=D.replace(new RegExp(String.fromCharCode(8217),"g"),"'"); +D=D.replace(new RegExp(String.fromCharCode(8218),"g"),"'"); +D=D.replace(new RegExp(String.fromCharCode(8219),"g"),"'"); +D=D.replace(new RegExp(String.fromCharCode(8220),"g"),"\""); +D=D.replace(new RegExp(String.fromCharCode(8221),"g"),"\""); +D=D.replace(new RegExp(String.fromCharCode(8222),"g"),"\""); +D=D.replace(new RegExp(String.fromCharCode(8223),"g"),"\""); +return D; +}; +SuperClean.filterFunctions.tidy=function(_1d,_1e){ +Xinha._postback(_1e.config.SuperClean.tidy_handler,{"content":_1d},function(_1f){ +eval(_1f); +}); +}; +SuperClean.prototype.onGenerate=function(){ +if(this.editor.config.SuperClean.show_dialog&&!this._dialog){ +this._dialog=new SuperClean.Dialog(this); +} +if(this.editor.config.tidy_handler){ +this.editor.config.SuperClean.tidy_handler=this.editor.config.tidy_handler; +this.editor.config.tidy_handler=null; +} +if(!this.editor.config.SuperClean.tidy_handler&&this.editor.config.filters.tidy){ +this.editor.config.filters.tidy=null; +} +var sc=this; +for(var _21 in this.editor.config.SuperClean.filters){ +if(!SuperClean.filterFunctions[_21]){ +var _22=this.editor.config.SuperClean.filters[_21]; +if(typeof _22.filterFunction!="undefined"){ +SuperClean.filterFunctions[_21]=filterFunction; +}else{ +Xinha._getback(Xinha.getPluginDir("SuperClean")+"/filters/"+_21+".js",function(_23){ +eval("SuperClean.filterFunctions."+_21+"="+_23+";"); +sc.onGenerate(); +}); +} +return; +} +} +}; +SuperClean.Dialog=function(_24){ +var _25=this; +this.Dialog_nxtid=0; +this.SuperClean=_24; +this.id={}; +this.ready=false; +this.files=false; +this.html=false; +this.dialog=false; +this._prepareDialog(); +}; +SuperClean.Dialog.prototype._prepareDialog=function(){ +var _26=this; +var _27=this.SuperClean; +if(this.html==false){ +Xinha._getback(Xinha.getPluginDir("SuperClean")+"/dialog.html",function(txt){ +_26.html=txt; +_26._prepareDialog(); +}); +return; +} +var _29=""; +for(var _2a in this.SuperClean.editor.config.SuperClean.filters){ +_29+="
    \n"; +var _2b=this.SuperClean.editor.config.SuperClean.filters[_2a]; +if(typeof _2b.label=="undefined"){ +_29+=" \n"; +_29+=" \n"; +}else{ +_29+=" \n"; +_29+=" \n"; +} +_29+="
    \n"; +} +this.html=this.html.replace("",_29); +var _2c=this.html; +var _2d=this.dialog=new Xinha.Dialog(_27.editor,this.html,"SuperClean"); +this.ready=true; +}; +SuperClean.Dialog.prototype._lc=SuperClean.prototype._lc; +SuperClean.Dialog.prototype.show=function(_2e,ok,_30){ +if(!this.ready){ +var _31=this; +window.setTimeout(function(){ +_31.show(_2e,ok,_30); +},100); +return; +} +var _32=this.dialog; +var _31=this; +if(ok){ +this.dialog.getElementById("ok").onclick=ok; +}else{ +this.dialog.getElementById("ok").onclick=function(){ +_31.hide(); +}; +} +if(_30){ +this.dialog.getElementById("cancel").onclick=_30; +}else{ +this.dialog.getElementById("cancel").onclick=function(){ +_31.hide(); +}; +} +this.SuperClean.editor.disableToolbar(["fullscreen","SuperClean"]); +this.dialog.show(_2e); +this.dialog.onresize(); +}; +SuperClean.Dialog.prototype.hide=function(){ +this.SuperClean.editor.enableToolbar(); +return this.dialog.hide(); +}; + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/tidy.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/tidy.php,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/tidy.php 3 Jan 2016 20:52:27 -0000 1.1.2.1 @@ -0,0 +1,179 @@ +,{,},@,\n,\r"; + + if(!is_array($strings)) + { + $tr = array(); + foreach(explode(',', $strings) as $chr) + { + $tr[$chr] = sprintf('\x%02X', ord($chr)); + } + $strings = $tr; + } + + return strtr($string, $strings); + } + + // Any errors would screq up our javascript + error_reporting(0); + ini_set('display_errors', false); + + if(trim(@$_REQUEST['content'])) + { + // PHP's urldecode doesn't understand %uHHHH for unicode + $_REQUEST['content'] = preg_replace('/%u([a-f0-9]{4,4})/ei', 'utf8_chr(0x$1)', $_REQUEST['content']); + function utf8_chr($num) + { + if($num<128)return chr($num); + if($num<1024)return chr(($num>>6)+192).chr(($num&63)+128); + if($num<32768)return chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128); + if($num<2097152)return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128) .chr(($num&63)+128); + return ''; + } + ob_start(); + passthru("echo " . escapeshellarg($_REQUEST['content']) . " | tidy -q -i -u -wrap 9999 -utf8 -bare -asxhtml 2>/dev/null", $result); + $content = ob_get_contents(); + ob_end_clean(); + + if(strlen($content) < 4) + { + // Tidy on the local machine failed, try a post + $res_1 + = PostIt( + array + ( + '_function' => 'tidy', + '_html' => $_REQUEST['content'], + 'char-encoding' => 'utf8', + '_output' => 'warn', + 'indent' => 'auto', + 'wrap' => 9999, + 'break-before-br' => 'y', + 'bare' => 'n', + 'word-2000' => 'n', + 'drop-empty-paras' => 'y', + 'drop-font-tags' => 'n', + + ), + 'http://infohound.net/tidy/tidy.pl'); + + if(preg_match('/ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/filters/paragraph.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/filters/paragraph.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/filters/paragraph.js 3 Jan 2016 20:52:27 -0000 1.1.2.1 @@ -0,0 +1,6 @@ +function(html) { + html = html.replace(/<\s*p[^>]*>/gi, ''); + html = html.replace(/<\/\s*p\s*>/gi, ''); + html = html.trim(); + return html; +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/filters/word.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/filters/word.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/filters/word.js 3 Jan 2016 20:52:27 -0000 1.1.2.1 @@ -0,0 +1,53 @@ +function(html) { + // Remove HTML comments + html = html.replace(//gi, "" ); + html = html.replace(//gi, ''); + // Remove all HTML tags + html = html.replace(/<\/?\s*HTML[^>]*>/gi, "" ); + // Remove all BODY tags + html = html.replace(/<\/?\s*BODY[^>]*>/gi, "" ); + // Remove all META tags + html = html.replace(/<\/?\s*META[^>]*>/gi, "" ); + // Remove all SPAN tags + html = html.replace(/<\/?\s*SPAN[^>]*>/gi, "" ); + // Remove all FONT tags + html = html.replace(/<\/?\s*FONT[^>]*>/gi, ""); + // Remove all IFRAME tags. + html = html.replace(/<\/?\s*IFRAME[^>]*>/gi, ""); + // Remove all STYLE tags & content + html = html.replace(/<\/?\s*STYLE[^>]*>(.|[\n\r\t])*<\/\s*STYLE\s*>/gi, "" ); + // Remove all TITLE tags & content + html = html.replace(/<\s*TITLE[^>]*>(.|[\n\r\t])*<\/\s*TITLE\s*>/gi, "" ); + // Remove javascript + html = html.replace(/<\s*SCRIPT[^>]*>[^\0]*<\/\s*SCRIPT\s*>/gi, ""); + // Remove all HEAD tags & content + html = html.replace(/<\s*HEAD[^>]*>(.|[\n\r\t])*<\/\s*HEAD\s*>/gi, "" ); + // Remove Class attributes + html = html.replace(/<\s*(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ; + // Remove Style attributes + html = html.replace(/<\s*(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3") ; + // Remove Lang attributes + html = html.replace(/<\s*(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ; + // Remove XML elements and declarations + html = html.replace(/<\\?\?xml[^>]*>/gi, "") ; + // Remove Tags with XML namespace declarations: + html = html.replace(/<\/?\w+:[^>]*>/gi, "") ; + // Replace the   + html = html.replace(/ /, " " ); + + // Transform


    to
    + //html = html.replace(/<\s*p[^>]*>\s*<\s*br\s*\/>\s*<\/\s*p[^>]*>/gi, "
    "); + html = html.replace(/<\s*p[^>]*><\s*br\s*\/?>\s*<\/\s*p[^>]*>/gi, "
    "); + + // Remove

    + html = html.replace(/<\s*p[^>]*>/gi, ""); + + // Replace

    with
    + html = html.replace(/<\/\s*p[^>]*>/gi, "
    "); + + // Remove any
    at the end + html = html.replace(/(\s*
    \s*)*$/, ""); + + html = html.trim(); + return html; +} \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/img/ed_superclean.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/img/ed_superclean.gif,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/da.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/da.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/da.js 3 Jan 2016 20:52:28 -0000 1.1.2.1 @@ -0,0 +1,18 @@ +// I18N constants +// LANG: "da", ENCODING: UTF-8 +// Author: Bjarke M. Lauridsen, http://www.detailx.dk, detailx@gmail.com +{ + "Clean up HTML": "Rengør HTML", + "Please select from the following cleaning options...": "Vælg et eller flere af følgende rengøringsværktøjer...", + "General tidy up and correction of some problems.": "Generel oprydning og rettelse af diverse problemer.", + "Clean bad HTML from Microsoft Word": "Rengør uønsket HTML fra Microsoft Word", + "Remove custom typefaces (font \"styles\").": "Slet skriftsnit (font \"styles\").", + "Remove custom font sizes.": "Slet skriftstørrelser.", + "Remove custom text colors.": "Slet tekstfarver.", + "Remove lang attributes.": "Slet lang attributter.", + "Go": "Ok", + "Cancel": "Annuller", + "Tidy failed. Check your HTML for syntax errors.": "Tidy mislykkedes. Tjek din HTML for syntaksfejl.", + "Replace directional quote marks with non-directional quote marks.": "Erstat directional anførselstegn med ikke-directional anførselstegn", + "You don't have anything to tidy!": "Der er ikke noget at rengøre!" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/de.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/de.js 3 Jan 2016 20:52:28 -0000 1.1.2.1 @@ -0,0 +1,18 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// translated: Raimund Meyer xinha@ray-of-light.org +{ + "Clean up HTML": "HTML säubern", + "Please select from the following cleaning options...": "Bitte Optionen auswählen...", + "General tidy up and correction of some problems.": "Allgemeines aufräumen und Korrektur einiger Probleme.", + "Clean bad HTML from Microsoft Word": "Schlechtes HTML aus Microsoft Word aufräumen", + "Remove custom typefaces (font \"styles\").": "Schriftarten entfernen (font face).", + "Remove custom font sizes.": "Schriftgrößen entfernen (font size).", + "Remove custom text colors.": "Schriftfarben entfernen (font color).", + "Remove lang attributes.": "Sprachattribute entfernen.", + "Go": "Go", + "Cancel": "Abbrechen", + "Tidy failed. Check your HTML for syntax errors.": "Säubern fehlgeschlagen. Überprüfen Sie Ihren Code auf Fehler.", + "You don't have anything to tidy!": "Es gibt nichts zu säubern...!", + "Please stand by while cleaning in process..." : "Bitte warten Sie, während die Säuberung läuft..." +}; Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/fr.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/fr.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/fr.js 3 Jan 2016 20:52:28 -0000 1.1.2.1 @@ -0,0 +1,16 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Clean up HTML": "Nettoyer le code HTML", + "Please select from the following cleaning options...": "Veuillez sélectionner une option de nettoyage.", + "General tidy up and correction of some problems.": "Nettoyage générique et correction des problèmes mineurs.", + "Clean bad HTML from Microsoft Word": "Nettoyer les balises HTML de Microsoft Word", + "Remove custom typefaces (font \"styles\").": "Supprimer les polices personalisées (font \"styles\").", + "Remove custom font sizes.": "Supprimer les tailles de polices personnalisées.", + "Remove custom text colors.": "Supprimer les couleurs de texte personalisées.", + "Remove lang attributes.": "Supprimer les attributs de langue.", + "Go": "Commencer", + "Cancel": "Annuler", + "Tidy failed. Check your HTML for syntax errors.": "Tidy a échoué. Vérifier la syntaxe HTML.", + "You don't have anything to tidy!": "Rien à transmettre à tidy !" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/ja.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/ja.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/ja.js 3 Jan 2016 20:52:28 -0000 1.1.2.1 @@ -0,0 +1,18 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Clean up HTML": "HTMLのクリーンナップ", + "Please select from the following cleaning options...": "以下のクリーンナップオプションを選択してください...", + "General tidy up and correction of some problems.": "一般的な適正化といくつかの問題を修正します。", + "Clean bad HTML from Microsoft Word": "Microsoft Wordによる不正なHTMLの清潔化", + "Remove custom typefaces (font \"styles\").": "独自フォント名設定の除去 (font face)。", + "Remove custom font sizes.": "独自フォントサイズ設定の除去。", + "Remove custom text colors.": "独自文字色設定の除去。", + "Remove lang attributes.": "言語属性の除去。", + "Go": "実行", + "Cancel": "中止", + "Tidy failed. Check your HTML for syntax errors.": "適正化に失敗しました。HTMLの文法エラーを確認してください。", + "You don't have anything to tidy!": "適正化するものは何もありません!", + "Replace directional quote marks with non-directional quote marks.": "方向つき引用符を方向なし引用符に置換。", + "CANCEL": "中止" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/nb.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/nb.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/nb.js 3 Jan 2016 20:52:29 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Clean up HTML": "Vask HTML kode", + "Please select from the following cleaning options...": "Vennligst velg blandt de forskjellige mulighetene å vaske/ rydde i HTML koden", + "General tidy up and correction of some problems.": "Generell opprydding i HTML koden samt korrigering av typiske feil", + "Clean bad HTML from Microsoft Word": "Vask HTML kode for feil og problemer etter Microsoft Word", + "Remove custom typefaces (font \"styles\").": "Fjerne egendefinerte skrifttyper (font face)", + "Remove custom font sizes.": "Fjerne egendefinerte skriftstørrelser (font size)", + "Remove custom text colors.": "Fjerne egendefinerte skriftfarger (font color)", + "Remove lang attributes.": "Fjerne lang-attributter.", + "Go": "Utfør", + "Cancel": "Avbryt", + "Tidy failed. Check your HTML for syntax errors.": "Tidy (Programmet som retter HTML koden) feilet. Vennligst se over HTML koden for feil.", + "You don't have anything to tidy!": "Det finnes ingen HTML kode å vaske!" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/nl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/nl.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/nl.js 3 Jan 2016 20:52:29 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Clean up HTML": "HTML opschonen", + "Please select from the following cleaning options...": "Selecteer de gewenste opschoon opties...", + "General tidy up and correction of some problems.": "Algemeen opschonen en correctie", + "Clean bad HTML from Microsoft Word": "Overbodige/verkeerde HTML van Microsoft Word opschonen", + "Remove custom typefaces (font \"styles\").": "Verwijder aangepaste lettertypes (font face)", + "Remove custom font sizes.": "Verwijder aangepaste lettergroottes (font size)", + "Remove custom text colors.": "Verwijder aangepaste tekstkleuren (font color)", + "Remove lang attributes.": "Verwijder alle taal (lang) attributen.", + "Go": "Opschonen", + "Cancel": "Annuleren", + "Tidy failed. Check your HTML for syntax errors.": "Tidy mislukt. Controleer HTML op fouten.", + "You don't have anything to tidy!": "Er is niets om op te schonen!" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/no.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/no.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/no.js 3 Jan 2016 20:52:29 -0000 1.1.2.1 @@ -0,0 +1,17 @@ +// I18N constants +// LANG: "no", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Clean up HTML": "Vask HTML kode", + "Please select from the following cleaning options...": "Vennligst velg blandt de forskjellige mulighetene å vaske/ rydde i HTML koden", + "General tidy up and correction of some problems.": "Generell opprydding i HTML koden samt korrigering av typiske feil", + "Clean bad HTML from Microsoft Word": "Vask HTML kode for feil og problemer etter Microsoft Word", + "Remove custom typefaces (font \"styles\").": "Fjerne egendefinerte skrifttyper (font face)", + "Remove custom font sizes.": "Fjerne egendefinerte skriftstørrelser (font size)", + "Remove custom text colors.": "Fjerne egendefinerte skriftfarger (font color)", + "Remove lang attributes.": "Fjerne lang-attributter.", + "Go": "Utfør", + "Cancel": "Avbryt", + "Tidy failed. Check your HTML for syntax errors.": "Tidy (Programmet som retter HTML koden) feilet. Vennligst se over HTML koden for feil.", + "You don't have anything to tidy!": "Det finnes ingen HTML kode å vaske!" +}; \ No newline at end of file Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/pt_br.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/pt_br.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/SuperClean/lang/pt_br.js 3 Jan 2016 20:52:29 -0000 1.1.2.1 @@ -0,0 +1,33 @@ +// I18N constants +// +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation +// +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br +// +// Last revision: 06 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail +// +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + +{ + "Cancel": "", + "Clean bad HTML from Microsoft Word": "Limpar códigos mal formatados do Microsoft Word", + "Clean up HTML": "Limpar HTML", + "General tidy up and correction of some problems.": "Limpesa geral e correção de alguns problemas.", + "OK": "", + "Please select from the following cleaning options...": "Por favor, selecione uma das opções de limpesa...", + "Remove custom font sizes.": "Remover tamanho de fontes personalizados (font size).", + "Remove custom text colors.": "Remover cores de texto personalizados (font color).", + "Remove custom typefaces (font \"styles\").": "Remover tipos de letras personalizadas (font \"styles\").", + "Remove lang attributes.": "Remover atributos de idioma.", + "Replace directional quote marks with non-directional quote marks.": "", + // not find with lc_parse_strings.php + "Tidy failed. Check your HTML for syntax errors.": "Limpesa falhou. Verifique seu HTML por erros de sintaxe.", + "You don't have anything to tidy!": "Você não possui nada para limpar!" +} + Index: openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/TableOperations/TableOperations.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/TableOperations/TableOperations.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-xinha/www/resources/xinha-nightly/plugins/TableOperations/TableOperations.js 3 Jan 2016 20:52:29 -0000 1.1.2.1 @@ -0,0 +1,654 @@ +// Table Operations Plugin for HTMLArea-3.0 +// Implementation by Mihai Bazon. Sponsored by http://www.bloki.com +// +// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc. +// This notice MUST stay intact for use (see license.txt). +// +// A free WYSIWYG editor replacement for