]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Pulls river js out into external file
authorEvan Winslow <evan@elgg.org>
Mon, 5 Mar 2012 04:43:05 +0000 (20:43 -0800)
committerEvan Winslow <evan@elgg.org>
Mon, 5 Mar 2012 04:43:05 +0000 (20:43 -0800)
engine/lib/elgglib.php
js/lib/ui.river.js [new file with mode: 0644]
views/default/core/river/filter.php

index 11bdc7285bdd70890eacb175f41cd65fc038a18b..720e69906a9a1513fbe305493a0280fe53e75864 100644 (file)
@@ -2111,6 +2111,7 @@ function elgg_init() {
        elgg_register_js('jquery.easing', 'vendors/jquery/jquery.easing.1.3.packed.js');
        elgg_register_js('elgg.avatar_cropper', 'js/lib/ui.avatar_cropper.js');
        elgg_register_js('jquery.imgareaselect', 'vendors/jquery/jquery.imgareaselect-0.9.8/scripts/jquery.imgareaselect.min.js');
+       elgg_register_js('elgg.ui.river', 'js/lib/ui.river.js');
 
        elgg_register_css('jquery.imgareaselect', 'vendors/jquery/jquery.imgareaselect-0.9.8/css/imgareaselect-deprecated.css');
        
diff --git a/js/lib/ui.river.js b/js/lib/ui.river.js
new file mode 100644 (file)
index 0000000..a56a664
--- /dev/null
@@ -0,0 +1,14 @@
+elgg.provide('elgg.ui.river');\r
+\r
+elgg.ui.river.init = function() {\r
+       $('#elgg-river-selector').change(function() {\r
+               var url = window.location.href;\r
+               if (window.location.search.length) {\r
+                       url = url.substring(0, url.indexOf('?'));\r
+               }\r
+               url += '?' + $(this).val();\r
+               elgg.forward(url);\r
+       });\r
+};\r
+\r
+elgg.register_hook_handler('init', 'system', elgg.ui.river.init);
\ No newline at end of file
index 87380b561031827099746df0c3b60c009aaa0d02..9b7fadaa82fd4c4f9c64cca9049c7de41d1ac8ca 100644 (file)
@@ -34,17 +34,5 @@ if ($selector) {
        $params['value'] = $selector;
 }
 echo elgg_view('input/dropdown', $params);
-?>
-<?php //@todo JS 1.8: no ?>
-<script type="text/javascript">
-elgg.register_hook_handler('init', 'system', function() {
-       $('#elgg-river-selector').change(function() {
-               var url = window.location.href;
-               if (window.location.search.length) {
-                       url = url.substring(0, url.indexOf('?'));
-               }
-               url += '?' + $(this).val();
-               elgg.forward(url);
-       });
-});
-</script>
+
+elgg_load_js('elgg.ui.river');