Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Commit

Permalink
remove old search from the toolbar
Browse files Browse the repository at this point in the history
remove the old system toolbar and searchbar
  • Loading branch information
exi committed May 9, 2012
1 parent 5c0c3ef commit 9770360
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 280 deletions.
100 changes: 1 addition & 99 deletions phprojekt/application/Default/Views/dojo/scripts/Main.js
Expand Up @@ -205,12 +205,8 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
dojo.subscribe(module + ".changeProject", this, "changeProject");
dojo.subscribe(module + ".reload", this, "reload");
dojo.subscribe(module + ".openForm", this, "openForm");
dojo.subscribe(module + ".showSuggest", this, "showSuggest");
dojo.subscribe(module + ".hideSuggest", this, "hideSuggest");
dojo.subscribe(module + ".setSuggest", this, "setSuggest");
dojo.subscribe(module + ".showSearchResults", this, "showSearchResults");
dojo.subscribe(module + ".showTagsResults", this, "showTagsResults");
dojo.subscribe(module + ".clickResult", this, "clickResult");
dojo.subscribe(module + ".updateCacheData", this, "updateCacheData");
dojo.subscribe(module + ".loadResult", this, "loadResult");
dojo.subscribe(module + ".setLanguage", this, "setLanguage");
Expand Down Expand Up @@ -358,7 +354,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
var view = phpr.viewManager.useDefaultView({blank: true});

phpr.InitialScreen.start();
this.hideSuggest();

// Get all configuration.php vars for the front
var config = new phpr.Default.System.Store.Config();
Expand Down Expand Up @@ -455,8 +450,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
phpr.tree.fadeIn();
this.setSubmoduleNavigation();
}
this.hideSuggest();
this.setSearchForm();
},

rebuildGrid: function(includeSubentries) {
Expand Down Expand Up @@ -510,7 +503,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
setGlobalModulesNavigation: function() {
var view = phpr.viewManager.getView();
var toolbar = view.mainNavigation;
var systemToolbar = view.systemNavigation;
var globalModules = phpr.DataStore.getData({url: phpr.globalModuleUrl});
var isAdmin = phpr.DataStore.getMetaData({url: phpr.globalModuleUrl});
var button = null;
Expand All @@ -519,7 +511,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
var that = this;

toolbar.destroyDescendants();
systemToolbar.destroyDescendants();


for (var i in globalModules) {
Expand All @@ -545,23 +536,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
button = null;
}

// Setting
button = new dijit.form.Button({
label: phpr.nls.get('Setting'),
showLabel: true,
onClick: dojo.hitch(this, function() {
phpr.currentProjectId = phpr.rootProjectId;
phpr.pageManager.modifyCurrentState(
dojo.mixin(dojo.clone(this._emptyState), { moduleName: "Setting" }),
{ forceModuleReload: true }
);
})
});

this.globalModuleNavigationButtons.Setting = button;
toolbar.addChild(button);
button = null;

if (isAdmin > 0) {
// Administration
button = new dijit.form.Button({
Expand All @@ -578,7 +552,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {

toolbar.addChild(button);
this.globalModuleNavigationButtons.Administration = button;
button = null;
}

// Help
Expand All @@ -588,10 +561,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
onClick: dojo.hitch(this, "showHelp")
});

phpr.tutorialAnchors.helpButton = button;

systemToolbar.addChild(button);
button = null;

// Logout
button = new dijit.form.Button({
Expand All @@ -602,12 +571,9 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
})
});

systemToolbar.addChild(button);
button = null;

// destroy cyclic refs
toolbar = null;
systemToolbar = null;
this._registerGlobalModuleNavigationListener();
},

Expand Down Expand Up @@ -944,46 +910,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
});
},

setSearchForm: function() {
// Summary:
// Add the onkeyup to the search field
if (this._searchEvent === null) {
var searchfield = phpr.viewManager.getView().searchfield;
this._searchEvent = dojo.connect(searchfield.domNode, "onkeyup",
dojo.hitch(this, "waitForSubmitSearchForm"));
this.garbageCollector.addEvent(this._searchEvent);
}
},

waitForSubmitSearchForm: function(event) {
// Summary:
// This function call the search itself After 1000ms of the last letter
// Description:
// The function will wait for 1000 ms on each keyup for try to
// call the search query when the user finish to write the text
// If the enter is presses, the suggest disapear.
// If some "user" key is presses, the function don't run.
key = event.keyCode;
if (key == dojo.keys.ENTER || key == dojo.keys.NUMPAD_ENTER) {
// hide the suggestBox and delete the time
// for not show the suggest
if (window.mytimeout) {
window.clearTimeout(window.mytimeout);
}
this.hideSuggest();
var words = phpr.viewManager.getView().searchfield.get('value');
phpr.pageManager.getActiveModule().clickResult("search");
phpr.pageManager.modifyCurrentState({search: words});
} else if (phpr.isValidInputKey(key)) {
if (window.mytimeout) {
window.clearTimeout(window.mytimeout);
}
if (phpr.viewManager.getView().searchfield.isValid()) {
window.mytimeout = window.setTimeout(dojo.hitch(this, "showSearchSuggest"), 500);
}
}
},

showSearchSuggest: function() {
// Summary:
// This function show a box with suggest or quick result of the search
Expand Down Expand Up @@ -1042,12 +968,10 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
search += "</div>";
}

this.setSuggest(search);
this.showSuggest();
}
}));
} else {
this.hideSuggest();
this.searchButton.hideSuggest();
}
},

Expand All @@ -1068,26 +992,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
}
},

clickResult: function(/*String*/type) {
if (type == 'search') {
this.hideSuggest();
}
},

showSuggest: function() {
if (phpr.viewManager.getView().searchsuggest.innerHTML !== '') {
phpr.viewManager.getView().searchsuggest.style.display = 'inline';
}
},

hideSuggest: function() {
phpr.viewManager.getView().searchsuggest.style.display = 'none';
},

setSuggest: function(html) {
phpr.viewManager.getView().searchsuggest.innerHTML = html;
},

showTagsResults: function(/*String*/tag) {
// Summary:
// This function reload the grid place with the result of the tag search
Expand All @@ -1107,8 +1011,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {

// Clean the navigation and forms buttons
phpr.tree.fadeIn();
this.hideSuggest();
this.setSearchForm();

phpr.send({
url: getDataUrl,
Expand Down
Expand Up @@ -130,7 +130,6 @@ dojo.declare(
return new dijit.MenuItem({
label: html,
onClick: function() {
dojo.publish(item.moduleName + ".clickResult", [item.resultType]);
dojo.publish(item.moduleName + ".loadResult", [item.id, item.moduleName, item.projectId]);
}
});
Expand Down
Expand Up @@ -20,17 +20,6 @@
style="height: 60px; overflow: hidden;" class="header">
<img class="left PHProjektLogo" src="{{webpath}}img/logo.png" alt="PHProjekt 6" dojoAttachPoint="PHProjektLogo"
onClick='phpr.currentProjectId = 1; dojo.publish("Project.setUrlHash", ["Project"])' />
<form dojoType="dijit.form.Form" dojoAttachPoint="searchform" name="searchform"
onsubmit='phpr.pageManager.getActiveModule().showSearchResults(phpr.viewManager.getView().searchfield.get("value"));
return false;'
style="display: inline">
<div dojoAttachPoint="searchBar" class="last right align-right searchBar">
<input dojoAttachPoint="searchfield" class="searchfield" name="searchfield" dojoType="dijit.form.ValidationTextBox"
onmousedown='this.focus(); phpr.pageManager.getActiveModule().showSuggest();' />
<div dojoAttachPoint="systemNavigation" class="systemNavigation" dojoType="dijit.Toolbar">
</div>
</div>
</form>
<div dojoAttachPoint="mainNavigation" class="right align-right mainNavigation" dojoType="dijit.Toolbar">
</div>
<div dojoAttachPoint="loadingIcon" class="right align-right loadingIcon"
Expand Down Expand Up @@ -82,10 +71,6 @@
</div>
</div>
</div>
<!-- Suggest seacrh -->
<div dojoAttachPoint="searchsuggest"
style="z-index: 100; display: inline" class="searchsuggest">
</div>
<!-- Help -->
<div dojoType="dijit.Dialog" dojoAttachPoint="helpDialog" class="helpDialog" title="" draggable="false"
style="background-color: white; width: auto; height: auto;">
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions phprojekt/application/Project/Views/dojo/scripts/Main.js
Expand Up @@ -58,8 +58,6 @@ dojo.declare("phpr.Project.Main", phpr.Default.Main, {
this.destroyGrid();

this.setSubmoduleNavigation('BasicData');
this.hideSuggest();
this.setSearchForm();
phpr.tree.fadeIn();

this.form = new this.formBasicDataWidget(this, phpr.currentProjectId, phpr.module, {}, view.centerMainContent);
Expand Down
7 changes: 0 additions & 7 deletions phprojekt/htdocs/css/themes/phprojekt/Common.css
Expand Up @@ -348,13 +348,6 @@ h1,h2,h3,h4,h5,h6 {
background-color: #fff;
}

.phprojekt .results a {
font-weight: bold;
color: #294064;
text-decoration: none;
margin-left: 10px;
margin-top: 10px;
margin-bottom: 10px;
}

.phprojekt .results span {
Expand Down
10 changes: 0 additions & 10 deletions phprojekt/htdocs/css/themes/phprojekt/Menu_rtl.css

This file was deleted.

0 comments on commit 9770360

Please sign in to comment.