From hidden shear-elasticity to opto-and thermo-elasticity in confined polymer melts and viscous liquids