From f598bd52dcc31bb84cf633ecfe94f428b80bdb49 Mon Sep 17 00:00:00 2001 From: NodeBB Misty Date: Thu, 14 Jul 2016 09:02:27 -0400 Subject: [PATCH 1/4] Latest translations and fallbacks --- public/language/es/category.json | 12 +++++----- public/language/es/error.json | 36 ++++++++++++++--------------- public/language/es/global.json | 4 ++-- public/language/es/pages.json | 4 ++-- public/language/es/register.json | 8 +++---- public/language/es/topic.json | 2 +- public/language/es/user.json | 18 +++++++-------- public/language/es/users.json | 2 +- public/language/fa_IR/register.json | 2 +- 9 files changed, 44 insertions(+), 44 deletions(-) diff --git a/public/language/es/category.json b/public/language/es/category.json index 1b8a605ef7..4ae8ebc1e6 100644 --- a/public/language/es/category.json +++ b/public/language/es/category.json @@ -8,12 +8,12 @@ "no_replies": "Nadie ha respondido aún", "no_new_posts": "No hay mensajes nuevos.", "share_this_category": "Compartir esta categoría", - "watch": "Siguiendo", - "ignore": "Ignorando", - "watching": "Watching", - "ignoring": "Ignoring", - "watching.description": "Show topics in unread", - "ignoring.description": "Do not show topics in unread", + "watch": "Seguir", + "ignore": "Ignorar", + "watching": "Siguiendo", + "ignoring": "Ignorando", + "watching.description": "Mostrar temas en no leidos", + "ignoring.description": "No mostrar temas en no leidos", "watch.message": "Ahora estás viendo actualizaciones de esta categoría", "ignore.message": "Ahora estás ignorando las actualizaciones de esta categoría", "watched-categories": "Categorías seguidas" diff --git a/public/language/es/error.json b/public/language/es/error.json index 4c07e24298..486fdc7df8 100644 --- a/public/language/es/error.json +++ b/public/language/es/error.json @@ -30,7 +30,7 @@ "user-banned": "Usuario baneado", "user-too-new": "Lo sentimos, es necesario que esperes %1 segundo(s) antes poder hacer tu primera publicación", "blacklisted-ip": "Lo sentimos, tu dirección IP ha sido baneada de esta comunidad. Si crees que debe de haber un error, por favor contacte con un administrador.", - "ban-expiry-missing": "Please provide an end date for this ban", + "ban-expiry-missing": "Por favor pon una fecha de fin del ban", "no-category": "La categoría no existe", "no-topic": "El tema no existe", "no-post": "La publicación no existe", @@ -40,20 +40,20 @@ "no-privileges": "No tienes suficientes privilegios para realizar esta acción.", "category-disabled": "Categoría deshabilitada", "topic-locked": "Tema bloqueado", - "post-edit-duration-expired": "Sólo puedes editar mensajes durante %1 segundo(s) después de haberlo escrito", - "post-edit-duration-expired-minutes": "You are only allowed to edit posts for %1 minute(s) after posting", - "post-edit-duration-expired-minutes-seconds": "You are only allowed to edit posts for %1 minute(s) %2 second(s) after posting", - "post-edit-duration-expired-hours": "You are only allowed to edit posts for %1 hour(s) after posting", - "post-edit-duration-expired-hours-minutes": "You are only allowed to edit posts for %1 hour(s) %2 minute(s) after posting", - "post-edit-duration-expired-days": "You are only allowed to edit posts for %1 day(s) after posting", - "post-edit-duration-expired-days-hours": "You are only allowed to edit posts for %1 day(s) %2 hour(s) after posting", - "post-delete-duration-expired": "You are only allowed to delete posts for %1 second(s) after posting", - "post-delete-duration-expired-minutes": "You are only allowed to delete posts for %1 minute(s) after posting", - "post-delete-duration-expired-minutes-seconds": "You are only allowed to delete posts for %1 minute(s) %2 second(s) after posting", - "post-delete-duration-expired-hours": "You are only allowed to delete posts for %1 hour(s) after posting", - "post-delete-duration-expired-hours-minutes": "You are only allowed to delete posts for %1 hour(s) %2 minute(s) after posting", - "post-delete-duration-expired-days": "You are only allowed to delete posts for %1 day(s) after posting", - "post-delete-duration-expired-days-hours": "You are only allowed to delete posts for %1 day(s) %2 hour(s) after posting", + "post-edit-duration-expired": "No puedes editar mensajes hasta pasado %1 segundo(s) después de haberlo escrito", + "post-edit-duration-expired-minutes": "No puedes editar mensajes hasta pasado %1 minuto(s) después de haberlo escrito", + "post-edit-duration-expired-minutes-seconds": "No puedes editar mensajes hasta pasado %1 minuto(s) y %2 segundo(s) después de haberlo escrito", + "post-edit-duration-expired-hours": "No puedes editar mensajes hasta pasado %1 hora(s) después de haberlo escrito", + "post-edit-duration-expired-hours-minutes": "No puedes editar mensajes hasta pasado %1 hora(s) y %2 minuto(s) después de haberlo escrito", + "post-edit-duration-expired-days": "No puedes editar mensajes hasta pasado %1 día(s) después de haberlo escrito", + "post-edit-duration-expired-days-hours": "No puedes editar mensajes hasta pasado %1 día(s) y %2 hora(s) después de haberlo escrito", + "post-delete-duration-expired": "No puedes borrar mensajes hasta pasado %1 segundo(s) después de haberlo escrito", + "post-delete-duration-expired-minutes": "No puedes borrar mensajes hasta pasado %1 minuto(s) después de haberlo escrito", + "post-delete-duration-expired-minutes-seconds": "No puedes borrar mensajes hasta pasado %1 minuto(s) y %2 segundo(s) después de haberlo escrito", + "post-delete-duration-expired-hours": "No puedes borrar mensajes hasta pasado %1 hora(s) después de haberlo escrito", + "post-delete-duration-expired-hours-minutes": "No puedes borrar mensajes hasta pasado %1 hora(s) y %2 minuto(s) después de haberlo escrito", + "post-delete-duration-expired-days": "No puedes borrar mensajes hasta pasado %1 día(s) después de haberlo escrito", + "post-delete-duration-expired-days-hours": "No puedes borrar mensajes hasta pasado %1 día(s) y %2 hora(s) después de haberlo escrito", "content-too-short": "Por favor introduzca una publicación más larga. Las publicaciones deben contener al menos %1 caractere(s).", "content-too-long": "Por favor introduzca un mensaje más corto. Los mensajes no pueden exceder los %1 caractere(s).", "title-too-short": "Por favor introduzca un título más largo. Los títulos deben contener al menos %1 caractere(s).", @@ -71,12 +71,12 @@ "already-unfavourited": "Ya habías desguardado este post.", "cant-ban-other-admins": "¡No puedes expulsar a otros administradores!", "cant-remove-last-admin": "Tu eres el unico administrador. Añade otro usuario como administrador antes de eliminarte a ti mismo.", - "cant-delete-admin": "Remove administrator privileges from this account before attempting to delete it.", + "cant-delete-admin": "Quitar privilegios de administrador de ésta cuenta antes de intentar borrarla", "invalid-image-type": "Tipo de imagen inválido. Los tipos permitidos son: %1", "invalid-image-extension": "Extensión de imagen inválida", "invalid-file-type": "Tipo de fichero inválido. Los tipos permitidos son: %1", "group-name-too-short": "Nombre del grupo es demasiado corto.", - "group-name-too-long": "Group name too long", + "group-name-too-long": "Nombre de grupo demasiado largo", "group-already-exists": "El grupo ya existe.", "group-name-change-not-allowed": "El nombre del grupo deseado no está permitido.", "group-already-member": "Ya eres miembro de este grupo", @@ -119,5 +119,5 @@ "not-in-room": "El usuario no está en la sala", "no-users-in-room": "No hay usuarios en esta sala", "cant-kick-self": "No te puedes expulsar a ti mismo del grupo", - "no-users-selected": "No user(s) selected" + "no-users-selected": "Ningun usuario(s) seleccionado" } \ No newline at end of file diff --git a/public/language/es/global.json b/public/language/es/global.json index d3ca7da211..fbe548dd54 100644 --- a/public/language/es/global.json +++ b/public/language/es/global.json @@ -50,9 +50,9 @@ "topics": "Temas", "posts": "Posts", "best": "Mejor valorados", - "upvoters": "Upvoters", + "upvoters": "Positivos", "upvoted": "Votado positivamente", - "downvoters": "Downvoters", + "downvoters": "Negativos", "downvoted": "Votado negativamente", "views": "Visitas", "reputation": "Reputación", diff --git a/public/language/es/pages.json b/public/language/es/pages.json index a093c5f548..3c0f7ee139 100644 --- a/public/language/es/pages.json +++ b/public/language/es/pages.json @@ -12,7 +12,7 @@ "users/sort-posts": "Top por mensajes", "users/sort-reputation": "Más reputados", "users/banned": "Usuarios baneados", - "users/most-flags": "Most flagged users", + "users/most-flags": "Usuarios mas reportados", "users/search": "Buscar", "notifications": "Notificaciones", "tags": "Etiquetas", @@ -29,7 +29,7 @@ "account/edit/password": "Editar contraseña de \"%1\"", "account/edit/username": "Editar nombre de usuario de \"%1\"", "account/edit/email": "Editar email \"%1\"", - "account/info": "Account Info", + "account/info": "Información de cuenta", "account/following": "Gente que sigue %1", "account/followers": "Seguidores de %1", "account/posts": "Publicados por %1", diff --git a/public/language/es/register.json b/public/language/es/register.json index 9916a0de52..a6e2d4bc76 100644 --- a/public/language/es/register.json +++ b/public/language/es/register.json @@ -1,6 +1,6 @@ { "register": "Registrarse", - "cancel_registration": "Cancel Registration", + "cancel_registration": "Cancelar registro", "help.email": "Por defecto, tu cuenta de correo electrónico estará oculta al publico.", "help.username_restrictions": "El nombre de usuario debe tener entre %1 y %2 carácteres. Los miembros pueden responderte escribiendo @usuario.", "help.minimum_password_length": "Tu contraseña debe tener al menos %1 carácteres.", @@ -16,8 +16,8 @@ "alternative_registration": "Métodos de registro alternativos", "terms_of_use": "Términos y Condiciones de uso", "agree_to_terms_of_use": "Acepto los Términos y Condiciones de uso", - "terms_of_use_error": "You must agree to the Terms of Use", + "terms_of_use_error": "Debes aceptar los términos de uso", "registration-added-to-queue": "Tu registro se ha añadido a la cola de aprobación,. Recibirás un correo cuando este sea aceptado por un administrador. ", - "interstitial.intro": "We require some additional information before we can create your account.", - "interstitial.errors-found": "We could not complete your registration:" + "interstitial.intro": "Se requiere de información adicional antes de crear tu cuenta.", + "interstitial.errors-found": "No pudimos completar tu registro:" } \ No newline at end of file diff --git a/public/language/es/topic.json b/public/language/es/topic.json index 50af3004ce..9c7ad4fc9a 100644 --- a/public/language/es/topic.json +++ b/public/language/es/topic.json @@ -31,7 +31,7 @@ "flag_success": "Este mensaje ha sido reportado para moderación.", "deleted_message": "Este tema ha sido borrado. Solo los usuarios que tengan privilegios de administración de temas pueden verlo.", "following_topic.message": "Ahora recibiras notificaciones cuando alguien publique en este tema.", - "not_following_topic.message": "You will see this topic in the unread topics list, but you will not receive notifications when somebody posts to this topic.", + "not_following_topic.message": "Podras ver este tema en la lista de no leidos, pero no recibirás notificaciones cuando alguien escriba en él.", "ignoring_topic.message": "Ya no verás este tema en no leídos. Serás notificado si te mencionan o te votan.", "login_to_subscribe": "Por favor, conéctate para subscribirte a este tema.", "markAsUnreadForAll.success": "Publicación marcada como no leída para todos.", diff --git a/public/language/es/user.json b/public/language/es/user.json index 7146e46611..3a3a112cec 100644 --- a/public/language/es/user.json +++ b/public/language/es/user.json @@ -6,7 +6,7 @@ "postcount": "Número De Publicaciones", "email": "Correo electrónico", "confirm_email": "Confirmar correo electrónico", - "account_info": "Account Info", + "account_info": "Información de cuenta", "ban_account": "Banear cuenta", "ban_account_confirm": "Quieres confirmar el baneo de este usuario?", "unban_account": "Desbanear cuenta", @@ -96,8 +96,8 @@ "delay_image_loading": "Retrasar la carga de imágenes", "image_load_delay_help": "Si se habilita, las imágenes no cargarán hasta que se vean en pantalla", "scroll_to_my_post": "Luego de enviar una respuesta, mostrar el nuevo mensaje", - "follow_topics_you_reply_to": "Watch topics that you reply to", - "follow_topics_you_create": "Watch topics you create", + "follow_topics_you_reply_to": "Seguir temas a los que respondes", + "follow_topics_you_create": "Seguir temas creados por ti", "grouptitle": "Título del grupo", "no-group-title": "Sin título de grupo", "select-skin": "Seleccionar una plantilla", @@ -109,10 +109,10 @@ "sso.title": "Servicios de Inicio de sesión Único", "sso.associated": "Asociado con", "sso.not-associated": "Da clic aquí para asociarse con", - "info.latest-flags": "Latest Flags", - "info.no-flags": "No Flagged Posts Found", - "info.ban-history": "Recent Ban History", - "info.no-ban-history": "This user has never been banned", - "info.banned-until": "Banned until %1", - "info.banned-permanently": "Banned permanently" + "info.latest-flags": "Ultimos reportes", + "info.no-flags": "Ningun mensaje reportado encontrado", + "info.ban-history": "Histórico reciente de bans", + "info.no-ban-history": "Este usuario nunca ha sido baneado", + "info.banned-until": "Baneado hasta %1", + "info.banned-permanently": "Baneado permanentemente" } \ No newline at end of file diff --git a/public/language/es/users.json b/public/language/es/users.json index 3d32fdc599..5b96abeef0 100644 --- a/public/language/es/users.json +++ b/public/language/es/users.json @@ -2,7 +2,7 @@ "latest_users": "Últimos usuarios", "top_posters": "Top por mensajes", "most_reputation": "Más reputados", - "most_flags": "Most Flags", + "most_flags": "Más Reportados", "search": "Buscar", "enter_username": "Ingresa el nombre de usuario que quieres buscar", "load_more": "Cargar más", diff --git a/public/language/fa_IR/register.json b/public/language/fa_IR/register.json index de5137ae74..15af9f66cb 100644 --- a/public/language/fa_IR/register.json +++ b/public/language/fa_IR/register.json @@ -16,7 +16,7 @@ "alternative_registration": "روش ثبت نام جایگزین", "terms_of_use": "شرایط استفاده", "agree_to_terms_of_use": "با شرایط استفاده موافقم", - "terms_of_use_error": "You must agree to the Terms of Use", + "terms_of_use_error": "شما باید با شرایط انجمن موافقت کنید", "registration-added-to-queue": "ثبت نام شما به صف تایید اضافه شد. وقتی توسط یک مدیر تایید شد شما ایمیلی دریافت خواهید کرد.", "interstitial.intro": "ما نیاز به برخی اطلاعات اضافی شما قبل از ایجاد شناسه کاربری داریم.", "interstitial.errors-found": "شما نمی‌توانید ثبت نام خود را تکمیل کنید:" From c204eac93a0cd27c460455e086272f2985a91182 Mon Sep 17 00:00:00 2001 From: pichalite Date: Thu, 14 Jul 2016 16:43:05 +0000 Subject: [PATCH 2/4] translate language strings in votes modal --- public/src/client/topic/postTools.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/public/src/client/topic/postTools.js b/public/src/client/topic/postTools.js index 71df716198..41aa3d4ca4 100644 --- a/public/src/client/topic/postTools.js +++ b/public/src/client/topic/postTools.js @@ -377,15 +377,18 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator } templates.parse('partials/modals/votes_modal', data, function(html) { - var dialog = bootbox.dialog({ - title: 'Voters', - message: html, - className: 'vote-modal', - show: true - }); - - dialog.on('click', function() { - dialog.modal('hide'); + translator.translate(html, function(translated) { + var dialog = bootbox.dialog({ + title: 'Voters', + message: translated, + className: 'vote-modal', + show: true + }); + + dialog.on('click', function() { + dialog.modal('hide'); + }); + }); }); }); From 1d100e9f4250e7ab24c60fb9791ed2e63efbe8f0 Mon Sep 17 00:00:00 2001 From: Anil Mandepudi Date: Thu, 14 Jul 2016 10:59:31 -0700 Subject: [PATCH 3/4] update tinycon to latest (#4850) --- public/vendor/tinycon/tinycon.js | 488 ++++++++++++++++--------------- 1 file changed, 254 insertions(+), 234 deletions(-) diff --git a/public/vendor/tinycon/tinycon.js b/public/vendor/tinycon/tinycon.js index 3317cc0d03..3e3657cdf8 100644 --- a/public/vendor/tinycon/tinycon.js +++ b/public/vendor/tinycon/tinycon.js @@ -1,188 +1,200 @@ /*! * Tinycon - A small library for manipulating the Favicon * Tom Moor, http://tommoor.com - * Copyright (c) 2012 Tom Moor - * MIT Licensed - * @version 0.6.1 + * Copyright (c) 2015 Tom Moor + * @license MIT Licensed + * @version 0.6.4 */ (function(){ - var Tinycon = {}; - var currentFavicon = null; - var originalFavicon = null; - var originalTitle = document.title; - var faviconImage = null; - var canvas = null; - var options = {}; - var r = window.devicePixelRatio || 1; - var size = 16 * r; - var defaults = { - width: 7, - height: 9, - font: 9 * r + 'px arial', - colour: '#ffffff', - background: '#F03D25', - fallback: true, - crossOrigin: true, - abbreviate: true - }; - - var ua = (function () { - var agent = navigator.userAgent.toLowerCase(); - // New function has access to 'agent' via closure - return function (browser) { - return agent.indexOf(browser) !== -1; - }; - }()); - - var browser = { - ie: ua('msie'), - chrome: ua('chrome'), - webkit: ua('chrome') || ua('safari'), - safari: ua('safari') && !ua('chrome'), - mozilla: ua('mozilla') && !ua('chrome') && !ua('safari') - }; - - // private methods - var getFaviconTag = function(){ - - var links = document.getElementsByTagName('link'); - - for(var i=0, len=links.length; i < len; i++) { - if ((links[i].getAttribute('rel') || '').match(/\bicon\b/)) { - return links[i]; - } - } - - return false; - }; - - var removeFaviconTag = function(){ - - var links = document.getElementsByTagName('link'); - var head = document.getElementsByTagName('head')[0]; - - for(var i=0, len=links.length; i < len; i++) { - var exists = (typeof(links[i]) !== 'undefined'); - if (exists && (links[i].getAttribute('rel') || '').match(/\bicon\b/)) { - head.removeChild(links[i]); - } - } - }; - - var getCurrentFavicon = function(){ - - if (!originalFavicon || !currentFavicon) { - var tag = getFaviconTag(); - originalFavicon = currentFavicon = tag ? tag.getAttribute('href') : '/favicon.ico'; - } - - return currentFavicon; - }; - - var getCanvas = function (){ - - if (!canvas) { - canvas = document.createElement("canvas"); - canvas.width = size; - canvas.height = size; - } - - return canvas; - }; - - var setFaviconTag = function(url){ - removeFaviconTag(); - - var link = document.createElement('link'); - link.type = 'image/x-icon'; - link.rel = 'icon'; - link.href = url; - document.getElementsByTagName('head')[0].appendChild(link); - }; - - var log = function(message){ - if (window.console) window.console.log(message); - }; - - var drawFavicon = function(label, colour) { - - // fallback to updating the browser title if unsupported - if (!getCanvas().getContext || browser.ie || browser.safari || options.fallback === 'force') { - return updateTitle(label); - } - - var context = getCanvas().getContext("2d"); - var colour = colour || '#000000'; - var src = getCurrentFavicon(); - - faviconImage = document.createElement('img'); - faviconImage.onload = function() { - - // clear canvas - context.clearRect(0, 0, size, size); - - // draw the favicon - context.drawImage(faviconImage, 0, 0, faviconImage.width, faviconImage.height, 0, 0, size, size); + var Tinycon = {}; + var currentFavicon = null; + var originalFavicon = null; + var faviconImage = null; + var canvas = null; + var options = {}; + var r = window.devicePixelRatio || 1; + var size = 16 * r; + var defaults = { + width: 7, + height: 9, + font: 10 * r + 'px arial', + color: '#ffffff', + background: '#F03D25', + fallback: true, + crossOrigin: true, + abbreviate: true + }; + + var ua = (function () { + var agent = navigator.userAgent.toLowerCase(); + // New function has access to 'agent' via closure + return function (browser) { + return agent.indexOf(browser) !== -1; + }; + }()); + + var browser = { + ie: ua('trident'), + chrome: ua('chrome'), + webkit: ua('chrome') || ua('safari'), + safari: ua('safari') && !ua('chrome'), + mozilla: ua('mozilla') && !ua('chrome') && !ua('safari') + }; + + // private methods + var getFaviconTag = function(){ + + var links = document.getElementsByTagName('link'); + + for(var i=0, len=links.length; i < len; i++) { + if ((links[i].getAttribute('rel') || '').match(/\bicon\b/i)) { + return links[i]; + } + } + + return false; + }; + + var removeFaviconTag = function(){ + + var links = document.getElementsByTagName('link'); + var head = document.getElementsByTagName('head')[0]; + + for(var i=0, len=links.length; i < len; i++) { + var exists = (typeof(links[i]) !== 'undefined'); + if (exists && (links[i].getAttribute('rel') || '').match(/\bicon\b/i)) { + head.removeChild(links[i]); + } + } + }; + + var getCurrentFavicon = function(){ + + if (!originalFavicon || !currentFavicon) { + var tag = getFaviconTag(); + currentFavicon = tag ? tag.getAttribute('href') : '/favicon.ico'; + if (!originalFavicon) { + originalFavicon = currentFavicon; + } + } + + return currentFavicon; + }; + + var getCanvas = function (){ + + if (!canvas) { + canvas = document.createElement("canvas"); + canvas.width = size; + canvas.height = size; + } + + return canvas; + }; + + var setFaviconTag = function(url){ + if(url){ + removeFaviconTag(); + + var link = document.createElement('link'); + link.type = 'image/x-icon'; + link.rel = 'icon'; + link.href = url; + document.getElementsByTagName('head')[0].appendChild(link); + } + }; + + var log = function(message){ + if (window.console) window.console.log(message); + }; + + var drawFavicon = function(label, color) { + + // fallback to updating the browser title if unsupported + if (!getCanvas().getContext || browser.ie || browser.safari || options.fallback === 'force') { + return updateTitle(label); + } + + var context = getCanvas().getContext("2d"); + var color = color || '#000000'; + var src = getCurrentFavicon(); + + faviconImage = document.createElement('img'); + faviconImage.onload = function() { + + // clear canvas + context.clearRect(0, 0, size, size); + + // draw the favicon + context.drawImage(faviconImage, 0, 0, faviconImage.width, faviconImage.height, 0, 0, size, size); + + // draw bubble over the top + if ((label + '').length > 0) drawBubble(context, label, color); - // draw bubble over the top - if ((label + '').length > 0) drawBubble(context, label, colour); + // refresh tag in page + refreshFavicon(); + }; - // refresh tag in page - refreshFavicon(); - }; + // allow cross origin resource requests if the image is not a data:uri + // as detailed here: https://github.com/mrdoob/three.js/issues/1305 + if (!src.match(/^data/) && options.crossOrigin) { + faviconImage.crossOrigin = 'anonymous'; + } - // allow cross origin resource requests if the image is not a data:uri - // as detailed here: https://github.com/mrdoob/three.js/issues/1305 - if (!src.match(/^data/) && options.crossOrigin) { - faviconImage.crossOrigin = 'anonymous'; - } + faviconImage.src = src; + }; - faviconImage.src = src; - }; + var updateTitle = function(label) { - var updateTitle = function(label) { + if (options.fallback) { + // Grab the current title that we can prefix with the label + var originalTitle = document.title; - if (options.fallback) { - if ((label + '').length > 0) { - document.title = '(' + label + ') ' + originalTitle; - } else { - document.title = originalTitle; - } - } - }; + // Strip out the old label if there is one + if (originalTitle[0] === '(') { + originalTitle = originalTitle.slice(originalTitle.indexOf(' ')); + } - var drawBubble = function(context, label, colour) { + if ((label + '').length > 0) { + document.title = '(' + label + ') ' + originalTitle; + } else { + document.title = originalTitle; + } + } + }; - // automatic abbreviation for long (>2 digits) numbers - if (typeof label == 'number' && label > 99 && options.abbreviate) { - label = abbreviateNumber(label); - } + var drawBubble = function(context, label, color) { - // bubble needs to be larger for double digits - var len = (label + '').length-1; + // automatic abbreviation for long (>2 digits) numbers + if (typeof label == 'number' && label > 99 && options.abbreviate) { + label = abbreviateNumber(label); + } - var width = options.width * r + (6 * r * len), - height = options.height * r; + // bubble needs to be larger for double digits + var len = (label + '').length-1; - var top = size - height, + var width = options.width * r + (6 * r * len), + height = options.height * r; + + var top = size - height, left = size - width - r, bottom = 16 * r, right = 16 * r, radius = 2 * r; - // webkit seems to render fonts lighter than firefox - context.font = (browser.webkit ? 'bold ' : '') + options.font; - context.fillStyle = options.background; - context.strokeStyle = options.background; - context.lineWidth = r; + // webkit seems to render fonts lighter than firefox + context.font = (browser.webkit ? 'bold ' : '') + options.font; + context.fillStyle = options.background; + context.strokeStyle = options.background; + context.lineWidth = r; - // bubble - context.beginPath(); + // bubble + context.beginPath(); context.moveTo(left + radius, top); - context.quadraticCurveTo(left, top, left, top + radius); - context.lineTo(left, bottom - radius); + context.quadraticCurveTo(left, top, left, top + radius); + context.lineTo(left, bottom - radius); context.quadraticCurveTo(left, bottom, left + radius, bottom); context.lineTo(right - radius, bottom); context.quadraticCurveTo(right, bottom, right, bottom - radius); @@ -191,77 +203,85 @@ context.closePath(); context.fill(); - // bottom shadow - context.beginPath(); - context.strokeStyle = "rgba(0,0,0,0.3)"; - context.moveTo(left + radius / 2.0, bottom); - context.lineTo(right - radius / 2.0, bottom); - context.stroke(); - - // label - context.fillStyle = options.colour; - context.textAlign = "right"; - context.textBaseline = "top"; - - // unfortunately webkit/mozilla are a pixel different in text positioning - context.fillText(label, r === 2 ? 29 : 15, browser.mozilla ? 7*r : 6*r); - }; - - var refreshFavicon = function(){ - // check support - if (!getCanvas().getContext) return; - - setFaviconTag(getCanvas().toDataURL()); - }; - - var abbreviateNumber = function(label) { - var metricPrefixes = [ - ['G', 1000000000], - ['M', 1000000], - ['k', 1000] - ]; - - for(var i = 0; i < metricPrefixes.length; ++i) { - if (label >= metricPrefixes[i][1]) { - label = round(label / metricPrefixes[i][1]) + metricPrefixes[i][0]; - break; - } - } - - return label; - }; - - var round = function (value, precision) { - var number = new Number(value); - return number.toFixed(precision); - }; - - // public methods - Tinycon.setOptions = function(custom){ - options = {}; - - for(var key in defaults){ - options[key] = custom.hasOwnProperty(key) ? custom[key] : defaults[key]; - } - return this; - }; - - Tinycon.setImage = function(url){ - currentFavicon = url; - refreshFavicon(); - return this; - }; - - Tinycon.setBubble = function(label, colour) { - label = label || ''; - drawFavicon(label, colour); - return this; - }; - - Tinycon.reset = function(){ - setFaviconTag(originalFavicon); - }; - - Tinycon.setOptions(defaults); - window.Tinycon = Tinycon; -})(); \ No newline at end of file + // bottom shadow + context.beginPath(); + context.strokeStyle = "rgba(0,0,0,0.3)"; + context.moveTo(left + radius / 2.0, bottom); + context.lineTo(right - radius / 2.0, bottom); + context.stroke(); + + // label + context.fillStyle = options.color; + context.textAlign = "right"; + context.textBaseline = "top"; + + // unfortunately webkit/mozilla are a pixel different in text positioning + context.fillText(label, r === 2 ? 29 : 15, browser.mozilla ? 7*r : 6*r); + }; + + var refreshFavicon = function(){ + // check support + if (!getCanvas().getContext) return; + + setFaviconTag(getCanvas().toDataURL()); + }; + + var abbreviateNumber = function(label) { + var metricPrefixes = [ + ['G', 1000000000], + ['M', 1000000], + ['k', 1000] + ]; + + for(var i = 0; i < metricPrefixes.length; ++i) { + if (label >= metricPrefixes[i][1]) { + label = round(label / metricPrefixes[i][1]) + metricPrefixes[i][0]; + break; + } + } + + return label; + }; + + var round = function (value, precision) { + var number = new Number(value); + return number.toFixed(precision); + }; + + // public methods + Tinycon.setOptions = function(custom){ + options = {}; + + // account for deprecated UK English spelling + if (custom.colour) { + custom.color = custom.colour; + } + + for(var key in defaults){ + options[key] = custom.hasOwnProperty(key) ? custom[key] : defaults[key]; + } + return this; + }; + + Tinycon.setImage = function(url){ + currentFavicon = url; + refreshFavicon(); + return this; + }; + + Tinycon.setBubble = function(label, color) { + label = label || ''; + drawFavicon(label, color); + return this; + }; + + Tinycon.reset = function(){ + currentFavicon = originalFavicon; + setFaviconTag(originalFavicon); + }; + + Tinycon.setOptions(defaults); + + window.Tinycon = Tinycon; + +})(); From 5ecf88adefd5210b6a5e5991923ec82fe07155bb Mon Sep 17 00:00:00 2001 From: Anil Mandepudi Date: Thu, 14 Jul 2016 11:22:19 -0700 Subject: [PATCH 4/4] update require.js to latest (#4851) --- public/vendor/requirejs/require.js | 66 +++++++++++++++--------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/public/vendor/requirejs/require.js b/public/vendor/requirejs/require.js index f04b8c3f7d..857eb5b700 100644 --- a/public/vendor/requirejs/require.js +++ b/public/vendor/requirejs/require.js @@ -1,36 +1,36 @@ /* - RequireJS 2.1.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. - Available via the MIT or new BSD license. - see: http://github.com/jrburke/requirejs for details + RequireJS 2.2.0 Copyright jQuery Foundation and other contributors. + Released under MIT license, http://github.com/requirejs/requirejs/LICENSE */ var requirejs,require,define; -(function(ba){function J(b){return"[object Function]"===N.call(b)}function K(b){return"[object Array]"===N.call(b)}function z(b,c){if(b){var d;for(d=0;dthis.depCount&&!this.defined){if(J(n)){if(this.events.error&&this.map.isDefine||h.onError!==ca)try{e=k.execCb(c,n,b,e)}catch(d){a=d}else e=k.execCb(c,n,b,e);this.map.isDefine&&((b=this.module)&&void 0!==b.exports&&b.exports!== -this.exports?e=b.exports:void 0===e&&this.usingExports&&(e=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else e=n;this.exports=e;if(this.map.isDefine&&!this.ignore&&(r[c]=e,h.onResourceLoad))h.onResourceLoad(k,this.map,this.depMaps);y(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete= -!0)}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,d=l(a.prefix);this.depMaps.push(d);u(d,"defined",v(this,function(e){var n,d;d=this.map.name;var g=this.map.parentMap?this.map.parentMap.name:null,C=k.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(e.normalize&&(d=e.normalize(d,function(a){return c(a,g,!0)})||""),e=l(a.prefix+"!"+d,this.map.parentMap),u(e,"defined",v(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})), -d=m(q,e.id)){this.depMaps.push(e);if(this.events.error)d.on("error",v(this,function(a){this.emit("error",a)}));d.enable()}}else n=v(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),n.error=v(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];H(q,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),n.fromText=v(this,function(e,c){var d=a.name,g=l(d),i=Q;c&&(e=c);i&&(Q=!1);s(g);t(j.config,b)&&(j.config[d]=j.config[b]);try{h.exec(e)}catch(D){return w(B("fromtexteval", -"fromText eval for "+b+" failed: "+D,D,[b]))}i&&(Q=!0);this.depMaps.push(g);k.completeLoad(d);C([d],n)}),e.load(a.name,C,n,j)}));k.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){W[this.map.id]=this;this.enabling=this.enabled=!0;z(this.depMaps,v(this,function(a,b){var c,e;if("string"===typeof a){a=l(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=m(P,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;u(a,"defined",v(this,function(a){this.defineDep(b, -a);this.check()}));this.errback&&u(a,"error",v(this,this.errback))}c=a.id;e=q[c];!t(P,c)&&(e&&!e.enabled)&&k.enable(a,this)}));H(this.pluginMaps,v(this,function(a){var b=m(q,a.id);b&&!b.enabled&&k.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){z(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};k={config:j,contextName:b,registry:q,defined:r,urlFetched:V,defQueue:I,Module:$,makeModuleMap:l, -nextTick:h.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=j.pkgs,c=j.shim,e={paths:!0,config:!0,map:!0};H(a,function(a,b){e[b]?"map"===b?(j.map||(j.map={}),S(j[b],a,!0,!0)):S(j[b],a,!0):j[b]=a});a.shim&&(H(a.shim,function(a,b){K(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=k.makeShimExports(a);c[b]=a}),j.shim=c);a.packages&&(z(a.packages,function(a){a="string"===typeof a?{name:a}:a;b[a.name]={name:a.name, -location:a.location||a.name,main:(a.main||"main").replace(ka,"").replace(fa,"")}}),j.pkgs=b);H(q,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=l(b))});if(a.deps||a.callback)k.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ba,arguments));return b||a.exports&&da(a.exports)}},makeRequire:function(a,f){function d(e,c,g){var i,j;f.enableBuildCallback&&(c&&J(c))&&(c.__requireJsBuild=!0);if("string"===typeof e){if(J(c))return w(B("requireargs", -"Invalid require call"),g);if(a&&t(P,e))return P[e](q[a.id]);if(h.get)return h.get(k,e,a,d);i=l(e,a,!1,!0);i=i.id;return!t(r,i)?w(B("notloaded",'Module name "'+i+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[i]}M();k.nextTick(function(){M();j=s(l(null,a));j.skipMap=f.skipMap;j.init(e,c,g,{enabled:!0});E()});return d}f=f||{};S(d,{isBrowser:A,toUrl:function(b){var d,f=b.lastIndexOf("."),g=b.split("/")[0];if(-1!==f&&(!("."===g||".."===g)||1g.attachEvent.toString().indexOf("[native code"))&&!Z?(Q=!0,g.attachEvent("onreadystatechange",b.onScriptLoad)):(g.addEventListener("load",b.onScriptLoad,!1),g.addEventListener("error",b.onScriptError,!1)),g.src=d,M=g,E?y.insertBefore(g,E):y.appendChild(g), -M=null,g;if(ea)try{importScripts(d),b.completeLoad(c)}catch(l){b.onError(B("importscripts","importScripts failed for "+c+" at "+d,l,[c]))}};A&&O(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(L=b.getAttribute("data-main"))return s=L,u.baseUrl||(F=s.split("/"),s=F.pop(),ga=F.length?F.join("/")+"/":"./",u.baseUrl=ga),s=s.replace(fa,""),h.jsExtRegExp.test(s)&&(s=L),u.deps=u.deps?u.deps.concat(s):[s],!0});define=function(b,c,d){var h,g;"string"!==typeof b&&(d=c,c=b,b=null); -K(c)||(d=c,c=null);!c&&J(d)&&(c=[],d.length&&(d.toString().replace(ma,"").replace(na,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(Q){if(!(h=M))R&&"interactive"===R.readyState||O(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return R=b}),h=R;h&&(b||(b=h.getAttribute("data-requiremodule")),g=G[h.getAttribute("data-requirecontext")])}(g?g.defQueue:U).push([b,c,d])};define.amd={jQuery:!0};h.exec=function(b){return eval(b)}; -h(u)}})(this); \ No newline at end of file +(function(ga){function ka(b,c,d,g){return g||""}function K(b){return"[object Function]"===Q.call(b)}function L(b){return"[object Array]"===Q.call(b)}function y(b,c){if(b){var d;for(d=0;dthis.depCount&&!this.defined){if(K(k)){if(this.events.error&&this.map.isDefine||g.onError!== +ha)try{h=l.execCb(c,k,b,h)}catch(d){a=d}else h=l.execCb(c,k,b,h);this.map.isDefine&&void 0===h&&((b=this.module)?h=b.exports:this.usingExports&&(h=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",A(this.error=a)}else h=k;this.exports=h;if(this.map.isDefine&&!this.ignore&&(v[c]=h,g.onResourceLoad)){var f=[];y(this.depMaps,function(a){f.push(a.normalizedMap||a)});g.onResourceLoad(l,this.map,f)}C(c); +this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var a=this.map,b=a.id,d=q(a.prefix);this.depMaps.push(d);w(d,"defined",z(this,function(h){var k,f,d=e(fa,this.map.id),M=this.map.name,r=this.map.parentMap?this.map.parentMap.name:null,m=l.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(h.normalize&&(M=h.normalize(M,function(a){return c(a,r,!0)})|| +""),f=q(a.prefix+"!"+M,this.map.parentMap),w(f,"defined",z(this,function(a){this.map.normalizedMap=f;this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),h=e(t,f.id)){this.depMaps.push(f);if(this.events.error)h.on("error",z(this,function(a){this.emit("error",a)}));h.enable()}}else d?(this.map.url=l.nameToUrl(d),this.load()):(k=z(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),k.error=z(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];D(t,function(a){0=== +a.map.id.indexOf(b+"_unnormalized")&&C(a.map.id)});A(a)}),k.fromText=z(this,function(h,c){var d=a.name,f=q(d),M=S;c&&(h=c);M&&(S=!1);u(f);x(p.config,b)&&(p.config[d]=p.config[b]);try{g.exec(h)}catch(e){return A(F("fromtexteval","fromText eval for "+b+" failed: "+e,e,[b]))}M&&(S=!0);this.depMaps.push(f);l.completeLoad(d);m([d],k)}),h.load(a.name,m,k,p))}));l.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){Z[this.map.id]=this;this.enabling=this.enabled=!0;y(this.depMaps,z(this,function(a, +b){var c,h;if("string"===typeof a){a=q(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=e(R,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;w(a,"defined",z(this,function(a){this.undefed||(this.defineDep(b,a),this.check())}));this.errback?w(a,"error",z(this,this.errback)):this.events.error&&w(a,"error",z(this,function(a){this.emit("error",a)}))}c=a.id;h=t[c];x(R,c)||!h||h.enabled||l.enable(a,this)}));D(this.pluginMaps,z(this,function(a){var b=e(t,a.id); +b&&!b.enabled&&l.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){y(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};l={config:p,contextName:b,registry:t,defined:v,urlFetched:W,defQueue:G,defQueueMap:{},Module:da,makeModuleMap:q,nextTick:g.nextTick,onError:A,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");if("string"===typeof a.urlArgs){var b= +a.urlArgs;a.urlArgs=function(a,c){return(-1===c.indexOf("?")?"?":"&")+b}}var c=p.shim,h={paths:!0,bundles:!0,config:!0,map:!0};D(a,function(a,b){h[b]?(p[b]||(p[b]={}),Y(p[b],a,!0,!0)):p[b]=a});a.bundles&&D(a.bundles,function(a,b){y(a,function(a){a!==b&&(fa[a]=b)})});a.shim&&(D(a.shim,function(a,b){L(a)&&(a={deps:a});!a.exports&&!a.init||a.exportsFn||(a.exportsFn=l.makeShimExports(a));c[b]=a}),p.shim=c);a.packages&&y(a.packages,function(a){var b;a="string"===typeof a?{name:a}:a;b=a.name;a.location&& +(p.paths[b]=a.location);p.pkgs[b]=a.name+"/"+(a.main||"main").replace(na,"").replace(U,"")});D(t,function(a,b){a.inited||a.map.unnormalized||(a.map=q(b,null,!0))});(a.deps||a.callback)&&l.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ga,arguments));return b||a.exports&&ia(a.exports)}},makeRequire:function(a,n){function m(c,d,f){var e,r;n.enableBuildCallback&&d&&K(d)&&(d.__requireJsBuild=!0);if("string"===typeof c){if(K(d))return A(F("requireargs", +"Invalid require call"),f);if(a&&x(R,c))return R[c](t[a.id]);if(g.get)return g.get(l,c,a,m);e=q(c,a,!1,!0);e=e.id;return x(v,e)?v[e]:A(F("notloaded",'Module name "'+e+'" has not been loaded yet for context: '+b+(a?"":". Use require([])")))}P();l.nextTick(function(){P();r=u(q(null,a));r.skipMap=n.skipMap;r.init(c,d,f,{enabled:!0});H()});return m}n=n||{};Y(m,{isBrowser:E,toUrl:function(b){var d,f=b.lastIndexOf("."),g=b.split("/")[0];-1!==f&&("."!==g&&".."!==g||1e.attachEvent.toString().indexOf("[native code")||ca?(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)):(S=!0,e.attachEvent("onreadystatechange",b.onScriptLoad));e.src=d;if(m.onNodeCreated)m.onNodeCreated(e,m,c,d);P=e;H?C.insertBefore(e,H):C.appendChild(e);P=null;return e}if(ja)try{setTimeout(function(){}, +0),importScripts(d),b.completeLoad(c)}catch(q){b.onError(F("importscripts","importScripts failed for "+c+" at "+d,q,[c]))}};E&&!w.skipDataMain&&X(document.getElementsByTagName("script"),function(b){C||(C=b.parentNode);if(O=b.getAttribute("data-main"))return u=O,w.baseUrl||-1!==u.indexOf("!")||(I=u.split("/"),u=I.pop(),T=I.length?I.join("/")+"/":"./",w.baseUrl=T),u=u.replace(U,""),g.jsExtRegExp.test(u)&&(u=O),w.deps=w.deps?w.deps.concat(u):[u],!0});define=function(b,c,d){var e,g;"string"!==typeof b&& +(d=c,c=b,b=null);L(c)||(d=c,c=null);!c&&K(d)&&(c=[],d.length&&(d.toString().replace(qa,ka).replace(ra,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));S&&(e=P||pa())&&(b||(b=e.getAttribute("data-requiremodule")),g=J[e.getAttribute("data-requirecontext")]);g?(g.defQueue.push([b,c,d]),g.defQueueMap[b]=!0):V.push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(w)}})(this);