diff --git a/entity/BulkMail_entity/BulkMail_entity.aod b/entity/BulkMail_entity/BulkMail_entity.aod index 3c902dff3f227405316889f9680bf5752e69dbb7..fc46b70b76ae2ec0d4ebaddf68c979e9294b69af 100644 --- a/entity/BulkMail_entity/BulkMail_entity.aod +++ b/entity/BulkMail_entity/BulkMail_entity.aod @@ -114,6 +114,7 @@ <name>bindata</name> <contentType>FILE</contentType> <stateProcess>%aditoprj%/entity/BulkMail_entity/entityfields/bindata/stateProcess.js</stateProcess> + <onValidation>%aditoprj%/entity/BulkMail_entity/entityfields/bindata/onValidation.js</onValidation> </entityField> <entityFieldGroup> <name>subjectPreview</name> diff --git a/entity/BulkMail_entity/entityfields/bindata/onValidation.js b/entity/BulkMail_entity/entityfields/bindata/onValidation.js new file mode 100644 index 0000000000000000000000000000000000000000..015947cbe07bf78b140473fb9353c72cbf8f5829 --- /dev/null +++ b/entity/BulkMail_entity/entityfields/bindata/onValidation.js @@ -0,0 +1,13 @@ +import("system.translate"); +import("Bulkmail_lib"); +import("system.result"); +import("system.vars"); +import("Document_lib"); + +var bindata = vars.get("$local.value"); +if (bindata) +{ + let mimeType = DocumentUtil.getMimeTypeFromUpload(bindata); + if (!BulkMailUtils.isValidMimeType(mimeType)) + result.string(translate.text("Invalid file type")); +} \ No newline at end of file diff --git a/entity/BulkMail_entity/entityfields/content/valueProcess.js b/entity/BulkMail_entity/entityfields/content/valueProcess.js index 88d58ef83678d176d31d2efce461afe0cc40e7d7..d0ea3be58f5a30f8b67e31b30836e169fa8ca581 100644 --- a/entity/BulkMail_entity/entityfields/content/valueProcess.js +++ b/entity/BulkMail_entity/entityfields/content/valueProcess.js @@ -16,6 +16,6 @@ if (vars.get("$this.value") == null && vars.get("$sys.viewmode") == neon.FRAME_V template = BulkMailUtils.getBulkMailTemplate(vars.get("$field.BULKMAILID"), vars.get("$field.DOCUMENTTEMPLATE_ID")); var content = template.getReplacedContent({}); - - result.string(content); -} \ No newline at end of file + if (content) + result.string(content); +} diff --git a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod index 8d4b79be20e1cb9bd76b48e48bf772199977214e..cf8e1af494a001cca4ff4fdcfa8b8f4491592dc3 100644 --- a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod +++ b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod @@ -50,6 +50,7 @@ <groupable v="true" /> <mandatory v="true" /> <stateProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/kind/stateProcess.js</stateProcess> + <valueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/kind/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/kind/displayValueProcess.js</displayValueProcess> <onValueChange>%aditoprj%/entity/DocumentTemplate_entity/entityfields/kind/onValueChange.js</onValueChange> </entityField> diff --git a/entity/DocumentTemplate_entity/entityfields/kind/valueProcess.js b/entity/DocumentTemplate_entity/entityfields/kind/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..8e1ca1a199540fff18044e0a51774d0a4565e630 --- /dev/null +++ b/entity/DocumentTemplate_entity/entityfields/kind/valueProcess.js @@ -0,0 +1,29 @@ +import("system.result"); +import("system.vars"); +import("system.neon"); +import("Entity_lib"); +import("Document_lib"); +import("MimeType_lib"); +import("KeywordRegistry_basic"); + +if (vars.get("$this.value") == null && vars.get("$field.BINDATA")) +{ + var mimeType = DocumentUtil.getMimeTypeFromUpload(vars.get("$field.BINDATA")); + var kind = null; + + //preset the type depending on the mime type, e. g. 'Mail' for eml files + switch (mimeType) + { + case MimeTypes.EML(): + case MimeTypes.MSG(): + kind = $KeywordRegistry.documentTemplateType$mail(); + break; + case MimeTypes.ODT(): + case MimeTypes.DOCX(): + kind = $KeywordRegistry.documentTemplateType$letter(); + break; + } + + if (kind) + result.string(kind); +} \ No newline at end of file diff --git a/entity/DocumentTemplate_entity/entityfields/name/valueProcess.js b/entity/DocumentTemplate_entity/entityfields/name/valueProcess.js index 65117fc5b8e553ef7764c9957e30b236b7174229..947d619fe54f8c894ea86e9ac1988fbe1278f68e 100644 --- a/entity/DocumentTemplate_entity/entityfields/name/valueProcess.js +++ b/entity/DocumentTemplate_entity/entityfields/name/valueProcess.js @@ -1,6 +1,5 @@ import("system.result"); import("system.vars"); -import("system.neon"); import("Entity_lib"); import("Document_lib"); @@ -11,5 +10,5 @@ if (vars.get("$this.value") == null && vars.get("$field.BINDATA")) if (uploadValue.length > 40) uploadValue = uploadValue.substr(0, 40); - neon.setFieldValue("$field.NAME", uploadValue); + result.string(uploadValue); } \ No newline at end of file diff --git a/entity/Order_entity/Order_entity.aod b/entity/Order_entity/Order_entity.aod index 220abdbfca83f723e8f7bc6dc74d50421b4e500d..80b6937c3ce27ac85a763a87b4b3fe8478d78f56 100644 --- a/entity/Order_entity/Order_entity.aod +++ b/entity/Order_entity/Order_entity.aod @@ -423,6 +423,7 @@ </entityConsumer> <entityConsumer> <name>AttributeTree</name> + <stateProcess>%aditoprj%/entity/Order_entity/entityfields/attributetree/stateProcess.js</stateProcess> <dependency> <name>dependency</name> <entityName>AttributeRelation_entity</entityName> @@ -985,6 +986,7 @@ <dbRecordFieldMapping> <name>CURRENCY.value</name> <recordfield>SALESORDER.CURRENCY</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>FOOTER.value</name> @@ -1029,10 +1031,12 @@ <dbRecordFieldMapping> <name>CONTACT_ORG_ID.value</name> <recordfield>CONTACT.ORGANISATION_ID</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>CONTACT_PERSON_ID.value</name> <recordfield>CONTACT.PERSON_ID</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>CURRENCY.displayValue</name> @@ -1041,6 +1045,7 @@ <dbRecordFieldMapping> <name>OFFER_ID.value</name> <recordfield>SALESORDER.OFFER_ID</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>CONTACT_ORG_ID.displayValue</name> @@ -1069,6 +1074,7 @@ <dbRecordFieldMapping> <name>ORDERTYPE.value</name> <recordfield>SALESORDER.ORDERTYPE</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>PAID.value</name> @@ -1077,6 +1083,7 @@ <dbRecordFieldMapping> <name>PAYDATE.value</name> <recordfield>SALESORDER.PAYDATE</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>PAYDUEDATE.value</name> @@ -1101,10 +1108,12 @@ <dbRecordFieldMapping> <name>PAYMENTTERMS.value</name> <recordfield>SALESORDER.PAYMENTTERMS</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>DELIVERYTERMS.value</name> <recordfield>SALESORDER.DELIVERYTERMS</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>DELIVERYADDRESS.value</name> diff --git a/entity/Order_entity/recordcontainers/db/onDBInsert.js b/entity/Order_entity/recordcontainers/db/onDBInsert.js index 0e8805fd5a43b0613e7014d49deac71e88da3ab7..0babcfe31d678e580f0460302b57c104e9612a71 100644 --- a/entity/Order_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Order_entity/recordcontainers/db/onDBInsert.js @@ -1,6 +1,7 @@ +import("Order_lib"); import("system.neon"); import("system.vars"); -import("Offer_lib"); -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.OfferOriginal_Id_param")) - OfferUtils.copyOfferItems(vars.getString("$param.OfferOriginal_Id_param"), vars.get("$local.rowdata")["SALESORDER.OFFER_ID"]); +//@TODO: OfferId_param is also set by 'copy order' -> the items of the offer are copied. What should happen? +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.OfferId_param")) + OrderUtils.copyOfferItemsToOrder(vars.getString("$param.OfferId_param"), vars.get("$local.rowdata")["SALESORDER.SALESORDERID"]); diff --git a/entity/Orderitem_entity/Orderitem_entity.aod b/entity/Orderitem_entity/Orderitem_entity.aod index 3ae458ef427016ece64637c5e5b12f8d4ce96610..34126ad9647d466f27fb816772ff317fe46d5b11 100644 --- a/entity/Orderitem_entity/Orderitem_entity.aod +++ b/entity/Orderitem_entity/Orderitem_entity.aod @@ -294,18 +294,22 @@ <dbRecordFieldMapping> <name>OPTIONAL.value</name> <recordfield>SALESORDERITEM.OPTIONAL</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>PRICE.value</name> <recordfield>SALESORDERITEM.PRICE</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>PRODUCT_ID.value</name> <recordfield>SALESORDERITEM.PRODUCT_ID</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>QUANTITY.value</name> <recordfield>SALESORDERITEM.QUANTITY</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>UNIT.value</name> @@ -330,6 +334,7 @@ <dbRecordFieldMapping> <name>INFO.value</name> <recordfield>SALESORDERITEM.INFO</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> diff --git a/entity/SerialLetter_entity/entityfields/downloadletter/onActionProcess.js b/entity/SerialLetter_entity/entityfields/downloadletter/onActionProcess.js index 3661c8f2d267db8ccbbab568c6b407fdfd2bb657..6563351beeed3e44fd2b4ce209d066508cdeb6f3 100644 --- a/entity/SerialLetter_entity/entityfields/downloadletter/onActionProcess.js +++ b/entity/SerialLetter_entity/entityfields/downloadletter/onActionProcess.js @@ -10,4 +10,4 @@ import("Employee_lib"); // binId : "1234" //} //notification.addNotification(util.getNewUUID(), null, null, null, "DownloadReady", notification.PRIO_NORMAL, 2, notification.STATE_UNSEEN, [EmployeeUtils.getCurrentUserId()], "yes", "desc") -var document = SerialLetterUtils.buildSerialLetter(vars.get("$field.SERIALLETTERID")); \ No newline at end of file +var document = SerialLetterUtils.buildSerialLetter(vars.get("$field.SERIALLETTERID")); diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index dfc13caeede0e8bc655840d5ae2bfe7b37dea7df..6b570d3f7548a3cfc8b2d356a59dcda1bb5abbe2 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -5877,7 +5877,7 @@ </entry> <entry> <key>Add to Bulkmail</key> - <value>Zu Massenmail hinzufügen</value> + <value>Zu Serienmail hinzufügen</value> </entry> <entry> <key>phase information</key> diff --git a/neonView/AttributeTree_view/AttributeTree_view.aod b/neonView/AttributeTree_view/AttributeTree_view.aod index 544cab8acec1088f10cbb63119e33cb7a15bbb7c..4d8fc3533a9c2c2a6cfa5464351261aaee898481 100644 --- a/neonView/AttributeTree_view/AttributeTree_view.aod +++ b/neonView/AttributeTree_view/AttributeTree_view.aod @@ -11,7 +11,7 @@ <treeViewTemplate> <name>Attributes</name> <parentField>ATTRIBUTE_PARENT_ID</parentField> - <titleField>ATTRIBUTE_NAME</titleField> + <titleField>FULL_ATTRIBUTE_NAME</titleField> <entryAction>openDetails</entryAction> <entityField>#ENTITY</entityField> <isCreatable v="false" /> diff --git a/process/Bulkmail_lib/process.js b/process/Bulkmail_lib/process.js index f784794a61a7b00394284e69fc4bbf9ce1b59a0d..4acdb432a1085fc183c0465bcf2b61afc6a5c870 100644 --- a/process/Bulkmail_lib/process.js +++ b/process/Bulkmail_lib/process.js @@ -215,7 +215,7 @@ BulkMailUtils.addRecipients = function (pBulkMailId, pContactIds) BulkMailUtils.getBulkMailTemplate = function (pBulkMailId, pDocumentTemplateId) { var template = DocumentTemplate.loadTemplate(pBulkMailId, "BULKMAIL"); - if (!template.type) + if (!template.content) template = DocumentTemplate.loadTemplate(pDocumentTemplateId); return template; } @@ -279,6 +279,26 @@ BulkMailUtils.openBulkMail = function (pBulkMailId) neon.openContext("BulkMail", "BulkMailMain_view", [pBulkMailId], neon.OPERATINGSTATE_VIEW, null); } +/** + * checks is the given mime type can be used for a bulk mail + * + * @param {String} pMimeType mime type + * @return {Boolean} wheter the type is usable or not + */ +BulkMailUtils.isValidMimeType = function (pMimeType) +{ + var templateType = DocumentTemplate.types.fromMimeType(pMimeType); + switch (templateType) + { + case DocumentTemplate.types.EML: + case DocumentTemplate.types.HTML: + case DocumentTemplate.types.TXT: + return true; + default: + return false; + } +} + function SerialLetterUtils () {} /** diff --git a/process/DocumentTemplate_lib/process.js b/process/DocumentTemplate_lib/process.js index f5c4c3a2d2e4e50acdb563adc90836129952799c..7d7e3f1492ae7e94b698a9e64c450b1b05a9f34c 100644 --- a/process/DocumentTemplate_lib/process.js +++ b/process/DocumentTemplate_lib/process.js @@ -19,6 +19,7 @@ import("system.mail"); import("Keyword_lib"); import("Placeholder_lib"); import("Email_lib"); +import("MimeType_lib"); /** * Object for working with document templates, holds the content and type of the template. @@ -66,6 +67,10 @@ DocumentTemplate.types = { ODT : "odt", DOCX : "docx", PLAIN : "plain", //for simple strings + + /** + * chooses the type depending on the file extension + */ fromFileExtension : function (pFileExtension) { switch (pFileExtension) @@ -80,25 +85,33 @@ DocumentTemplate.types = { case "docx": return this.DOCX; case "txt": - default: return this.TXT; + case "msg": + case "oft": + default: + return null; } }, + /** + * chooses the type depending on the mime type + */ fromMimeType : function (pMimetype) { switch (pMimetype) { - case "text/html": + case MimeTypes.HTML(): return this.HTML; - case "message/rfc822": + case MimeTypes.EML(): return this.EML; - case "application/vnd.oasis.opendocument.text": + case MimeTypes.ODT(): return this.ODT; - case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": + case MimeTypes.DOCX(): return this.DOCX; - case "text/plain": - default: + case MimeTypes.TXT(): return this.TXT; + case MimeTypes.MSG(): + default: + return null; } } }; diff --git a/process/Location_lib/process.js b/process/Location_lib/process.js index 335f688606b94cfc76ba538ef15b7f6c58afb269..5c24f993ced1f9e5df6705430247784ea0ee6680 100644 --- a/process/Location_lib/process.js +++ b/process/Location_lib/process.js @@ -4,19 +4,28 @@ import("system.eMath"); function GeoLocationUtils () {} /** - * average earth radius in kilometers + * average earth radius in kilometres */ -GeoLocationUtils.EARTH_RADIUS_AVG = 6371.001; +GeoLocationUtils.EARTH_RADIUS_AVG = function () +{ + return 6371.001; +} /** - * earth radius at the equator in kilometers + * earth radius at the equator in kilometres */ -GeoLocationUtils.EARTH_RADIUS_EQUATOR = 6378.137; +GeoLocationUtils.EARTH_RADIUS_EQUATOR = function () +{ + return 6378.137; +} /** - * earth radius at the poles in kilometers + * earth radius at the poles in kilometres */ -GeoLocationUtils.EARTH_RADIUS_POLE = 6356.752; +GeoLocationUtils.EARTH_RADIUS_POLES = function () +{ + return 6356.752; +} /** * Calculates the distance between two given locations using the haversine formula. @@ -26,7 +35,7 @@ GeoLocationUtils.EARTH_RADIUS_POLE = 6356.752; * @param {String|Number} pLonA longitude of the first location * @param {String|Number} pLatB latitude of the second location * @param {String|Number} pLonB longitude of the second location - * @return {Number} the distance in kilometers + * @return {Number} the distance in kilometres */ GeoLocationUtils.distanceHaversine = function (pLatA, pLonA, pLatB, pLonB) { @@ -35,20 +44,20 @@ GeoLocationUtils.distanceHaversine = function (pLatA, pLonA, pLatB, pLonB) pLatB = GeoLocationUtils.degreeToRadians(pLatB); pLonB = GeoLocationUtils.degreeToRadians(pLonB); - var R = GeoLocationUtils.EARTH_RADIUS_AVG; //average Earth radius in km https://en.wikipedia.org/wiki/Earth_radius + var R = GeoLocationUtils.EARTH_RADIUS_AVG(); //average Earth radius in km https://en.wikipedia.org/wiki/Earth_radius - var deltaLat = eMath.subDec(pLatA, eMath.absDec(pLatB)); //lat can be negative - var deltaLon = eMath.subDec(pLonA, pLonB); + var deltaLat = pLatA - Math.abs(pLatB); //lat can be negative + var deltaLon = pLonA - pLonB; - var sinLat = GeoLocationUtils.haversine(deltaLat); - var sinLon = GeoLocationUtils.haversine(deltaLon); + var sinLat = Math.sin(deltaLat / 2); + var sinLon = Math.sin(deltaLon / 2); - return R * 2 * Math.asin(Math.sqrt(Math.pow(sinLat, 2) + Math.cos(pLatA) * Math.cos(eMath.absDec(pLatB)) * Math.pow(sinLon, 2))); + return R * 2 * Math.asin(Math.sqrt(sinLat * sinLat + Math.cos(pLatA) * Math.cos(Math.abs(pLatB)) * sinLon * sinLon)); } /** * JavaScript function to calculate the geodetic distance between two points specified by latitude/longitude using the Vincenty inverse formula for ellipsoids. - * This is more accurate than the haversine formula but also more complex and thus theoretically not as fast. + * This is much more accurate than the haversine formula but also more complex and thus not as fast and can fail if the points are antipodal (very uncommon). * * Taken from http://movable-type.co.uk/scripts/latlong-vincenty.html * @@ -117,6 +126,18 @@ GeoLocationUtils.distanceVincenty = function (latA, lonA, latB, lonB) return s / 1000; //convert metres into kilometres } +/** + * Calculates the distance between two points on earth's surface ignoring earth's curvature. + * This method is very fast, but not suitable for too large distances. (less than 1000 km should be fine) + */ +GeoLocationUtils.distanceFlat = function (latA, lonA, latB, lonB) +{ + var deglen = 110.25; + var x = latA - latB; + var y = (lonA - lonB) * Math.cos(latB) + return deglen * Math.sqrt(x*x + y*y) +} + /** * haversine function * @@ -125,7 +146,7 @@ GeoLocationUtils.distanceVincenty = function (latA, lonA, latB, lonB) */ GeoLocationUtils.haversine = function (pDelta) { - return Math.sin(eMath.divDec(pDelta, 2)); + return Math.sin(pDelta / 2); } /** diff --git a/process/MimeType_lib/MimeType_lib.aod b/process/MimeType_lib/MimeType_lib.aod new file mode 100644 index 0000000000000000000000000000000000000000..01ad226f611bd45cacf2aca4b7ad0649a439afea --- /dev/null +++ b/process/MimeType_lib/MimeType_lib.aod @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> + <name>MimeType_lib</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <process>%aditoprj%/process/MimeType_lib/process.js</process> + <variants> + <element>LIBRARY</element> + </variants> +</process> diff --git a/process/MimeType_lib/process.js b/process/MimeType_lib/process.js new file mode 100644 index 0000000000000000000000000000000000000000..91d2403cd38c81b77da5cb519bb9ba0e4f4aa152 --- /dev/null +++ b/process/MimeType_lib/process.js @@ -0,0 +1,49 @@ +/** + * Object for the enumeration of mime types. + * This includes commonly used ones, if something is missing, feel free to add it. + */ +function MimeTypes () {} + +/* application */ +MimeTypes.ODT = function () {return "application/vnd.oasis.opendocument.text";}; +MimeTypes.PDF = function () {return "application/pdf";}; +MimeTypes.DOC = function () {return "application/msword";}; +MimeTypes.DOCX = function() {return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";}; +MimeTypes.XLS = function () {return "application/vnd.ms-excel";}; +MimeTypes.PPT = function () {return "application/vnd.ms-powerpoint";}; +MimeTypes.MDB = function () {return "application/x-msaccess";}; +MimeTypes.RTF = function () {return "application/rtf";}; +MimeTypes.JS = function () {return "application/javascript";}; +MimeTypes.JSON = function() {return "application/json";}; +MimeTypes.ZIP = function () {return "application/zip";}; +MimeTypes.MSG = function () {return "application/vnd.ms-outlook";}; + +/* text */ +MimeTypes.TXT = function () {return "text/plain";}; +MimeTypes.HTML = function() {return "text/html";}; +MimeTypes.CSV = function () {return "text/comma-separated-values";}; +MimeTypes.TSV = function () {return "text/tab-separated-values";}; +MimeTypes.CSS = function () {return "text/css";}; +MimeTypes.RTX = function () {return "text/richtext";}; +MimeTypes.XML = function () {return "text/xml";}; + +/* mail */ +MimeTypes.EML = function () {return "message/rfc822";}; + +/* images */ +MimeTypes.BMP = function () {return "image/bmp";}; +MimeTypes.GIF = function () {return "image/gif";}; +MimeTypes.JPEG = function() {return "image/jpeg";}; +MimeTypes.TIFF = function() {return "image/tiff";}; +MimeTypes.PNG = function () {return "image/png";}; +MimeTypes.SVG = function () {return "image/svg+xml";}; + +/* audio */ +MimeTypes.MP3 = function () {return "audio/mpeg";}; +MimeTypes.OGG = function () {return "audio/ogg";}; +MimeTypes.WAV = function () {return "audio/x-wav";}; + +/* video */ +MimeTypes.MPEG = function() {return "video/mpeg";}; +MimeTypes.MP4 = function () {return "video/mp4";}; +MimeTypes.AVI = function () {return "video/x-msvideo";};