Skip to content
Permalink
Browse files

Moved jquery directory under resources/jQuery (Python Console)

  • Loading branch information
slarosa committed Oct 1, 2012
1 parent d2d7cae commit 35a4f88b3355f0902a8eb944d5990f567f4e77b5
@@ -1,6 +1,7 @@
from PyQt4 import QtCore, QtGui, QtWebKit
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
import os

class HelpDialog(QtGui.QDialog):
@@ -29,8 +30,12 @@ def setupUi(self):
QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), self.closeWindow)
self.verticalLayout.addLayout(self.horizontalLayout)
self.setLayout(self.verticalLayout)
jQueryPath = QgsApplication.pkgDataPath()
localeFullName = QSettings().value( "locale/userLocale", QVariant( "" ) ).toString()
filename = os.path.dirname(__file__) + "/helpConsole/help.htm?lang=" + localeFullName
filename = os.path.dirname(__file__) + "/helpConsole/help.htm? \
lang=" + localeFullName \
+ "&pkgDir=" + jQueryPath

url = QtCore.QUrl(filename)
self.webView.load(url)

@@ -3,25 +3,9 @@
<head>
<title>Help Python Console</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="js/jquery.i18n.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var parameter = window.location.search.replace( "?", "" );
var locale = parameter.split("=");
var lang = locale[1]
var js = document.createElement("script");
js.type = "text/javascript";
js.src = "i18n/" + lang + ".properties";
document.body.appendChild(js);
//alert(js.src);

var encode = document.createElement("script");
encode.type = "text/javascript";
encode.src = "js/encoding.js";
document.body.appendChild(encode);
});
</script>
<!--<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="js/jquery.i18n.min.js"></script>-->

<style>
body{
font-family: verdana,arial,helvetica,sans-serif;
@@ -147,4 +131,28 @@ <h4 id="thanks">Acknowledgments</h4>
<span id="thanksText">Thanks to Larry Shaffer who provided the API files.</span>
</p>
</body>
<script type="text/javascript">
var parameter = window.location.search.replace( "?", "" );
var langPathParameters = parameter.split("&");
var locale = langPathParameters[0].split("=");
var jQueryPath = langPathParameters[1].split("=");
var pathJs = jQueryPath[1];
var lang = locale[1];
var jquery = document.createElement("script");
jquery.type = "text/javascript";
jquery.src = pathJs + "/resources/jQuery/jquery-1.8.2.min.js";
document.body.appendChild(jquery);
var jqueryi18n = document.createElement("script");
jqueryi18n.type = "text/javascript";
jqueryi18n.src = pathJs + "/resources/jQuery/jquery.i18n.min.js";
document.body.appendChild(jqueryi18n);
var properties = document.createElement("script");
properties.type = "text/javascript";
properties.src = "i18n/" + lang + ".properties";
document.body.appendChild(properties);
var encode = document.createElement("script");
encode.type = "text/javascript";
encode.src = "js/encoding.js";
document.body.appendChild(encode);
</script>
</html>
@@ -1,6 +1,7 @@
INSTALL(FILES srs.db qgis.db qgis_help.db symbology-ng-style.db spatialite.db customization.xml
DESTINATION ${QGIS_DATA_DIR}/resources)
INSTALL(DIRECTORY cpt-city-qgis-min DESTINATION ${QGIS_DATA_DIR}/resources)
INSTALL(DIRECTORY jQuery DESTINATION ${QGIS_DATA_DIR}/resources)

ADD_SUBDIRECTORY(context_help)
ADD_SUBDIRECTORY(function_help)

Large diffs are not rendered by default.

@@ -0,0 +1,13 @@
/*
* jQuery i18n plugin
* @requires jQuery v1.1 or later
*
* See http://recursive-design.com/projects/jquery-i18n/
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Version: 0.9.2 (201204070102)
*/
(function(f){f.i18n={dict:null,setDictionary:function(a){this.dict=a},_:function(a,b){var d=a;if(this.dict&&this.dict[a])d=this.dict[a];return this.printf(d,b)},toEntity:function(a){for(var b="",d=0;d<a.length;d++)b+=a.charCodeAt(d)>128?"&#"+a.charCodeAt(d)+";":a.charAt(d);return b},stripStr:function(a){return a.replace(/^\s*/,"").replace(/\s*$/,"")},stripStrML:function(a){a=a.split("\n");for(var b=0;b<a.length;b++)a[b]=stripStr(a[b]);return stripStr(a.join(" "))},printf:function(a,b){if(!b)return a;
for(var d="",e=/%(\d+)\$s/g;result=e.exec(a);){var c=parseInt(result[1],10)-1;a=a.replace("%"+result[1]+"$s",b[c]);b.splice(c,1)}e=a.split("%s");if(e.length>1)for(c=0;c<b.length;c++){if(e[c].lastIndexOf("%")==e[c].length-1&&c!=b.length-1)e[c]+="s"+e.splice(c+1,1)[0];d+=e[c]+b[c]}return d+e[e.length-1]}};f.fn._t=function(a,b){return f(this).text(f.i18n._(a,b))}})(jQuery);

0 comments on commit 35a4f88

Please sign in to comment.
You can’t perform that action at this time.