diff --git a/README.md b/README.md index 78051c14..d29f5950 100644 --- a/README.md +++ b/README.md @@ -88,16 +88,18 @@ Several important features for saving memory in the templates system may have to An example of running the commands directly on Windows. -Linux is similar, however you might need to use cd and mv a bit more like in the shell files due to the differences in go build across platforms. +Linux is similar, however you might need to use cd and mv a bit more like in the shell files due to the differences in go build across platforms. Additionally, Linux doesn't require `StackExchange/wmi` or ``/x/sys/windows` ```bash +git clone https://github.com/Azareal/Gosora + go get -u github.com/go-sql-driver/mysql go get -u golang.org/x/crypto/bcrypt go get -u github.com/StackExchange/wmi -go get -u github.com/shirou/gopsutil +go get -u github.com/Azareal/gopsutil go get -u github.com/gorilla/websocket @@ -162,11 +164,11 @@ We're looking for ways to clean-up the plugin system so that all of them (except * golang.org/x/crypto/bcrypt For hashing passwords. -* github.com/shirou/gopsutil For pulling information on CPU and memory usage. +* github.com/Azareal/gopsutil For pulling information on CPU and memory usage. I've temporarily forked this, as we were having stability issues with the latest build. * github.com/StackExchange/wmi Dependency for gopsutil on Windows. - - * golang.org/x/sys/windows Also a dependency for gopsutil on Windows. + + * golang.org/x/sys/windows Also a dependency for gopsutil on Windows. This isn't needed at the moment, as I've rolled things back to an older more stable build. * github.com/gorilla/websocket Needed for Gosora's Optional WebSockets Module. diff --git a/install-gosora-linux b/install-gosora-linux index ead6a1d4..86449706 100644 --- a/install-gosora-linux +++ b/install-gosora-linux @@ -5,7 +5,7 @@ go get -u github.com/lib/pq echo "Installing bcrypt" go get -u golang.org/x/crypto/bcrypt echo "Installing gopsutil" -go get -u github.com/shirou/gopsutil +go get -u github.com/Azareal/gopsutil echo "Installing Gorilla WebSockets" go get -u github.com/gorilla/websocket @@ -17,4 +17,4 @@ mv ./Install .. cd .. echo "Running the installer" -./Install \ No newline at end of file +./Install diff --git a/install.bat b/install.bat index 9cc62203..1a66b5f3 100644 --- a/install.bat +++ b/install.bat @@ -29,7 +29,7 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) echo Installing the gopsutil library -go get -u github.com/shirou/gopsutil +go get -u github.com/Azareal/gopsutil if %errorlevel% neq 0 ( pause exit /b %errorlevel% diff --git a/mysql.sql b/mysql.sql index 6dd1da08..047ff7aa 100644 --- a/mysql.sql +++ b/mysql.sql @@ -71,7 +71,9 @@ CREATE TABLE `replies`( `createdAt` datetime not null, `createdBy` int not null, `lastEdit` int not null, - `lastEditBy` int not null, + `lastEditBy` int not null, /* Do we need this? */ + /*`editIndex` int not null,*/ /* For append edits, e.g. auto-merges? Is this enough for this feature? */ + `lastUpdated` datetime not null, `ipaddress` varchar(200) DEFAULT '0.0.0.0.0' not null, `likeCount` int DEFAULT 0 not null, `words` int DEFAULT 1 not null, diff --git a/pgsql.go b/pgsql.go index e51118ca..05300d9a 100644 --- a/pgsql.go +++ b/pgsql.go @@ -29,6 +29,12 @@ func _init_database() (err error) { return err } + // Make sure that the connection is alive + err = db.Ping() + if err != nil { + return err + } + // Fetch the database version db.QueryRow("SELECT VERSION()").Scan(&db_version) diff --git a/plugin_socialgroups.go b/plugin_socialgroups.go index 9b228190..dee9f633 100644 --- a/plugin_socialgroups.go +++ b/plugin_socialgroups.go @@ -190,7 +190,7 @@ func install_socialgroups() error { qgen.DB_Table_Column{"joinable","smallint",0,false,false,"0"}, qgen.DB_Table_Column{"owner","int",0,false,false,""}, qgen.DB_Table_Column{"memberCount","int",0,false,false,""}, - qgen.DB_Table_Column{"mainForum","int",0,false,false,"0"}, // The board the user lands on when they click ona group, we'll make it possible for group admins to change what users land on + qgen.DB_Table_Column{"mainForum","int",0,false,false,"0"}, // The board the user lands on when they click on a group, we'll make it possible for group admins to change what users land on //qgen.DB_Table_Column{"boards","varchar",255,false,false,""}, // Cap the max number of boards at 8 to avoid overflowing the confines of a 64-bit integer? qgen.DB_Table_Column{"backdrop","varchar",200,false,false,""}, // File extension for the uploaded file, or an external link qgen.DB_Table_Column{"createdAt","createdAt",0,false,false,""}, diff --git a/public/rgb_105_105_105.jpg b/public/rgb_105_105_105.jpg new file mode 100644 index 00000000..8b12065f Binary files /dev/null and b/public/rgb_105_105_105.jpg differ diff --git a/public/rgb_71_71_71.jpg b/public/rgb_71_71_71.jpg new file mode 100644 index 00000000..3862da09 Binary files /dev/null and b/public/rgb_71_71_71.jpg differ diff --git a/public/rgb_95_95_95.jpg b/public/rgb_95_95_95.jpg new file mode 100644 index 00000000..4053030a Binary files /dev/null and b/public/rgb_95_95_95.jpg differ diff --git a/template_list.go b/template_list.go index 99cf4efe..4158b257 100644 --- a/template_list.go +++ b/template_list.go @@ -37,6 +37,12 @@ var menu_1 []byte = []byte(` + `) var menu_2 []byte = []byte(` @@ -54,12 +60,6 @@ var menu_8 []byte = []byte(` `) var menu_9 []byte = []byte(` - @@ -73,155 +73,158 @@ var header_11 []byte = []byte(`> `) var header_12 []byte = []byte(`
`) var header_13 []byte = []byte(`
`) -var topic_0 []byte = []byte(`
<
`) -var topic_3 []byte = []byte(` +var topic_0 []byte = []byte(` + +
+`) +var topic_2 []byte = []byte(`
<
`) +var topic_5 []byte = []byte(`
> +var topic_8 []byte = []byte(`?page=`) +var topic_9 []byte = []byte(`">>
`) -var topic_8 []byte = []byte(` +var topic_10 []byte = []byte(`
- -
- `) -var topic_13 []byte = []byte(` - `) -var topic_14 []byte = []byte(`🔒︎`) -var topic_15 []byte = []byte(` - - `) -var topic_17 []byte = []byte(``) -var topic_18 []byte = []byte(` - - `) +
+ `) +var topic_14 []byte = []byte(` + `) +var topic_15 []byte = []byte(`🔒︎`) +var topic_16 []byte = []byte(` + + `) +var topic_18 []byte = []byte(``) var topic_19 []byte = []byte(` -
- + + `) +var topic_20 []byte = []byte(` +
+
+var topic_21 []byte = []byte(`" style="`) +var topic_22 []byte = []byte(`background-image:url(`) +var topic_23 []byte = []byte(`), url(/static/post-avatar-bg.jpg);background-position: 0px `) +var topic_24 []byte = []byte(`-1`) +var topic_25 []byte = []byte(`0px;background-repeat:no-repeat, repeat-y;`) +var topic_26 []byte = []byte(`">

`) -var topic_26 []byte = []byte(`

+var topic_27 []byte = []byte(`

+var topic_28 []byte = []byte(` `) -var topic_30 []byte = []byte(`   +var topic_29 []byte = []byte(`.`) +var topic_30 []byte = []byte(`" class="username real_username">`) +var topic_31 []byte = []byte(`   `) -var topic_31 []byte = []byte(` +var topic_32 []byte = []byte(` `) -var topic_35 []byte = []byte(``) -var topic_37 []byte = []byte(``) -var topic_39 []byte = []byte(``) -var topic_41 []byte = []byte(``) -var topic_43 []byte = []byte(` +var topic_34 []byte = []byte(`background-color:/*#eaffea*/#D6FFD6;`) +var topic_35 []byte = []byte(`">`) +var topic_36 []byte = []byte(``) +var topic_38 []byte = []byte(``) +var topic_40 []byte = []byte(``) +var topic_42 []byte = []byte(``) +var topic_44 []byte = []byte(` +var topic_45 []byte = []byte(`?session=`) +var topic_46 []byte = []byte(`&type=topic" class="mod_button report_item" style="font-weight:normal;" title="Flag Topic"> `) -var topic_46 []byte = []byte(``) -var topic_48 []byte = []byte(``) -var topic_49 []byte = []byte(``) -var topic_50 []byte = []byte(``) -var topic_51 []byte = []byte(``) -var topic_52 []byte = []byte(` +var topic_47 []byte = []byte(``) +var topic_49 []byte = []byte(``) +var topic_50 []byte = []byte(``) +var topic_51 []byte = []byte(``) +var topic_52 []byte = []byte(``) +var topic_53 []byte = []byte(`
`) -var topic_53 []byte = []byte(` +var topic_54 []byte = []byte(`
`) -var topic_54 []byte = []byte(` - `) var topic_55 []byte = []byte(` + `) +var topic_56 []byte = []byte(`
`) -var topic_56 []byte = []byte(` +var topic_57 []byte = []byte(`
+var topic_58 []byte = []byte(`" style="`) +var topic_59 []byte = []byte(`background-image:url(`) +var topic_60 []byte = []byte(`), url(/static/post-avatar-bg.jpg);background-position: 0px `) +var topic_61 []byte = []byte(`-1`) +var topic_62 []byte = []byte(`0px;background-repeat:no-repeat, repeat-y;`) +var topic_63 []byte = []byte(`">

`) -var topic_63 []byte = []byte(`

+var topic_64 []byte = []byte(`

`) -var topic_66 []byte = []byte(`   +var topic_65 []byte = []byte(`.`) +var topic_66 []byte = []byte(`" class="username real_username">`) +var topic_67 []byte = []byte(`   `) -var topic_67 []byte = []byte(``) -var topic_71 []byte = []byte(``) -var topic_73 []byte = []byte(``) -var topic_75 []byte = []byte(` +var topic_68 []byte = []byte(``) +var topic_72 []byte = []byte(``) +var topic_74 []byte = []byte(``) +var topic_76 []byte = []byte(` +var topic_77 []byte = []byte(`?session=`) +var topic_78 []byte = []byte(`&type=reply" class="mod_button report_item" title="Flag Reply"> `) -var topic_78 []byte = []byte(``) -var topic_80 []byte = []byte(``) -var topic_81 []byte = []byte(``) -var topic_82 []byte = []byte(``) -var topic_83 []byte = []byte(``) -var topic_84 []byte = []byte(` +var topic_79 []byte = []byte(``) +var topic_81 []byte = []byte(``) +var topic_82 []byte = []byte(``) +var topic_83 []byte = []byte(``) +var topic_84 []byte = []byte(``) +var topic_85 []byte = []byte(`
`) -var topic_85 []byte = []byte(`
+var topic_86 []byte = []byte(` `) -var topic_86 []byte = []byte(` +var topic_87 []byte = []byte(`
+var topic_88 []byte = []byte(`' type="hidden" />
@@ -410,24 +413,28 @@ var topic_alt_89 []byte = []byte(`' type="hidden" /> `) var profile_0 []byte = []byte(` -
-
- -
-
- `) +
+ +
+
+ +
+
+ `) var profile_2 []byte = []byte(``) var profile_3 []byte = []byte(``) var profile_4 []byte = []byte(``) var profile_5 []byte = []byte(` -
- - `) -var profile_6 []byte = []byte(`
+
+ `) +var profile_6 []byte = []byte(`
+ `) var profile_7 []byte = []byte(`Unban @@ -436,67 +443,70 @@ var profile_10 []byte = []byte(`Ban`) var profile_13 []byte = []byte(` -
`) +
`) var profile_14 []byte = []byte(` -
- -
`) +
+
+ +
+
`) var profile_17 []byte = []byte(` -
- `) + `) var profile_24 []byte = []byte(`

- `) var profile_27 []byte = []byte(`   - `) + `) var profile_28 []byte = []byte(` - `) var profile_31 []byte = []byte(` - - `) -var profile_34 []byte = []byte(``) + `) +var profile_34 []byte = []byte(``) var profile_35 []byte = []byte(``) var profile_36 []byte = []byte(` -
-`) +
+ `) var profile_37 []byte = []byte(`
-
`) var profile_38 []byte = []byte(` - - -
-
-
-
-
-
- +
+
+
+
+
+
+
+
+ `) var profile_40 []byte = []byte(`
@@ -607,9 +617,9 @@ var forum_11 []byte = []byte(` `) var forum_12 []byte = []byte(` +var forum_13 []byte = []byte(`">
`) -var forum_14 []byte = []byte(`
🔒︎
`) +var forum_14 []byte = []byte(`
`) var forum_15 []byte = []byte(`
`) diff --git a/template_topic.go b/template_topic.go index 65edc6b7..6b749b2c 100644 --- a/template_topic.go +++ b/template_topic.go @@ -66,199 +66,200 @@ w.Write([]byte(item)) w.Write(header_13) } } -if tmpl_topic_vars.Page > 1 { w.Write(topic_0) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_1) -w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Page - 1))) +if tmpl_topic_vars.Page > 1 { w.Write(topic_2) +w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) +w.Write(topic_3) +w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Page - 1))) +w.Write(topic_4) } if tmpl_topic_vars.LastPage != tmpl_topic_vars.Page { -w.Write(topic_3) -w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) -w.Write(topic_4) -w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Page + 1))) w.Write(topic_5) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_6) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Page + 1))) w.Write(topic_7) -} -w.Write(topic_8) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) +w.Write(topic_8) +w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Page + 1))) w.Write(topic_9) -if tmpl_topic_vars.Topic.Sticky { +} w.Write(topic_10) +if tmpl_topic_vars.Topic.Sticky { +w.Write(topic_11) } else { if tmpl_topic_vars.Topic.Is_Closed { -w.Write(topic_11) -} -} w.Write(topic_12) -w.Write([]byte(tmpl_topic_vars.Topic.Title)) +} +} w.Write(topic_13) -if tmpl_topic_vars.Topic.Is_Closed { +w.Write([]byte(tmpl_topic_vars.Topic.Title)) w.Write(topic_14) +if tmpl_topic_vars.Topic.Is_Closed { +w.Write(topic_15) } if tmpl_topic_vars.CurrentUser.Perms.EditTopic { -w.Write(topic_15) -w.Write([]byte(tmpl_topic_vars.Topic.Title)) w.Write(topic_16) -if tmpl_topic_vars.CurrentUser.Perms.CloseTopic { +w.Write([]byte(tmpl_topic_vars.Topic.Title)) w.Write(topic_17) -} +if tmpl_topic_vars.CurrentUser.Perms.CloseTopic { w.Write(topic_18) } w.Write(topic_19) -w.Write([]byte(tmpl_topic_vars.Topic.ClassName)) -w.Write(topic_20) -if tmpl_topic_vars.Topic.Avatar != "" { -w.Write(topic_21) -w.Write([]byte(tmpl_topic_vars.Topic.Avatar)) -w.Write(topic_22) -if tmpl_topic_vars.Topic.ContentLines <= 5 { -w.Write(topic_23) } +w.Write(topic_20) +w.Write([]byte(tmpl_topic_vars.Topic.ClassName)) +w.Write(topic_21) +if tmpl_topic_vars.Topic.Avatar != "" { +w.Write(topic_22) +w.Write([]byte(tmpl_topic_vars.Topic.Avatar)) +w.Write(topic_23) +if tmpl_topic_vars.Topic.ContentLines <= 5 { w.Write(topic_24) } w.Write(topic_25) -w.Write([]byte(tmpl_topic_vars.Topic.Content)) +} w.Write(topic_26) w.Write([]byte(tmpl_topic_vars.Topic.Content)) w.Write(topic_27) -w.Write([]byte(tmpl_topic_vars.Topic.UserSlug)) +w.Write([]byte(tmpl_topic_vars.Topic.Content)) w.Write(topic_28) -w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.CreatedBy))) +w.Write([]byte(tmpl_topic_vars.Topic.UserSlug)) w.Write(topic_29) -w.Write([]byte(tmpl_topic_vars.Topic.CreatedByName)) +w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.CreatedBy))) w.Write(topic_30) -if tmpl_topic_vars.CurrentUser.Perms.LikeItem { +w.Write([]byte(tmpl_topic_vars.Topic.CreatedByName)) w.Write(topic_31) -w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) +if tmpl_topic_vars.CurrentUser.Perms.LikeItem { w.Write(topic_32) -if tmpl_topic_vars.Topic.Liked { +w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_33) -} +if tmpl_topic_vars.Topic.Liked { w.Write(topic_34) } -if tmpl_topic_vars.CurrentUser.Perms.EditTopic { w.Write(topic_35) -w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) +} +if tmpl_topic_vars.CurrentUser.Perms.EditTopic { w.Write(topic_36) +w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) +w.Write(topic_37) } if tmpl_topic_vars.CurrentUser.Perms.DeleteTopic { -w.Write(topic_37) -w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_38) +w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) +w.Write(topic_39) } if tmpl_topic_vars.CurrentUser.Perms.PinTopic { if tmpl_topic_vars.Topic.Sticky { -w.Write(topic_39) -w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_40) -} else { +w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_41) -w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) +} else { w.Write(topic_42) -} -} -w.Write(topic_43) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) +w.Write(topic_43) +} +} w.Write(topic_44) -w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) +w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_45) -if tmpl_topic_vars.Topic.LikeCount > 0 { +w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_46) -w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.LikeCount))) +if tmpl_topic_vars.Topic.LikeCount > 0 { w.Write(topic_47) +w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.LikeCount))) +w.Write(topic_48) } if tmpl_topic_vars.Topic.Tag != "" { -w.Write(topic_48) -w.Write([]byte(tmpl_topic_vars.Topic.Tag)) w.Write(topic_49) -} else { +w.Write([]byte(tmpl_topic_vars.Topic.Tag)) w.Write(topic_50) -w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.Level))) +} else { w.Write(topic_51) -} +w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.Level))) w.Write(topic_52) +} +w.Write(topic_53) if len(tmpl_topic_vars.ItemList) != 0 { for _, item := range tmpl_topic_vars.ItemList { if item.ActionType != "" { -w.Write(topic_53) -w.Write([]byte(item.ActionIcon)) w.Write(topic_54) -w.Write([]byte(item.ActionType)) +w.Write([]byte(item.ActionIcon)) w.Write(topic_55) -} else { +w.Write([]byte(item.ActionType)) w.Write(topic_56) -w.Write([]byte(item.ClassName)) +} else { w.Write(topic_57) -if item.Avatar != "" { +w.Write([]byte(item.ClassName)) w.Write(topic_58) -w.Write([]byte(item.Avatar)) +if item.Avatar != "" { w.Write(topic_59) -if item.ContentLines <= 5 { +w.Write([]byte(item.Avatar)) w.Write(topic_60) -} +if item.ContentLines <= 5 { w.Write(topic_61) } w.Write(topic_62) -w.Write([]byte(item.ContentHtml)) -w.Write(topic_63) -w.Write([]byte(item.UserSlug)) -w.Write(topic_64) -w.Write([]byte(strconv.Itoa(item.CreatedBy))) -w.Write(topic_65) -w.Write([]byte(item.CreatedByName)) -w.Write(topic_66) -if tmpl_topic_vars.CurrentUser.Perms.LikeItem { -w.Write(topic_67) -w.Write([]byte(strconv.Itoa(item.ID))) -w.Write(topic_68) -if item.Liked { -w.Write(topic_69) } +w.Write(topic_63) +w.Write([]byte(item.ContentHtml)) +w.Write(topic_64) +w.Write([]byte(item.UserSlug)) +w.Write(topic_65) +w.Write([]byte(strconv.Itoa(item.CreatedBy))) +w.Write(topic_66) +w.Write([]byte(item.CreatedByName)) +w.Write(topic_67) +if tmpl_topic_vars.CurrentUser.Perms.LikeItem { +w.Write(topic_68) +w.Write([]byte(strconv.Itoa(item.ID))) +w.Write(topic_69) +if item.Liked { w.Write(topic_70) } -if tmpl_topic_vars.CurrentUser.Perms.EditReply { w.Write(topic_71) -w.Write([]byte(strconv.Itoa(item.ID))) +} +if tmpl_topic_vars.CurrentUser.Perms.EditReply { w.Write(topic_72) +w.Write([]byte(strconv.Itoa(item.ID))) +w.Write(topic_73) } if tmpl_topic_vars.CurrentUser.Perms.DeleteReply { -w.Write(topic_73) -w.Write([]byte(strconv.Itoa(item.ID))) w.Write(topic_74) -} -w.Write(topic_75) w.Write([]byte(strconv.Itoa(item.ID))) +w.Write(topic_75) +} w.Write(topic_76) -w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) +w.Write([]byte(strconv.Itoa(item.ID))) w.Write(topic_77) -if item.LikeCount > 0 { +w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_78) -w.Write([]byte(strconv.Itoa(item.LikeCount))) +if item.LikeCount > 0 { w.Write(topic_79) +w.Write([]byte(strconv.Itoa(item.LikeCount))) +w.Write(topic_80) } if item.Tag != "" { -w.Write(topic_80) -w.Write([]byte(item.Tag)) w.Write(topic_81) -} else { +w.Write([]byte(item.Tag)) w.Write(topic_82) -w.Write([]byte(strconv.Itoa(item.Level))) +} else { w.Write(topic_83) -} +w.Write([]byte(strconv.Itoa(item.Level))) w.Write(topic_84) } -} -} w.Write(topic_85) -if tmpl_topic_vars.CurrentUser.Perms.CreateReply { +} +} +} w.Write(topic_86) -w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) +if tmpl_topic_vars.CurrentUser.Perms.CreateReply { w.Write(topic_87) +w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) +w.Write(topic_88) } w.Write(footer_0) if tmpl_topic_vars.Header.Widgets.RightSidebar != "" { diff --git a/templates.go b/templates.go index 06f69543..c31e85db 100644 --- a/templates.go +++ b/templates.go @@ -985,6 +985,7 @@ func (c *CTemplateSet) compile_command(*parse.CommandNode) (out string) { return "" } +// TO-DO: Write unit tests for this func minify(data string) string { data = strings.Replace(data,"\t","",-1) data = strings.Replace(data,"\v","",-1) @@ -993,3 +994,40 @@ func minify(data string) string { data = strings.Replace(data," "," ",-1) return data } + +// TO-DO: Strip comments +// TO-DO: Handle CSS nested in