r75609 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75608‎ | r75609 | r75610 >
Date:11:30, 28 October 2010
Author:wikibhasha.msr
Status:deferred
Tags:
Comment:
removing dead code
Modified paths:
  • /trunk/extensions/WikiBhasha/src/js/core/wikiMarkupEditWindow.js (deleted) (history)

Diff [purge]

Index: trunk/extensions/WikiBhasha/src/js/core/wikiMarkupEditWindow.js
@@ -1,130 +0,0 @@
2 -/********************************************************
3 -* *
4 -* Copyright (C) Microsoft. All rights reserved. *
5 -* *
6 -********************************************************/
7 -
8 -/*
9 -
10 -BSD license:
11 -
12 -Copyright (c) 2010, Microsoft
13 -All rights reserved.
14 -
15 -Redistribution and use in $source and binary forms, with or without modification, are permitted provided that the following conditions are met:
16 -
17 -
18 -• Redistributions of $source code must retain the above copyright notice, this list of conditions and the following disclaimer.
19 -
20 -• Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
21 -
22 -• Neither the name of Microsoft nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
23 -
24 -• THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 -
26 -*/
27 -
28 -/*
29 -*
30 -* Available Classes:
31 -* 1) wikiMarkupEditWindow - Describes the wiki markup edit window, which enables user to edit the wiki markup and privew the same and save the same to the target language article
32 -*
33 -*/
34 -
35 -//make sure the namespace exists.
36 -if (typeof (wikiBhasha.windowManagement) === "undefined") {
37 - wikiBhasha.windowManagement = {};
38 -}
39 -
40 -(function() {
41 - //describes the search window, which enables user to search various articles in wikipedia
42 - //for contributing to the target language article
43 - wikiBhasha.windowManagement.wikiMarkupEditWindow = {
44 -
45 - //search window div Id.
46 - windowId: "wbWikiMarkupEditWindow",
47 -
48 - wikiMarkupEditWindowHTML: "",
49 -
50 - wikiMarkupEditObject:'',
51 -
52 - //displays search window on application UI
53 - show: function(elem, e) {
54 - var $wikiMarkupEditWindowElem = $("#" + this.windowId),
55 - wikiMarkupText = elem ? elem.getAttribute("_data") : null;
56 - //store the mouse hover element reference
57 - this.wikiMarkupEditObject=elem;
58 -
59 - //check if the window was created already
60 - if ($wikiMarkupEditWindowElem.length === 0) {
61 - wbUIHelper.createWindow(this.windowId, wbGlobalSettings.wikiMarkupEditWindowHTML);
62 - //popup window tabs
63 - $('#wbWikiMarkupEditTabsContainer').tabs();
64 -
65 - if (wbWorkflow.config.currentPane) {
66 - //make the wiki markup tab editable
67 - $("#wbWikiMarkupEditTab").attr("contentEditable", "true");
68 - } else {
69 - $("#wbWikiMarkupEditTab").attr("contentEditable", "false");
70 - }
71 -
72 - //priview $link
73 - $("#wbWikiMarkupEditPrivewLink").click(function(){ wbWikiMarkupEdit.priview();});
74 - //submit links
75 - $("#wbWikiMarkupEditSubmitLink").click(function(){ wbWikiMarkupEdit.submit();});
76 - //clicking out side the div hide the wiki markup edit popup
77 - $('#wbTranslationWindow').click(function() { wbWikiMarkupEdit.hide(); });
78 - $('#wbWikiMarkupEditDiv').click(function(event){ event.stopPropagation(); });
79 - //close button
80 - $(".wbExit").click(function(){wbWikiMarkupEdit.hide();});
81 -
82 - $("#wbWikiMarkupEditHeader").html(wbLocal.wbWikiMarkupEditHeader);
83 - $wikiMarkupEditWindowElem = $("#" + this.windowId);
84 - wbUIHelper.makeDraggable(this.windowId, "wbWikiMarkupEditDraggableHandle");
85 - }
86 - else {
87 - $wikiMarkupEditWindowElem.show();
88 - }
89 - //popup window tabs
90 - $('#wbWikiMarkupEditTabsContainer').tabs("option", "selected", 0);
91 - wbUIHelper.setWindowOnContext(this.windowId, e);
92 - //populate the $content
93 - $("#wbWikiMarkupEditTab").html(wikiMarkupText);
94 - //clear the priview tab
95 - $("#wbWikiMarkupEditPrivewTab").html("");
96 -
97 - // bring the window always on top.
98 - $wikiMarkupEditWindowElem.maxZIndex({ inc: 5 });
99 -
100 - // log the usage of search window.
101 - wbLoggerService.logFeatureUsage(wbGlobalSettings.sessionId, "WikiMarkupEditWindowInvoked");
102 - },
103 -
104 - priview : function(){
105 - wbWikiSite.getPriviewContent(wbGlobalSettings.targetLanguageCode, wbGlobalSettings.targetLanguageArticleTitle, $("#wbWikiMarkupEditTab").html(), function(priviewData){
106 - $("#wbWikiMarkupEditPrivewTab").html(priviewData);
107 - });
108 - },
109 -
110 - submit : function(){
111 - wbUtil.setDataAttribute(wbWikiMarkupEdit.wikiMarkupEditObject, $("#wbWikiMarkupEditTab").html());
112 - this.hide();
113 - },
114 -
115 - //removes the window from the application window
116 - unload: function() {
117 - wbUIHelper.removeWindow(this.windowId);
118 - },
119 -
120 - //hides the window from application UI
121 - hide: function() {
122 - $("#wbWikiMarkupEditTab").html("");
123 - //clear the priview tab
124 - $("#wbWikiMarkupEditPrivewTab").html("");
125 - $("#" + this.windowId).hide();
126 - }
127 - };
128 -
129 - //shortcut to call wikiBhasha.windowManagement.wikiMarkupEditWindow
130 - wbWikiMarkupEdit = wikiBhasha.windowManagement.wikiMarkupEditWindow;
131 -})();
\ No newline at end of file

Status & tagging log