text: (function() {
  
  var checkVersion = Dagaz.Model.checkVersion;
  
  Dagaz.Model.checkVersion = function(design, name, value) {
    if (name != "editor-extension") {
       checkVersion(design, name, value);
    }
  }
  
  var go = Dagaz.Controller.go;
  
  Dagaz.Controller.go = function(url) {
    var design = Dagaz.Model.design;
    var board = Dagaz.Controller.app.board;
    url = url + "?setup="; 
    var prev = null; var cnt = 0;
    _.each(design.allPositions(), function(pos) {
        var piece = board.getPiece(pos);
        var s = "";
        if (piece !== null) {
            var type = (piece.type * 2) + (piece.player - 1);
            s = s + type + ":1";
        }
        if ((prev === null) || (prev != s)) {
            if (prev !== null) {
                url = url + prev;
                if (cnt > 0) {
                    url = url + "+" + cnt;
                }
                url = url + ";";
            }
            prev = s;
            cnt = 0;
        } else {
            cnt++;
        }
    });
    url = url + prev;
    if (cnt > 0) {
        url = url + "+" + cnt;
    }
    url = url + ";";
    go(url);
  }
  
  })();
  