Procházet zdrojové kódy

Set the request query as input value in the frontend.

Sander Mathijs van Veen před 13 roky
rodič
revize
aca8a13783
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      src/frontend/js/editor.js

+ 4 - 0
src/frontend/js/editor.js

@@ -5,6 +5,10 @@
     var trigger_update = true;
     var input_textarea = $('#MathInput');
 
+    // Set the requested query as input value if a query string is given.
+    if (location.search.substr(0, 3) == '?q=')
+        input_textarea.val(decodeURIComponent(location.search.substr(3)));
+
     input_textarea.change(function(){ trigger_update = true; })
         .keyup(function(){ trigger_update = true; });