Commit 0963afc1 authored by Ilia Ryabokon's avatar Ilia Ryabokon

Merge branch 'master' of github.com:Sankore/Sankore-3.1

Strange merge
parents fd289bc6 ba95a4f1
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -201,8 +201,7 @@
.attr("height", globalHeight - 120);
});
function checkcontent(){
function checkcontent(){
if(window.sankore){
window.sankore.setPreference("url", $("#textbox").val());
window.sankore.setPreference("browserHistory", references.toString());
......@@ -215,7 +214,6 @@
function checkLoading(){
if(loadingState){
clearTimeout(resizer);
resizerIndex = 0;
$("#web-content")
......@@ -227,9 +225,10 @@
};
if(resizerIndex > 80){
resizerIndex = 0;
console.log("error on loading page");
$("#back-button").trigger("click");
//alert(sankoreLang[lang].alert);
$("#textbox").val("http://www.google.com/search?q=" + $("#textbox").val().replace("http://", ""));
$("#textbox").val($("#textbox").val().replace("http://", ""));
$("#textbox").val("http://www.metacrawler.com/search/web?&q=" + $("#textbox").val().replace("http://", "")+"&ql=");
$("#search-button").trigger("click");
}else{
resizer = setTimeout(function(){checkLoading()}, 100);
......
div.olMap {
z-index: 0;
padding: 0 !important;
margin: 0 !important;
cursor: default;
}
div.olMapViewport {
text-align: left;
}
div.olLayerDiv {
-moz-user-select: none;
-khtml-user-select: none;
}
.olLayerGoogleCopyright {
left: 2px;
bottom: 2px;
}
.olLayerGoogleV3.olLayerGoogleCopyright {
right: auto !important;
}
.olLayerGooglePoweredBy {
left: 2px;
bottom: 15px;
}
.olLayerGoogleV3.olLayerGooglePoweredBy {
bottom: 15px !important;
}
.olControlAttribution {
font-size: smaller;
right: 3px;
bottom: 4.5em;
position: absolute;
display: block;
}
.olControlScale {
right: 3px;
bottom: 3em;
display: block;
position: absolute;
font-size: smaller;
}
.olControlScaleLine {
display: block;
position: absolute;
left: 10px;
bottom: 15px;
font-size: xx-small;
}
.olControlScaleLineBottom {
border: solid 2px black;
border-bottom: none;
margin-top:-2px;
text-align: center;
}
.olControlScaleLineTop {
border: solid 2px black;
border-top: none;
text-align: center;
}
.olControlPermalink {
right: 3px;
bottom: 1.5em;
display: block;
position: absolute;
font-size: smaller;
}
div.olControlMousePosition {
bottom: 0em;
right: 3px;
display: block;
position: absolute;
font-family: Arial;
font-size: smaller;
}
.olControlOverviewMapContainer {
position: absolute;
bottom: 0;
right: 0;
}
.olControlOverviewMapElement {
padding: 10px 18px 10px 10px;
background-color: #00008B;
-moz-border-radius: 1em 0 0 0;
}
.olControlOverviewMapMinimizeButton {
right: 0;
bottom: 80px;
cursor: pointer;
}
.olControlOverviewMapMaximizeButton {
right: 0;
bottom: 80px;
cursor: pointer;
}
.olControlOverviewMapExtentRectangle {
overflow: hidden;
background-image: url("img/blank.gif");
cursor: move;
border: 2px dotted red;
}
.olControlOverviewMapRectReplacement {
overflow: hidden;
cursor: move;
background-image: url("img/overview_replacement.gif");
background-repeat: no-repeat;
background-position: center;
}
.olLayerGeoRSSDescription {
float:left;
width:100%;
overflow:auto;
font-size:1.0em;
}
.olLayerGeoRSSClose {
float:right;
color:gray;
font-size:1.2em;
margin-right:6px;
font-family:sans-serif;
}
.olLayerGeoRSSTitle {
float:left;font-size:1.2em;
}
.olPopupContent {
padding:5px;
overflow: auto;
}
.olControlNavigationHistory {
background-image: url("img/navigation_history.png");
background-repeat: no-repeat;
width: 24px;
height: 24px;
}
.olControlNavigationHistoryPreviousItemActive {
background-position: 0 0;
}
.olControlNavigationHistoryPreviousItemInactive {
background-position: 0 -24px;
}
.olControlNavigationHistoryNextItemActive {
background-position: -24px 0;
}
.olControlNavigationHistoryNextItemInactive {
background-position: -24px -24px;
}
div.olControlSaveFeaturesItemActive {
background-image: url(img/save_features_on.png);
background-repeat: no-repeat;
background-position: 0 1px;
}
div.olControlSaveFeaturesItemInactive {
background-image: url(img/save_features_off.png);
background-repeat: no-repeat;
background-position: 0 1px;
}
.olHandlerBoxZoomBox {
border: 2px solid red;
position: absolute;
background-color: white;
opacity: 0.50;
font-size: 1px;
filter: alpha(opacity=50);
}
.olHandlerBoxSelectFeature {
border: 2px solid blue;
position: absolute;
background-color: white;
opacity: 0.50;
font-size: 1px;
filter: alpha(opacity=50);
}
.olControlPanPanel {
top: 10px;
left: 5px;
}
.olControlPanPanel div {
background-image: url(img/pan-panel.png);
height: 18px;
width: 18px;
cursor: pointer;
position: absolute;
}
.olControlPanPanel .olControlPanNorthItemInactive {
top: 0;
left: 9px;
background-position: 0 0;
}
.olControlPanPanel .olControlPanSouthItemInactive {
top: 36px;
left: 9px;
background-position: 18px 0;
}
.olControlPanPanel .olControlPanWestItemInactive {
position: absolute;
top: 18px;
left: 0;
background-position: 0 18px;
}
.olControlPanPanel .olControlPanEastItemInactive {
top: 18px;
left: 18px;
background-position: 18px 18px;
}
.olControlZoomPanel {
top: 71px;
left: 14px;
}
.olControlZoomPanel div {
background-image: url(img/zoom-panel.png);
position: absolute;
height: 18px;
width: 18px;
cursor: pointer;
}
.olControlZoomPanel .olControlZoomInItemInactive {
top: 0;
left: 0;
background-position: 0 0;
}
.olControlZoomPanel .olControlZoomToMaxExtentItemInactive {
top: 18px;
left: 0;
background-position: 0 -18px;
}
.olControlZoomPanel .olControlZoomOutItemInactive {
top: 36px;
left: 0;
background-position: 0 18px;
}
/*
* When a potential text is bigger than the image it move the image
* with some headers (closes #3154)
*/
.olControlPanZoomBar div {
font-size: 1px;
}
.olPopupCloseBox {
background: url("img/close.gif") no-repeat;
cursor: pointer;
}
.olFramedCloudPopupContent {
padding: 5px;
overflow: auto;
}
.olControlNoSelect {
-moz-user-select: none;
-khtml-user-select: none;
}
.olImageLoadError {
background-color: pink;
opacity: 0.5;
filter: alpha(opacity=50); /* IE */
}
/**
* Cursor styles
*/
.olCursorWait {
cursor: wait;
}
.olDragDown {
cursor: move;
}
.olDrawBox {
cursor: crosshair;
}
.olControlDragFeatureOver {
cursor: move;
}
.olControlDragFeatureActive.olControlDragFeatureOver.olDragDown {
cursor: -moz-grabbing;
}
/**
* Layer switcher
*/
.olControlLayerSwitcher {
position: absolute;
top: 25px;
right: 0;
width: 20em;
font-family: sans-serif;
font-weight: bold;
margin-top: 3px;
margin-left: 3px;
margin-bottom: 3px;
font-size: smaller;
color: white;
background-color: transparent;
}
.olControlLayerSwitcher .layersDiv {
padding-top: 5px;
padding-left: 10px;
padding-bottom: 5px;
padding-right: 75px;
background-color: darkblue;
width: 100%;
height: 100%;
}
.olControlLayerSwitcher .layersDiv .baseLbl,
.olControlLayerSwitcher .layersDiv .dataLbl {
margin-top: 3px;
margin-left: 3px;
margin-bottom: 3px;
}
.olControlLayerSwitcher .layersDiv .baseLayersDiv,
.olControlLayerSwitcher .layersDiv .dataLayersDiv {
padding-left: 10px;
}
.olControlLayerSwitcher .maximizeDiv,
.olControlLayerSwitcher .minimizeDiv {
top: 5px;
right: 0;
cursor: pointer;
}
.olBingAttribution {
color: #DDD;
}
.olBingAttribution.road {
color: #333;
}
.olGoogleAttribution.hybrid, .olGoogleAttribution.satellite {
color: #EEE;
}
.olGoogleAttribution {
color: #333;
}
span.olGoogleAttribution a {
color: #77C;
}
span.olGoogleAttribution.hybrid a, span.olGoogleAttribution.satellite a {
color: #EEE;
}
/**
* Editing and navigation icons.
* (using the editing_tool_bar.png sprint image)
*/
.olControlNavToolbar ,
.olControlEditingToolbar {
margin: 5px 5px 0 0;
}
.olControlNavToolbar div,
.olControlEditingToolbar div {
background-image: url("img/editing_tool_bar.png");
background-repeat: no-repeat;
margin: 0 0 5px 5px;
width: 24px;
height: 22px;
cursor: pointer
}
/* positions */
.olControlEditingToolbar {
right: 0;
top: 0;
}
.olControlNavToolbar {
top: 295px;
left: 9px;
}
/* layouts */
.olControlEditingToolbar div {
float: right;
}
/* individual controls */
.olControlNavToolbar .olControlNavigationItemInactive,
.olControlEditingToolbar .olControlNavigationItemInactive {
background-position: -103px -1px;
}
.olControlNavToolbar .olControlNavigationItemActive ,
.olControlEditingToolbar .olControlNavigationItemActive {
background-position: -103px -24px;
}
.olControlNavToolbar .olControlZoomBoxItemInactive {
background-position: -128px -1px;
}
.olControlNavToolbar .olControlZoomBoxItemActive {
background-position: -128px -24px;
}
.olControlEditingToolbar .olControlDrawFeaturePointItemInactive {
background-position: -77px -1px;
}
.olControlEditingToolbar .olControlDrawFeaturePointItemActive {
background-position: -77px -24px;
}
.olControlEditingToolbar .olControlDrawFeaturePathItemInactive {
background-position: -51px -1px;
}
.olControlEditingToolbar .olControlDrawFeaturePathItemActive {
background-position: -51px -24px;
}
.olControlEditingToolbar .olControlDrawFeaturePolygonItemInactive{
background-position: -26px -1px;
}
.olControlEditingToolbar .olControlDrawFeaturePolygonItemActive {
background-position: -26px -24px;
}
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
id="OSM"
version="0.1"
width="800"
height="600"
ub:resizable="true"
ub:roles="content">
<name>OpenStreetMap</name>
<author href="http://icap.univ-lyon1.fr/"
email="guillaume.burel@etu.univ-lyon1.fr">Guillaume Burel - Université Claude Bernard Lyon 1 (ICAP), Délégation Interministérielle à l'Éducation Numérique en Afrique</author>
<description>View maps in OpenStreetMap<description>
<content src="index.html"/>
</widget>
This diff is collapsed.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Open Street Map</title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
<style type="text/css" media="all">
html, body, #map {
width: 100%;
height: 100%;
margin: 0;
position: relative;
z-index: 0;
font-family: sans-serif;
}
#search_form {
position: absolute;
z-index: 1;
bottom: 2.5em;
right: 0.5em;
}
#layout_switch {
position: absolute;
bottom: 15px;
left: 140px;
z-index: 1;
}
#layout_switch a {
color: black;
}
#layout_switch a:visited {
color: black;
}
#layout_switch a:hover {
color: white;
background-color: black;
opacity: 0.5;
}
.olControlPanZoom {
top: auto !important;
bottom: 173px; /* .olControlScaleLine.bottom = 15 + .olControlScaleLine.bottom = 26 + margin = 15px + #OpenLayers.Control.PanZoom_5_zoomout = 99 + #OpenLayers.Control.PanZoom_5_zoomout = 18 */
}
.olControlAttribution {
right: 0.5em !important;
bottom: 15px !important;
}
</style>
<script src="api/OpenLayers.js" type="text/javascript"></script>
<script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
/*
* OpenStreetMap Widget
* ==========================================================
* Copyright (C) Université Claude Bernard Lyon 1 (ICAP), Délégation Interministérielle à l'Éducation Numérique en Afrique, Guillaume Burel, 2012
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* API identifier */
var geonamesUser = "yimgo";
/* map variable will be used to manipulate the map. This will be initialized like an OpenLayers.Map object. */
var map;
/* updateMap() allow user to modify the considered zone, in case a change has been requested (e.g. user request) */
function updateMap(coordinates) {
/* transforming given coordinates, which have to be expressed in WGS-1984 projection, to map's projection */
var position = new OpenLayers.LonLat(coordinates["lng"], coordinates["lat"]).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
/* centering in position with given zoom */
map.setCenter(position, coordinates["zoom"]);
}
/* doSearch() performs the request to geonames server with the given query, and updates the map in case of success. */
function doSearch(query) {
/* performing request with JSON API from geonames and global username (identifying request's author). Asking for only one result, to save resources and to allow the user to avoid a choice when doing the research. */
$.ajax({
url: "http://api.geonames.org/searchJSON",
dataType: 'json',
data: {
q: encodeURIComponent(query),
maxRows: "1",
username: geonamesUser
},
success: function(data) {
/* updating the map if response is ok */
if (typeof data["geonames"][0]!= 'undefined') {
var coordinates = new Array();
coordinates["lng"] = data["geonames"][0].lng;
coordinates["lat"] = data["geonames"][0].lat;
/* if position represents a country, setting the zoom to 6 */
if (data["geonames"][0].fcl == "A")
coordinates["zoom"] = 6;
else
coordinates["zoom"] = 12;
updateMap(coordinates);
}
}
});
}
/*
* doNominatim() could use Nominatim API (http://wiki.openstreetmap.org/wiki/Nominatim).
* It is not used because first result is not always pertinent and we want to avoid user to make a choice after his request.
* Bounding box info provided by Nominatim could be a good way to set the right zoom for request (instead of having a determined zoom for countries and cities).
* Nominatim allows user (the developer in this case) to set the language to display informations provided in sankoré user native language.
*/
function doNominatim(query) {
$.ajax({
url: "http://nominatim.openstreetmap.org/search",
dataType: "json",
data: {
q: query,
format: "json",
limit: "10",
addressdetails: "1"
},
success: function(data) {
/* updating the map if response is ok */
if (typeof data[0]!= 'undefined') {
var coordinates = new Array();
coordinates["lng"] = data[0].lon;
coordinates["lat"] = data[0].lat;
/* if position represents a city, setting the zoom to 12 */
if (data[0].address.state)
coordinates["zoom"] = 12;
else
coordinates["zoom"] = 6;
updateMap(coordinates);
}
}
});
}
window.onload = function() {
map = new OpenLayers.Map({
div: "map"
});
/* limiting max zoom, by overriding OpenLayers.Map::moveTo function */
map.newMoveTo = map.moveTo;
map.moveTo = function(lonlat, zoom, options) {
return(zoom >= 0 && zoom <= 17) ? map.newMoveTo(lonlat,zoom,options) : false;
};
/* Standard layer */
classic = new OpenLayers.Layer.OSM("Classic");
/* avoiding out of bounds requests */
classic.displayOutsideMaxExtent = false;
/* Landscape layer */
relief = new OpenLayers.Layer.OSM("Relief", [
'http://a.tile3.opencyclemap.org/landscape/${z}/${x}/${y}.png',
'http://b.tile3.opencyclemap.org/landscape/${z}/${x}/${y}.png',
'http://c.tile3.opencyclemap.org/landscape/${z}/${x}/${y}.png'
]);
relief.displayOutsideMaxExtent = false;
/* then adding layers to the map */
map.addLayers([classic, relief]);
/* displaying scale line, allowing user to represent distances */
map.addControl(new OpenLayers.Control.ScaleLine());
/* then zomming to get a better overview of the worldmap */
map.zoomTo(2);
/* doSearch is called when form is submitted */
$("#search_form").submit(function (event) {
doSearch($("#query").val());
return false;
});
/* allowing user to simply switch between classic and relief layers */
$("#layout_switch > a").click(function (event) {
newLayer = $(this).text() == "Relief" ? relief : classic;
newText = $(this).text() == "Relief" ? "Classic" : "Relief";
$(this).text(newText);
map.setBaseLayer(newLayer);
return false;
});
};
-->
</script>
</head>
<body>
<div id="map">
</div>
<div id="layout_switch">
<a href="#">Relief</a>
</div>
<form method="post" id="search_form" action="#" accept-charset="UTF-8">
<p>
<input type="text" value="" tabindex="1" id="query" />
<input type="submit" value="Go" />
</p>
</form>
</body>
</html>
......@@ -144,7 +144,7 @@ body{
margin-left: 10px;
margin-bottom: 10px;
width: 95%;
max-height: 60px;
max-height: 100px;
overflow-x: hidden;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: small;
......@@ -160,7 +160,7 @@ body{
padding: 5px;
margin: 10px;
width: 95%;
max-height: 60px;
max-height: 120px;
overflow-x: hidden;
font-family: Verdana,Arial,Helvetica,sans-serif;
color: white;
......@@ -217,7 +217,7 @@ body{
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: small;
width: 80%;
max-height: 45px;
max-height: 60px;
overflow-x: hidden;
float: left;
border: 3px solid #ccc;
......@@ -234,7 +234,7 @@ body{
font-size: small;
font-weight: bold;
width: 80%;
max-height: 45px;
max-height: 60px;
overflow-x: hidden;
float: left;
border: 1px solid #DFDFDE;
......
......@@ -56,27 +56,30 @@
<td class="b_top_left">&nbsp;</td>
<td class="b_top_center">
<div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_reload"></div>
<div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div>
<select class="style_select">
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
</select>
</td>
<td class="b_top_right">&nbsp;</td>
</tr>
<tr>
<td class="b_center_left">&nbsp;</td>
<td>
<div id="help"></div>
<div id="ub-widget">
</div>
</td>
<td class="b_center_right">&nbsp;</td>
</tr>
<tr style="height: 54px;">
<td class="b_bottom_left">&nbsp;</td>
<td class="b_bottom_center">&nbsp;</td>
......
......@@ -33,27 +33,30 @@
<td class="b_top_left">&nbsp;</td>
<td class="b_top_center">
<div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_reload"></div>
<div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div>
<select class="style_select">
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
</select>
</td>
<td class="b_top_right">&nbsp;</td>
</tr>
<tr>
<td class="b_center_left">&nbsp;</td>
<td>
<div id="help"></div>
<div id="ub-widget">
</div>
</td>
<td class="b_center_right">&nbsp;</td>
</tr>
<tr style="height: 54px;">
<td class="b_bottom_left">&nbsp;</td>
<td class="b_bottom_center">&nbsp;</td>
......
var sankoreLang = {
view: "Afficher",
edit: "Modifier",
example: "so*phi*sti*qué",
example: "so*phis*ti*qué",
wgt_name: "Syllabe",
reload: "Recharger",
slate: "ardoise",
pad: "tablette"
pad: "tablette",
none: "aucun",
help: "aide",
help_content: "Ceci est un exemple de contenu de l'aide ..."
};
// if use the "view/edit" button or rely on the api instead
......
......@@ -33,27 +33,30 @@
<td class="b_top_left">&nbsp;</td>
<td class="b_top_center">
<div id="wgt_name"></div>
<div id="wgt_help"></div>
<div id="wgt_reload"></div>
<div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div>
<select class="style_select">
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
</select>
</td>
<td class="b_top_right">&nbsp;</td>
</tr>
<tr>
<td class="b_center_left">&nbsp;</td>
<td>
<div id="help"></div>
<div id="ub-widget">
</div>
</td>
<td class="b_center_right">&nbsp;</td>
</tr>
<tr style="height: 54px;">
<td class="b_bottom_left">&nbsp;</td>
<td class="b_bottom_center">&nbsp;</td>
......
......@@ -5,7 +5,10 @@ var sankoreLang = {
wgt_name: "Разделить слово",
reload: "Обновить",
slate: "Узор",
pad: "Планшет"
pad: "Планшет",
none: "Нет",
help: "Помощь",
help_content: "Пример текста помощи ..."
};
// if use the "view/edit" button or rely on the api instead
......
......@@ -5,7 +5,10 @@ var sankoreLang = {
wgt_name: "Split a word",
reload: "Reload",
slate: "Wood",
pad: "Pad"
pad: "Pad",
none: "None",
help: "Help",
help_content: "This is an example of help content ..."
};
// if use the "view/edit" button or rely on the api instead
......
......@@ -4,24 +4,26 @@ html, body{
margin: 0;
padding: 0;
border-radius: 50px;
overflow: hidden;
}
body{
background-image: url(../img/bg.png);
}
h1{
font-size:18px;
margin-bottom:20px;
margin-top:0px;
}
#ub-widget{
width: 100%;
height: 100%;
min-height: 180px;
overflow: auto;
color: white;
word-wrap: break-word;
}
input{
......
......@@ -108,7 +108,6 @@
#wgt_name{
height: 44px;
width: 200px;
margin: 10px 10px 0 10px;
padding: 0;
float: left;
......@@ -117,9 +116,8 @@
color: #8c5730;
}
#wgt_reload, #wgt_edit, #wgt_display{
#wgt_reload, #wgt_edit, #wgt_display, #wgt_help{
cursor: pointer;
width: 80px;
height: 44px;
margin: 10px 10px 0 0;
float: right;
......@@ -129,7 +127,6 @@
}
#wgt_display{
width: 100px;
padding-left: 40px;
background-image: url(../img/slate-edit.png);
background-repeat: no-repeat;
......@@ -138,7 +135,6 @@
}
#wgt_edit{
width: 100px;
padding-left: 40px;
background-image: url(../img/slate-edit.png);
background-repeat: no-repeat;
......@@ -217,3 +213,42 @@
color: white !important;
background-image: url(../img/ar_down_white.png) !important;
}
.without_radius{
border-radius: 0 !important;
}
.without_back{
background: none !important;
}
.none_select{
background-color: #333 !important;
color: white !important;
background-image: url(../img/ar_down_white.png) !important;
}
.pad_help{
background-image: url(../img/slate-help-white.png) !important;
}
#wgt_help{
padding-left: 32px;
background-image: url(../img/slate-help.png);
background-repeat: no-repeat;
background-position: top 0;
}
#help{
width: 100%;
height: 100%;
overflow: auto;
display: none;
background-color: #ccc;
padding: 5px;
}
.open{
}
\ No newline at end of file
......@@ -687,9 +687,16 @@ void UBBoardController::zoom(const qreal ratio, QPointF scenePoint)
QPointF offset = scenePoint - viewCenter;
QPointF scalledOffset = offset / ratio;
mControlView->scale(ratio, ratio);
qreal currentZoom = ratio * mControlView->viewportTransform().m11() / mSystemScaleFactor;
qreal currentZoom = mControlView->viewportTransform().m11() / mSystemScaleFactor;
qreal usedRatio = ratio;
if (currentZoom > UB_MAX_ZOOM)
{
currentZoom = UB_MAX_ZOOM;
usedRatio = currentZoom * mSystemScaleFactor / mControlView->viewportTransform().m11();
}
mControlView->scale(usedRatio, usedRatio);
QPointF newCenter = scenePoint - scalledOffset;
......@@ -2233,8 +2240,8 @@ void UBBoardController::freezeW3CWidget(QGraphicsItem *item, bool freeze)
return;
if (freeze) {
item_casted->widgetWebView()->page()->mainFrame()->setContent(UBW3CWidget::freezedWidgetPage().toAscii());
} else
item_casted->widgetWebView()->load(QUrl(item_casted->w3cWidget()->freezedWidgetFilePath()));
}else
item_casted->widgetWebView()->loadMainHtml();
}
}
......@@ -291,7 +291,7 @@ void UBBoardPaletteManager::setupPalettes()
addItemActions << UBApplication::mainWindow->actionAddItemToNewPage;
addItemActions << UBApplication::mainWindow->actionAddItemToLibrary;
mAddItemPalette = new UBActionPalette(addItemActions, Qt::Horizontal, 0);
mAddItemPalette = new UBActionPalette(addItemActions, Qt::Horizontal, mContainer);
mAddItemPalette->setButtonIconSize(QSize(128, 128));
mAddItemPalette->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
mAddItemPalette->groupActions();
......
......@@ -18,7 +18,7 @@
#include <QtGui>
#define UB_MAX_ZOOM 15
#define UB_MAX_ZOOM 9
struct UBMimeType
{
......
......@@ -914,7 +914,7 @@ void UBDocumentController::importFile()
QString groupName = group->groupName();
if (groupName == UBSettings::defaultDocumentGroupName)
if (groupName == UBSettings::defaultDocumentGroupName || fileInfo.suffix() != "ubz")
groupName = "";
UBApplication::showMessage(tr("Importing file %1...").arg(fileInfo.baseName()), true);
......
This diff is collapsed.
This diff is collapsed.
......@@ -95,8 +95,6 @@ private:
QBitArray points;
double val;
uint fill : 1;
uint shadow : 1;
uint smallPoint : 1;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -1717,6 +1717,7 @@ void UBGraphicsScene::removeItem(QGraphicsItem* item)
{
setModified(true);
UBCoreGraphicsScene::removeItem(item);
UBApplication::boardController->freezeW3CWidget(item, true);
if (!mTools.contains(item))
--mItemCount;
......
......@@ -29,7 +29,6 @@
#include "core/memcheck.h"
const QString freezedWidgetDefaultContentFilePath = "./etc/freezedWidgetWrapper.html";
bool UBW3CWidget::sTemplateLoaded = false;
QMap<QString, QString> UBW3CWidget::sNPAPIWrapperTemplates;
......@@ -426,6 +425,7 @@ QString UBW3CWidget::freezedWidgetPage()
static QString defaultcontent;
if (defaultcontent.isNull()) {
QString freezedWidgetDefaultContentFilePath = freezedWidgetFilePath();
QFile wrapperFile(freezedWidgetDefaultContentFilePath);
if (!wrapperFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
qDebug() << "can't open wrapper file " + freezedWidgetDefaultContentFilePath;
......@@ -444,6 +444,11 @@ QString UBW3CWidget::freezedWidgetPage()
return defaultcontent;
}
QString UBW3CWidget::freezedWidgetFilePath()
{
return UBPlatformUtils::applicationResourcesDirectory() + "/etc/" + "freezedWidgetWrapper.html";
}
void UBW3CWidget::loadNPAPIWrappersTemplates()
{
if (!sTemplateLoaded)
......
......@@ -50,6 +50,8 @@ class UBW3CWidget : public UBAbstractWidget
static QString freezedWidgetPage();
static QString freezedWidgetFilePath();
static bool hasNPAPIWrapper(const QString& pMimeType);
class PreferenceValue
......
......@@ -30,6 +30,7 @@
*/
UBDockPalette::UBDockPalette(eUBDockPaletteType paletteType, QWidget *parent, const char *name)
:QWidget(parent, Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint)
, mCurrentMode(eUBDockPaletteWidget_BOARD)
, mOrientation(eUBDockOrientation_Left)
, mPreferredWidth(100)
, mPreferredHeight(100)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment