updated example project index and migrated js code to plugin js file from index