Commit 9514b7f50d5ee11c299b410f1d3ef9ed4c74e49c

Authored by Fabio Teixeira
1 parent 38259d56

Adding script to move video block inside profile_design

Showing 1 changed file with 32 additions and 0 deletions   Show diff stats
footer.rhtml
1 1 <div id="footer-content">
2 2 </div>
3 3 <script type="text/javascript" src="http://barra.brasil.gov.br/barra.js?cor=verde"></script>
  4 +<script type="text/javascript">
  5 + // Script that include the video-block on Droppables
  6 + function addVideoToDroppables() {
  7 + var script_search = jQuery(".blocks script"); // get all script tags
  8 + var sub_search, position, before, after, new_code;
  9 +
  10 + for(var i = 0; i < script_search.length; i++) {
  11 + sub_search = jQuery(script_search[i]); // take one tag script into jquery object
  12 +
  13 + // verify if this tag has Droppables.add
  14 + if( (sub_search.html().search("Droppables.add") > -1) &&
  15 + (sub_search.html().search("video-block") == -1) ) {
  16 + position = sub_search.html().search("']"); // get its position
  17 +
  18 + before = sub_search.html().slice(0, position);
  19 + after = sub_search.html().slice(position, sub_search.html().length);
  20 +
  21 + before += "','video-block"; // include the block class name
  22 + new_code = before + after;
  23 +
  24 + eval(new_code); // re-execute the function
  25 + }
  26 + }
  27 + }
  28 +
  29 +
  30 + jQuery(document).ready(function(){
  31 + if( jQuery("body.controller-profile_design").length == 1 ) {
  32 + addVideoToDroppables();
  33 + }
  34 + });
  35 +</script>
4 36 \ No newline at end of file
... ...