Changeset 5266
- Timestamp:
- Feb 14, 2009, 3:41:41 PM (15 years ago)
- Location:
- workfloweditorplugin/0.11
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
workfloweditorplugin/0.11/.settings/org.eclipse.core.resources.prefs
r5239 r5266 1 # Mon Feb 09 00:04:30 JST 20091 #Sat Feb 14 23:25:00 JST 2009 2 2 eclipse.preferences.version=1 3 3 encoding//customworkflow/templates/customworkflow_admin.html=UTF-8 4 4 encoding//customworkflow/templates/customworkflow_admin_ja.html=UTF-8 5 encoding//workfloweditor/htdocs/js/workfloweditor-locale-ja.js=UTF-8 5 6 encoding//workfloweditor/htdocs/js/workfloweditor.js=UTF-8 6 7 encoding/<project>=UTF-8 -
workfloweditorplugin/0.11/setup.py
r5239 r5266 6 6 setup( 7 7 name = 'WorkflowEditorPlugin', 8 version = '1.0 beta',8 version = '1.0', 9 9 description = "Edit Ticket Workflow", 10 10 url = "http://trac-hacks.org/wiki/WorkflowEditorPlugin", -
workfloweditorplugin/0.11/workfloweditor/api.py
r5243 r5266 2 2 3 3 from os import environ 4 from trac.core import Component5 4 6 class LocaleUtil (Component):5 class LocaleUtil: 7 6 8 7 def get_locale(self, req): 9 """Get client locale from the http request. 10 """ 8 """Get client locale from the http request.""" 11 9 12 10 locale = None … … 14 12 if (len(locale_array) > 0): 15 13 locale = locale_array[0].strip() 16 14 15 if (len(locale) > 2): 16 locale = locale[0:2]; 17 17 18 return locale -
workfloweditorplugin/0.11/workfloweditor/htdocs/js/workfloweditor.js
r5243 r5266 2 2 if (!workfloweditor) workfloweditor = {}; 3 3 4 /** 5 * i18n 6 */ 7 workfloweditor.Localizer = function() { 8 this.strings = {}; 9 this.lang = ""; 10 11 var htmlTag = document.getElementsByTagName("html")[0]; 12 this.lang = htmlTag.getAttribute("xml:lang") || htmlTag.getAttribute("lang"); 13 14 // If there isn't the lang attribute, use browser language. 15 if (this.lang == null || this.lang == "") { 16 var currentLanguage; 17 if (navigator.browserLanguage) { 18 currentLanguage = navigator.browserLanguage; 19 } else if (navigator.language) { 20 currentLanguage = navigator.language; 21 } else if (navigator.userLanguage) { 22 currentLanguage = navigator.userLanguage; 23 } 24 25 if (currentLanguage && currentLanguage.length >= 2) { 26 this.lang = currentLanguage.substr(0,2); 27 } 28 } 29 30 var self = this; 31 this.getLocalizedString = function(str) { 32 if (!workfloweditor.Localizer.strings) 33 { 34 return str; 35 } 36 37 var message = workfloweditor.Localizer.strings[str]; 38 if (!message || message == "") { 39 message = str; 40 } 41 return message; 42 }; 43 44 return this; 45 } 46 47 workfloweditor.Localizer = new workfloweditor.Localizer(); 48 _ = workfloweditor.Localizer.getLocalizedString; 49 50 /** 51 * Workflow Editor onload action. 52 */ 4 53 jQuery(document).ready(function(){ 5 54 var context = new workfloweditor.WorkflowContext(); … … 34 83 // The workflow is updated before saving. 35 84 jQuery("#doChanges").click( function() { 36 if (currentTab = "gridTab") { 85 try 86 { 87 if (currentTab == "textTab") { 88 context.updateModelByText("#workflowText"); 89 context.refreshGrid(); 90 } 91 37 92 context.updateModelByGrid("#workflowGrid"); 38 93 context.refreshText(); 94 } 95 catch(ex) 96 { 97 alert(_("Error: Please fix the workflow text.") 98 + "\n(error code = " + ex.number + ")"); 99 return false; 39 100 } 40 101 }); … … 50 111 this.DEFAULT_OPERATIONS = { 51 112 "" : "", 52 "set_owner" : "担当者を設定",53 "del_owner" : "担当者を削除",54 "set_owner_to_self" : "自分を担当者に設定",55 "set_resolution" : "解決方法を設定",56 "del_resolution" : "解決方法を削除",57 "leave_status" : "ステータス表示のみ"113 "set_owner" : _("set owner"), 114 "del_owner" : _("del owner"), 115 "set_owner_to_self" : _("set owner to self"), 116 "set_resolution" : _("set resolution"), 117 "del_resolution" : _("del resolution"), 118 "leave_status" : _("leave status") 58 119 }; 59 120 this.DEFAULT_PERMISSIONS = { … … 362 423 ); 363 424 } else { 364 alert( "行を選択してください");425 alert(_("Please select row.")); 365 426 } 366 427 }); … … 381 442 ); 382 443 } else { 383 alert( "行を選択してください");444 alert(_("Please select row.")); 384 445 } 385 446 }); … … 394 455 */ 395 456 workfloweditor.WorkflowContext.prototype.createGridColNames = function() { 396 var colNames = [ '操作', '表示名', '処理', '権限', '順序', '次のステータス', ''];457 var colNames = [_('action'), _('name'), _('operation'), _('permission'), _('order'), _('next status'), '']; 397 458 colNames = colNames.concat(this.status); 398 459 … … 531 592 height : 0, 532 593 width : 0, 533 colNames : [ "ステータス"],594 colNames : [_("status")], 534 595 colModel : [{ 535 596 name:'editableStatus', index:'status', width:100, editable:true, -
workfloweditorplugin/0.11/workfloweditor/templates/workfloweditor_admin.html
r5146 r5266 18 18 <fieldset> 19 19 <legend>Workflow Configuration</legend> 20 <div class="field"> 21 <textarea name="workflow_config" rows="25" cols="100" wrap="off">${template.workflow_config}</textarea> 22 <br /> 23 <br /> 24 <div>How to set the workflow: <a href="${href.wiki('TracWorkflow')}">TracWorkflow</a></div> 20 <br /> 21 <div id="workflowTabs" style="display:none;"> 22 <ul> 23 <li><a href="#gridTab"><span>Grid</span></a></li> 24 <li><a href="#textTab"><span>Text</span></a></li> 25 </ul> 26 <div id="gridTab"> 27 <table id="workflowStatusGrid" class="scroll" cellpadding="0" cellspacing="0"></table> 28 <table id="workflowGrid" class="scroll" cellpadding="0" cellspacing="0"></table> 29 <br /> 30 <ul> 31 <li>If you edit the action, please click 'Add', 'Change' or 'Delete' button.</li> 32 <li>If you edit the status, please click 'Edit status' button.</li> 33 </ul> 34 <input type="button" id="workflowGridItemAdd" value="Add" /> 35 <input type="button" id="workflowGridItemMod" value="Change" /> 36 <input type="button" id="workflowGridItemDel" value="Delete" /> 37 38 <input type="button" id="workflowStatusGridItemMod" value="Edit status" /> 39 </div> 40 <div id="textTab"> 41 <textarea id="workflowText" name="workflow_config" rows="20" cols="100" wrap="off">${template.workflow_config}</textarea> 42 </div> 25 43 </div> 44 <br /> 45 <div>How to set the workflow: <a href="${href.wiki('TracWorkflow')}">TracWorkflow</a></div> 26 46 </fieldset> 47 27 48 <div class="buttons"> 28 <input type="submit" value="Apply changes" />49 <input id="doChanges" type="submit" value="Apply changes" /> 29 50 </div> 30 51 </form> -
workfloweditorplugin/0.11/workfloweditor/templates/workfloweditor_admin_ja.html
r5239 r5266 28 28 <table id="workflowGrid" class="scroll" cellpadding="0" cellspacing="0"></table> 29 29 <br /> 30 <ul> 31 <li>操作を編集する場合は、「追加」「変更」「削除」ボタンをしてください。</li> 32 <li>ステータスを編集する場合は、「ステータスの編集」ボタンを押下してください。</li> 33 </ul> 30 34 <input type="button" id="workflowGridItemAdd" value="追加" /> 31 35 <input type="button" id="workflowGridItemMod" value="変更" /> -
workfloweditorplugin/0.11/workfloweditor/workfloweditor_admin.py
r5243 r5266 30 30 if req.perm.has_permission('TRAC_ADMIN'): 31 31 # localization 32 locale = LocaleUtil( self.env).get_locale(req)33 if locale in ['ja', 'ja-JP']:32 locale = LocaleUtil().get_locale(req) 33 if (locale == 'ja'): 34 34 yield ('ticket', u'チケットシステム', 'workfloweditor', u'ワークフロー') 35 35 else: … … 58 58 59 59 # localization 60 locale = LocaleUtil(self.env).get_locale(req) 61 if locale in ['ja', 'ja-JP']: 60 locale = LocaleUtil().get_locale(req) 61 if (locale == 'ja'): 62 add_script(req, 'workfloweditor/js/workfloweditor-locale-ja.js') 62 63 page_template = 'workfloweditor_admin_ja.html' 63 64 else: … … 107 108 108 109 # localization 109 locale = LocaleUtil( self.env).get_locale(req)110 if locale in ['ja', 'ja-JP']:110 locale = LocaleUtil().get_locale(req) 111 if (locale == 'ja'): 111 112 init_file = 'trac_jp.ini' 112 113 else:
Note: See TracChangeset
for help on using the changeset viewer.