|
|
@ -1163,6 +1163,9 @@ class ShixunsController < ApplicationController
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def get_script_contents
|
|
|
|
def get_script_contents
|
|
|
|
|
|
|
|
if params[:script_id].to_i == -1
|
|
|
|
|
|
|
|
render :json => {contents: "", description: ""}
|
|
|
|
|
|
|
|
else
|
|
|
|
mirrir_script = MirrorScript.find(params[:script_id])
|
|
|
|
mirrir_script = MirrorScript.find(params[:script_id])
|
|
|
|
script = mirrir_script.try(:script)
|
|
|
|
script = mirrir_script.try(:script)
|
|
|
|
description = mirrir_script.try(:description)
|
|
|
|
description = mirrir_script.try(:description)
|
|
|
@ -1170,6 +1173,8 @@ class ShixunsController < ApplicationController
|
|
|
|
render :json => {contents: script, description: description}
|
|
|
|
render :json => {contents: script, description: description}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def get_common_script
|
|
|
|
def get_common_script
|
|
|
|
shixun_script = PlatformSample.where(:samples_type => "script").first.try(:contents)
|
|
|
|
shixun_script = PlatformSample.where(:samples_type => "script").first.try(:contents)
|
|
|
|
compile = params[:compile]
|
|
|
|
compile = params[:compile]
|
|
|
|