-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #434 from px-org/dev
v3.1.5
- Loading branch information
Showing
4 changed files
with
158 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -473,7 +473,7 @@ func GetCdnFilesMap(cdn, version string) map[string]string { | |
"natural@compare@js": "//fastly.jsdelivr.net/npm/[email protected]/index.js", | ||
"bootstrap@css": "//cdn.staticfile.org/bootstrap/4.6.1/css/bootstrap.min.css", | ||
"bootstrap@js": "//cdn.staticfile.org/bootstrap/4.6.1/js/bootstrap.min.js", | ||
"Material+Icons@css": "//fonts.sourcegcdn.com/icon?family=Material+Icons", | ||
"Material+Icons@css": "//fonts.loli.net/icon?family=Material+Icons", | ||
}, | ||
"2": KV{ | ||
"mdui@css": jp + "/static/lib/[email protected]/css/mdui.min.css", | ||
|
@@ -513,7 +513,7 @@ func GetCdnFilesMap(cdn, version string) map[string]string { | |
"natural@compare@js": jp + "/static/lib/[email protected]/index.min.js", | ||
"bootstrap@css": jp + "/static/lib/[email protected]/css/bootstrap.min.css", | ||
"bootstrap@js": jp + "/static/lib/[email protected]/js/bootstrap.min.js", | ||
"Material+Icons@css": "//fonts.sourcegcdn.com/icon?family=Material+Icons", | ||
"Material+Icons@css": "//fonts.loli.net/icon?family=Material+Icons", | ||
}, | ||
} | ||
cdnKV := cdnMap["0"].(KV) | ||
|
@@ -915,3 +915,18 @@ func ExeFilePath(def string) string { | |
exPath := filepath.Dir(ex) | ||
return exPath | ||
} | ||
|
||
func Group(nodes []module.FileNode, subGroupLength int64) [][]module.FileNode { | ||
max := int64(len(nodes)) | ||
var segmens = make([][]module.FileNode, 0) | ||
quantity := max / subGroupLength | ||
remainder := max % subGroupLength | ||
i := int64(0) | ||
for i = int64(0); i < quantity; i++ { | ||
segmens = append(segmens, nodes[i*subGroupLength:(i+1)*subGroupLength]) | ||
} | ||
if quantity == 0 || remainder != 0 { | ||
segmens = append(segmens, nodes[i*subGroupLength:i*subGroupLength+remainder]) | ||
} | ||
return segmens | ||
} |