Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
web-apps
Commits
2461b1d7
Commit
2461b1d7
authored
Nov 21, 2016
by
Maxim Kadushkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[common] depends moved for LocalStorage
parent
12ca6e79
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
58 deletions
+61
-58
apps/common/main/lib/util/LocalStorage.js
apps/common/main/lib/util/LocalStorage.js
+60
-58
apps/documenteditor/main/app/controller/Main.js
apps/documenteditor/main/app/controller/Main.js
+1
-0
No files found.
apps/common/main/lib/util/LocalStorage.js
View file @
2461b1d7
...
@@ -38,71 +38,73 @@
...
@@ -38,71 +38,73 @@
*
*
*/
*/
Common
.
localStorage
=
new
(
function
()
{
define
([
'
gateway
'
],
function
()
{
var
_storeName
,
_filter
;
Common
.
localStorage
=
new
(
function
()
{
var
_store
=
{};
var
_storeName
,
_filter
;
var
_store
=
{};
var
ongetstore
=
function
(
data
)
{
var
ongetstore
=
function
(
data
)
{
if
(
data
.
type
==
'
localstorage
'
)
{
if
(
data
.
type
==
'
localstorage
'
)
{
_store
=
data
.
keys
;
_store
=
data
.
keys
;
}
}
};
};
Common
.
Gateway
.
on
(
'
internalcommand
'
,
ongetstore
);
Common
.
Gateway
.
on
(
'
internalcommand
'
,
ongetstore
);
var
_refresh
=
function
()
{
var
_refresh
=
function
()
{
if
(
!
_lsAllowed
)
if
(
!
_lsAllowed
)
Common
.
Gateway
.
internalMessage
(
'
localstorage
'
,
{
cmd
:
'
get
'
,
keys
:
_filter
});
Common
.
Gateway
.
internalMessage
(
'
localstorage
'
,
{
cmd
:
'
get
'
,
keys
:
_filter
});
};
};
var
_save
=
function
()
{
var
_save
=
function
()
{
if
(
!
_lsAllowed
)
if
(
!
_lsAllowed
)
Common
.
Gateway
.
internalMessage
(
'
localstorage
'
,
{
cmd
:
'
set
'
,
keys
:
_store
});
Common
.
Gateway
.
internalMessage
(
'
localstorage
'
,
{
cmd
:
'
set
'
,
keys
:
_store
});
};
};
var
_setItem
=
function
(
name
,
value
,
just
)
{
var
_setItem
=
function
(
name
,
value
,
just
)
{
if
(
_lsAllowed
)
{
if
(
_lsAllowed
)
{
localStorage
.
setItem
(
name
,
value
);
localStorage
.
setItem
(
name
,
value
);
}
else
{
}
else
{
_store
[
name
]
=
value
;
_store
[
name
]
=
value
;
if
(
just
===
true
)
{
if
(
just
===
true
)
{
Common
.
Gateway
.
internalMessage
(
'
localstorage
'
,
{
Common
.
Gateway
.
internalMessage
(
'
localstorage
'
,
{
cmd
:
'
set
'
,
cmd
:
'
set
'
,
keys
:
{
keys
:
{
name
:
value
name
:
value
}
}
});
});
}
}
}
}
};
};
var
_getItem
=
function
(
name
)
{
var
_getItem
=
function
(
name
)
{
if
(
_lsAllowed
)
if
(
_lsAllowed
)
return
localStorage
.
getItem
(
name
);
return
localStorage
.
getItem
(
name
);
else
else
return
_store
[
name
]
===
undefined
?
null
:
_store
[
name
];
return
_store
[
name
]
===
undefined
?
null
:
_store
[
name
];
};
};
try
{
try
{
var
_lsAllowed
=
!!
window
.
localStorage
;
var
_lsAllowed
=
!!
window
.
localStorage
;
}
catch
(
e
)
{
}
catch
(
e
)
{
_lsAllowed
=
false
;
_lsAllowed
=
false
;
}
}
return
{
return
{
getId
:
function
()
{
getId
:
function
()
{
return
_storeName
;
return
_storeName
;
},
},
setId
:
function
(
name
)
{
setId
:
function
(
name
)
{
_storeName
=
name
;
_storeName
=
name
;
},
},
getItem
:
_getItem
,
getItem
:
_getItem
,
setItem
:
_setItem
,
setItem
:
_setItem
,
setKeysFilter
:
function
(
value
)
{
setKeysFilter
:
function
(
value
)
{
_filter
=
value
;
_filter
=
value
;
},
},
sync
:
_refresh
,
sync
:
_refresh
,
save
:
_save
save
:
_save
};
};
})();
})();
\ No newline at end of file
});
apps/documenteditor/main/app/controller/Main.js
View file @
2461b1d7
...
@@ -49,6 +49,7 @@ define([
...
@@ -49,6 +49,7 @@ define([
'
common/main/lib/controller/Fonts
'
,
'
common/main/lib/controller/Fonts
'
,
'
common/main/lib/collection/TextArt
'
,
'
common/main/lib/collection/TextArt
'
,
'
common/main/lib/view/OpenDialog
'
,
'
common/main/lib/view/OpenDialog
'
,
'
common/main/lib/util/LocalStorage
'
,
'
documenteditor/main/app/collection/ShapeGroups
'
,
'
documenteditor/main/app/collection/ShapeGroups
'
,
'
documenteditor/main/app/collection/EquationGroups
'
'
documenteditor/main/app/collection/EquationGroups
'
],
function
()
{
],
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment