Subversion Repositories php-qbpwcf

Rev

Rev 81 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 81 Rev 226
Line 1... Line 1...
1
<?php
1
<?php
2
 
2
 
3
/*
3
/*
4
 
4
 
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
    Copyright (C) 2015~2025 Min-Jhin,Chen
6
    Copyright (C) 2014~2025 MIN ZHI, CHEN
7
 
7
 
8
    This file is part of QBPWCF.
8
    This file is part of QBPWCF.
9
 
9
 
10
    QBPWCF is free software: you can redistribute it and/or modify
10
    QBPWCF is free software: you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
11
    it under the terms of the GNU General Public License as published by
Line 26... Line 26...
26
namespace qbpwcf;
26
namespace qbpwcf;
27
 
27
 
28
#assets dir
28
#assets dir
29
$assetsDir="assets_of_javaScript::qbpwcfJavaScript_20240912";
29
$assetsDir="assets_of_javaScript::qbpwcfJavaScript_20240912";
30
 
30
 
31
#產生 qbpwcfJavaScript 
31
#產生 qbpwcfJavaScript
32
#函式說明:
32
#函式說明:
33
#建立qbpwcf專屬的js函式庫
33
#建立qbpwcf專屬的js函式庫
34
#回傳結果
34
#回傳結果
35
#$result["funciton"],當前函式的名稱.
35
#$result["funciton"],當前函式的名稱.
36
#$result["status"],執行的狀態,"true"代表正常,"false"代表不正常.
36
#$result["status"],執行的狀態,"true"代表正常,"false"代表不正常.
Line 52... Line 52...
52
if($qbpwcfJavaScript["status"]==="false")
52
if($qbpwcfJavaScript["status"]==="false")
53
{
53
{
54
 
54
 
55
	#show detail info
55
	#show detail info
56
	var_dump($qbpwcfJavaScript);
56
	var_dump($qbpwcfJavaScript);
57
	
57
 
58
	#結束執行,並回傳shell 1.
58
	#結束執行,並回傳shell 1.
59
	exit(1);
59
	exit(1);
60
 
60
 
61
}#if end
61
}#if end
62
 
62
 
Line 75... Line 75...
75
#$conf["script"],字串,要執行的javaScript語法.
75
#$conf["script"],字串,要執行的javaScript語法.
76
$conf["script"]="
76
$conf["script"]="
77
 
77
 
78
	//設定空白頁面
78
	//設定空白頁面
79
	window.qbpwcf.openWindow.params.url='".$assetsDir."/blank.php';
79
	window.qbpwcf.openWindow.params.url='".$assetsDir."/blank.php';
80
						
80
 
81
	//設定開啟視窗後要作的事情
81
	//設定開啟視窗後要作的事情
82
	window.qbpwcf.openWindow.actionAfterOpen=function(Window){
82
	window.qbpwcf.openWindow.actionAfterOpen=function(Window){
83
	
83
 
84
		//debug
84
		//debug
85
		console.log(Window);
85
		console.log(Window);
86
		
86
 
87
		//取得新視窗的document參考
87
		//取得新視窗的document參考
88
		var documentInWindow=Window.document;
88
		var documentInWindow=Window.document;
89
		
89
 
90
		//設置其body的內容
90
		//設置其body的內容
91
		documentInWindow.body.innerHTML='<h1>test</h1>';
91
		documentInWindow.body.innerHTML='<h1>test</h1>';
92
	
92
 
93
		}//function end
93
		}//function end
94
		
94
 
95
	//開啟window
95
	//開啟window
96
	await window.qbpwcf.openWindow.func();
96
	await window.qbpwcf.openWindow.func();
97
 
97
 
98
	";
98
	";
99
#可省略參數:
99
#可省略參數:
Line 115... Line 115...
115
#如果執行失敗
115
#如果執行失敗
116
if($toScript["status"]==="false"){
116
if($toScript["status"]==="false"){
117
 
117
 
118
	#show detail info
118
	#show detail info
119
	var_dump($toScript);
119
	var_dump($toScript);
120
	
120
 
121
	#結束執行,並回傳shell 1.
121
	#結束執行,並回傳shell 1.
122
	exit(1);
122
	exit(1);
123
 
123
 
124
	}#if end
124
	}#if end
125
 
125
 
126
#印出js語法
126
#印出js語法
127
echo $toScript["content"];
-
 
128
127
echo $toScript["content"];
-
 
128