• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

OpenTweenのfork


Commit MetaInfo

修订版7df73faf1754079a327c6ff88b918c21a47f2eb9 (tree)
时间2012-02-18 23:11:02
作者kiri_feather <kiri_feather@user...>
CommiterKimura Youichi

Log Message

タブ作成時に既存タブのソート順が引き継がれないバグ修正
メニューの「タブ」からのサウンドファイル指定が反映されないバグ修正
メニューの「タブ」から振り分けルール編集画面が開けないバグ修正
Webモードで半角スペースをnbspに置換できていなかったバグ修正
APIモードでのHTMLタグ付けが正しく行われないバグ修正

git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@100 e39ad16e-3079-482e-bb30-4b4d378143b6

更改概述

差异

--- a/Tween/My Project/AssemblyInfo.vb
+++ b/Tween/My Project/AssemblyInfo.vb
@@ -55,5 +55,5 @@ Imports System.Runtime.InteropServices
5555 ' <Assembly: AssemblyVersion("1.0.*")>
5656
5757 <Assembly: AssemblyVersion("0.1.0.0")>
58-<Assembly: AssemblyFileVersion("0.8.5.1")>
58+<Assembly: AssemblyFileVersion("0.8.5.3")>
5959
--- a/Tween/StatusDictionary.vb
+++ b/Tween/StatusDictionary.vb
@@ -377,11 +377,13 @@ Public NotInheritable Class TabInformations
377377
378378 Public Sub AddTab(ByVal TabName As String, ByVal TabType As TabUsageType)
379379 _tabs.Add(TabName, New TabClass(TabName, TabType))
380+ _tabs(TabName).Sorter.Mode = _sorter.Mode
381+ _tabs(TabName).Sorter.Order = _sorter.Order
380382 End Sub
381383
382- Public Sub AddTab(ByVal TabName As String, ByVal Tab As TabClass)
383- _tabs.Add(TabName, Tab)
384- End Sub
384+ 'Public Sub AddTab(ByVal TabName As String, ByVal Tab As TabClass)
385+ ' _tabs.Add(TabName, Tab)
386+ 'End Sub
385387
386388 Public Sub RemoveTab(ByVal TabName As String)
387389 SyncLock LockObj
--- a/Tween/Tween.vb
+++ b/Tween/Tween.vb
@@ -5643,7 +5643,7 @@ RETRY:
56435643 Private Sub SoundFileComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SoundFileComboBox.SelectedIndexChanged, SoundFileTbComboBox.SelectedIndexChanged
56445644 If soundfileListup OrElse _rclickTabName = "" Then Exit Sub
56455645
5646- _statuses.Tabs(_rclickTabName).SoundFile = DirectCast(SoundFileComboBox.SelectedItem, String)
5646+ _statuses.Tabs(_rclickTabName).SoundFile = DirectCast(DirectCast(sender, ToolStripComboBox).SelectedItem, String)
56475647
56485648 'SaveConfigsTab(_rclickTabName)
56495649 SaveConfigsTabs()
@@ -5659,7 +5659,7 @@ RETRY:
56595659 SaveConfigsTabs()
56605660 End Sub
56615661
5662- Private Sub FilterEditMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FilterEditMenuItem.Click
5662+ Private Sub FilterEditMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FilterEditMenuItem.Click, EditRuleTbMenuItem.Click
56635663 'If _rclickTabName = "" OrElse _rclickTabName = DEFAULTTAB.RECENT OrElse _rclickTabName = DEFAULTTAB.DM _
56645664 ' OrElse _rclickTabName = DEFAULTTAB.FAV Then Exit Sub
56655665
@@ -7567,4 +7567,5 @@ RETRY:
75677567 Private Sub MenuItemTab_DropDownOpening(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItemTab.DropDownOpening
75687568 ContextMenuTabProperty_Opening(sender, Nothing)
75697569 End Sub
7570+
75707571 End Class
--- a/Tween/Twitter.vb
+++ b/Tween/Twitter.vb
@@ -1718,25 +1718,47 @@ Public Module Twitter
17181718 retStr = retStr.Replace(vbLf, "<br>")
17191719
17201720 '半角スペースを置換(Thanks @anis774)
1721+ Dim ret As Boolean = False
1722+ Do
1723+ ret = EscapeSpace(retStr)
1724+ Loop While Not ret
1725+ 'Dim isTag As Boolean = False
1726+ 'For i As Integer = 0 To retStr.Length - 1
1727+ ' If retStr(i) = "<"c Then
1728+ ' isTag = True
1729+ ' End If
1730+ ' If retStr(i) = ">"c Then
1731+ ' isTag = False
1732+ ' End If
1733+
1734+ ' If (Not isTag) AndAlso (retStr(i) = " "c) Then
1735+ ' retStr = retStr.Remove(i, 1)
1736+ ' retStr = retStr.Insert(i, "&nbsp;")
1737+ ' End If
1738+ 'Next
1739+
1740+ Return SanitizeHtml(retStr)
1741+ End Function
1742+
1743+ Private Function EscapeSpace(ByRef html As String) As Boolean
1744+ '半角スペースを置換(Thanks @anis774)
17211745 Dim isTag As Boolean = False
1722- For i As Integer = 0 To retStr.Length - 1
1723- If retStr(i) = "<"c Then
1746+ For i As Integer = 0 To html.Length - 1
1747+ If html(i) = "<"c Then
17241748 isTag = True
17251749 End If
1726- If retStr(i) = ">"c Then
1750+ If html(i) = ">"c Then
17271751 isTag = False
17281752 End If
17291753
1730- If (Not isTag) AndAlso (retStr(i) = " "c) Then
1731- retStr.Remove(i, 1)
1732- retStr.Insert(i, "&nbsp;")
1733- i += 5
1754+ If (Not isTag) AndAlso (html(i) = " "c) Then
1755+ html = html.Remove(i, 1)
1756+ html = html.Insert(i, "&nbsp;")
1757+ Return False
17341758 End If
17351759 Next
1736-
1737- Return SanitizeHtml(retStr)
1760+ Return True
17381761 End Function
1739-
17401762 Private Sub GetIconImage(ByVal post As PostClass)
17411763 Dim img As Image
17421764 Dim bmp2 As Bitmap
@@ -3798,10 +3820,10 @@ Public Module Twitter
37983820
37993821 Private Function CreateHtmlAnchor(ByVal Text As String, ByVal AtList As List(Of String)) As String
38003822 'Dim retStr As String = HttpUtility.HtmlEncode(Text) '要検証(デコードされて取得されるので再エンコード)
3801- Dim retStr As String = HttpUtility.HtmlDecode(Text)
3802-
3823+ 'Dim retStr As String = HttpUtility.HtmlDecode(Text)
3824+ Dim retStr As String = ""
38033825 'uriの正規表現
3804- Dim rgUrl As Regex = New Regex("(?<![0-9A-Za-z])(?:https?|shttp|ftps?)://(?:(?:[-_.!~*'()a-zA-Z0-9;:&=+$,]|%[0-9A-Fa-f" + _
3826+ Dim rgUrl As Regex = New Regex("(?<![0-9A-Za-z=])(?:https?|shttp|ftps?)://(?:(?:[-_.!~*'()a-zA-Z0-9;:&=+$,]|%[0-9A-Fa-f" + _
38053827 "][0-9A-Fa-f])*@)?(?:(?:[a-zA-Z0-9](?:[-a-zA-Z0-9]*[a-zA-Z0-9])?\.)" + _
38063828 "*[a-zA-Z](?:[-a-zA-Z0-9]*[a-zA-Z0-9])?\.?|[0-9]+\.[0-9]+\.[0-9]+\." + _
38073829 "[0-9]+)(?::[0-9]*)?(?:/(?:[-_.!~*'()a-zA-Z0-9:@&=+$,]|%[0-9A-Fa-f]" + _
@@ -3811,14 +3833,15 @@ Public Module Twitter
38113833 "*)?(?:\?(?:[-_.!~*'()a-zA-Z0-9;/?:@&=+$,]|%[0-9A-Fa-f][0-9A-Fa-f])" + _
38123834 "*)?(?:#(?:[-_.!~*'()a-zA-Z0-9;/?:@&=+$,]|%[0-9A-Fa-f][0-9A-Fa-f])*)?")
38133835 '絶対パス表現のUriをリンクに置換
3814- 'retStr = rgUrl.Replace(retStr, "<a href=""$&"">$&</a>")
3815- For Each mt As Match In rgUrl.Matches(retStr)
3816- Text.Replace(mt.Result("$&"), "<a href=""" + mt.Result("$&") + """>" + mt.Result("$&") + "</a>")
3817- Next
3818- retStr = Text
3836+ retStr = rgUrl.Replace(Text, "<a href=""$&"">$&</a>")
3837+ 'Dim mts As MatchCollection = rgUrl.Matches(retStr)
3838+ '''半角スペースを置換(Thanks @anis774)
3839+ ''Text = Text.Replace(" ", "&nbsp;") 'HttpUtility.HtmlEncode()ではスペースが処理されない為
38193840
3820- '半角スペースを置換(Thanks @anis774)
3821- retStr = retStr.Replace(" ", "&nbsp;") 'HttpUtility.HtmlEncode()ではスペースが処理されない為
3841+ 'For Each mt As Match In mts
3842+ ' Text = Text.Replace(mt.Result("$&"), "<a href=""" + mt.Result("$&") + """>" + mt.Result("$&") + "</a>")
3843+ 'Next
3844+ 'retStr = Text
38223845
38233846 '@返信を抽出し、@先リスト作成
38243847 'Dim rg As New Regex("(^|[ -/:-@[-^`{-~])@([a-zA-Z0-9_]{1,20}/[a-zA-Z0-9_\-]{1,24}[a-zA-Z0-9_])")
@@ -3839,17 +3862,29 @@ Public Module Twitter
38393862
38403863 'ハッシュタグを抽出し、リンクに置換
38413864 'Dim rgh As New Regex("(^|[ .!,\-:;<>?])#([^] !""#$%&'()*+,.:;<=>?@\-[\^`{|}~\r\n]+)")
3842- Dim rgh As New Regex("(^|[^a-zA-Z0-9_/])[##]([a-zA-Z0-9_]+)")
3843- Dim mh As Match = rgh.Match(retStr)
3844- If mh.Success Then
3845- retStr = rgh.Replace(retStr, "$1<a href=""" + _protocol + "twitter.com/search?q=%23$2"">#$2</a>")
3846- End If
3847- While mh.Success
3848- SyncLock LockObj
3849- _hashList.Add("#" + mh.Result("$2"))
3850- End SyncLock
3851- mh = mh.NextMatch
3852- End While
3865+ Dim rgh As New Regex("(^|[^a-zA-Z0-9_/&])[##]([a-zA-Z0-9_]+)")
3866+ Dim mhs As MatchCollection = rgh.Matches(retStr)
3867+ For Each mt As Match In mhs
3868+ If Not IsNumeric(mt.Result("$2")) Then
3869+ 'retStr = retStr.Replace(mt.Result("$1") + mt.Result("$2"), "<a href=""" + _protocol + "twitter.com/search?q=%23" + mt.Result("$2") + """>#" + mt.Result("$2") + "</a>")
3870+ SyncLock LockObj
3871+ _hashList.Add("#" + mt.Result("$2"))
3872+ End SyncLock
3873+ End If
3874+ Next
3875+ retStr = rgh.Replace(retStr, "$1<a href=""" + _protocol + "twitter.com/search?q=%23$2"">#$2</a>")
3876+ '数字のみハッシュタグを戻す
3877+ Dim rgnh As New Regex("<a href=""" + _protocol + "twitter.com/search\?q=%23[0-9]+"">(#[0-9]+)</a>")
3878+ retStr = rgnh.Replace(retStr, "$1")
3879+ 'If mh.Success Then
3880+ ' retStr = rgh.Replace(retStr, "$1<a href=""" + _protocol + "twitter.com/search?q=%23$2"">#$2</a>")
3881+ 'End If
3882+ 'While mh.Success
3883+ ' SyncLock LockObj
3884+ ' _hashList.Add("#" + mh.Result("$2"))
3885+ ' End SyncLock
3886+ ' mh = mh.NextMatch
3887+ 'End While
38533888
38543889 retStr = AdjustHtml(ShortUrlResolve(PreProcessUrl(retStr))) 'IDN置換、短縮Uri解決、@リンクを相対→絶対にしてtarget属性付与
38553890 Return retStr