add listeners for new source button and remove DRY
add listeners for new source button and remove DRY

mattgodbolt/gcc-explorer,mattgodbolt/gcc-explorer,mattgodbolt/compiler-explorer,dkm/gcc-explorer,dkm/gcc-explorer,dkm/gcc-explorer,mattgodbolt/gcc-explorer,dkm/gcc-explorer,mattgodbolt/compiler-explorer,dkm/gcc-explorer,mattgodbolt/compiler-explorer,dkm/gcc-explorer,mattgodbolt/gcc-explorer,mattgodbolt/compiler-explorer,dkm/gcc-explorer,mattgodbolt/compiler-explorer,dkm/gcc-explorer,mattgodbolt/compiler-explorer,dkm/gcc-explorer,mattgodbolt/compiler-explorer,mattgodbolt/gcc-explorer,mattgodbolt/compiler-explorer