Manage warning class on close button
Prevent save when text is not valid JSON.