add russian translation, translate share strings, add share to
vkontakte and update styles to account for longer texts
This commit is contained in:
parent
eda5d0b20f
commit
3ec6a6b64e
@ -11,9 +11,10 @@
|
|||||||
"resizeuploadedimages": "Große Bilder verkleinen, um Fehler zu vermeiden",
|
"resizeuploadedimages": "Große Bilder verkleinen, um Fehler zu vermeiden",
|
||||||
"language": "Sprache (Language)",
|
"language": "Sprache (Language)",
|
||||||
"languageoptions": {
|
"languageoptions": {
|
||||||
"de-DE": "Deutsch DE",
|
"de-de": "Deutsch (German)",
|
||||||
"en-US": "English US",
|
"en-us": "English (American English)",
|
||||||
"en-GB": "English GB"
|
"en-gb": "English (British English)",
|
||||||
|
"ru-ru": "Русский (Russian)"
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"save": "Konnte die Einstellungen nicht im Browser speichern.",
|
"save": "Konnte die Einstellungen nicht im Browser speichern.",
|
||||||
@ -94,23 +95,35 @@
|
|||||||
"imagelink": "Online Link zum Bild",
|
"imagelink": "Online Link zum Bild",
|
||||||
"imagelinktitle": "Du kannst diesen Link nehmen um das Bild auf anderen Seiten zu teilen oder hochzuladen",
|
"imagelinktitle": "Du kannst diesen Link nehmen um das Bild auf anderen Seiten zu teilen oder hochzuladen",
|
||||||
"opennewtabtitle": "Öffne das Bild in einem neuen Browsertab",
|
"opennewtabtitle": "Öffne das Bild in einem neuen Browsertab",
|
||||||
"imgur": "Imgur",
|
|
||||||
"reddit": "Reddit",
|
|
||||||
"twitter": "Twitter",
|
|
||||||
"facebook": "Facebook",
|
|
||||||
"pinterest": "Pinterest",
|
|
||||||
"recentlyshared": "Kürzlich geteilte Bilder",
|
"recentlyshared": "Kürzlich geteilte Bilder",
|
||||||
"untitled": "Ohne Titel",
|
"untitled": "Ohne Titel",
|
||||||
"openlink": "Öffne Link",
|
"openlink": "Öffne Link",
|
||||||
"openlinktitle": "Das Bild in einen neuen Browsertab öffnen",
|
"openlinktitle": "Das Bild in einen neuen Browsertab öffnen",
|
||||||
"offline": "Offline nehmen",
|
"offline": "Offline nehmen",
|
||||||
"offlinetitle": "Dieses Bild von Imgur löschen und vom Netz nehmen",
|
"offlinetitle": "Dieses Bild von Imgur löschen und vom Netz nehmen",
|
||||||
|
"target": {
|
||||||
|
"imgur": "Imgur",
|
||||||
|
"reddit": "Reddit",
|
||||||
|
"twitter": "Twitter",
|
||||||
|
"facebook": "Facebook",
|
||||||
|
"pinterest": "Pinterest",
|
||||||
|
"vkontakte": "VKontakte"
|
||||||
|
},
|
||||||
|
"link": {
|
||||||
|
"title": "Glitch!",
|
||||||
|
"description": {
|
||||||
|
"withoutname": "Schau mal was ich mit diesem Glitch Tool gemacht habe:",
|
||||||
|
"withname": "Schau mal was ich mit @snorpey’s Glitch Tool gemacht habe:",
|
||||||
|
"edited": "Das Bild habe ich mit snorpey's Glitch Tool bearbeitet:"
|
||||||
|
}
|
||||||
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"base64": "Es gibt keine Base64-Adresse zum hochladen",
|
"base64": "Es gibt keine Base64-Adresse zum hochladen",
|
||||||
"upload": "Konnte das Bild nicht auf Imgur hochladen."
|
"upload": "Konnte das Bild nicht auf Imgur hochladen."
|
||||||
},
|
},
|
||||||
"message": {
|
"message": {
|
||||||
"upload": "Das Bild wurde zu Imgur hochgeladen. [Bild öffnen.]({$1})",
|
"upload": "Das Bild wurde zu Imgur hochgeladen. [Bild öffnen.]({$1})",
|
||||||
|
"delete": "Konnte das Bild nicht von Imgur löschen.",
|
||||||
"del": "Das Bild wurde von Imgur gelöscht."
|
"del": "Das Bild wurde von Imgur gelöscht."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -10,9 +10,10 @@
|
|||||||
"canzoomwithpointer": "Enable zooming with mousewheel and touch gestures",
|
"canzoomwithpointer": "Enable zooming with mousewheel and touch gestures",
|
||||||
"language": "Language",
|
"language": "Language",
|
||||||
"languageoptions": {
|
"languageoptions": {
|
||||||
"de-DE": "Deutsch DE",
|
"de-de": "Deutsch (German)",
|
||||||
"en-US": "English US",
|
"en-us": "English (American English)",
|
||||||
"en-GB": "English GB"
|
"en-gb": "English (British English)",
|
||||||
|
"ru-ru": "Русский (Russian)"
|
||||||
},
|
},
|
||||||
"resizeuploadedimages": "Resize big images to avoid errors",
|
"resizeuploadedimages": "Resize big images to avoid errors",
|
||||||
"error": {
|
"error": {
|
||||||
@ -94,17 +95,28 @@
|
|||||||
"imagelink": "Online link to image",
|
"imagelink": "Online link to image",
|
||||||
"imagelinktitle": "You can use this link to share the image or embed it on other sites",
|
"imagelinktitle": "You can use this link to share the image or embed it on other sites",
|
||||||
"opennewtabtitle": "Open the image in a new browser tab",
|
"opennewtabtitle": "Open the image in a new browser tab",
|
||||||
"imgur": "Imgur",
|
|
||||||
"reddit": "Reddit",
|
|
||||||
"twitter": "Twitter",
|
|
||||||
"facebook": "Facebook",
|
|
||||||
"pinterest": "Pinterest",
|
|
||||||
"recentlyshared": "Recently shared images",
|
"recentlyshared": "Recently shared images",
|
||||||
"untitled": "Untitled",
|
"untitled": "Untitled",
|
||||||
"openlink": "Open Link",
|
"openlink": "Open Link",
|
||||||
"openlinktitle": "Open the online link of this image in a new browser tab",
|
"openlinktitle": "Open the online link of this image in a new browser tab",
|
||||||
"offline": "Take Offline",
|
"offline": "Take Offline",
|
||||||
"offlinetitle": "Delete this image from Imgur",
|
"offlinetitle": "Delete this image from Imgur",
|
||||||
|
"target": {
|
||||||
|
"imgur": "Imgur",
|
||||||
|
"reddit": "Reddit",
|
||||||
|
"twitter": "Twitter",
|
||||||
|
"facebook": "Facebook",
|
||||||
|
"pinterest": "Pinterest",
|
||||||
|
"vkontakte": "VKontakte"
|
||||||
|
},
|
||||||
|
"link": {
|
||||||
|
"title": "Glitch!",
|
||||||
|
"description": {
|
||||||
|
"withoutname": "Check out what I made with this glitch tool:",
|
||||||
|
"withname": "Check out what I made with @snorpey’s glitch tool:",
|
||||||
|
"edited": "I made this with snorpey’s glitch tool:"
|
||||||
|
}
|
||||||
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"base64": "No base64 URL to upload.",
|
"base64": "No base64 URL to upload.",
|
||||||
"upload": "Could not upload file to Imgur.",
|
"upload": "Could not upload file to Imgur.",
|
||||||
@ -121,7 +133,7 @@
|
|||||||
"webcamlabel": "Take a Picture",
|
"webcamlabel": "Take a Picture",
|
||||||
"trigger": "Take Picture",
|
"trigger": "Take Picture",
|
||||||
"triggertitle": "Click to take a picture with your webcam",
|
"triggertitle": "Click to take a picture with your webcam",
|
||||||
"picture": "'Webcam Picture {$1}",
|
"picture": "Webcam Picture {$1}",
|
||||||
"error": {
|
"error": {
|
||||||
"access": "Could not access your webcam."
|
"access": "Could not access your webcam."
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,9 +15,10 @@
|
|||||||
"canzoomwithpointer": "Enable zooming with mousewheel and touch gestures",
|
"canzoomwithpointer": "Enable zooming with mousewheel and touch gestures",
|
||||||
"language": "Language",
|
"language": "Language",
|
||||||
"languageoptions": {
|
"languageoptions": {
|
||||||
"de-DE": "Deutsch DE",
|
"de-de": "Deutsch (German)",
|
||||||
"en-US": "English US",
|
"en-us": "English (American English)",
|
||||||
"en-GB": "English GB"
|
"en-gb": "English (British English)",
|
||||||
|
"ru-ru": "Русский (Russian)"
|
||||||
},
|
},
|
||||||
"resizeuploadedimages": "Resize big images to avoid errors",
|
"resizeuploadedimages": "Resize big images to avoid errors",
|
||||||
"error": {
|
"error": {
|
||||||
@ -102,17 +103,28 @@
|
|||||||
"imagelink": "Online link to image",
|
"imagelink": "Online link to image",
|
||||||
"imagelinktitle": "You can use this link to share the image or embed it on other sites",
|
"imagelinktitle": "You can use this link to share the image or embed it on other sites",
|
||||||
"opennewtabtitle": "Open the image in a new browser tab",
|
"opennewtabtitle": "Open the image in a new browser tab",
|
||||||
"imgur": "Imgur",
|
|
||||||
"reddit": "Reddit",
|
|
||||||
"twitter": "Twitter",
|
|
||||||
"facebook": "Facebook",
|
|
||||||
"pinterest": "Pinterest",
|
|
||||||
"recentlyshared": "Recently shared images",
|
"recentlyshared": "Recently shared images",
|
||||||
"untitled": "Untitled",
|
"untitled": "Untitled",
|
||||||
"openlink": "Open Link",
|
"openlink": "Open Link",
|
||||||
"openlinktitle": "Open the online link of this image in a new browser tab",
|
"openlinktitle": "Open the online link of this image in a new browser tab",
|
||||||
"offline": "Take Offline",
|
"offline": "Take Offline",
|
||||||
"offlinetitle": "Delete this image from Imgur",
|
"offlinetitle": "Delete this image from Imgur",
|
||||||
|
"target": {
|
||||||
|
"imgur": "Imgur",
|
||||||
|
"reddit": "Reddit",
|
||||||
|
"twitter": "Twitter",
|
||||||
|
"facebook": "Facebook",
|
||||||
|
"pinterest": "Pinterest",
|
||||||
|
"vkontakte": "VKontakte"
|
||||||
|
},
|
||||||
|
"link": {
|
||||||
|
"title": "Glitch!",
|
||||||
|
"description": {
|
||||||
|
"withoutname": "Check out what I made with this glitch tool:",
|
||||||
|
"withname": "Check out what I made with @snorpey’s glitch tool:",
|
||||||
|
"edited": "I made this with snorpey’s glitch tool:"
|
||||||
|
}
|
||||||
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"base64": "No base64 URL to upload.",
|
"base64": "No base64 URL to upload.",
|
||||||
"upload": "Could not upload file to Imgur.",
|
"upload": "Could not upload file to Imgur.",
|
||||||
@ -129,7 +141,7 @@
|
|||||||
"webcamlabel": "Take a Picture",
|
"webcamlabel": "Take a Picture",
|
||||||
"trigger": "Take Picture",
|
"trigger": "Take Picture",
|
||||||
"triggertitle": "Click to take a picture with your webcam",
|
"triggertitle": "Click to take a picture with your webcam",
|
||||||
"picture": "'Webcam Picture {$1}",
|
"picture": "Webcam Picture {$1}",
|
||||||
"error": {
|
"error": {
|
||||||
"access": "Could not access your webcam."
|
"access": "Could not access your webcam."
|
||||||
}
|
}
|
||||||
|
|||||||
156
lang/ru-ru.json
Normal file
156
lang/ru-ru.json
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
{
|
||||||
|
"lang": "ru-RU",
|
||||||
|
"index": {
|
||||||
|
"title": "Программа для обработки изображений",
|
||||||
|
"description": [
|
||||||
|
"С помощью этого приложения, Вы можете обрабатывать Ваши собственные изображения, перетаскивая их в окне браузера. Используйте ползунки в панели управления, чтобы изменить параметры обработок. Изображение обновляется в режиме реального времени.",
|
||||||
|
"Это приложение несколько изменяет размер картинки [JPEG](https://en.wikipedia.org/wiki/JPEG) ,что нисколько не влияет на качество изображения. Эта программа была результатом вдохновления [soulwire](http://github.com/soulwire) [экспериментом](http://blog.soulwire.co.uk/laboratory/flash/as3-bitmapdata-glitch-generator) в Flash.",
|
||||||
|
"Этот редактор был создан [Георгом](http://snorpey.com/). Он всегда рад когда его программами пользуются и будет рад Вашему отзыву. Вы можете следить за ним на [Twitter](https://twitter.com/snorpey) или ознакомится с исходным кодом этого приложения на [GitHub](https://github.com/snorpey/jpg-glitch).",
|
||||||
|
"Если Вам понравилась эта программа по обработке изображений, то Вы можете проверить некоторые из других [JavaScript экспериментов Георга](http://snorpey.github.io/experiments/)."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"settings": "Настройки",
|
||||||
|
"settingstitle": "Изменить настройки программы",
|
||||||
|
"canzoomwithpointer": "Изменить масштаб изображения с помощью колеса мышки и прикасания",
|
||||||
|
"language": "Язык",
|
||||||
|
"languageoptions": {
|
||||||
|
"de-de": "Deutsch (German)",
|
||||||
|
"en-us": "English (American English)",
|
||||||
|
"en-gb": "English (British English)",
|
||||||
|
"ru-ru": "Русский (Russian)"
|
||||||
|
},
|
||||||
|
"resizeuploadedimages": "Изменить размер больших изображений во избежание ошибок",
|
||||||
|
"error": {
|
||||||
|
"save": "Не удалось сохранить настройки в своем браузере.",
|
||||||
|
"load": "Не удалось загрузить предыдущие настройки из браузера."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"about": {
|
||||||
|
"info": "Информация",
|
||||||
|
"infotitle": "Дополнительная Информация"
|
||||||
|
},
|
||||||
|
"controls": {
|
||||||
|
"controls": "Управления",
|
||||||
|
"controlstitle": "Показать и скрыть элементы управления",
|
||||||
|
"randomize": "Случайные настройки",
|
||||||
|
"randomizetitle": "Выбрать случайные контрольные значения",
|
||||||
|
"center": "Центр",
|
||||||
|
"centertitle": "Масштабировать изображение на весь экран",
|
||||||
|
"original": "100%",
|
||||||
|
"originaltitle": "Увеличить изображение до его исходного размера (100%)",
|
||||||
|
"zoom": "Масштабирование",
|
||||||
|
"amount": "Количество",
|
||||||
|
"seed": "Начальное значение",
|
||||||
|
"iterations": "Повторения",
|
||||||
|
"quality": "Качество",
|
||||||
|
"fullscreen": "Полноэкранный режим",
|
||||||
|
"fullscreentitle": "Включение и выключение полноэкранного режима"
|
||||||
|
},
|
||||||
|
"nav": {
|
||||||
|
"menu": "Меню",
|
||||||
|
"menutitle": "Включение и выключение главного меню"
|
||||||
|
},
|
||||||
|
"file": {
|
||||||
|
"open": "Открыть",
|
||||||
|
"opentitle": "Открыть изображение с Вашего устройства",
|
||||||
|
"import": "Импортировать файл",
|
||||||
|
"importtitle": "Откройте изображение с жесткого диска",
|
||||||
|
"recent": "Изображения с предыдущих сессий",
|
||||||
|
"norecent": "Нет доступа к недавно отредактированным файлам",
|
||||||
|
"untitled": "Без имени",
|
||||||
|
"del": "Удалить",
|
||||||
|
"deltitle": "Удалить это изображение с браузера",
|
||||||
|
"openimage": "Открыть",
|
||||||
|
"openimagetitle": "Загрузить изображение",
|
||||||
|
"offline": "Взять с форума",
|
||||||
|
"offlinetitle": "Удалить изображение с Imgur",
|
||||||
|
"openlink": "Открыть ссылку",
|
||||||
|
"openlinktitle": "Открыть изображение в новой вкладке",
|
||||||
|
"save": "Сохранить",
|
||||||
|
"savetitle": "Сохранить текущее изображение для более поздних сессий",
|
||||||
|
"download": "Загрузить изображение",
|
||||||
|
"downloadtitle": "Загрузить обработанное изображение на свое устройство",
|
||||||
|
"saveinbrowser": "Сохранить",
|
||||||
|
"saveinbrowsertitle": "Сохранить изображение в своем браузере",
|
||||||
|
"error": {
|
||||||
|
"load": "Не удалось получить данные предыдущего сеанса из браузера.",
|
||||||
|
"save": "Не удалось сохранить данные вашего браузера.",
|
||||||
|
"openimage": "Не удалось открыть изображение",
|
||||||
|
"openfile": "Не удалось открыть файл."
|
||||||
|
},
|
||||||
|
"message": {
|
||||||
|
"before": "Этот файл был сохранен ранее.",
|
||||||
|
"save": "Файл был сохранен в браузере.",
|
||||||
|
"del": "Файл был удален из вашего браузера.",
|
||||||
|
"resize": "Изображение было уменьшено во избежание ошибок."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"share": {
|
||||||
|
"share": "Поделиться",
|
||||||
|
"sharetitle": "Поделиться изображением в интернете",
|
||||||
|
"info": [
|
||||||
|
"Вы можете загрузить изображение на [Imgur](https://imgur.com) чтобы поделиться им.",
|
||||||
|
"Пожалуйста, обратите внимание, что после загрузки изображение будет общедоступно в Imgur и Вы соглашаетесь с пользовательским соглашением [Imgur](https://imgur.com/tos)."
|
||||||
|
],
|
||||||
|
"openon": "Открыть изображение на {$1}",
|
||||||
|
"openontitle": "Открыть изображение, которым Вы поделились на {$1}",
|
||||||
|
"shareon": "Поделиться на {$1}",
|
||||||
|
"shareontitle": "Поделиться отредактированным изображением на {$1}",
|
||||||
|
"upload": "Загрузить изображение на Imgur",
|
||||||
|
"uploadtitle": "Загрузить изображение на Imgur для того чтобы поделиться им с остальными",
|
||||||
|
"uploading": "Изображение загружается …",
|
||||||
|
"imagelink": "Ссылка на изображение",
|
||||||
|
"imagelinktitle": "Вы можете использовать эту ссылку, чтобы поделиться изображением или загрузить его на другие сайты",
|
||||||
|
"opennewtabtitle": "Открыть изображение в новом окне",
|
||||||
|
"recentlyshared": "Недавние фото которыми Вы поделились",
|
||||||
|
"untitled": "Без имени",
|
||||||
|
"openlink": "Открыть ссылку",
|
||||||
|
"openlinktitle": "Открыть изображение в новом окне",
|
||||||
|
"offline": "Взять с форума",
|
||||||
|
"offlinetitle": "Удалить изображение с Imgur",
|
||||||
|
"target": {
|
||||||
|
"imgur": "Imgur",
|
||||||
|
"reddit": "Reddit",
|
||||||
|
"twitter": "Twitter",
|
||||||
|
"facebook": "Facebook",
|
||||||
|
"pinterest": "Pinterest",
|
||||||
|
"vkontakte": "Вконтакте"
|
||||||
|
},
|
||||||
|
"link": {
|
||||||
|
"title": "Glitch!",
|
||||||
|
"description": {
|
||||||
|
"withoutname": "Смотри, что я сделал с помощью этой программы:",
|
||||||
|
"withname": "Посмотри,что я сделал с фоторедактором @snorpey’s Glitch Tool:",
|
||||||
|
"edited": "Я обработал это изображение в snorpey’s Glitch Tool:"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"error": {
|
||||||
|
"base64": "Ошибка при загрузке.",
|
||||||
|
"upload": "Невозможно загрузить файл на Imgur.",
|
||||||
|
"del": "Невозможно удалить файл с Imgur."
|
||||||
|
},
|
||||||
|
"message": {
|
||||||
|
"upload": "Изображение было успешно загружено на Imgur [Открыть изображение]({$1}).",
|
||||||
|
"del": "Изображение было успешно удалено из Imgur."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"webcam": {
|
||||||
|
"webcam": "Веб-камера",
|
||||||
|
"webcamtitle": "Сделать фото веб-камерой",
|
||||||
|
"webcamlabel": "Фото",
|
||||||
|
"trigger": "Сделать фото",
|
||||||
|
"triggertitle": "Нажмите, чтобы сфотографироваться веб-камерой",
|
||||||
|
"picture": "Фото с веб-камеры {$1}",
|
||||||
|
"error": {
|
||||||
|
"access": "Не удалось получить доступ к Вашей веб-камере."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"welcome": {
|
||||||
|
"firstvisit": [
|
||||||
|
"Добро Пожаловать! Кажется, ты здесь впервые.",
|
||||||
|
"Для начала, перетащите ползунок ниже для обработки изображения.",
|
||||||
|
"Вы также можете импортировать изображения с устройства. Просто нажмите на кнопку ОТКРЫТЬ в меню."
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -36,13 +36,23 @@ define(
|
|||||||
settings: {
|
settings: {
|
||||||
canZoomWithPointer: { value: true },
|
canZoomWithPointer: { value: true },
|
||||||
resizeUploadedImages: { value: true },
|
resizeUploadedImages: { value: true },
|
||||||
language: { value: 'en-us', options: [ 'en-us', 'en-gb', 'de-de' ] }
|
language: { value: 'en-us', options: [ 'en-us', 'en-gb', 'de-de', 'ru-ru' ] }
|
||||||
},
|
},
|
||||||
localForage: {
|
localForage: {
|
||||||
name : 'glitchtool',
|
name : 'glitchtool',
|
||||||
storeName : 'keyvaluepairs'
|
storeName : 'keyvaluepairs'
|
||||||
},
|
},
|
||||||
origin: location.protocol + '//' + location.host + ( location.port !== '' ? ':' + location.port : '' )
|
origin: location.protocol + '//' + location.host + ( location.port !== '' ? ':' + location.port : '' ),
|
||||||
|
share: {
|
||||||
|
appURL: 'https://snorpey.github.io/jpg-glitch',
|
||||||
|
sharer: {
|
||||||
|
facebook: 'https://www.facebook.com/sharer/sharer.php',
|
||||||
|
twitter: 'https://twitter.com/intent/tweet',
|
||||||
|
reddit: 'https://www.reddit.com/submit',
|
||||||
|
pinterest: 'https://pinterest.com/pin/create/button/',
|
||||||
|
vkontakte: 'http://vk.com/share.php'
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -77,9 +77,8 @@ define(
|
|||||||
if ( el && attribute && key ) {
|
if ( el && attribute && key ) {
|
||||||
textElData.push( { el: el, attribute: attribute, key: key, wasUpdated: false, args: getArgs( arguments ) } );
|
textElData.push( { el: el, attribute: attribute, key: key, wasUpdated: false, args: getArgs( arguments ) } );
|
||||||
} else {
|
} else {
|
||||||
if ( typeof el === 'string' ) {
|
var args = getArgs( arguments, 1 );
|
||||||
return getTextForKey( el, getArgs( arguments, 1 ) );
|
return getTextForKey( el, getArgs( arguments, 1 ) );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateAllTexts();
|
updateAllTexts();
|
||||||
@ -191,7 +190,14 @@ define(
|
|||||||
|
|
||||||
args.forEach( function ( arg, index ) {
|
args.forEach( function ( arg, index ) {
|
||||||
regex = new RegExp( '{\\$' + ( index + 1 ) + '}' );
|
regex = new RegExp( '{\\$' + ( index + 1 ) + '}' );
|
||||||
result = result.replace( regex, arg );
|
|
||||||
|
if ( typeof arg === 'string' ) {
|
||||||
|
result = result.replace( regex, arg );
|
||||||
|
} else {
|
||||||
|
if ( typeof arg === 'function' ) {
|
||||||
|
result = result.replace( regex, arg() );
|
||||||
|
}
|
||||||
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -69,11 +69,26 @@ define(
|
|||||||
endTag;
|
endTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// http://stackoverflow.com/a/1714899/229189
|
||||||
|
function objToQueryStr ( obj, prefix ) {
|
||||||
|
var str = [ ];
|
||||||
|
|
||||||
|
for ( var p in obj ) {
|
||||||
|
if ( obj.hasOwnProperty( p ) ) {
|
||||||
|
var k = prefix ? prefix + '[' + p + ']' : p, v = obj[p];
|
||||||
|
str.push( typeof v === 'object' ? objToQueryStr( v, k ) : encodeURIComponent( k ) + '=' + encodeURIComponent( v ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return str.join( '&' );
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
toCamelCase: toCamelCase,
|
toCamelCase: toCamelCase,
|
||||||
autop: autop,
|
autop: autop,
|
||||||
markdownToHtml: markdownToHtml,
|
markdownToHtml: markdownToHtml,
|
||||||
markdownLinksToHtml: markdownLinksToHtml
|
markdownLinksToHtml: markdownLinksToHtml,
|
||||||
|
objToQueryStr: objToQueryStr
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*global define*/
|
/*global define*/
|
||||||
define(
|
define(
|
||||||
[ 'util/el' ],
|
[ 'util/el', 'util/localizetext' ],
|
||||||
function ( elHelper ) {
|
function ( elHelper, loc ) {
|
||||||
// the app view, wrapping element of the app
|
// the app view, wrapping element of the app
|
||||||
// also updates the html element classes
|
// also updates the html element classes
|
||||||
function AppView ( parentEl ) {
|
function AppView ( parentEl ) {
|
||||||
@ -12,6 +12,9 @@ define(
|
|||||||
var self = this;
|
var self = this;
|
||||||
var el = elHelper.createEl( 'div', 'app', parentEl );
|
var el = elHelper.createEl( 'div', 'app', parentEl );
|
||||||
|
|
||||||
|
loc( document.title, 'textContent', 'index.title' );
|
||||||
|
loc( document.documentElement, 'lang', 'lang' );
|
||||||
|
|
||||||
function showOnlineOptions () {
|
function showOnlineOptions () {
|
||||||
document.documentElement.classList.add( 'is-online' );
|
document.documentElement.classList.add( 'is-online' );
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/*global define*/
|
/*global define*/
|
||||||
define(
|
define(
|
||||||
[ 'util/addpublishers', 'util/el' ],
|
[ 'util/addpublishers', 'util/el', 'util/localizetext' ],
|
||||||
function ( addPublishers, elHelper ) {
|
function ( addPublishers, elHelper, loc ) {
|
||||||
// the control elements are used to change the appearance of the image
|
// the control elements are used to change the appearance of the image
|
||||||
function ControlsView ( parentEl, buttonParentEl, params ) {
|
function ControlsView ( parentEl, buttonParentEl, params ) {
|
||||||
if ( ! ( this instanceof ControlsView ) ) {
|
if ( ! ( this instanceof ControlsView ) ) {
|
||||||
@ -44,7 +44,8 @@ define(
|
|||||||
function addControl ( key, params ) {
|
function addControl ( key, params ) {
|
||||||
var controlEl = elHelper.createEl( 'div', 'control', controlsWrapperEl );
|
var controlEl = elHelper.createEl( 'div', 'control', controlsWrapperEl );
|
||||||
|
|
||||||
elHelper.createLabel( 'controls.' + key, 'input-' + key, 'control-label', controlEl );
|
var labelEl = elHelper.createLabel( 'controls.' + key, 'input-' + key, 'control-label', controlEl );
|
||||||
|
loc( labelEl, 'title', 'controls.' + key );
|
||||||
|
|
||||||
var inputEl = elHelper.createEl( 'input', 'control-input', controlEl );
|
var inputEl = elHelper.createEl( 'input', 'control-input', controlEl );
|
||||||
inputEl.setAttribute( 'data-key', key );
|
inputEl.setAttribute( 'data-key', key );
|
||||||
|
|||||||
@ -57,7 +57,7 @@ define(
|
|||||||
buttonEl.addEventListener( 'click', toggle, false );
|
buttonEl.addEventListener( 'click', toggle, false );
|
||||||
|
|
||||||
var headlineEl = elHelper.createEl( 'h1', 'nav-headline', el );
|
var headlineEl = elHelper.createEl( 'h1', 'nav-headline', el );
|
||||||
headlineEl.textContent = document.title;
|
loc( headlineEl, 'textContent', 'index.title' );
|
||||||
|
|
||||||
var navBreakPoint = 600;
|
var navBreakPoint = 600;
|
||||||
var navWidth = 300;
|
var navWidth = 300;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/*global define*/
|
/*global define*/
|
||||||
define(
|
define(
|
||||||
[ 'util/addpublishers', 'views/dialog', 'util/el', 'util/browser', 'util/time', 'util/localizetext' ],
|
[ 'config', 'util/addpublishers', 'views/dialog', 'util/el', 'util/browser', 'util/time', 'util/string', 'util/localizetext' ],
|
||||||
function ( addPublishers, Dialog, elHelper, browser, timeHelper, loc ) {
|
function ( config, addPublishers, Dialog, elHelper, browser, timeHelper, strHelper, loc ) {
|
||||||
// shareview lets users upload their glitched image to imgur and
|
// shareview lets users upload their glitched image to imgur and
|
||||||
// share links on social media
|
// share links on social media
|
||||||
function ShareView ( parentEl ) {
|
function ShareView ( parentEl ) {
|
||||||
@ -39,24 +39,28 @@ define(
|
|||||||
imgLinkEl.id = 'img-link-input';
|
imgLinkEl.id = 'img-link-input';
|
||||||
|
|
||||||
var imgurLinkEl = elHelper.createLink( null, null, null, blankTargetStr, 'imgur-link button' );
|
var imgurLinkEl = elHelper.createLink( null, null, null, blankTargetStr, 'imgur-link button' );
|
||||||
loc( imgurLinkEl, 'textContent', 'share.openon', 'Imgur' );
|
loc( imgurLinkEl, 'textContent', 'share.openon', getLocFn( 'share.target.imgur' ) );
|
||||||
loc( imgurLinkEl, 'title', 'share.openontitle', 'Imgur' );
|
loc( imgurLinkEl, 'title', 'share.openontitle', getLocFn( 'share.target.imgur' ) );
|
||||||
|
|
||||||
var redditShareLinkEl = elHelper.createLink( null, null, null, blankTargetStr, 'reddit-link button' );
|
var redditShareLinkEl = elHelper.createLink( null, null, null, blankTargetStr, 'reddit-link button' );
|
||||||
loc( redditShareLinkEl, 'textContent', 'share.shareon', 'Reddit' );
|
loc( redditShareLinkEl, 'textContent', 'share.shareon', getLocFn( 'share.target.reddit' ) );
|
||||||
loc( redditShareLinkEl, 'title', 'share.shareontitle', 'Reddit' );
|
loc( redditShareLinkEl, 'title', 'share.shareontitle', getLocFn( 'share.target.reddit' ) );
|
||||||
|
|
||||||
var twitterShareLinkEl = elHelper.createLink( null, null, null, blankTargetStr, 'twitter-link button' );
|
var twitterShareLinkEl = elHelper.createLink( null, null, null, blankTargetStr, 'twitter-link button' );
|
||||||
loc( twitterShareLinkEl, 'textContent', 'share.shareon', 'Twitter' );
|
loc( twitterShareLinkEl, 'textContent', 'share.shareon', getLocFn( 'share.target.twitter' ) );
|
||||||
loc( twitterShareLinkEl, 'title', 'share.shareontitle', 'Twitter' );
|
loc( twitterShareLinkEl, 'title', 'share.shareontitle', getLocFn( 'share.target.twitter' ) );
|
||||||
|
|
||||||
var facebookShareLinkEl = elHelper.createLink( null, null, null, blankTargetStr, 'facebook-link button' );
|
var facebookShareLinkEl = elHelper.createLink( null, null, null, blankTargetStr, 'facebook-link button' );
|
||||||
loc( facebookShareLinkEl, 'textContent', 'share.shareon', 'Facebook' );
|
loc( facebookShareLinkEl, 'textContent', 'share.shareon', getLocFn( 'share.target.facebook' ) );
|
||||||
loc( facebookShareLinkEl, 'title', 'share.shareontitle', 'Facebook' );
|
loc( facebookShareLinkEl, 'title', 'share.shareontitle', getLocFn( 'share.target.facebook' ) );
|
||||||
|
|
||||||
var pinterestShareLinkEl = elHelper.createLink( null, null, null, blankTargetStr, 'pinterest-link button' );
|
var pinterestShareLinkEl = elHelper.createLink( null, null, null, blankTargetStr, 'pinterest-link button' );
|
||||||
loc( pinterestShareLinkEl, 'textContent', 'share.shareon', 'Pinterest' );
|
loc( pinterestShareLinkEl, 'textContent', 'share.shareon', getLocFn( 'share.target.pinterest' ) );
|
||||||
loc( pinterestShareLinkEl, 'title', 'share.shareontitle', 'Pinterest' );
|
loc( pinterestShareLinkEl, 'title', 'share.shareontitle', getLocFn( 'share.target.pinterest' ) );
|
||||||
|
|
||||||
|
var vkontakteShareLinkEl = elHelper.createLink( null, null, null, blankTargetStr, 'vkontakte-link button' );
|
||||||
|
loc( vkontakteShareLinkEl, 'textContent', 'share.shareon', getLocFn( 'share.target.vkontakte' ) );
|
||||||
|
loc( vkontakteShareLinkEl, 'title', 'share.shareontitle', getLocFn( 'share.target.vkontakte' ) );
|
||||||
|
|
||||||
var sharedListEl;
|
var sharedListEl;
|
||||||
|
|
||||||
@ -69,7 +73,8 @@ define(
|
|||||||
.add( isOnlineCssClass, redditShareLinkEl )
|
.add( isOnlineCssClass, redditShareLinkEl )
|
||||||
.add( isOnlineCssClass, twitterShareLinkEl )
|
.add( isOnlineCssClass, twitterShareLinkEl )
|
||||||
.add( isOnlineCssClass, facebookShareLinkEl )
|
.add( isOnlineCssClass, facebookShareLinkEl )
|
||||||
.add( isOnlineCssClass, pinterestShareLinkEl );
|
.add( isOnlineCssClass, pinterestShareLinkEl )
|
||||||
|
.add( isOnlineCssClass, vkontakteShareLinkEl );
|
||||||
|
|
||||||
if ( browser.test( 'localforage' ) ) {
|
if ( browser.test( 'localforage' ) ) {
|
||||||
sharedListEl = elHelper.createEl( 'ul', 'shared-list dialog-list' );
|
sharedListEl = elHelper.createEl( 'ul', 'shared-list dialog-list' );
|
||||||
@ -89,16 +94,19 @@ define(
|
|||||||
function updateShareUrl ( imgUrl, imgId ) {
|
function updateShareUrl ( imgUrl, imgId ) {
|
||||||
clearTimeout( clearTimeoutId );
|
clearTimeout( clearTimeoutId );
|
||||||
|
|
||||||
|
var imgurLink = 'https://imgur.com/' + imgId;
|
||||||
|
|
||||||
dialog.el.classList.add( 'has-links' );
|
dialog.el.classList.add( 'has-links' );
|
||||||
imgLinkEl.textContent = imgUrl;
|
imgLinkEl.textContent = imgUrl;
|
||||||
imgLinkEl.href = imgUrl;
|
imgLinkEl.href = imgUrl;
|
||||||
imgLinkEl.setAttribute( 'data-imgurid', imgId );
|
imgLinkEl.setAttribute( 'data-imgurid', imgId );
|
||||||
imgurLinkEl.href = 'https://imgur.com/' + imgId;
|
imgurLinkEl.href = imgurLink;
|
||||||
|
|
||||||
redditShareLinkEl.href = getRedditShareUrl( imgUrl );
|
redditShareLinkEl.href = getShareUrl( 'reddit', imgUrl, imgurLink );
|
||||||
twitterShareLinkEl.href = getTwitterShareUrl( imgUrl );
|
twitterShareLinkEl.href = getShareUrl( 'twitter', imgUrl, imgurLink );
|
||||||
facebookShareLinkEl.href = getFacebookShareUrl( imgUrl );
|
facebookShareLinkEl.href = getShareUrl( 'facebook', imgUrl, imgurLink );
|
||||||
pinterestShareLinkEl.href = getPinterestShareUrl( imgUrl );
|
pinterestShareLinkEl.href = getShareUrl( 'pinterest', imgUrl, imgurLink );
|
||||||
|
vkontakteShareLinkEl.href = getShareUrl( 'vkontakte', imgUrl, imgurLink );
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearShareUrl () {
|
function clearShareUrl () {
|
||||||
@ -286,39 +294,48 @@ define(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getShareDescription ( imgUrl ) {
|
// https://gist.github.com/dr-dimitru/7164862
|
||||||
return 'Check out what I made with @snorpey’s glitch tool: ' + imgUrl + ' https://snorpey.github.io/jpg-glitch';
|
function getShareUrl ( service, imgUrl, imgurLink ) {
|
||||||
|
var description = loc( 'share.link.description.edited' );
|
||||||
|
var title = loc( 'share.link.title' );
|
||||||
|
var params = { };
|
||||||
|
|
||||||
|
if ( [ 'reddit', 'vkontakte' ].indexOf( service ) !== -1 ) {
|
||||||
|
params.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( [ 'pinterest', 'vkontakte' ].indexOf( service ) !== -1 ) {
|
||||||
|
params.description = description + ' ' + config.share.appURL;
|
||||||
|
params.url = config.appURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( service === 'pinterest' ) {
|
||||||
|
params.media = imgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( service === 'vkontakte' ) {
|
||||||
|
params.image = imgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( service === 'reddit' ) {
|
||||||
|
params.url = imgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( service === 'facebook' ) {
|
||||||
|
params.u = imgurLink;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( service === 'twitter' ) {
|
||||||
|
params.text = loc( 'share.link.description.withname' ) + ' ' + imgUrl + ' ' + config.share.appURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return config.share.sharer[service] + '?' + strHelper.objToQueryStr( params );
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTwitterShareUrl ( imgUrl ) {
|
function getLocFn ( key ) {
|
||||||
return 'https://twitter.com/intent/tweet?text=' + encodeURIComponent( getShareDescription( imgUrl ) );
|
return function () {
|
||||||
}
|
return loc( key );
|
||||||
|
}
|
||||||
function getRedditShareUrl ( imgUrl ) {
|
|
||||||
return 'https://www.reddit.com/submit?url=' + encodeURIComponent( imgUrl ) + '&title=Glitch!';
|
|
||||||
}
|
|
||||||
|
|
||||||
// http://ar.zu.my/how-to-really-customize-the-deprecated-facebook-sharer-dot-php/
|
|
||||||
function getFacebookShareUrl ( imgUrl ) {
|
|
||||||
var text = 'Check out what I made with this glitch tool: https://snorpey.github.io/jpg-glitch';
|
|
||||||
var shareUrl = 'https://www.facebook.com/sharer/sharer.php?s=100';
|
|
||||||
shareUrl += '&p[url]=' + imgUrl;
|
|
||||||
shareUrl += '&p[title]=Glitch!';
|
|
||||||
shareUrl += '&p[images][0]=' + imgUrl;
|
|
||||||
shareUrl += '&p[summary]=' + encodeURIComponent( text );
|
|
||||||
|
|
||||||
return shareUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPinterestShareUrl ( imgUrl ) {
|
|
||||||
var text = 'I made this with snorpey\'s glitch tool: https://snorpey.github.io/jpg-glitch';
|
|
||||||
var link = 'https://snorpey.github.io/jpg-glitch';
|
|
||||||
var shareUrl = 'https://pinterest.com/pin/create/button/';
|
|
||||||
shareUrl += '?url=' + encodeURIComponent( link );
|
|
||||||
shareUrl += '&media=' + encodeURIComponent( imgUrl );
|
|
||||||
shareUrl += '&description=' + encodeURIComponent( text );
|
|
||||||
|
|
||||||
return shareUrl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.showUpload = showUpload;
|
self.showUpload = showUpload;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
.about-content {
|
.about-content {
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
max-height: calc(100vh - 270px);
|
max-height: calc(100vh - 355px);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding-bottom: 15px;
|
padding-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
float: left;
|
float: left;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 60px;
|
max-width: 70px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
@ -72,7 +72,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
min-height: 10px;
|
min-height: 10px;
|
||||||
max-width: calc(100% - 105px);
|
max-width: calc(100% - 115px);
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
@ -96,6 +96,11 @@
|
|||||||
|
|
||||||
.controls .random-button {
|
.controls .random-button {
|
||||||
display: none;
|
display: none;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 90px;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*two columns*/
|
/*two columns*/
|
||||||
|
|||||||
@ -282,7 +282,7 @@
|
|||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-touch .share-dialog.is-active {
|
.share-dialog.is-active {
|
||||||
max-height: calc(100vh - 270px);
|
max-height: calc(100vh - 270px);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -124,7 +124,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.nav-headline {
|
.nav-headline {
|
||||||
height: 50px;
|
/*height: 50px;*/
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user