Skip to content

Commit

Permalink
updated libraries, connect using https, cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Herr Ritschwumm committed Nov 25, 2013
1 parent 6046d82 commit 92f50de
Show file tree
Hide file tree
Showing 15 changed files with 327 additions and 294 deletions.
10 changes: 4 additions & 6 deletions build.sbt
Expand Up @@ -2,16 +2,14 @@ name := "commonist"

organization := "de.djini"

version := "0.7.0"
version := "0.8.0"

scalaVersion := "2.10.3"

libraryDependencies ++= Seq(
"de.djini" %% "scutil" % "0.31.0" % "compile",
"de.djini" %% "scjson" % "0.34.0" % "compile",
"de.djini" %% "scmw" % "0.29.0" % "compile",
"org.apache.httpcomponents" % "httpclient" % "4.2.6" % "compile",
"org.apache.httpcomponents" % "httpmime" % "4.2.6" % "compile",
"de.djini" %% "scutil" % "0.34.0" % "compile",
"de.djini" %% "scjson" % "0.37.0" % "compile",
"de.djini" %% "scmw" % "0.33.0" % "compile",
"org.apache.sanselan" % "sanselan" % "0.97-incubator" % "compile",
"org.simplericity.macify" % "macify" % "1.6" % "compile"
)
Expand Down
8 changes: 4 additions & 4 deletions project/plugins.sbt
@@ -1,9 +1,9 @@
addSbtPlugin("de.djini" % "xsbt-webstart" % "0.12.0")
addSbtPlugin("de.djini" % "xsbt-webstart" % "0.13.0")

addSbtPlugin("de.djini" % "xsbt-scriptstart" % "0.11.0")
addSbtPlugin("de.djini" % "xsbt-scriptstart" % "0.13.0")

addSbtPlugin("de.djini" % "xsbt-osxapp" % "0.7.0")
addSbtPlugin("de.djini" % "xsbt-osxapp" % "0.8.0")

addSbtPlugin("de.djini" % "xsbt-zipper" % "0.5.0")
addSbtPlugin("de.djini" % "xsbt-zipper" % "0.6.0")

addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.2.5")
4 changes: 4 additions & 0 deletions src/main/doc/changes.txt
@@ -1,3 +1,7 @@
0.8.0 24nov13
change changed all wikis to use https
change use scmw-0.33.0 to use new httpclient 4.3.1

0.7.0 26oct13
change issued a new snakeoil certificate
change added permissions attribute to jar manifests
Expand Down
162 changes: 82 additions & 80 deletions src/main/doc/index.html

Large diffs are not rendered by default.

168 changes: 84 additions & 84 deletions src/main/resources/wikis.txt
@@ -1,103 +1,103 @@
# other
kamelopedia _ http://kamelopedia.mormo.org/api.php
mediawiki _ http://www.mediawiki.org/w/api.php
# kamelopedia _ http://kamelopedia.mormo.org/api.php
mediawiki _ https://www.mediawiki.org/w/api.php

# wikia
wikia foto http://foto.wikia.com/api.php
wikia uncyclopedia http://uncyclopedia.wikia.com/api.php
wikia foto https://foto.wikia.com/api.php
wikia uncyclopedia https://uncyclopedia.wikia.com/api.php

# wikimedia
wikimedia commons http://commons.wikimedia.org/w/api.php
wikimedia meta http://meta.wikimedia.org/w/api.php
wikimedia commons https://commons.wikimedia.org/w/api.php
wikimedia meta https://meta.wikimedia.org/w/api.php

# wikibooks
wikibooks de http://de.wikibooks.org/w/api.php
wikibooks en http://en.wikibooks.org/w/api.php
wikibooks es http://es.wikibooks.org/w/api.php
wikibooks fr http://fr.wikibooks.org/w/api.php
wikibooks it http://it.wikibooks.org/w/api.php
wikibooks ja http://ja.wikibooks.org/w/api.php
wikibooks nl http://nl.wikibooks.org/w/api.php
wikibooks pl http://pl.wikibooks.org/w/api.php
wikibooks pt http://pt.wikibooks.org/w/api.php
wikibooks sv http://sv.wikibooks.org/w/api.php
wikibooks de https://de.wikibooks.org/w/api.php
wikibooks en https://en.wikibooks.org/w/api.php
wikibooks es https://es.wikibooks.org/w/api.php
wikibooks fr https://fr.wikibooks.org/w/api.php
wikibooks it https://it.wikibooks.org/w/api.php
wikibooks ja https://ja.wikibooks.org/w/api.php
wikibooks nl https://nl.wikibooks.org/w/api.php
wikibooks pl https://pl.wikibooks.org/w/api.php
wikibooks pt https://pt.wikibooks.org/w/api.php
wikibooks sv https://sv.wikibooks.org/w/api.php

# wikinews
wikinews de http://de.wikinews.org/w/api.php
wikinews en http://en.wikinews.org/w/api.php
wikinews es http://es.wikinews.org/w/api.php
wikinews fr http://fr.wikinews.org/w/api.php
wikinews it http://it.wikinews.org/w/api.php
wikinews ja http://ja.wikinews.org/w/api.php
wikinews nl http://nl.wikinews.org/w/api.php
wikinews pl http://pl.wikinews.org/w/api.php
wikinews pt http://pt.wikinews.org/w/api.php
wikinews sv http://sv.wikinews.org/w/api.php
wikinews de https://de.wikinews.org/w/api.php
wikinews en https://en.wikinews.org/w/api.php
wikinews es https://es.wikinews.org/w/api.php
wikinews fr https://fr.wikinews.org/w/api.php
wikinews it https://it.wikinews.org/w/api.php
wikinews ja https://ja.wikinews.org/w/api.php
wikinews nl https://nl.wikinews.org/w/api.php
wikinews pl https://pl.wikinews.org/w/api.php
wikinews pt https://pt.wikinews.org/w/api.php
wikinews sv https://sv.wikinews.org/w/api.php

# wikipedia
wikipedia ar http://ar.wikipedia.org/w/api.php
wikipedia ca http://ca.wikipedia.org/w/api.php
wikipedia da http://da.wikipedia.org/w/api.php
wikipedia de http://de.wikipedia.org/w/api.php
wikipedia en http://en.wikipedia.org/w/api.php
wikipedia eo http://eo.wikipedia.org/w/api.php
wikipedia es http://es.wikipedia.org/w/api.php
wikipedia et http://et.wikipedia.org/w/api.php
wikipedia fi http://fi.wikipedia.org/w/api.php
wikipedia fr http://fr.wikipedia.org/w/api.php
wikipedia he http://he.wikipedia.org/w/api.php
wikipedia hr http://hr.wikipedia.org/w/api.php
wikipedia hu http://hu.wikipedia.org/w/api.php
wikipedia ia http://ia.wikipedia.org/w/api.php
wikipedia it http://it.wikipedia.org/w/api.php
wikipedia ja http://ja.wikipedia.org/w/api.php
wikipedia ml http://ml.wikipedia.org/w/api.php
wikipedia nl http://nl.wikipedia.org/w/api.php
wikipedia no http://no.wikipedia.org/w/api.php
wikipedia pl http://pl.wikipedia.org/w/api.php
wikipedia pt http://pt.wikipedia.org/w/api.php
wikipedia ro http://ro.wikipedia.org/w/api.php
wikipedia sl http://sl.wikipedia.org/w/api.php
wikipedia sv http://sv.wikipedia.org/w/api.php
wikipedia zh http://zh.wikipedia.org/w/api.php
wikipedia ar https://ar.wikipedia.org/w/api.php
wikipedia ca https://ca.wikipedia.org/w/api.php
wikipedia da https://da.wikipedia.org/w/api.php
wikipedia de https://de.wikipedia.org/w/api.php
wikipedia en https://en.wikipedia.org/w/api.php
wikipedia eo https://eo.wikipedia.org/w/api.php
wikipedia es https://es.wikipedia.org/w/api.php
wikipedia et https://et.wikipedia.org/w/api.php
wikipedia fi https://fi.wikipedia.org/w/api.php
wikipedia fr https://fr.wikipedia.org/w/api.php
wikipedia he https://he.wikipedia.org/w/api.php
wikipedia hr https://hr.wikipedia.org/w/api.php
wikipedia hu https://hu.wikipedia.org/w/api.php
wikipedia ia https://ia.wikipedia.org/w/api.php
wikipedia it https://it.wikipedia.org/w/api.php
wikipedia ja https://ja.wikipedia.org/w/api.php
wikipedia ml https://ml.wikipedia.org/w/api.php
wikipedia nl https://nl.wikipedia.org/w/api.php
wikipedia no https://no.wikipedia.org/w/api.php
wikipedia pl https://pl.wikipedia.org/w/api.php
wikipedia pt https://pt.wikipedia.org/w/api.php
wikipedia ro https://ro.wikipedia.org/w/api.php
wikipedia sl https://sl.wikipedia.org/w/api.php
wikipedia sv https://sv.wikipedia.org/w/api.php
wikipedia zh https://zh.wikipedia.org/w/api.php

# wikiquote
wikiquote de http://de.wikiquote.org/w/api.php
wikiquote en http://en.wikiquote.org/w/api.php
wikiquote es http://es.wikiquote.org/w/api.php
wikiquote fr http://fr.wikiquote.org/w/api.php
wikiquote it http://it.wikiquote.org/w/api.php
wikiquote ja http://ja.wikiquote.org/w/api.php
wikiquote nl http://nl.wikiquote.org/w/api.php
wikiquote pl http://pl.wikiquote.org/w/api.php
wikiquote pt http://pt.wikiquote.org/w/api.php
wikiquote sv http://sv.wikiquote.org/w/api.php
wikiquote de https://de.wikiquote.org/w/api.php
wikiquote en https://en.wikiquote.org/w/api.php
wikiquote es https://es.wikiquote.org/w/api.php
wikiquote fr https://fr.wikiquote.org/w/api.php
wikiquote it https://it.wikiquote.org/w/api.php
wikiquote ja https://ja.wikiquote.org/w/api.php
wikiquote nl https://nl.wikiquote.org/w/api.php
wikiquote pl https://pl.wikiquote.org/w/api.php
wikiquote pt https://pt.wikiquote.org/w/api.php
wikiquote sv https://sv.wikiquote.org/w/api.php

# wikisource
wikisource ar http://ar.wikisource.org/w/api.php
wikisource de http://de.wikisource.org/w/api.php
wikisource en http://en.wikisource.org/w/api.php
wikisource es http://es.wikisource.org/w/api.php
wikisource fr http://fr.wikisource.org/w/api.php
wikisource it http://it.wikisource.org/w/api.php
wikisource ja http://ja.wikisource.org/w/api.php
wikisource nl http://nl.wikisource.org/w/api.php
wikisource pl http://pl.wikisource.org/w/api.php
wikisource pt http://pt.wikisource.org/w/api.php
wikisource sv http://sv.wikisource.org/w/api.php
wikisource ar https://ar.wikisource.org/w/api.php
wikisource de https://de.wikisource.org/w/api.php
wikisource en https://en.wikisource.org/w/api.php
wikisource es https://es.wikisource.org/w/api.php
wikisource fr https://fr.wikisource.org/w/api.php
wikisource it https://it.wikisource.org/w/api.php
wikisource ja https://ja.wikisource.org/w/api.php
wikisource nl https://nl.wikisource.org/w/api.php
wikisource pl https://pl.wikisource.org/w/api.php
wikisource pt https://pt.wikisource.org/w/api.php
wikisource sv https://sv.wikisource.org/w/api.php

# wikiversity
wikiversity de http://de.wikiversity.org/w/api.php
wikiversity en http://en.wikiversity.org/w/api.php
wikiversity de https://de.wikiversity.org/w/api.php
wikiversity en https://en.wikiversity.org/w/api.php

# wiktionary
wiktionary de http://de.wiktionary.org/w/api.php
wiktionary en http://en.wiktionary.org/w/api.php
wiktionary es http://es.wiktionary.org/w/api.php
wiktionary fr http://fr.wiktionary.org/w/api.php
wiktionary it http://it.wiktionary.org/w/api.php
wiktionary ja http://ja.wiktionary.org/w/api.php
wiktionary nl http://nl.wiktionary.org/w/api.php
wiktionary pl http://pl.wiktionary.org/w/api.php
wiktionary pt http://pt.wiktionary.org/w/api.php
wiktionary sv http://sv.wiktionary.org/w/api.php
wiktionary de https://de.wiktionary.org/w/api.php
wiktionary en https://en.wiktionary.org/w/api.php
wiktionary es https://es.wiktionary.org/w/api.php
wiktionary fr https://fr.wiktionary.org/w/api.php
wiktionary it https://it.wiktionary.org/w/api.php
wiktionary ja https://ja.wiktionary.org/w/api.php
wiktionary nl https://nl.wiktionary.org/w/api.php
wiktionary pl https://pl.wiktionary.org/w/api.php
wiktionary pt https://pt.wiktionary.org/w/api.php
wiktionary sv https://sv.wiktionary.org/w/api.php
21 changes: 11 additions & 10 deletions src/main/scala/commonist/data/CommonData.scala
Expand Up @@ -2,13 +2,14 @@ package commonist.data

/** Data edited in a CommonUI */
case class CommonData(
wiki:WikiData,
user:String,
password:String,
description:String,
date:String,
source:String,
author:String,
permission:String,
license:LicenseData,
categories:String)
wiki:WikiData,
user:String,
password:String,
description:String,
date:String,
source:String,
author:String,
permission:String,
license:LicenseData,
categories:String
)
15 changes: 8 additions & 7 deletions src/main/scala/commonist/data/ImageData.scala
Expand Up @@ -4,10 +4,11 @@ import java.io.File

/** Data edited in an ImageUI */
case class ImageData(
file:File,
upload:Boolean,
name:String,
description:String,
date:String,
coordinates:String,
categories:String)
file:File,
upload:Boolean,
name:String,
description:String,
date:String,
coordinates:String,
categories:String
)
9 changes: 5 additions & 4 deletions src/main/scala/commonist/data/WikiData.scala
Expand Up @@ -3,8 +3,9 @@ package commonist.data
/** metadata of a wiki site */
case class WikiData(family:String, site:Option[String], api:String) {
// used in the combo box
override def toString = site match {
case Some(name) => family + ":" + name
case None => family
}
override def toString =
site match {
case Some(name) => family + ":" + name
case None => family
}
}
62 changes: 34 additions & 28 deletions src/main/scala/commonist/ui/CommonUI.scala
Expand Up @@ -14,9 +14,11 @@ import commonist.util._

/** an editor for Data common to all images */
final class CommonUI(wikiList:Seq[WikiData], licenseList:Seq[LicenseData]) extends JPanel {
override def getMinimumSize():Dimension = new Dimension(
300,
super.getMinimumSize.height)
override def getMinimumSize():Dimension =
new Dimension(
300,
super.getMinimumSize.height
)

//## components

Expand Down Expand Up @@ -69,11 +71,12 @@ final class CommonUI(wikiList:Seq[WikiData], licenseList:Seq[LicenseData]) exten

// license contains the full text as a tooltip
private def updateLicenseTooltip() {
val text = licenseEditor.getSelectedItem match {
case x:LicenseData => x.description
case x:String => x
case x => sys error ("unexpected license type: " + x)
}
val text =
licenseEditor.getSelectedItem match {
case x:LicenseData => x.description
case x:String => x
case x => sys error ("unexpected license type: " + x)
}
licenseEditor setToolTipText text
}
licenseEditor onActionPerformed { _ =>
Expand Down Expand Up @@ -131,21 +134,23 @@ final class CommonUI(wikiList:Seq[WikiData], licenseList:Seq[LicenseData]) exten
add(separator2, GBC pos (0,12) size (2,1) weight (1,0) anchor CENTER fill HORIZONTAL insetsTLBR (0,0,0,0))

/** gets all data edit in this UI */
def getData:CommonData = new CommonData(
wikiEditor.getSelectedItem.asInstanceOf[WikiData],
userEditor.getText.trim,
new String(passwordEditor.getPassword),
descriptionEditor.getText,
dateEditor.getText,
sourceEditor.getText,
authorEditor.getText,
permissionEditor.getText,
licenseEditor.getSelectedItem match {
case x:String => LicenseData(x, "")
case x:LicenseData => x
case x => sys error ("unexpected license type: " + x)
},
categoriesEditor.getText)
def getData:CommonData =
CommonData(
wikiEditor.getSelectedItem.asInstanceOf[WikiData],
userEditor.getText.trim,
new String(passwordEditor.getPassword),
descriptionEditor.getText,
dateEditor.getText,
sourceEditor.getText,
authorEditor.getText,
permissionEditor.getText,
licenseEditor.getSelectedItem match {
case x:String => LicenseData(x, "")
case x:LicenseData => x
case x => sys error ("unexpected license type: " + x)
},
categoriesEditor.getText
)

//------------------------------------------------------------------------------
//## Settings
Expand Down Expand Up @@ -186,11 +191,12 @@ final class CommonUI(wikiList:Seq[WikiData], licenseList:Seq[LicenseData]) exten
val wikiData = wikiEditor.getSelectedItem.asInstanceOf[WikiData]
settings set ("wikiEditor.SelectedItem", wikiData.api)

val licenseSel = licenseEditor.getSelectedItem match {
case x:LicenseData => x.template
case x:String => x
case x => sys error ("unexpected license type: " + x)
}
val licenseSel =
licenseEditor.getSelectedItem match {
case x:LicenseData => x.template
case x:String => x
case x => sys error ("unexpected license type: " + x)
}
settings set ("licenseEditor.SelectedItem", licenseSel)
}
}
10 changes: 7 additions & 3 deletions src/main/scala/commonist/ui/DirectoryUI.scala
Expand Up @@ -100,9 +100,13 @@ final class DirectoryUI(callback:DirectoryUICallback) extends JScrollPane with L

/** loads this UI's state from the properties */
def loadSettings(settings:Settings) {
currentDirectory = new File(settings getOrElse (
"directoryTree.currentDirectory",
SystemProperties.user.home))
currentDirectory =
new File(
settings getOrElse (
"directoryTree.currentDirectory",
SystemProperties.user.home
)
)
browseDirectory(currentDirectory)
}

Expand Down

0 comments on commit 92f50de

Please sign in to comment.