         @view = new ColabView(codekey[1],@getFilename())
         @view.show()
 
+        #stop collab button
         $('#stopCollab').on 'click', =>
           @stop()
+
         #@initStatistics
+
+        #read only button
+        $('#readonlycheckbox').on 'click', =>
+          console.log($('#readonlycheckbox')[0].checked)
+          @readonlyref.set($('#readonlycheckbox')[0].checked);
 
         #Lets add the comment stating where the collaboration is being done online
         #comment = @getColabComment(@getLanguage(),codekey[1])
         #editor.setText comment+editor.getText()
+        @readonlyref.on 'value',(snapshot) =>
+          $('#readonlycheckbox')[0].checked = snapshot.val()
+
         @chatref.on 'child_added', (snapshot) =>
           chattext = snapshot.val().text
           chatuser = snapshot.val().user

    @coderef = @ref.child('code');
    @userref = @ref.child('users');
    @chatref = @ref.child('chat');

    @coderef.once 'value', (snapshot) =>
        options = {sv_: Firebase.ServerValue.TIMESTAMP}

        style: 'padding:10px;border-bottom:1px solid #ef4423'
        =>
          @div '[x] Stop session',id: 'stopCollab', class: ' pull-right',style:'cursor:pointer;color:#ef4423'
          @div id: 'readonly', class: ' pull-right',style:'cursor:pointer;margin-right:4px;font-size:10px', =>
            @label 'Read only ', =>
              @input type: 'checkbox',id:'readonlycheckbox',style:'margin-right:3px;'
          @div id: 'users', class: ' pull-right'
          @div id: 'chat', class: ' pull-right', style:'max-width:300px;overflow:hidden;height:17px;width:100%'
          @div class: 'pull-left', =>
