Added logic to load js files found in the current selected document