//////////////////////////////////////////////////////////////////////////////// function OnInit(data){ //uid added via script wizard (do not change after publishing this script) var uid = "1135329D-02DC-47DD-8D75-8EE249D34223"; //resource center url added via script wizard (required for updating) var url = "http://resource.dopus.com/viewtopic.php?f=35&t=23602"; data.name = "Column.Generic: CreationMonth"; data.desc = t("script.desc"); data.copyright = "tbone"; data.version = "0.2"; data.default_enable = true; data.min_version = "11.5.1" data.config.Extensions = ".jpg.jpeg.tiff.tif.png.gif.bmp.rw2.nef.cr2"; var col = data.AddColumn(); col.name = "CreationMonth"; col.method = "Column_CreationMonth"; col.label = "CreationMonth"; col.header = t("month"); col.type = "number"; col.justify = "right"; col.autogroup = false; } //////////////////////////////////////////////////////////////////////////////// new Translator(this). AddT("en", { "month" : "Month", "january" : "January", "february" : "February", "march" : "March", "april" : "April", "may" : "May", "june" : "June", "july" : "July", "august" : "August", "september" : "September", "october" : "October", "november" : "November", "december" : "December", "script.desc" : "Sort and group items by month of creation date." }). AddT("de", { "month" : "Monat", "january" : "Januar", "february" : "Februar", "march" : "März", "april" : "April", "may" : "Mai", "june" : "Juni", "july" : "Juli", "august" : "August", "september" : "September", "october" : "Oktober", "november" : "November", "december" : "Dezember", "script.desc" : "Sortieren und Gruppieren nach Monat des Erstellungsdatums" }); //////////////////////////////////////////////////////////////////////////////// function Column_CreationMonth(data){ var monthTextIDs = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"]; var creationDate = null; if ((Script.Config.Extensions.indexOf(String(data.item.ext).toLowerCase())>-1) && data.item.metadata=="image"){ if (data.item.metadata.image_text.datetaken != undefined){ creationDate = new Date(data.item.metadata.image.datetaken); } if (data.item.metadata.image_text.shootingtime != undefined){ creationDate = new Date(data.item.metadata.image.shootingtime); } } if (creationDate === null){ creationDate = new Date(data.item.create); } var month = creationDate.getMonth(); data.value = month+1; data.group = "("+(month+1) + ") " + t(monthTextIDs[month]); } /////////////////////////////////////////////////////////////////////////////// function Translator(gThis){ this.version = 0.1; this.lang = "en"; if (!gThis.Translator.translations){ gThis.Translator = this; this.translations = {en:{}, de:{}, fr:{}, it:{}, sp:{}}; /////////////////////////////////////////////////////////////////////////// gThis.t = function(textID){ var text = "", textIDs = textID.split("|"); for(var ti=0;ti