From 213d10619f9aca086104f99c49411c9a18ffe2b1 Mon Sep 17 00:00:00 2001 From: Piotr Mitros Date: Wed, 4 Jan 2012 19:03:29 -0500 Subject: [PATCH] Wiki now supports circuits, modulo bugs --- js/video_player.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/js/video_player.js b/js/video_player.js index 5394ae4552..568132a58a 100644 --- a/js/video_player.js +++ b/js/video_player.js @@ -26,7 +26,20 @@ function postJSON(url, data, callback) { }); } -var global=5; +// For easy embedding of CSRF in forms +$(function() { + $('#csrfmiddlewaretoken').attr("value", getCookie('csrftoken')) +}); + +// For working with circuits in wiki: + +function submit_circuit(circuit_id) { + $("input.schematic").each(function(index,element){ element.schematic.update_value(); }); + postJSON('/save_circuit/'+circuit_id, + {'schematic': $('#schematic_'+circuit_id).attr("value")}, + function(data){ if (data.results=='success') alert("Saved");}); + return false; +} // Video player