From b20d1c4e07f1375b3c03468f6d8b0134e55b7be1 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 14 Mar 2013 10:10:22 +0100 Subject: [PATCH] Fixed typos. --- .../app/lib/app_post/delay.js.coffee | 72 +++++++++++++++++++ .../javascripts/app/models/sla.js.coffee | 4 +- .../app/views/generic/table.jst.eco | 4 +- db/seeds.rb | 4 +- 4 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 app/assets/javascripts/app/lib/app_post/delay.js.coffee diff --git a/app/assets/javascripts/app/lib/app_post/delay.js.coffee b/app/assets/javascripts/app/lib/app_post/delay.js.coffee new file mode 100644 index 000000000..8a761fdef --- /dev/null +++ b/app/assets/javascripts/app/lib/app_post/delay.js.coffee @@ -0,0 +1,72 @@ +class App.Delay + _instance = undefined + + @set: ( callback, timeout, key, level ) -> + if _instance == undefined + _instance ?= new _Singleton + _instance.set( callback, timeout, key, level ) + + @clear: ( key ) -> + if _instance == undefined + _instance ?= new _Singleton + _instance.clear( key ) + + @clearLevel: ( level ) -> + if _instance == undefined + _instance ?= new _Singleton + _instance.clearLevel( level ) + +class _Singleton extends Spine.Module + @include App.Log + + constructor: -> + @levelStack = {} + + set: ( callback, timeout, key, level ) -> + + if !level + level = '_all' + + if !@levelStack[level] + @levelStack[level] = {} + + if key + @clear( key ) + + # setTimeout + @log 'Delay', 'debug', 'set', key, timeout, level, callback + call = => + @clear( key ) + callback() + delay_id = setTimeout( call, timeout ) + + # remember all delays + @levelStack[ level ][ key ] = { + delay_id: delay_id + timeout: timeout + level: level + } + + return delay_id + + clear: ( key ) -> + + if !level + level = '_all' + + if !@levelStack[ level ] + @levelStack[ level ] = {} + + # get global delay ids + data = @levelStack[ level ][ key ] + return if !data + + @log 'Delay', 'debug', 'clear', data + clearTimeout( data['delay_id'] ) + + clearLevel: (level) -> + return if !@levelStack[ level ] + for key, data of @levelStack[ level ] + @clear( key ) + @levelStack[level] = {} + diff --git a/app/assets/javascripts/app/models/sla.js.coffee b/app/assets/javascripts/app/models/sla.js.coffee index 4aead54b4..81a51135c 100644 --- a/app/assets/javascripts/app/models/sla.js.coffee +++ b/app/assets/javascripts/app/models/sla.js.coffee @@ -4,7 +4,7 @@ class App.Sla extends Spine.Model @url: 'api/slas' @configure_attributes = [ { name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, null: false, 'class': 'span4' }, - { name: 'first_response_time', display: 'First Resposne Time', tag: 'input', type: 'text', limit: 100, null: true, 'class': 'span4', note: 'In minutes, only business times are counted.' }, + { name: 'first_response_time', display: 'First Response Time', tag: 'input', type: 'text', limit: 100, null: true, 'class': 'span4', note: 'In minutes, only business times are counted.' }, { name: 'update_time', display: 'Update Time', tag: 'input', type: 'text', limit: 100, null: true, 'class': 'span4', note: 'In minutes, only business times are counted.' }, { name: 'close_time', display: 'Solution Time', tag: 'input', type: 'text', limit: 100, null: true, 'class': 'span4', note: 'In minutes, only business times are counted.' }, { name: 'condition', display: 'Conditions where SLA is used', tag: 'ticket_attribute_selection', null: true, class: 'span4' }, @@ -37,4 +37,4 @@ class App.Sla extends Spine.Model @configure_delete = true @configure_overview = [ 'name', - ] \ No newline at end of file + ] diff --git a/app/assets/javascripts/app/views/generic/table.jst.eco b/app/assets/javascripts/app/views/generic/table.jst.eco index 11913fa4a..d37027b98 100644 --- a/app/assets/javascripts/app/views/generic/table.jst.eco +++ b/app/assets/javascripts/app/views/generic/table.jst.eco @@ -11,7 +11,7 @@ style="<%= row.style %>"<% end %>><%- @T( row.display ) %> <% end %> <% if @destroy: %> - <%- @T('Destory') %> + <%- @T('Destroy') %> <% end %> @@ -63,4 +63,4 @@ <% end %> - \ No newline at end of file + diff --git a/db/seeds.rb b/db/seeds.rb index aab41044f..e2fcec6dd 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -90,7 +90,7 @@ Setting.create_if_not_exists( :title => 'http type', :name => 'http_type', :area => 'System::Base', - :description => 'Defines the type of protocol, used by the web server, to serve the application. If https protocol will be used instead of plain http, it must be specified it here. Since this has no affect on the web server\'s settings or behavior, it will not change the method of access to the application and, if it is wrong, it will not prevent you from logging into the application. This setting is used as a variable, #{setting.http_type} which is found in all forms of messaging used by the application, to build links to the tickets within your system.', + :description => 'Defines the type of protocol, used by the web server, to serve the application. If https protocol will be used instead of plain http, it must be specified in here. Since this has no affect on the web server\'s settings or behavior, it will not change the method of access to the application and, if it is wrong, it will not prevent you from logging into the application. This setting is used as a variable, #{setting.http_type} which is found in all forms of messaging used by the application, to build links to the tickets within your system.', :options => { :form => [ { @@ -115,7 +115,7 @@ Setting.create_if_not_exists( :title => 'Storage Mechanism', :name => 'storage', :area => 'System::Storage', - :description => '"Database" stores all attachments in the database (not recommended for storing big). "Filesystem" stores the data on the filesystem; this is faster but the webserver should run under the Zammad user. You can switch between the modules even on a system that is already in production without any loss of data.', + :description => '"Database" stores all attachments in the database (not recommended for storing large amounts of data). "Filesystem" stores the data on the filesystem. You can switch between the modules even on a system that is already in production without any loss of data.', :options => { :form => [ {