Merge branch 'feature/browsercheck' into develop
This commit is contained in:
commit
434062efdb
10 changed files with 204 additions and 23 deletions
|
@ -400,6 +400,20 @@ class App.ControllerModal extends App.Controller
|
||||||
# @callback.error = options.error
|
# @callback.error = options.error
|
||||||
|
|
||||||
super(options)
|
super(options)
|
||||||
|
if options.show
|
||||||
|
@render()
|
||||||
|
|
||||||
|
render: ->
|
||||||
|
@html App.view('modal')(
|
||||||
|
title: @title,
|
||||||
|
message: @message
|
||||||
|
detail: @detail
|
||||||
|
close: @close
|
||||||
|
)
|
||||||
|
@modalShow(
|
||||||
|
backdrop: @backdrop,
|
||||||
|
keyboard: @keyboard,
|
||||||
|
)
|
||||||
|
|
||||||
modalShow: (params) ->
|
modalShow: (params) ->
|
||||||
defaults = {
|
defaults = {
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
class App.ContentPermanentWidget extends App.ControllerPermanent
|
|
||||||
className: 'container aaa'
|
|
||||||
|
|
||||||
constructor: ->
|
|
||||||
super
|
|
||||||
|
|
||||||
App.Config.set( 'content_permanent', App.ContentPermanentWidget, 'Widgets' )
|
|
15
app/assets/javascripts/app/controllers/footer.js.coffee
Normal file
15
app/assets/javascripts/app/controllers/footer.js.coffee
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
class App.Footer extends App.Controller
|
||||||
|
className: 'container'
|
||||||
|
|
||||||
|
constructor: ->
|
||||||
|
super
|
||||||
|
@render()
|
||||||
|
|
||||||
|
# rebuild ticket overview data
|
||||||
|
App.Event.bind 'ui:rerender', =>
|
||||||
|
@render()
|
||||||
|
|
||||||
|
render: () ->
|
||||||
|
@html App.view('footer')()
|
||||||
|
|
||||||
|
App.Config.set( 'zzzfooter', App.Footer, 'Widgets' )
|
138
app/assets/javascripts/app/lib/app_post/browser.coffee
Normal file
138
app/assets/javascripts/app/lib/app_post/browser.coffee
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
class App.Browser
|
||||||
|
@detection: ->
|
||||||
|
data =
|
||||||
|
browser: @searchString(@dataBrowser) or "An unknown browser"
|
||||||
|
version: @searchVersion(navigator.userAgent) or @searchVersion(navigator.appVersion) or "an unknown version"
|
||||||
|
OS: @searchString(@dataOS) or "an unknown OS"
|
||||||
|
|
||||||
|
@check: ->
|
||||||
|
data = @detection()
|
||||||
|
|
||||||
|
# disable Crome 13 and older
|
||||||
|
if data.browser == 'Chrome' && data.version <= 13
|
||||||
|
@message(data)
|
||||||
|
return false
|
||||||
|
|
||||||
|
# disable Firefox 6 and older
|
||||||
|
else if data.browser == 'Firefox' && data.version <= 6
|
||||||
|
@message(data)
|
||||||
|
return false
|
||||||
|
|
||||||
|
# disable IE 8 and older
|
||||||
|
else if data.browser == 'Explorer' && data.version <= 8
|
||||||
|
@message(data)
|
||||||
|
return false
|
||||||
|
|
||||||
|
# disable Safari 3 and older
|
||||||
|
else if data.browser == 'Firefox' && data.version <= 3
|
||||||
|
@message(data)
|
||||||
|
return false
|
||||||
|
|
||||||
|
# disable Opera 10 and older
|
||||||
|
else if data.browser == 'Firefox' && data.version <= 10
|
||||||
|
@message(data)
|
||||||
|
return false
|
||||||
|
|
||||||
|
return true
|
||||||
|
|
||||||
|
@message: (data) ->
|
||||||
|
new App.ControllerModal(
|
||||||
|
title: 'Browser too old!'
|
||||||
|
message: "Your Browser is not supported. Please use a newer one (#{data.browser} #{data.version} #{data.OS})"
|
||||||
|
show: true
|
||||||
|
backdrop: false
|
||||||
|
keyboard: false
|
||||||
|
)
|
||||||
|
|
||||||
|
@searchString: (data) ->
|
||||||
|
i = 0
|
||||||
|
|
||||||
|
while i < data.length
|
||||||
|
dataString = data[i].string
|
||||||
|
dataProp = data[i].prop
|
||||||
|
@versionSearchString = data[i].versionSearch or data[i].identity
|
||||||
|
if dataString
|
||||||
|
return data[i].identity unless dataString.indexOf(data[i].subString) is -1
|
||||||
|
else return data[i].identity if dataProp
|
||||||
|
i++
|
||||||
|
|
||||||
|
@searchVersion: (dataString) ->
|
||||||
|
index = dataString.indexOf(@versionSearchString)
|
||||||
|
return if index is -1
|
||||||
|
parseFloat dataString.substring(index + @versionSearchString.length + 1)
|
||||||
|
|
||||||
|
@dataBrowser: [
|
||||||
|
string: navigator.userAgent
|
||||||
|
subString: "Chrome"
|
||||||
|
identity: "Chrome"
|
||||||
|
,
|
||||||
|
string: navigator.userAgent
|
||||||
|
subString: "OmniWeb"
|
||||||
|
versionSearch: "OmniWeb/"
|
||||||
|
identity: "OmniWeb"
|
||||||
|
,
|
||||||
|
string: navigator.vendor
|
||||||
|
subString: "Apple"
|
||||||
|
identity: "Safari"
|
||||||
|
versionSearch: "Version"
|
||||||
|
,
|
||||||
|
prop: window.opera
|
||||||
|
identity: "Opera"
|
||||||
|
versionSearch: "Version"
|
||||||
|
,
|
||||||
|
string: navigator.vendor
|
||||||
|
subString: "iCab"
|
||||||
|
identity: "iCab"
|
||||||
|
,
|
||||||
|
string: navigator.vendor
|
||||||
|
subString: "KDE"
|
||||||
|
identity: "Konqueror"
|
||||||
|
,
|
||||||
|
string: navigator.userAgent
|
||||||
|
subString: "Firefox"
|
||||||
|
identity: "Firefox"
|
||||||
|
,
|
||||||
|
string: navigator.vendor
|
||||||
|
subString: "Camino"
|
||||||
|
identity: "Camino"
|
||||||
|
,
|
||||||
|
# for newer Netscapes (6+)
|
||||||
|
string: navigator.userAgent
|
||||||
|
subString: "Netscape"
|
||||||
|
identity: "Netscape"
|
||||||
|
,
|
||||||
|
string: navigator.userAgent
|
||||||
|
subString: "MSIE"
|
||||||
|
identity: "Explorer"
|
||||||
|
versionSearch: "MSIE"
|
||||||
|
,
|
||||||
|
string: navigator.userAgent
|
||||||
|
subString: "Gecko"
|
||||||
|
identity: "Mozilla"
|
||||||
|
versionSearch: "rv"
|
||||||
|
,
|
||||||
|
# for older Netscapes (4-)
|
||||||
|
string: navigator.userAgent
|
||||||
|
subString: "Mozilla"
|
||||||
|
identity: "Netscape"
|
||||||
|
versionSearch: "Mozilla"
|
||||||
|
]
|
||||||
|
@dataOS: [
|
||||||
|
string: navigator.platform
|
||||||
|
subString: "Win"
|
||||||
|
identity: "Windows"
|
||||||
|
,
|
||||||
|
string: navigator.platform
|
||||||
|
subString: "Mac"
|
||||||
|
identity: "Mac"
|
||||||
|
,
|
||||||
|
string: navigator.userAgent
|
||||||
|
subString: "iPhone"
|
||||||
|
identity: "iPhone/iPod"
|
||||||
|
,
|
||||||
|
string: navigator.platform
|
||||||
|
subString: "Linux"
|
||||||
|
identity: "Linux"
|
||||||
|
]
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,11 @@ class App.Run extends App.Controller
|
||||||
App.Event.trigger('app:init')
|
App.Event.trigger('app:init')
|
||||||
|
|
||||||
# browser check
|
# browser check
|
||||||
# App.Browser.check()
|
if !App.Browser.check()
|
||||||
|
return
|
||||||
|
|
||||||
|
# hide splash screen
|
||||||
|
$('#splash').hide()
|
||||||
|
|
||||||
# init collections
|
# init collections
|
||||||
App.Collection.init()
|
App.Collection.init()
|
||||||
|
@ -21,9 +25,13 @@ class App.Run extends App.Controller
|
||||||
App.Event.trigger('widget:init')
|
App.Event.trigger('widget:init')
|
||||||
widgets = App.Config.get( 'Widgets' )
|
widgets = App.Config.get( 'Widgets' )
|
||||||
if widgets
|
if widgets
|
||||||
for key, widget of widgets
|
sortedKeys = []
|
||||||
|
for key, value of widgets
|
||||||
|
sortedKeys.push key
|
||||||
|
sortedKeys = sortedKeys.sort()
|
||||||
|
for key in sortedKeys
|
||||||
@el.append('<div id="' + key + '"></div>')
|
@el.append('<div id="' + key + '"></div>')
|
||||||
new widget( el: @el.find("##{key}") )
|
new widgets[key]( el: @el.find("##{key}") )
|
||||||
App.Event.trigger('widget:ready')
|
App.Event.trigger('widget:ready')
|
||||||
|
|
||||||
# bind to fill selected text into
|
# bind to fill selected text into
|
||||||
|
|
|
@ -105,6 +105,10 @@ class _Singleton extends App.Controller
|
||||||
|
|
||||||
tasks = @all()
|
tasks = @all()
|
||||||
|
|
||||||
|
# create div for permanent content
|
||||||
|
if !$("#content_permanent")[0]
|
||||||
|
$('#app').append('<div id="content_permanent" class="container"></div>')
|
||||||
|
|
||||||
# empty static content if task is shown
|
# empty static content if task is shown
|
||||||
if active
|
if active
|
||||||
@activeTask = key
|
@activeTask = key
|
||||||
|
|
4
app/assets/javascripts/app/views/footer.jst.eco
Normal file
4
app/assets/javascripts/app/views/footer.jst.eco
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<footer class="footer">
|
||||||
|
<p class="pull-right"><a href="javascript:window.scrollTo(0,0);"><%- @T('Back to top') %></a></p>
|
||||||
|
<p><%- @T('Designed and built with all the love in the world') %> <a href="http://twitter.com/zammad_org">@zammad_org</a></p>
|
||||||
|
</footer>
|
|
@ -450,3 +450,17 @@ footer {
|
||||||
.sub_attribute .controls {
|
.sub_attribute .controls {
|
||||||
margin-left: 80px;
|
margin-left: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#splash {
|
||||||
|
background-color: #eee;
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
top: 0px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
#splash .logo {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
margin-top: 200px;
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
|
|
@ -1,14 +1,5 @@
|
||||||
|
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
<div id="splash"><div class="logo">booting...</div></div>
|
||||||
<div class="container">
|
|
||||||
<footer class="footer">
|
|
||||||
<!-- <p class="pull-right">Powered by <a href="" target="_blank">xxx</a></p>-->
|
|
||||||
<p class="pull-right"><a href="javascript:window.scrollTo(0,0);">Back to top</a></p>
|
|
||||||
<p>Designed and built with all the love in the world <a href="http://twitter.com/zammad_org">@zammad_org</a></p>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(function(){
|
jQuery(function(){
|
||||||
new App.Run();
|
new App.Run();
|
||||||
|
|
|
@ -1807,7 +1807,7 @@ Translation.create_if_not_exists( :locale => 'de', :source => "First Response Ti
|
||||||
Translation.create_if_not_exists( :locale => 'de', :source => "Update Time", :target => "Aktuallisierungszeit" )
|
Translation.create_if_not_exists( :locale => 'de', :source => "Update Time", :target => "Aktuallisierungszeit" )
|
||||||
Translation.create_if_not_exists( :locale => 'de', :source => "Solution Time", :target => "Lösungszeit" )
|
Translation.create_if_not_exists( :locale => 'de', :source => "Solution Time", :target => "Lösungszeit" )
|
||||||
Translation.create_if_not_exists( :locale => 'de', :source => "Add Attribute", :target => "Attribut hinzufügen" )
|
Translation.create_if_not_exists( :locale => 'de', :source => "Add Attribute", :target => "Attribut hinzufügen" )
|
||||||
Translation.create_if_not_exists( :locale => 'de', :source => "", :target => "" )
|
Translation.create_if_not_exists( :locale => 'de', :source => "Back to top", :target => "Nach oben" )
|
||||||
|
|
||||||
#Translation.create_if_not_exists( :locale => 'de', :source => "", :target => "" )
|
#Translation.create_if_not_exists( :locale => 'de', :source => "", :target => "" )
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue