parlement 0.14 → 0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. data/CHANGES +41 -1
  2. data/MEMORY +66 -5
  3. data/README +10 -5
  4. data/Rakefile +15 -23
  5. data/app/controllers/account_controller.rb +48 -43
  6. data/app/controllers/{application.rb → application_controller.rb} +15 -12
  7. data/app/controllers/elt_controller.rb +77 -32
  8. data/app/controllers/subscriber_controller.rb +11 -10
  9. data/app/helpers/application_helper.rb +14 -1
  10. data/app/helpers/elt_helper.rb +9 -7
  11. data/app/models/elt.rb +25 -24
  12. data/app/models/mail.rb +44 -47
  13. data/app/models/person_notify.rb +2 -2
  14. data/app/models/user.rb +128 -2
  15. data/app/models/user_notify.rb +15 -15
  16. data/app/views/account/_login.rhtml +39 -39
  17. data/app/views/account/_show.rhtml +22 -30
  18. data/app/views/account/signup.rhtml +2 -2
  19. data/app/views/elt/_choice.rhtml +6 -6
  20. data/app/views/elt/_elt.rhtml +27 -32
  21. data/app/views/elt/choices.rhtml +16 -18
  22. data/app/views/elt/list/_byDate.rhtml +14 -14
  23. data/app/views/elt/list/_byVote.rhtml +15 -15
  24. data/app/views/elt/list/_children.rhtml +48 -40
  25. data/app/views/elt/list/_subscribers.rhtml +1 -1
  26. data/app/views/elt/new.rhtml +22 -21
  27. data/app/views/elt/rss.rxml +4 -11
  28. data/app/views/elt/show.rhtml +65 -61
  29. data/app/views/elt/vote_rss.rxml +4 -11
  30. data/app/views/layouts/top.rhtml +39 -50
  31. data/app/views/person/_listElts.rhtml +1 -1
  32. data/app/views/person/show.rhtml +1 -1
  33. data/{vendor/plugins/login_engine/app → app}/views/user_notify/change_password.rhtml +0 -0
  34. data/{vendor/plugins/login_engine/app → app}/views/user_notify/delete.rhtml +0 -0
  35. data/{vendor/plugins/login_engine/app → app}/views/user_notify/forgot_password.rhtml +0 -0
  36. data/{vendor/plugins/login_engine/app → app}/views/user_notify/pending_delete.rhtml +0 -0
  37. data/{vendor/plugins/login_engine/app → app}/views/user_notify/signup.rhtml +0 -0
  38. data/config/boot.rb +97 -32
  39. data/config/environment.rb +37 -35
  40. data/config/environments/development.rb +2 -3
  41. data/config/environments/production.rb +3 -0
  42. data/config/initializers/string_ruby_1.8.rb +10 -0
  43. data/config/routes.rb +17 -22
  44. data/db/schema.rb +102 -74
  45. data/lib/tasks/rspec.rake +167 -0
  46. data/public/404.html +25 -7
  47. data/public/500.html +26 -7
  48. data/public/dispatch.cgi +0 -0
  49. data/public/dispatch.fcgi +0 -0
  50. data/public/dispatch.rb +0 -0
  51. data/public/images/live_tree_branch_collapsed_icon.gif +0 -0
  52. data/public/images/live_tree_branch_expanded_icon.gif +0 -0
  53. data/public/images/live_tree_leaf_icon.gif +0 -0
  54. data/public/javascripts/application.js +258 -0
  55. data/public/javascripts/controls.js +544 -414
  56. data/public/javascripts/dragdrop.js +229 -198
  57. data/public/javascripts/effects.js +499 -459
  58. data/public/javascripts/prototype.js +2926 -1121
  59. data/public/javascripts/shadedborder.js +68 -50
  60. data/public/stylesheets/default.css +34 -34
  61. data/public/stylesheets/live_tree.css +0 -0
  62. data/public/stylesheets/scaffold.css +6 -6
  63. data/script/about +0 -0
  64. data/script/autospec +6 -0
  65. data/script/benchmarker +0 -0
  66. data/script/breakpointer +0 -0
  67. data/script/console +0 -0
  68. data/script/dbconsole +3 -0
  69. data/script/destroy +0 -0
  70. data/script/generate +0 -0
  71. data/script/plugin +0 -0
  72. data/script/profiler +0 -0
  73. data/script/runner +0 -0
  74. data/script/server +0 -0
  75. data/script/spec +10 -0
  76. data/script/spec_server +9 -0
  77. data/test/unit/attachment_test.rb +4 -4
  78. data/test/unit/choice_test.rb +1 -1
  79. data/test/unit/elt_test.rb +9 -9
  80. data/test/unit/mail_notify_test.rb +2 -2
  81. data/test/unit/mail_test.rb +18 -11
  82. data/test/unit/person_notify_test.rb +1 -1
  83. data/test/unit/person_test.rb +1 -1
  84. data/test/unit/subscriber_test.rb +1 -1
  85. data/test/unit/user_test.rb +81 -0
  86. data/test/unit/visit_test.rb +6 -6
  87. data/vendor/plugins/activerecord_foreign_key_extensions/init.rb +2 -0
  88. data/vendor/plugins/activerecord_foreign_key_extensions/lib/active_record_extensions.rb +182 -0
  89. data/vendor/plugins/activerecord_text_id_extensions/init.rb +2 -0
  90. data/vendor/plugins/activerecord_text_id_extensions/lib/active_record_extensions.rb +24 -0
  91. data/vendor/plugins/acts_as_nested_set/README +15 -0
  92. data/vendor/plugins/acts_as_nested_set/init.rb +1 -0
  93. data/vendor/plugins/acts_as_nested_set/lib/active_record/acts/nested_set.rb +210 -0
  94. data/vendor/plugins/acts_as_nested_set/test/nested_set_test.rb +269 -0
  95. data/vendor/plugins/acts_as_tree/README +26 -0
  96. data/vendor/plugins/acts_as_tree/Rakefile +22 -0
  97. data/vendor/plugins/acts_as_tree/init.rb +1 -0
  98. data/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb +96 -0
  99. data/vendor/plugins/{output_compression/CHANGELOG → acts_as_tree/test/abstract_unit.rb} +0 -0
  100. data/vendor/plugins/acts_as_tree/test/acts_as_tree_test.rb +219 -0
  101. data/vendor/plugins/acts_as_tree/test/database.yml +0 -0
  102. data/vendor/plugins/acts_as_tree/test/fixtures/mixin.rb +0 -0
  103. data/vendor/plugins/acts_as_tree/test/fixtures/mixins.yml +0 -0
  104. data/vendor/plugins/acts_as_tree/test/schema.rb +0 -0
  105. data/vendor/plugins/classic_pagination/CHANGELOG +152 -0
  106. data/vendor/plugins/classic_pagination/README +18 -0
  107. data/vendor/plugins/{output_compression/rakefile → classic_pagination/Rakefile} +22 -22
  108. data/vendor/plugins/classic_pagination/init.rb +33 -0
  109. data/vendor/plugins/classic_pagination/install.rb +1 -0
  110. data/vendor/plugins/classic_pagination/lib/pagination.rb +405 -0
  111. data/vendor/plugins/classic_pagination/lib/pagination_helper.rb +135 -0
  112. data/vendor/plugins/classic_pagination/test/fixtures/companies.yml +24 -0
  113. data/vendor/plugins/classic_pagination/test/fixtures/company.rb +9 -0
  114. data/vendor/plugins/classic_pagination/test/fixtures/developer.rb +7 -0
  115. data/vendor/plugins/classic_pagination/test/fixtures/developers.yml +21 -0
  116. data/vendor/plugins/classic_pagination/test/fixtures/developers_projects.yml +13 -0
  117. data/vendor/plugins/classic_pagination/test/fixtures/project.rb +3 -0
  118. data/vendor/plugins/classic_pagination/test/fixtures/projects.yml +7 -0
  119. data/vendor/plugins/classic_pagination/test/fixtures/replies.yml +13 -0
  120. data/vendor/plugins/classic_pagination/test/fixtures/reply.rb +5 -0
  121. data/vendor/plugins/classic_pagination/test/fixtures/schema.sql +42 -0
  122. data/vendor/plugins/classic_pagination/test/fixtures/topic.rb +3 -0
  123. data/vendor/plugins/classic_pagination/test/fixtures/topics.yml +22 -0
  124. data/vendor/plugins/classic_pagination/test/helper.rb +117 -0
  125. data/vendor/plugins/classic_pagination/test/pagination_helper_test.rb +38 -0
  126. data/vendor/plugins/classic_pagination/test/pagination_test.rb +177 -0
  127. data/vendor/plugins/file_column/lib/file_column.rb +1 -1
  128. data/vendor/plugins/file_column/test/file_column_test.rb +0 -0
  129. metadata +151 -197
  130. data/app/helpers/live_tree.rb +0 -238
  131. data/app/views/elt/_form.rhtml +0 -31
  132. data/app/views/elt/show_tree.rhtml +0 -8
  133. data/config/environments/user_environment.rb +0 -1
  134. data/db/ROOT/Titemagli.txt +0 -3
  135. data/db/ROOT/titemagli.txt +0 -9
  136. data/public/javascripts/behaviour.js +0 -254
  137. data/public/javascripts/ie7-load.htc +0 -1
  138. data/public/javascripts/ie7.js +0 -6
  139. data/public/javascripts/live_tree.js +0 -749
  140. data/public/javascripts/mybehaviour.js +0 -225
  141. data/public/javascripts/scriptaculous.js +0 -47
  142. data/public/javascripts/slider.js +0 -283
  143. data/public/stylesheets/blue.css +0 -471
  144. data/vendor/plugins/engines/CHANGELOG +0 -241
  145. data/vendor/plugins/engines/MIT-LICENSE +0 -21
  146. data/vendor/plugins/engines/README +0 -64
  147. data/vendor/plugins/engines/Rakefile +0 -32
  148. data/vendor/plugins/engines/UPGRADING +0 -93
  149. data/vendor/plugins/engines/about.yml +0 -7
  150. data/vendor/plugins/engines/generators/plugin_migration/USAGE +0 -45
  151. data/vendor/plugins/engines/generators/plugin_migration/plugin_migration_generator.rb +0 -79
  152. data/vendor/plugins/engines/generators/plugin_migration/templates/plugin_migration.erb +0 -13
  153. data/vendor/plugins/engines/init.rb +0 -40
  154. data/vendor/plugins/engines/install.rb +0 -32
  155. data/vendor/plugins/engines/lib/engines.rb +0 -323
  156. data/vendor/plugins/engines/lib/engines/deprecated_config_support.rb +0 -135
  157. data/vendor/plugins/engines/lib/engines/plugin.rb +0 -214
  158. data/vendor/plugins/engines/lib/engines/plugin_list.rb +0 -31
  159. data/vendor/plugins/engines/lib/engines/plugin_migrator.rb +0 -60
  160. data/vendor/plugins/engines/lib/engines/rails_extensions.rb +0 -6
  161. data/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb +0 -19
  162. data/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb +0 -143
  163. data/vendor/plugins/engines/lib/engines/rails_extensions/migrations.rb +0 -155
  164. data/vendor/plugins/engines/lib/engines/rails_extensions/public_asset_helpers.rb +0 -116
  165. data/vendor/plugins/engines/lib/engines/rails_extensions/rails.rb +0 -20
  166. data/vendor/plugins/engines/lib/engines/rails_extensions/rails_initializer.rb +0 -86
  167. data/vendor/plugins/engines/lib/engines/rails_extensions/routing.rb +0 -77
  168. data/vendor/plugins/engines/lib/engines/rails_extensions/templates.rb +0 -140
  169. data/vendor/plugins/engines/lib/engines/testing.rb +0 -87
  170. data/vendor/plugins/engines/tasks/engines.rake +0 -149
  171. data/vendor/plugins/login_engine/CHANGELOG +0 -22
  172. data/vendor/plugins/login_engine/README +0 -344
  173. data/vendor/plugins/login_engine/app/controllers/user_controller.rb +0 -262
  174. data/vendor/plugins/login_engine/app/helpers/user_helper.rb +0 -88
  175. data/vendor/plugins/login_engine/app/models/user.rb +0 -7
  176. data/vendor/plugins/login_engine/app/models/user_notify.rb +0 -75
  177. data/vendor/plugins/login_engine/app/views/user/_edit.rhtml +0 -11
  178. data/vendor/plugins/login_engine/app/views/user/_password.rhtml +0 -9
  179. data/vendor/plugins/login_engine/app/views/user/change_password.rhtml +0 -17
  180. data/vendor/plugins/login_engine/app/views/user/edit.rhtml +0 -23
  181. data/vendor/plugins/login_engine/app/views/user/forgot_password.rhtml +0 -18
  182. data/vendor/plugins/login_engine/app/views/user/home.rhtml +0 -7
  183. data/vendor/plugins/login_engine/app/views/user/login.rhtml +0 -17
  184. data/vendor/plugins/login_engine/app/views/user/logout.rhtml +0 -8
  185. data/vendor/plugins/login_engine/app/views/user/signup.rhtml +0 -17
  186. data/vendor/plugins/login_engine/db/migrate/001_initial_schema.rb +0 -25
  187. data/vendor/plugins/login_engine/init_engine.rb +0 -11
  188. data/vendor/plugins/login_engine/install.rb +0 -4
  189. data/vendor/plugins/login_engine/lib/login_engine.rb +0 -62
  190. data/vendor/plugins/login_engine/lib/login_engine/authenticated_system.rb +0 -113
  191. data/vendor/plugins/login_engine/lib/login_engine/authenticated_user.rb +0 -155
  192. data/vendor/plugins/login_engine/public/stylesheets/login_engine.css +0 -81
  193. data/vendor/plugins/login_engine/test/fixtures/users.yml +0 -41
  194. data/vendor/plugins/login_engine/test/functional/user_controller_test.rb +0 -536
  195. data/vendor/plugins/login_engine/test/mocks/mail.rb +0 -14
  196. data/vendor/plugins/login_engine/test/mocks/time.rb +0 -19
  197. data/vendor/plugins/login_engine/test/test_helper.rb +0 -11
  198. data/vendor/plugins/login_engine/test/unit/user_test.rb +0 -114
  199. data/vendor/plugins/output_compression/MIT-LICENSE +0 -20
  200. data/vendor/plugins/output_compression/README +0 -4
  201. data/vendor/plugins/output_compression/init.rb +0 -1
  202. data/vendor/plugins/output_compression/lib/output_compression.rb +0 -84
  203. data/vendor/plugins/output_compression/test/output_test.rb +0 -11
  204. data/vendor/plugins/output_compression/test/test_controller.rb +0 -3
  205. data/vendor/plugins/output_compression/test/test_helper.rb +0 -14
@@ -1 +0,0 @@
1
- <component lightweight="true"><attach event="ondocumentready" onevent="IE7.init()"/></component>
@@ -1,6 +0,0 @@
1
- /*
2
- IE7, version 0.9 (alpha) (2005-08-19)
3
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
4
- License: http://creativecommons.org/licenses/LGPL/2.1/
5
- */
6
- eval(function(p,a,c,k,e,d){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--)d[e(c)]=k[c]||e(c);k=[function(e){return d[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}('y(!26.1F)11 7(){2C{26.1F=8;6 2s=8.24=11 3b;8.1g=7(){z"1F 4x 0.9 (ad)"};6 5T=/5T/.Z(2y.5h.7C);6 31=(5T)?7(m){26.31(1F+"\\n\\n"+m)}:2s;6 29=ac.29.19(/ab (\\d\\.\\d)/)[1];6 2m=16.aa!="a9";y(/a8/.Z(2y.5h.7C)||29<5||!/^a7/.Z(16.2F.2a))z;6 33=16.5W=="33";6 1s,1K;6 2F=16.2F,1X,1J,1R=16.1R;6 4E="!";6 3Q={};6 2G=1z;1F.24=7(n,s){y(!3Q[n]){y(2G)1k("s="+23(s));3Q[n]=11 s()}};6 R=/^[\\w\\.]+[^:]*$/;7 1Z(h,p){y(R.Z(h))h=(p||"")+h;z h};7 3F(h,p){h=1Z(h,p);z h.1q(0,h.7a("/")+1)};6 s=16.7B[16.7B.K-1];2C{1k(s.7j)}2j(i){}6 2k=3F(s.1l);6 2v;2C{6 l=(a6()>=5)?"a5":"5n";2v=11 a4(l+".a3")}2j(i){}6 4A={};7 3T(h,p){2C{h=1Z(h,p);y(!4A[h]){2v.a2("a1",h,1z);2v.a0();y(2v.7A==0||2v.7A==9Z){4A[h]=2v.9Y}}}2j(i){31("4B [1]: 5O 9X 9W "+h)}5U{z 4A[h]||""}};6 4i=1Z("9V.9U",2k);7 2o(1w){y(1w!=1U){1w.1T=1t.1C.1T;1w.1e=1t.1C.1e}z 1w};2o.1e=7(p,c){y(!p)p={};y(!c)c=p.1h;y(c=={}.1h)c=11 3b("8.1T()");c.1i=11 3b("z 8");c.1i.1C=11 8.1i;c.1i.1C.1e(p);c.1C=11 c.1i;c.1i.1C.1h=c.1C.1h=c;c.2E=8;c.1e=1a.5P;c.4z=8.4z;z c};2o.1i=11 3b("z 8");2o.1i.1C={1h:2o,1T:7(){z 1a.5P.9T.2E.2q(8,1a)},1e:7(1w){y(8==8.1h.1C&&8.1h.1e){z 8.1h.1i.1C.1e(1w)}O(6 i 28 1w){34(i){1m"1h":1m"1g":1m"1i":5M}y(3Y 1w[i]=="7"&&1w[i]!=8[i]){1w[i].2E=8[i]}8[i]=1w[i]}y(1w.1g!=8.1g&&1w.1g!={}.1g){1w.1g.2E=8.1g;8.1g=1w.1g}z 8}};7 1t(){};8.1t=2o.1e({1h:1t,1g:7(){z"[9S "+(8.1h.1x||"9R")+"]"},9Q:7(2i){z 8.1h==2i||2i.4z(8.1h)}});1t.1x="1t";1t.2E=1U;1t.4z=7(2i){1D(2i&&2i.2E!=8)2i=2i.2E;z 7q(2i)};1t.1i.2E=2o;3u 8.1t;6 5x=1t.1e({1h:7(){8.3L=[];8.1Q=[]},1S:2s});y(29<5.5)1k(3T("17-9P.5X",2k));6 5S=1z;1F.1S=7(){2C{y(5S)z;5S=33=1o;1X=16.1X;1J=(2m)?1X:2F;y(2l&&1s)1s.2q();V.2q();1u();31("2G 9O")}2j(e){31("4B [2]: "+e.5V)}};6 1Q=[];7 1n(r){1Q.1b(r)};7 1u(){14.5g();y(2l&&1s)1s.1u();V.1u();O(6 i=0;i<1Q.K;i++)1Q[i]()};7 2U(){6 E=0,R=1,L=2;6 G=/\\(/g,S=/\\$\\d/,I=/^\\$\\d+$/,T=/([\'"])\\1\\+(.*)\\+\\1\\1$/,7t=/\\\\./g,Q=/\'/,7z=/\\3S[^\\3S]*\\3S/g;6 3N=8;8.15=7(e,r){y(!r)r="";6 l=(5R(23(e)).19(G)||"").K+1;y(S.Z(r)){y(I.Z(r)){r=25(r.1q(1))-1}1d{6 i=l;6 q=Q.Z(5R(r))?\'"\':"\'";1D(i)r=r.2O("$"+i--).2p(q+"+a[o+"+i+"]+"+q);r=11 3b("a,o","z"+q+r.13(T,"$1")+q)}}7y(e||"/^$/",r,l)};8.2V=7(s){3R.K=0;z 7u(7v(s,8.4y).13(11 1N(30,8.5Q?"5D":"g"),7w),8.4y).13(7z,"")};8.72=7(){30.K=0};6 3R=[];6 30=[];6 7x=7(){z"("+23(8[E]).1q(1,-1)+")"};30.1g=7(){z 8.2p("|")};7 7y(){1a.1g=7x;30[30.K]=1a}7 7w(){y(!1a[0])z"";6 i=1,j=0,p;1D(p=30[j++]){y(1a[i]){6 r=p[R];34(3Y r){1m"7":z r(1a,i);1m"9N":z 1a[r+i]}6 d=(1a[i].6F(3N.4y)==-1)?"":"\\3S"+1a[i]+"\\3S";z d+r}1d i+=p[L]}};7 7v(s,e){z e?s.13(11 1N("\\\\"+e+"(.)","g"),7(m,c){3R[3R.K]=c;z e}):s};7 7u(s,e){6 i=0;z e?s.13(11 1N("\\\\"+e,"g"),7(){z e+(3R[i++]||"")}):s};7 5R(s){z s.13(7t,"")}};2U.1C={1h:2U,5Q:1z,4y:""};1t.1e(2U.1C);6 3M=2U.1e({5Q:1o});6 14=7(){6 4x="2.0.2";6 C=/\\s*,\\s*/;6 14=7(s,1E){2C{6 m=[];6 u=1a.5P.5I&&!1E;6 b=(1E)?(1E.1h==7n)?1E:[1E]:[16];6 2f=45(s).2O(C),i;O(i=0;i<2f.K;i++){s=5J(2f[i]);y(4P&&s.1q(0,3).2p("")==" *#"){s=s.1q(2);1E=7o([],b,s[1])}1d 1E=b;6 j=0,t,f,a,c="";1D(j<s.K){t=s[j++];f=s[j++];c+=t+f;a="";y(s[j]=="("){1D(s[j++]!=")"&&j<s.K){a+=s[j]}a=a.1q(0,-1);c+="("+a+")"}1E=(u&&2e[c])?2e[c]:7m(1E,t,f,a);y(u)2e[c]=1E}m=m.4J(1E)}3u 14.5O;z m}2j(e){14.5O=e;z[]}};14.1g=7(){z"7 14() {\\n [4x "+4x+"]\\n}"};6 2e={};14.5I=1z;14.5g=7(s){y(s){s=5J(s).2p("");3u 2e[s]}1d 2e={}};6 3Q={};6 2G=1z;14.24=7(n,s){y(2G)1k("s="+23(s));3Q[n]=11 s()};14.1i=7(c){z c?1k(c):8};6 1V={};6 1B={};6 1p={19:/\\[([\\w-]+(\\|[\\w-]+)?)\\s*(\\W?=)?\\s*([^\\]]*)\\]/};6 2R=[];1V[" "]=7(r,f,t,n){6 e,i,j;O(i=0;i<f.K;i++){6 s=4w(f[i],t,n);O(j=0;(e=s[j]);j++){y(2D(e)&&5K(e,n))r.1b(e)}}};1V["#"]=7(r,f,i){6 e,j;O(j=0;(e=f[j]);j++)y(e.1c==i)r.1b(e)};1V["."]=7(r,f,c){c=11 1N("(^|\\\\s)"+c+"(\\\\s|$)");6 e,i;O(i=0;(e=f[i]);i++)y(c.Z(e.1x))r.1b(e)};1V[":"]=7(r,f,p,a){6 t=1B[p],e,i;y(t)O(i=0;(e=f[i]);i++)y(t(e,a))r.1b(e)};1B["21"]=7(e){6 d=5L(e);y(d.5N)O(6 i=0;i<d.5N.K;i++){y(d.5N[i]==e)z 1o}};1B["37"]=7(e){};6 2D=7(e){z(e&&e.7k==1&&e.2W!="!")?e:1U};6 4S=7(e){1D(e&&(e=e.9M)&&!2D(e))5M;z e};6 47=7(e){1D(e&&(e=e.6W)&&!2D(e))5M;z e};6 3l=7(e){z 2D(e.7s)||47(e.7s)};6 5t=7(e){z 2D(e.7r)||4S(e.7r)};6 6q=7(e){6 c=[];e=3l(e);1D(e){c.1b(e);e=47(e)}z c};6 4P=1o;6 5H=7(e){6 d=5L(e);z(3Y d.7p=="9L")?/\\.9K$/i.Z(d.9J):7q(d.7p=="9I 9H")};6 5L=7(e){z e.9G||e.16};6 4w=7(e,t){z(t=="*"&&e.1Y)?e.1Y:e.4w(t)};6 4T=7(e,t,n){y(t=="*")z 2D(e);y(!5K(e,n))z 1z;y(!5H(e))t=t.9F();z e.2W==t};6 5K=7(e,n){z!n||(n=="*")||(e.9E==n)};6 9D=7(e){z e.9C};7 7o(r,f,1c){6 m,i,j;O(i=0;i<f.K;i++){y(m=f[i].1Y.9B(1c)){y(m.1c==1c)r.1b(m);1d y(m.K!=1U){O(j=0;j<m.K;j++){y(m[j].1c==1c)r.1b(m[j])}}}}z r};y(![].1b)7n.1C.1b=7(){O(6 i=0;i<1a.K;i++){8[8.K]=1a[i]}z 8.K};6 N=/\\|/;7 7m(1E,t,f,a){y(N.Z(f)){f=f.2O(N);a=f[0];f=f[1]}6 r=[];y(1V[t]){1V[t](r,1E,f,a)}z r};6 S=/^[^\\s>+~]/;6 7l=/[\\s#.:>+~()@]|[^\\s#.:>+~()@]+/g;7 5J(s){y(S.Z(s))s=" "+s;z s.19(7l)||[]};6 W=/\\s*([\\s>+~(),]|^|$)\\s*/g;6 I=/([\\s>+~,]|[^(]\\+|^)([#.:@])/g;6 45=7(s){z s.13(W,"$1").13(I,"$1*$2")};6 2c={1g:7(){z"\'"},19:/^(\'[^\']*\')|("[^"]*")$/,Z:7(s){z 8.19.Z(s)},15:7(s){z 8.Z(s)?s:8+s+8},3v:7(s){z 8.Z(s)?s.1q(1,-1):s}};6 2w=7(t){z 2c.3v(t)};6 E=/([\\/()[\\]?{}|*+-])/g;7 4O(s){z s.13(E,"\\\\$1")};2G=1o;z 14}();14.5I=1o;14.24("17",7(){2D=7(e){z(e&&e.7k==1&&e.2W!="!"&&!e.2K)?e:1U}});14.1i("2w=1a[1]",42);6 2l=!14.1i("5H(1a[1])",2F);6 2r=":21{17-21:21}:37{17-21:37}"+(2l?"":"*{6Q:0}");6 V=11(5x.1e({5B:11 3M,2P:"",2Y:"",5F:[],1S:7(){8.5G();8.4t()},4t:7(){V.3O.18=2r+8.2P+8.2Y},7i:7(){6 3P=16.4w("1r"),s;O(6 i=3P.K-1;(s=3P[i]);i--){y(!s.3m&&!s.17){8.5F.1b(s.7j)}}},2q:7(){8.7i();8.4t();11 3y("2P");8.7g()},3i:7(e,r){8.5B.15(e,r)},1u:7(){6 R=/7h\\d+/g;6 s=2r.19(/[{,]/g).K;6 3P=s+(8.2P.18.19(/\\{/g)||"").K;6 2Q=8.3O.2t,r;6 4v,c,4u,e,i,j,k,1c;O(i=s;i<3P;i++){r=2Q[i];y(r&&(4v=r.1r.18.19(R))){4u=14(r.4M);y(4u.K)O(j=0;j<4v.K;j++){1c=4v[j];c=V.1Q[1c.1q(10)][2];O(k=0;(e=4u[k]);k++){y(e.D[1c])c(e)}}}}},1n:7(p,t,h,r){t=11 1N("([{;\\\\s])"+p+"\\\\s*:\\\\s*"+t+"[^;}]*");6 i=8.1Q.K;y(r)r=p+":"+r;8.3i(t,7(m,o){z(r?m[o+1]+r:m[o])+";17-"+m[o].1q(1)+";7h"+i+":1"});8.1Q.1b(1a);z i},2w:7(s){z s.18||""},5G:7(){y(33||!2l)16.5G();1d 16.9A("<1r 17=1o></1r>");8.3O=1R[1R.K-1];8.3O.17=1o;8.3O.18=2r},7g:7(){O(6 i=0;i<1R.K;i++){y(!1R[i].17&&1R[i].18){1R[i].18=""}}}}));7 3y(m){8.2Z=m;8.3q();V[m]=8;V.4t()};1t.1e({1h:3y,1g:7(){z"@2Z "+8.2Z+"{"+8.18+"}"},1u:2s,3q:7(){8.18="";8.2w();8.38();8.18=41(8.18);f={}},2w:7(){6 7e=[].4J(V.5F);6 M=/@2Z\\s+([^{]*)\\{([^@]+\\})\\s*\\}/5D;6 A=/\\9z\\b|^$/i,S=/\\9y\\b/i,P=/\\9x\\b/i;7 7d(c,m){4s.v=m;z c.13(M,4s)};7 4s(9w,m,c){m=5E(m);34(m){1m"2P":1m"2Y":y(m!=4s.v)z"";1m"1Y":z c}z""};7 5E(m){y(A.Z(m))z"1Y";1d y(S.Z(m))z(P.Z(m))?"1Y":"2P";1d y(P.Z(m))z"2Y"};6 3N=8;7 5C(s,p,m,l){6 c="";y(!l){m=5E(s.2Z);l=0}y(m=="1Y"||m==3N.2Z){y(l<3){O(6 i=0;i<s.7f.K;i++){c+=5C(s.7f[i],3F(s.2u,p),m,l+1)}}c+=79(s.2u?7c(s,p):7e.77()||"");c=7d(c,3N.2Z)}z c};6 f={};7 7c(s,p){6 u=1Z(s.2u,p);y(f[u])z"";f[u]=(s.3m)?"":7b(V.2w(s,p),3F(s.2u,p));z f[u]};6 U=/(43\\s*\\(\\s*[\'"]?)([\\w\\.]+[^:\\)]*[\'"]?\\))/5D;7 7b(c,p){z c.13(U,"$1"+p.1q(0,p.7a("/")+1)+"$2")};O(6 i=0;i<1R.K;i++){y(!1R[i].3m&&!1R[i].17){8.18+=5C(1R[i])}}},38:7(){8.18=V.5B.2V(8.18)},1u:2s});6 2c=14.1i("2c");6 4r=[];7 79(c){z 2n.2V(3r.2V(c))};7 5A(m,o){z 2c+(4r.1b(m[o])-1)+2c};7 42(v){z 2c.Z(v)?1k(4r[1k(v)]):v};6 2n=11 3M;2n.15(/\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\//);2n.15(/\'[^\']*\'/,5A);2n.15(/"[^"]*"/,5A);2n.15(/\\s+/," ");2n.15(/@(9v|9u)[^;\\n]+[;\\n]|<!\\-\\-|\\-\\->/);6 3r=11 3M;3r.15(/\\\\\'/,"\\\\9t");3r.15(/\\\\"/,"\\\\46");6 5z=11 3M;5z.15(/\'(\\d+)\'/,78);7 41(c){z 5z.2V(c)};7 78(m,o){z 4r[m[o+1]]};6 5y=[];7 4U(h){1n(h);1j(26,"9s",h)};7 1j(e,t,h){e.9r(t,h);5y.1b(1a)};7 76(e,t,h){2C{e.9q(t,h)}2j(i){}};1j(26,"9p",7(){6 h;1D(h=5y.77()){76(h[0],h[1],h[2])}});7 20(h,e,c){y(!h.1O)h.1O={};y(c)h.1O[e.2a]=e;1d 3u h.1O[e.2a];z c};1j(26,"6z",7(){y(!V.2Y)11 3y("2Y");V.2Y.1u()});6 75=/^\\d+(9o)?$/i;6 3d=/^\\d+%$/;6 3c=7(e,v){y(75.Z(v))z 25(v);6 s=e.1r.1f;6 r=e.J.1f;e.J.1f=e.D.1f;e.1r.1f=v||0;v=e.1r.4e;e.1r.1f=s;e.J.1f=r;z v};7 6x(t){6 e=16.3X(t||"2M");e.1r.18="1y:3C;6R:0;4K:9n;3G:1M;9m:9l(0 0 0 0);1f:-9k";e.2K=1o;z e};6 4q="17-";7 3D(e){z e.D["17-1y"]=="2z"};7 4o(e,p){z e.D[4q+p]||e.D[p]};7 2T(e,p,v){y(e.D[4q+p]==1U){e.J[4q+p]=e.D[p]}e.J[p]=v};7 4H(o,c,u){6 t=9j(7(){2C{y(!o.3q)z;o.3q(o,c,u);74(t)}2j(i){74(t)}},10)};1F.24("17-9i",7(){y(!2l)z;2r+="9h{3p-3o:9g}9f{3p-3o:1.9e;}9d{3p-3o:1.9c;}"+"9b{3p-3o:9a}99{3p-3o:.98}97{3p-3o:.96}";6 5w={};1s=11(5x.1e({1S:2s,3i:7(){8.3L.1b(1a)},2q:7(){O(6 i=0;i<8.3L.K;i++){6 m=14(8.3L[i][0]);6 f=8.3L[i][1]||6X;O(6 j=0;j<m.K;j++)f(m[j])}},1n:7(){8.1Q.1b(1a)},1u:7(){O(6 i=0;i<8.1Q.K;i++){6 m=14(8.1Q[i][0]);6 r=8.1Q[i][1],e;6 k=4g.95(2,i);O(6 j=0;(e=m[j]);j++){6 u=e.2a;y((5w[u]&k)==0){e=r(e)||e;5w[u]|=k}}}}}));1s.3i("94");1s.1n("93",7(e){y(!e.6o){6 f=14("5l,92",e)[0];y(f){1j(e,"73",7(){f.91()})}}});1s.1n("71,5l",7(e){y(e.2W=="70"){6 m=e.3z.19(/ 3n="([^"]*)"/i);e.J.3n=(m)?m[1]:""}y(e.2L=="5v"){1j(e,"73",7(){e.J.5u=1o;32("16.1Y."+e.2a+".J.5u=1z",1)})}});6 U=/^(5v|72|71)$/;1s.1n("90",7(e){1j(e,"8Z",7(){O(6 i=0;i<e.K;i++){y(6Z(e[i])){e[i].3m=1o;32("16.1Y."+e[i].2a+".3m=1z",1)}1d y(e[i].2W=="70"&&e[i].2L=="5v"){32("16.1Y."+e[i].2a+".3n=\'"+e[i].3n+"\'",1);e[i].3n=e[i].J.3n}}})});7 6Z(e){z U.Z(e.2L)&&!e.3m&&!e.J.5u};1s.1n("5d",7(e){y(e.8Y&&!e.6Y)e.6Y=""});6 P=(29<5.5)?"8X:":"";7 6X(e){6 f=16.3X("<"+P+e.3z.1q(1));y(e.3z.1q(-2)!="/>"){6 6V="</"+e.2W+">",n;1D((n=e.6W)&&n.3z!=6V){f.6t(n)}y(n)n.8W()}e.4R.6A(f,e)}});1F.24("17-8V",7(){1K=8;2r+="*{3H:22-2X}";8.3j=(29<5.5)?7(e){z e.1I}:7(e){z e.D.3j};8.3H=7(e){y(!1K.3j(e)){e.1r.2b="6T";y(e.D.6U=="1P")e.J.6U="2y";4k(e)}};7 4k(e){y(e!=1J&&e.D.1y!="3C"){4p(e);8U(e)}};6 3l=14.1i("3l");6 5t=14.1i("5t");7 4p(e){y(!e.J.3k){6 p=e.59;y(p&&1K.3j(p)&&e==3l(p))z;6 f=3l(e);y(f&&f.D.8T=="1M"&&1K.3j(f)){4p(f);m=5s(e,e.D.3k);c=5s(f,f.D.3k);y(m<0||c<0){e.J.3k=m+c}1d{e.J.3k=4g.3g(c,m)}f.J.3k="8S"}}};1k(23(4p).13(/5c/g,"6N").13(/4N/g,"8R"));7 5s(e,v){z(v=="1P")?0:3c(e,v)};6 U=/^[.\\d][\\w%]*$/,A=/^(1P|6T)$/,N="[.\\\\d]";6 4l,6S;7 6O(e){4l(e);6S(e)};7 2g(H){4l=7(e){y(!3d.Z(e.D.12))2g(e);4k(e)};7 2g(e,v){y(!e.J.3J){y(!v)v=e.D.12;e.J.3J=(U.Z(v))?4g.3g(0,2B(e,v)):v;2T(e,"12",e.J.3J)}};7 5r(e){y(!3D(e)){6 l=e.3B;1D(l&&!1K.3j(l))l=l.3B}z(l||1J).1I};7 1H(e,v){y(3d.Z(v))z 25(4c(v)/3w*5r(e));z 3c(e,v)};6 2B=7(e,v){6 b=e.D["2X-5o"]=="3G-2X";6 a=0;y(2m&&!b)a+=4n(e)+3K(e);1d y(!2m&&b)a-=4n(e)+3K(e);z 1H(e,v)+a};7 4n(e){z e.2S-e.1I};7 3K(e){z 1H(e,e.D.8Q)+1H(e,e.D.8P)};1k(23(3K).13(/6R/g,"6Q").13(/8O/g,"8N"));2r+="*{1A:1M;27:1M;3I-12:1M;3g-12:1M}";7 1A(e){y(e.D["3I-12"]!=1U){e.1r.1A=e.D["3I-12"]}y(20(1A,e,e.D.1A!="1M")){1K.3H(e);2g(e);4m(e)}};1k(23(1A).13(/3I/g,"3g"));1K.1A=1A;1K.27=27;7 4m(e){6 r=e.54();6 w=r.1W-r.1f;y(e.D.1A!="1M"&&w<=2B(e,e.D.1A)){e.J.12=2B(e,e.D.1A)}1d y(e.D.27!="1M"&&w>=2B(e,e.D.27)){e.J.12=2B(e,e.D.27)}1d{e.J.12=e.J.3J}};7 2x(e){y(20(2x,e,/^(2z|3C)$/.Z(e.D.1y)&&4o(e,"1f")!="1P"&&4o(e,"1W")!="1P"&&A.Z(4o(e,"12")))){5p(e);1K.3H(e)}};1K.2x=2x;7 5p(e){6 l=1H(e,e.J.52||e.D.1f);6 w=5r(e)-1H(e,e.D.1W)-l-8M(e);y(25(e.J.12)==w)z;e.J.12="";y(3D(e)||H||e.2S<w){y(!2m)w-=4n(e)+3K(e);y(w<0)w=0;e.J.3J=w;2T(e,"12",w)}};6 5q=0;4U(7(){6 i,w=(5q<1J.1I);5q=1J.1I;O(i 28 1A.1O){6 e=1A.1O[i];6 f=(25(e.J.12)==2B(e,e.D.1A));y(w&&f)e.J.12="";y(w==f)4m(e)}O(i 28 27.1O){6 e=27.1O[i];6 f=(25(e.J.12)==2B(e,e.D.27));y(!w&&f)e.J.12="";y(w!=f)4m(e)}O(i 28 2x.1O)5p(2x.1O[i])});y(26.8L!==1z){V.1n("12",N,2m?4l:4k)}V.1n("3I-12",N,1A);V.1n("3g-12",N,27);V.1n("1W",N,2x)};V.1n("3G-6P",N,7(e){y(e.D.8K!="8J"){e.8I=3c(e,e.D["3G-6P"])}});V.1n("2X-5o","22-2X",8.3H);V.1n("2X-5o","3G-2X",6O);6 1v=11 2U;1v.15(/6v/,"6u");1v.15(/12/,"2b");1v.15(/6w/,"5c");1v.15(/1f/,"2y");1v.15(/8H/,"6N");1v.15(/1W/,"56");1k(1v.2V(23(2g)));2g();8G(1o)});1F.24("17-8F",7(){y(29<5.5)z;6 A="6J.5n.8E";6 F="6K:"+A+"(1l=\'%1\',8D=\'6H\')";6 5j=11 1N((26.8C||"-8B.8A")+"$","i");6 3h=[];7 5f(e){6 f=e.6M[A];y(f){f.1l=e.1l;f.6L=1o}1d{e.J.5m=F.13(/%1/,e.1l);3h.1b(e)}e.1l=4i};7 6y(e){e.1l=e.4D;e.6M[A].6L=1z};V.3i(/6I\\s*:\\s*([\\d.]+)/,7(m,o){z"6G:1;5m:6K:6J.5n.8z(6I="+((4c(m[o+1])*3w)||1)+")"});6 B=/5e(-5i)?\\s*:\\s*([^\\(};]*)43\\(([^\\)]+)\\)([^;}]*)/;V.3i(B,7(m,o){6 u=42(m[o+3]);z 5j.Z(u)?"5m:"+F.13(/6H/,"8y").13(/%1/,u)+";6G:1;5e"+(m[o+1]||"")+":"+(m[o+2]||"")+"1M"+(m[o+4]||""):m[o]});y(1s){1s.1n("5d,5l",7(e){y(e.2W=="8x"&&e.2L!="5i")z;5k(e);1j(e,"8w",7(){y(!4j&&60.8v=="1l"&&e.1l.6F(4i)==-1)5k(e)})});6 6D=/^3W:.*;6E/i;6 6C=1Z("17-6E.8u",2k);7 5k(e){y(5j.Z(e.1l)){6 i=11 8t(e.12,e.2b);i.8s=7(){e.12=i.12;e.2b=i.2b;i=1U};i.1l=e.1l;e.4D=e.1l;5f(e)}1d y(6D.Z(e.1l)){e.1l=6C+"?"+e.1l.1q(5)}};6 I=/^5i/i;6 6B=1Z("17-2M.4C",2k);1s.1n("2M",7(e){y(I.Z(e.2L)){6 o=16.3X("<2M 2L=68/x-67>");o.1r.12=e.D.12;o.1r.2b=e.D.2b;o.3W=6B;6 u=1Z(e.3W,3F(5h.2u));e.4R.6A(o,e);14.5g("2M");4H(o,"",u);z o}})}6 4j=1z;1j(26,"6z",7(){4j=1o;O(6 i=0;i<3h.K;i++)6y(3h[i])});1j(26,"8r",7(){O(6 i=0;i<3h.K;i++)5f(3h[i]);4j=1z})});1F.24("17-2z",7(){V.1n("1y","2z",4a,"3C");V.1n("5e(-8q)?","[^};]*2z",4b);6 4Z=(2m)?"1X":"2F";6 4h=7(){y(1X.D.5b!="2z"){y(1X.D.5a=="1M"){1X.J.8p="8o-8n";1X.J.5a="43("+4i+")"}1X.J.5b="2z"}4h=2s};6 2h=6x("5d");7 1v(f){z 2A.2V(23(f))};6 2A=11 2U;2A.15(/6w/,"5c");2A.15(/1f/,"2y");2A.15(/6v/,"6u");2A.15(/12/,"2b");2A.15(/1W/,"56");2A.15(/X/,"Y");7 3f(e){z(e)?3D(e)||3f(e.59):1z};7 4f(e,p,3e){32("16.1Y."+e.2a+".J.4f(\'"+p+"\',\'"+3e+"\')",0)};7 4b(e){y(20(4b,e,e.D.5b=="2z"&&!e.61(1X))){4h();58(e);8m(e);4V(e)}};7 4V(e){2h.1l=e.D.5a.1q(5,-2);6 p=(e.6c)?e:e.59;p.6t(2h);57(e);8l(e);p.8k(2h)};7 58(e){e.1r.3E=e.D.3E;y(!3f(e)){6 3e="(25(J.3A)+16."+4Z+".6s)||0";4f(e,"3E",3e)}};1k(1v(58));7 57(e){6 p=3f(e)?"3E":"3A";e.J[p]=55(e,e.1r.3E)-e.54().1f-e.8j+2};1k(1v(57));7 55(e,p){34(p){1m"1f":1m"2y":z 0;1m"1W":1m"56":z 1J.1I-2h.2S;1m"8i":z(1J.1I-2h.2S)/2;8h:y(3d.Z(p)){z 25((1J.1I-2h.2S)*4c(p)/3w)}2h.1r.1f=p;z 2h.3A}};1k(1v(55));7 4a(e){y(20(4a,e,3D(e))){2T(e,"1y","3C");2T(e,"1f",e.D.1f);2T(e,"2y",e.D.2y);4h();y(1K)1K.2x(e);49(e)}};7 49(e,r){8g(e,r);4Y(e,r,1o);y(!e.J.4d&&e.D.4X=="1P"&&e.D.1W!="1P"){6 l=1J.1I-1H(e,e.D.1W)-1H(e,e.J.52)-e.1I;y(e.D.8f=="1P")l=25(l/2);y(3f(e.3B))e.J.4e+=l;1d e.J.50=l}53(e);8e(e)};7 53(e){y(e.D.12!="1P"){6 r=e.54();6 w=e.2S-1J.1I+r.1f-2;y(w>=0){w=4g.3g(3c(e,e.D.12)-w,0);2T(e,"12",w)}}};1k(1v(53));7 4Y(e,r){y(!r&&3d.Z(e.D.12)){e.J.2g=e.D.12}y(e.J.2g){e.J.12=1H(e,e.J.2g)}y(r){y(!e.J.4d)z}1d{e.J.50=0;e.J.52=e.D.1f;e.J.4d=e.D.1W!="1P"&&e.D.1f=="1P"}e.J.1f="";e.J.51=4W(e);e.J.4e=e.J.51;y(!r&&!3f(e.3B)){6 3e="J.51+J.50+16."+4Z+".6s";4f(e,"4e",3e)}};1k(1v(4Y));7 4W(e){6 s=e.3A,n=1;y(e.J.4d){s=1J.1I-e.2S-1H(e,e.D.1W)}y(e.D.4X!="1P"){s-=1H(e,e.D.4X)}1D(e=e.3B){y(e.D.1y!="8d")n=-1;s+=e.3A*n}z s};1k(1v(4W));7 1H(e,v){y(3d.Z(v))z 25(4c(v)/3w*1J.1I);z 3c(e,v)};1k(1v(1H));7 6r(){6 e=4b.1O;O(6 i 28 e)4V(e[i]);e=4a.1O;O(i 28 e){49(e[i],1o);49(e[i],1o)}48=0};6 48;4U(7(){y(!48)48=32(6r,0)})});1F.24("17-8c-1V",7(){14.24("8b-8a",7(){1V[">"]=7(r,f,t,n){6 e,i,j;O(i=0;i<f.K;i++){6 s=6q(f[i]);O(j=0;(e=s[j]);j++)y(4T(e,t,n))r.1b(e)}};1V["+"]=7(r,f,t,n){O(6 i=0;i<f.K;i++){6 e=47(f[i]);y(e&&4T(e,t,n))r.1b(e)}};1V["@"]=7(r,f,a){6 t=2R[a].Z;6 e,i;O(i=0;(e=f[i]);i++)y(t(e))r.1b(e)};1B["4N-89"]=7(e){z!4S(e)};1B["4Q"]=7(e,c){c=11 1N("^"+c,"i");1D(e&&!e.2H("4Q"))e=e.4R;z e&&c.Z(e.2H("4Q"))};1p.6p=/\\\\:/g;1p.3x="@";1p.3a={};1p.13=7(m,a,n,c,v){6 k=8.3x+m;y(!2R[k]){a=8.3Z(a,c||"",v||"");2R[k]=a;2R.1b(a)}z 2R[k].1c};1p.38=7(s){s=s.13(8.6p,"|");6 m;1D(m=s.19(8.19)){6 r=8.13(m[0],m[1],m[2],m[3],m[4]);s=s.13(8.19,r)}z s};1p.3Z=7(p,t,v){6 a={};a.1c=8.3x+2R.K;a.66=p;t=8.3a[t];t=t?t(8.2H(p),2w(v)):1z;a.Z=11 3b("e","z "+t);z a};1p.2H=7(n){34(n.5Z()){1m"1c":z"e.1c";1m"3U":z"e.1x";1m"O":z"e.6o";1m"2u":y(4P){z"23((e.3z.19(/2u=\\\\46?([^\\\\s\\\\46]*)\\\\46?/)||[])[1]||\'\')"}}z"e.2H(\'"+n.13(N,":")+"\')"};1p.3a[""]=7(a){z a};1p.3a["="]=7(a,v){z a+"=="+2c.15(v)};1p.3a["~="]=7(a,v){z"/(^| )"+4O(v)+"( |$)/.Z("+a+")"};1p.3a["|="]=7(a,v){z"/^"+4O(v)+"(-|$)/.Z("+a+")"};6 6n=45;45=7(s){z 6n(1p.38(s))}});6 1p=14.1i("1p");6 H=/a(#[\\w-]+)?(\\.[\\w-]+)?:(65|62)/i;6 6l=/\\s*\\{\\s*/,6m=/\\s*\\}\\s*/,C=/\\s*\\,\\s*/;6 F=/(.*)(:4N-(88|87))/;3y.1C.1e({38:7(){8.1T();6 o=V.2t.K;6 2Q=8.18.2O(6m),r;6 2f,c,i,j;O(i=0;i<2Q.K;i++){r=2Q[i].2O(6l);2f=r[0].2O(C);c=r[1];O(j=0;j<2f.K;j++){2f[j]=c?8.6k(2f[j],c):""}2Q[i]=2f.2p("\\n")}8.18=2Q.2p("\\n");8.2t=V.2t.1q(o)},1u:7(){6 r,i;O(i=0;(r=8.2t[i]);i++)r.1u()},6k:7(s,c){y(V.6j.Z(s)){6 m;y(m=s.19(1L.39)){z 11 1L(m[1],m[2],c)}1d y(m=s.19(2d.39)){y(!2l||!H.Z(m)||2d.44.Z(m)){z 11 2d(s,m[1],m[2],m[3],c)}}1d z 11 1G(s,c)}z s+" {"+c+"}"}});V.1e({2t:[],1B:14.1i("1B"),36:{},2e:14.1i("2e"),1G:1G,2d:2d,1L:1L,2J:2J,2q:7(){6 p=8.1B+"|6i|6h|"+8.36;p=p.13(/(21|37)\\|/g,"");8.6j=11 1N("[>+~\\[]|([:.])[\\\\w-()]+\\\\1|:("+p+")");6 c="[^\\\\s(]+\\\\s*[+~]|@\\\\d+|:(";1G.44=11 1N(c+p+")","g");2d.44=11 1N(c+8.1B+")","g");2d.39=11 1N("(.*):("+8.36+")(.*)");1L.39=/(.*):(6i|6h).*/;8.1T()},1u:7(){8.2P.1u();8.1T()},2w:7(s,p){z 2v?(3T(s.2u,p)||s.18):8.1T(s)},1j:7(e,t,h){1j(e,t,h)}});7 1G(s,c){8.1c=V.2t.K;8.1x=1G.3x+8.1c;s=(s).19(F)||s||"*";8.40=s[1]||s;8.4M=1G.6g(8.40)+"."+8.1x+(s[2]||"");8.18=c;8.39=11 1N("\\\\s"+8.1x+"(\\\\s|$)","g");V.2t.1b(8);8.1S()};1t.1e({1h:1G,1g:7(){z 8.4M+" {"+8.18+"}"},1S:2s,15:7(e){e.1x+=" "+8.1x},3v:7(e){e.1x=e.1x.13(8.39,"$1")},1u:7(){6 m=V.2e[" *."+8.1x]=14(8.40);O(i=0;i<m.K;i++)8.15(m[i])}});1G.3x="5Y";1G.6f=/>/g;1G.6g=7(s){s=1p.38(s);z s.13(8.44,"").13(8.6f," ")};7 2d(s,a,d,t,c){8.6e=a||"*";8.6d=V.36[d];8.4L=t;8.1T(s,c)};1G.1e({1h:2d,1u:7(){6 m=14(8.6e);O(6 i=0;i<m.K;i++){6 t=(8.4L)?14(8.4L,m[i]):[m[i]];y(t.K)8.6d.2q(m[i],t,8)}}});6 A=/^4I/;6 U=/^43\\s*\\(\\s*([^)]*)\\)$/;6 M={86:"85",84:"83",82:"81",80:"7Z"};6 6b=1Z("17-22.4C",2k)+"?";2r+=".2K{4K:1M}";7 1L(s,p,c){8.1y=p;6 2N=c.19(1L.6a),m,e;y(2N){2N=2N[1];m=2N.2O(/\\s+/);O(6 i=0;(e=m[i]);i++){m[i]=A.Z(e)?{4I:e.1q(5,-1)}:(e.7Y(0)=="\'")?42(e):41(e)}2N=m}8.22=2N;8.1T(s,41(c))};1G.1e({1h:1L,1g:7(){z"."+8.1x+"{4K:7X}"},1S:7(){8.19=14(8.40);O(6 i=0;i<8.19.K;i++){6 r=8.19[i].J;y(!r[8.1y])r[8.1y]={18:""};r[8.1y].18+=";"+8.18;y(8.22!=1U)r[8.1y].22=8.22}},1u:7(){y(8.22==1U)z;O(6 i=0;i<8.19.K;i++){8.3Z(8.19[i])}},3Z:7(t){6 g=t.J[8.1y];y(g){6 c=[].4J(g.22||"");O(6 j=0;j<c.K;j++){y(3Y c[j]=="2M"){c[j]=t.2H(c[j].4I)}}c=c.2p("");6 u=c.19(U);6 h=1L[u?"69":"4E"].13(/%1/,8.1x);6 4G=g.18.13(/\'/g,\'"\');6 4F=M[8.1y+7W(t.6c)];y(u){6 p=16.3X(h);t.7V(4F,p);p.3W=6b;4H(p,4G,2c.3v(u[1]))}1d{h=h.13(/%2/,4G).13(/%3/,c);t.7U(4F,h)}t.J[8.1y]=1U}}});1L.6a=/22\\s*:\\s*([^;]*)(;|$)/;1L.69="<2M 3U=\'2K %1\' 2K 12=3w% 2b=0 2L=68/x-67>";1L.4E="<17:! 3U=\'2K %1\' 2K 1r=\'%2\'>%3</17:!>";7 2J(n,a){8.66=n;8.2q=a;8.2I={};V.36[n]=8};1t.1e({1h:2J,20:7(i){6 c=i[2];i.1c=c.1c+i[0].2a;y(!8.2I[i.1c]){6 t=i[1],j;O(j=0;j<t.K;j++)c.15(t[j]);8.2I[i.1c]=i}},35:7(i){y(8.2I[i.1c]){6 c=i[2];6 t=i[1],j;O(j=0;j<t.K;j++)c.3v(t[j]);3u 8.2I[i.1c]}}});V.1B.1g=7(){6 t=[],p;O(p 28 8){y(8[p].K>1)p+="\\\\([^)]*\\\\)";t.1b(p)}z t.2p("|")};V.1B["21"]=7(e){z e.D["17-21"]=="21"};V.1B["37"]=7(e){z e.D["17-21"]=="37"};6 64=(29<5.5)?"7T":"7S";6 63=(29<5.5)?"7R":"7Q";V.36.1g=V.1B.1g;6 3s=11 2J("65",7(e){6 i=1a;V.1j(e,64,7(){3s.20(i)});V.1j(e,63,7(){3s.35(i)})});6 3t=11 2J("7P",7(e){6 i=1a;V.1j(e,"7O",7(){3t.35(i);3t.20(i)});V.1j(e,"7N",7(){3t.35(i)});y(e==16.7M){3t.20(i)}});6 3V=11 2J("62",7(e){6 i=1a;V.1j(e,"7L",7(){3V.20(i)})});1j(16,"7K",7(){6 i=3V.2I,j;O(j 28 i)3V.35(i[j]);i=3s.2I;O(j 28 i)y(!i[j][0].61(60.7J))3s.35(i[j])});2o(1p);1p.1e({2H:7(n){34(n.5Z()){1m"3U":z"e.1x.13(/\\\\b\\\\s*5Y\\\\d+/g,\'\')";1m"1l":z"(e.4D||e.1l)"}z 8.1T(n)}});2n.15(/::/,":");3r.15(/\\\\([\\7I-7H-F]{1,4})/,7(m,o){m=m[o+1];z"\\\\u"+"7G".1q(m.K)+m})});2G=1o;y(2m)1k(3T("17-7F.5X",2k));V.1S();y(2l&&1s)1s.1S();y(33)1F.1S();1d{2F.7E(1Z("17-3q.4C",2k));1j(16,"7D",7(){y(16.5W=="33")32(1F.1S,0)})}}2j(e){31("4B [0]: "+e.5V)}5U{}};',62,634,'||||||var|function|this||||||||||||||||||||||||||if|return||||currentStyle||||||runtimeStyle|length||||for|||||||ie7CSS||||test||new|width|replace|cssQuery|add|document|ie7|cssText|match|arguments|push|id|else|specialize|left|toString|constructor|valueOf|addEventHandler|eval|src|case|addRecalc|true|AttributeSelector|slice|style|ie7HTML|Common|recalc|_0|that|className|position|false|minWidth|pseudoClasses|prototype|while|fr|IE7|Rule|getPixelWidth|clientWidth|viewport|ie7Layout|PseudoElement|none|RegExp|elements|auto|recalcs|styleSheets|init|inherit|null|selectors|right|body|all|makePath|register|link|content|String|addModule|parseInt|window|maxWidth|in|appVersion|uniqueID|height|Quote|DynamicRule|cache|se|fixWidth|_1|klass|catch|path|isHTML|quirksMode|encoder|ICommon|join|apply|HEADER|DUMMY|rules|href|httpRequest|getText|fixRight|top|fixed|_2|getFixedWidth|try|thisElement|ancestor|documentElement|loaded|getAttribute|instances|DynamicPseudoClass|ie7_anon|type|object|co|split|screen|ru|attributeSelectors|offsetWidth|setOverrideStyle|ParseMaster|exec|tagName|box|print|media|_3|alert|setTimeout|complete|switch|unregister|dynamicPseudoClasses|visited|parse|MATCH|tests|Function|getPixelValue|PERCENT|ex|_4|max|_5|addFix|hasLayout|marginTop|firstElementChild|disabled|value|size|font|load|safeString|_6|_7|delete|remove|100|PREFIX|StyleSheet|outerHTML|offsetLeft|offsetParent|absolute|isFixed|backgroundPositionX|getPath|border|boxSizing|min|fixedWidth|getPaddingWidth|fixes|Parser|self|styleSheet|st|modules|_8|x01|loadFile|class|_9|data|createElement|typeof|create|selector|decode|getString|url|COMPLEX|parseSelector|x22|nextElementSibling|_10|_11|_12|_13|parseFloat|autoLeft|pixelLeft|setExpression|Math|_14|BLANK_GIF|_15|_16|applyWidth|resizeWidth|getBorderWidth|getDefinedStyle|collapseMarginTop|_17|_18|_19|refresh|el|ca|getElementsByTagName|version|escapeChar|ancestorOf|_20|Error|htc|pngSrc|ANON|po|cs|addTimer|attr|concat|display|target|selectorText|first|regEscape|isMSIE|lang|parentNode|previousElementSibling|compareTagName|addResize|_21|getScreenLeft|marginLeft|positionLeft|_22|shiftLeft|screenLeft|_23|clipWidth|getBoundingClientRect|getOffsetLeft|bottom|setOffsetLeft|backgroundLeft|parentElement|backgroundImage|backgroundAttachment|Top|img|background|_24|clearCache|location|image|_25|_26|input|filter|Microsoft|sizing|resizeRight|_27|layoutWidth|_28|lastElementChild|clicked|submit|_29|Fix|_30|decoder|_31|parser|_32|gi|_33|styles|createStyleSheet|isXML|caching|_34|compareNamespace|getDocument|continue|links|error|callee|ignoreCase|_35|_36|ie7_debug|finally|description|readyState|js|ie7_class|toLowerCase|event|contains|active|_37|_38|hover|name|scriptlet|text|OBJECT|CONTENT|_39|canHaveChildren|dynamicPseudoClass|attach|CHILD|simple|after|before|UNKNOWN|createRule|B1|B2|_40|htmlFor|NS_IE|childElements|_41|scrollLeft|appendChild|Height|Width|Left|createTempElement|_42|onbeforeprint|replaceChild|_43|_44|B64|base64|indexOf|zoom|scale|opacity|DXImageTransform|progid|enabled|filters|Bottom|borderBox|spacing|margin|padding|applyHeight|0cm|verticalAlign|en|nextSibling|_45|title|_46|BUTTON|button|reset|onclick|clearInterval|PIXEL|removeEventHandler|pop|_47|_48|lastIndexOf|_49|_50|_51|_52|imports|trash|ie7_recalc|getInlineStyles|innerHTML|nodeType|ST|select|Array|_53|mimeType|Boolean|lastChild|firstChild|ES|_54|_55|_56|_57|_58|DE|status|scripts|search|onreadystatechange|addBehavior|quirks|0000|fA|da|srcElement|onmouseup|onmousedown|activeElement|onblur|onfocus|focus|onmouseleave|onmouseout|onmouseenter|onmouseover|insertAdjacentHTML|insertAdjacentElement|Number|inline|charAt|beforeEnd|after1|afterEnd|after0|afterBegin|before1|beforeBegin|before0|letter|line|child|level2|css|css2|static|clipHeight|marginRight|positionTop|default|center|clientLeft|removeChild|setOffsetTop|backgroundTop|repeat|no|backgroundRepeat|attachment|onafterprint|onload|Image|php|propertyName|onpropertychange|INPUT|crop|Alpha|png|trans|IE7_PNG_SUFFIX|sizingMethod|AlphaImageLoader|graphics|fixHeight|Right|cellSpacing|collapse|borderCollapse|IE7_BOX_MODEL|getMarginWidth|Margin|Padding|paddingRight|paddingLeft|last|0px|styleFloat|collapseMarginBottom|layout|removeNode|HTML|alt|onsubmit|form|click|textarea|label|abbr|pow|67em|h6|83em|h5|1em|h4|17em|h3|5em|h2|2em|h1|html4|setInterval|9999|rect|clip|block|px|onunload|detachEvent|attachEvent|onresize|x27|import|namespace|ma|bprint|bscreen|ball|write|item|innerText|getTextContent|scopeName|toUpperCase|ownerDocument|Document|XML|URL|xml|unknown|previousSibling|number|successfully|ie5|instanceOf|Object|common|caller|gif|blank|file|loading|responseText|200|send|GET|open|XMLHTTP|ActiveXObject|Msxml2|ScriptEngineMajorVersion|ms_|ie7_off|CSS1Compat|compatMode|MSIE|navigator|alpha'.split('|'),0,{}))
@@ -1,749 +0,0 @@
1
- // LiveTree, version: 0.1
2
- //
3
- // Home page: http://www.epiphyte.ca/code/live_tree.html
4
- //
5
- // Copyright (c) 2005 Emanuel Borsboom
6
- //
7
- // Permission is hereby granted, free of charge, to any person obtaining a
8
- // copy of this software and associated documentation files (the
9
- // "Software"), to deal in the Software without restriction, including
10
- // without limitation the rights to use, copy, modify, merge, publish,
11
- // distribute, sublicense, and/or sell copies of the Software, and to permit
12
- // persons to whom the Software is furnished to do so, subject to the
13
- // following conditions:
14
- //
15
- // The above copyright notice and this permission notice shall be included
16
- // in all copies or substantial portions of the Software.
17
- //
18
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
21
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
22
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
25
-
26
- function LiveTree(id, options) {
27
- this.id = id;
28
-
29
- if (options == null) {
30
- options = {};
31
- }
32
-
33
- this.dataUrl = options.dataUrl;
34
- this.cssClass = options.cssClass;
35
- this.cssStyle = options.cssStyle;
36
- this.expandRootItem = (options.expandRootItem == null ? true : options.expandRootItem);
37
- this.hideRootItem = (options.hideRootItem == null ? false : options.hideRootItem);
38
- this.rootItemId = options.rootItemId;
39
- this.expandItemOnClick = (options.expandItemOnClick == null ? true : options.expandItemOnClick);
40
- this.initialData = options.initialData;
41
- this.scroll = (options.scroll == null ? true : options.scroll);
42
- this.preloadItems = (options.preloadItems == null ? true : options.preloadItems);
43
-
44
- this.collapsedItemIconHtml = options.collapsedItemIconHtml;
45
- this.expandedItemIconHtml = options.expandedItemIconHtml;
46
- this.leafIconHtml = options.leafIconHtml;
47
- this.loadingIconHtml = options.loadingIconHtml;
48
- this.loadingTreeHtml = options.loadingTreeHtml;
49
- this.searchingHtml = options.searchingHtml;
50
-
51
- this.onClickItem = options.onClickItem;
52
- this.allowClickBranch = (options.allowClickBranch == null ? true : options.allowClickBranch);
53
- this.allowClickLeaf = (options.allowClickLeaf == null ? true : options.allowClickLeaf);
54
- this.onExpandItem = options.onExpandItem;
55
- this.onCollapseItem = options.onCollapseItem;
56
- this.onLoadItem = options.onLoadItem;
57
-
58
- this._root = {};
59
- this._itemsIndex = {};
60
- this._activeItemId = null;
61
- this._scrollToItemIdOnLoad = null;
62
- this._scrollToItemMustBeExpanded = false;
63
- this._searchCount = 0;
64
- this._preloadCount = 0;
65
- this._updateItemDisplay = null;
66
- }
67
-
68
- LiveTree.prototype._markItemForUpdateDisplay = function (item) {
69
- var tree = this;
70
- // This is not very intelligent yet... basically if only one item needs to be updated, that's fine, otherwise the whole tree is updated.
71
- if (tree._updateItemDisplay == null) {
72
- tree._updateItemDisplay = item;
73
- } else if (tree._updateItemDisplay != item) {
74
- tree._updateItemDisplay = tree._root;
75
- }
76
- }
77
-
78
- LiveTree.prototype._getClass = function (suffix) {
79
- if (suffix != "") {
80
- suffix = "_" + suffix;
81
- }
82
- result = 'live_tree' + suffix;
83
- if (this.cssClass != null) {
84
- result += ' ' + this.cssClass + suffix;
85
- }
86
- return result;
87
- }
88
-
89
- LiveTree.prototype._getCollapsedItemIconHtml = function () {
90
- if (this.collapsedItemIconHtml != null) {
91
- return this.collapsedItemIconHtml;
92
- } else {
93
- return '<img src="/images/live_tree_branch_collapsed_icon.gif" alt="&gt;" width="9" height="9" class="' + this._getClass("item_icon") + '" />';
94
- }
95
- }
96
-
97
- LiveTree.prototype._getExpandedItemIconHtml = function () {
98
- if (this.expandedItemIconHtml != null) {
99
- return this.expandedItemIconHtml;
100
- } else {
101
- return '<img src="/images/live_tree_branch_expanded_icon.gif" alt="v" width="9" height="9" class="' + this._getClass("item_icon") + '" />';
102
- }
103
- }
104
-
105
- LiveTree.prototype._getLeafIconHtml = function () {
106
- if (this.leafIconHtml != null) {
107
- return this.leafIconHtml;
108
- } else {
109
- return '<img src="/images/live_tree_leaf_icon.gif" alt=" " width="9" height="9" class="' + this._getClass("item_icon") + '" />';
110
- }
111
- }
112
-
113
- LiveTree.prototype._getLoadingIconHtml = function () {
114
- if (this.loadingIconHtml != null) {
115
- return this.loadingIconHtml;
116
- } else {
117
- return '<img src="/images/live_tree_loading_spinner.gif" alt="[loading]" width="10" height="10" class="' + this._getClass("loading_icon") + '" />';
118
- }
119
- }
120
-
121
- LiveTree.prototype._getLoadingTreeHtml = function () {
122
- if (this.loadingTreeHtml != null) {
123
- return this.loadingTreeHtml;
124
- } else {
125
- return '<span class="' + this._getClass("loading_tree") + '">' + this._getLoadingIconHtml() + 'Loading tree data&hellip;</span>';
126
- }
127
- }
128
-
129
- LiveTree.prototype._getSearchingHtml = function () {
130
- if (this.searchingHtml != null) {
131
- return this.searchingHtml;
132
- } else {
133
- return '<div class="' + this._getClass("searching") + '">' + this._getLoadingIconHtml() + 'Searching for item&hellip;</div>';
134
- }
135
- }
136
-
137
- LiveTree.prototype._addItem = function (item, parent) {
138
- // If this item ID was already loaded, copy its status from the old data
139
- var oldItem = this._itemsIndex[item.id];
140
- if (oldItem != null) {
141
- item.isLoading = oldItem.isLoading;
142
- item.isLoadingBackground = oldItem.isLoadingBackground;
143
- item.isExpanded = oldItem.isExpanded;
144
- }
145
- this._itemsIndex[item.id] = item;
146
-
147
- // Add some extra properties
148
- item.isLeaf = !(item.children == null || item.children.length > 0);
149
- item.isLoaded = item.children != null;
150
- item.parent = parent;
151
-
152
- // Replace or add this item in the parent's list of children
153
- if (parent.children == null) {
154
- parent.children = [item];
155
- } else {
156
- var found = false;
157
- for (var i = 0; i < parent.children.length; i++) {
158
- if (parent.children[i].id == item.id) {
159
- parent.children[i] = item;
160
- found = true;
161
- break;
162
- }
163
- }
164
- if (!found) {
165
- parent.children[parent.children.length] = item;
166
- }
167
- }
168
-
169
- // Now add the item's children as well
170
- if (item.children != null) {
171
- for (var i = 0; i < item.children.length; i++) {
172
- this._addItem(item.children[i], item);
173
- }
174
- }
175
- }
176
-
177
- LiveTree.prototype._startPreloads = function (item) {
178
- var tree = this;
179
- if (!tree.preloadItems || tree._preloadCount > 0) {
180
- return false;
181
- }
182
- if (item == null) {
183
- item = tree._root;
184
- }
185
- //alert("startPreloads " + item.id);
186
- if (!item.isExpanded || item.isLoading) {
187
- return false;
188
- }
189
- var tailBranch = true;
190
- for (var i = 0; i < item.children.length; i++) {
191
- var child = item.children[i];
192
- if (!child.isLeaf && ( child.isLoaded || child.isLoading )) {
193
- tailBranch = false;
194
- }
195
- }
196
- var doLoad = false;
197
- if (tailBranch) {
198
- for (var i = 0; i < item.children.length; i++) {
199
- var child = item.children[i];
200
- if (!child.isLeaf) {
201
- if (!child.isLoaded && !child.isLoading) {
202
- //alert("setting loading for " + child.id);
203
- doLoad = true;
204
- child.isLoading = true;
205
- child.isLoadingBackground = true;
206
- }
207
- }
208
- }
209
- }
210
- var didLoad = false;
211
- if (doLoad) {
212
- //alert("preloading children of " + item.id);
213
- tree._preloadCount++;
214
- tree._requestItem(item.id, 3, tree._onPreloadItemReceived.bind(tree));
215
- tree._markItemForUpdateDisplay(item);
216
- didLoad = true;
217
- } else {
218
- for (var i = 0; i < item.children.length; i++) {
219
- var child = item.children[i];
220
- if (!child.isLeaf && child.isLoaded) {
221
- if (tree._startPreloads(child)) {
222
- didLoad = true;
223
- }
224
- }
225
- }
226
- }
227
-
228
- return didLoad;
229
- }
230
-
231
- LiveTree.prototype._handleReceivedItem = function (item, requestOptions) {
232
- var tree = this;
233
-
234
- // Find item's parent
235
- var parent = null;
236
- if (requestOptions.includeParents) {
237
- // The response includes the desired item's parents, but we don't want to over-write
238
- // data that is already there (since it may include other children deeper down), so
239
- // go down the tree until we find an item that hasn't been loaded before (or we get to the
240
- // requested item)
241
- var newParent = tree._getItem(item.id).parent;
242
- while (true) {
243
- // since we included parents, there should only be a single child with children, so find that one
244
- var child = null;
245
- for (var i = 0; i < item.children.length; i++) {
246
- if (item.children[i].children != null && item.children[i].children.length > 0) {
247
- if (child != null) {
248
- alert("LiveTree error: didn't expect multiple children with children while iterating through parents");
249
- return;
250
- }
251
- child = item.children[i];
252
- }
253
- }
254
- if (child == null || tree._getItem(child.id) == null) {
255
- break;
256
- }
257
- newParent = item;
258
- item = child;
259
- }
260
- parent = tree._getItem(newParent.id);
261
- } else {
262
- // First, check if root is the parent
263
- if (tree._root.children == null) {
264
- // ... which is always the case if the root has no children, since that means nothing has been loaded yet
265
- parent = tree._root;
266
- } else {
267
- for (var i = 0; i < tree._root.children.length; i++) {
268
- if (item.id == tree._root.children[i].id) {
269
- parent = tree._root;
270
- break;
271
- }
272
- }
273
- }
274
- // Otherwise, it must have been loaded before, so get the old parent
275
- if (parent == null) {
276
- var oldItem = tree._itemsIndex[item.id];
277
- if (oldItem == null) {
278
- alert("LiveTree error: attempt to load item of unknown parentage");
279
- return false;
280
- }
281
- parent = oldItem.parent;
282
- }
283
- }
284
-
285
- // Now add the item to its parent
286
- tree._addItem(item, parent);
287
- //alert(ekb_inspect(tree._root));
288
- tree._markItemForUpdateDisplay(parent);
289
-
290
- if (tree.onLoadItem != null) {
291
- tree.onLoadItem(item);
292
- }
293
- return true;
294
- }
295
-
296
- LiveTree.prototype._onItemResponse = function (request, onItemCallback, requestOptions) {
297
- var tree = this;
298
- if (requestOptions.includeParents) {
299
- tree._searchCount--;
300
- }
301
- var item;
302
- try {
303
- eval("item = " + request.responseText);
304
- } catch (e) {
305
- alert("LiveTree error: bad items data from server: " + e);
306
- return;
307
- }
308
- var handled = tree._handleReceivedItem(item, requestOptions);
309
- if (handled) {
310
- onItemCallback(item, requestOptions);
311
- }
312
- }
313
-
314
- LiveTree.prototype._requestItem = function (itemId, depth, onItemCallback, options) {
315
- var tree = this;
316
- if (options == null) {
317
- options = {};
318
- }
319
- var url = tree.dataUrl;
320
- if (url == null) {
321
- alert("LiveTree error: no data URL provided");
322
- return false;
323
- }
324
- var requestOptions = new Object();
325
- var delim = "?";
326
- if (itemId != null) {
327
- requestOptions.itemId = itemId;
328
- url += delim + "item_id=" + itemId;
329
- delim = "&";
330
- }
331
- if (depth != null) {
332
- requestOptions.depth = depth;
333
- url += delim + "depth=" + depth;
334
- delim = "&";
335
- }
336
- if (options.includeParents) {
337
- requestOptions.includeParents = true;
338
- requestOptions.rootItemId = tree.rootItemId;
339
- url += delim + "include_parents=1&root_item_id=" + tree.rootItemId;
340
- tree._searchCount++;
341
- }
342
- new Ajax.Request(url, {onComplete:function (request) { tree._onItemResponse(request, onItemCallback, requestOptions) }, evalScripts:true, asynchronous:true});
343
- return true;
344
- }
345
-
346
- LiveTree.prototype._onExpandItemReceived = function (item, requestOptions) {
347
- var tree = this;
348
- item.isLoading = false;
349
- tree._startPreloads();
350
- tree._updateDisplay();
351
- }
352
-
353
- LiveTree.prototype._onPreloadItemReceived = function (item, requestOptions) {
354
- var tree = this;
355
- tree._preloadCount--;
356
- for (var i = 0; i < item.children.length; i++) {
357
- item.children[i].isLoading = false;
358
- }
359
- tree._markItemForUpdateDisplay(item);
360
- tree._startPreloads();
361
- tree._updateDisplay();
362
- }
363
-
364
- LiveTree.prototype._onClickExpand = function (item) {
365
- var tree = this;
366
- var expanded = tree._expandItem(item);
367
- tree._updateDisplay();
368
- if (expanded) {
369
- tree.scrollToItem(item.id);
370
- if (item.isLoading) {
371
- tree._scrollToItemIdOnLoad = item.id;
372
- tree._scrollToItemMustBeExpanded = true;
373
- }
374
- if (tree.onExpandItem != null) {
375
- tree.onExpandItem(item);
376
- }
377
- }
378
- }
379
-
380
- LiveTree.prototype._onClickCollapse = function (item) {
381
- var tree = this;
382
- if (!item.isExpanded) {
383
- return;
384
- }
385
- item.isExpanded = false;
386
- tree._markItemForUpdateDisplay(item);
387
- tree._updateDisplay();
388
- if (tree.onCollapseItem != null) {
389
- tree.onCollapseItem(item);
390
- }
391
- }
392
-
393
- LiveTree.prototype._onClickItem = function (item) {
394
- var tree = this;
395
- if (tree.expandItemOnClick && !item.isExpanded && !item.isLeaf) {
396
- tree._onClickExpand(item);
397
- }
398
- if (tree.onClickItem != null && ((tree.allowClickLeaf && item.isLeaf) || (tree.allowClickBranch && !item.isLeaf))) {
399
- tree.onClickItem(item);
400
- }
401
- tree._updateDisplay();
402
- }
403
-
404
- LiveTree.prototype._getItem = function (itemId) {
405
- return this._itemsIndex[itemId];
406
- }
407
-
408
- LiveTree.prototype._getItemElement = function (itemId) {
409
- return $(this.id + "_item_" + itemId);
410
- }
411
-
412
- LiveTree.prototype._displayItem = function (item, isRoot) {
413
- var tree = this;
414
- var elem;
415
- if (isRoot) {
416
- elem = $(tree.id + "_root");
417
- } else {
418
- elem = tree._getItemElement(item.id);
419
- }
420
- var html = '';
421
- if (!isRoot) {
422
- if (!item.isLeaf) {
423
- if (item.isExpanded) {
424
- html += '<a href="#" id="' + tree.id + '_branch_collapse_link_' + item.id + '" class="' + this._getClass("branch_collapse_link") + '">'; {
425
- html += tree._getExpandedItemIconHtml();
426
- } html += '</a>';
427
- } else {
428
- html += '<a href="#" id="' + tree.id + '_branch_expand_link_' + item.id + '" class="' + this._getClass("branch_expand_link") + '">'; {
429
- html += tree._getCollapsedItemIconHtml();
430
- } html += '</a>';
431
- }
432
- if (item.isLoading && !item.isLoadingBackground) {
433
- html += tree._getLoadingIconHtml();
434
- }
435
- } else {
436
- html += tree._getLeafIconHtml();
437
- }
438
- var item_link_exists = false;
439
- var extraNameClass = "";
440
- if (item.id == tree._activeItemId) {
441
- extraNameClass = " " + this._getClass("active_item_name");
442
- }
443
- var name_html = '<span id="' + tree.id + '_item_name_' + item.id + '" class="' + this._getClass("item_name") + extraNameClass + '">' + item.name + '</span>';
444
- if ((tree.onClickItem != null && ((tree.allowClickLeaf && item.isLeaf) || (tree.allowClickBranch && !item.isLeaf))) ||
445
- (tree.expandItemOnClick && !item.isLeaf && !item.isExpanded)) {
446
- name_html = '<a href="#" id="' + tree.id + '_item_link_' + item.id + '" class="' + this._getClass("item_link") + '">' + name_html + '</a>';
447
- item_link_exists = true;
448
- }
449
- //name_html = "(" + item.id + ") " + name_html;
450
- html += name_html;
451
- //if (item.isLoading && item.isLoadingBackground) {
452
- // html += " " + tree._getLoadingIconHtml();
453
- //}
454
- }
455
- if (item.isExpanded && item.children != null) {
456
- var childrenListId;
457
- if (isRoot) {
458
- childrenListId = tree.id + '_children_list_root';
459
- } else {
460
- childrenListId = tree.id + '_children_list_' + item.id;
461
- }
462
- if (!isRoot) {
463
- html += '<ul id="' + childrenListId + '" class="' + this._getClass("branch") + '">';
464
- }
465
- for (var i = 0; i < item.children.length; i++) {
466
- var child = item.children[i];
467
- html += '<li id="' + tree.id + '_item_' + child.id + '" class="' + this._getClass("item") + '"></li>';
468
- }
469
- if (!isRoot) {
470
- html += '</ul>';
471
- }
472
- }
473
- elem.innerHTML = html;
474
- if (!isRoot) {
475
- if (!item.isLeaf) {
476
- if (item.isExpanded) {
477
- $(tree.id + '_branch_collapse_link_' + item.id).onclick = function () { tree._onClickCollapse(item); return false }
478
- } else {
479
- $(tree.id + '_branch_expand_link_' + item.id).onclick = function () { tree._onClickExpand(item); return false }
480
- }
481
- }
482
- if (item_link_exists) {
483
- $(tree.id + '_item_link_' + item.id).onclick = function() { tree._onClickItem(item); return false }
484
- }
485
- }
486
- if (item.isExpanded && item.children != null) {
487
- for (var i = 0; i < item.children.length; i++) {
488
- tree._displayItem(item.children[i], false);
489
- }
490
- }
491
- }
492
-
493
- LiveTree.prototype._checkScrollOnLoad = function () {
494
- var tree = this;
495
- if (tree._scrollToItemIdOnLoad == null) {
496
- return;
497
- }
498
- var item = tree._itemsIndex[tree._scrollToItemIdOnLoad];
499
- if (item == null) {
500
- return;
501
- }
502
- if (tree._scrollToItemMustBeExpanded) {
503
- if (item.isLoaded) {
504
- // The user may have collapsed the item while it was loading, so only scroll to it if it's still expanded.
505
- if (item.isExpanded) {
506
- tree.scrollToItem(item.id);
507
- }
508
- tree._scrollToItemIdOnLoad = null;
509
- }
510
- } else {
511
- tree.scrollToItem(item.id);
512
- tree._scrollToItemIdOnLoad = null;
513
- }
514
- }
515
-
516
- LiveTree.prototype._updateDisplay = function () {
517
- var tree = this;
518
- if (tree._searchCount > 0) {
519
- Element.show(tree.id + "_searching");
520
- } else {
521
- Element.hide(tree.id + "_searching");
522
- }
523
- var updateItem = tree._updateItemDisplay;
524
- if (updateItem != null) {
525
- tree._updateItemDisplay = null;
526
- var html = "";
527
- var isRoot = false;
528
- if (updateItem == tree._root || (tree.hideRootItem && updateItem == tree._root.children[0])) {
529
- if (tree.hideRootItem) {
530
- updateItem = tree._root.children[0];
531
- }
532
- isRoot = true;
533
- }
534
- tree._displayItem(updateItem, isRoot);
535
- }
536
- tree._checkScrollOnLoad();
537
- }
538
-
539
- LiveTree.prototype._onInitialItemReceived = function () {
540
- var tree = this;
541
- this.rootItemId = tree._root.children[0].id;
542
- if (tree.hideRootItem) {
543
- //tree._root = tree._root.children[0];
544
- tree._expandItem(tree._root.children[0]);
545
- } else if (tree.expandRootItem) {
546
- tree._expandItem(tree._root.children[0]);
547
- }
548
- tree._root.isExpanded = true;
549
- tree._markItemForUpdateDisplay(tree._root);
550
- tree._startPreloads();
551
- }
552
-
553
- LiveTree.prototype._getElementPosition = function (destinationLink) {
554
- // borrowed from http://www.sitepoint.com/print/scroll-smoothly-javascript
555
- var destx = destinationLink.offsetLeft;
556
- var desty = destinationLink.offsetTop;
557
- var thisNode = destinationLink;
558
- while (thisNode.offsetParent &&
559
- (thisNode.offsetParent != document.body)) {
560
- thisNode = thisNode.offsetParent;
561
- destx += thisNode.offsetLeft;
562
- desty += thisNode.offsetTop;
563
- }
564
- return { x: destx, y: desty }
565
- }
566
-
567
- LiveTree.prototype._scrollTo = function (top) {
568
- var tree = this;
569
- if (!tree.scroll) {
570
- return;
571
- }
572
- var containerElem = $(tree.id);
573
- containerElem.scrollTop = top;
574
- }
575
-
576
- LiveTree.prototype.scrollToItem = function (itemId) {
577
- var tree = this;
578
- if (!tree.scroll) {
579
- return;
580
- }
581
- var itemElem = tree._getItemElement(itemId);
582
- if (itemElem == null) {
583
- return;
584
- }
585
- var containerElem = $(tree.id);
586
- var itemPos = tree._getElementPosition(itemElem);
587
- var containerPos = tree._getElementPosition(containerElem);
588
- var itemTop = itemPos.y - containerPos.y;
589
- var containerHeight = containerElem.offsetHeight - 35; //HACK: adjust for space used by scrollbars and other decoration
590
- if (itemTop + itemElem.offsetHeight > containerElem.scrollTop + containerHeight ||
591
- itemTop < containerElem.scrollTop) {
592
- // item is currently not entirely visible
593
- if (itemElem.offsetHeight > containerHeight) {
594
- // item is too big to fit, so scroll to the top
595
- tree._scrollTo(itemTop);
596
- } else {
597
- if (itemTop < containerElem.scrollTop + containerHeight) {
598
- // item is partially onscreen (the top is showing), so put whole item at bottom
599
- tree._scrollTo(itemTop + itemElem.offsetHeight - containerHeight);
600
- } else {
601
- // item is entirely offscreen, so center it
602
- tree._scrollTo(itemTop - containerHeight/2 + itemElem.offsetHeight/2);
603
- }
604
- }
605
- }
606
- tree._scrollToItemOnLoad = null;
607
- }
608
-
609
- LiveTree.prototype._expandItem = function (item) {
610
- var tree = this;
611
-
612
- // Make sure all item's parents are expanded as well
613
- var didExpand = false;
614
- var parent = item.parent;
615
- while (parent != tree._root && parent != null) {
616
- if (!parent.isExpanded) {
617
- parent.isExpanded = true;
618
- tree._markItemForUpdateDisplay(parent);
619
- didExpand = true;
620
- }
621
- parent = parent.parent;
622
- }
623
-
624
- // Expand the selected item
625
- var needToLoad = false;
626
- if (!item.isExpanded) {
627
- needToLoad = (item.children == null && !item.isLoading);
628
- if (needToLoad) {
629
- item.isLoading = true;
630
- }
631
- item.isLoadingBackground = false;
632
- item.isExpanded = true;
633
- tree._markItemForUpdateDisplay(item);
634
- didExpand = true;
635
- }
636
-
637
- // If the item has not loaded, load it now
638
- if (needToLoad) {
639
- tree._requestItem(item.id, 2, tree._onExpandItemReceived.bind(tree));
640
- }
641
-
642
- tree._startPreloads();
643
- return didExpand;
644
- }
645
-
646
- LiveTree.prototype._onExpandItemParentsReceived = function (item, requestOptions) {
647
- var tree = this;
648
- var requestedItem = tree._getItem(requestOptions.itemId);
649
- this._expandItem(requestedItem);
650
- tree._startPreloads();
651
- tree._updateDisplay();
652
- }
653
-
654
- LiveTree.prototype.expandItem = function (itemId) {
655
- var tree = this;
656
- var item = tree._getItem(itemId);
657
- var search = false;
658
- if (item == null) {
659
- tree._requestItem(itemId, 2, tree._onExpandItemParentsReceived.bind(tree), { includeParents: true });
660
- search = true;
661
- } else {
662
- this._expandItem(this._itemsIndex[itemId]);
663
- }
664
- tree._updateDisplay();
665
- if (search) {
666
- tree._scrollTo(0);
667
- tree._scrollToItemIdOnLoad = itemId;
668
- tree._scrollToItemMustBeExpanded = false;
669
- } else {
670
- tree.scrollToItem(itemId);
671
- }
672
- }
673
-
674
- LiveTree.prototype._onExpandParentsOfItemReceived = function (item, requestOptions) {
675
- var tree = this;
676
- var requestedItem = tree._getItem(requestOptions.itemId);
677
- tree._expandItem(requestedItem.parent);
678
- tree._startPreloads();
679
- tree._updateDisplay();
680
- }
681
-
682
- LiveTree.prototype.expandParentsOfItem = function (itemId) {
683
- var tree = this;
684
- var item = tree._getItem(itemId);
685
- var search = false;
686
- if (item == null) {
687
- tree._requestItem(itemId, 1, tree._onExpandParentsOfItemReceived.bind(tree), { includeParents: true });
688
- search = true;
689
- } else {
690
- tree._expandItem(item.parent);
691
- }
692
- tree._updateDisplay();
693
- if (search) {
694
- tree._scrollTo(0);
695
- tree._scrollToItemIdOnLoad = itemId;
696
- tree._scrollToItemMustBeExpanded = false;
697
- } else {
698
- tree.scrollToItem(itemId);
699
- }
700
- }
701
-
702
- LiveTree.prototype.activateItem = function (itemId) {
703
- var tree = this;
704
- // un-highlight the old active item
705
- var oldElem = $(tree.id + '_item_name_' + tree._activeItemId);
706
- if (oldElem != null) {
707
- oldElem.className = tree._getClass("item_name");
708
- }
709
- // highlight the new active item
710
- var elem = $(tree.id + '_item_name_' + itemId);
711
- if (elem != null) {
712
- elem.className = tree._getClass("item_name") + " " + tree._getClass("active_item_name");
713
- }
714
- tree._activeItemId = itemId;
715
- tree.scrollToItem(itemId);
716
- }
717
-
718
- LiveTree.prototype.getHtml = function() {
719
- var tree = this;
720
- var html = '';
721
- html += '<div id="' + tree.id + '" class="' + tree._getClass("") + '"';
722
- if (tree.cssStyle != null) {
723
- html += ' style="' + tree.cssStyle + '"';
724
- }
725
- html += '>';
726
- html += '<div id="' + tree.id + '_searching" style="display:none">' + tree._getSearchingHtml() + '</div>';
727
- html += '<ul id="' + tree.id + '_root" class="' + tree._getClass("root") + '">' + tree._getLoadingTreeHtml() + '</ul>'
728
- html += '</div>';
729
- return html;
730
- }
731
-
732
- LiveTree.prototype.start = function() {
733
- var tree = this;
734
- if (tree.initialData != null) {
735
- var handled = tree._handleReceivedItem(tree.initialData, {});
736
- if (handled) {
737
- tree._onInitialItemReceived(tree.initialData);
738
- }
739
- tree._updateDisplay();
740
- } else {
741
- tree._requestItem(tree.rootItemId, tree.expandRootItem || tree.hideRootItem ? 2 : 1, tree._onInitialItemReceived.bind(tree));
742
- }
743
- }
744
-
745
- LiveTree.prototype.render = function () {
746
- var tree = this;
747
- document.write(tree.getHtml());
748
- tree.start();
749
- }