carrier 0.0.6 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. data/Gemfile +1 -1
  2. data/TODO +1 -0
  3. data/VERSION +1 -1
  4. data/app/assets/images/carrier/chosen-sprite.png +0 -0
  5. data/app/assets/javascripts/carrier/chosen.jquery.min.js +10 -0
  6. data/app/assets/javascripts/carrier/chosen.js +5 -0
  7. data/app/assets/stylesheets/{carrier.css → carrier/carrier.css} +43 -5
  8. data/app/assets/stylesheets/carrier/chosen.css +367 -0
  9. data/app/controllers/carrier/chains_controller.rb +7 -5
  10. data/app/controllers/carrier/messages_controller.rb +4 -6
  11. data/app/helpers/carrier/application_helper.rb +5 -8
  12. data/app/models/carrier/chain.rb +2 -2
  13. data/app/models/carrier/message.rb +23 -19
  14. data/app/models/carrier/message/validations.rb +1 -1
  15. data/app/validators/recipients/exclude_self.rb +1 -1
  16. data/app/validators/recipients/recipients_presence_validator.rb +8 -0
  17. data/app/validators/recipients/right_recipients_validator.rb +10 -0
  18. data/app/views/carrier/messages/_chosen.html.erb +7 -0
  19. data/app/views/carrier/messages/_form.html.erb +30 -24
  20. data/app/views/carrier/messages/_head.html.erb +1 -6
  21. data/app/views/carrier/messages/_index_message.html.erb +2 -2
  22. data/app/views/carrier/messages/{_message_expanded.html.erb → _message.html.erb} +0 -0
  23. data/app/views/carrier/messages/_message_collapsed.html.erb +1 -1
  24. data/app/views/carrier/messages/_nav_messages.html.erb +5 -5
  25. data/app/views/carrier/messages/_recipients.html.erb +1 -0
  26. data/app/views/carrier/messages/_reply.html.erb +17 -14
  27. data/app/views/carrier/messages/as_sent.html.erb +4 -0
  28. data/app/views/carrier/messages/create.js.erb +1 -1
  29. data/app/views/carrier/messages/index.html.erb +12 -1
  30. data/app/views/carrier/messages/new.html.erb +6 -0
  31. data/app/views/carrier/messages/reply.js.erb +1 -1
  32. data/app/views/carrier/messages/show.html.erb +34 -32
  33. data/app/views/layouts/carrier/application.html.erb +2 -2
  34. data/app/views/partials/_error_messages_for.html.erb +2 -2
  35. data/carrier.gemspec +21 -115
  36. data/config/locales/carrier.en.yml +11 -5
  37. data/config/locales/carrier.ru.yml +12 -1
  38. data/config/routes.rb +6 -2
  39. data/lib/carrier.rb +0 -1
  40. data/lib/carrier/configuration.rb +6 -8
  41. data/lib/carrier/configuration/routes.rb +19 -0
  42. data/lib/carrier/configuration/user.rb +24 -0
  43. data/lib/carrier/rails/engine.rb +15 -4
  44. data/lib/carrier/rails/helpers.rb +17 -3
  45. data/lib/carrier/version.rb +3 -0
  46. data/spec/dummy/config/initializers/carrier.rb +2 -0
  47. data/spec/integration/carrier_spec.rb +4 -2
  48. data/spec/requests/main_spec.rb +0 -1
  49. metadata +134 -223
  50. data/app/assets/javascripts/autocomplete.js +0 -4
  51. data/app/assets/javascripts/autocomplete/i18n/jquery-ui-i18n.js +0 -1379
  52. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-af.js +0 -23
  53. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ar-DZ.js +0 -23
  54. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ar.js +0 -23
  55. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-az.js +0 -23
  56. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-bg.js +0 -24
  57. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-bs.js +0 -23
  58. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ca.js +0 -23
  59. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-cs.js +0 -23
  60. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-da.js +0 -23
  61. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-de.js +0 -23
  62. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-el.js +0 -23
  63. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-en-AU.js +0 -23
  64. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-en-GB.js +0 -23
  65. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-en-NZ.js +0 -23
  66. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-eo.js +0 -23
  67. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-es.js +0 -23
  68. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-et.js +0 -23
  69. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-eu.js +0 -23
  70. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-fa.js +0 -23
  71. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-fi.js +0 -23
  72. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-fo.js +0 -23
  73. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-fr-CH.js +0 -23
  74. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-fr.js +0 -25
  75. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-gl.js +0 -23
  76. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-he.js +0 -23
  77. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-hr.js +0 -23
  78. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-hu.js +0 -23
  79. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-hy.js +0 -23
  80. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-id.js +0 -23
  81. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-is.js +0 -23
  82. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-it.js +0 -23
  83. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ja.js +0 -23
  84. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ko.js +0 -23
  85. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-kz.js +0 -23
  86. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-lt.js +0 -23
  87. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-lv.js +0 -23
  88. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ml.js +0 -23
  89. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ms.js +0 -23
  90. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-nl.js +0 -23
  91. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-no.js +0 -23
  92. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-pl.js +0 -23
  93. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-pt-BR.js +0 -23
  94. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-pt.js +0 -22
  95. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-rm.js +0 -21
  96. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ro.js +0 -26
  97. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ru.js +0 -23
  98. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-sk.js +0 -23
  99. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-sl.js +0 -24
  100. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-sq.js +0 -23
  101. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-sr-SR.js +0 -23
  102. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-sr.js +0 -23
  103. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-sv.js +0 -23
  104. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ta.js +0 -23
  105. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-th.js +0 -23
  106. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-tj.js +0 -23
  107. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-tr.js +0 -23
  108. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-uk.js +0 -23
  109. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-vi.js +0 -23
  110. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-zh-CN.js +0 -23
  111. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-zh-HK.js +0 -23
  112. data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-zh-TW.js +0 -23
  113. data/app/assets/javascripts/autocomplete/jquery.ui.autocomplete.min.js +0 -32
  114. data/app/assets/javascripts/autocomplete/jquery.ui.core.min.js +0 -17
  115. data/app/assets/javascripts/autocomplete/jquery.ui.position.min.js +0 -16
  116. data/app/assets/javascripts/autocomplete/jquery.ui.widget.min.js +0 -15
  117. data/app/assets/javascripts/carrier.js +0 -8
  118. data/app/assets/javascripts/rich-multiselect/jquery-ui.min.js +0 -405
  119. data/app/assets/javascripts/rich-multiselect/locale/ui-multiselect-de.js +0 -11
  120. data/app/assets/javascripts/rich-multiselect/locale/ui-multiselect-en.js +0 -11
  121. data/app/assets/javascripts/rich-multiselect/locale/ui-multiselect-es.js +0 -11
  122. data/app/assets/javascripts/rich-multiselect/locale/ui-multiselect-fr.js +0 -11
  123. data/app/assets/javascripts/rich-multiselect/locale/ui-multiselect-it.js +0 -13
  124. data/app/assets/javascripts/rich-multiselect/plugins/localisation/jquery.localisation-min.js +0 -7
  125. data/app/assets/javascripts/rich-multiselect/plugins/localisation/jquery.localisation-pack.js +0 -7
  126. data/app/assets/javascripts/rich-multiselect/plugins/localisation/jquery.localisation.js +0 -99
  127. data/app/assets/javascripts/rich-multiselect/plugins/scrollTo/README.txt +0 -37
  128. data/app/assets/javascripts/rich-multiselect/plugins/scrollTo/changes.txt +0 -82
  129. data/app/assets/javascripts/rich-multiselect/plugins/scrollTo/jquery.scrollTo-min.js +0 -11
  130. data/app/assets/javascripts/rich-multiselect/plugins/scrollTo/jquery.scrollTo.js +0 -207
  131. data/app/assets/javascripts/rich-multiselect/ui.multiselect.js +0 -339
  132. data/app/assets/stylesheets/carrier_rich.css +0 -48
  133. data/app/assets/stylesheets/carrier_simple.css +0 -15
  134. data/app/assets/stylesheets/rich-multiselect/ui.multiselect.css +0 -30
  135. data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  136. data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_55_fbf9ee_40x100.png +0 -0
  137. data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_65_ffffff_40x100.png +0 -0
  138. data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_75_cccccc_40x100.png +0 -0
  139. data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_75_dadada_40x100.png +0 -0
  140. data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_75_e6e6e6_40x100.png +0 -0
  141. data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  142. data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_95_fef1ec_40x100.png +0 -0
  143. data/app/assets/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  144. data/app/assets/stylesheets/ui-lightness/images/ui-icons_2e83ff_256x240.png +0 -0
  145. data/app/assets/stylesheets/ui-lightness/images/ui-icons_454545_256x240.png +0 -0
  146. data/app/assets/stylesheets/ui-lightness/images/ui-icons_888888_256x240.png +0 -0
  147. data/app/assets/stylesheets/ui-lightness/images/ui-icons_cd0a0a_256x240.png +0 -0
  148. data/app/assets/stylesheets/ui-lightness/jquery-ui-1.8.14.custom.css +0 -342
  149. data/app/helpers/carrier/post_helper.rb +0 -4
  150. data/app/validators/recipients/recipients_validator.rb +0 -10
  151. data/app/views/carrier/messages/rich/_multiselect.html.erb +0 -18
  152. data/app/views/carrier/messages/rich/_recipients.html.erb +0 -6
  153. data/app/views/carrier/messages/simple/_autocomplete.html.erb +0 -45
  154. data/app/views/carrier/messages/simple/_autocomplete_includes.html.erb +0 -7
  155. data/app/views/carrier/messages/simple/_recipients.html.erb +0 -3
  156. data/lib/carrier/configuration/ui.rb +0 -28
@@ -1,11 +0,0 @@
1
- /**
2
- * Localization strings for the UI Multiselect widget
3
- *
4
- * @locale de, de-DE, de-AT, de-CH
5
- */
6
-
7
- $.extend($.ui.multiselect.locale, {
8
- addAll:'Alle hinzufügen',
9
- removeAll:'Alle entfernen',
10
- itemsCount:'Einträge ausgewählt'
11
- });
@@ -1,11 +0,0 @@
1
- /**
2
- * Localization strings for the UI Multiselect widget
3
- *
4
- * @locale en, en-US
5
- */
6
-
7
- $.extend($.ui.multiselect.locale, {
8
- addAll:'Add all',
9
- removeAll:'Remove all',
10
- itemsCount:'items selected'
11
- });
@@ -1,11 +0,0 @@
1
- /**
2
- * Localization strings for the UI Multiselect widget
3
- *
4
- * @locale es, es-ES
5
- */
6
-
7
- $.extend($.ui.multiselect.locale, {
8
- addAll:'Agregar todos',
9
- removeAll:'Remover todos',
10
- itemsCount:'Objetos seleccionados'
11
- });
@@ -1,11 +0,0 @@
1
- /**
2
- * Localization strings for the UI Multiselect widget
3
- *
4
- * @locale fr, fr-FR, fr-CA
5
- */
6
-
7
- $.extend($.ui.multiselect.locale, {
8
- addAll:'Ajouter tout',
9
- removeAll:'Supprimer tout',
10
- itemsCount:'items sélectionnés'
11
- });
@@ -1,13 +0,0 @@
1
- /**
2
- * Localization strings for the UI Multiselect widget
3
- *
4
- * @locale it, it-IT
5
- */
6
-
7
- $.extend($.ui.multiselect, {
8
- locale: {
9
- addAll:'Aggiungi tutti',
10
- removeAll:'Rimuovi tutti',
11
- itemsCount:'elementi selezionati'
12
- }
13
- });
@@ -1,7 +0,0 @@
1
- /* http://keith-wood.name/localisation.html
2
- Localisation assistance for jQuery v1.0.4.
3
- Written by Keith Wood (kbwood{at}iinet.com.au) June 2007.
4
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
5
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
6
- Please attribute the author if you use it. */
7
- (function($){$.localise=function(c,d,e,f,g){if(typeof d!='object'&&typeof d!='string'){g=f;f=e;e=d;d=''}if(typeof e!='boolean'){g=f;f=e;e=false}if(typeof f!='string'&&!isArray(f)){g=f;f=['','']}var h={async:$.ajaxSettings.async,timeout:$.ajaxSettings.timeout};d=(typeof d!='string'?d||{}:{language:d,loadBase:e,path:f,timeout:g});var j=(!d.path?['','']:(isArray(d.path)?d.path:[d.path,d.path]));$.ajaxSetup({async:false,timeout:(d.timeout||500)});var k=function(a,b){if(d.loadBase){$.getScript(j[0]+a+'.js')}if(b.length>=2){$.getScript(j[1]+a+'-'+b.substring(0,2)+'.js')}if(b.length>=5){$.getScript(j[1]+a+'-'+b.substring(0,5)+'.js')}};var l=normaliseLang(d.language||$.localise.defaultLanguage);c=(isArray(c)?c:[c]);for(i=0;i<c.length;i++){k(c[i],l)}$.ajaxSetup(h)};$.localize=$.localise;$.localise.defaultLanguage=normaliseLang(navigator.language||navigator.userLanguage);function normaliseLang(a){a=a.replace(/_/,'-').toLowerCase();if(a.length>3){a=a.substring(0,3)+a.substring(3).toUpperCase()}return a}function isArray(a){return(a&&a.constructor==Array)}})(jQuery);
@@ -1,7 +0,0 @@
1
- /* http://keith-wood.name/localisation.html
2
- Localisation assistance for jQuery v1.0.4.
3
- Written by Keith Wood (kbwood{at}iinet.com.au) June 2007.
4
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
5
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
6
- Please attribute the author if you use it. */
7
- eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(7($){$.m=7(c,d,e,f,g){4(8 d!=\'E\'&&8 d!=\'r\'){g=f;f=e;e=d;d=\'\'}4(8 e!=\'F\'){g=f;f=e;e=x}4(8 f!=\'r\'&&!n(f)){g=f;f=[\'\',\'\']}o h={s:$.y.s,9:$.y.9};d=(8 d!=\'r\'?d||{}:{t:d,z:e,6:f,9:g});o j=(!d.6?[\'\',\'\']:(n(d.6)?d.6:[d.6,d.6]));$.A({s:x,9:(d.9||G)});o k=7(a,b){4(d.z){$.u(j[0]+a+\'.v\')}4(b.p>=2){$.u(j[1]+a+\'-\'+b.q(0,2)+\'.v\')}4(b.p>=5){$.u(j[1]+a+\'-\'+b.q(0,5)+\'.v\')}};o l=w(d.t||$.m.B);c=(n(c)?c:[c]);H(i=0;i<c.p;i++){k(c[i],l)}$.A(h)};$.I=$.m;$.m.B=w(C.t||C.J);7 w(a){a=a.K(/L/,\'-\').M();4(a.p>3){a=a.q(0,3)+a.q(3).N()}D a}7 n(a){D(a&&a.O==P)}})(Q);',53,53,'||||if||path|function|typeof|timeout|||||||||||||localise|isArray|var|length|substring|string|async|language|getScript|js|normaliseLang|false|ajaxSettings|loadBase|ajaxSetup|defaultLanguage|navigator|return|object|boolean|500|for|localize|userLanguage|replace|_|toLowerCase|toUpperCase|constructor|Array|jQuery'.split('|'),0,{}))
@@ -1,99 +0,0 @@
1
- /* http://keith-wood.name/localisation.html
2
- Localisation assistance for jQuery v1.0.4.
3
- Written by Keith Wood (kbwood{at}iinet.com.au) June 2007.
4
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
5
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
6
- Please attribute the author if you use it. */
7
-
8
- (function($) { // Hide scope, no $ conflict
9
-
10
- /* Load applicable localisation package(s) for one or more jQuery packages.
11
- Assumes that the localisations are named <base>-<lang>.js
12
- and loads them in order from least to most specific.
13
- For example, $.localise('mypackage');
14
- with the browser set to 'en-US' would attempt to load
15
- mypackage-en.js and mypackage-en-US.js.
16
- Also accepts an array of package names to process.
17
- Optionally specify whether or not to include the base file,
18
- the desired language, and/or the timeout period, e.g.
19
- $.localise(['mypackage1', 'yourpackage'],
20
- {loadBase: true; language: 'en-AU', timeout: 300});
21
- @param packages (string or string[]) names of package(s) to load
22
- @param settings omit for the current browser language or
23
- (string) code for the language to load (aa[-AA]) or
24
- (object} options for the call with
25
- language (string) the code for the language
26
- loadBase (boolean) true to also load the base package or false (default) to not
27
- path (string or string[2]) the paths to the JavaScript,
28
- either as both or [base, localisations]
29
- timeout (number) the time period in milliseconds (default 500)
30
- @param loadBase (boolean, optional) true to also load the base package or false (default) to not -
31
- omit this if settings is an object
32
- @param path (string or string[2], optional) the paths to the JavaScript,
33
- either as both or [base, localisations] -
34
- omit this if settings is an object
35
- @param timeout (number, optional) the time period in milliseconds (default 500) -
36
- omit this if settings is an object */
37
- $.localise = function(packages, settings, loadBase, path, timeout) {
38
- if (typeof settings != 'object' && typeof settings != 'string') {
39
- timeout = path;
40
- path = loadBase;
41
- loadBase = settings;
42
- settings = '';
43
- }
44
- if (typeof loadBase != 'boolean') {
45
- timeout = path;
46
- path = loadBase;
47
- loadBase = false;
48
- }
49
- if (typeof path != 'string' && !isArray(path)) {
50
- timeout = path;
51
- path = ['', ''];
52
- }
53
- var saveSettings = {async: $.ajaxSettings.async, timeout: $.ajaxSettings.timeout};
54
- settings = (typeof settings != 'string' ? settings || {} :
55
- {language: settings, loadBase: loadBase, path: path, timeout: timeout});
56
- var paths = (!settings.path ? ['', ''] :
57
- (isArray(settings.path) ? settings.path : [settings.path, settings.path]));
58
- $.ajaxSetup({async: false, timeout: (settings.timeout || 500)});
59
- var localiseOne = function(package, lang) {
60
- if (settings.loadBase) {
61
- $.getScript(paths[0] + package + '.js');
62
- }
63
- if (lang.length >= 2) {
64
- $.getScript(paths[1] + package + '-' + lang.substring(0, 2) + '.js');
65
- }
66
- if (lang.length >= 5) {
67
- $.getScript(paths[1] + package + '-' + lang.substring(0, 5) + '.js');
68
- }
69
- };
70
- var lang = normaliseLang(settings.language || $.localise.defaultLanguage);
71
- packages = (isArray(packages) ? packages : [packages]);
72
- for (i = 0; i < packages.length; i++) {
73
- localiseOne(packages[i], lang);
74
- }
75
- $.ajaxSetup(saveSettings);
76
- };
77
-
78
- // Localise it!
79
- $.localize = $.localise;
80
-
81
- /* Retrieve the default language set for the browser. */
82
- $.localise.defaultLanguage = normaliseLang(navigator.language /* Mozilla */ ||
83
- navigator.userLanguage /* IE */);
84
-
85
- /* Ensure language code is in the format aa-AA. */
86
- function normaliseLang(lang) {
87
- lang = lang.replace(/_/, '-').toLowerCase();
88
- if (lang.length > 3) {
89
- lang = lang.substring(0, 3) + lang.substring(3).toUpperCase();
90
- }
91
- return lang;
92
- }
93
-
94
- /* Determine whether an object is an array. */
95
- function isArray(a) {
96
- return (a && a.constructor == Array);
97
- }
98
-
99
- })(jQuery);
@@ -1,37 +0,0 @@
1
- jQuery.ScrollTo 1.4
2
-
3
- * Apart from the target and duration, the plugin can receive a hash of settings. Documentation and examples are included in the source file.
4
-
5
- * If you are interested in animated "same-page-scrolling" using anchors(<a href="#some_id">...), check http://jquery.com/plugins/project/LocalScroll
6
-
7
- * The target can be specified as:
8
- * A Number/String specifying a position using px or just the number.
9
- * A string selector that will be relative, to the element that is going to be scrolled, and must match at least one child.
10
- * A DOM element, logically child of the element to scroll.
11
- * A hash { top:x, left:y }, x and y can be any kind of number/string like described above.
12
-
13
- * The plugin supports relative animations
14
-
15
- * 'em' and '%' are not supported as part of the target, because they won't work with jQuery.fn.animate.
16
-
17
- * The plugin might fail to scroll an element, to an inner node that is nested in more scrollable elements. This seems like an odd situation anyway.
18
-
19
- * Both axes ( x, y -> left, top ) can be scrolled, you can send 'x', 'y', 'xy' or 'yx' as 'axis' inside the settings.
20
-
21
- * If 2 axis are scrolled, there's an option to queue the animations, so that the second will start once the first ended ('xy' and 'yx' will have different effects)
22
-
23
- * The option 'margin' can be setted to true, then the margin of the target element, will be taken into account and will be deducted.
24
-
25
- * 'margin' will only be valid, if the target is a selector, a DOM element, or a jQuery Object.
26
-
27
- * The option 'offset' allows to scroll less or more than the actual target by a defined amount of pixels. Can be a number(both axes) or { top:x, left:y }.
28
-
29
- * The option 'over' lets you add or deduct a fraction of the element's height and width from the final position. so over:0.5 will scroll to the middle of the object. can be specified with {top:x, left:y}
30
-
31
- * Don't forget the callback event is now called 'onAfter', and if queuing is activated, then 'onAfterFirst' can be used.
32
-
33
- * If the first axis to be scrolled, is already positioned, that animation will be skipped, to avoid a delay in the animation.
34
-
35
- * The call to the plugin can be made in 2 different ways: $().scrollTo( target, duration, settings ) or $().scrollTo( target, settings ). Where one of the settings is 'duration'.
36
-
37
- * If you find any bug, or you have any advice, don't hesitate to open a ticket/request at http://jquery.com/plugins/project/ScrollTo .
@@ -1,82 +0,0 @@
1
- 1.4.1
2
- [Feature]
3
- - The target can be 'max' to scroll to the end while keeping it elegant.
4
- [Enhancement]
5
- - Default duration is 0 for jquery +1.3. Means sync animation
6
- - The plugin works on all major browsers, on compat & quirks modes, including iframes.
7
- - In addition to window/document, if html or body are received, the plugin will choose the right one.
8
- [Fix]
9
- - The Regex accepts floating numbers, Thanks Ramin
10
- - Using jQuery.nodeName where neccessary so that this works on xml+xhtml
11
- - The max() internal function wasn't completely accurrate, now it is 98% (except for IE on quirks mode and it's not too noticeable).
12
-
13
- 1.4
14
- [Fix]
15
- - Fixed the problem when scrolling the window to absolute positioned elements on Safari.
16
- - Fixed the problem on Opera 9.5 when scrolling the window. That it always scrolls to 0.
17
- [Feature]
18
- - Added the settings object as 2nd argument to the onAfter callback.
19
- - The 3rd argument of scrollTo can be just a function and it's used as the onAfter.
20
- - Added full support for iframes (even max scroll calculation).
21
- - Instead of $.scrollTo, $(window).scrollTo() and $(document).scrollTo() can be used.
22
- - Added $().scrollable() that returns the real element to scroll, f.e: $(window).scrollable() == [body|html], works for iframes.
23
- [Enhancement]
24
- - Cleaned the code a bit, specially the comments
25
-
26
- 1.3.3
27
- [Change]
28
- - Changed the licensing from GPL to GPL+MIT.
29
-
30
- 1.3.2
31
- [Enhancement]
32
- - Small improvements to make the code shorter.
33
- [Change]
34
- - Removed the last argument received by onAfter as it was the same as the 'this' but jqueryfied.
35
-
36
- 1.3.1
37
- [Feature]
38
- - Exposed $.scrollTo.window() to get the element that needs to be animated, to scroll the window.
39
- - Added option 'over'.
40
- [Enhancement]
41
- - Made the code as short as possible.
42
- [Change]
43
- - Changed the arguments received by onAfter
44
-
45
- 1.3
46
- [Enhancement]
47
- - Added semicolon to the start, for safe file concatenation
48
- - Added a limit check, values below 0 or over the maximum are fixed.
49
- - Now it should work faster, only one of html or body go through all the processing, instead of both for all browsers.
50
- [Fix]
51
- - Fixed the behavior for Opera, which seemed to react to both changes on <html> and <body>.
52
- - The border is also reduced, when 'margin' is set to true.
53
- [Change]
54
- - The option speed has been renamed to duration.
55
- [Feature]
56
- - The duration can be specified with a number as 2nd argument, and the rest of the settings as the third ( like $().animate )
57
- - Remade the demo
58
-
59
- 1.2.4
60
- [Enhancement]
61
- - The target can be in the form of { top:x, left:y } allowing different position for each axis.
62
- [Feature]
63
- - The option 'offset' has been added, to scroll behind or past the target. Can be a number(both axes) or { top:x, left:y }.
64
-
65
- 1.2.3
66
- [Feature]
67
- - Exposed the defaults.
68
- [Enhancement]
69
- - Made the callback functions receive more parameters.
70
-
71
- 1.2.2
72
- [Fix]
73
- - Fixed a bug, I didn't have to add the scrolled amount if it was body or html.
74
-
75
- 1.2
76
- [Change]
77
- - The option 'onafter' is now called 'onAfter'.
78
- [Feature]
79
- - Two axes can be scrolled together, this is set with the option 'axis'.
80
- - In case 2 axes are chosen, the scrolling can be queued: one scrolls, and then the other.
81
- - There's an intermediary event, 'onAfterFirst' called in case the axes are queued, after the first ends.
82
- - If the option 'margin' is set to true, the plugin will take in account, the margin of the target(no use if target is a value).
@@ -1,11 +0,0 @@
1
- /**
2
- * jQuery.ScrollTo - Easy element scrolling using jQuery.
3
- * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
4
- * Dual licensed under MIT and GPL.
5
- * Date: 3/9/2009
6
- * @author Ariel Flesler
7
- * @version 1.4.1
8
- *
9
- * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
10
- */
11
- ;(function($){var m=$.scrollTo=function(b,h,f){$(window).scrollTo(b,h,f)};m.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1};m.window=function(b){return $(window).scrollable()};$.fn.scrollable=function(){return this.map(function(){var b=this,h=!b.nodeName||$.inArray(b.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!h)return b;var f=(b.contentWindow||b).document||b.ownerDocument||b;return $.browser.safari||f.compatMode=='BackCompat'?f.body:f.documentElement})};$.fn.scrollTo=function(l,j,a){if(typeof j=='object'){a=j;j=0}if(typeof a=='function')a={onAfter:a};if(l=='max')l=9e9;a=$.extend({},m.defaults,a);j=j||a.speed||a.duration;a.queue=a.queue&&a.axis.length>1;if(a.queue)j/=2;a.offset=n(a.offset);a.over=n(a.over);return this.scrollable().each(function(){var k=this,o=$(k),d=l,p,g={},q=o.is('html,body');switch(typeof d){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px)?$/.test(d)){d=n(d);break}d=$(d,this);case'object':if(d.is||d.style)p=(d=$(d)).offset()}$.each(a.axis.split(''),function(b,h){var f=h=='x'?'Left':'Top',i=f.toLowerCase(),c='scroll'+f,r=k[c],s=h=='x'?'Width':'Height';if(p){g[c]=p[i]+(q?0:r-o.offset()[i]);if(a.margin){g[c]-=parseInt(d.css('margin'+f))||0;g[c]-=parseInt(d.css('border'+f+'Width'))||0}g[c]+=a.offset[i]||0;if(a.over[i])g[c]+=d[s.toLowerCase()]()*a.over[i]}else g[c]=d[i];if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],u(s));if(!b&&a.queue){if(r!=g[c])t(a.onAfterFirst);delete g[c]}});t(a.onAfter);function t(b){o.animate(g,j,a.easing,b&&function(){b.call(this,l,a)})};function u(b){var h='scroll'+b;if(!q)return k[h];var f='client'+b,i=k.ownerDocument.documentElement,c=k.ownerDocument.body;return Math.max(i[h],c[h])-Math.min(i[f],c[f])}}).end()};function n(b){return typeof b=='object'?b:{top:b,left:b}}})(jQuery);
@@ -1,207 +0,0 @@
1
- /**
2
- * jQuery.ScrollTo
3
- * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
4
- * Dual licensed under MIT and GPL.
5
- * Date: 3/9/2009
6
- *
7
- * @projectDescription Easy element scrolling using jQuery.
8
- * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
9
- * Works with jQuery +1.2.6. Tested on FF 2/3, IE 6/7, Opera 9.5/6, Safari 3, Chrome 1 on WinXP.
10
- *
11
- * @author Ariel Flesler
12
- * @version 1.4.1
13
- *
14
- * @id jQuery.scrollTo
15
- * @id jQuery.fn.scrollTo
16
- * @param {String, Number, DOMElement, jQuery, Object} target Where to scroll the matched elements.
17
- * The different options for target are:
18
- * - A number position (will be applied to all axes).
19
- * - A string position ('44', '100px', '+=90', etc ) will be applied to all axes
20
- * - A jQuery/DOM element ( logically, child of the element to scroll )
21
- * - A string selector, that will be relative to the element to scroll ( 'li:eq(2)', etc )
22
- * - A hash { top:x, left:y }, x and y can be any kind of number/string like above.
23
- * @param {Number} duration The OVERALL length of the animation, this argument can be the settings object instead.
24
- * @param {Object,Function} settings Optional set of settings or the onAfter callback.
25
- * @option {String} axis Which axis must be scrolled, use 'x', 'y', 'xy' or 'yx'.
26
- * @option {Number} duration The OVERALL length of the animation.
27
- * @option {String} easing The easing method for the animation.
28
- * @option {Boolean} margin If true, the margin of the target element will be deducted from the final position.
29
- * @option {Object, Number} offset Add/deduct from the end position. One number for both axes or { top:x, left:y }.
30
- * @option {Object, Number} over Add/deduct the height/width multiplied by 'over', can be { top:x, left:y } when using both axes.
31
- * @option {Boolean} queue If true, and both axis are given, the 2nd axis will only be animated after the first one ends.
32
- * @option {Function} onAfter Function to be called after the scrolling ends.
33
- * @option {Function} onAfterFirst If queuing is activated, this function will be called after the first scrolling ends.
34
- * @return {jQuery} Returns the same jQuery object, for chaining.
35
- *
36
- * @desc Scroll to a fixed position
37
- * @example $('div').scrollTo( 340 );
38
- *
39
- * @desc Scroll relatively to the actual position
40
- * @example $('div').scrollTo( '+=340px', { axis:'y' } );
41
- *
42
- * @dec Scroll using a selector (relative to the scrolled element)
43
- * @example $('div').scrollTo( 'p.paragraph:eq(2)', 500, { easing:'swing', queue:true, axis:'xy' } );
44
- *
45
- * @ Scroll to a DOM element (same for jQuery object)
46
- * @example var second_child = document.getElementById('container').firstChild.nextSibling;
47
- * $('#container').scrollTo( second_child, { duration:500, axis:'x', onAfter:function(){
48
- * alert('scrolled!!');
49
- * }});
50
- *
51
- * @desc Scroll on both axes, to different values
52
- * @example $('div').scrollTo( { top: 300, left:'+=200' }, { axis:'xy', offset:-20 } );
53
- */
54
- ;(function( $ ){
55
-
56
- var $scrollTo = $.scrollTo = function( target, duration, settings ){
57
- $(window).scrollTo( target, duration, settings );
58
- };
59
-
60
- $scrollTo.defaults = {
61
- axis:'xy',
62
- duration: parseFloat($.fn.jquery) >= 1.3 ? 0 : 1
63
- };
64
-
65
- // Returns the element that needs to be animated to scroll the window.
66
- // Kept for backwards compatibility (specially for localScroll & serialScroll)
67
- $scrollTo.window = function( scope ){
68
- return $(window).scrollable();
69
- };
70
-
71
- // Hack, hack, hack... stay away!
72
- // Returns the real elements to scroll (supports window/iframes, documents and regular nodes)
73
- $.fn.scrollable = function(){
74
- return this.map(function(){
75
- var elem = this,
76
- isWin = !elem.nodeName || $.inArray( elem.nodeName.toLowerCase(), ['iframe','#document','html','body'] ) != -1;
77
-
78
- if( !isWin )
79
- return elem;
80
-
81
- var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem;
82
-
83
- return $.browser.safari || doc.compatMode == 'BackCompat' ?
84
- doc.body :
85
- doc.documentElement;
86
- });
87
- };
88
-
89
- $.fn.scrollTo = function( target, duration, settings ){
90
- if( typeof duration == 'object' ){
91
- settings = duration;
92
- duration = 0;
93
- }
94
- if( typeof settings == 'function' )
95
- settings = { onAfter:settings };
96
-
97
- if( target == 'max' )
98
- target = 9e9;
99
-
100
- settings = $.extend( {}, $scrollTo.defaults, settings );
101
- // Speed is still recognized for backwards compatibility
102
- duration = duration || settings.speed || settings.duration;
103
- // Make sure the settings are given right
104
- settings.queue = settings.queue && settings.axis.length > 1;
105
-
106
- if( settings.queue )
107
- // Let's keep the overall duration
108
- duration /= 2;
109
- settings.offset = both( settings.offset );
110
- settings.over = both( settings.over );
111
-
112
- return this.scrollable().each(function(){
113
- var elem = this,
114
- $elem = $(elem),
115
- targ = target, toff, attr = {},
116
- win = $elem.is('html,body');
117
-
118
- switch( typeof targ ){
119
- // A number will pass the regex
120
- case 'number':
121
- case 'string':
122
- if( /^([+-]=)?\d+(\.\d+)?(px)?$/.test(targ) ){
123
- targ = both( targ );
124
- // We are done
125
- break;
126
- }
127
- // Relative selector, no break!
128
- targ = $(targ,this);
129
- case 'object':
130
- // DOMElement / jQuery
131
- if( targ.is || targ.style )
132
- // Get the real position of the target
133
- toff = (targ = $(targ)).offset();
134
- }
135
- $.each( settings.axis.split(''), function( i, axis ){
136
- var Pos = axis == 'x' ? 'Left' : 'Top',
137
- pos = Pos.toLowerCase(),
138
- key = 'scroll' + Pos,
139
- old = elem[key],
140
- Dim = axis == 'x' ? 'Width' : 'Height';
141
-
142
- if( toff ){// jQuery / DOMElement
143
- attr[key] = toff[pos] + ( win ? 0 : old - $elem.offset()[pos] );
144
-
145
- // If it's a dom element, reduce the margin
146
- if( settings.margin ){
147
- attr[key] -= parseInt(targ.css('margin'+Pos)) || 0;
148
- attr[key] -= parseInt(targ.css('border'+Pos+'Width')) || 0;
149
- }
150
-
151
- attr[key] += settings.offset[pos] || 0;
152
-
153
- if( settings.over[pos] )
154
- // Scroll to a fraction of its width/height
155
- attr[key] += targ[Dim.toLowerCase()]() * settings.over[pos];
156
- }else
157
- attr[key] = targ[pos];
158
-
159
- // Number or 'number'
160
- if( /^\d+$/.test(attr[key]) )
161
- // Check the limits
162
- attr[key] = attr[key] <= 0 ? 0 : Math.min( attr[key], max(Dim) );
163
-
164
- // Queueing axes
165
- if( !i && settings.queue ){
166
- // Don't waste time animating, if there's no need.
167
- if( old != attr[key] )
168
- // Intermediate animation
169
- animate( settings.onAfterFirst );
170
- // Don't animate this axis again in the next iteration.
171
- delete attr[key];
172
- }
173
- });
174
-
175
- animate( settings.onAfter );
176
-
177
- function animate( callback ){
178
- $elem.animate( attr, duration, settings.easing, callback && function(){
179
- callback.call(this, target, settings);
180
- });
181
- };
182
-
183
- // Max scrolling position, works on quirks mode
184
- // It only fails (not too badly) on IE, quirks mode.
185
- function max( Dim ){
186
- var scroll = 'scroll'+Dim;
187
-
188
- if( !win )
189
- return elem[scroll];
190
-
191
- var size = 'client' + Dim,
192
- html = elem.ownerDocument.documentElement,
193
- body = elem.ownerDocument.body;
194
-
195
- return Math.max( html[scroll], body[scroll] )
196
- - Math.min( html[size] , body[size] );
197
-
198
- };
199
-
200
- }).end();
201
- };
202
-
203
- function both( val ){
204
- return typeof val == 'object' ? val : { top:val, left:val };
205
- };
206
-
207
- })( jQuery );