-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add notification for old browsers #475
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ffb2a60
Add notification for old browsers
Trufi 1a2de61
Add will word in map museum option
Trufi a96c919
Increase museum z-index and use localstorage for disabling museum
Trufi ea56046
Fix comment translation
Trufi 5db92d7
Safari51 fix
Trufi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
.dg-museum { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
z-index: 500; | ||
padding: 4px 5px 8px; | ||
background: #333; | ||
color: #fff; | ||
opacity: .97; | ||
text-align: center; | ||
} | ||
|
||
.dg-museum-browser { | ||
position: relative; | ||
top: 4px; | ||
display: inline-block; | ||
width: 16px; | ||
height: 16px; | ||
margin: 0 4px; | ||
background: url('@{baseURL}/img/DGMuseum.jpg') left top no-repeat; | ||
} | ||
.dg-museum__chrome { | ||
background-position: 0 0; | ||
|
||
&:hover { | ||
background-position: 0 -16px; | ||
} | ||
} | ||
.dg-museum__firefox { | ||
background-position: -16px 0; | ||
|
||
&:hover { | ||
background-position: -16px -16px; | ||
} | ||
} | ||
.dg-museum__safari { | ||
background-position: -32px 0; | ||
|
||
&:hover { | ||
background-position: -32px -16px; | ||
} | ||
} | ||
.dg-museum__opera { | ||
width: 15px; | ||
background-position: -48px 0; | ||
|
||
&:hover { | ||
background-position: -48px -16px; | ||
} | ||
} | ||
.dg-museum__ie { | ||
width: 17px; | ||
background-position: -63px 0; | ||
|
||
&:hover { | ||
background-position: -63px -16px; | ||
} | ||
|
||
} | ||
.dg-museum__close { | ||
display: inline-block; | ||
margin: 0 4px; | ||
width: 9px; | ||
height: 9px; | ||
background: url('@{baseURL}/img/DGMuseum_close.gif') top left no-repeat; | ||
cursor: pointer; | ||
|
||
&:hover { | ||
opacity: .6; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
var ie9 = (function() { | ||
var div = document.createElement('div'); | ||
var all = div.getElementsByTagName('i'); | ||
div.innerHTML = '<!--[if IE 9]><i></i><![endif]-->'; | ||
return Boolean(all[0]); | ||
})(); | ||
|
||
DG.Map.mergeOptions({ | ||
museum: DG.Browser.ielt9 || ie9 || DG.Browser.opera12 || DG.Browser.safari51 | ||
}); | ||
|
||
DG.Map.Museum = DG.Handler.extend({ | ||
statics: { | ||
Dictionary: { | ||
ar: { | ||
wearesorry: 'لا نضمن لك تشغيل ثابت للتطبيق على متصفحك. حاول التحديث:' | ||
}, | ||
cs: { | ||
wearesorry: 'Nezaručujeme stabilní fungování aplikace ve Vašem prohlížeči. Zkuste provést aktualizaci:' | ||
}, | ||
en: { | ||
wearesorry: 'We do not guarantee stable operation of the application in your browser. Try updating:' | ||
}, | ||
es: { | ||
wearesorry: 'No garantizamos un funcionamiento estable de la aplicación en su buscador. Intente actualizarlo:' | ||
}, | ||
it: { | ||
wearesorry: 'Non garantiamo il funzionamento stabile dell\'applicazione nel tuo browser. Prova ad aggiornare:' | ||
}, | ||
ru: { | ||
wearesorry: 'Мы не гарантируем стабильную работу приложения в вашем браузере. Попробуйте обновиться:' | ||
} | ||
} | ||
}, | ||
|
||
includes: [DG.Locale], | ||
|
||
initialize: function(map) { | ||
this._map = map; | ||
|
||
this._element = document.createElement('div'); | ||
this._element.className = 'dg-museum'; | ||
this._element.innerHTML = '<span></span>' + | ||
'<a class="dg-museum-browser dg-museum__chrome" target="_blank" href="https://www.google.com/chrome/"></a>' + | ||
'<a class="dg-museum-browser dg-museum__firefox" target="_blank" href="https://www.mozilla.org/firefox/new/"></a>' + | ||
'<a class="dg-museum-browser dg-museum__safari" target="_blank" href="https://support.apple.com/downloads/safari"></a>' + | ||
'<a class="dg-museum-browser dg-museum__opera" target="_blank" href="https://www.opera.com/"></a>' + | ||
'<a class="dg-museum-browser dg-museum__ie" target="_blank" href="https://windows.microsoft.com/internet-explorer/download-ie"></a>'; | ||
|
||
this._text = this._element.children[0]; | ||
|
||
this._closeButton = document.createElement('span'); | ||
this._closeButton.className = 'dg-museum__close'; | ||
this._element.appendChild(this._closeButton); | ||
|
||
this._renderTranslation(); | ||
}, | ||
|
||
addHooks: function() { | ||
this._map.getContainer().appendChild(this._element); | ||
this._map.on('langchange', this._renderTranslation, this); | ||
DG.DomEvent.on(this._closeButton, 'click', this._onCloseButtonClick, this); | ||
}, | ||
|
||
removeHooks: function() { | ||
this._map.getContainer().removeChild(this._element); | ||
this._map.off('langchange', this._renderTranslation, this); | ||
DG.DomEvent.off(this._closeButton, 'click', this._onCloseButtonClick, this); | ||
}, | ||
|
||
_onCloseButtonClick: function(e) { | ||
DG.DomEvent.stop(e); | ||
this.disable(); | ||
}, | ||
|
||
_renderTranslation: function() { | ||
var lang = this._map.getLang(); | ||
this._text.innerHTML = this.t('wearesorry'); | ||
this._element.setAttribute('dir', lang === 'ar' ? 'rtl': 'ltr'); | ||
} | ||
}); | ||
|
||
DG.Map.addInitHook('addHandler', 'museum', DG.Map.Museum); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не стоит ли эту проверку в
DG.Browser
и вынести?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Думаю, что нет, так мы не будем расширять публичные методы и в будущем сможем без колебаний ее выпилить
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ОК