Index: branches/wmf/1.17wmf1/extensions/WikiLove/WikiLove.api.php |
— | — | @@ -1,176 +0,0 @@ |
2 | | -<?php |
3 | | -class WikiLoveApi extends ApiBase { |
4 | | - public function execute() { |
5 | | - global $wgRequest, $wgWikiLoveLogging, $wgParser; |
6 | | - |
7 | | - $params = $this->extractRequestParams(); |
8 | | - |
9 | | - $title = Title::newFromText( $params['title'] ); |
10 | | - if ( is_null( $title ) ) { |
11 | | - $this->dieUsageMsg( array( 'invaliduser', $params['title'] ) ); |
12 | | - } |
13 | | - |
14 | | - $talk = WikiLoveHooks::getUserTalkPage( $title ); |
15 | | - if ( is_null( $talk ) ) { |
16 | | - $this->dieUsageMsg( array( 'invaliduser', $params['title'] ) ); |
17 | | - } |
18 | | - |
19 | | - if ( $wgWikiLoveLogging ) { |
20 | | - $this->saveInDb( $talk, $params['subject'], $params['message'], $params['type'], isset( $params['email'] ) ? 1 : 0 ); |
21 | | - } |
22 | | - |
23 | | - // not using section => 'new' here, as we like to give our own edit summary |
24 | | - $api = new ApiMain( new FauxRequest( array( |
25 | | - 'action' => 'edit', |
26 | | - 'title' => $talk->getFullText(), |
27 | | - // need to do this, as Article::replaceSection fails for non-existing pages |
28 | | - 'appendtext' => ( $talk->exists() ? "\n\n" : '' ) . wfMsgForContent( 'newsectionheaderdefaultlevel', $params['subject'] ) |
29 | | - . "\n\n" . $params['text'], |
30 | | - 'token' => $params['token'], |
31 | | - 'summary' => wfMsgForContent( 'wikilove-summary', $wgParser->stripSectionName( $params['subject'] ) ), |
32 | | - 'notminor' => true, |
33 | | - ), false, array( 'wsEditToken' => $wgRequest->getSessionData( 'wsEditToken' ) ) ), true ); |
34 | | - |
35 | | - if ( isset( $params['email'] ) ) { |
36 | | - $this->emailUser( $talk, $params['subject'], $params['email'], $params['token'] ); |
37 | | - } |
38 | | - |
39 | | - $api->execute(); |
40 | | - |
41 | | - $result = $api->getResult(); |
42 | | - $data = $result->getData(); |
43 | | - |
44 | | - $this->getResult()->addValue( 'redirect', 'pageName', $talk->getPrefixedDBkey() ); |
45 | | - $this->getResult()->addValue( 'redirect', 'fragment', Title::escapeFragmentForURL( $params['subject'] ) ); |
46 | | - // note that we cannot use Title::makeTitle here as it doesn't sanitize the fragment |
47 | | - } |
48 | | - |
49 | | - /** |
50 | | - * @param $talk Title |
51 | | - * @param $subject |
52 | | - * @param $message |
53 | | - * @param $type |
54 | | - * @param $email |
55 | | - * @return void |
56 | | - */ |
57 | | - private function saveInDb( $talk, $subject, $message, $type, $email ) { |
58 | | - global $wgUser; |
59 | | - $dbw = wfGetDB( DB_MASTER ); |
60 | | - $receiver = User::newFromName( $talk->getSubjectPage()->getBaseText() ); |
61 | | - if ( $receiver->isAnon() ) { |
62 | | - $this->setWarning( 'Not logging anonymous recipients' ); |
63 | | - return; |
64 | | - } |
65 | | - |
66 | | - $values = array( |
67 | | - 'wll_timestamp' => $dbw->timestamp(), |
68 | | - 'wll_sender' => $wgUser->getId(), |
69 | | - 'wll_sender_editcount' => $wgUser->getEditCount(), |
70 | | - 'wll_sender_registration' => $wgUser->getRegistration(), |
71 | | - 'wll_receiver' => $receiver->getId(), |
72 | | - 'wll_receiver_editcount' => $receiver->getEditCount(), |
73 | | - 'wll_receiver_registration' => $receiver->getRegistration(), |
74 | | - 'wll_type' => $type, |
75 | | - 'wll_subject' => $subject, |
76 | | - 'wll_message' => $message, |
77 | | - 'wll_email' => $email, |
78 | | - ); |
79 | | - |
80 | | - try{ |
81 | | - $dbw->insert( 'wikilove_log', $values, __METHOD__ ); |
82 | | - } catch( DBQueryError $dbqe ) { |
83 | | - $this->setWarning( 'Action was not logged' ); |
84 | | - } |
85 | | - } |
86 | | - |
87 | | - private function emailUser( $talk, $subject, $text, $token ) { |
88 | | - global $wgRequest; |
89 | | - $api = new ApiMain( new FauxRequest( array( |
90 | | - 'action' => 'emailuser', |
91 | | - 'target' => User::newFromName( $talk->getSubjectPage()->getBaseText() )->getName(), |
92 | | - 'subject' => $subject, |
93 | | - 'text' => $text, |
94 | | - 'token' => $token, |
95 | | - ), false, array( 'wsEditToken' => $wgRequest->getSessionData( 'wsEditToken' ) ) ), true ); |
96 | | - try{ |
97 | | - $api->execute(); |
98 | | - } catch( DBQueryError $dbqe ) { |
99 | | - $this->setWarning( 'E-mail was not sent' ); |
100 | | - } |
101 | | - } |
102 | | - |
103 | | - public function getAllowedParams() { |
104 | | - return array( |
105 | | - 'title' => array( |
106 | | - ApiBase::PARAM_TYPE => 'string', |
107 | | - ApiBase::PARAM_REQUIRED => true, |
108 | | - ), |
109 | | - 'text' => array( |
110 | | - ApiBase::PARAM_TYPE => 'string', |
111 | | - ApiBase::PARAM_REQUIRED => true, |
112 | | - ), |
113 | | - 'message' => array( |
114 | | - ApiBase::PARAM_TYPE => 'string', |
115 | | - ), |
116 | | - 'token' => array( |
117 | | - ApiBase::PARAM_TYPE => 'string', |
118 | | - ApiBase::PARAM_REQUIRED => true, |
119 | | - ), |
120 | | - 'subject' => array( |
121 | | - ApiBase::PARAM_TYPE => 'string', |
122 | | - ApiBase::PARAM_REQUIRED => true, |
123 | | - ), |
124 | | - 'type' => array( |
125 | | - ApiBase::PARAM_TYPE => 'string', |
126 | | - ), |
127 | | - 'email' => array( |
128 | | - ApiBase::PARAM_TYPE => 'string', |
129 | | - ), |
130 | | - ); |
131 | | - } |
132 | | - |
133 | | - public function getParamDescription() { |
134 | | - return array( |
135 | | - 'title' => 'Title of the user or user talk page to send WikiLove to', |
136 | | - 'text' => 'Raw wikitext to add in the new section', |
137 | | - 'message' => 'Actual message the user has entered, for logging purposes', |
138 | | - 'token' => 'Edit token. You can get one of these through prop=info', |
139 | | - 'subject' => 'Subject header of the new section', |
140 | | - 'email' => 'Content of the optional e-mail message to send to the user', |
141 | | - 'type' => array( 'Type of WikiLove (for statistics); this corresponds with a type', |
142 | | - 'selected in the left menu, and optionally a subtype after that', |
143 | | - '(e.g. "barnstar-normal" or "kitten")', |
144 | | - ), |
145 | | - ); |
146 | | - } |
147 | | - |
148 | | - public function getDescription() { |
149 | | - return array( |
150 | | - 'Give WikiLove to another user.', |
151 | | - "WikiLove is a positive message posted to a user's talk page through a", |
152 | | - 'convenient interface with preset or locally defined templates. This action', |
153 | | - 'adds the specified wikitext to a certain talk page. For statistical purposes,', |
154 | | - 'the type and other data are logged.', |
155 | | - ); |
156 | | - } |
157 | | - |
158 | | - public function getPossibleErrors() { |
159 | | - return array_merge( parent::getPossibleErrors(), array( |
160 | | - array( 'invalidtitle', 'title' ), |
161 | | - array( |
162 | | - 'code' => 'nologging', |
163 | | - 'info' => 'Warning: action was not logged!' |
164 | | - ), |
165 | | - ) ); |
166 | | - } |
167 | | - |
168 | | - public function getExamples() { |
169 | | - return array( |
170 | | - 'api.php?action=wikilove&title=User:Dummy&text=Love&subject=Hi&token=%2B\\', |
171 | | - ); |
172 | | - } |
173 | | - |
174 | | - public function getVersion() { |
175 | | - return __CLASS__ . ': $Id$'; |
176 | | - } |
177 | | -} |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/WikiLove.php |
— | — | @@ -16,6 +16,7 @@ |
17 | 17 | * http://www.gnu.org/copyleft/gpl.html |
18 | 18 | * |
19 | 19 | * Heart icon by Mark James (Creative Commons Attribution 3.0 License) |
| 20 | + * Interface design by Brandon Harris |
20 | 21 | */ |
21 | 22 | |
22 | 23 | /** |
— | — | @@ -37,7 +38,7 @@ |
38 | 39 | $wgExtensionCredits['other'][] = array( |
39 | 40 | 'path' => __FILE__, |
40 | 41 | 'name' => 'WikiLove', |
41 | | - 'version' => '0.1', |
| 42 | + 'version' => '1.0', |
42 | 43 | 'url' => 'http://www.mediawiki.org/wiki/Extension:WikiLove', |
43 | 44 | 'author' => array( |
44 | 45 | 'Ryan Kaldari', 'Jan Paul Posma' |
— | — | @@ -54,7 +55,8 @@ |
55 | 56 | $dir = dirname( __FILE__ ) . '/'; |
56 | 57 | |
57 | 58 | // add autoload classes |
58 | | -$wgAutoloadClasses['WikiLoveApi'] = $dir . 'WikiLove.api.php'; |
| 59 | +$wgAutoloadClasses['ApiWikiLove'] = $dir . 'ApiWikiLove.php'; |
| 60 | +$wgAutoloadClasses['ApiWikiLoveImageLog'] = $dir . 'ApiWikiLoveImageLog.php'; |
59 | 61 | $wgAutoloadClasses['WikiLoveHooks'] = $dir . 'WikiLove.hooks.php'; |
60 | 62 | $wgAutoloadClasses['WikiLoveLocal'] = $dir . 'WikiLove.local.php'; |
61 | 63 | |
— | — | @@ -70,23 +72,36 @@ |
71 | 73 | $wgHooks['MakeGlobalVariablesScript'][] = 'WikiLoveHooks::makeGlobalVariablesScript'; |
72 | 74 | |
73 | 75 | // api modules |
74 | | -$wgAPIModules['wikilove'] = 'WikiLoveApi'; |
| 76 | +$wgAPIModules['wikilove'] = 'ApiWikiLove'; |
| 77 | +$wgAPIModules['wikiloveimagelog'] = 'ApiWikiLoveImageLog'; |
75 | 78 | |
76 | 79 | $extWikiLoveTpl = array( |
77 | 80 | 'localBasePath' => dirname( __FILE__ ) . '/modules/ext.wikiLove', |
78 | 81 | 'remoteExtPath' => 'WikiLove/modules/ext.wikiLove', |
79 | 82 | ); |
80 | 83 | |
81 | | -// resources |
| 84 | +// messages for default options, because we want to use them in the default |
| 85 | +// options module, but also for the user in the user options module |
| 86 | +$wgWikiLoveOptionMessages = array( |
| 87 | + 'wikilove-type-makeyourown', |
| 88 | +); |
| 89 | + |
| 90 | +// Because of bug 29608 we can't make a dependancy on a wiki module yet |
| 91 | +// For now using 'using' to load the wiki module from within init. |
82 | 92 | $wgResourceModules += array( |
83 | 93 | 'ext.wikiLove.icon' => $extWikiLoveTpl + array( |
84 | 94 | 'styles' => 'ext.wikiLove.icon.css', |
85 | 95 | 'position' => 'top', |
86 | 96 | ), |
| 97 | + 'ext.wikiLove.defaultOptions' => $extWikiLoveTpl + array( |
| 98 | + 'scripts' => array( |
| 99 | + 'ext.wikiLove.defaultOptions.js', |
| 100 | + ), |
| 101 | + 'messages' => $wgWikiLoveOptionMessages, |
| 102 | + ), |
87 | 103 | 'ext.wikiLove.startup' => $extWikiLoveTpl + array( |
88 | 104 | 'scripts' => array( |
89 | 105 | 'ext.wikiLove.core.js', |
90 | | - 'ext.wikiLove.defaultOptions.js', |
91 | 106 | ), |
92 | 107 | 'styles' => 'ext.wikiLove.css', |
93 | 108 | 'messages' => array( |
— | — | @@ -98,42 +113,50 @@ |
99 | 114 | 'wikilove-get-started-list-3', |
100 | 115 | 'wikilove-add-details', |
101 | 116 | 'wikilove-image', |
| 117 | + 'wikilove-select-image', |
102 | 118 | 'wikilove-header', |
103 | 119 | 'wikilove-title', |
104 | 120 | 'wikilove-enter-message', |
105 | 121 | 'wikilove-omit-sig', |
| 122 | + 'wikilove-image-example', |
106 | 123 | 'wikilove-button-preview', |
107 | 124 | 'wikilove-preview', |
108 | 125 | 'wikilove-notify', |
109 | 126 | 'wikilove-button-send', |
110 | | - 'wikilove-type-makeyourown', |
111 | 127 | 'wikilove-err-header', |
112 | 128 | 'wikilove-err-title', |
113 | 129 | 'wikilove-err-msg', |
114 | 130 | 'wikilove-err-image', |
| 131 | + 'wikilove-err-image-bad', |
| 132 | + 'wikilove-err-image-api', |
115 | 133 | 'wikilove-err-sig', |
116 | 134 | 'wikilove-err-gallery', |
117 | 135 | 'wikilove-err-gallery-again', |
| 136 | + 'wikilove-what-is-this', |
| 137 | + 'wikilove-anon-warning', |
| 138 | + 'wikilove-commons-text', |
| 139 | + 'wikilove-commons-link', |
| 140 | + 'wikilove-commons-url', |
| 141 | + 'wikilove-err-preview-api', |
| 142 | + 'wikilove-err-send-api', |
118 | 143 | ), |
119 | 144 | 'dependencies' => array( |
| 145 | + 'ext.wikiLove.defaultOptions', |
120 | 146 | 'jquery.ui.dialog', |
121 | 147 | 'jquery.ui.button', |
| 148 | + 'jquery.localize', |
122 | 149 | 'jquery.elastic', |
123 | | - 'jquery.localize', |
124 | 150 | ), |
125 | 151 | ), |
126 | 152 | 'ext.wikiLove.local' => array( |
127 | 153 | 'class' => 'WikiLoveLocal', |
128 | | - /* for information only, this is actually in the class! |
129 | | - 'dependencies' => array( |
130 | | - 'ext.wikiLove.startup', |
131 | | - ), |
132 | | - */ |
133 | 154 | ), |
134 | 155 | 'ext.wikiLove.init' => $extWikiLoveTpl + array( |
135 | | - 'scripts' => 'ext.wikiLove.init.js', |
| 156 | + 'scripts' => array( |
| 157 | + 'ext.wikiLove.init.js', |
| 158 | + ), |
136 | 159 | 'dependencies' => array( |
137 | | - 'ext.wikiLove.local', |
| 160 | + 'ext.wikiLove.startup', |
138 | 161 | ), |
139 | 162 | ), |
140 | 163 | 'jquery.elastic' => array( |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/WikiLove.hooks.php |
— | — | @@ -18,9 +18,12 @@ |
19 | 19 | if ( $updater === null ) { |
20 | 20 | global $wgExtNewTables; |
21 | 21 | $wgExtNewTables[] = array( 'wikilove_log', dirname( __FILE__ ) . '/patches/WikiLoveLog.sql' ); |
| 22 | + $wgExtNewTables[] = array( 'wikilove_image_log', dirname( __FILE__ ) . '/patches/WikiLoveImageLog.sql' ); |
22 | 23 | } else { |
23 | 24 | $updater->addExtensionUpdate( array( 'addTable', 'wikilove_log', |
24 | 25 | dirname( __FILE__ ) . '/patches/WikiLoveLog.sql', true ) ); |
| 26 | + $updater->addExtensionUpdate( array( 'addTable', 'wikilove_image_log', |
| 27 | + dirname( __FILE__ ) . '/patches/WikiLoveImageLog.sql', true ) ); |
25 | 28 | } |
26 | 29 | return true; |
27 | 30 | } |
— | — | @@ -56,9 +59,8 @@ |
57 | 60 | |
58 | 61 | $title = self::getUserTalkPage( $skin->getTitle() ); |
59 | 62 | if ( !is_null( $title ) ) { |
60 | | - $out->addModules( 'ext.wikiLove.icon' ); |
61 | | - $out->addModules( 'ext.wikiLove.init' ); |
62 | | - self::$recipient = $title->getText(); |
| 63 | + $out->addModules( array( 'ext.wikiLove.icon', 'ext.wikiLove.init' ) ); |
| 64 | + self::$recipient = $title->getBaseText(); |
63 | 65 | } |
64 | 66 | return true; |
65 | 67 | } |
— | — | @@ -70,6 +72,12 @@ |
71 | 73 | global $wgUser; |
72 | 74 | $vars['wikilove-recipient'] = self::$recipient; |
73 | 75 | $vars['wikilove-edittoken'] = $wgUser->edittoken(); |
| 76 | + |
| 77 | + $vars['wikilove-anon'] = 0; |
| 78 | + if ( self::$recipient !== '' ) { |
| 79 | + $receiver = User::newFromName( self::$recipient ); |
| 80 | + if ( $receiver === false || $receiver->isAnon() ) $vars['wikilove-anon'] = 1; |
| 81 | + } |
74 | 82 | return true; |
75 | 83 | } |
76 | 84 | |
— | — | @@ -104,7 +112,9 @@ |
105 | 113 | */ |
106 | 114 | private static function skinConfigViewsLinks( $skin, &$views ) { |
107 | 115 | global $wgWikiLoveGlobal, $wgUser; |
108 | | - if ( !$wgWikiLoveGlobal && !$wgUser->getOption( 'wikilove-enabled' ) ) return true; |
| 116 | + if ( !$wgWikiLoveGlobal && !$wgUser->getOption( 'wikilove-enabled' ) ) { |
| 117 | + return true; |
| 118 | + } |
109 | 119 | |
110 | 120 | if ( !is_null( self::getUserTalkPage( $skin->getTitle() ) ) ) { |
111 | 121 | $views['wikilove'] = array( |
— | — | @@ -144,7 +154,9 @@ |
145 | 155 | |
146 | 156 | $ns = $title->getNamespace(); |
147 | 157 | // return quickly if we're in the wrong namespace anyway |
148 | | - if ( $ns != NS_USER && $ns != NS_USER_TALK ) return null; |
| 158 | + if ( $ns != NS_USER && $ns != NS_USER_TALK ) { |
| 159 | + return null; |
| 160 | + } |
149 | 161 | |
150 | 162 | $baseTitle = Title::newFromText( $title->getBaseText(), $ns ); |
151 | 163 | |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/sourcefiles/WikiLove-Icon-Source.psd |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: branches/wmf/1.17wmf1/extensions/WikiLove/sourcefiles/WikiLove-Icon-Source.psd |
___________________________________________________________________ |
Added: svn:mime-type |
152 | 164 | + application/octet-stream |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/patches/WikiLoveImageLog.sql |
— | — | @@ -0,0 +1,16 @@ |
| 2 | +-- |
| 3 | +-- WikiLove image logging schema |
| 4 | +-- Logs every time someone attempts to preview an award with a user-entered image title. |
| 5 | +-- This is mainly to see if people understand the idea of using images from Commons. |
| 6 | +-- |
| 7 | + |
| 8 | +CREATE TABLE IF NOT EXISTS /*_*/wikilove_image_log ( |
| 9 | + wlil_id int(11) NOT NULL PRIMARY KEY auto_increment, |
| 10 | + wlil_timestamp binary(14) NOT NULL, |
| 11 | + wlil_user_id int(11) NOT NULL, |
| 12 | + wlil_image varchar(128) NOT NULL, |
| 13 | + wlil_success bool NOT NULL |
| 14 | +) /*$wgDBTableOptions*/; |
| 15 | + |
| 16 | +CREATE INDEX /*i*/wlil_timestamp ON /*_*/wikilove_image_log (wlil_timestamp); |
| 17 | +CREATE INDEX /*i*/wlil_user_time ON /*_*/wikilove_image_log (wlil_user_id, wlil_timestamp); |
Property changes on: branches/wmf/1.17wmf1/extensions/WikiLove/patches/WikiLoveImageLog.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 18 | + native |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/WikiLove.local.php |
— | — | @@ -9,9 +9,8 @@ |
10 | 10 | ); |
11 | 11 | } |
12 | 12 | |
13 | | - public function getDependencies() { |
14 | | - return array( |
15 | | - 'ext.wikiLove.startup', |
16 | | - ); |
| 13 | + public function getMessages() { |
| 14 | + global $wgWikiLoveOptionMessages; |
| 15 | + return $wgWikiLoveOptionMessages; |
17 | 16 | } |
18 | 17 | } |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/modules/jquery.elastic/jquery.elastic.js |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | /** |
3 | 3 | * @name Elastic |
4 | 4 | * @descripton Elastic is jQuery plugin that grow and shrink your textareas automatically |
5 | | -* @version 1.6.5 |
| 5 | +* @version 1.6.10 |
6 | 6 | * @requires jQuery 1.2.6+ |
7 | 7 | * |
8 | 8 | * @author Jan Jarfalk |
— | — | @@ -29,22 +29,35 @@ |
30 | 30 | 'lineHeight', |
31 | 31 | 'fontFamily', |
32 | 32 | 'width', |
33 | | - 'fontWeight']; |
| 33 | + 'fontWeight', |
| 34 | + 'border-top-width', |
| 35 | + 'border-right-width', |
| 36 | + 'border-bottom-width', |
| 37 | + 'border-left-width', |
| 38 | + 'borderTopStyle', |
| 39 | + 'borderTopColor', |
| 40 | + 'borderRightStyle', |
| 41 | + 'borderRightColor', |
| 42 | + 'borderBottomStyle', |
| 43 | + 'borderBottomColor', |
| 44 | + 'borderLeftStyle', |
| 45 | + 'borderLeftColor' |
| 46 | + ]; |
34 | 47 | |
35 | 48 | return this.each( function() { |
36 | 49 | |
37 | 50 | // Elastic only works on textareas |
38 | | - if ( this.type != 'textarea' ) { |
| 51 | + if ( this.type !== 'textarea' ) { |
39 | 52 | return false; |
40 | 53 | } |
| 54 | + |
| 55 | + var $textarea = jQuery(this), |
| 56 | + $twin = jQuery('<div />').css({'position': 'absolute','display':'none','word-wrap':'break-word'}), |
| 57 | + lineHeight = parseInt($textarea.css('line-height'),10) || parseInt($textarea.css('font-size'),'10'), |
| 58 | + minheight = parseInt($textarea.css('height'),10) || lineHeight*3, |
| 59 | + maxheight = parseInt($textarea.css('max-height'),10) || Number.MAX_VALUE, |
| 60 | + goalheight = 0; |
41 | 61 | |
42 | | - var $textarea = jQuery(this), |
43 | | - $twin = jQuery('<div />').css({'position': 'absolute','display':'none','word-wrap':'break-word'}), |
44 | | - lineHeight = parseInt($textarea.css('line-height'),10) || parseInt($textarea.css('font-size'),'10'), |
45 | | - minheight = parseInt($textarea.css('height'),10) || lineHeight*3, |
46 | | - maxheight = parseInt($textarea.css('max-height'),10) || Number.MAX_VALUE, |
47 | | - goalheight = 0; |
48 | | - |
49 | 62 | // Opera returns max-height of -1 if not set |
50 | 63 | if (maxheight < 0) { maxheight = Number.MAX_VALUE; } |
51 | 64 | |
— | — | @@ -58,18 +71,32 @@ |
59 | 72 | $twin.css(mimics[i].toString(),$textarea.css(mimics[i].toString())); |
60 | 73 | } |
61 | 74 | |
| 75 | + // Updates the width of the twin. (solution for textareas with widths in percent) |
| 76 | + function setTwinWidth(){ |
| 77 | + curatedWidth = Math.floor(parseInt($textarea.width(),10)); |
| 78 | + if($twin.width() !== curatedWidth){ |
| 79 | + $twin.css({'width': curatedWidth + 'px'}); |
| 80 | + |
| 81 | + // Update height of textarea |
| 82 | + update(true); |
| 83 | + } |
| 84 | + } |
62 | 85 | |
63 | 86 | // Sets a given height and overflow state on the textarea |
64 | 87 | function setHeightAndOverflow(height, overflow){ |
| 88 | + |
65 | 89 | var curratedHeight = Math.floor(parseInt(height,10)); |
66 | | - if($textarea.height() != curratedHeight){ |
| 90 | + if($textarea.height() !== curratedHeight){ |
67 | 91 | $textarea.css({'height': curratedHeight + 'px','overflow':overflow}); |
| 92 | + |
| 93 | + // Fire the custom event resize |
| 94 | + //$textarea.trigger('resize'); |
| 95 | + |
68 | 96 | } |
69 | 97 | } |
70 | 98 | |
71 | | - |
72 | 99 | // This function will update the height of the textarea if necessary |
73 | | - function update() { |
| 100 | + function update(forced) { |
74 | 101 | |
75 | 102 | // Get curated content from the textarea. |
76 | 103 | var textareaContent = $textarea.val().replace(/&/g,'&').replace(/ {2}/g, ' ').replace(/<|>/g, '>').replace(/\n/g, '<br />'); |
— | — | @@ -77,7 +104,7 @@ |
78 | 105 | // Compare curated content with curated twin. |
79 | 106 | var twinContent = $twin.html().replace(/<br>/ig,'<br />'); |
80 | 107 | |
81 | | - if(textareaContent+' ' != twinContent){ |
| 108 | + if(forced || textareaContent+' ' !== twinContent){ |
82 | 109 | |
83 | 110 | // Add an extra white space so new rows are added when you are at the end of a row. |
84 | 111 | $twin.html(textareaContent+' '); |
— | — | @@ -108,8 +135,12 @@ |
109 | 136 | update(); |
110 | 137 | }); |
111 | 138 | |
| 139 | + // Update width of twin if browser or textarea is resized (solution for textareas with widths in percent) |
| 140 | + $(window).bind('resize', setTwinWidth); |
| 141 | + $textarea.bind('resize', setTwinWidth); |
| 142 | + $textarea.bind('update', update); |
| 143 | + |
112 | 144 | // Compact textarea on blur |
113 | | - // Lets animate this.... |
114 | 145 | $textarea.bind('blur',function(){ |
115 | 146 | if($twin.height() < maxheight){ |
116 | 147 | if($twin.height() > minheight) { |
— | — | @@ -121,7 +152,7 @@ |
122 | 153 | }); |
123 | 154 | |
124 | 155 | // And this line is to catch the browser paste event |
125 | | - $textarea.live('input paste',function(e){ setTimeout( update, 250); }); |
| 156 | + $textarea.bind('input paste',function(e){ setTimeout( update, 250); }); |
126 | 157 | |
127 | 158 | // Run update once when elastic is initialized |
128 | 159 | update(); |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.css |
— | — | @@ -1,3 +1,7 @@ |
| 2 | +.ui-widget-overlay { |
| 3 | + min-height: 750px; |
| 4 | +} |
| 5 | + |
2 | 6 | /* dialog */ |
3 | 7 | #mw-wikilove-dialog { |
4 | 8 | margin: 10px; |
— | — | @@ -3,4 +7,9 @@ |
4 | 8 | } |
5 | 9 | |
| 10 | +#mw-wikilove-preview-form { |
| 11 | + position: relative; |
| 12 | + clear: both; /* for monobook skin */ |
| 13 | +} |
| 14 | + |
6 | 15 | /* dialog type selection */ |
7 | 16 | /*#mw-wikilove-dialog*/ #mw-wikilove-select-type { |
— | — | @@ -202,7 +211,7 @@ |
203 | 212 | } |
204 | 213 | |
205 | 214 | /*#mw-wikilove-dialog #mw-wikilove-add-details*/ #mw-wikilove-subtype-description { |
206 | | - margin: 5px 0px 8px 15px; |
| 215 | + margin: 5px 85px 8px 15px; |
207 | 216 | font-size: 1.0em; |
208 | 217 | line-height: 1.2em; |
209 | 218 | } |
— | — | @@ -210,7 +219,6 @@ |
211 | 220 | /*#mw-wikilove-dialog*/ #mw-wikilove-add-details .mw-wikilove-note { |
212 | 221 | font-weight: light; |
213 | 222 | font-size: 0.9em; |
214 | | - float: right; |
215 | 223 | color: #999; |
216 | 224 | } |
217 | 225 | |
— | — | @@ -218,6 +226,10 @@ |
219 | 227 | resize: none; |
220 | 228 | } |
221 | 229 | |
| 230 | +/*#mw-wikilove-dialog*/ #mw-wikilove-commons-text { |
| 231 | + margin: 5px 0px 5px 15px; |
| 232 | +} |
| 233 | + |
222 | 234 | /* add details gallery */ |
223 | 235 | /*#mw-wikilove-dialog*/ #mw-wikilove-gallery { |
224 | 236 | min-height: 40px; |
— | — | @@ -336,3 +348,25 @@ |
337 | 349 | padding-left: 34px; |
338 | 350 | padding-bottom: 3px; |
339 | 351 | } |
| 352 | + |
| 353 | +#mw-wikilove-dialog #mw-wikilove-image-preview { |
| 354 | + position: absolute; |
| 355 | + top: 1em; |
| 356 | + right: 0; |
| 357 | + width: 75px; |
| 358 | + height: 68px; |
| 359 | +} |
| 360 | + |
| 361 | +#mw-wikilove-dialog #mw-wikilove-image-preview-content { |
| 362 | + text-align: center; |
| 363 | +} |
| 364 | + |
| 365 | +#mw-wikilove-dialog #mw-wikilove-image-preview-spinner { |
| 366 | + float: none; |
| 367 | + margin-left:auto; |
| 368 | + margin-right:auto; |
| 369 | +} |
| 370 | + |
| 371 | +#mw-wikilove-dialog a { |
| 372 | + color: #0645AD; |
| 373 | +} |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | ( function( $ ) { |
3 | | -$.wikiLove.optionsHook = function() { return { |
| 3 | +$.wikiLoveOptions = { |
4 | 4 | defaultText: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
5 | | -|rowspan="2" style="vertical-align: middle; padding: 5px;" | [[File:$3|$4]]\n\ |
| 5 | +|rowspan="2" style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
6 | 6 | |style="font-size: x-large; padding: 3px; height: 1.5em;" | \'\'\'$2\'\'\'\n\ |
7 | 7 | |-\n\ |
8 | 8 | |style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
— | — | @@ -9,293 +9,356 @@ |
10 | 10 | defaultBackgroundColor: '#fdffe7', |
11 | 11 | defaultBorderColor: '#fceb92', |
12 | 12 | defaultImageSize: '100px', |
13 | | - defaultImage: 'Emblem-fun.svg', |
| 13 | + defaultImage: 'Trophy.png', |
14 | 14 | |
15 | 15 | types: { |
16 | 16 | // example type, could be removed later (also no i18n) |
17 | 17 | 'barnstar': { |
18 | | - name: 'Barnstar', // name of the type (appears in the types menu) |
| 18 | + name: 'Barnstars', // name of the type (appears in the types menu) |
19 | 19 | select: 'Select a barnstar:', // subtype select label |
20 | 20 | subtypes: { // some different subtypes |
21 | 21 | // note that when not using subtypes you should use these subtype options |
22 | 22 | // for the top-level type |
23 | 23 | 'original': { |
24 | | - fields: [ 'notify' ], // fields to ask for in form |
| 24 | + fields: [ 'message' ], // fields to ask for in form |
25 | 25 | option: 'Original Barnstar', // option listed in the select list |
26 | 26 | descr: 'This barnstar is given to recognize particularly fine contributions to Wikipedia, to let people know that their hard work is seen and appreciated.', // description |
27 | 27 | header: 'A barnstar for you!', // header that appears at the top of the talk page post (optional) |
28 | 28 | title: 'The Original Barnstar', // title that appears inside the award box (optional) |
29 | | - image: 'Original Barnstar Hires.png', // image for the award |
30 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' // message to use in eemail notification; $7 is replaced by the recipient's username |
| 29 | + image: 'Original Barnstar Hires.png' // image for the award |
31 | 30 | }, |
32 | 31 | 'admins': { |
33 | | - fields: [ 'notify' ], |
| 32 | + fields: [ 'message' ], |
34 | 33 | option: 'Admin\'s Barnstar', |
35 | 34 | descr: 'The Admin\'s Barnstar may be awarded to an administrator who made a particularly difficult decision or performed a tedious but needed admin task.', |
36 | 35 | header: 'A barnstar for you!', |
37 | 36 | title: 'The Admin\'s Barnstar', |
38 | | - image: 'Administrator Barnstar Hires.png', |
39 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 37 | + image: 'Administrator Barnstar Hires.png' |
40 | 38 | }, |
41 | 39 | 'antivandalism': { |
42 | | - fields: [ 'notify' ], |
| 40 | + fields: [ 'message' ], |
43 | 41 | option: 'Anti-Vandalism Barnstar', |
44 | 42 | descr: 'The Anti-Vandalism Barnstar may be awarded to those who show great contributions to protecting and reverting attacks of vandalism on Wikipedia.', |
45 | 43 | header: 'A barnstar for you!', |
46 | 44 | title: 'The Anti-Vandalism Barnstar', |
47 | | - image: 'Barnstar of Reversion Hires.png', |
48 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 45 | + image: 'Barnstar of Reversion Hires.png' |
49 | 46 | }, |
50 | 47 | 'diligence': { |
51 | | - fields: [ 'notify' ], |
| 48 | + fields: [ 'message' ], |
52 | 49 | option: 'Barnstar of Diligence', |
53 | 50 | descr: 'The Barnstar of Diligence may be awarded in recognition of a combination of extraordinary scrutiny, precision and community service.', |
54 | 51 | header: 'A barnstar for you!', |
55 | 52 | title: 'The Barnstar of Diligence', |
56 | | - image: 'Barnstar of Diligence Hires.png', |
57 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 53 | + image: 'Barnstar of Diligence Hires.png' |
58 | 54 | }, |
59 | 55 | 'diplomacy': { |
60 | | - fields: [ 'notify' ], |
| 56 | + fields: [ 'message' ], |
61 | 57 | option: 'Barnstar of Diplomacy', |
62 | 58 | descr: 'The Barnstar of Diplomacy is awarded to users who have helped to resolve, peacefully, conflicts on Wikipedia.', |
63 | 59 | header: 'A barnstar for you!', |
64 | 60 | title: 'The Barnstar of Diplomacy', |
65 | | - image: 'Peace Barnstar Hires.png', |
66 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 61 | + image: 'Peace Barnstar Hires.png' |
67 | 62 | }, |
68 | 63 | 'goodhumor': { |
69 | | - fields: [ 'notify' ], |
| 64 | + fields: [ 'message' ], |
70 | 65 | option: 'Barnstar of Good Humor', |
71 | 66 | descr: 'The Barnstar of Good Humor may be awarded to Wikipedians who consistently lighten the mood, defuse conflicts, and make Wikipedia a better place to be.', |
72 | 67 | header: 'A barnstar for you!', |
73 | 68 | title: 'The Barnstar of Good Humor', |
74 | | - image: 'Barnstar of Reversion Hires.png', |
75 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 69 | + image: 'Barnstar of Humour Hires.png' |
76 | 70 | }, |
77 | 71 | 'brilliant': { |
78 | | - fields: [ 'notify' ], |
| 72 | + fields: [ 'message' ], |
79 | 73 | option: 'Brilliant Idea Barnstar', |
80 | 74 | descr: 'The Brilliant Idea Barnstar may be awarded to a user who figures out an elegant solution to a particularly difficult problem.', |
81 | 75 | header: 'A barnstar for you!', |
82 | 76 | title: 'The Brilliant Idea Barnstar', |
83 | | - image: 'Brilliant Idea Barnstar Hires.png', |
84 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 77 | + image: 'Brilliant Idea Barnstar Hires.png' |
85 | 78 | }, |
86 | 79 | 'citation': { |
87 | | - fields: [ 'notify' ], |
| 80 | + fields: [ 'message' ], |
88 | 81 | option: 'Citation Barnstar', |
89 | 82 | descr: 'The Citation Barnstar is awarded to users who provide references and in-line citations to previously unsourced articles.', |
90 | 83 | header: 'A barnstar for you!', |
91 | 84 | title: 'The Citation Barnstar', |
92 | | - image: 'Citation Barnstar Hires.png', |
93 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 85 | + image: 'Citation Barnstar Hires.png' |
94 | 86 | }, |
95 | 87 | 'civility': { |
96 | | - fields: [ 'notify' ], |
| 88 | + fields: [ 'message' ], |
97 | 89 | option: 'Civility Barnstar', |
98 | 90 | descr: 'The Civility Barnstar may be awarded to any user who excels at maintaining civility in the midst of contentious situations.', |
99 | 91 | header: 'A barnstar for you!', |
100 | 92 | title: 'The Civility Barnstar', |
101 | | - image: 'Civility Barnstar Hires.png', |
102 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 93 | + image: 'Civility Barnstar Hires.png' |
103 | 94 | }, |
104 | 95 | 'copyeditor': { |
105 | | - fields: [ 'notify' ], |
| 96 | + fields: [ 'message' ], |
106 | 97 | option: 'Copyeditor\'s Barnstar', |
107 | 98 | descr: 'The Copyeditor\'s Barnstar is awarded for excellence in correcting spelling, grammar, punctuation, and style issues.', |
108 | 99 | header: 'A barnstar for you!', |
109 | 100 | title: 'The Copyeditor\'s Barnstar', |
110 | | - image: 'Copyeditor Barnstar Hires.png', |
111 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 101 | + image: 'Copyeditor Barnstar Hires.png' |
112 | 102 | }, |
113 | 103 | 'defender': { |
114 | | - fields: [ 'notify' ], |
| 104 | + fields: [ 'message' ], |
115 | 105 | option: 'Defender of the Wiki Barnstar', |
116 | 106 | descr: 'The Defender of the Wiki may be awarded to those who have gone above and beyond to prevent Wikipedia from being used for fraudulent purposes.', |
117 | 107 | header: 'A barnstar for you!', |
118 | 108 | title: 'The Defender of the Wiki Barnstar', |
119 | | - image: 'WikiDefender Barnstar Hires.png', |
120 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 109 | + image: 'WikiDefender Barnstar Hires.png' |
121 | 110 | }, |
122 | 111 | 'editors': { |
123 | | - fields: [ 'notify' ], |
| 112 | + fields: [ 'message' ], |
124 | 113 | option: 'Editor\'s Barnstar', |
125 | 114 | descr: 'The Editor\'s Barnstar is awarded to individuals who display particularly fine decisions in general editing.', |
126 | 115 | header: 'A barnstar for you!', |
127 | 116 | title: 'The Editor\'s Barnstar', |
128 | | - image: 'Editors Barnstar Hires.png', |
129 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 117 | + image: 'Editors Barnstar Hires.png' |
130 | 118 | }, |
131 | 119 | 'designers': { |
132 | | - fields: [ 'notify' ], |
| 120 | + fields: [ 'message' ], |
133 | 121 | option: 'Graphic Designer\'s Barnstar', |
134 | 122 | descr: 'The Graphic Designer\'s Barnstar may be awarded to those who work tirelessly to provide Wikipedia with free, high-quality graphics.', |
135 | 123 | header: 'A barnstar for you!', |
136 | 124 | title: 'The Graphic Designer\'s Barnstar', |
137 | | - image: 'Rosetta Barnstar Hires.png', |
138 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 125 | + image: 'Rosetta Barnstar Hires.png' |
139 | 126 | }, |
140 | 127 | 'half': { |
141 | | - fields: [ 'notify' ], |
| 128 | + fields: [ 'message' ], |
142 | 129 | option: 'Half Barnstar', |
143 | 130 | descr: 'The Half Barnstar is awarded for excellence in cooperation, especially for productive editing with someone who holds an opposing viewpoint.', |
144 | 131 | header: 'A barnstar for you!', |
145 | 132 | title: 'The Half Barnstar', |
146 | | - image: 'Halfstar Hires.png', |
147 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 133 | + image: 'Halfstar Hires.png' |
148 | 134 | }, |
149 | 135 | 'minor': { |
150 | | - fields: [ 'notify' ], |
| 136 | + fields: [ 'message' ], |
151 | 137 | option: 'Minor Barnstar', |
152 | 138 | descr: 'Minor edits are often overlooked, but are essential contributions to Wikipedia. The Minor Barnstar is awarded for making minor edits of the utmost quality.', |
153 | 139 | header: 'A barnstar for you!', |
154 | 140 | title: 'The Minor barnstar', |
155 | | - image: 'Minor Barnstar Hires.png', |
156 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 141 | + image: 'Minor Barnstar Hires.png' |
157 | 142 | }, |
158 | 143 | 'antispam': { |
159 | | - fields: [ 'notify' ], |
| 144 | + fields: [ 'message' ], |
160 | 145 | option: 'No Spam Barnstar', |
161 | 146 | descr: 'The Anti-Spam Barnstar is awarded to users who do an exceptional job fighting against spam on Wikipedia.', |
162 | 147 | header: 'A barnstar for you!', |
163 | 148 | title: 'The No Spam Barnstar', |
164 | | - image: 'No Spam Barnstar Hires.png', |
165 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 149 | + image: 'No Spam Barnstar Hires.png' |
166 | 150 | }, |
167 | 151 | 'photographers': { |
168 | | - fields: [ 'notify' ], |
| 152 | + fields: [ 'message' ], |
169 | 153 | option: 'Photographer\'s Barnstar', |
170 | 154 | descr: 'The Photographer\'s Barnstar is awarded to those individuals who tirelessly improve the Wikipedia with their photographic skills and contributions.', |
171 | 155 | header: 'A barnstar for you!', |
172 | 156 | title: 'The Photographer\'s Barnstar', |
173 | | - image: 'Camera Barnstar Hires.png', |
174 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 157 | + image: 'Camera Barnstar Hires.png' |
175 | 158 | }, |
176 | 159 | 'kindness': { |
177 | | - fields: [ 'notify' ], |
| 160 | + fields: [ 'message' ], |
178 | 161 | option: 'Random Acts of Kindness Barnstar', |
179 | 162 | descr: 'The Random Acts of Kindness Barnstar may be awarded to those that show a pattern of going the extra mile to be nice, without being asked.', |
180 | 163 | header: 'A barnstar for you!', |
181 | | - title: 'The Random Acts of Kindness barnstar', |
182 | | - image: 'Kindness Barnstar Hires.png', |
183 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 164 | + title: 'The Random Acts of Kindness Barnstar', |
| 165 | + image: 'Kindness Barnstar Hires.png' |
184 | 166 | }, |
185 | 167 | 'reallife': { |
186 | | - fields: [ 'notify' ], |
| 168 | + fields: [ 'message' ], |
187 | 169 | option: 'Real Life Barnstar', |
188 | 170 | descr: 'The Real Life Barnstar is awarded to editors who make contributions both online and offline, by organizing wiki-related real-life events.', |
189 | 171 | header: 'A barnstar for you!', |
190 | 172 | title: 'The Real Life Barnstar', |
191 | | - image: 'Real Life Barnstar.jpg', |
192 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 173 | + image: 'Real Life Barnstar.jpg' |
193 | 174 | }, |
194 | 175 | 'resilient': { |
195 | | - fields: [ 'notify' ], |
| 176 | + fields: [ 'message' ], |
196 | 177 | option: 'Resilient Barnstar', |
197 | 178 | descr: 'The Resilient Barnstar may be given to any editor who learns and improves from criticisms, never letting mistakes impede their growth as a Wikipedian.', |
198 | 179 | header: 'A barnstar for you!', |
199 | 180 | title: 'The Resilient Barnstar', |
200 | | - image: 'Resilient Barnstar Hires.png', |
201 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 181 | + image: 'Resilient Barnstar Hires.png' |
202 | 182 | }, |
203 | 183 | 'rosetta': { |
204 | | - fields: [ 'notify' ], |
| 184 | + fields: [ 'message' ], |
205 | 185 | option: 'Rosetta Barnstar', |
206 | 186 | descr: 'The Rosetta Barnstar may be given to any editor who exhibits outstanding translation efforts on Wikipedia.', |
207 | 187 | header: 'A barnstar for you!', |
208 | 188 | title: 'The Rosetta Barnstar', |
209 | | - image: 'Rosetta Barnstar Hires.png', |
210 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 189 | + image: 'Rosetta Barnstar Hires.png' |
211 | 190 | }, |
212 | 191 | 'special': { |
213 | | - fields: [ 'notify' ], |
| 192 | + fields: [ 'message' ], |
214 | 193 | option: 'Special Barnstar', |
215 | 194 | descr: 'The Special Barnstar may be awarded to a user as a gesture of appreciation when there is no other barnstar which would be appropriate.', |
216 | 195 | header: 'A barnstar for you!', |
217 | 196 | title: 'The Special Barnstar', |
218 | | - image: 'Special Barnstar Hires.png', |
219 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 197 | + image: 'Special Barnstar Hires.png' |
220 | 198 | }, |
221 | 199 | 'surreal': { |
222 | | - fields: [ 'notify' ], |
| 200 | + fields: [ 'message' ], |
223 | 201 | option: 'Surreal Barnstar', |
224 | 202 | descr: 'The Surreal Barnstar may be awarded to any Wikipedian who adds "special flavor" to the community by acting as a sort of wildcard.', |
225 | 203 | header: 'A barnstar for you!', |
226 | 204 | title: 'The Surreal Barnstar', |
227 | | - image: 'Surreal Barnstar Hires.png', |
228 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 205 | + image: 'Surreal Barnstar Hires.png' |
229 | 206 | }, |
230 | 207 | 'teamwork': { |
231 | | - fields: [ 'notify' ], |
| 208 | + fields: [ 'message' ], |
232 | 209 | option: 'Teamwork Barnstar', |
233 | 210 | descr: 'The Teamwork Barnstar may be awarded when several editors work together to improve an article.', |
234 | 211 | header: 'A barnstar for you!', |
235 | 212 | title: 'The Teamwork Barnstar', |
236 | | - image: 'Team Barnstar Hires.png', |
237 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 213 | + image: 'Team Barnstar Hires.png' |
238 | 214 | }, |
239 | 215 | 'technical': { |
240 | | - fields: [ 'notify' ], |
| 216 | + fields: [ 'message' ], |
241 | 217 | option: 'Technical Barnstar', |
242 | 218 | descr: 'The Technical Barnstar may be awarded to anyone who has enhanced Wikipedia through their technical work (programming, bot building, link repair, etc.).', |
243 | 219 | header: 'A barnstar for you!', |
244 | 220 | title: 'The Technical Barnstar', |
245 | | - image: 'Vitruvian Barnstar Hires.png', |
246 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 221 | + image: 'Vitruvian Barnstar Hires.png' |
247 | 222 | }, |
248 | 223 | 'tireless': { |
249 | | - fields: [ 'notify' ], |
| 224 | + fields: [ 'message' ], |
250 | 225 | option: 'Tireless Contributor Barnstar', |
251 | 226 | descr: 'The Tireless Contributor Barnstar is awarded to especially tireless Wikipedians who contribute an especially large body of work without sacrificing quality.', |
252 | 227 | header: 'A barnstar for you!', |
253 | 228 | title: 'The Tireless Contributor Barnstar', |
254 | | - image: 'Tireless Contributor Barnstar Hires.gif', |
255 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 229 | + image: 'Tireless Contributor Barnstar Hires.gif' |
256 | 230 | }, |
257 | 231 | 'writers': { |
258 | | - fields: [ 'notify' ], |
| 232 | + fields: [ 'message' ], |
259 | 233 | option: 'Writer\'s Barnstar', |
260 | 234 | descr: 'The Writer\'s Barnstar may be awarded to any user who has written a large number of articles or has contributed a large number of edits.', |
261 | 235 | header: 'A barnstar for you!', |
262 | 236 | title: 'The Writer\'s Barnstar', |
263 | | - image: 'Writers Barnstar Hires.png', |
264 | | - email: 'Hello $7!\n\nI just awarded you a barnstar.' |
| 237 | + image: 'Writers Barnstar Hires.png' |
265 | 238 | } |
266 | 239 | }, |
267 | 240 | icon: mw.config.get( 'wgExtensionAssetsPath' ) + '/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-barnstar.png' // icon for left-side menu |
268 | 241 | }, |
269 | | - 'beer': { |
270 | | - name: 'Beer', |
271 | | - fields: [ 'header' ], |
272 | | - header: 'A beer for you!', |
273 | | - text: '[[$3|left|150px]]\n$1\n\n~~~~\n<br style="clear: both"/>', // custom text |
274 | | - gallery: { |
275 | | - imageList: [ 'Cruzcampo.jpg', 'Glass_of_la_trappe_quadrupel.jpg', 'Hefeweizen.jpg', 'Krušovice_Mušketýr_in_glass.JPG', 'NCI_Visuals_Food_Beer.jpg', 'PintJug.jpg' ], |
276 | | - width: 145, |
277 | | - number: 3 |
| 242 | + 'food': { |
| 243 | + name: 'Food and drink', // name of the type (appears in the types menu) |
| 244 | + select: 'Select food or drink item:', // subtype select label |
| 245 | + text: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
| 246 | +|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
| 247 | +|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
| 248 | +|}', // custom text |
| 249 | + subtypes: { // some different subtypes |
| 250 | + // note that when not using subtypes you should use these subtype options |
| 251 | + // for the top-level type |
| 252 | + 'baklava': { |
| 253 | + fields: [ 'header', 'message' ], // fields to ask for in form |
| 254 | + option: 'Baklava', // option listed in the select list |
| 255 | + descr: 'Baklava is a rich, sweet pastry made of layers of filo pastry filled with chopped nuts and sweetened with syrup or honey.', |
| 256 | + header: 'Some baklava for you!', // header that appears at the top of the talk page post (optional) |
| 257 | + image: 'Baklava - Turkish special, 80-ply.JPEG', // image for the award |
| 258 | + imageSize: '135px' // size to display image |
| 259 | + }, |
| 260 | + 'beer': { |
| 261 | + fields: [ 'header', 'message' ], |
| 262 | + option: 'Beer', |
| 263 | + descr: 'Beer is the world\'s most widely consumed and probably oldest alcoholic beverage. It is the third most popular drink after water and tea.', |
| 264 | + header: 'A beer for you!', |
| 265 | + image: 'Export hell seidel steiner.png', |
| 266 | + imageSize: '70px' |
| 267 | + }, |
| 268 | + 'brownie': { |
| 269 | + fields: [ 'header', 'message' ], |
| 270 | + option: 'Brownie', |
| 271 | + descr: 'A brownie is a flat, baked square or bar made of dense, rich chocolate cake.', |
| 272 | + header: 'A brownie for you!', |
| 273 | + image: 'Brownie transparent.png', |
| 274 | + imageSize: '120px' |
| 275 | + }, |
| 276 | + 'bubble tea': { |
| 277 | + fields: [ 'header', 'message' ], |
| 278 | + option: 'Bubble tea', |
| 279 | + descr: 'Bubble tea is a tea or juice beverage containing small chewy balls made of tapioca starch or jelly. First invented in Taiwan, it is now popular in many areas of the world.', |
| 280 | + header: 'Some bubble tea for you!', |
| 281 | + image: 'Bubble_Tea.png', |
| 282 | + imageSize: '65px' |
| 283 | + }, |
| 284 | + 'cheeseburger': { |
| 285 | + fields: [ 'header', 'message' ], |
| 286 | + option: 'Cheeseburger', |
| 287 | + descr: 'A staple of diners and fast-food restaurants, cheeseburgers were first popularized in the United States during the 1920s and 30s.', |
| 288 | + header: 'A cheeseburger for you!', |
| 289 | + image: 'Cheeseburger.png', |
| 290 | + imageSize: '120px' |
| 291 | + }, |
| 292 | + 'cookie': { |
| 293 | + fields: [ 'header', 'message' ], |
| 294 | + option: 'Cookie', |
| 295 | + descr: 'Cookies (known as biscuits in the UK) come in a wide array of flavors, shapes, and sizes.', |
| 296 | + header: 'A cookie for you!', |
| 297 | + image: 'Choco_chip_cookie.png', |
| 298 | + imageSize: '120px' |
| 299 | + }, |
| 300 | + 'coffee': { |
| 301 | + fields: [ 'header', 'message' ], |
| 302 | + option: 'Cup of coffee', |
| 303 | + descr: 'Appreciated the world over, coffee is known for its energizing effect on people.', |
| 304 | + header: 'A cup of coffee for you!', |
| 305 | + image: 'A small cup of coffee.JPG', |
| 306 | + imageSize: '120px' |
| 307 | + }, |
| 308 | + 'tea': { |
| 309 | + fields: [ 'header', 'message' ], |
| 310 | + option: 'Cup of tea', |
| 311 | + descr: 'After water, tea is the most widely consumed beverage in the world. It can be enjoyed hot or cold, with milk or sugar.', |
| 312 | + header: 'A cup of tea for you!', |
| 313 | + image: 'Meissen-teacup pinkrose01.jpg', |
| 314 | + imageSize: '120px' |
| 315 | + }, |
| 316 | + 'cupcake': { |
| 317 | + fields: [ 'header', 'message' ], |
| 318 | + option: 'Cupcake', |
| 319 | + descr: 'A cupcake is a small cake designed to serve one person. They are often served with frosting and sprikles on top.', |
| 320 | + header: 'A cupcake for you!', |
| 321 | + image: 'Choco-Nut Bake with Meringue Top cropped.jpg', |
| 322 | + imageSize: '120px' |
| 323 | + }, |
| 324 | + 'pie': { |
| 325 | + fields: [ 'header', 'message' ], |
| 326 | + option: 'Pie', |
| 327 | + descr: 'Pies can be filled with a wide variety of sweet or savoury ingredients.', |
| 328 | + header: 'A pie for you!', |
| 329 | + image: 'A very beautiful Nectarine Pie.jpg', |
| 330 | + imageSize: '120px' |
| 331 | + }, |
| 332 | + 'stroopwafels': { |
| 333 | + fields: [ 'header', 'message' ], |
| 334 | + option: 'Stroopwafels', |
| 335 | + descr: 'A stroopwafel is a Dutch snack made from two thin layers of baked batter with a caramel-like syrup filling in the middle.', |
| 336 | + header: 'Some stroopwafels for you!', |
| 337 | + image: 'Gaufre biscuit.jpg', |
| 338 | + imageSize: '135px' |
| 339 | + } |
278 | 340 | }, |
279 | | - icon: mw.config.get( 'wgExtensionAssetsPath' ) + '/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-beer.png' // icon for left-side menu |
| 341 | + icon: mw.config.get( 'wgExtensionAssetsPath' ) + '/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-food.png' |
280 | 342 | }, |
281 | 343 | 'kitten': { |
282 | | - name: 'Kitten', |
283 | | - fields: [ 'header' ], |
| 344 | + name: 'Kittens', |
| 345 | + fields: [ 'header', 'message' ], |
284 | 346 | header: 'A kitten for you!', |
285 | 347 | text: '[[$3|left|150px]]\n$1\n\n~~~~\n<br style="clear: both"/>', // $3 is the image filename |
286 | 348 | gallery: { |
287 | | - imageList: [ 'Cucciolo gatto Bibo.jpg','Kitten (06) by Ron.jpg','Kitten-stare.jpg', 'Cat03.jpg', 'Kot_Leon.JPG', 'Greycat.jpg' ], |
| 349 | + imageList: [ 'Cucciolo gatto Bibo.jpg', 'Kitten (06) by Ron.jpg', 'Kitten-stare.jpg', 'Red Kitten 01.jpg', 'Kitten in a helmet.jpg', 'Cute grey kitten.jpg' ], |
288 | 350 | width: 145, |
| 351 | + height: 150, |
289 | 352 | number: 3 |
290 | 353 | }, |
291 | | - icon: mw.config.get( 'wgExtensionAssetsPath' ) + '/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-kitten.png' // icon for left-side menu |
| 354 | + icon: mw.config.get( 'wgExtensionAssetsPath' ) + '/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-kitten.png' |
292 | 355 | }, |
293 | 356 | // default type, nice to leave this one in place when adding other types |
294 | 357 | 'makeyourown': { |
295 | 358 | name: mw.msg( 'wikilove-type-makeyourown' ), |
296 | | - fields: [ 'header', 'title', 'image', 'notify' ], |
297 | | - imageSize: '150px', |
298 | | - icon: mw.config.get( 'wgExtensionAssetsPath' ) + '/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-create.png' // icon for left-side menu |
| 359 | + fields: [ 'header', 'title', 'image', 'message' ], |
| 360 | + icon: mw.config.get( 'wgExtensionAssetsPath' ) + '/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-create.png' |
299 | 361 | } |
300 | 362 | } |
301 | | -}; }; |
| 363 | +}; |
| 364 | + |
302 | 365 | } )( jQuery ); |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.init.js |
— | — | @@ -1,3 +1 @@ |
2 | | -( function( $ ) { |
3 | | -$( document ).ready( $.wikiLove.init ); |
4 | | -} )( jQuery ); |
| 2 | +mw.loader.using( 'ext.wikiLove.local', jQuery.wikiLove.init ); |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/modules/ext.wikiLove/images/heart-icons.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/modules/ext.wikiLove/images/heart.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/modules/ext.wikiLove/images/heart-hover.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/modules/ext.wikiLove/images/heart-icons-blue.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: branches/wmf/1.17wmf1/extensions/WikiLove/modules/ext.wikiLove/images/heart-icons-blue.png |
___________________________________________________________________ |
Added: svn:mime-type |
5 | 3 | + image/png |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/modules/ext.wikiLove/images/heart-icons-red.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: branches/wmf/1.17wmf1/extensions/WikiLove/modules/ext.wikiLove/images/heart-icons-red.png |
___________________________________________________________________ |
Added: svn:mime-type |
6 | 4 | + image/png |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-food.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: branches/wmf/1.17wmf1/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-food.png |
___________________________________________________________________ |
Added: svn:mime-type |
7 | 5 | + application/octet-stream |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.icon.css |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | height: 0; |
33 | 33 | overflow: hidden; |
34 | 34 | /* @embed */ |
35 | | - background-image: url(images/heart-icons.png); |
| 35 | + background-image: url(images/heart-icons-red.png); |
36 | 36 | } |
37 | 37 | #ca-wikilove.icon a { |
38 | 38 | background-position: 5px 60%; |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js |
— | — | @@ -1,18 +1,15 @@ |
2 | 2 | ( function( $ ) { |
3 | | -$.wikiLove = (function(){ |
4 | 3 | |
5 | 4 | var options = {}, // options modifiable by the user |
6 | 5 | $dialog = null, // dialog jQuery object |
7 | 6 | currentTypeId = null, // id of the currently selected type (e.g. 'barnstar' or 'makeyourown') |
8 | 7 | currentSubtypeId = null, // id of the currently selected subtype (e.g. 'original' or 'special') |
9 | 8 | currentTypeOrSubtype = null, // content of the current (sub)type (i.e. an object with title, descr, text, etc.) |
10 | | - previewData = null, // data of the currently previewed thing is set here |
| 9 | + rememberData = null, // input data to remember when switching types or subtypes |
11 | 10 | emailable = false, |
12 | 11 | gallery = {}; |
13 | | - |
14 | | -return { |
15 | | - optionsHook: function() { return {}; }, // hook that can be overridden by the user to modify options |
16 | | - |
| 12 | + |
| 13 | +$.wikiLove = { |
17 | 14 | /* |
18 | 15 | * Opens the dialog and builds it if necessary. |
19 | 16 | */ |
— | — | @@ -58,15 +55,23 @@ |
59 | 56 | <li><html:msg key="wikilove-get-started-list-2"/></li>\ |
60 | 57 | <li><html:msg key="wikilove-get-started-list-3"/></li>\ |
61 | 58 | </ol>\ |
| 59 | + <p><a target="_blank" href="http://www.mediawiki.org/wiki/WikiLove">\ |
| 60 | + <html:msg key="wikilove-what-is-this"/>\ |
| 61 | + </a></p>\ |
| 62 | + <p id="mw-wikilove-anon-warning"><strong><html:msg key="wikilove-anon-warning"/></strong></p>\ |
62 | 63 | </div>\ |
63 | 64 | <div id="mw-wikilove-add-details">\ |
64 | 65 | <span class="mw-wikilove-number">2</span>\ |
65 | 66 | <h3><html:msg key="wikilove-add-details"/></h3>\ |
66 | 67 | <form id="mw-wikilove-preview-form">\ |
| 68 | + <div id="mw-wikilove-image-preview">\ |
| 69 | + <div id="mw-wikilove-image-preview-spinner" class="mw-wikilove-spinner"></div>\ |
| 70 | + <div id="mw-wikilove-image-preview-content"></div>\ |
| 71 | + </div>\ |
67 | 72 | <label for="mw-wikilove-subtype" id="mw-wikilove-subtype-label"></label>\ |
68 | 73 | <select id="mw-wikilove-subtype"></select>\ |
69 | 74 | <div id="mw-wikilove-subtype-description"></div>\ |
70 | | - <label id="mw-wikilove-gallery-label"><html:msg key="wikilove-image"/></label>\ |
| 75 | + <label id="mw-wikilove-gallery-label"><html:msg key="wikilove-select-image"/></label>\ |
71 | 76 | <div id="mw-wikilove-gallery">\ |
72 | 77 | <div id="mw-wikilove-gallery-error">\ |
73 | 78 | <html:msg key="wikilove-err-gallery"/>\ |
— | — | @@ -80,9 +85,13 @@ |
81 | 86 | <label for="mw-wikilove-title" id="mw-wikilove-title-label"><html:msg key="wikilove-title"/></label>\ |
82 | 87 | <input type="text" class="text" id="mw-wikilove-title"/>\ |
83 | 88 | <label for="mw-wikilove-image" id="mw-wikilove-image-label"><html:msg key="wikilove-image"/></label>\ |
| 89 | + <span class="mw-wikilove-note" id="mw-wikilove-image-note"><html:msg key="wikilove-image-example"/></span>\ |
84 | 90 | <input type="text" class="text" id="mw-wikilove-image"/>\ |
| 91 | + <div id="mw-wikilove-commons-text">\ |
| 92 | + ' + mw.msg( 'wikilove-commons-text', '<a href="' + mw.msg( 'wikilove-commons-url' ) + '" target="_blank">' + mw.msg( 'wikilove-commons-link' ) +'</a>' ) + '\ |
| 93 | + </div>\ |
85 | 94 | <label for="mw-wikilove-message" id="mw-wikilove-message-label"><html:msg key="wikilove-enter-message"/></label>\ |
86 | | - <span class="mw-wikilove-note"><html:msg key="wikilove-omit-sig"/></span>\ |
| 95 | + <span class="mw-wikilove-note" id="mw-wikilove-message-note"><html:msg key="wikilove-omit-sig"/></span>\ |
87 | 96 | <textarea id="mw-wikilove-message"></textarea>\ |
88 | 97 | <div id="mw-wikilove-notify">\ |
89 | 98 | <input type="checkbox" id="mw-wikilove-notify-checkbox" name="notify"/>\ |
— | — | @@ -113,17 +122,40 @@ |
114 | 123 | resizable: false |
115 | 124 | }); |
116 | 125 | |
117 | | - $( '#mw-wikilove-button-preview' ).button( { label: mw.msg( 'wikilove-button-preview' ), icons: { primary:'ui-icon-search' } } ); |
118 | | - $( '#mw-wikilove-button-send' ).button( { label: mw.msg( 'wikilove-button-send' ) } ); |
| 126 | + if ( mw.config.get( 'skin' ) == 'vector' ) { |
| 127 | + $( '#mw-wikilove-button-preview' ).button( { |
| 128 | + label: mw.msg( 'wikilove-button-preview' ), |
| 129 | + icons: { |
| 130 | + primary:'ui-icon-search' |
| 131 | + } |
| 132 | + } ); |
| 133 | + } else { |
| 134 | + $( '#mw-wikilove-button-preview' ).button( { |
| 135 | + label: mw.msg( 'wikilove-button-preview' ) |
| 136 | + } ); |
| 137 | + } |
| 138 | + $( '#mw-wikilove-button-send' ).button( { |
| 139 | + label: mw.msg( 'wikilove-button-send' ) |
| 140 | + } ); |
119 | 141 | $( '#mw-wikilove-add-details' ).hide(); |
120 | 142 | $( '#mw-wikilove-preview' ).hide(); |
121 | 143 | $( '#mw-wikilove-types' ).replaceWith( $typeList ); |
122 | 144 | $( '#mw-wikilove-gallery-error-again' ).click( $.wikiLove.showGallery ); |
123 | 145 | $( '#mw-wikilove-types a' ).click( $.wikiLove.clickType ); |
124 | 146 | $( '#mw-wikilove-subtype' ).change( $.wikiLove.changeSubtype ); |
125 | | - $( '#mw-wikilove-preview-form' ).submit( $.wikiLove.submitPreview ); |
| 147 | + $( '#mw-wikilove-preview-form' ).submit( $.wikiLove.validatePreviewForm ); |
126 | 148 | $( '#mw-wikilove-send-form' ).click( $.wikiLove.submitSend ); |
127 | 149 | $( '#mw-wikilove-message' ).elastic(); // have the message textarea grow automatically |
| 150 | + |
| 151 | + if ( mw.config.get( 'wikilove-anon' ) === 0 ) { |
| 152 | + $( '#mw-wikilove-anon-warning' ).hide(); |
| 153 | + } |
| 154 | + |
| 155 | + // When the image changes, we want to reset the preview and error message. |
| 156 | + $( '#mw-wikilove-image' ).change( function() { |
| 157 | + $( '#mw-wikilove-dialog' ).find( '.mw-wikilove-error' ).remove(); |
| 158 | + $( '#mw-wikilove-preview' ).hide(); |
| 159 | + } ); |
128 | 160 | } |
129 | 161 | |
130 | 162 | $dialog.dialog( 'open' ); |
— | — | @@ -135,6 +167,7 @@ |
136 | 168 | */ |
137 | 169 | clickType: function( e ) { |
138 | 170 | e.preventDefault(); |
| 171 | + $.wikiLove.rememberInputData(); // remember previously entered data |
139 | 172 | $( '#mw-wikilove-get-started' ).hide(); // always hide the get started section |
140 | 173 | |
141 | 174 | var newTypeId = $( this ).data( 'typeId' ); |
— | — | @@ -171,12 +204,12 @@ |
172 | 205 | currentTypeOrSubtype = options.types[currentTypeId]; |
173 | 206 | $( '#mw-wikilove-subtype' ).hide(); |
174 | 207 | $( '#mw-wikilove-subtype-label' ).hide(); |
| 208 | + $( '#mw-wikilove-image-preview' ).hide(); |
175 | 209 | $.wikiLove.updateAllDetails(); // update controls depending on this type |
176 | 210 | } |
177 | 211 | |
178 | 212 | $( '#mw-wikilove-add-details' ).show(); |
179 | 213 | $( '#mw-wikilove-preview' ).hide(); |
180 | | - previewData = null; |
181 | 214 | } |
182 | 215 | }, |
183 | 216 | |
— | — | @@ -184,6 +217,8 @@ |
185 | 218 | * Handler for changing the subtype. |
186 | 219 | */ |
187 | 220 | changeSubtype: function() { |
| 221 | + $.wikiLove.rememberInputData(); // remember previously entered data |
| 222 | + |
188 | 223 | // find out which subtype is selected |
189 | 224 | var newSubtypeId = $( '#mw-wikilove-subtype option:selected' ).first().data( 'subtypeId' ); |
190 | 225 | if( currentSubtypeId != newSubtypeId ) { // only change stuff when a different subtype is selected |
— | — | @@ -191,18 +226,118 @@ |
192 | 227 | currentTypeOrSubtype = options.types[currentTypeId] |
193 | 228 | .subtypes[currentSubtypeId]; |
194 | 229 | $( '#mw-wikilove-subtype-description' ).html( currentTypeOrSubtype.descr ); |
| 230 | + |
| 231 | + if( currentTypeOrSubtype.gallery === undefined && currentTypeOrSubtype.image ) { // not a gallery |
| 232 | + $.wikiLove.showImagePreview(); |
| 233 | + } else { |
| 234 | + $( '#mw-wikilove-image-preview' ).hide(); |
| 235 | + } |
| 236 | + |
195 | 237 | $.wikiLove.updateAllDetails(); |
196 | 238 | $( '#mw-wikilove-preview' ).hide(); |
197 | | - previewData = null; |
198 | 239 | } |
199 | 240 | }, |
200 | 241 | |
201 | 242 | /* |
| 243 | + * Remember data the user entered if it is different from the default. |
| 244 | + */ |
| 245 | + rememberInputData: function() { |
| 246 | + if ( rememberData === null) { |
| 247 | + rememberData = { |
| 248 | + header : '', |
| 249 | + title : '', |
| 250 | + message: '', |
| 251 | + image : '' |
| 252 | + }; |
| 253 | + } |
| 254 | + if ( currentTypeOrSubtype !== null ) { |
| 255 | + if ( $.inArray( 'header', currentTypeOrSubtype.fields ) >= 0 && |
| 256 | + ( !currentTypeOrSubtype.header || $( '#mw-wikilove-header' ).val() != currentTypeOrSubtype.header ) ) |
| 257 | + { |
| 258 | + rememberData.header = $( '#mw-wikilove-header' ).val(); |
| 259 | + } |
| 260 | + if ( $.inArray( 'title', currentTypeOrSubtype.fields ) >= 0 && |
| 261 | + ( !currentTypeOrSubtype.title || $( '#mw-wikilove-title' ).val() != currentTypeOrSubtype.title ) ) |
| 262 | + { |
| 263 | + rememberData.title = $( '#mw-wikilove-title' ).val(); |
| 264 | + } |
| 265 | + if ( $.inArray( 'message', currentTypeOrSubtype.fields ) >= 0 && |
| 266 | + ( !currentTypeOrSubtype.message || $( '#mw-wikilove-message' ).val() != currentTypeOrSubtype.message ) ) |
| 267 | + { |
| 268 | + rememberData.message = $( '#mw-wikilove-message' ).val(); |
| 269 | + } |
| 270 | + if ( currentTypeOrSubtype.gallery === undefined && $.inArray( 'image', currentTypeOrSubtype.fields ) >= 0 && |
| 271 | + ( !currentTypeOrSubtype.image || $( '#mw-wikilove-image' ).val() != currentTypeOrSubtype.image ) ) |
| 272 | + { |
| 273 | + rememberData.image = $( '#mw-wikilove-image' ).val(); |
| 274 | + } |
| 275 | + } |
| 276 | + }, |
| 277 | + |
| 278 | + /* |
| 279 | + * Show a preview of the image for a subtype. |
| 280 | + */ |
| 281 | + showImagePreview: function() { |
| 282 | + $( '#mw-wikilove-image-preview' ).show(); |
| 283 | + $( '#mw-wikilove-image-preview-content' ).html( '' ); |
| 284 | + $( '#mw-wikilove-image-preview-spinner' ).fadeIn( 200 ); |
| 285 | + var title = $.wikiLove.addFilePrefix( currentTypeOrSubtype.image ); |
| 286 | + var loadingType = currentTypeOrSubtype; |
| 287 | + $.ajax({ |
| 288 | + url: mw.util.wikiScript( 'api' ), |
| 289 | + data: { |
| 290 | + 'action' : 'query', |
| 291 | + 'format' : 'json', |
| 292 | + 'prop' : 'imageinfo', |
| 293 | + 'iiprop' : 'mime|url', |
| 294 | + 'titles' : title, |
| 295 | + 'iiurlwidth' : 75, |
| 296 | + 'iiurlheight' : 68 |
| 297 | + }, |
| 298 | + dataType: 'json', |
| 299 | + type: 'POST', |
| 300 | + success: function( data ) { |
| 301 | + if ( !data || !data.query || !data.query.pages ) { |
| 302 | + $( '#mw-wikilove-image-preview-spinner' ).fadeOut( 200 ); |
| 303 | + return; |
| 304 | + } |
| 305 | + if ( loadingType != currentTypeOrSubtype ) { |
| 306 | + return; |
| 307 | + } |
| 308 | + $.each( data.query.pages, function( id, page ) { |
| 309 | + if ( page.imageinfo && page.imageinfo.length ) { |
| 310 | + // build an image tag with the correct url |
| 311 | + var $img = $( '<img/>' ) |
| 312 | + .attr( 'src', page.imageinfo[0].thumburl ) |
| 313 | + .hide() |
| 314 | + .load( function() { |
| 315 | + $( '#mw-wikilove-image-preview-spinner' ).hide(); |
| 316 | + $( this ).css( 'display', 'inline-block' ); |
| 317 | + } ); |
| 318 | + $( '#mw-wikilove-image-preview-content' ).append( $img ); |
| 319 | + } |
| 320 | + }); |
| 321 | + }, |
| 322 | + error: function() { |
| 323 | + $( '#mw-wikilove-image-preview-spinner' ).fadeOut( 200 ); |
| 324 | + } |
| 325 | + }); |
| 326 | + }, |
| 327 | + |
| 328 | + /* |
202 | 329 | * Called when type or subtype changes, updates controls. |
203 | 330 | */ |
204 | 331 | updateAllDetails: function() { |
205 | 332 | $( '#mw-wikilove-dialog' ).find( '.mw-wikilove-error' ).remove(); |
206 | 333 | |
| 334 | + // use remembered data for fields that can be set by the user |
| 335 | + var currentRememberData = { |
| 336 | + 'header' : ( $.inArray( 'header', currentTypeOrSubtype.fields ) >= 0 ? rememberData.header : '' ), |
| 337 | + 'title' : ( $.inArray( 'title', currentTypeOrSubtype.fields ) >= 0 ? rememberData.title : '' ), |
| 338 | + 'message': ( $.inArray( 'message', currentTypeOrSubtype.fields ) >= 0 ? rememberData.message : '' ), |
| 339 | + 'image' : ( $.inArray( 'image', currentTypeOrSubtype.fields ) >= 0 ? rememberData.image : '' ) |
| 340 | + }; |
| 341 | + |
207 | 342 | // only show the description if it exists for this type or subtype |
208 | 343 | if( typeof currentTypeOrSubtype.descr == 'string' ) { |
209 | 344 | $( '#mw-wikilove-subtype-description').show(); |
— | — | @@ -210,29 +345,29 @@ |
211 | 346 | $( '#mw-wikilove-subtype-description').hide(); |
212 | 347 | } |
213 | 348 | |
214 | | - // show or hide header label and textbox depending on whether a predefined header exists |
| 349 | + // show or hide header label and textbox depending on fields configuration |
215 | 350 | $( '#mw-wikilove-header, #mw-wikilove-header-label' ) |
216 | 351 | .toggle( $.inArray( 'header', currentTypeOrSubtype.fields ) >= 0 ); |
217 | 352 | |
218 | 353 | // set the new text for the header textbox |
219 | | - $( '#mw-wikilove-header' ).val( currentTypeOrSubtype.header || '' ); |
| 354 | + $( '#mw-wikilove-header' ).val( currentRememberData.header || currentTypeOrSubtype.header || '' ); |
220 | 355 | |
221 | | - // show or hide title label and textbox depending on whether a predefined title exists |
| 356 | + // show or hide title label and textbox depending on fields configuration |
222 | 357 | $( '#mw-wikilove-title, #mw-wikilove-title-label') |
223 | 358 | .toggle( $.inArray( 'title', currentTypeOrSubtype.fields ) >= 0 ); |
224 | 359 | |
225 | 360 | // set the new text for the title textbox |
226 | | - $( '#mw-wikilove-title' ).val( currentTypeOrSubtype.title || '' ); |
| 361 | + $( '#mw-wikilove-title' ).val( currentRememberData.title || currentTypeOrSubtype.title || '' ); |
227 | 362 | |
228 | | - // show or hide image label and textbox depending on whether a predefined image exists |
229 | | - $( '#mw-wikilove-image, #mw-wikilove-image-label') |
| 363 | + // show or hide image label and textbox depending on fields configuration |
| 364 | + $( '#mw-wikilove-image, #mw-wikilove-image-label, #mw-wikilove-image-note, #mw-wikilove-commons-text' ) |
230 | 365 | .toggle( $.inArray( 'image', currentTypeOrSubtype.fields ) >= 0 ); |
231 | 366 | |
232 | 367 | // set the new text for the image textbox |
233 | | - $( '#mw-wikilove-image' ).val( currentTypeOrSubtype.image || '' ); |
| 368 | + $( '#mw-wikilove-image' ).val( currentRememberData.image || currentTypeOrSubtype.image || '' ); |
234 | 369 | |
235 | 370 | if( typeof currentTypeOrSubtype.gallery == 'object' |
236 | | - && currentTypeOrSubtype.gallery.imageList instanceof Array |
| 371 | + && $.isArray( currentTypeOrSubtype.gallery.imageList ) |
237 | 372 | ) { |
238 | 373 | $( '#mw-wikilove-gallery, #mw-wikilove-gallery-label' ).show(); |
239 | 374 | $.wikiLove.showGallery(); // build gallery from array of images |
— | — | @@ -241,6 +376,13 @@ |
242 | 377 | $( '#mw-wikilove-gallery, #mw-wikilove-gallery-label' ).hide(); |
243 | 378 | } |
244 | 379 | |
| 380 | + // show or hide message label and textbox depending on fields configuration |
| 381 | + $( '#mw-wikilove-message, #mw-wikilove-message-label, #mw-wikilove-message-note' ) |
| 382 | + .toggle( $.inArray( 'message', currentTypeOrSubtype.fields ) >= 0 ); |
| 383 | + |
| 384 | + // set the new text for the message textbox |
| 385 | + $( '#mw-wikilove-message' ).val( currentRememberData.message || currentTypeOrSubtype.message || '' ); |
| 386 | + |
245 | 387 | if( $.inArray( 'notify', currentTypeOrSubtype.fields ) >= 0 && emailable ) { |
246 | 388 | $( '#mw-wikilove-notify' ).show(); |
247 | 389 | } else { |
— | — | @@ -250,61 +392,99 @@ |
251 | 393 | }, |
252 | 394 | |
253 | 395 | /* |
254 | | - * Handler for clicking the preview button. Builds data for AJAX request. |
| 396 | + * Handler for clicking the preview button. |
255 | 397 | */ |
256 | | - submitPreview: function( e ) { |
| 398 | + validatePreviewForm: function( e ) { |
257 | 399 | e.preventDefault(); |
258 | 400 | $( '#mw-wikilove-preview' ).hide(); |
259 | 401 | $( '#mw-wikilove-dialog' ).find( '.mw-wikilove-error' ).remove(); |
260 | 402 | |
261 | | - |
262 | | - if ( $( '#mw-wikilove-image' ).val().length <= 0 ) { |
263 | | - if( typeof currentTypeOrSubtype.gallery == 'object' ) { |
264 | | - $.wikiLove.showError( 'wikilove-err-image' ); return false; |
265 | | - } |
266 | | - else { |
267 | | - $( '#mw-wikilove-image' ).val( options.defaultImage ); |
268 | | - } |
| 403 | + // Check for a header if it is required |
| 404 | + if( $.inArray( 'header', currentTypeOrSubtype.fields ) >= 0 && $( '#mw-wikilove-header' ).val().length === 0 ) { |
| 405 | + $.wikiLove.showAddDetailsError( 'wikilove-err-header' ); return false; |
269 | 406 | } |
270 | | - if( $( '#mw-wikilove-header' ).val().length <= 0 ) { |
271 | | - $.wikiLove.showError( 'wikilove-err-header' ); return false; |
272 | | - } |
273 | 407 | |
274 | | - /* |
275 | | - Let's not show an error for not entering a message, making it always optional. |
276 | | - This is preferred over removing the field from the interface, so that users are |
277 | | - stimulated to enter a message, but are not required to do so if they want to leave |
278 | | - a quick gesture of appreciation. |
279 | | - if( $( '#mw-wikilove-message' ).val().length <= 0 ) { |
280 | | - $.wikiLove.showError( 'wikilove-err-msg' ); return false; |
| 408 | + // Check for a title if it is required, and otherwise use the header text |
| 409 | + if( $.inArray( 'title', currentTypeOrSubtype.fields ) >= 0 && $( '#mw-wikilove-title' ).val().length === 0 ) { |
| 410 | + $( '#mw-wikilove-title' ).val( $( '#mw-wikilove-header' ).val() ); |
281 | 411 | } |
282 | | - */ |
283 | 412 | |
284 | | - // If there isn't a signature already in the message, throw an error |
285 | | - if ( $( '#mw-wikilove-message' ).val().indexOf( '~~~' ) >= 0 ) { |
286 | | - $.wikiLove.showError( 'wikilove-err-sig' ); return false; |
| 413 | + if( $.inArray( 'message', currentTypeOrSubtype.fields ) >= 0 ) { |
| 414 | + // If there's a signature already in the message, throw an error |
| 415 | + if ( $( '#mw-wikilove-message' ).val().indexOf( '~~~' ) >= 0 ) { |
| 416 | + $.wikiLove.showAddDetailsError( 'wikilove-err-sig' ); return false; |
| 417 | + } |
287 | 418 | } |
288 | 419 | |
289 | | - var text = $.wikiLove.prepareMsg( currentTypeOrSubtype.text || options.defaultText ); |
290 | | - |
291 | | - $.wikiLove.doPreview( '==' + $( '#mw-wikilove-header' ).val() + "==\n" + text ); |
292 | | - previewData = { |
293 | | - 'header': $( '#mw-wikilove-header' ).val(), |
294 | | - 'text': text, |
295 | | - 'message': $( '#mw-wikilove-message' ).val(), |
296 | | - 'type': currentTypeId |
297 | | - + (currentSubtypeId !== null ? '-' + currentSubtypeId : '') |
298 | | - }; |
299 | | - |
300 | | - if ( $( '#mw-wikilove-notify-checkbox:checked' ).val() && emailable ) { |
301 | | - previewData.email = $.wikiLove.prepareMsg( currentTypeOrSubtype.email ); |
| 420 | + // Split image validation depending on whether or not it is a gallery |
| 421 | + if ( typeof currentTypeOrSubtype.gallery == 'undefined' ) { // not a gallery |
| 422 | + if ( $.inArray( 'image', currentTypeOrSubtype.fields ) >= 0 ) { // asks for an image |
| 423 | + if ( $( '#mw-wikilove-image' ).val().length === 0 ) { // no image entered |
| 424 | + // Give them the default image and continue with preview. |
| 425 | + $( '#mw-wikilove-image' ).val( options.defaultImage ); |
| 426 | + $.wikiLove.submitPreview(); |
| 427 | + } else { // image was entered by user |
| 428 | + // Make sure the image exists |
| 429 | + var imageTitle = $.wikiLove.addFilePrefix( $( '#mw-wikilove-image' ).val() ); |
| 430 | + $( '#mw-wikilove-preview-spinner' ).fadeIn( 200 ); |
| 431 | + |
| 432 | + $.ajax( { |
| 433 | + url: mw.util.wikiScript( 'api' ), |
| 434 | + data: { |
| 435 | + 'action': 'query', |
| 436 | + 'format': 'json', |
| 437 | + 'titles': imageTitle, |
| 438 | + 'prop': 'imageinfo' |
| 439 | + }, |
| 440 | + dataType: 'json', |
| 441 | + success: function( data ) { |
| 442 | + // See if image exists locally or through InstantCommons |
| 443 | + if ( !data.query.pages[-1] || data.query.pages[-1].imageinfo) { |
| 444 | + // Image exists |
| 445 | + $.wikiLove.submitPreview(); |
| 446 | + $.wikiLove.logCustomImageUse( imageTitle, 1 ); |
| 447 | + } else { |
| 448 | + // Image does not exist |
| 449 | + $.wikiLove.showAddDetailsError( 'wikilove-err-image-bad' ); |
| 450 | + $.wikiLove.logCustomImageUse( imageTitle, 0 ); |
| 451 | + $( '#mw-wikilove-preview-spinner' ).fadeOut( 200 ); |
| 452 | + } |
| 453 | + }, |
| 454 | + error: function() { |
| 455 | + $.wikiLove.showAddDetailsError( 'wikilove-err-image-api' ); |
| 456 | + $( '#mw-wikilove-preview-spinner' ).fadeOut( 200 ); |
| 457 | + } |
| 458 | + } ); |
| 459 | + } |
| 460 | + } else { // doesn't ask for an image |
| 461 | + $.wikiLove.submitPreview(); |
| 462 | + } |
| 463 | + } else { // a gallery |
| 464 | + if ( $( '#mw-wikilove-image' ).val().length === 0 ) { // no image selected |
| 465 | + // Display an error telling them to select an image. |
| 466 | + $.wikiLove.showAddDetailsError( 'wikilove-err-image' ); return false; |
| 467 | + } else { // image was selected |
| 468 | + $.wikiLove.submitPreview(); |
| 469 | + } |
302 | 470 | } |
303 | 471 | }, |
304 | 472 | |
305 | | - showError: function( errmsg ) { |
| 473 | + /* |
| 474 | + * After the form is validated, perform preview. |
| 475 | + */ |
| 476 | + submitPreview: function() { |
| 477 | + var text = $.wikiLove.prepareMsg( currentTypeOrSubtype.text || options.types[currentTypeId].text || options.defaultText ); |
| 478 | + $.wikiLove.doPreview( '==' + $( '#mw-wikilove-header' ).val() + "==\n" + text ); |
| 479 | + }, |
| 480 | + |
| 481 | + showAddDetailsError: function( errmsg ) { |
306 | 482 | $( '#mw-wikilove-add-details' ).append( $( '<div class="mw-wikilove-error"></div>' ).text( mw.msg( errmsg ) ) ); |
307 | 483 | }, |
308 | 484 | |
| 485 | + showPreviewError: function( errmsg ) { |
| 486 | + $( '#mw-wikilove-preview' ).append( $( '<div class="mw-wikilove-error"></div>' ).text( mw.msg( errmsg ) ) ); |
| 487 | + }, |
| 488 | + |
309 | 489 | /* |
310 | 490 | * Prepares a message or e-mail body by replacing placeholders. |
311 | 491 | * $1: message entered by the user |
— | — | @@ -319,16 +499,47 @@ |
320 | 500 | |
321 | 501 | msg = msg.replace( '$1', $( '#mw-wikilove-message' ).val() ); // replace the raw message |
322 | 502 | msg = msg.replace( '$2', $( '#mw-wikilove-title' ).val() ); // replace the title |
323 | | - msg = msg.replace( '$3', $( '#mw-wikilove-image' ).val() ); // replace the image |
| 503 | + var imageName = $.wikiLove.addFilePrefix( $( '#mw-wikilove-image' ).val() ); |
| 504 | + msg = msg.replace( '$3', imageName ); // replace the image |
324 | 505 | msg = msg.replace( '$4', currentTypeOrSubtype.imageSize || options.defaultImageSize ); // replace the image size |
325 | 506 | msg = msg.replace( '$5', currentTypeOrSubtype.backgroundColor || options.defaultBackgroundColor ); // replace the background color |
326 | 507 | msg = msg.replace( '$6', currentTypeOrSubtype.borderColor || options.defaultBorderColor ); // replace the border color |
327 | | - msg = msg.replace( '$7', mw.config.get( 'wikilove-recipient' ) ); // replace the username we're sending to |
| 508 | + msg = msg.replace( '$7', '<nowiki>' + mw.config.get( 'wikilove-recipient' ) + '</nowiki>' ); // replace the username we're sending to |
328 | 509 | |
329 | 510 | return msg; |
330 | 511 | }, |
331 | 512 | |
332 | 513 | /* |
| 514 | + * Adds a "File:" prefix if there isn't already a media namespace prefix. |
| 515 | + */ |
| 516 | + addFilePrefix: function( filename ) { |
| 517 | + // Can't use mw.Title in 1.17 |
| 518 | + var prefix = filename.split( ':' )[0] || '', |
| 519 | + normalized = $.trim( prefix ).toLowerCase().replace( /\s/g, '_' ); |
| 520 | + // wgNamespaceIds is missing 'file' in 1.17 on non-English wikis |
| 521 | + if ( mw.config.get( 'wgNamespaceIds' )[normalized] !== 6 && normalized !== 'file' ) { |
| 522 | + filename = 'File:' + filename; |
| 523 | + } |
| 524 | + return filename; |
| 525 | + }, |
| 526 | + |
| 527 | + /* |
| 528 | + * Log each time a user attempts to use a custom image via the Make your own feature. |
| 529 | + */ |
| 530 | + logCustomImageUse: function( imageTitle, success ) { |
| 531 | + $.ajax( { |
| 532 | + url: mw.util.wikiScript( 'api' ), |
| 533 | + data: { |
| 534 | + 'action': 'wikiloveimagelog', |
| 535 | + 'image': imageTitle, |
| 536 | + 'success': success, |
| 537 | + 'format': 'json' |
| 538 | + }, |
| 539 | + dataType: 'json' |
| 540 | + } ); |
| 541 | + }, |
| 542 | + |
| 543 | + /* |
333 | 544 | * Fires AJAX request for previewing wikitext. |
334 | 545 | */ |
335 | 546 | doPreview: function( wikitext ) { |
— | — | @@ -337,6 +548,7 @@ |
338 | 549 | url: mw.util.wikiScript( 'api' ), |
339 | 550 | data: { |
340 | 551 | 'action': 'parse', |
| 552 | + 'title': mw.config.get( 'wgPageName' ), |
341 | 553 | 'format': 'json', |
342 | 554 | 'text': wikitext, |
343 | 555 | 'prop': 'text', |
— | — | @@ -347,6 +559,10 @@ |
348 | 560 | success: function( data ) { |
349 | 561 | $.wikiLove.showPreview( data.parse.text['*'] ); |
350 | 562 | $( '#mw-wikilove-preview-spinner' ).fadeOut( 200 ); |
| 563 | + }, |
| 564 | + error: function() { |
| 565 | + $.wikiLove.showAddDetailsError( 'wikilove-err-preview-api' ); |
| 566 | + $( '#mw-wikilove-preview-spinner' ).fadeOut( 200 ); |
351 | 567 | } |
352 | 568 | }); |
353 | 569 | }, |
— | — | @@ -360,14 +576,46 @@ |
361 | 577 | }, |
362 | 578 | |
363 | 579 | /* |
364 | | - * Handler for the send (final submit) button. Builds data for AJAX request. |
| 580 | + * Handler for the send (final submit) button. Builds the data for the AJAX request. |
365 | 581 | * The type sent for statistics is 'typeId-subtypeId' when using subtypes, |
366 | 582 | * or simply 'typeId' otherwise. |
367 | 583 | */ |
368 | 584 | submitSend: function( e ) { |
369 | 585 | e.preventDefault(); |
370 | | - $.wikiLove.doSend( previewData.header, previewData.text, |
371 | | - previewData.message, previewData.type, previewData.email ); |
| 586 | + $( '#mw-wikilove-dialog' ).find( '.mw-wikilove-error' ).remove(); |
| 587 | + |
| 588 | + // Check for a header if it is required |
| 589 | + if( $.inArray( 'header', currentTypeOrSubtype.fields ) >= 0 && $( '#mw-wikilove-header' ).val().length === 0 ) { |
| 590 | + $.wikiLove.showAddDetailsError( 'wikilove-err-header' ); return false; |
| 591 | + } |
| 592 | + |
| 593 | + // Check for a title if it is required, and otherwise use the header text |
| 594 | + if( $.inArray( 'title', currentTypeOrSubtype.fields ) >= 0 && $( '#mw-wikilove-title' ).val().length === 0 ) { |
| 595 | + $( '#mw-wikilove-title' ).val( $( '#mw-wikilove-header' ).val() ); |
| 596 | + } |
| 597 | + |
| 598 | + if( $.inArray( 'message', currentTypeOrSubtype.fields ) >= 0 ) { |
| 599 | + // If there's a signature already in the message, throw an error |
| 600 | + if ( $( '#mw-wikilove-message' ).val().indexOf( '~~~' ) >= 0 ) { |
| 601 | + $.wikiLove.showAddDetailsError( 'wikilove-err-sig' ); return false; |
| 602 | + } |
| 603 | + } |
| 604 | + |
| 605 | + // We don't need to do any image validation here since its not actually possible to click |
| 606 | + // Send WikiLove without having a valid image entered. |
| 607 | + |
| 608 | + var submitData = { |
| 609 | + 'header': $( '#mw-wikilove-header' ).val(), |
| 610 | + 'text': $.wikiLove.prepareMsg( currentTypeOrSubtype.text || options.types[currentTypeId].text || options.defaultText ), |
| 611 | + 'message': $( '#mw-wikilove-message' ).val(), |
| 612 | + 'type': currentTypeId |
| 613 | + + (currentSubtypeId !== null ? '-' + currentSubtypeId : '') |
| 614 | + }; |
| 615 | + if ( $( '#mw-wikilove-notify-checkbox:checked' ).val() && emailable ) { |
| 616 | + submitData.email = $.wikiLove.prepareMsg( currentTypeOrSubtype.email ); |
| 617 | + } |
| 618 | + $.wikiLove.doSend( submitData.header, submitData.text, |
| 619 | + submitData.message, submitData.type, submitData.email ); |
372 | 620 | }, |
373 | 621 | |
374 | 622 | /* |
— | — | @@ -400,7 +648,7 @@ |
401 | 649 | $( '#mw-wikilove-send-spinner' ).fadeOut( 200 ); |
402 | 650 | |
403 | 651 | if ( typeof data.error !== 'undefined' ) { |
404 | | - $( '#mw-wikilove-preview' ).append( '<div class="mw-wikilove-error">' + mw.html.escape( data.error.info ) + '<div>' ); |
| 652 | + $.wikiLove.showPreviewError( data.error.info ); |
405 | 653 | return; |
406 | 654 | } |
407 | 655 | |
— | — | @@ -410,12 +658,15 @@ |
411 | 659 | // jump to the correct section, because when we set the hash (#...) |
412 | 660 | // the page won't reload... |
413 | 661 | window.location.reload(); |
414 | | - } |
415 | | - else { |
416 | | - window.location = mw.util.wikiUrlencode( |
417 | | - mw.config.get( 'wgArticlePath' ).replace( '$1', data.redirect.pageName ) |
| 662 | + } else { |
| 663 | + window.location = encodeURI( |
| 664 | + mw.config.get( 'wgArticlePath' ).replace( '$1', mw.util.wikiUrlencode( data.redirect.pageName ) ) |
418 | 665 | + '#' + data.redirect.fragment ); |
419 | 666 | } |
| 667 | + }, |
| 668 | + error: function() { |
| 669 | + $.wikiLove.showPreviewError( 'wikilove-err-send-api' ); |
| 670 | + $( '#mw-wikilove-send-spinner' ).fadeOut( 200 ); |
420 | 671 | } |
421 | 672 | }); |
422 | 673 | }, |
— | — | @@ -439,11 +690,11 @@ |
440 | 691 | var titles = ''; |
441 | 692 | var imageList = currentTypeOrSubtype.gallery.imageList.slice( 0 ); |
442 | 693 | for( var i=0; i<currentTypeOrSubtype.gallery.number; i++ ) { |
443 | | - // get a randomimage |
| 694 | + // get a random image from imageList and add it to the list of titles to be retrieved |
444 | 695 | var id = Math.floor( Math.random() * imageList.length ); |
445 | | - titles = titles + 'File:' + imageList[id] + '|'; |
| 696 | + titles = titles + $.wikiLove.addFilePrefix( imageList[id] ) + '|'; |
446 | 697 | |
447 | | - // remove the random page from the keys array |
| 698 | + // remove the randomly selected image from imageList so that it can't be added twice |
448 | 699 | imageList.splice(id, 1); |
449 | 700 | } |
450 | 701 | |
— | — | @@ -458,7 +709,8 @@ |
459 | 710 | 'prop' : 'imageinfo', |
460 | 711 | 'iiprop' : 'mime|url', |
461 | 712 | 'titles' : titles, |
462 | | - 'iiurlwidth' : currentTypeOrSubtype.gallery.width |
| 713 | + 'iiurlwidth' : currentTypeOrSubtype.gallery.width, |
| 714 | + 'iiurlheight' : currentTypeOrSubtype.gallery.height |
463 | 715 | }, |
464 | 716 | dataType: 'json', |
465 | 717 | type: 'POST', |
— | — | @@ -472,18 +724,18 @@ |
473 | 725 | if ( loadingType != currentTypeOrSubtype ) { |
474 | 726 | return; |
475 | 727 | } |
| 728 | + var galleryNumber = currentTypeOrSubtype.gallery.number; |
476 | 729 | |
477 | 730 | $.each( data.query.pages, function( id, page ) { |
478 | 731 | if ( page.imageinfo && page.imageinfo.length ) { |
479 | | - // build an image tag with the correct url and width |
| 732 | + // build an image tag with the correct url |
480 | 733 | var $img = $( '<img/>' ) |
481 | 734 | .attr( 'src', page.imageinfo[0].thumburl ) |
482 | | - .attr( 'width', currentTypeOrSubtype.gallery.width ) |
483 | 735 | .hide() |
484 | 736 | .load( function() { |
485 | 737 | $( this ).css( 'display', 'inline-block' ); |
486 | 738 | loadingIndex++; |
487 | | - if ( loadingIndex >= currentTypeOrSubtype.gallery.number ) { |
| 739 | + if ( loadingIndex >= galleryNumber ) { |
488 | 740 | $( '#mw-wikilove-gallery-spinner' ).fadeOut( 200 ); |
489 | 741 | } |
490 | 742 | } ); |
— | — | @@ -502,6 +754,8 @@ |
503 | 755 | index++; |
504 | 756 | } |
505 | 757 | } ); |
| 758 | + // Pre-select first image |
| 759 | + /* $('#mw-wikilove-gallery-img-0 img').trigger('click'); */ |
506 | 760 | }, |
507 | 761 | error: function() { |
508 | 762 | $( '#mw-wikilove-gallery-error' ).show(); |
— | — | @@ -514,10 +768,13 @@ |
515 | 769 | * Init function which is called upon page load. Binds the WikiLove icon to opening the dialog. |
516 | 770 | */ |
517 | 771 | init: function() { |
518 | | - options = $.wikiLove.optionsHook(); |
519 | | - $( '#ca-wikilove' ).find( 'a' ).click( function( e ) { |
| 772 | + options = $.wikiLoveOptions; |
| 773 | + |
| 774 | + var $wikiLoveLink = $( '#ca-wikilove' ).find( 'a' ); |
| 775 | + $wikiLoveLink.unbind( 'click' ); |
| 776 | + $wikiLoveLink.click( function( e ) { |
| 777 | + e.preventDefault(); |
520 | 778 | $.wikiLove.openDialog(); |
521 | | - e.preventDefault(); |
522 | 779 | }); |
523 | 780 | } |
524 | 781 | |
— | — | @@ -604,7 +861,7 @@ |
605 | 862 | } |
606 | 863 | } |
607 | 864 | } |
608 | | - if( gallery.length <= 0 ) { |
| 865 | + if( gallery.length === 0 ) { |
609 | 866 | $( '#mw-wikilove-gallery' ).hide(); |
610 | 867 | $( '#mw-wikilove-gallery-label' ).hide(); |
611 | 868 | } |
— | — | @@ -616,5 +873,6 @@ |
617 | 874 | */ |
618 | 875 | }; |
619 | 876 | |
620 | | -}()); |
| 877 | + |
| 878 | +$( document ).ready( $.wikiLove.init ); |
621 | 879 | } ) ( jQuery ); |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/ApiWikiLove.php |
— | — | @@ -0,0 +1,179 @@ |
| 2 | +<?php |
| 3 | +class ApiWikiLove extends ApiBase { |
| 4 | + public function execute() { |
| 5 | + global $wgRequest, $wgWikiLoveLogging, $wgParser; |
| 6 | + |
| 7 | + $params = $this->extractRequestParams(); |
| 8 | + |
| 9 | + $title = Title::newFromText( $params['title'] ); |
| 10 | + if ( is_null( $title ) ) { |
| 11 | + $this->dieUsageMsg( array( 'invaliduser', $params['title'] ) ); |
| 12 | + } |
| 13 | + |
| 14 | + $talk = WikiLoveHooks::getUserTalkPage( $title ); |
| 15 | + if ( is_null( $talk ) ) { |
| 16 | + $this->dieUsageMsg( array( 'invaliduser', $params['title'] ) ); |
| 17 | + } |
| 18 | + |
| 19 | + if ( $wgWikiLoveLogging ) { |
| 20 | + $this->saveInDb( $talk, $params['subject'], $params['message'], $params['type'], isset( $params['email'] ) ? 1 : 0 ); |
| 21 | + } |
| 22 | + |
| 23 | + // not using section => 'new' here, as we like to give our own edit summary |
| 24 | + $api = new ApiMain( new FauxRequest( array( |
| 25 | + 'action' => 'edit', |
| 26 | + 'title' => $talk->getFullText(), |
| 27 | + // need to do this, as Article::replaceSection fails for non-existing pages |
| 28 | + 'appendtext' => ( $talk->exists() ? "\n\n" : '' ) . wfMsgForContent( 'newsectionheaderdefaultlevel', $params['subject'] ) |
| 29 | + . "\n\n" . $params['text'], |
| 30 | + 'token' => $params['token'], |
| 31 | + 'summary' => wfMsgForContent( 'wikilove-summary', $wgParser->stripSectionName( $params['subject'] ) ), |
| 32 | + 'notminor' => true, |
| 33 | + ), false, array( 'wsEditToken' => $wgRequest->getSessionData( 'wsEditToken' ) ) ), true ); |
| 34 | + |
| 35 | + $api->execute(); |
| 36 | + |
| 37 | + if ( isset( $params['email'] ) ) { |
| 38 | + $this->emailUser( $talk, $params['subject'], $params['email'], $params['token'] ); |
| 39 | + } |
| 40 | + |
| 41 | + $this->getResult()->addValue( 'redirect', 'pageName', $talk->getPrefixedDBkey() ); |
| 42 | + $this->getResult()->addValue( 'redirect', 'fragment', Title::escapeFragmentForURL( $params['subject'] ) ); |
| 43 | + // note that we cannot use Title::makeTitle here as it doesn't sanitize the fragment |
| 44 | + } |
| 45 | + |
| 46 | + /** |
| 47 | + * @param $talk Title |
| 48 | + * @param $subject |
| 49 | + * @param $message |
| 50 | + * @param $type |
| 51 | + * @param $email |
| 52 | + * @return void |
| 53 | + */ |
| 54 | + private function saveInDb( $talk, $subject, $message, $type, $email ) { |
| 55 | + global $wgUser; |
| 56 | + $dbw = wfGetDB( DB_MASTER ); |
| 57 | + $receiver = User::newFromName( $talk->getSubjectPage()->getBaseText() ); |
| 58 | + if ( $receiver === false || $receiver->isAnon() ) { |
| 59 | + $this->setWarning( 'Not logging anonymous recipients' ); |
| 60 | + return; |
| 61 | + } |
| 62 | + |
| 63 | + $values = array( |
| 64 | + 'wll_timestamp' => $dbw->timestamp(), |
| 65 | + 'wll_sender' => $wgUser->getId(), |
| 66 | + 'wll_sender_editcount' => $wgUser->getEditCount(), |
| 67 | + 'wll_sender_registration' => $wgUser->getRegistration(), |
| 68 | + 'wll_receiver' => $receiver->getId(), |
| 69 | + 'wll_receiver_editcount' => $receiver->getEditCount(), |
| 70 | + 'wll_receiver_registration' => $receiver->getRegistration(), |
| 71 | + 'wll_type' => $type, |
| 72 | + 'wll_subject' => $subject, |
| 73 | + 'wll_message' => $message, |
| 74 | + 'wll_email' => $email, |
| 75 | + ); |
| 76 | + |
| 77 | + try{ |
| 78 | + $dbw->insert( 'wikilove_log', $values, __METHOD__ ); |
| 79 | + } catch( DBQueryError $dbqe ) { |
| 80 | + $this->setWarning( 'Action was not logged' ); |
| 81 | + } |
| 82 | + } |
| 83 | + |
| 84 | + /** |
| 85 | + * @param $talk Title |
| 86 | + * @param $subject string |
| 87 | + * @param $text string |
| 88 | + * @param $token string |
| 89 | + */ |
| 90 | + private function emailUser( $talk, $subject, $text, $token ) { |
| 91 | + global $wgRequest; |
| 92 | + $api = new ApiMain( new FauxRequest( array( |
| 93 | + 'action' => 'emailuser', |
| 94 | + 'target' => User::newFromName( $talk->getSubjectPage()->getBaseText() )->getName(), |
| 95 | + 'subject' => $subject, |
| 96 | + 'text' => $text, |
| 97 | + 'token' => $token, |
| 98 | + ), false, array( 'wsEditToken' => $wgRequest->getSessionData( 'wsEditToken' ) ) ), true ); |
| 99 | + try{ |
| 100 | + $api->execute(); |
| 101 | + } catch( DBQueryError $dbqe ) { |
| 102 | + $this->setWarning( 'E-mail was not sent' ); |
| 103 | + } |
| 104 | + } |
| 105 | + |
| 106 | + public function getAllowedParams() { |
| 107 | + return array( |
| 108 | + 'title' => array( |
| 109 | + ApiBase::PARAM_TYPE => 'string', |
| 110 | + ApiBase::PARAM_REQUIRED => true, |
| 111 | + ), |
| 112 | + 'text' => array( |
| 113 | + ApiBase::PARAM_TYPE => 'string', |
| 114 | + ApiBase::PARAM_REQUIRED => true, |
| 115 | + ), |
| 116 | + 'message' => array( |
| 117 | + ApiBase::PARAM_TYPE => 'string', |
| 118 | + ), |
| 119 | + 'token' => array( |
| 120 | + ApiBase::PARAM_TYPE => 'string', |
| 121 | + ApiBase::PARAM_REQUIRED => true, |
| 122 | + ), |
| 123 | + 'subject' => array( |
| 124 | + ApiBase::PARAM_TYPE => 'string', |
| 125 | + ApiBase::PARAM_REQUIRED => true, |
| 126 | + ), |
| 127 | + 'type' => array( |
| 128 | + ApiBase::PARAM_TYPE => 'string', |
| 129 | + ), |
| 130 | + 'email' => array( |
| 131 | + ApiBase::PARAM_TYPE => 'string', |
| 132 | + ), |
| 133 | + ); |
| 134 | + } |
| 135 | + |
| 136 | + public function getParamDescription() { |
| 137 | + return array( |
| 138 | + 'title' => 'Title of the user or user talk page to send WikiLove to', |
| 139 | + 'text' => 'Raw wikitext to add in the new section', |
| 140 | + 'message' => 'Actual message the user has entered, for logging purposes', |
| 141 | + 'token' => 'Edit token. You can get one of these through prop=info', |
| 142 | + 'subject' => 'Subject header of the new section', |
| 143 | + 'email' => 'Content of the optional e-mail message to send to the user', |
| 144 | + 'type' => array( 'Type of WikiLove (for statistics); this corresponds with a type', |
| 145 | + 'selected in the left menu, and optionally a subtype after that', |
| 146 | + '(e.g. "barnstar-normal" or "kitten")', |
| 147 | + ), |
| 148 | + ); |
| 149 | + } |
| 150 | + |
| 151 | + public function getDescription() { |
| 152 | + return array( |
| 153 | + 'Give WikiLove to another user.', |
| 154 | + "WikiLove is a positive message posted to a user's talk page through a", |
| 155 | + 'convenient interface with preset or locally defined templates. This action', |
| 156 | + 'adds the specified wikitext to a certain talk page. For statistical purposes,', |
| 157 | + 'the type and other data are logged.', |
| 158 | + ); |
| 159 | + } |
| 160 | + |
| 161 | + public function getPossibleErrors() { |
| 162 | + return array_merge( parent::getPossibleErrors(), array( |
| 163 | + array( 'invalidtitle', 'title' ), |
| 164 | + array( |
| 165 | + 'code' => 'nologging', |
| 166 | + 'info' => 'Warning: action was not logged!' |
| 167 | + ), |
| 168 | + ) ); |
| 169 | + } |
| 170 | + |
| 171 | + public function getExamples() { |
| 172 | + return array( |
| 173 | + 'api.php?action=wikilove&title=User:Dummy&text=Love&subject=Hi&token=%2B\\', |
| 174 | + ); |
| 175 | + } |
| 176 | + |
| 177 | + public function getVersion() { |
| 178 | + return __CLASS__ . ': $Id$'; |
| 179 | + } |
| 180 | +} |
Property changes on: branches/wmf/1.17wmf1/extensions/WikiLove/ApiWikiLove.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 181 | + native |
Added: svn:keywords |
2 | 182 | + Id |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/WikiLove.i18n.php |
— | — | @@ -15,20 +15,22 @@ |
16 | 16 | 'wikilove-desc' => 'Adds an interface for facilitating positive user feedback to user talk pages', |
17 | 17 | 'wikilove' => 'WikiLove', |
18 | 18 | 'wikilove-enable-preference' => 'Enable showing appreciation for other users with the WikiLove tab (experimental)', |
19 | | - 'wikilove-tab-text' => 'Show appreciation', |
| 19 | + 'wikilove-tab-text' => 'WikiLove', |
20 | 20 | 'tooltip-ca-wikilove' => 'Post a message for this user showing your appreciation', |
21 | | - 'wikilove-dialog-title' => 'WikiLove', |
| 21 | + 'wikilove-dialog-title' => 'WikiLove – Send a message of appreciation to another user', |
22 | 22 | 'wikilove-select-type' => 'Select type', |
23 | 23 | 'wikilove-get-started-header' => "Let's get started!", |
24 | 24 | 'wikilove-get-started-list-1' => 'Select the type of WikiLove you wish to send', |
25 | 25 | 'wikilove-get-started-list-2' => 'Add details to your WikiLove', |
26 | 26 | 'wikilove-get-started-list-3' => 'Send your WikiLove!', |
27 | 27 | 'wikilove-add-details' => 'Add details', |
28 | | - 'wikilove-image' => 'Image:', |
29 | | - 'wikilove-header' => 'Header:', |
30 | | - 'wikilove-title' => 'Title:', |
| 28 | + 'wikilove-image' => 'Enter an image filename:', |
| 29 | + 'wikilove-select-image' => 'Select an image:', |
| 30 | + 'wikilove-header' => 'Enter a header:', |
| 31 | + 'wikilove-title' => 'Enter an award title:', |
31 | 32 | 'wikilove-enter-message' => 'Enter a message:', |
32 | 33 | 'wikilove-omit-sig' => '(without a signature)', |
| 34 | + 'wikilove-image-example' => '(example: Trophy.png)', |
33 | 35 | 'wikilove-button-preview' => 'Preview', |
34 | 36 | 'wikilove-preview' => 'Preview', |
35 | 37 | 'wikilove-notify' => 'Notify the user by e-mail', |
— | — | @@ -38,19 +40,30 @@ |
39 | 41 | 'wikilove-err-title' => 'Please enter a title.', |
40 | 42 | 'wikilove-err-msg' => 'Please enter a message.', |
41 | 43 | 'wikilove-err-image' => 'Please select an image.', |
| 44 | + 'wikilove-err-image-bad' => 'Image does not exist.', |
| 45 | + 'wikilove-err-image-api' => 'Something went wrong when retrieving the image. Please try again.', |
42 | 46 | 'wikilove-err-sig' => 'Please do not include a signature in the message.', |
43 | | - 'wikilove-err-gallery' => 'Something went wrong when loading the images!', |
| 47 | + 'wikilove-err-gallery' => 'Something went wrong when loading the images.', |
44 | 48 | 'wikilove-err-gallery-again' => 'Try again', |
45 | | - 'wikilove-summary' => '/* $1 */ new WikiLove message' |
| 49 | + 'wikilove-err-preview-api' => 'Something went wrong during previewing. Please try again.', |
| 50 | + 'wikilove-err-send-api' => 'Something went wrong when sending the message. Please try again.', |
| 51 | + 'wikilove-summary' => '/* $1 */ new WikiLove message', |
| 52 | + 'wikilove-what-is-this' => "What is this?", |
| 53 | + 'wikilove-anon-warning' => 'Note: This user is not registered, he or she may not notice this message.', |
| 54 | + 'wikilove-commons-text' => 'You can find images by browsing $1.', |
| 55 | + 'wikilove-commons-link' => 'Wikimedia Commons', |
| 56 | + 'wikilove-commons-url' => 'http://commons.wikimedia.org', |
46 | 57 | ); |
47 | 58 | |
48 | 59 | /** Message documentation (Message documentation) |
49 | 60 | * @author McDutchie |
50 | 61 | */ |
51 | 62 | $messages['qqq'] = array( |
| 63 | + 'wikilove-image-example' => 'The filename should be an actual image on Wikimedia Commons.', |
52 | 64 | 'wikilove-button-preview' => 'Button text. Verb.', |
53 | 65 | 'wikilove-preview' => 'Title. Noun.', |
54 | | - 'wikilove-barnstar-header' => 'See [[:wikipedia:Barnstar]]. Probably not literally translatable.', |
| 66 | + 'wikilove-commons-text' => '$1 gets replaced by a link with wikilove-commons-link as caption and wikilove-commons-url as URL.', |
| 67 | + 'wikilove-commons-url' => 'This URL can be changed to point at a localised page on Wikimedia Commons.', |
55 | 68 | ); |
56 | 69 | |
57 | 70 | /** Bulgarian (Български) |
— | — | @@ -58,50 +71,133 @@ |
59 | 72 | */ |
60 | 73 | $messages['bg'] = array( |
61 | 74 | 'wikilove' => 'УикиОбич', |
62 | | - 'wikilove-dialog-title' => 'УикиОбич', |
| 75 | + 'wikilove-tab-text' => 'УикиОбич', |
| 76 | + 'wikilove-dialog-title' => 'УикиОбич - Изпращане на благодарствено съобщение на друг потребител', |
| 77 | + 'wikilove-add-details' => 'Добавяне на подробности', |
| 78 | + 'wikilove-select-image' => 'Избиране на изображение:', |
63 | 79 | 'wikilove-omit-sig' => '(без подпис)', |
| 80 | + 'wikilove-image-example' => '(пример: Trophy.png)', |
64 | 81 | 'wikilove-button-preview' => 'Предварителен преглед', |
65 | 82 | 'wikilove-preview' => 'Предварителен преглед', |
| 83 | + 'wikilove-notify' => 'Уведомяване на потребителя на електронната поща', |
66 | 84 | 'wikilove-button-send' => 'Изпращане на УикиОбич', |
| 85 | + 'wikilove-err-image-bad' => 'Изображението не съществува.', |
| 86 | + 'wikilove-err-sig' => 'В съобщението не трябва да се вклчва подпис.', |
| 87 | + 'wikilove-err-gallery' => 'Възникна грешка при зареждане на изображенията!', |
67 | 88 | 'wikilove-err-gallery-again' => 'Опитайте отново', |
| 89 | + 'wikilove-summary' => '/* $1 */ ново съобщение за УикиОбич', |
| 90 | + 'wikilove-what-is-this' => 'Какво е това?', |
68 | 91 | ); |
69 | 92 | |
| 93 | +/** Breton (Brezhoneg) |
| 94 | + * @author Fulup |
| 95 | + */ |
| 96 | +$messages['br'] = array( |
| 97 | + 'wikilove-desc' => 'Ouzhpennañ a ra un etrefas evit aesaat merkañ evezhiadennoù pozitivel war pajenn gaozeal un implijer', |
| 98 | + 'wikilove' => 'WikiLove', |
| 99 | + 'wikilove-enable-preference' => 'Aotren a ra diskouez priziadennoù evit implijerien all gant an ivinell WikiLove (arnodel)', |
| 100 | + 'wikilove-tab-text' => 'WikiLove', |
| 101 | + 'tooltip-ca-wikilove' => 'Lakaat ur gemennadenn evit an implijer-mañ da ziskouez e priziit an traoù', |
| 102 | + 'wikilove-dialog-title' => "WikiLove – Kas ur gemennadenn pe ur soñj bennak d'un implijer all", |
| 103 | + 'wikilove-select-type' => 'Diuzañ ur seurt', |
| 104 | + 'wikilove-get-started-header' => 'Krogomp ganti !', |
| 105 | + 'wikilove-get-started-list-1' => "Diuzit ar seurt WikiLove hoc'h eus c'hoant da gas", |
| 106 | + 'wikilove-get-started-list-2' => "Ouzhpennit titouroù d'ho WikiLove", |
| 107 | + 'wikilove-get-started-list-3' => 'Kasit ho WikiLove !', |
| 108 | + 'wikilove-add-details' => 'Ouzhpennañ titouroù', |
| 109 | + 'wikilove-image' => 'Lakat ur skeudenn eus Wikimedia Commons :', |
| 110 | + 'wikilove-select-image' => 'Diuzañ ur skeudenn :', |
| 111 | + 'wikilove-header' => 'Lakaat un talbenn :', |
| 112 | + 'wikilove-title' => 'Lakaat un titl :', |
| 113 | + 'wikilove-enter-message' => 'Lakaat ur gemennadenn', |
| 114 | + 'wikilove-omit-sig' => '(hep sinadur)', |
| 115 | + 'wikilove-button-preview' => 'Rakwelet', |
| 116 | + 'wikilove-preview' => 'Rakwelet', |
| 117 | + 'wikilove-notify' => "Kas ur c'hemenn dre bostel d'an implijer", |
| 118 | + 'wikilove-button-send' => 'Kas ar WikiLove', |
| 119 | + 'wikilove-type-makeyourown' => "Krouit ho-hini deoc'h-c'hwi", |
| 120 | + 'wikilove-err-header' => 'Merkit un talbenn.', |
| 121 | + 'wikilove-err-title' => 'Merkit un titl.', |
| 122 | + 'wikilove-err-msg' => 'Merkit ur gemennadenn.', |
| 123 | + 'wikilove-err-image' => 'Diuzit ur skeudenn.', |
| 124 | + 'wikilove-err-sig' => 'Arabat sinañ ar gemennadenn.', |
| 125 | + 'wikilove-err-gallery' => "Un dra bennak a-dreuz zo c'hoarvezet en ur gargañ ar skeudennoù !", |
| 126 | + 'wikilove-err-gallery-again' => 'Klask en-dro', |
| 127 | + 'wikilove-summary' => '/* $1 */ kemennadenn WikiLove nevez', |
| 128 | +); |
| 129 | + |
| 130 | +/** Bosnian (Bosanski) |
| 131 | + * @author CERminator |
| 132 | + */ |
| 133 | +$messages['bs'] = array( |
| 134 | + 'wikilove-select-type' => 'Odaberite vrstu', |
| 135 | + 'wikilove-add-details' => 'Dodaj detalje', |
| 136 | + 'wikilove-enter-message' => 'Unesite poruku:', |
| 137 | + 'wikilove-button-preview' => 'Pregled', |
| 138 | + 'wikilove-preview' => 'Pregled', |
| 139 | +); |
| 140 | + |
70 | 141 | /** German (Deutsch) |
71 | 142 | * @author Kghbln |
72 | 143 | */ |
73 | 144 | $messages['de'] = array( |
74 | 145 | 'wikilove-desc' => 'Ergänzt ein Hilfsmittel zum Ausdrücken persönlicher Wertschätzung gegenüber einem Benutzer auf dessen Diskussionsseite', |
75 | | - 'wikilove' => 'Wikiliebe', |
| 146 | + 'wikilove' => 'Wertschätzung', |
76 | 147 | 'wikilove-enable-preference' => 'Menüreiter für das Hilfsmittel zum Ausdrücken persönlicher Wertschätzung gegenüber einem anderen Benutzer aktivieren (experimentell)', |
77 | 148 | 'wikilove-tab-text' => 'Wertschätzen', |
78 | 149 | 'tooltip-ca-wikilove' => 'Diesem Benutzer die persönliche Wertschätzung in Form einer Nachricht hinterlassen', |
79 | | - 'wikilove-dialog-title' => 'Persönliche Wertschätzung', |
| 150 | + 'wikilove-dialog-title' => 'Eine Nachricht der Wertschätzung an einen anderen Benutzer senden', |
80 | 151 | 'wikilove-select-type' => 'Art auswählen', |
81 | 152 | 'wikilove-get-started-header' => 'Los geht’s!', |
82 | 153 | 'wikilove-get-started-list-1' => 'Die Art der persönlichen Wertschätzung auswählen, die ausgedrückt werden soll', |
83 | 154 | 'wikilove-get-started-list-2' => 'Persönliche Wertschätzung ergänzen', |
84 | 155 | 'wikilove-get-started-list-3' => 'Persönliche Wertschätzung senden', |
85 | 156 | 'wikilove-add-details' => 'Ergänzungen hinzufügen', |
86 | | - 'wikilove-image' => 'Bild:', |
87 | | - 'wikilove-header' => 'Kopfbereich:', |
88 | | - 'wikilove-title' => 'Titel:', |
89 | | - 'wikilove-enter-message' => 'Eine Nachricht erfassen:', |
| 157 | + 'wikilove-image' => 'Gib den Namen der Bilddatei an:', |
| 158 | + 'wikilove-select-image' => 'Wähle ein Bild aus:', |
| 159 | + 'wikilove-header' => 'Gib den Inhalt des Kopfbereichs ein:', |
| 160 | + 'wikilove-title' => 'Gib den Titel für die Wertschätzung ein:', |
| 161 | + 'wikilove-enter-message' => 'Gibt eine Nachricht ein:', |
90 | 162 | 'wikilove-omit-sig' => '(ohne Signatur)', |
| 163 | + 'wikilove-image-example' => '(Beispiel: Drei Sonnenblumen im Feld.JPG)', |
91 | 164 | 'wikilove-button-preview' => 'Vorschau', |
92 | 165 | 'wikilove-preview' => 'Vorschau', |
93 | 166 | 'wikilove-notify' => 'Den Benutzer per E-Mail benachrichtigen', |
94 | 167 | 'wikilove-button-send' => 'Persönliche Wertschätzung senden', |
95 | 168 | 'wikilove-type-makeyourown' => 'Eigene Art der Wertschätzung erstellen', |
96 | | - 'wikilove-err-header' => 'Bitte einen Kopfbereich eingeben.', |
| 169 | + 'wikilove-err-header' => 'Bitte den Inhalt für den Kopfbereich eingeben.', |
97 | 170 | 'wikilove-err-title' => 'Bitte einen Titel eingeben.', |
98 | 171 | 'wikilove-err-msg' => 'Bitte eine Nachricht eingeben.', |
99 | 172 | 'wikilove-err-image' => 'Bitte ein Bild auswählen.', |
| 173 | + 'wikilove-err-image-bad' => 'Das Bild ist nicht vorhanden.', |
| 174 | + 'wikilove-err-image-api' => 'Während des Abrufens des Bildes ist ein Fehler aufgetreten. Bitte versuche es erneut.', |
100 | 175 | 'wikilove-err-sig' => 'Bitte keine Signatur im Nachrichtentext eingeben.', |
101 | | - 'wikilove-err-gallery' => 'Etwas ist beim Laden der Bilder schief gelaufen.', |
102 | | - 'wikilove-err-gallery-again' => 'Bitte erneut versuchen', |
| 176 | + 'wikilove-err-gallery' => 'Während des Ladens der Bilder ist ein Fehler aufgetreten.', |
| 177 | + 'wikilove-err-gallery-again' => 'Bitte versuche es erneut.', |
| 178 | + 'wikilove-err-preview-api' => 'Während der Vorschau ist ein Fehler aufgetreten. Bitte versuche es erneut.', |
| 179 | + 'wikilove-err-send-api' => 'Während des Sendens der Wertschätzung ist ein Fehler aufgetreten. Bitte versuche es erneut.', |
103 | 180 | 'wikilove-summary' => '/* $1 */ neue persönliche Wertschätzung', |
| 181 | + 'wikilove-what-is-this' => 'Worum handelt es sich?', |
| 182 | + 'wikilove-anon-warning' => 'Hinweis: Es handelt sich um einen Benutzer ohne Benutzerkonto. Daher wird er oder sie die Nachricht wahrscheinlich nicht bemerken.', |
| 183 | + 'wikilove-commons-text' => 'Bilder können gefunden werden, indem man $1 durchsucht.', |
104 | 184 | ); |
105 | 185 | |
| 186 | +/** German (formal address) (Deutsch (Sie-Form)) |
| 187 | + * @author Kghbln |
| 188 | + */ |
| 189 | +$messages['de-formal'] = array( |
| 190 | + 'wikilove-image' => 'Geben Sie den Namen der Bilddatei an:', |
| 191 | + 'wikilove-select-image' => 'Wählen Sie ein Bild aus:', |
| 192 | + 'wikilove-header' => 'Geben Sie den Inhalt des Kopfbereichs ein:', |
| 193 | + 'wikilove-title' => 'Geben Sie den Titel für die Wertschätzung ein:', |
| 194 | + 'wikilove-enter-message' => 'Geben Sie eine Nachricht ein:', |
| 195 | + 'wikilove-err-image-api' => 'Während des Abrufens des Bildes ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.', |
| 196 | + 'wikilove-err-gallery' => 'Während des Ladens der Bilder ist ein Fehler aufgetreten.', |
| 197 | + 'wikilove-err-gallery-again' => 'Bitte versuchen Sie es erneut.', |
| 198 | + 'wikilove-err-preview-api' => 'Während der Vorschau ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.', |
| 199 | + 'wikilove-err-send-api' => 'Während des Sendens der Wertschätzung ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.', |
| 200 | +); |
| 201 | + |
106 | 202 | /** French (Français) |
107 | 203 | * @author Crochet.david |
108 | 204 | * @author IAlex |
— | — | @@ -123,7 +219,7 @@ |
124 | 220 | 'wikilove-add-details' => 'Ajouter des détails', |
125 | 221 | 'wikilove-image' => 'Image :', |
126 | 222 | 'wikilove-header' => 'En-tête :', |
127 | | - 'wikilove-title' => 'Titre :', |
| 223 | + 'wikilove-title' => 'Entrez un titre :', |
128 | 224 | 'wikilove-enter-message' => 'Entrez un message :', |
129 | 225 | 'wikilove-omit-sig' => '(sans signature)', |
130 | 226 | 'wikilove-button-preview' => 'Prévisualiser', |
— | — | @@ -138,6 +234,7 @@ |
139 | 235 | 'wikilove-err-sig' => "S'il vous plaît ne pas inclure une signature dans le message.", |
140 | 236 | 'wikilove-err-gallery' => "Quelque chose n'a pas fonctionné lors du chargement des images !", |
141 | 237 | 'wikilove-err-gallery-again' => 'Essayez à nouveau', |
| 238 | + 'wikilove-summary' => '/* $1 */ nouveau message WikiLove', |
142 | 239 | ); |
143 | 240 | |
144 | 241 | /** Franco-Provençal (Arpetan) |
— | — | @@ -178,18 +275,19 @@ |
179 | 276 | 'wikilove-desc' => 'Engade unha interface para facilitar a mostra de aprecio cara a un usuario na súa páxina de conversa', |
180 | 277 | 'wikilove' => 'Amor wiki', |
181 | 278 | 'wikilove-enable-preference' => 'Activar o envío de mostras de aprecio aos outros usuarios mediante a lapela de amor wiki (experimental)', |
182 | | - 'wikilove-tab-text' => 'Mostrar o aprecio', |
| 279 | + 'wikilove-tab-text' => 'Amor wiki', |
183 | 280 | 'tooltip-ca-wikilove' => 'Déixelle unha mensaxe a este usuario mostrando o seu aprecio', |
184 | | - 'wikilove-dialog-title' => 'Amor wiki', |
| 281 | + 'wikilove-dialog-title' => 'Amor wiki - Envíe unha mensaxe de aprecio a outro usuario', |
185 | 282 | 'wikilove-select-type' => 'Seleccione o tipo', |
186 | 283 | 'wikilove-get-started-header' => 'Comecemos!', |
187 | 284 | 'wikilove-get-started-list-1' => 'Seleccione tipo de amor wiki que queira enviar', |
188 | 285 | 'wikilove-get-started-list-2' => 'Engadir detalles ao seu amor wiki', |
189 | 286 | 'wikilove-get-started-list-3' => 'Enviar o seu amor wiki!', |
190 | 287 | 'wikilove-add-details' => 'Engadir detalles', |
191 | | - 'wikilove-image' => 'Imaxe:', |
192 | | - 'wikilove-header' => 'Cabeceira:', |
193 | | - 'wikilove-title' => 'Título:', |
| 288 | + 'wikilove-image' => 'Insira unha imaxe da Wikimedia Commons:', |
| 289 | + 'wikilove-select-image' => 'Seleccione unha imaxe:', |
| 290 | + 'wikilove-header' => 'Insira unha cabeceira:', |
| 291 | + 'wikilove-title' => 'Insira un título:', |
194 | 292 | 'wikilove-enter-message' => 'Escriba unha mensaxe:', |
195 | 293 | 'wikilove-omit-sig' => '(sen sinatura)', |
196 | 294 | 'wikilove-button-preview' => 'Vista previa', |
— | — | @@ -205,6 +303,7 @@ |
206 | 304 | 'wikilove-err-gallery' => 'Houbo un problema ao cargar as imaxes!', |
207 | 305 | 'wikilove-err-gallery-again' => 'Inténteo de novo', |
208 | 306 | 'wikilove-summary' => '/* $1 */ nova mensaxe de amor wiki', |
| 307 | + 'wikilove-what-is-this' => 'Que é isto?', |
209 | 308 | ); |
210 | 309 | |
211 | 310 | /** Hebrew (עברית) |
— | — | @@ -214,16 +313,17 @@ |
215 | 314 | 'wikilove-desc' => 'הוספת ממשק לשליחת תגובות חיוביות לדפי שיחת משתמש', |
216 | 315 | 'wikilove' => 'ויקי־אהבה', |
217 | 316 | 'wikilove-enable-preference' => 'הפעלה של הצגת הערכה למשתמשים אחרים באמצעות לשונית ויקי־אהבה (ניסיוני)', |
218 | | - 'wikilove-tab-text' => 'להראות הערכה', |
| 317 | + 'wikilove-tab-text' => 'ויקי־אהבה', |
219 | 318 | 'tooltip-ca-wikilove' => 'לשלוח למשתמש הזה הודעה שמראה את הערכתך', |
220 | | - 'wikilove-dialog-title' => 'ויקי־אהבה', |
| 319 | + 'wikilove-dialog-title' => 'ויקי־אהבה – שליחת הודעת הערכה למשתמש אחר', |
221 | 320 | 'wikilove-select-type' => 'בחירת סוג', |
222 | 321 | 'wikilove-get-started-header' => 'בואו נתחיל!', |
223 | 322 | 'wikilove-get-started-list-1' => 'איזה סוג של ויקי־אהבה לשלוח', |
224 | 323 | 'wikilove-get-started-list-2' => 'להוסיף פרטים להודעת ויקי־אהבה', |
225 | 324 | 'wikilove-get-started-list-3' => 'לשלוח ויקי־אהבה!', |
226 | 325 | 'wikilove-add-details' => 'הוספת פרטים', |
227 | | - 'wikilove-image' => 'תמונה:', |
| 326 | + 'wikilove-image' => 'שם קובץ תמונה:', |
| 327 | + 'wikilove-select-image' => 'בחירת תמונה:', |
228 | 328 | 'wikilove-header' => 'כותרת פסקה:', |
229 | 329 | 'wikilove-title' => 'שם הצל"ש:', |
230 | 330 | 'wikilove-enter-message' => 'הודעה:', |
— | — | @@ -238,6 +338,10 @@ |
239 | 339 | 'wikilove-err-msg' => 'נא להזין הודעה.', |
240 | 340 | 'wikilove-err-image' => 'נא לבחור תמונה.', |
241 | 341 | 'wikilove-err-sig' => 'נא לא לכתוב חתימה בהודעה.', |
| 342 | + 'wikilove-err-gallery' => 'משהו השתבש בעת טעינת התמונות!', |
| 343 | + 'wikilove-err-gallery-again' => 'לנסות שוב', |
| 344 | + 'wikilove-summary' => '/* $1 */ הודעת ויקי־אהבה חדשה', |
| 345 | + 'wikilove-what-is-this' => 'מה זה?', |
242 | 346 | ); |
243 | 347 | |
244 | 348 | /** Hungarian (Magyar) |
— | — | @@ -245,17 +349,22 @@ |
246 | 350 | */ |
247 | 351 | $messages['hu'] = array( |
248 | 352 | 'wikilove' => 'Wikibók', |
249 | | - 'wikilove-dialog-title' => 'Wikibók', |
| 353 | + 'wikilove-tab-text' => 'Wikibók', |
| 354 | + 'tooltip-ca-wikilove' => 'Elismerő üzenet küldése ennek a felhasználónak', |
| 355 | + 'wikilove-dialog-title' => 'Wikibók – Küldj elismerő üzenetet egy másik felhasználónak', |
250 | 356 | 'wikilove-select-type' => 'Válassz típust', |
| 357 | + 'wikilove-get-started-header' => 'Kezdjük!', |
251 | 358 | 'wikilove-get-started-list-1' => 'Válaszd ki a wikibók típusát', |
252 | 359 | 'wikilove-get-started-list-2' => 'Töltsd ki a részleteket', |
253 | 360 | 'wikilove-get-started-list-3' => 'Küldd el a wikibókot!', |
254 | 361 | 'wikilove-add-details' => 'Részletek', |
255 | | - 'wikilove-image' => 'Kép:', |
256 | | - 'wikilove-header' => 'Fejléc:', |
| 362 | + 'wikilove-image' => 'Képfájl a Wikimédia Commonsról:', |
| 363 | + 'wikilove-select-image' => 'Válassz egy képet:', |
| 364 | + 'wikilove-header' => 'A fejléc tartalma:', |
257 | 365 | 'wikilove-title' => 'Cím:', |
258 | 366 | 'wikilove-enter-message' => 'Üzenet:', |
259 | 367 | 'wikilove-omit-sig' => '(aláírás nélkül)', |
| 368 | + 'wikilove-image-example' => '(példa: Trophy.png)', |
260 | 369 | 'wikilove-button-preview' => 'Előnézet', |
261 | 370 | 'wikilove-preview' => 'Előnézet', |
262 | 371 | 'wikilove-notify' => 'Felhasználó értesítése e-mailben', |
— | — | @@ -265,9 +374,13 @@ |
266 | 375 | 'wikilove-err-title' => 'Add meg a címet!', |
267 | 376 | 'wikilove-err-msg' => 'Add meg az üzenetet!', |
268 | 377 | 'wikilove-err-image' => 'Válassz egy képet!', |
| 378 | + 'wikilove-err-image-bad' => 'A kép nem létezik.', |
| 379 | + 'wikilove-err-image-api' => 'Képellenőrzés sikertelen.', |
269 | 380 | 'wikilove-err-sig' => 'Ne helyezz el aláírást az üzenetben!', |
270 | 381 | 'wikilove-err-gallery' => 'Valami hiba történt a képek betöltése közben!', |
271 | 382 | 'wikilove-err-gallery-again' => 'Újrapróbálkozás', |
| 383 | + 'wikilove-summary' => '/* $1 */ Új wikibók', |
| 384 | + 'wikilove-what-is-this' => 'Mi ez?', |
272 | 385 | ); |
273 | 386 | |
274 | 387 | /** Interlingua (Interlingua) |
— | — | @@ -277,20 +390,22 @@ |
278 | 391 | 'wikilove-desc' => 'Adde un interfacie pro exprimer appreciation in le paginas de discussion de usatores', |
279 | 392 | 'wikilove' => 'WikiLove', |
280 | 393 | 'wikilove-enable-preference' => 'Permitter monstrar appreciation pro altere usatores con le scheda WikiLove (experimental)', |
281 | | - 'wikilove-tab-text' => 'Monstrar appreciation', |
| 394 | + 'wikilove-tab-text' => 'WikiLove', |
282 | 395 | 'tooltip-ca-wikilove' => 'Publicar un message pro iste usator que monstra tu appreciation', |
283 | | - 'wikilove-dialog-title' => 'WikiLove', |
| 396 | + 'wikilove-dialog-title' => 'WikiLove: Inviar un message de appreciation a un altere usator', |
284 | 397 | 'wikilove-select-type' => 'Selige typo', |
285 | 398 | 'wikilove-get-started-header' => 'Nos comencia!', |
286 | 399 | 'wikilove-get-started-list-1' => 'Selige le typo de WikiLove que tu vole inviar', |
287 | 400 | 'wikilove-get-started-list-2' => 'Adde detalios a tu WikiLove', |
288 | 401 | 'wikilove-get-started-list-3' => 'Invia tu WikiLove!', |
289 | 402 | 'wikilove-add-details' => 'Adder detalios', |
290 | | - 'wikilove-image' => 'Imagine:', |
291 | | - 'wikilove-header' => 'Capite:', |
292 | | - 'wikilove-title' => 'Titulo:', |
| 403 | + 'wikilove-image' => 'Entra le nomine de file de un imagine:', |
| 404 | + 'wikilove-select-image' => 'Selige un imagine:', |
| 405 | + 'wikilove-header' => 'Entra un texto de capite:', |
| 406 | + 'wikilove-title' => 'Entra le titulo de un premio:', |
293 | 407 | 'wikilove-enter-message' => 'Entra un message:', |
294 | 408 | 'wikilove-omit-sig' => '(sin signatura)', |
| 409 | + 'wikilove-image-example' => '(exemplo: Stella-Auro-Interlingua.jpg)', |
295 | 410 | 'wikilove-button-preview' => 'Previsualisar', |
296 | 411 | 'wikilove-preview' => 'Previsualisation', |
297 | 412 | 'wikilove-notify' => 'Notificar le usator per e-mail', |
— | — | @@ -300,9 +415,19 @@ |
301 | 416 | 'wikilove-err-title' => 'Per favor entra un titulo.', |
302 | 417 | 'wikilove-err-msg' => 'Per favor entra un message.', |
303 | 418 | 'wikilove-err-image' => 'Per favor selige un imagine.', |
| 419 | + 'wikilove-err-image-bad' => 'Le imagine non existe.', |
| 420 | + 'wikilove-err-image-api' => 'Un problema occurreva durante le obtention del imagine. Per favor reproba.', |
304 | 421 | 'wikilove-err-sig' => 'Per favor non include un signatura in le message.', |
305 | 422 | 'wikilove-err-gallery' => 'Un problema occurreva durante le cargamento del imagines!', |
306 | 423 | 'wikilove-err-gallery-again' => 'Reprobar', |
| 424 | + 'wikilove-err-preview-api' => 'Un problema occurreva durante le previsualisation. Per favor reproba.', |
| 425 | + 'wikilove-err-send-api' => 'Un problema occurreva durante le invio del message. Per favor reproba.', |
| 426 | + 'wikilove-summary' => '/* $1 */ nove message de WikiLove', |
| 427 | + 'wikilove-what-is-this' => 'Que es isto?', |
| 428 | + 'wikilove-anon-warning' => 'Nota: Iste usator non es registrate, e ille o illa non recipera notification de iste message.', |
| 429 | + 'wikilove-commons-text' => 'Tu pote trovar imagines in $1.', |
| 430 | + 'wikilove-commons-link' => 'Wikimedia Commons', |
| 431 | + 'wikilove-commons-url' => 'http://commons.wikimedia.org/wiki/Pagina_principal?uselang=ia', |
307 | 432 | ); |
308 | 433 | |
309 | 434 | /** Colognian (Ripoarisch) |
— | — | @@ -339,12 +464,17 @@ |
340 | 465 | 'wikilove-dialog-title' => 'WikiLove', |
341 | 466 | 'wikilove-get-started-header' => 'Elo geet et lass!', |
342 | 467 | 'wikilove-add-details' => 'Detailer derbäisetzen', |
343 | | - 'wikilove-image' => 'Bild:', |
344 | | - 'wikilove-title' => 'Titel:', |
| 468 | + 'wikilove-image' => 'Gitt e Bild un:', |
| 469 | + 'wikilove-select-image' => 'Sicht e Bild eraus:', |
| 470 | + 'wikilove-title' => 'Gitt en Titel un:', |
| 471 | + 'wikilove-enter-message' => 'Gitt e Message an:', |
| 472 | + 'wikilove-omit-sig' => '(ouni Ënnerschrëft)', |
345 | 473 | 'wikilove-button-preview' => 'Kucken ouni ofzespäicheren', |
346 | 474 | 'wikilove-preview' => 'Kucken ouni ofzespäicheren', |
| 475 | + 'wikilove-notify' => 'De Benotzer per Mail informéieren', |
| 476 | + 'wikilove-type-makeyourown' => 'Maacht Ären Eegenen', |
347 | 477 | 'wikilove-err-image' => 'Sicht w.e.g. e Bild eraus.', |
348 | | - 'wikilove-barnstar-header' => 'Een Uerde fir Iech!', |
| 478 | + 'wikilove-err-gallery-again' => 'Probéiert nach emol', |
349 | 479 | ); |
350 | 480 | |
351 | 481 | /** Macedonian (Македонски) |
— | — | @@ -354,20 +484,22 @@ |
355 | 485 | 'wikilove-desc' => 'Додава посредник за искажување на позитивни мислења и поддршка на кориснички страници за разговор', |
356 | 486 | 'wikilove' => 'ВикиЉубов', |
357 | 487 | 'wikilove-enable-preference' => 'Овозможи оддавање на признанија и заслуги со јазичето ВикиЉубов (експериментално)', |
358 | | - 'wikilove-tab-text' => 'Оддај признание', |
| 488 | + 'wikilove-tab-text' => 'ВикиЉубов', |
359 | 489 | 'tooltip-ca-wikilove' => 'Оставете му порака на корисников кажувајќи му дека го цените', |
360 | | - 'wikilove-dialog-title' => 'ВикиЉубов', |
| 490 | + 'wikilove-dialog-title' => 'ВикиЉубов - испратете порака на корисник, оддавајќи му признание за работата', |
361 | 491 | 'wikilove-select-type' => 'Одберете тип', |
362 | 492 | 'wikilove-get-started-header' => 'Да почнеме!', |
363 | 493 | 'wikilove-get-started-list-1' => 'Одберете го типот на ВикиЉубов што сакате да ја испратите', |
364 | 494 | 'wikilove-get-started-list-2' => 'Внесете содржина на ВикиЉубов-та', |
365 | 495 | 'wikilove-get-started-list-3' => 'Испратете ја вашата ВикиЉубов', |
366 | 496 | 'wikilove-add-details' => 'Внесете содржина', |
367 | | - 'wikilove-image' => 'Слика:', |
368 | | - 'wikilove-header' => 'Заглавие:', |
369 | | - 'wikilove-title' => 'Наслов:', |
| 497 | + 'wikilove-image' => 'Внесете име на слика:', |
| 498 | + 'wikilove-select-image' => 'Одберете слика:', |
| 499 | + 'wikilove-header' => 'Внесете заглавие:', |
| 500 | + 'wikilove-title' => 'Внесете назив на наградата:', |
370 | 501 | 'wikilove-enter-message' => 'Внесете порака:', |
371 | 502 | 'wikilove-omit-sig' => '(без потпис)', |
| 503 | + 'wikilove-image-example' => '(пример: Trophy.png)', |
372 | 504 | 'wikilove-button-preview' => 'Преглед', |
373 | 505 | 'wikilove-preview' => 'Преглед', |
374 | 506 | 'wikilove-notify' => 'Извести го корисникот по е-пошта', |
— | — | @@ -377,32 +509,79 @@ |
378 | 510 | 'wikilove-err-title' => 'Внесете наслов.', |
379 | 511 | 'wikilove-err-msg' => 'Внесете порака.', |
380 | 512 | 'wikilove-err-image' => 'Одберете слика.', |
| 513 | + 'wikilove-err-image-bad' => 'Сликата не постои.', |
| 514 | + 'wikilove-err-image-api' => 'Се појави проблем при преземањето на сликата. Обидете се повторно.', |
381 | 515 | 'wikilove-err-sig' => 'Не ставајте потпис во пораката.', |
382 | 516 | 'wikilove-err-gallery' => 'Се појави грешка при вчитувањето на сликите!', |
383 | 517 | 'wikilove-err-gallery-again' => 'Обиди се повторно', |
| 518 | + 'wikilove-err-preview-api' => 'Се појави проблем при прегледувањето. Обидете се повторно.', |
| 519 | + 'wikilove-err-send-api' => 'Се појави проблем при испраќањето на пораката. Обидете се повторно.', |
384 | 520 | 'wikilove-summary' => '/* $1 */ нова порака (ВикиЉубов)', |
| 521 | + 'wikilove-what-is-this' => 'Што е ова?', |
| 522 | + 'wikilove-anon-warning' => 'Напомена: Корисникот не е регистриран, па затоа може да не ја примети поракава.', |
| 523 | + 'wikilove-commons-text' => 'Слики можете да најдете во проектот $1.', |
385 | 524 | ); |
386 | 525 | |
| 526 | +/** Malayalam (മലയാളം) |
| 527 | + * @author Praveenp |
| 528 | + */ |
| 529 | +$messages['ml'] = array( |
| 530 | + 'wikilove-desc' => 'ഉപയോക്താക്കൾക്ക് സംവാദം താളുകൾ വഴി ഗുണാത്മക അഭിപ്രായങ്ങൾ പ്രകടിപ്പിക്കാനുള്ള സമ്പർക്കമുഖം കൂട്ടിച്ചേർക്കുന്നു', |
| 531 | + 'wikilove' => 'വിക്കിലവ്', |
| 532 | + 'wikilove-enable-preference' => 'വിക്കിലവ് റ്റാബ് ഉപയോഗിച്ച് മറ്റ് ഉപയോക്താക്കളെ അഭിനന്ദനങ്ങൾ അറിയിക്കൽ സജ്ജമാക്കുക (പരീക്ഷണാടിസ്ഥാനം)', |
| 533 | + 'wikilove-tab-text' => 'വിക്കിലവ്', |
| 534 | + 'tooltip-ca-wikilove' => 'താങ്കളുടെ അഭിനന്ദനം അറിയിക്കാൻ ഈ ഉപയോക്താവിന് ഒരു സന്ദേശയമയ്ക്കുക', |
| 535 | + 'wikilove-dialog-title' => 'വിക്കിലവ് - മറ്റൊരു ഉപയോക്താവിനെ അഭിനന്ദനം അറിയിക്കാനൊരു സന്ദേശം നൽകുക', |
| 536 | + 'wikilove-select-type' => 'ഇനം തിരഞ്ഞെടുക്കുക', |
| 537 | + 'wikilove-get-started-header' => 'നമുക്ക് തുടങ്ങാം!', |
| 538 | + 'wikilove-get-started-list-1' => 'താങ്കൾ അയയ്ക്കാനാഗ്രഹിക്കുന്ന തരം വിക്കിലവ് തിരഞ്ഞെടുക്കുക', |
| 539 | + 'wikilove-get-started-list-2' => 'താങ്കളുടെ വിക്കിലവിലേയ്ക്ക് കൂടുതൽ വിവരങ്ങൾ കൂട്ടിച്ചേർക്കുക', |
| 540 | + 'wikilove-get-started-list-3' => 'താങ്കളുടെ വിക്കിലവ് അയയ്ക്കുക!', |
| 541 | + 'wikilove-add-details' => 'അധികവിവരങ്ങൾ ചേർക്കുക', |
| 542 | + 'wikilove-image' => 'വിക്കിമീഡിയ കോമൺസിൽ നിന്നുമുള്ള ഒരു ചിത്രം നൽകുക:', |
| 543 | + 'wikilove-select-image' => 'ചിത്രം തിരഞ്ഞെടുക്കുക:', |
| 544 | + 'wikilove-header' => 'തലക്കുറി നൽകുക:', |
| 545 | + 'wikilove-title' => 'തലക്കെട്ട് നൽകുക:', |
| 546 | + 'wikilove-enter-message' => 'സന്ദേശം നൽകുക:', |
| 547 | + 'wikilove-omit-sig' => '(ഒപ്പ് ചേർക്കേണ്ടതില്ല)', |
| 548 | + 'wikilove-button-preview' => 'എങ്ങനെയുണ്ടെന്നു കാണുക', |
| 549 | + 'wikilove-preview' => 'എങ്ങനെയുണ്ടെന്നു കാണുക', |
| 550 | + 'wikilove-notify' => 'ഉപയോക്താവിനെ ഇമെയിൽ വഴി അറിയിക്കുക', |
| 551 | + 'wikilove-button-send' => 'വിക്കിലവ് അയയ്ക്കുക', |
| 552 | + 'wikilove-type-makeyourown' => 'താങ്കളുടെ സ്വന്തമായ ഒരെണ്ണം സൃഷ്ടിക്കുക', |
| 553 | + 'wikilove-err-header' => 'ദയവായി ഒരു തലക്കുറി ചേർക്കുക.', |
| 554 | + 'wikilove-err-title' => 'ദയവായി തലക്കെട്ട് നൽകുക.', |
| 555 | + 'wikilove-err-msg' => 'ദയവായി ഒരു സന്ദേശം ചേർക്കുക.', |
| 556 | + 'wikilove-err-image' => 'ദയവായി ചിത്രം തിരഞ്ഞെടുക്കുക.', |
| 557 | + 'wikilove-err-sig' => 'ദയവായി സന്ദേശത്തിൽ ഒപ്പ് ഉൾപ്പെടുത്തരുത്.', |
| 558 | + 'wikilove-err-gallery' => 'ചിത്രങ്ങൾ ശേഖരിച്ചുകൊണ്ടിരിക്കെ എന്തോ കുഴപ്പമുണ്ടായി!', |
| 559 | + 'wikilove-err-gallery-again' => 'വീണ്ടും ശ്രമിക്കുക', |
| 560 | + 'wikilove-summary' => '/* $1 */ പുതിയ വിക്കിലവ് സന്ദേശം', |
| 561 | + 'wikilove-what-is-this' => 'എന്താണിത്?', |
| 562 | +); |
| 563 | + |
387 | 564 | /** Dutch (Nederlands) |
388 | 565 | * @author SPQRobin |
389 | 566 | * @author Siebrand |
| 567 | + * @author Tjcool007 |
390 | 568 | */ |
391 | 569 | $messages['nl'] = array( |
392 | 570 | 'wikilove-desc' => "Voegt een interface toe voor het geven van positieve terugkoppeling op overlegpagina's van gebruikers", |
393 | 571 | 'wikilove' => 'Wikiwaardering', |
394 | 572 | 'wikilove-enable-preference' => 'Waardering geven aan andere gebruikers via Wikiwaardering inschakelen (experimenteel)', |
395 | | - 'wikilove-tab-text' => 'Waardering tonen', |
| 573 | + 'wikilove-tab-text' => 'Wikiwaardering', |
396 | 574 | 'tooltip-ca-wikilove' => 'Plaats een bericht voor deze gebruiker om uw waardering te tonen', |
397 | | - 'wikilove-dialog-title' => 'Wikiwaardering', |
| 575 | + 'wikilove-dialog-title' => 'Wikiwaardering - stuur een boodschap van waardering naar een andere gebruiker', |
398 | 576 | 'wikilove-select-type' => 'Selecteer type', |
399 | 577 | 'wikilove-get-started-header' => 'Begin ermee!', |
400 | 578 | 'wikilove-get-started-list-1' => 'Selecteer het type Wikiwaardering dat u wilt achterlaten', |
401 | 579 | 'wikilove-get-started-list-2' => 'Voegt gegevens toe aan uw Wikiwaardering', |
402 | 580 | 'wikilove-get-started-list-3' => 'Uw Wikiwaardering verzenden!', |
403 | 581 | 'wikilove-add-details' => 'Gegevens toevoegen', |
404 | | - 'wikilove-image' => 'Afbeelding:', |
405 | | - 'wikilove-header' => 'Koptekst:', |
406 | | - 'wikilove-title' => 'Onderwerp:', |
| 582 | + 'wikilove-image' => 'Geef de bestandsnaam van een afbeelding op:', |
| 583 | + 'wikilove-select-image' => 'Kies een afbeelding', |
| 584 | + 'wikilove-header' => 'Geef een koptekst op:', |
| 585 | + 'wikilove-title' => 'Geef een onderwerp op:', |
407 | 586 | 'wikilove-enter-message' => 'Voer een bericht in:', |
408 | 587 | 'wikilove-omit-sig' => '(zonder ondertekening)', |
409 | 588 | 'wikilove-button-preview' => 'Voorvertoning', |
— | — | @@ -414,11 +593,21 @@ |
415 | 594 | 'wikilove-err-title' => 'Geef een naam op.', |
416 | 595 | 'wikilove-err-msg' => 'Geef een bericht op.', |
417 | 596 | 'wikilove-err-image' => 'Selecteer een afbeelding.', |
| 597 | + 'wikilove-err-image-bad' => 'Afbeelding bestaat niet.', |
418 | 598 | 'wikilove-err-sig' => 'Neem geen ondertekening op in dit bericht.', |
419 | 599 | 'wikilove-err-gallery' => 'Er iets misgegaan bij het laden van de afbeeldingen.', |
420 | 600 | 'wikilove-err-gallery-again' => 'Probeer het opnieuw', |
| 601 | + 'wikilove-summary' => '/* $1 */ nieuw Wikiwaarderingbericht', |
421 | 602 | ); |
422 | 603 | |
| 604 | +/** Pashto (پښتو) |
| 605 | + * @author Ahmed-Najib-Biabani-Ibrahimkhel |
| 606 | + */ |
| 607 | +$messages['ps'] = array( |
| 608 | + 'wikilove-image' => 'انځور:', |
| 609 | + 'wikilove-title' => 'سرليک:', |
| 610 | +); |
| 611 | + |
423 | 612 | /** Portuguese (Português) |
424 | 613 | * @author Hamilton Abreu |
425 | 614 | */ |
— | — | @@ -426,20 +615,22 @@ |
427 | 616 | 'wikilove-desc' => 'Adiciona uma interface para facilitar a colocação de demonstrações de apreço nas páginas de discussão dos utilizadores', |
428 | 617 | 'wikilove' => 'WikiApreço', |
429 | 618 | 'wikilove-enable-preference' => 'Permite enviar demonstrações de apreço a outros utilizadores usando o separador "WikiApreço" (experimental)', |
430 | | - 'wikilove-tab-text' => 'Demonstrar apreço', |
| 619 | + 'wikilove-tab-text' => 'WikiApreço', |
431 | 620 | 'tooltip-ca-wikilove' => 'Envie uma mensagem a este utilizador demonstrando o seu apreço', |
432 | | - 'wikilove-dialog-title' => 'WikiApreço', |
| 621 | + 'wikilove-dialog-title' => 'WikiApreço - Envie uma mensagem de apreço a outro utilizador', |
433 | 622 | 'wikilove-select-type' => 'Escolha o tipo', |
434 | 623 | 'wikilove-get-started-header' => 'Vamos começar!', |
435 | 624 | 'wikilove-get-started-list-1' => 'Escolha o tipo de WikiApreço que pretende enviar', |
436 | 625 | 'wikilove-get-started-list-2' => 'Acrescente detalhes ao seu WikiApreço', |
437 | 626 | 'wikilove-get-started-list-3' => 'Enviar o seu WikiApreço!', |
438 | 627 | 'wikilove-add-details' => 'Adicionar detalhes', |
439 | | - 'wikilove-image' => 'Imagem:', |
440 | | - 'wikilove-header' => 'Cabeçalho:', |
441 | | - 'wikilove-title' => 'Título:', |
| 628 | + 'wikilove-image' => 'Introduza o nome de uma imagem:', |
| 629 | + 'wikilove-select-image' => 'Seleccione uma imagem:', |
| 630 | + 'wikilove-header' => 'Introduza um cabeçalho:', |
| 631 | + 'wikilove-title' => 'Introduza o título de um prémio:', |
442 | 632 | 'wikilove-enter-message' => 'Introduza uma mensagem:', |
443 | 633 | 'wikilove-omit-sig' => '(sem assinatura)', |
| 634 | + 'wikilove-image-example' => '(exemplo: Troféu.png)', |
444 | 635 | 'wikilove-button-preview' => 'Antever', |
445 | 636 | 'wikilove-preview' => 'Antevisão', |
446 | 637 | 'wikilove-notify' => 'Notificar o utilizador por correio electrónico', |
— | — | @@ -449,18 +640,124 @@ |
450 | 641 | 'wikilove-err-title' => 'Introduza um título, por favor.', |
451 | 642 | 'wikilove-err-msg' => 'Introduza uma mensagem, por favor.', |
452 | 643 | 'wikilove-err-image' => 'Escolha uma imagem, por favor.', |
| 644 | + 'wikilove-err-image-bad' => 'A imagem não existe.', |
| 645 | + 'wikilove-err-image-api' => 'Ocorreu um erro ao aceder à imagem. Tente novamente, por favor.', |
453 | 646 | 'wikilove-err-sig' => 'Não inclua uma assinatura na mensagem, por favor.', |
454 | 647 | 'wikilove-err-gallery' => 'Ocorreu um erro ao carregar as imagens!', |
455 | 648 | 'wikilove-err-gallery-again' => 'Tente novamente', |
| 649 | + 'wikilove-err-preview-api' => 'Ocorreu um erro durante a antevisão. Tente novamente, por favor.', |
| 650 | + 'wikilove-err-send-api' => 'Ocorreu um erro ao enviar a mensagem. Tente novamente, por favor.', |
456 | 651 | 'wikilove-summary' => '/* $1 */ nova mensagem de WikiApreço', |
| 652 | + 'wikilove-what-is-this' => 'O que é isto?', |
| 653 | + 'wikilove-anon-warning' => 'Nota: Este utilizador não está registado e poderá não se aperceber desta mensagem.', |
| 654 | + 'wikilove-commons-text' => 'Pode encontrar imagens pesquisando-as em $1.', |
457 | 655 | ); |
458 | 656 | |
| 657 | +/** Tarandíne (Tarandíne) |
| 658 | + * @author Joetaras |
| 659 | + */ |
| 660 | +$messages['roa-tara'] = array( |
| 661 | + 'wikilove-err-gallery-again' => 'Pruève arrete', |
| 662 | +); |
| 663 | + |
| 664 | +/** Russian (Русский) |
| 665 | + * @author Александр Сигачёв |
| 666 | + */ |
| 667 | +$messages['ru'] = array( |
| 668 | + 'wikilove-desc' => 'Добавляет интерфейс для упрощения добавления положительных отзывов на страницы обсуждения участников', |
| 669 | + 'wikilove' => 'ВикиСимпатия', |
| 670 | + 'wikilove-enable-preference' => 'Включить вкладку ВикиСимпатия для выражения признательности другим пользователям (экспериментальная)', |
| 671 | + 'wikilove-tab-text' => 'ВикиСимпатия', |
| 672 | + 'tooltip-ca-wikilove' => 'Отправить сообщение для этого участника, выразить ему признательность', |
| 673 | + 'wikilove-dialog-title' => 'ВикиСимпатия — выразите признательность другому участнику', |
| 674 | + 'wikilove-select-type' => 'Выберите тип', |
| 675 | + 'wikilove-get-started-header' => 'Давайте начнём!', |
| 676 | + 'wikilove-get-started-list-1' => 'Выберите тип ВикиСимпатии, которую вы хотите выразить', |
| 677 | + 'wikilove-get-started-list-2' => 'Добавьте подробности к вашей ВикиСимпатии', |
| 678 | + 'wikilove-get-started-list-3' => 'Отправьте вашу ВикиСимпатию!', |
| 679 | + 'wikilove-add-details' => 'Добавить подробности', |
| 680 | + 'wikilove-image' => 'Введите имя файла с изображением:', |
| 681 | + 'wikilove-select-image' => 'Выберите изображение:', |
| 682 | + 'wikilove-header' => 'Введите заголовок:', |
| 683 | + 'wikilove-title' => 'Введите название награды:', |
| 684 | + 'wikilove-enter-message' => 'Введите сообщение:', |
| 685 | + 'wikilove-omit-sig' => '(без подписи)', |
| 686 | + 'wikilove-image-example' => '(например: Trophy.png)', |
| 687 | + 'wikilove-button-preview' => 'Предпросмотр', |
| 688 | + 'wikilove-preview' => 'Предпросмотр', |
| 689 | + 'wikilove-notify' => 'Уведомить участника по электронной почте', |
| 690 | + 'wikilove-button-send' => 'Отправить ВикиСимпатию', |
| 691 | + 'wikilove-type-makeyourown' => 'Сделать свой собственный', |
| 692 | + 'wikilove-err-header' => 'Пожалуйста, введите заголовок.', |
| 693 | + 'wikilove-err-title' => 'Пожалуйста, введите название.', |
| 694 | + 'wikilove-err-msg' => 'Пожалуйста, введите сообщение.', |
| 695 | + 'wikilove-err-image' => 'Пожалуйста, выберите изображение.', |
| 696 | + 'wikilove-err-image-bad' => 'Нет такого изображения.', |
| 697 | + 'wikilove-err-image-api' => 'Что-то пошло не так, при получении изображения. Пожалуйста, попробуйте ещё раз.', |
| 698 | + 'wikilove-err-sig' => 'Пожалуйста, не включайте подпись в сообщение.', |
| 699 | + 'wikilove-err-gallery' => 'Что-то пошло не так при загрузке изображений!', |
| 700 | + 'wikilove-err-gallery-again' => 'Попробуйте ещё раз', |
| 701 | + 'wikilove-err-preview-api' => 'Что-то пошло не так во время предпросмотра. Пожалуйста, попробуйте ещё раз.', |
| 702 | + 'wikilove-err-send-api' => 'Что-то пошло не так при отправке сообщения. Пожалуйста, попробуйте ещё раз.', |
| 703 | + 'wikilove-summary' => '/ * $1 * / новая ВикиСимпатия', |
| 704 | + 'wikilove-what-is-this' => 'Что это?', |
| 705 | + 'wikilove-anon-warning' => 'Примечание. Этот участник не зарегистрирован, он или она может не заметить это сообщение.', |
| 706 | + 'wikilove-commons-text' => 'Вы можете найти изображения в проекте $1.', |
| 707 | + 'wikilove-commons-link' => 'Викисклад', |
| 708 | + 'wikilove-commons-url' => 'http://commons.wikimedia.org/wiki/Main_Page?uselang=ru', |
| 709 | +); |
| 710 | + |
| 711 | +/** Slovenian (Slovenščina) |
| 712 | + * @author Dbc334 |
| 713 | + */ |
| 714 | +$messages['sl'] = array( |
| 715 | + 'wikilove-desc' => 'Doda vmesnik za olajšanje pozitivne povratne informacije uporabnika na uporabniških pogovornih straneh', |
| 716 | + 'wikilove' => 'WikiLjubezen', |
| 717 | + 'wikilove-enable-preference' => 'Omogoči izkazovanje hvaležnosti drugim uporabnikom z zavihkom WikiLjubezen (preizkusno)', |
| 718 | + 'wikilove-tab-text' => 'WikiLjubezen', |
| 719 | + 'tooltip-ca-wikilove' => 'Objavite sporočilo za tega uporabnika, s katerim boste izkazali svojo hvaležnost', |
| 720 | + 'wikilove-dialog-title' => 'WikiLjubezen – Pošljite drugemu uporabniku sporočilo hvaležnosti', |
| 721 | + 'wikilove-select-type' => 'Izberite vrsto', |
| 722 | + 'wikilove-get-started-header' => 'Začnimo!', |
| 723 | + 'wikilove-get-started-list-1' => 'Izberite vrsto WikiLjubezni, ki jo želite poslati', |
| 724 | + 'wikilove-get-started-list-2' => 'Dodajte podrobnosti svoji WikiLjubezni', |
| 725 | + 'wikilove-get-started-list-3' => 'Pošljite svojo WikiLjubezen!', |
| 726 | + 'wikilove-add-details' => 'Dodaj podrobnosti', |
| 727 | + 'wikilove-image' => 'Vnesite ime datoteke slike:', |
| 728 | + 'wikilove-select-image' => 'Izberite sliko:', |
| 729 | + 'wikilove-header' => 'Vnesite glavo:', |
| 730 | + 'wikilove-title' => 'Vnesite naslov nagrade:', |
| 731 | + 'wikilove-enter-message' => 'Vnesite sporočilo:', |
| 732 | + 'wikilove-omit-sig' => '(brez podpisa)', |
| 733 | + 'wikilove-image-example' => '(primer: Trophy.png)', |
| 734 | + 'wikilove-button-preview' => 'Predoglej', |
| 735 | + 'wikilove-preview' => 'Predogled', |
| 736 | + 'wikilove-notify' => 'Obvesti uporabnika po e-pošti', |
| 737 | + 'wikilove-button-send' => 'Pošljite WikiLjubezen', |
| 738 | + 'wikilove-type-makeyourown' => 'Naredite svojo', |
| 739 | + 'wikilove-err-header' => 'Prosimo, vnesite glavo.', |
| 740 | + 'wikilove-err-title' => 'Prosimo, vnesite naslov.', |
| 741 | + 'wikilove-err-msg' => 'Prosimo, vnesite sporočilo.', |
| 742 | + 'wikilove-err-image' => 'Prosimo, izberite sliko.', |
| 743 | + 'wikilove-err-image-bad' => 'Slika ne obstaja.', |
| 744 | + 'wikilove-err-image-api' => 'Med pridobivanjem slike je nekaj šlo narobe. Prosimo, poskusite znova.', |
| 745 | + 'wikilove-err-sig' => 'Prosimo, da v sporočilo ne vključite svojega podpisa.', |
| 746 | + 'wikilove-err-gallery' => 'Nekaj je šlo narobe pri nalaganju slik!', |
| 747 | + 'wikilove-err-gallery-again' => 'Poskusite znova', |
| 748 | + 'wikilove-err-preview-api' => 'Med predogledom je nekaj šlo narobe. Prosimo, poskusite znova.', |
| 749 | + 'wikilove-err-send-api' => 'Med pošiljanjem sporočila je nekaj šlo narobe. Prosimo, poskusite znova.', |
| 750 | + 'wikilove-summary' => '/* $1 */ novo sporočilo WikiLjubezen', |
| 751 | + 'wikilove-what-is-this' => 'Kaj je to?', |
| 752 | + 'wikilove-anon-warning' => 'Opomba: Uporabnik ni registriran, zato sporočila morda ne bo opazil.', |
| 753 | + 'wikilove-commons-text' => 'Slike lahko najdete z brskanjem po $1.', |
| 754 | +); |
| 755 | + |
459 | 756 | /** Telugu (తెలుగు) |
460 | 757 | * @author Veeven |
461 | 758 | */ |
462 | 759 | $messages['te'] = array( |
463 | 760 | 'wikilove-add-details' => 'వివరాలను చేర్చు', |
464 | | - 'wikilove-title' => 'శీర్షిక:', |
| 761 | + 'wikilove-title' => 'ఒక శీర్షికను ఇవ్వండి:', |
465 | 762 | ); |
466 | 763 | |
467 | 764 | /** Tagalog (Tagalog) |
— | — | @@ -488,3 +785,86 @@ |
489 | 786 | 'wikilove-type-makeyourown' => 'Gumawa ng sarili mo', |
490 | 787 | ); |
491 | 788 | |
| 789 | +/** Vietnamese (Tiếng Việt) |
| 790 | + * @author Minh Nguyen |
| 791 | + */ |
| 792 | +$messages['vi'] = array( |
| 793 | + 'wikilove-desc' => 'Thêm một giao diện cho phép gửi phản hồi khen ngợi cho người dùng khác qua các trang thảo luận cá nhân', |
| 794 | + 'wikilove' => 'WikiLove', |
| 795 | + 'wikilove-enable-preference' => 'Cho phép bày tỏ sự biết ơn cho người dùng khác qua thẻ WikiLove (thử nghiệm)', |
| 796 | + 'wikilove-tab-text' => 'WikiLove', |
| 797 | + 'tooltip-ca-wikilove' => 'Đăng một thông điệp cho người dùng này để cho biết sự đánh giá cao của bạn', |
| 798 | + 'wikilove-dialog-title' => 'WikiLove – Gửi thông điệp bày tỏ sự đánh giá cao cho người dùng khác', |
| 799 | + 'wikilove-select-type' => 'Chọn loại', |
| 800 | + 'wikilove-get-started-header' => 'Hãy bắt đầu!', |
| 801 | + 'wikilove-get-started-list-1' => 'Chọn loại WikiLove để gửi', |
| 802 | + 'wikilove-get-started-list-2' => 'Thêm chi tiết vào WikiLove của bạn', |
| 803 | + 'wikilove-get-started-list-3' => 'Gửi WikiLove!', |
| 804 | + 'wikilove-add-details' => 'Thêm chi tiết', |
| 805 | + 'wikilove-image' => 'Nhập một tên hình:', |
| 806 | + 'wikilove-select-image' => 'Chọn một hình ảnh:', |
| 807 | + 'wikilove-header' => 'Nhập đầu đề:', |
| 808 | + 'wikilove-title' => 'Nhập một tên giải thưởng:', |
| 809 | + 'wikilove-enter-message' => 'Nhập tin nhắn:', |
| 810 | + 'wikilove-omit-sig' => '(không ký tên)', |
| 811 | + 'wikilove-image-example' => '(ví dụ: Trophy.png)', |
| 812 | + 'wikilove-button-preview' => 'Xem trước', |
| 813 | + 'wikilove-preview' => 'Xem trước', |
| 814 | + 'wikilove-notify' => 'Báo người dùng qua thư điện tử', |
| 815 | + 'wikilove-button-send' => 'Gửi WikiLove', |
| 816 | + 'wikilove-type-makeyourown' => 'Làm lấy', |
| 817 | + 'wikilove-err-header' => 'Vui lòng đưa vào đầu đề.', |
| 818 | + 'wikilove-err-title' => 'Vui lòng đưa vào tựa đề.', |
| 819 | + 'wikilove-err-msg' => 'Vui lòng đưa vào tin nhắn.', |
| 820 | + 'wikilove-err-image' => 'Vui lòng chọn một hình ảnh.', |
| 821 | + 'wikilove-err-image-bad' => 'Hình không tồn tại.', |
| 822 | + 'wikilove-err-image-api' => 'Đã gặp một lỗi bất ngờ trong việc lấy hình ảnh. Hãy thử lại.', |
| 823 | + 'wikilove-err-sig' => 'Xin vui lòng đừng đưa một chữ ký vào tin nhắn.', |
| 824 | + 'wikilove-err-gallery' => 'Đã gặp lỗi khi tải các hình ảnh!', |
| 825 | + 'wikilove-err-gallery-again' => 'Thử lại', |
| 826 | + 'wikilove-err-preview-api' => 'Đã gặp một lỗi bất ngờ trong việc xem trước. Hãy thử lại.', |
| 827 | + 'wikilove-err-send-api' => 'Đã gặp một lỗi bất ngờ trong việc gửi thông điệp. Hãy thử lại.', |
| 828 | + 'wikilove-summary' => '/* $1 */ thông điệp WikiLove mới', |
| 829 | + 'wikilove-what-is-this' => 'Này là gì?', |
| 830 | + 'wikilove-anon-warning' => 'Lưu ý: Người dùng này chưa đăng ký, nên họ có thể không nhận thấy được thông điệp này.', |
| 831 | + 'wikilove-commons-text' => 'Có thể tìm kiếm hình ảnh tại $1.', |
| 832 | +); |
| 833 | + |
| 834 | +/** Traditional Chinese (中文(繁體)) |
| 835 | + * @author Waihorace |
| 836 | + */ |
| 837 | +$messages['zh-hant'] = array( |
| 838 | + 'wikilove-desc' => '加入一個界面以使用戶向其他用戶提供正面的意見', |
| 839 | + 'wikilove' => '維基友愛', |
| 840 | + 'wikilove-enable-preference' => '顯示維基友愛標籤以便讚賞其他用戶(試驗性)', |
| 841 | + 'wikilove-tab-text' => '維基友愛', |
| 842 | + 'tooltip-ca-wikilove' => '張貼一條信息以表示你的欣賞', |
| 843 | + 'wikilove-dialog-title' => '維基友愛-向其他用戶發送欣賞信息', |
| 844 | + 'wikilove-select-type' => '選擇類型', |
| 845 | + 'wikilove-get-started-header' => '開始吧!', |
| 846 | + 'wikilove-get-started-list-1' => '選擇想發送的維基友愛類型', |
| 847 | + 'wikilove-get-started-list-2' => '對你的維基友愛加入細節', |
| 848 | + 'wikilove-get-started-list-3' => '發送你的友愛!', |
| 849 | + 'wikilove-add-details' => '加入詳情', |
| 850 | + 'wikilove-image' => '輸入一個來自維基共享資源的圖像名:', |
| 851 | + 'wikilove-select-image' => '選擇一個圖片:', |
| 852 | + 'wikilove-header' => '輸入頭部:', |
| 853 | + 'wikilove-title' => '輸入標題:', |
| 854 | + 'wikilove-enter-message' => '輸入信息:', |
| 855 | + 'wikilove-omit-sig' => '(沒有簽名)', |
| 856 | + 'wikilove-button-preview' => '預覽', |
| 857 | + 'wikilove-preview' => '預覽', |
| 858 | + 'wikilove-notify' => '通過電郵通知這位用戶', |
| 859 | + 'wikilove-button-send' => '發送友愛', |
| 860 | + 'wikilove-type-makeyourown' => '製作你自己的', |
| 861 | + 'wikilove-err-header' => '請輸入頭部。', |
| 862 | + 'wikilove-err-title' => '請輸入標題。', |
| 863 | + 'wikilove-err-msg' => '請輸入信息。', |
| 864 | + 'wikilove-err-image' => '請選擇圖片。', |
| 865 | + 'wikilove-err-sig' => '請不要在信息中包含簽名。', |
| 866 | + 'wikilove-err-gallery' => '加載圖片時發生了錯誤。', |
| 867 | + 'wikilove-err-gallery-again' => '再試一次', |
| 868 | + 'wikilove-summary' => '/* $1 */ 新的維基友愛信息', |
| 869 | + 'wikilove-what-is-this' => '這是甚麼?', |
| 870 | +); |
| 871 | + |
Index: branches/wmf/1.17wmf1/extensions/WikiLove/ApiWikiLoveImageLog.php |
— | — | @@ -0,0 +1,64 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * This API is for logging each time a user attempts to use a custom image via the Make your own |
| 6 | + * feature. This is basically just to see if users can grok the concept. Once usage analysis is |
| 7 | + * complete, this API can be deleted. |
| 8 | + */ |
| 9 | +class ApiWikiLoveImageLog extends ApiBase { |
| 10 | + public function execute() { |
| 11 | + global $wgRequest, $wgWikiLoveLogging, $wgParser; |
| 12 | + |
| 13 | + $params = $this->extractRequestParams(); |
| 14 | + |
| 15 | + if ( $wgWikiLoveLogging ) { |
| 16 | + $this->saveInDb( $params['image'], $params['success'] ); |
| 17 | + } |
| 18 | + } |
| 19 | + |
| 20 | + /** |
| 21 | + * @param $user User ID |
| 22 | + * @param $image string |
| 23 | + * @param $success integer |
| 24 | + */ |
| 25 | + private function saveInDb( $image, $success ) { |
| 26 | + global $wgUser; |
| 27 | + $dbw = wfGetDB( DB_MASTER ); |
| 28 | + |
| 29 | + $values = array( |
| 30 | + 'wlil_timestamp' => $dbw->timestamp(), |
| 31 | + 'wlil_user_id' => $wgUser->getId(), |
| 32 | + 'wlil_image' => $image, |
| 33 | + 'wlil_success' => $success, |
| 34 | + ); |
| 35 | + |
| 36 | + try{ |
| 37 | + $dbw->insert( 'wikilove_image_log', $values, __METHOD__ ); |
| 38 | + } catch( DBQueryError $dbqe ) { |
| 39 | + $this->setWarning( 'Action was not logged' ); |
| 40 | + } |
| 41 | + } |
| 42 | + |
| 43 | + public function getDescription() { |
| 44 | + return array( |
| 45 | + 'This API is for logging each time a user attempts to use a custom image via WikiLove.', |
| 46 | + ); |
| 47 | + } |
| 48 | + |
| 49 | + public function getAllowedParams() { |
| 50 | + return array( |
| 51 | + 'image' => array( |
| 52 | + ApiBase::PARAM_TYPE => 'string', |
| 53 | + ApiBase::PARAM_REQUIRED => true, |
| 54 | + ), |
| 55 | + 'success' => array( |
| 56 | + ApiBase::PARAM_TYPE => 'integer', |
| 57 | + ApiBase::PARAM_REQUIRED => true, |
| 58 | + ) |
| 59 | + ); |
| 60 | + } |
| 61 | + |
| 62 | + public function getVersion() { |
| 63 | + return __CLASS__ . ': $Id$'; |
| 64 | + } |
| 65 | +} |
Property changes on: branches/wmf/1.17wmf1/extensions/WikiLove/ApiWikiLoveImageLog.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 66 | + native |
Added: svn:keywords |
2 | 67 | + Id |